diff --git a/coolstore-partner-dao/src/main/resources/mapper/DecorationDesignInfoMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/DecorationDesignInfoMapper.xml index 71bff903a..f1371be21 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/DecorationDesignInfoMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/DecorationDesignInfoMapper.xml @@ -63,12 +63,49 @@ from xfsg_decoration_design_info a left join xfsg_shop_stage_info b on a.shop_id = b.shop_id left join xfsg_shop_info c on a.shop_id = c.id + + left join xfsg_shop_sign_info sign on a.shop_id = sign.shop_id + where a.design_user_id = #{userId} and b.shop_sub_stage_status = 901 and c.deleted = 0 and c.shop_status !=2 - - and (c.shop_name like concat('%',#{keyword},'%') or c.shop_code like concat('%',#{keyword},'%')) + + and b.shop_sub_stage_status in + + #{item} + + + + and (c.shop_name like concat('%',#{request.shopKeyword},'%') or c.shop_code like concat('%',#{request.shopKeyword},'%')) + + + and c.region_id in + + #{regionId} + + + + and c.store_type in + + #{storeType} + + + + and sign.sign_type in + + #{signType} + + + + and c.investment_manager = #{request.supervisorId} + + + and c.join_mode in + + #{joinMode} + order by b.update_time desc diff --git a/coolstore-partner-dao/src/main/resources/mapper/DecorationMeasureMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/DecorationMeasureMapper.xml index 0c2e26bb5..ed4703116 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/DecorationMeasureMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/DecorationMeasureMapper.xml @@ -48,12 +48,49 @@ from xfsg_decoration_measure a left join xfsg_shop_stage_info b on a.shop_id = b.shop_id left join xfsg_shop_info c on a.shop_id = c.id + + left join xfsg_shop_sign_info sign on a.shop_id = sign.shop_id + where a.measure_user_id = #{measureUserId} and b.shop_sub_stage_status = 892 and c.deleted = 0 and c.shop_status !=2 - - and (c.shop_name like concat('%',#{keyword},'%') or c.shop_code like concat('%',#{keyword},'%')) + + and b.shop_sub_stage_status in + + #{item} + + + + and (c.shop_name like concat('%',#{request.shopKeyword},'%') or c.shop_code like concat('%',#{request.shopKeyword},'%')) + + + and c.region_id in + + #{regionId} + + + + and c.store_type in + + #{storeType} + + + + and sign.sign_type in + + #{signType} + + + + and c.investment_manager = #{request.supervisorId} + + + and c.join_mode in + + #{joinMode} + order by b.update_time desc @@ -76,12 +113,49 @@ from xfsg_decoration_measure a left join xfsg_shop_stage_info b on a.shop_id = b.shop_id left join xfsg_shop_info c on a.shop_id = c.id + + left join xfsg_shop_sign_info sign on a.shop_id = sign.shop_id + where a.design_user_id = #{userId} and b.shop_sub_stage_status = 900 and c.deleted = 0 and c.shop_status !=2 - - and (c.shop_name like concat('%',#{keyword},'%') or c.shop_code like concat('%',#{keyword},'%')) + + and b.shop_sub_stage_status in + + #{item} + + + + and (c.shop_name like concat('%',#{request.shopKeyword},'%') or c.shop_code like concat('%',#{request.shopKeyword},'%')) + + + and c.region_id in + + #{regionId} + + + + and c.store_type in + + #{storeType} + + + + and sign.sign_type in + + #{signType} + + + + and c.investment_manager = #{request.supervisorId} + + + and c.join_mode in + + #{joinMode} + order by b.update_time desc @@ -105,11 +179,48 @@ left join xfsg_shop_stage_info b on a.shop_id = b.shop_id left join xfsg_shop_info c on a.shop_id = c.id left join xfsg_decoration_design_info d on a.shop_id = d.shop_id + + left join xfsg_shop_sign_info sign on a.shop_id = sign.shop_id + where ((b.shop_sub_stage_status = 900 and a.design_user_id = #{userId}) or (b.shop_sub_stage_status = 901 and d.design_user_id = #{userId})) and c.deleted = 0 and c.shop_status !=2 - - and (c.shop_name like concat('%',#{keyword},'%') or c.shop_code like concat('%',#{keyword},'%')) + + and b.shop_sub_stage_status in + + #{item} + + + + and (c.shop_name like concat('%',#{request.shopKeyword},'%') or c.shop_code like concat('%',#{request.shopKeyword},'%')) + + + and c.region_id in + + #{regionId} + + + + and c.store_type in + + #{storeType} + + + + and sign.sign_type in + + #{signType} + + + + and c.investment_manager = #{request.supervisorId} + + + and c.join_mode in + + #{joinMode} + order by b.update_time desc diff --git a/coolstore-partner-dao/src/main/resources/mapper/OperationLogMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/OperationLogMapper.xml index 7bc43723a..76c474141 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/OperationLogMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/OperationLogMapper.xml @@ -81,6 +81,9 @@ select * from xfsg_operation_log a left join xfsg_shop_info b on a.shop_id = b.id + + left join xfsg_shop_sign_info sign on a.shop_id = sign.shop_id + where b.deleted=0 and b.shop_status !=2 @@ -90,8 +93,42 @@ #{item} and a.status = 0 - - and (b.shop_code like concat('%',#{keyword},'%') or b.shop_name like concat('%',#{keyword},'%')) + + and a.shop_sub_stage_status in + + #{item} + + + + and (b.shop_name like concat('%',#{request.shopKeyword},'%') or b.shop_code like concat('%',#{request.shopKeyword},'%')) + + + and b.region_id in + + #{regionId} + + + + and b.store_type in + + #{storeType} + + + + and sign.sign_type in + + #{signType} + + + + and b.investment_manager = #{request.supervisorId} + + + and b.join_mode in + + #{joinMode} + order by a.create_time desc diff --git a/coolstore-partner-dao/src/main/resources/mapper/ShopStageInfoMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/ShopStageInfoMapper.xml index 1a2e0d181..2aad2e8b4 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/ShopStageInfoMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/ShopStageInfoMapper.xml @@ -325,6 +325,13 @@ #{stageStatus} + + and a.shop_sub_stage_status in + + #{item} + + and si.investment_manager = #{investmentUserId} diff --git a/coolstore-partner-model/src/main/java/com/cool/store/request/DeskRequest.java b/coolstore-partner-model/src/main/java/com/cool/store/request/DeskRequest.java index db5d3e6d4..e08de3802 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/request/DeskRequest.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/request/DeskRequest.java @@ -32,6 +32,8 @@ public class DeskRequest { @ApiModelProperty(value = "签约类型") private List signTypes; + @ApiModelProperty(value = "阶段状态") + private List stageStatus; private Integer pageNum = 1; diff --git a/coolstore-partner-model/src/main/java/com/cool/store/response/DeskStageResponse.java b/coolstore-partner-model/src/main/java/com/cool/store/response/DeskStageResponse.java deleted file mode 100644 index 61db290cd..000000000 --- a/coolstore-partner-model/src/main/java/com/cool/store/response/DeskStageResponse.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.cool.store.response; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @Author: WangShuo - * @Date: 2025/06/23/16:33 - * @Version 1.0 - * @注释: - */ -@Data -public class DeskStageResponse { - @ApiModelProperty(value = "阶段") - private Integer shopSubStage; - - @ApiModelProperty(value = "阶段状态") - private Integer shopSubStageStatus; - - @ApiModelProperty(value = "阶段状态描述") - private String shopSubStageStatusDesc; -} diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/DeskService.java b/coolstore-partner-service/src/main/java/com/cool/store/service/DeskService.java index c027ffca9..9def104b4 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/DeskService.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/DeskService.java @@ -7,7 +7,6 @@ import com.cool.store.entity.HyPartnerLabelDO; import com.cool.store.entity.LineInfoDO; import com.cool.store.request.BusinessRemarkRequest; import com.cool.store.request.DeskRequest; -import com.cool.store.response.DeskStageResponse; import com.cool.store.vo.BaseInfoVO; import com.cool.store.vo.desk.*; import com.github.pagehelper.PageInfo; @@ -196,5 +195,4 @@ public interface DeskService { Integer submitBusinessRemark(BusinessRemarkRequest request, LoginUserInfo user); - List getDeskStageList(Integer shopSubStage,String userId); } diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DeskServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DeskServiceImpl.java index c83fae9b2..390b5b537 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DeskServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/DeskServiceImpl.java @@ -20,12 +20,10 @@ import com.cool.store.mapper.IntentAgreementMapper; import com.cool.store.mapper.TrainingExperienceMapper; import com.cool.store.request.BusinessRemarkRequest; import com.cool.store.request.DeskRequest; -import com.cool.store.response.DeskStageResponse; import com.cool.store.service.DeskService; import com.cool.store.service.RegionService; import com.cool.store.service.SysRoleService; import com.cool.store.service.UserAuthMappingService; -import com.cool.store.utils.CoolDateUtils; import com.cool.store.utils.StringUtil; import com.cool.store.utils.poi.DateUtils; import com.cool.store.vo.BaseInfoVO; @@ -102,9 +100,9 @@ public class DeskServiceImpl implements DeskService { private ShopStageRemarkInfoDAO shopStageRemarkInfoDAO; @Override - public PageInfo intendPendingList(Integer pageNum, Integer pageSize, String userId,String keyword) { + public PageInfo intendPendingList(Integer pageNum, Integer pageSize, String userId, String keyword) { PageHelper.startPage(pageNum, pageSize); - List lineInfoDOS = lineInfoDAO.listByInvestmentManager(userId, Arrays.asList(INTENT_5.getCode()),keyword); + List lineInfoDOS = lineInfoDAO.listByInvestmentManager(userId, Arrays.asList(INTENT_5.getCode()), keyword); PageInfo page = new PageInfo(lineInfoDOS); Map userPortraitMap = this.getUserPortraitMap(lineInfoDOS); List wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList()); @@ -129,9 +127,9 @@ public class DeskServiceImpl implements DeskService { @Override - public PageInfo payStagePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user,String keyword) { + public PageInfo payStagePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user, String keyword) { PageHelper.startPage(pageNum, pageSize); - List lineInfoDOS = lineInfoDAO.listByInvestmentManager(user.getUserId(), Arrays.asList(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode()),keyword); + List lineInfoDOS = lineInfoDAO.listByInvestmentManager(user.getUserId(), Arrays.asList(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode()), keyword); PageInfo page = new PageInfo(lineInfoDOS); Map userPortraitMap = this.getUserPortraitMap(lineInfoDOS); List wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList()); @@ -158,10 +156,10 @@ public class DeskServiceImpl implements DeskService { } @Override - public PageInfo signingPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user,String keyword) { + public PageInfo signingPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user, String keyword) { PageHelper.startPage(pageNum, pageSize); List lineInfoDOS = lineInfoDAO.listByInvestmentManager(user.getUserId(), - Arrays.asList(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode()),keyword); + Arrays.asList(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode()), keyword); PageInfo page = new PageInfo(lineInfoDOS); Map userPortraitMap = this.getUserPortraitMap(lineInfoDOS); List wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList()); @@ -257,7 +255,7 @@ public class DeskServiceImpl implements DeskService { @Override - public PageInfo payFranchiseFeesPendingList(DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo payFranchiseFeesPendingList(DeskRequest deskRequest, LoginUserInfo user) { List userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId()); PageInfo pageInfo = new PageInfo<>(); List subStageStatusList = new ArrayList<>(); @@ -267,10 +265,11 @@ public class DeskServiceImpl implements DeskService { pageInfo = commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_7, Arrays.asList(SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus()), Boolean.FALSE); } else { - if (userRoleIds.contains(UserRoleEnum.JOIN_OFFICE.getCode()) || userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode())) { + Boolean isAdmin = sysRoleService.checkIsAdmin(user.getUserId()); + if (userRoleIds.contains(UserRoleEnum.JOIN_OFFICE.getCode()) || userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode()) || isAdmin) { subStageStatusList.add(SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus()); } - if(userRoleIds.contains(UserRoleEnum.BRANCH_OFFICE.getCode())||userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode())){ + if (userRoleIds.contains(UserRoleEnum.BRANCH_OFFICE.getCode()) || userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode()) || isAdmin) { subStageStatusList.add(SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus()); } if (!subStageStatusList.isEmpty()) { @@ -283,48 +282,58 @@ public class DeskServiceImpl implements DeskService { } @Override - public PageInfo signingOfFranchiseContractPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo signingOfFranchiseContractPendingList(DeskRequest deskRequest, LoginUserInfo user) { + List subStageStatusList = new ArrayList<>(); + List userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId()); + Boolean isAdmin = sysRoleService.checkIsAdmin(user.getUserId()); + if (userRoleIds.contains(UserRoleEnum.JOIN_OFFICE.getCode()) || userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode()) || isAdmin) { + subStageStatusList.add(SHOP_SUB_STAGE_STATUS_80.getShopSubStageStatus()); + subStageStatusList.add(SHOP_SUB_STAGE_STATUS_85.getShopSubStageStatus()); + } + if (userRoleIds.contains(UserRoleEnum.BRANCH_OFFICE.getCode()) || userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode()) || isAdmin) { + subStageStatusList.add(SHOP_SUB_STAGE_STATUS_83.getShopSubStageStatus()); + } PageInfo pageInfo = commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_8, - Arrays.asList(SHOP_SUB_STAGE_STATUS_80.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_85.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_83.getShopSubStageStatus()), Boolean.TRUE); + subStageStatusList, Boolean.TRUE); return pageInfo; } @Override - public PageInfo invoiceReturnPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo invoiceReturnPendingList(DeskRequest deskRequest, LoginUserInfo user) { return commonPendingVOPageInfo(deskRequest, null, ShopSubStageEnum.SHOP_STAGE_8_5, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_85_1.getShopSubStageStatus()), Boolean.FALSE); } @Override - public PageInfo openingAndOperationPlanPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo openingAndOperationPlanPendingList(DeskRequest deskRequest, LoginUserInfo user) { return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_14, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_140.getShopSubStageStatus()), Boolean.FALSE); } @Override - public PageInfo trainListPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo trainListPendingList(DeskRequest deskRequest, LoginUserInfo user) { return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_5, - Collections.singletonList(SHOP_SUB_STAGE_STATUS_50.getShopSubStageStatus()), Boolean.TRUE ); + Collections.singletonList(SHOP_SUB_STAGE_STATUS_50.getShopSubStageStatus()), Boolean.TRUE); } @Override - public PageInfo xinFaListPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo xinFaListPendingList(DeskRequest deskRequest, LoginUserInfo user) { return commonPendingVOPageInfo(deskRequest, null, ShopSubStageEnum.SHOP_STAGE_23, - Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_230.getShopSubStageStatus()), Boolean.FALSE ); + Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_230.getShopSubStageStatus()), Boolean.FALSE); } @Override - public PageInfo posListPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo posListPendingList(DeskRequest deskRequest, LoginUserInfo user) { return commonPendingVOPageInfo(deskRequest, null, ShopSubStageEnum.SHOP_STAGE_16, - Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_160.getShopSubStageStatus()), Boolean.FALSE ); + Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_160.getShopSubStageStatus()), Boolean.FALSE); } @Override - public PageInfo tentPassListPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo tentPassListPendingList(DeskRequest deskRequest, LoginUserInfo user) { return commonPendingVOPageInfo(deskRequest, null, ShopSubStageEnum.SHOP_STAGE_24, Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_240.getShopSubStageStatus()), Boolean.FALSE); @@ -332,14 +341,14 @@ public class DeskServiceImpl implements DeskService { } @Override - public PageInfo orderSysPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo orderSysPendingList(DeskRequest deskRequest, LoginUserInfo user) { return commonPendingVOPageInfo(deskRequest, null, ShopSubStageEnum.SHOP_STAGE_17, - Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_170.getShopSubStageStatus()), Boolean.FALSE ); + Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_170.getShopSubStageStatus()), Boolean.FALSE); } @Override - public PageInfo designPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo designPendingList(DeskRequest deskRequest, LoginUserInfo user) { List userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId()); List subStageStatusList = new ArrayList<>(); //报价员和管理员不指定人,看阶段符合的全部数据 @@ -353,10 +362,10 @@ public class DeskServiceImpl implements DeskService { subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_902.getShopSubStageStatus()); subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_903.getShopSubStageStatus()); } - return commonPendingVOPageInfo(deskRequest, isAdmin ? null : user, ShopSubStageEnum.SHOP_STAGE_9, subStageStatusList, isAdmin ? Boolean.FALSE : Boolean.TRUE ); + return commonPendingVOPageInfo(deskRequest, isAdmin ? null : user, ShopSubStageEnum.SHOP_STAGE_9, subStageStatusList, isAdmin ? Boolean.FALSE : Boolean.TRUE); } else { List list = new ArrayList<>(); - list = getDesignPendingVO(deskRequest, user, userRoleIds ); + list = getDesignPendingVO(deskRequest, user, userRoleIds); if (CollectionUtils.isEmpty(list)) { return new PageInfo<>(); @@ -391,46 +400,46 @@ public class DeskServiceImpl implements DeskService { } } - private List getDesignPendingVO( DeskRequest deskRequest, LoginUserInfo user, List userRoleIds ) { + private List getDesignPendingVO(DeskRequest deskRequest, LoginUserInfo user, List userRoleIds) { //只有设计组长 查询 指定当前用户和阶段为 900 待分配设计师 if (userRoleIds.contains(UserRoleEnum.HEAD_OF_DESIGN.getCode()) && !userRoleIds.contains(UserRoleEnum.DESIGN_CUSTOMER.getCode())) { - PageHelper.startPage(deskRequest); - List resultList = decorationMeasureDAO.getShopIdListByDesignUserIdAndShopStage(user.getUserId(),deskRequest ); + PageHelper.startPage(deskRequest.getPageNum(), deskRequest.getPageSize()); + List resultList = decorationMeasureDAO.getShopIdListByDesignUserIdAndShopStage(user.getUserId(), deskRequest); List shopIds = resultList.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList()); List remarkInfoDOList = shopStageRemarkInfoDAO.getByShopIdsAndStage(shopIds, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus())); Map> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.groupingBy(ShopStageRemarkInfoDO::getShopId)); - for (PreparationCommonPendingVO preparationCommonPendingVO : resultList){ + for (PreparationCommonPendingVO preparationCommonPendingVO : resultList) { List remarkInfoList = remarkInfoMap.getOrDefault(preparationCommonPendingVO.getShopId(), new ArrayList<>()); Map remarkMapByShopSubStageStatus = remarkInfoList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopSubStageStatus, ShopStageRemarkInfoDO::getRemark)); - preparationCommonPendingVO.setBusinessRemark(remarkMapByShopSubStageStatus.getOrDefault(preparationCommonPendingVO.getSubStageStatus(), "")); + preparationCommonPendingVO.setBusinessRemark(remarkMapByShopSubStageStatus.getOrDefault(preparationCommonPendingVO.getSubStageStatus(), "")); } return resultList; } //只有设计师 查询 指定当前用户和阶段为 901 if (userRoleIds.contains(UserRoleEnum.DESIGN_CUSTOMER.getCode()) && !userRoleIds.contains(UserRoleEnum.HEAD_OF_DESIGN.getCode())) { - PageHelper.startPage(deskRequest); - List resultList = decorationDesignInfoDAO.getByDesignUserIdAndShopStage(user.getUserId(),deskRequest); + PageHelper.startPage(deskRequest.getPageNum(), deskRequest.getPageSize()); + List resultList = decorationDesignInfoDAO.getByDesignUserIdAndShopStage(user.getUserId(), deskRequest); List shopIds = resultList.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList()); List remarkInfoDOList = shopStageRemarkInfoDAO.getByShopIdsAndStage(shopIds, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_901.getShopSubStageStatus())); Map> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.groupingBy(ShopStageRemarkInfoDO::getShopId)); - for (PreparationCommonPendingVO preparationCommonPendingVO : resultList){ + for (PreparationCommonPendingVO preparationCommonPendingVO : resultList) { List remarkInfoList = remarkInfoMap.getOrDefault(preparationCommonPendingVO.getShopId(), new ArrayList<>()); Map remarkMapByShopSubStageStatus = remarkInfoList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopSubStageStatus, ShopStageRemarkInfoDO::getRemark)); - preparationCommonPendingVO.setBusinessRemark(remarkMapByShopSubStageStatus.getOrDefault(preparationCommonPendingVO.getSubStageStatus(), "")); + preparationCommonPendingVO.setBusinessRemark(remarkMapByShopSubStageStatus.getOrDefault(preparationCommonPendingVO.getSubStageStatus(), "")); } return resultList; } //有 设计组长 和 设计师 查询 指定当前用户和 阶段为 900 待分配设计师 阶段为 901 设计中 if (userRoleIds.contains(UserRoleEnum.DESIGN_CUSTOMER.getCode()) && userRoleIds.contains(UserRoleEnum.HEAD_OF_DESIGN.getCode())) { PageHelper.startPage(deskRequest); - List resultList = decorationMeasureDAO.getShopIdListByDesignUserIdOrQuotationAndShopStage(user.getUserId(),deskRequest ); + List resultList = decorationMeasureDAO.getShopIdListByDesignUserIdOrQuotationAndShopStage(user.getUserId(), deskRequest); List shopIds = resultList.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList()); - List remarkInfoDOList = shopStageRemarkInfoDAO.getByShopIdsAndStage(shopIds, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_901.getShopSubStageStatus(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus())); + List remarkInfoDOList = shopStageRemarkInfoDAO.getByShopIdsAndStage(shopIds, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_901.getShopSubStageStatus(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus())); Map> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.groupingBy(ShopStageRemarkInfoDO::getShopId)); - for (PreparationCommonPendingVO preparationCommonPendingVO : resultList){ + for (PreparationCommonPendingVO preparationCommonPendingVO : resultList) { List remarkInfoList = remarkInfoMap.getOrDefault(preparationCommonPendingVO.getShopId(), new ArrayList<>()); Map remarkMapByShopSubStageStatus = remarkInfoList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopSubStageStatus, ShopStageRemarkInfoDO::getRemark)); - preparationCommonPendingVO.setBusinessRemark(remarkMapByShopSubStageStatus.getOrDefault(preparationCommonPendingVO.getSubStageStatus(), "")); + preparationCommonPendingVO.setBusinessRemark(remarkMapByShopSubStageStatus.getOrDefault(preparationCommonPendingVO.getSubStageStatus(), "")); } return resultList; } @@ -438,66 +447,66 @@ public class DeskServiceImpl implements DeskService { } @Override - public PageInfo constructionPendingList( DeskRequest deskRequest, LoginUserInfo user ) { - return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_11, + public PageInfo constructionPendingList(DeskRequest deskRequest, LoginUserInfo user) { + return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_11, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_110.getShopSubStageStatus(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_111.getShopSubStageStatus()), Boolean.TRUE); } @Override - public PageInfo fitmentPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo fitmentPendingList(DeskRequest deskRequest, LoginUserInfo user) { return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_12, - Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus()), Boolean.FALSE ); + Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122.getShopSubStageStatus()), Boolean.FALSE); } @Override - public PageInfo DYPendingList( DeskRequest deskRequest, LoginUserInfo user ) { - return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_181.getShopSubStageStatus()) ); + public PageInfo DYPendingList(DeskRequest deskRequest, LoginUserInfo user) { + return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_181.getShopSubStageStatus())); } @Override - public PageInfo KSPendingList( DeskRequest deskRequest, LoginUserInfo user ) { - return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_221.getShopSubStageStatus()) ); + public PageInfo KSPendingList(DeskRequest deskRequest, LoginUserInfo user) { + return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_221.getShopSubStageStatus())); } @Override - public PageInfo MTPendingList( DeskRequest deskRequest, LoginUserInfo user ) { - return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_191.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_193.getShopSubStageStatus()) ); + public PageInfo MTPendingList(DeskRequest deskRequest, LoginUserInfo user) { + return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_191.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_193.getShopSubStageStatus())); } @Override - public PageInfo MTBuyPendingList( DeskRequest deskRequest, LoginUserInfo user ) { - return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_201.getShopSubStageStatus()) ); + public PageInfo MTBuyPendingList(DeskRequest deskRequest, LoginUserInfo user) { + return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_201.getShopSubStageStatus())); } @Override - public PageInfo ELMEPendingList( DeskRequest deskRequest, LoginUserInfo user ) { - return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_211.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_213.getShopSubStageStatus()) ); + public PageInfo ELMEPendingList(DeskRequest deskRequest, LoginUserInfo user) { + return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_211.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_213.getShopSubStageStatus())); } @Override - public PageInfo buildInformationPendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo buildInformationPendingList(DeskRequest deskRequest, LoginUserInfo user) { List userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId()); if (userRoleIds.contains(UserRoleEnum.QW_SUPERVISION.getCode()) || userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) { return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_15, - Collections.singletonList(SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus()), Boolean.FALSE ); + Collections.singletonList(SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus()), Boolean.FALSE); } //如果不是财务角色或者即是财务又是自有店财务 则不需要标识 Boolean ownShopFlag = null; - if (userRoleIds.contains(UserRoleEnum.FINANCE.getCode())&&userRoleIds.contains(UserRoleEnum.OWN_SHOP_OFFICE.getCode())){ + if (userRoleIds.contains(UserRoleEnum.FINANCE.getCode()) && userRoleIds.contains(UserRoleEnum.OWN_SHOP_OFFICE.getCode())) { ownShopFlag = null; - }else if(userRoleIds.contains(UserRoleEnum.FINANCE.getCode())){ + } else if (userRoleIds.contains(UserRoleEnum.FINANCE.getCode())) { ownShopFlag = Boolean.FALSE; - }else if (userRoleIds.contains(UserRoleEnum.OWN_SHOP_OFFICE.getCode())){ + } else if (userRoleIds.contains(UserRoleEnum.OWN_SHOP_OFFICE.getCode())) { ownShopFlag = Boolean.TRUE; } List subStageStatusList = new ArrayList<>(); if (userRoleIds.contains(UserRoleEnum.LOGISTICS.getCode())) { subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus()); } - if (userRoleIds.contains(UserRoleEnum.FINANCE.getCode())||userRoleIds.contains(UserRoleEnum.OWN_SHOP_OFFICE.getCode())) { + if (userRoleIds.contains(UserRoleEnum.FINANCE.getCode()) || userRoleIds.contains(UserRoleEnum.OWN_SHOP_OFFICE.getCode())) { subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus()); } if (userRoleIds.contains(UserRoleEnum.HEAD_OF_DIVISION.getCode()) || userRoleIds.contains(UserRoleEnum.REGIONAL_MANAGER.getCode())) { @@ -517,11 +526,11 @@ public class DeskServiceImpl implements DeskService { subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_154.getShopSubStageStatus()); subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_155.getShopSubStageStatus()); } - return commonPendingVOPage(deskRequest, isAdmin ? null : user, ShopSubStageEnum.SHOP_STAGE_15, subStageStatusList, isAdmin ? Boolean.FALSE : Boolean.TRUE,ownShopFlag ); + return commonPendingVOPage(deskRequest, isAdmin ? null : user, ShopSubStageEnum.SHOP_STAGE_15, subStageStatusList, isAdmin ? Boolean.FALSE : Boolean.TRUE, ownShopFlag); } @Override - public PageInfo measurePendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo measurePendingList(DeskRequest deskRequest, LoginUserInfo user) { List userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId()); List subStageStatusList = new ArrayList<>(); Boolean isAdmin = sysRoleService.checkIsAdmin(user.getUserId()); @@ -536,7 +545,7 @@ public class DeskServiceImpl implements DeskService { } if (userRoleIds.contains(UserRoleEnum.MEASURE_OFFICE.getCode())) { PageHelper.startPage(deskRequest); - List list = decorationMeasureDAO.getByMeasureUserIdAndShopStage(user.getUserId() , deskRequest); + List list = decorationMeasureDAO.getByMeasureUserIdAndShopStage(user.getUserId(), deskRequest); if (CollectionUtils.isEmpty(list)) { return new PageInfo<>(); } @@ -573,45 +582,46 @@ public class DeskServiceImpl implements DeskService { } @Override - public PageInfo businessLicensePendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo businessLicensePendingList(DeskRequest deskRequest, LoginUserInfo user) { return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_3, - Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30.getShopSubStageStatus()), Boolean.FALSE ); + Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30.getShopSubStageStatus()), Boolean.FALSE); } @Override - public PageInfo foodLicensePendingList( DeskRequest deskRequest, LoginUserInfo user ) { + public PageInfo foodLicensePendingList(DeskRequest deskRequest, LoginUserInfo user) { return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_4, - Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_40.getShopSubStageStatus()), Boolean.FALSE ); + Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_40.getShopSubStageStatus()), Boolean.FALSE); } + @Override - public PageInfo JingDongPendingList( DeskRequest deskRequest, LoginUserInfo user ) { - return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_251.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_253.getShopSubStageStatus()) ); + public PageInfo JingDongPendingList(DeskRequest deskRequest, LoginUserInfo user) { + return commonPlatformBuild(deskRequest, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_251.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_253.getShopSubStageStatus())); } @Override - public Integer submitBusinessRemark(BusinessRemarkRequest request, LoginUserInfo user){ - if (!((request.getShopId() != null&&request.getSubStage()!=null&&request.getSubStageStatus()!=null) - ||(request.getLineId()!=null&&request.getWorkflowSubStage()!=null&&request.getWorkflowSubStageStatus()!=null))){ - throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR); + public Integer submitBusinessRemark(BusinessRemarkRequest request, LoginUserInfo user) { + if (!((request.getShopId() != null && request.getSubStage() != null && request.getSubStageStatus() != null) + || (request.getLineId() != null && request.getWorkflowSubStage() != null && request.getWorkflowSubStageStatus() != null))) { + throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR); } ShopStageRemarkInfoDO remarkInfoDO = new ShopStageRemarkInfoDO(); - if (request.getShopId() != null){ - remarkInfoDO = shopStageRemarkInfoDAO.getByShopIdAndStage(request.getShopId(),request.getSubStageStatus()); + if (request.getShopId() != null) { + remarkInfoDO = shopStageRemarkInfoDAO.getByShopIdAndStage(request.getShopId(), request.getSubStageStatus()); remarkInfoDO.setShopId(request.getShopId()); remarkInfoDO.setShopSubStage(request.getSubStage()); remarkInfoDO.setShopSubStageStatus(request.getSubStageStatus()); - }else if (request.getLineId() != null){ - remarkInfoDO = shopStageRemarkInfoDAO.getByLineIdAndStage(request.getLineId(),request.getWorkflowSubStageStatus()); + } else if (request.getLineId() != null) { + remarkInfoDO = shopStageRemarkInfoDAO.getByLineIdAndStage(request.getLineId(), request.getWorkflowSubStageStatus()); remarkInfoDO.setLineId(request.getLineId()); remarkInfoDO.setWorkflowSubStage(request.getWorkflowSubStage()); remarkInfoDO.setWorkflowSubStageStatus(request.getWorkflowSubStageStatus()); } remarkInfoDO.setRemark(request.getBusinessRemark()); - if(remarkInfoDO.getCreateTime()==null){ + if (remarkInfoDO.getCreateTime() == null) { remarkInfoDO.setCreateTime(new Date()); } - if (StringUtil.isBlank(remarkInfoDO.getCreateUserId())){ + if (StringUtil.isBlank(remarkInfoDO.getCreateUserId())) { remarkInfoDO.setCreateUserId(user.getUserId()); } remarkInfoDO.setUpdateTime(new Date()); @@ -619,45 +629,29 @@ public class DeskServiceImpl implements DeskService { return shopStageRemarkInfoDAO.insertOrUpdate(remarkInfoDO); } - @Override - public List getDeskStageList(Integer shopSubStage, String userId) { - List userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(userId); - if (CollectionUtils.isEmpty(userRoleIds)){ - return new ArrayList<>(); - } - List responses = new ArrayList<>(); - ShopSubStageEnum shopSubStageEnum = ShopSubStageEnum.getByShopSubStage(shopSubStage); - if (shopSubStageEnum == null){ - return new ArrayList<>(); - } - - return responses; - } /** * 通用查询 - * @param user * @param shopSubStageEnum * @param subStageStatusList * @param filterFlag * @return */ - private PageInfo commonPendingVOPageInfo( DeskRequest deskRequest, LoginUserInfo user, ShopSubStageEnum shopSubStageEnum, List subStageStatusList, Boolean filterFlag ){ - return this.commonPendingVOPage(deskRequest,user,shopSubStageEnum,subStageStatusList,filterFlag,null ); + private PageInfo commonPendingVOPageInfo(DeskRequest deskRequest, LoginUserInfo user, ShopSubStageEnum shopSubStageEnum, List subStageStatusList, Boolean filterFlag) { + return this.commonPendingVOPage(deskRequest, user, shopSubStageEnum, subStageStatusList, filterFlag, null); } /** * 通用查询 * - * @param user * @param shopSubStageEnum * @param subStageStatusList * @return */ - private PageInfo commonPendingVOPage( DeskRequest deskRequest, LoginUserInfo user, ShopSubStageEnum shopSubStageEnum, List subStageStatusList, Boolean filterFlag,Boolean ownShopFlag ) { + private PageInfo commonPendingVOPage(DeskRequest deskRequest, LoginUserInfo user, ShopSubStageEnum shopSubStageEnum, List subStageStatusList, Boolean filterFlag, Boolean ownShopFlag) { //user.getJobNumber() List authRegionIds = new ArrayList<>(); if (filterFlag) { @@ -665,9 +659,9 @@ public class DeskServiceImpl implements DeskService { authRegionIds = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(user.getUserId()); } } - PageHelper.startPage(deskRequest); + PageHelper.startPage(deskRequest.getPageNum(), deskRequest.getPageSize()); List specialShopStageInfo = shopStageInfoDAO.getSpecialShopStageInfo(null, shopSubStageEnum.getShopSubStage(), - subStageStatusList, user == null ? null : user.getUserId(), authRegionIds,ownShopFlag,deskRequest ); + subStageStatusList, user == null ? null : user.getUserId(), authRegionIds, ownShopFlag, deskRequest); PageInfo result = new PageInfo<>(specialShopStageInfo); List shopIds = specialShopStageInfo.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList()); List lineIds = specialShopStageInfo.stream().map(ShopStageInfoDO::getLineId).collect(Collectors.toList()); @@ -696,7 +690,7 @@ public class DeskServiceImpl implements DeskService { specialShopStageInfo.forEach(x -> { PreparationCommonPendingVO preparationCommonPendingVO = new PreparationCommonPendingVO(); List remarkInfoMapOrDefault = remarkInfoMap.getOrDefault(x.getShopId(), new ArrayList<>()); - Map remarkInfoMapByStageStatus = remarkInfoMapOrDefault.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopSubStageStatus, Function.identity())); + Map remarkInfoMapByStageStatus = remarkInfoMapOrDefault.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopSubStageStatus, Function.identity())); preparationCommonPendingVO.setBusinessRemark(remarkInfoMapByStageStatus.getOrDefault(x.getShopSubStageStatus(), new ShopStageRemarkInfoDO()).getRemark()); preparationCommonPendingVO.setLineId(x.getLineId()); preparationCommonPendingVO.setShopId(x.getShopId()); @@ -755,9 +749,9 @@ public class DeskServiceImpl implements DeskService { } //平台建店通用查询 - private PageInfo commonPlatformBuild( DeskRequest deskRequest, LoginUserInfo user, List subStageStatusList ) { + private PageInfo commonPlatformBuild(DeskRequest deskRequest, LoginUserInfo user, List subStageStatusList) { PageHelper.startPage(deskRequest); - List operationLogDOList = operationLogDAO.getBySubStageStatusAndUser(user.getUserId(), subStageStatusList,deskRequest); + List operationLogDOList = operationLogDAO.getBySubStageStatusAndUser(user.getUserId(), subStageStatusList, deskRequest); if (CollectionUtils.isEmpty(operationLogDOList)) { return new PageInfo<>(); }