This commit is contained in:
shuo.wang
2025-04-10 10:35:57 +08:00
parent e4af38601a
commit 2cbe1758e5

View File

@@ -873,6 +873,21 @@ public class PointServiceImpl implements PointService {
if (Objects.isNull(lineInfo)) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
if(request.getShopId()==null){
PointDetailInfoDO pointDetailInfo = MiniAddPointRequest.convertDO(request);
PointInfoDO pointInfo = MiniAddPointRequest.convertPointDO(request);
pointInfo.setRegionId(lineInfo.getRegionId());
pointInfo.setLineId(lineId);
pointInfo.setSelectStatus(SelectStatusEnum.SELECT_STATUS_0.getCode());
pointInfo.setPointSource(PointSourceEnum.POINT_SOURCE_2.getCode());
pointInfo.setPointCode(generateCode());
Long pointId = pointInfoDAO.addPointInfo(pointInfo);
pointDetailInfo.setPointId(pointId);
pointDetailInfoDAO.addPointDetailInfo(pointDetailInfo);
//推送铺位至三方平台
extracted(request, lineInfo, pointId, pointInfo);
return pointId;
}
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
@@ -910,6 +925,19 @@ public class PointServiceImpl implements PointService {
updatePoint.setId(pointId);
updatePoint.setShopId(shopInfo.getId());
pointInfoDAO.updatePointInfo(updatePoint);
//推送铺位至三方平台
extracted(request, lineInfo, pointId, pointInfo);
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfo.getUsername());
map.put("partnerMobile", lineInfo.getMobile());
map.put("pointName", pointInfo.getPointName());
commonService.sendQWMessage(Collections.singletonList(shopInfo.getInvestmentManager()),
MessageEnum.MESSAGE_51,
map);
return pointId;
}
private void extracted(MiniAddPointRequest request, LineInfoDO lineInfo, Long pointId, PointInfoDO pointInfo) {
//推送铺位至三方平台
BerthOperationRequest request1 = new BerthOperationRequest();
request1.setOpType(OpTypeEnum.INSERT.getCode());
@@ -922,14 +950,6 @@ public class PointServiceImpl implements PointService {
request1.setAddress(pointInfo.getAddress());
request1.setLocation(request.getLocation());
thirdOpportunityService.berthOperation(request1);
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfo.getUsername());
map.put("partnerMobile", lineInfo.getMobile());
map.put("pointName", pointInfo.getPointName());
commonService.sendQWMessage(Collections.singletonList(shopInfo.getInvestmentManager()),
MessageEnum.MESSAGE_51,
map);
return pointId;
}
@Override