From 4542242c42d990b1dc284ca422898f7245c11726 Mon Sep 17 00:00:00 2001 From: "shuo.wang" Date: Wed, 15 Jan 2025 18:16:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=BC=80=E5=BA=97=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=94=B9=E9=80=A0=E6=94=AF=E6=8C=81=E6=9F=A5=E8=AF=A2=E6=88=91?= =?UTF-8?q?=E7=AE=A1=E8=BE=96=E6=88=91=E8=B4=9F=E8=B4=A3=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cool/store/dao/ShopInfoDAO.java | 4 +-- .../com/cool/store/dao/ShopStageInfoDAO.java | 35 ++++++++----------- .../com/cool/store/mapper/ShopInfoMapper.java | 2 +- .../main/resources/mapper/ShopInfoMapper.xml | 15 ++++---- .../cool/store/request/BranchShopRequest.java | 5 +++ .../store/service/impl/ShopServiceImpl.java | 14 ++++---- .../webb/PreparationController.java | 3 +- 7 files changed, 42 insertions(+), 36 deletions(-) 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