From 3b258cd36492b8c765dfeeb4b5365bbda9eb6cdf Mon Sep 17 00:00:00 2001 From: "shuo.wang" Date: Wed, 8 May 2024 15:05:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=90=E8=90=A5=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E5=88=97=E8=A1=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/LineInfoMapper.xml | 2 +- .../mapper/OpeningOperationPlanMapper.xml | 53 ++++++++--------- .../dto/openPreparation/PlanLineDTO.java | 3 +- .../cool/store/request/PlanListRequest.java | 4 +- .../store/vo/OpeningOperationPlanListVO.java | 9 +-- .../service/impl/FirstOrderServiceImp.java | 6 ++ .../impl/OpeningOperationPlanImpl.java | 57 +++++++++++-------- 7 files changed, 72 insertions(+), 62 deletions(-) diff --git a/coolstore-partner-dao/src/main/resources/mapper/LineInfoMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/LineInfoMapper.xml index c34d93bf4..2af874d0d 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/LineInfoMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/LineInfoMapper.xml @@ -494,7 +494,7 @@ diff --git a/coolstore-partner-model/src/main/java/com/cool/store/dto/openPreparation/PlanLineDTO.java b/coolstore-partner-model/src/main/java/com/cool/store/dto/openPreparation/PlanLineDTO.java index 6a6873ba4..04b2a64e7 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/dto/openPreparation/PlanLineDTO.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/dto/openPreparation/PlanLineDTO.java @@ -17,7 +17,8 @@ public class PlanLineDTO { private String mobile; @ApiModelProperty("加盟商姓名") private String username; - + @ApiModelProperty("招商经理Id") + private String investmentManagerId; @ApiModelProperty("招商经理姓名") private String investmentManagerName; } diff --git a/coolstore-partner-model/src/main/java/com/cool/store/request/PlanListRequest.java b/coolstore-partner-model/src/main/java/com/cool/store/request/PlanListRequest.java index f05115208..ce9b0bde4 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/request/PlanListRequest.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/request/PlanListRequest.java @@ -19,9 +19,9 @@ public class PlanListRequest { @ApiModelProperty("店铺名称") private String shopName; @ApiModelProperty("起始日期") - private String planStartDate; + private Date planStartDate; @ApiModelProperty("结束日期") - private String planEndDate; + private Date planEndDate; @ApiModelProperty("选择区域") private List regionIds; @ApiModelProperty("审核状态") diff --git a/coolstore-partner-model/src/main/java/com/cool/store/vo/OpeningOperationPlanListVO.java b/coolstore-partner-model/src/main/java/com/cool/store/vo/OpeningOperationPlanListVO.java index 955780cf1..35f7cfaaa 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/vo/OpeningOperationPlanListVO.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/vo/OpeningOperationPlanListVO.java @@ -27,23 +27,18 @@ public class OpeningOperationPlanListVO { @ApiModelProperty("开店负责人") private String shopManagerName; - @ApiModelProperty("加盟商姓名") private String partnerName; @ApiModelProperty("手机号码") private String mobile; - @ApiModelProperty("所属大区") - private String bigName; - - @ApiModelProperty("所属战区") - private String fightName; + @ApiModelProperty("所属区域") + private String region; @ApiModelProperty("招商经理名字") private String investmentManagerName; - @ApiModelProperty("督导") private String supervisorName; diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FirstOrderServiceImp.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FirstOrderServiceImp.java index 694c5867a..fbe6c670f 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FirstOrderServiceImp.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/FirstOrderServiceImp.java @@ -113,6 +113,12 @@ public class FirstOrderServiceImp implements FirstOrderService { throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL); } FirstOrderDTO order = firstOrderDAO.selectFirstOrderByShopId(shopId); + ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15); + if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())) + { + order.setFirstOrderSubStage( ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus()); + return order; + } if (Objects.nonNull(order)) { try { ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId()); diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/OpeningOperationPlanImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/OpeningOperationPlanImpl.java index d55d59aab..d9a5af61c 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/OpeningOperationPlanImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/OpeningOperationPlanImpl.java @@ -64,6 +64,8 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService { private ShopInfoDAO shopInfoDAO; @Resource private CoolStoreStartFlowService coolStoreStartFlowService; + @Resource + private LineInfoDAO lineInfoDAO; @Override @Transactional(rollbackFor = Exception.class) @@ -113,7 +115,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService { throw new ServiceException(ErrorCodeEnum.SHOP_ID_IS_NULL); } OpeningOperationPlanDO openingOperationPlanDO = openingOperationPlanDAO.selectByShopId(shopId); - if (Objects.nonNull(openingOperationPlanDO) ) { + if (Objects.nonNull(openingOperationPlanDO)) { OpeningOperationPlanVO openingOperationPlanVO = new OpeningOperationPlanVO(openingOperationPlanDO); String preparationUserIds = openingOperationPlanDO.getPreparationUserIds(); List stream = Arrays.stream(preparationUserIds.split(CommonConstants.COMMA)).collect(Collectors.toList()); @@ -134,26 +136,41 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService { public PageInfo getPlanListPage(PlanListRequest request) { log.info("getPlanListPage request:{}", JSONObject.toJSONString(request)); PageHelper.startPage(request.getPageNumber(), request.getPageSize()); - //去shop_info表查询店铺名字,店铺code,开店负责人id,督导id,区域id,lineinfo 加盟商name,手机号,招商经理id,open_plan,提交时间,审核状态 - //TODO 拆表 产品沟通限定时间 + //不指定时间为3个月数据 去shop_info表查询店铺名字,店铺code,开店负责人id,督导id,区域id,open_plan,提交时间,审核状态 List openPlanShopInfoDTOS = openingOperationPlanDAO.getOpenPlanShopListByCondition(request); + //lineinfo 加盟商name,手机号,招商经理name, + if (CollectionUtils.isEmpty(openPlanShopInfoDTOS)) { + log.error("查询运营方案列表没有数据"); + return null; + } + List lines = openPlanShopInfoDTOS.stream().map(OpenPlanShopInfoDTO::getLineId).collect(Collectors.toList()); + List lineInfos = lineInfoDAO.getLines(lines); + Map lineInfoMap = lineInfos.stream().collect(Collectors.toMap(PlanLineDTO::getLineId, dto -> dto)); + for (OpenPlanShopInfoDTO openPlanShopInfoDTO : openPlanShopInfoDTOS) { + openPlanShopInfoDTO.setPartnerName(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getUsername()); + openPlanShopInfoDTO.setMobile(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getMobile()); + openPlanShopInfoDTO.setInvestmentManagerId(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getInvestmentManagerId()); + } PageInfo pageInfo = new PageInfo<>(openPlanShopInfoDTOS); - //开店负责人id,督导id,招商经理id // TODO id 为null过滤 + //开店负责人id,督导id,招商经理id // Set userIdset = openPlanShopInfoDTOS.stream() + .filter(dto -> dto.getShopManagerUserId() != null) .map(OpenPlanShopInfoDTO::getShopManagerUserId) .collect(Collectors.toSet()); userIdset.addAll(openPlanShopInfoDTOS.stream() + .filter(dto -> dto.getSupervisorUserId() != null) .map(OpenPlanShopInfoDTO::getSupervisorUserId) .collect(Collectors.toSet())); userIdset.addAll(openPlanShopInfoDTOS.stream() + .filter(dto -> dto.getInvestmentManagerId() != null) .map(OpenPlanShopInfoDTO::getInvestmentManagerId) .collect(Collectors.toSet())); - List userlist = new ArrayList<>(); - userlist.addAll(userIdset); - Map vonameMap = enterpriseUserDAO.getUserMap(userlist); + List userIdList = new ArrayList<>(userIdset); + Map vonameMap = enterpriseUserDAO.getUserNameMap(userIdList); log.info("getPlanListPage vonameMap:{}", JSONObject.toJSONString(vonameMap)); //region - List regionIds = openPlanShopInfoDTOS.stream().map(OpenPlanShopInfoDTO::getRegionId).collect(Collectors.toList()); + List regionIds = openPlanShopInfoDTOS.stream() + .filter(dto -> dto.getRegionId() != null).map(OpenPlanShopInfoDTO::getRegionId).collect(Collectors.toList()); Map regionNameMap = regionService.getBelongWarRegionNameMap(regionIds); List openingOperationPlanListVOList = new ArrayList<>(); openPlanShopInfoDTOS.forEach(x -> { @@ -163,23 +180,13 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService { openingOperationPlanListVO.setStoreNum(x.getStoreNum()); openingOperationPlanListVO.setPartnerName(x.getPartnerName()); openingOperationPlanListVO.setMobile(x.getMobile()); - //TODO - String[] split = regionNameMap.getOrDefault(x.getRegionId(), "").split("-"); - if (split.length > 0) { - openingOperationPlanListVO.setBigName(split[0]); - openingOperationPlanListVO.setFightName(split[1]); - } - if (!StringUtils.isEmpty(x.getInvestmentManagerId())) { - openingOperationPlanListVO.setInvestmentManagerName - (vonameMap.get(x.getInvestmentManagerId()).getName()); - } - if (!StringUtils.isEmpty(x.getShopManagerUserId())) { - openingOperationPlanListVO.setShopManagerName - (vonameMap.get(x.getInvestmentManagerId()).getName()); - } - if (!StringUtils.isEmpty(x.getSupervisorUserId())) { - openingOperationPlanListVO.setSupervisorName(vonameMap.get(x.getSupervisorUserId()).getName()); - } + openingOperationPlanListVO.setRegion(regionNameMap.get(x.getRegionId())); + openingOperationPlanListVO.setInvestmentManagerName + (vonameMap.get(x.getInvestmentManagerId())); + openingOperationPlanListVO.setShopManagerName + (vonameMap.get(x.getInvestmentManagerId())); + openingOperationPlanListVO.setSupervisorName( + vonameMap.get(x.getSupervisorUserId())); openingOperationPlanListVO.setSubmissionTime(x.getSubmissionTime()); openingOperationPlanListVO.setResultType(x.getResultType()); openingOperationPlanListVOList.add(openingOperationPlanListVO);