diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopInfoDAO.java b/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopInfoDAO.java index aaff2c240..ba6721d8d 100644 --- a/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopInfoDAO.java +++ b/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopInfoDAO.java @@ -162,8 +162,8 @@ public class ShopInfoDAO { return shopInfoMapper.ListByCondition(request); } - public List ListByBranchShopRequest(BranchShopRequest request){ - return shopInfoMapper.ListByBranchShopRequest(request); + public List ListByBranchShopRequest(BranchShopRequest request,String userId){ + return shopInfoMapper.ListByBranchShopRequest(request,userId); } public Long getRegionIdByid(Long shopId){ return shopInfoMapper.getRegionIdByid(shopId); diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopStageInfoDAO.java b/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopStageInfoDAO.java index 6f2087c87..2553fa605 100644 --- a/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopStageInfoDAO.java +++ b/coolstore-partner-dao/src/main/java/com/cool/store/dao/ShopStageInfoDAO.java @@ -176,16 +176,7 @@ public class ShopStageInfoDAO { return CommonConstants.ZERO; } List shopStageList = Lists.newArrayList(); - for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) { - String remark = subStageStatus.getShopSubStageName() + CommonConstants.PATH_BAR + subStageStatus.getShopSubStageStatusName(); - ShopStageInfoDO shopStageInfo = new ShopStageInfoDO(); - shopStageInfo.setShopId(shopId); - shopStageInfo.setShopSubStage(subStageStatus.getShopSubStageEnum().getShopSubStage()); - shopStageInfo.setShopSubStageStatus(subStageStatus.getShopSubStageStatus()); - shopStageInfo.setRemark(remark); - shopStageInfo.setIsTerminated(subStageStatus.isTerminated()); - shopStageList.add(shopStageInfo); - } + extracted(subStageStatusList, shopId, shopStageList); return shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList); } @@ -203,21 +194,25 @@ public class ShopStageInfoDAO { } List shopStageList = Lists.newArrayList(); for (Long shopId : shopIds) { - for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) { - String remark = subStageStatus.getShopSubStageName() + CommonConstants.PATH_BAR + subStageStatus.getShopSubStageStatusName(); - ShopStageInfoDO shopStageInfo = new ShopStageInfoDO(); - shopStageInfo.setShopId(shopId); - shopStageInfo.setShopSubStage(subStageStatus.getShopSubStageEnum().getShopSubStage()); - shopStageInfo.setShopSubStageStatus(subStageStatus.getShopSubStageStatus()); - shopStageInfo.setRemark(remark); - shopStageInfo.setIsTerminated(subStageStatus.isTerminated()); - shopStageList.add(shopStageInfo); - } + extracted(subStageStatusList, shopId, shopStageList); } return shopStageInfoMapper.batchUpdateByShopIdsAndSubStageStatus(shopIds, shopStageList); } + private static void extracted(List subStageStatusList, Long shopId, List shopStageList) { + for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) { + String remark = subStageStatus.getShopSubStageName() + CommonConstants.PATH_BAR + subStageStatus.getShopSubStageStatusName(); + ShopStageInfoDO shopStageInfo = new ShopStageInfoDO(); + shopStageInfo.setShopId(shopId); + shopStageInfo.setShopSubStage(subStageStatus.getShopSubStageEnum().getShopSubStage()); + shopStageInfo.setShopSubStageStatus(subStageStatus.getShopSubStageStatus()); + shopStageInfo.setRemark(remark); + shopStageInfo.setIsTerminated(subStageStatus.isTerminated()); + shopStageList.add(shopStageInfo); + } + } + /** * 更新子阶段到未开始状态 * @param shopId diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/mapper/ShopInfoMapper.java b/coolstore-partner-dao/src/main/java/com/cool/store/mapper/ShopInfoMapper.java index f6b02ff28..c068e7a4a 100644 --- a/coolstore-partner-dao/src/main/java/com/cool/store/mapper/ShopInfoMapper.java +++ b/coolstore-partner-dao/src/main/java/com/cool/store/mapper/ShopInfoMapper.java @@ -86,7 +86,7 @@ public interface ShopInfoMapper extends Mapper { List ListByCondition(@Param("request") PreparationRequest request); - List ListByBranchShopRequest(@Param("request") BranchShopRequest request); + List ListByBranchShopRequest(@Param("request") BranchShopRequest request,@Param("userId") String userId); Long getRegionIdByid(@Param("shopId") Long shopId); diff --git a/coolstore-partner-dao/src/main/resources/mapper/ShopInfoMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/ShopInfoMapper.xml index e4d8219c1..fc7065e28 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/ShopInfoMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/ShopInfoMapper.xml @@ -294,12 +294,6 @@ #{regionId} - - and a.region_id in - - #{regionId} - - and a.investment_manager = #{request.investmentManagerUserId} @@ -334,6 +328,15 @@ #{wantShopAreaId} + + and a.investment_manager = #{userId} + + + and a.region_id in + + #{regionId} + + order by a.update_time desc