feat:handleDecorationTeam
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,8 +6,10 @@ import com.aliyun.openservices.ons.api.ConsumeContext;
|
|||||||
import com.aliyun.openservices.ons.api.Message;
|
import com.aliyun.openservices.ons.api.Message;
|
||||||
import com.aliyun.openservices.ons.api.MessageListener;
|
import com.aliyun.openservices.ons.api.MessageListener;
|
||||||
import com.cool.store.constants.CommonConstants;
|
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.StoreUserPositionDTO;
|
||||||
import com.cool.store.dto.store.StoreUserUpdateDTO;
|
import com.cool.store.dto.store.StoreUserUpdateDTO;
|
||||||
|
import com.cool.store.entity.decoration.ShopDecorationAssignDO;
|
||||||
import com.cool.store.service.DecorationHandleService;
|
import com.cool.store.service.DecorationHandleService;
|
||||||
import com.cool.store.utils.RedisUtilPool;
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -33,6 +35,8 @@ public class ShopDecorationAssignListener implements MessageListener {
|
|||||||
public RedisUtilPool redisUtilPool;
|
public RedisUtilPool redisUtilPool;
|
||||||
@Resource
|
@Resource
|
||||||
DecorationHandleService decorationHandleService;
|
DecorationHandleService decorationHandleService;
|
||||||
|
@Resource
|
||||||
|
ShopDecorationAssignDAO shopDecorationAssignDAO;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Action consume(Message message, ConsumeContext context) {
|
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);
|
boolean lock = redisUtilPool.setNxExpire(lockKey, message.getMsgID(), CommonConstants.NORMAL_LOCK_TIMES);
|
||||||
if(lock){
|
if(lock){
|
||||||
try {
|
try {
|
||||||
decorationHandleService.handleDecorationTeam(Long.valueOf(text));
|
ShopDecorationAssignDO shopDecorationAssignDO = shopDecorationAssignDAO.getById(Long.valueOf(text));
|
||||||
|
decorationHandleService.handleDecorationTeam(shopDecorationAssignDO);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("ShopDecorationAssignListener consume error",e);
|
log.error("ShopDecorationAssignListener consume error",e);
|
||||||
return Action.ReconsumeLater;
|
return Action.ReconsumeLater;
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import com.cool.store.common.PageBasicInfo;
|
|||||||
import com.cool.store.dto.ShopSignerInfoDTO;
|
import com.cool.store.dto.ShopSignerInfoDTO;
|
||||||
import com.cool.store.dto.decoration.DecorationListDTO;
|
import com.cool.store.dto.decoration.DecorationListDTO;
|
||||||
import com.cool.store.dto.decoration.DecorationTeamDTO;
|
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.AddTeamRequest;
|
||||||
import com.cool.store.request.decoration.DecorationListRequest;
|
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.request.decoration.UpdateTeamRequest;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
@@ -59,7 +61,7 @@ public interface DecorationHandleService {
|
|||||||
* @param teamId
|
* @param teamId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Boolean handleDecorationTeam(Long decorationAssignId);
|
Boolean handleDecorationTeam(ShopDecorationAssignDO shopDecorationAssignDO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表
|
* 列表
|
||||||
@@ -75,6 +77,13 @@ public interface DecorationHandleService {
|
|||||||
*/
|
*/
|
||||||
ShopSignerInfoDTO getShopSignerInfo(Long shopId);
|
ShopSignerInfoDTO getShopSignerInfo(Long shopId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新施工团队
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean updateConstructionTeam(UpdateConstructionTeamRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.common.PageBasicInfo;
|
import com.cool.store.common.PageBasicInfo;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
import com.cool.store.dao.decoration.DecorationTeamConfigDAO;
|
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.exception.ServiceException;
|
||||||
import com.cool.store.request.decoration.AddTeamRequest;
|
import com.cool.store.request.decoration.AddTeamRequest;
|
||||||
import com.cool.store.request.decoration.DecorationListRequest;
|
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.request.decoration.UpdateTeamRequest;
|
||||||
import com.cool.store.service.DecorationHandleService;
|
import com.cool.store.service.DecorationHandleService;
|
||||||
import com.cool.store.service.HqtAPIService;
|
import com.cool.store.service.HqtAPIService;
|
||||||
@@ -155,16 +157,15 @@ public class DecorationHandleServiceImpl implements DecorationHandleService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean handleDecorationTeam(Long decorationAssignId) {
|
public Boolean handleDecorationTeam(ShopDecorationAssignDO shopDecorationAssign) {
|
||||||
//先查询
|
//先查询
|
||||||
ShopDecorationAssignDO shopDecorationAssign = shopDecorationAssignDAO.getById(decorationAssignId);
|
|
||||||
if (shopDecorationAssign == null){
|
if (shopDecorationAssign == null){
|
||||||
log.info("handleDecorationTeam_error data not exist");
|
log.info("handleDecorationTeam_error data not exist");
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
//如果门店是已经分配状态 则不能再次分配
|
//如果门店是已经分配状态 则不能再次分配
|
||||||
if (DecorationDescStatus.ASSIGNED.getCode().equals(shopDecorationAssign.getDecorationDescStatus())){
|
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());
|
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(shopDecorationAssign.getShopId());
|
||||||
@@ -223,6 +224,19 @@ public class DecorationHandleServiceImpl implements DecorationHandleService {
|
|||||||
return shopSignerInfoDTO;
|
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() {
|
public String getNextNumber() {
|
||||||
Long current = redisUtilPool.incrby("counter_key", 1);
|
Long current = redisUtilPool.incrby("counter_key", 1);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.cool.store.dto.decoration.DecorationListDTO;
|
|||||||
import com.cool.store.dto.decoration.DecorationTeamDTO;
|
import com.cool.store.dto.decoration.DecorationTeamDTO;
|
||||||
import com.cool.store.request.decoration.AddTeamRequest;
|
import com.cool.store.request.decoration.AddTeamRequest;
|
||||||
import com.cool.store.request.decoration.DecorationListRequest;
|
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.request.decoration.UpdateTeamRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.DecorationHandleService;
|
import com.cool.store.service.DecorationHandleService;
|
||||||
@@ -50,7 +51,6 @@ public class DecorationAllocationController {
|
|||||||
return ResponseResult.success(decorationHandleService.deleteByTeamId(teamId));
|
return ResponseResult.success(decorationHandleService.deleteByTeamId(teamId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/listByCondition")
|
@PostMapping("/listByCondition")
|
||||||
@ApiOperation("查询团队")
|
@ApiOperation("查询团队")
|
||||||
public ResponseResult<PageInfo<DecorationTeamDTO>> listByCondition(@RequestBody PageBasicInfo pageBasicInfo){
|
public ResponseResult<PageInfo<DecorationTeamDTO>> listByCondition(@RequestBody PageBasicInfo pageBasicInfo){
|
||||||
@@ -63,10 +63,17 @@ public class DecorationAllocationController {
|
|||||||
return ResponseResult.success(decorationHandleService.getDecorationAssignList(pageBasicInfo));
|
return ResponseResult.success(decorationHandleService.getDecorationAssignList(pageBasicInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getShopSignerInfo")
|
||||||
@PostMapping("/getShopSignerInfo")
|
|
||||||
@ApiOperation("详情中获取签约人信息")
|
@ApiOperation("详情中获取签约人信息")
|
||||||
public ResponseResult<ShopSignerInfoDTO> getShopSignerInfo(@RequestParam("shopId") Long shopId){
|
public ResponseResult<ShopSignerInfoDTO> getShopSignerInfo(@RequestParam("shopId") Long shopId){
|
||||||
return ResponseResult.success(decorationHandleService.getShopSignerInfo(shopId));
|
return ResponseResult.success(decorationHandleService.getShopSignerInfo(shopId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/confirm")
|
||||||
|
@ApiOperation("确认")
|
||||||
|
public ResponseResult<Boolean> updateConstructionTeam(@RequestBody UpdateConstructionTeamRequest request){
|
||||||
|
return ResponseResult.success(decorationHandleService.updateConstructionTeam(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user