From 0c3e3048ef4fa82b1be1d0d40d76e6e67e2834c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E7=AB=B9=E7=BA=A2?= Date: Mon, 3 Nov 2025 16:17:08 +0800 Subject: [PATCH] feat:handleDecorationTeam --- .../UpdateConstructionTeamRequest.java | 17 ++++++++++++++++ .../ShopDecorationAssignListener.java | 7 ++++++- .../service/DecorationHandleService.java | 11 +++++++++- .../impl/DecorationHandleServiceImpl.java | 20 ++++++++++++++++--- .../webb/DecorationAllocationController.java | 13 +++++++++--- 5 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 coolstore-partner-model/src/main/java/com/cool/store/request/decoration/UpdateConstructionTeamRequest.java diff --git a/coolstore-partner-model/src/main/java/com/cool/store/request/decoration/UpdateConstructionTeamRequest.java b/coolstore-partner-model/src/main/java/com/cool/store/request/decoration/UpdateConstructionTeamRequest.java new file mode 100644 index 000000000..41ace8c8b --- /dev/null +++ b/coolstore-partner-model/src/main/java/com/cool/store/request/decoration/UpdateConstructionTeamRequest.java @@ -0,0 +1,17 @@ +package com.cool.store.request.decoration; + +import lombok.Data; + +/** + * @Author suzhuhong + * @Date 2025/11/3 16:00 + * @Version 1.0 + */ +@Data +public class UpdateConstructionTeamRequest { + + private Long id; + + private Long teamId; + +} diff --git a/coolstore-partner-service/src/main/java/com/cool/store/mq/consumer/listener/ShopDecorationAssignListener.java b/coolstore-partner-service/src/main/java/com/cool/store/mq/consumer/listener/ShopDecorationAssignListener.java index b394b6872..e465de67a 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/mq/consumer/listener/ShopDecorationAssignListener.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/mq/consumer/listener/ShopDecorationAssignListener.java @@ -6,8 +6,10 @@ import com.aliyun.openservices.ons.api.ConsumeContext; import com.aliyun.openservices.ons.api.Message; import com.aliyun.openservices.ons.api.MessageListener; import com.cool.store.constants.CommonConstants; +import com.cool.store.dao.decoration.ShopDecorationAssignDAO; import com.cool.store.dto.store.StoreUserPositionDTO; import com.cool.store.dto.store.StoreUserUpdateDTO; +import com.cool.store.entity.decoration.ShopDecorationAssignDO; import com.cool.store.service.DecorationHandleService; import com.cool.store.utils.RedisUtilPool; import lombok.extern.slf4j.Slf4j; @@ -33,6 +35,8 @@ public class ShopDecorationAssignListener implements MessageListener { public RedisUtilPool redisUtilPool; @Resource DecorationHandleService decorationHandleService; + @Resource + ShopDecorationAssignDAO shopDecorationAssignDAO; @Override public Action consume(Message message, ConsumeContext context) { @@ -45,7 +49,8 @@ public class ShopDecorationAssignListener implements MessageListener { boolean lock = redisUtilPool.setNxExpire(lockKey, message.getMsgID(), CommonConstants.NORMAL_LOCK_TIMES); if(lock){ try { - decorationHandleService.handleDecorationTeam(Long.valueOf(text)); + ShopDecorationAssignDO shopDecorationAssignDO = shopDecorationAssignDAO.getById(Long.valueOf(text)); + decorationHandleService.handleDecorationTeam(shopDecorationAssignDO); }catch (Exception e){ log.error("ShopDecorationAssignListener consume error",e); return Action.ReconsumeLater; diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/DecorationHandleService.java b/coolstore-partner-service/src/main/java/com/cool/store/service/DecorationHandleService.java index 2c8edcaa6..5461f94a8 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/DecorationHandleService.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/DecorationHandleService.java @@ -4,8 +4,10 @@ import com.cool.store.common.PageBasicInfo; import com.cool.store.dto.ShopSignerInfoDTO; import com.cool.store.dto.decoration.DecorationListDTO; import com.cool.store.dto.decoration.DecorationTeamDTO; +import com.cool.store.entity.decoration.ShopDecorationAssignDO; import com.cool.store.request.decoration.AddTeamRequest; import com.cool.store.request.decoration.DecorationListRequest; +import com.cool.store.request.decoration.UpdateConstructionTeamRequest; import com.cool.store.request.decoration.UpdateTeamRequest; import com.github.pagehelper.PageInfo; @@ -59,7 +61,7 @@ public interface DecorationHandleService { * @param teamId * @return */ - Boolean handleDecorationTeam(Long decorationAssignId); + Boolean handleDecorationTeam(ShopDecorationAssignDO shopDecorationAssignDO); /** * 列表 @@ -75,6 +77,13 @@ public interface DecorationHandleService { */ ShopSignerInfoDTO getShopSignerInfo(Long shopId); + /** + * 更新施工团队 + * @param request + * @return + */ + Boolean updateConstructionTeam(UpdateConstructionTeamRequest request); + diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DecorationHandleServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DecorationHandleServiceImpl.java index 949d94eff..32501daf2 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DecorationHandleServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DecorationHandleServiceImpl.java @@ -1,5 +1,6 @@ package com.cool.store.service.impl; +import com.alibaba.fastjson.JSONObject; import com.cool.store.common.PageBasicInfo; import com.cool.store.dao.*; import com.cool.store.dao.decoration.DecorationTeamConfigDAO; @@ -21,6 +22,7 @@ import com.cool.store.enums.point.ShopSubStageStatusEnum; import com.cool.store.exception.ServiceException; import com.cool.store.request.decoration.AddTeamRequest; import com.cool.store.request.decoration.DecorationListRequest; +import com.cool.store.request.decoration.UpdateConstructionTeamRequest; import com.cool.store.request.decoration.UpdateTeamRequest; import com.cool.store.service.DecorationHandleService; import com.cool.store.service.HqtAPIService; @@ -155,16 +157,15 @@ public class DecorationHandleServiceImpl implements DecorationHandleService { } @Override - public Boolean handleDecorationTeam(Long decorationAssignId) { + public Boolean handleDecorationTeam(ShopDecorationAssignDO shopDecorationAssign) { //先查询 - ShopDecorationAssignDO shopDecorationAssign = shopDecorationAssignDAO.getById(decorationAssignId); if (shopDecorationAssign == null){ log.info("handleDecorationTeam_error data not exist"); return Boolean.FALSE; } //如果门店是已经分配状态 则不能再次分配 if (DecorationDescStatus.ASSIGNED.getCode().equals(shopDecorationAssign.getDecorationDescStatus())){ - log.info("handleDecorationTeam id:{},门店已分配",decorationAssignId); + log.info("handleDecorationTeam id:{},门店已分配", JSONObject.toJSONString(shopDecorationAssign)); } //没有分配的门店 开始分配 ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(shopDecorationAssign.getShopId()); @@ -223,6 +224,19 @@ public class DecorationHandleServiceImpl implements DecorationHandleService { return shopSignerInfoDTO; } + @Override + public Boolean updateConstructionTeam(UpdateConstructionTeamRequest request) { + //查询待分配门店信息 + ShopDecorationAssignDO shopDecorationAssign = shopDecorationAssignDAO.getById(request.getId()); + if (shopDecorationAssign == null){ + log.info("handleDecorationTeam_error data not exist"); + return Boolean.FALSE; + } + shopDecorationAssign.setDecorationTeamId(request.getTeamId()); + handleDecorationTeam(shopDecorationAssign); + return Boolean.TRUE; + } + public String getNextNumber() { Long current = redisUtilPool.incrby("counter_key", 1); diff --git a/coolstore-partner-web/src/main/java/com/cool/store/controller/webb/DecorationAllocationController.java b/coolstore-partner-web/src/main/java/com/cool/store/controller/webb/DecorationAllocationController.java index 83acdeacf..3448e7398 100644 --- a/coolstore-partner-web/src/main/java/com/cool/store/controller/webb/DecorationAllocationController.java +++ b/coolstore-partner-web/src/main/java/com/cool/store/controller/webb/DecorationAllocationController.java @@ -6,6 +6,7 @@ import com.cool.store.dto.decoration.DecorationListDTO; import com.cool.store.dto.decoration.DecorationTeamDTO; import com.cool.store.request.decoration.AddTeamRequest; import com.cool.store.request.decoration.DecorationListRequest; +import com.cool.store.request.decoration.UpdateConstructionTeamRequest; import com.cool.store.request.decoration.UpdateTeamRequest; import com.cool.store.response.ResponseResult; import com.cool.store.service.DecorationHandleService; @@ -50,7 +51,6 @@ public class DecorationAllocationController { return ResponseResult.success(decorationHandleService.deleteByTeamId(teamId)); } - @PostMapping("/listByCondition") @ApiOperation("查询团队") public ResponseResult> listByCondition(@RequestBody PageBasicInfo pageBasicInfo){ @@ -63,10 +63,17 @@ public class DecorationAllocationController { return ResponseResult.success(decorationHandleService.getDecorationAssignList(pageBasicInfo)); } - - @PostMapping("/getShopSignerInfo") + @GetMapping("/getShopSignerInfo") @ApiOperation("详情中获取签约人信息") public ResponseResult getShopSignerInfo(@RequestParam("shopId") Long shopId){ return ResponseResult.success(decorationHandleService.getShopSignerInfo(shopId)); } + + @PostMapping("/confirm") + @ApiOperation("确认") + public ResponseResult updateConstructionTeam(@RequestBody UpdateConstructionTeamRequest request){ + return ResponseResult.success(decorationHandleService.updateConstructionTeam(request)); + } + + }