修改设计师和设计组接口
This commit is contained in:
@@ -243,7 +243,8 @@ public enum ErrorCodeEnum {
|
||||
QUOTATION_URL_REQUIRED(131010,"请等待报价单提交",null),
|
||||
DESIGN_URL_REQUIRED(131011,"请等待设计图提交",null),
|
||||
LEGAL_PERSON_NAME_NOT_SAME(131012,"法人姓名与加盟商姓名不一致",null),
|
||||
|
||||
UPDATE_DESIGN_LEADER(131019,"设计阶段状态不支持修改设计组",null),
|
||||
UPDATE_DESIGN_USER(131022,"设计阶段状态不支持修改设计师",null),
|
||||
TALLY_BOOK_NOT_EXIST(180001, "记账本数据不存在", null),
|
||||
|
||||
THIRD_API_ERROR(151001,"第三方服务异常->{0}",null),
|
||||
|
||||
@@ -88,6 +88,7 @@ public enum MessageEnum {
|
||||
MESSAGE_59("您有一个门店设计阶段报价任务待领取,请查收","门店名称:${storeName}\n加盟商姓名:${partnerUsername}\n加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_60("您有一个门店已提交京东建店资料,请查收","门店名称:${storeName}\n加盟商姓名:${partnerUsername}\n加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_61("您有一个门店京东外卖初审已通过,请查收","门店名称:${storeName}\n加盟商姓名:${partnerUsername}\n加盟商手机号码:${partnerMobile}\n"),
|
||||
MESSAGE_62("您有一个门店设计阶段设计图待提交,请查收","门店名称:${storeName}\n加盟商姓名:${partnerUsername}\n加盟商手机号码:${partnerMobile}\n"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -24,14 +24,15 @@ public class DecorationDesignInfoDAO {
|
||||
@Resource
|
||||
DecorationDesignInfoMapper decorationDesignInfoMapper;
|
||||
|
||||
public DecorationDesignInfoDO getById(Long id){
|
||||
if(id == null){
|
||||
public DecorationDesignInfoDO getById(Long id) {
|
||||
if (id == null) {
|
||||
return null;
|
||||
}
|
||||
return decorationDesignInfoMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
public List<DecorationDesignInfoDO> getByIds(List<Long> shopIds){
|
||||
if(CollectionUtils.isEmpty(shopIds)){
|
||||
|
||||
public List<DecorationDesignInfoDO> getByIds(List<Long> shopIds) {
|
||||
if (CollectionUtils.isEmpty(shopIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Example example = new Example(DecorationDesignInfoDO.class);
|
||||
@@ -39,29 +40,41 @@ public class DecorationDesignInfoDAO {
|
||||
return decorationDesignInfoMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public Integer insertSelective(DecorationDesignInfoDO decorationDesignInfoDO){
|
||||
public Integer insertSelective(DecorationDesignInfoDO decorationDesignInfoDO) {
|
||||
return decorationDesignInfoMapper.insertSelective(decorationDesignInfoDO);
|
||||
}
|
||||
|
||||
public Integer updateByPrimaryKeySelective(DecorationDesignInfoDO decorationDesignInfoDO){
|
||||
public Integer updateByPrimaryKeySelective(DecorationDesignInfoDO decorationDesignInfoDO) {
|
||||
return decorationDesignInfoMapper.updateByPrimaryKeySelective(decorationDesignInfoDO);
|
||||
}
|
||||
|
||||
public DecorationDesignInfoDO getByShopId(Long shopId){
|
||||
if(shopId == null){
|
||||
public DecorationDesignInfoDO getByShopId(Long shopId) {
|
||||
if (shopId == null) {
|
||||
return null;
|
||||
}
|
||||
return decorationDesignInfoMapper.selectByShopId(shopId);
|
||||
}
|
||||
|
||||
// 根据设计师人员id和店铺阶段 SHOP_SUB_STAGE_STATUS_901 查询店铺信息
|
||||
public List<PreparationCommonPendingVO> getByDesignUserIdAndShopStage(String userId, String keyword){
|
||||
if(userId == null){
|
||||
public List<PreparationCommonPendingVO> getByDesignUserIdAndShopStage(String userId, String keyword) {
|
||||
if (userId == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return decorationDesignInfoMapper.getByDesignUserIdAndShopStage(userId, keyword);
|
||||
return decorationDesignInfoMapper.getByDesignUserIdAndShopStage(userId, keyword);
|
||||
}
|
||||
|
||||
public Integer updateDesignLeaderIdAndDesignUserIdInteger(Long shopId, String designLeaderId) {
|
||||
if (shopId == null|| StringUtil.isEmpty(designLeaderId)){
|
||||
return 0;
|
||||
}
|
||||
return decorationDesignInfoMapper.updateDesignLeaderIdAndDesignUserIdInteger(shopId, designLeaderId);
|
||||
}
|
||||
|
||||
public Integer updateDesignUserId(Long shopId, String designUserId) {
|
||||
if (shopId == null|| StringUtil.isEmpty(designUserId)){
|
||||
return 0;
|
||||
}
|
||||
return decorationDesignInfoMapper.updateDesignUserId(shopId, designUserId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,5 +18,12 @@ public interface DecorationDesignInfoMapper extends Mapper<DecorationDesignInfoD
|
||||
DecorationDesignInfoDO selectByShopId(Long shopId);
|
||||
|
||||
List<PreparationCommonPendingVO> getByDesignUserIdAndShopStage(@Param("userId") String userId,@Param("keyword") String keyword);
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/6/16
|
||||
* @description:DesignUserId置空
|
||||
*/
|
||||
Integer updateDesignLeaderIdAndDesignUserIdInteger(@Param("shopId") Long shopId,@Param("designLeaderId") String designLeaderId);
|
||||
|
||||
Integer updateDesignUserId(@Param("shopId") Long shopId,@Param("designUserId") String designUserId);
|
||||
}
|
||||
@@ -27,6 +27,17 @@
|
||||
<result column="design_submit_time" jdbcType="TIMESTAMP" property="designSubmitTime" />
|
||||
<result column="quotation_submit_time" jdbcType="TIMESTAMP" property="quotationSubmitTime" />
|
||||
</resultMap>
|
||||
<update id="updateDesignLeaderIdAndDesignUserIdInteger">
|
||||
update xfsg_decoration_design_info
|
||||
set design_leader_id = #{designLeaderId},
|
||||
design_user_id = null
|
||||
where shop_id = #{shopId}
|
||||
</update>
|
||||
<update id="updateDesignUserId">
|
||||
update xfsg_decoration_design_info
|
||||
set design_user_id = #{designUserId}
|
||||
where shop_id = #{shopId}
|
||||
</update>
|
||||
|
||||
<select id="selectByShopId" resultMap="BaseResultMap">
|
||||
select
|
||||
|
||||
@@ -171,4 +171,8 @@ public interface DecorationService {
|
||||
* @return
|
||||
*/
|
||||
Boolean saveDecorationDesign(DecorationDesignRequest request, LoginUserInfo user);
|
||||
|
||||
Boolean updateDesignLeader(Long shopId, String userId);
|
||||
|
||||
Boolean updateDesignUser(Long shopId, String userId);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public class DecorationMeasureServiceImpl implements DecorationMeasureService {
|
||||
map.put("partnerMobile", lineInfo.getMobile());
|
||||
map.put("storeName", shopInfo.getShopName());
|
||||
commonService.sendQWMessage(Collections.singletonList(request.getDesignUserId()),
|
||||
MessageEnum.MESSAGE_58,
|
||||
MessageEnum.MESSAGE_62,
|
||||
map
|
||||
);
|
||||
}
|
||||
|
||||
@@ -614,7 +614,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
//查询测量阶段的设计组长
|
||||
DecorationMeasureDO measureDO = decorationMeasureDAO.getByShopId(shopId);
|
||||
DecorationDesignVO decorationDesignVO = new DecorationDesignVO();
|
||||
if (measureDO!=null){
|
||||
if (measureDO != null) {
|
||||
decorationDesignVO.setDesignLeaderId(measureDO.getDesignUserId());
|
||||
String userName = enterpriseUserDAO.getUserName(measureDO.getDesignUserId());
|
||||
decorationDesignVO.setDesignLeaderName(userName);
|
||||
@@ -828,6 +828,57 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateDesignLeader(Long shopId, String userId) {
|
||||
if (Objects.isNull(shopId) || StringUtils.isEmpty(userId)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
//设计阶段
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_9);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus())
|
||||
&& !shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_901.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.UPDATE_DESIGN_LEADER);
|
||||
}
|
||||
decorationDesignInfoDAO.updateDesignLeaderIdAndDesignUserIdInteger(shopId, userId);
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90);
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
LineInfoDO lineInfo = lineInfoMapper.getByLineId(shopInfo.getLineId());
|
||||
HashMap<String, String> map = new HashMap<>(4);
|
||||
map.put("partnerUsername", lineInfo.getUsername());
|
||||
map.put("partnerMobile", lineInfo.getMobile());
|
||||
map.put("storeName", shopInfo.getShopName());
|
||||
commonService.sendQWMessage(Collections.singletonList(userId),
|
||||
MessageEnum.MESSAGE_58,
|
||||
map
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateDesignUser(Long shopId, String userId) {
|
||||
if (Objects.isNull(shopId) || StringUtils.isEmpty(userId)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
//设计阶段
|
||||
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_9);
|
||||
if (!shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_901.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.UPDATE_DESIGN_USER);
|
||||
}
|
||||
decorationDesignInfoDAO.updateDesignUserId(shopId, userId);
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
LineInfoDO lineInfo = lineInfoMapper.getByLineId(shopInfo.getLineId());
|
||||
HashMap<String, String> map = new HashMap<>(4);
|
||||
map.put("partnerUsername", lineInfo.getUsername());
|
||||
map.put("partnerMobile", lineInfo.getMobile());
|
||||
map.put("storeName", shopInfo.getShopName());
|
||||
commonService.sendQWMessage(Collections.singletonList(userId),
|
||||
MessageEnum.MESSAGE_62,
|
||||
map
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
private DecorationDTO getDecorationDTO(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
|
||||
@@ -193,4 +193,18 @@ public class PCDecorationController {
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(decorationService.saveDecorationDesign(request, user));
|
||||
}
|
||||
|
||||
@ApiOperation("修改设计组")
|
||||
@GetMapping("/updateDesignLeader")
|
||||
public ResponseResult<Boolean> updateDesignLeader(@RequestParam Long shopId, @RequestParam String leaderId) {
|
||||
return ResponseResult.success(decorationService.updateDesignLeader(shopId, leaderId));
|
||||
}
|
||||
|
||||
@ApiOperation("修改设计师")
|
||||
@GetMapping("/updateDesignUser")
|
||||
public ResponseResult<Boolean> updateDesignUser(@RequestParam Long shopId, @RequestParam String designerId) {
|
||||
return ResponseResult.success(decorationService.updateDesignUser(shopId, designerId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user