diff --git a/coolstore-partner-model/src/main/java/com/cool/store/vo/desk/PreparationCommonPendingVO.java b/coolstore-partner-model/src/main/java/com/cool/store/vo/desk/PreparationCommonPendingVO.java index fa28669fa..03617a6c9 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/vo/desk/PreparationCommonPendingVO.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/vo/desk/PreparationCommonPendingVO.java @@ -15,6 +15,12 @@ public class PreparationCommonPendingVO { private String storeName; @ApiModelProperty("门店负责人名称") private String shopManagerUserName; + @ApiModelProperty("门店编码") + private String storeNum; + @ApiModelProperty("店铺地址") + private String shopAddress; + @ApiModelProperty("督导") + private String investmentManager; @ApiModelProperty("加盟商名称") private String partnerName; @ApiModelProperty("手机号") diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DeskServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DeskServiceImpl.java index 389446e4c..7cb4ebaa8 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DeskServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DeskServiceImpl.java @@ -32,6 +32,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; import static com.cool.store.enums.point.ShopSubStageStatusEnum.*; @@ -79,6 +80,8 @@ public class DeskServiceImpl implements DeskService { private DecorationDesignInfoDAO decorationDesignInfoDAO; @Autowired private AcceptanceInfoDAO acceptanceInfoDAO; + @Autowired + private PointInfoDAO pointInfoDAO; @Override public PageInfo intendPendingList(Integer pageNum, Integer pageSize, String userId) { @@ -481,7 +484,10 @@ public class DeskServiceImpl implements DeskService { //将lines 转为map Map lineMap = lines.stream().collect(Collectors.toMap(PlanLineDTO::getLineId, line -> line)); + List pointId = shopInfoList.stream().filter(x -> Objects.nonNull(x.getPointId())).map(ShopInfoDO::getPointId).collect(Collectors.toList()); + List pointListByIds = pointInfoDAO.getPointListByIds(pointId); + Map pointMap = pointListByIds.stream().collect(Collectors.toMap(PointInfoDO::getId, Function.identity())); List regionIds = shopInfoList.stream().map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList()); List developmentManagers = shopInfoList.stream().filter(x -> StringUtil.isNotEmpty(x.getShopManagerUserId())).map(ShopInfoDO::getShopManagerUserId).distinct().collect(Collectors.toList()); Map userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers); @@ -538,10 +544,19 @@ public class DeskServiceImpl implements DeskService { PreparationCommonPendingVO preparationCommonPendingVO = new PreparationCommonPendingVO(); preparationCommonPendingVO.setLineId(x.getLineId()); preparationCommonPendingVO.setShopId(x.getShopId()); + ShopInfoDO shopInfoDO = shopInfoMap.getOrDefault(x.getShopId(), new ShopInfoDO()); + if (shopInfoDO != null) { + PointInfoDO pointInfoDO = pointMap.get(shopInfoDO.getId()); + if(pointInfoDO != null) { + preparationCommonPendingVO.setShopAddress(pointInfoDO.getAddress()); + } + preparationCommonPendingVO.setStoreNum(shopInfoDO.getStoreNum()); + } + preparationCommonPendingVO.setInvestmentManager(lineMap.get(x.getLineId()).getInvestmentManagerName()); preparationCommonPendingVO.setStage(x.getShopStage()); preparationCommonPendingVO.setSubStage(x.getShopSubStage()); preparationCommonPendingVO.setSubStageStatus(x.getShopSubStageStatus()); - ShopInfoDO shopInfoDO = shopInfoMap.getOrDefault(x.getShopId(), new ShopInfoDO()); + if (ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage().equals(shopSubStageEnum.getShopSubStage())) { preparationCommonPendingVO.setSubmitTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START, finalShopPayDoMap.getOrDefault(x.getShopId(), new LinePayDO()).getCreateTime())); } @@ -616,7 +631,10 @@ public class DeskServiceImpl implements DeskService { List lineIds = shopInfoList.stream().map(ShopInfoDO::getLineId).collect(Collectors.toList()); List lines = lineInfoDAO.getLines(lineIds); + List pointId = shopInfoList.stream().filter(x -> Objects.nonNull(x.getPointId())).map(ShopInfoDO::getPointId).collect(Collectors.toList()); + List pointListByIds = pointInfoDAO.getPointListByIds(pointId); + Map pointMap = pointListByIds.stream().collect(Collectors.toMap(PointInfoDO::getId, Function.identity())); //将shopInfoList 转为map Map shopInfoMap = shopInfoList.stream().collect(Collectors.toMap(ShopInfoDO::getId, shop -> shop)); //将lines 转为map @@ -631,6 +649,13 @@ public class DeskServiceImpl implements DeskService { operationLogDOList.forEach(x -> { PreparationCommonPendingVO preparationCommonPendingVO = new PreparationCommonPendingVO(); ShopInfoDO shopInfoDO = shopInfoMap.getOrDefault(x.getShopId(), new ShopInfoDO()); + if (shopInfoDO != null) { + PointInfoDO pointInfoDO = pointMap.get(shopInfoDO.getId()); + if(pointInfoDO != null) { + preparationCommonPendingVO.setShopAddress(pointInfoDO.getAddress()); + } + preparationCommonPendingVO.setStoreNum(shopInfoDO.getStoreNum()); + } preparationCommonPendingVO.setLineId(shopInfoDO.getLineId()); preparationCommonPendingVO.setShopId(x.getShopId()); preparationCommonPendingVO.setSubStage(x.getShopSubStage());