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 06dbc9d04..050cad791 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 @@ -270,11 +270,11 @@ public class ShopStageInfoDAO { return shopStageInfoMapper.updateShopStageAndAuditInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark, auditId); } - public Page getRentContractToDoPage(String userId, Integer pageNum, Integer pageSize,List authRegionIds,String keyword) { + public Page getRentContractToDoPage(String userId, Integer pageNum, + Integer pageSize,List authRegionIds,String keyword,List subStageStatusEnum) { PageHelper.startPage(pageNum, pageSize); - ShopSubStageStatusEnum shopSubStageStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21; - return shopStageInfoMapper.getRentContractToDoPage(userId, shopSubStageStatus.getShopSubStageEnum().getShopSubStage(), - shopSubStageStatus.getShopSubStageStatus(),authRegionIds,keyword); + return shopStageInfoMapper.getRentContractToDoPage(userId, ShopSubStageEnum.SHOP_STAGE_2.getShopSubStage(), + subStageStatusEnum,authRegionIds,keyword); } public List getShopIdListByStageStatus(Integer shopSubStageStatus) { diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/mapper/ShopStageInfoMapper.java b/coolstore-partner-dao/src/main/java/com/cool/store/mapper/ShopStageInfoMapper.java index dd853a92d..93e61b417 100644 --- a/coolstore-partner-dao/src/main/java/com/cool/store/mapper/ShopStageInfoMapper.java +++ b/coolstore-partner-dao/src/main/java/com/cool/store/mapper/ShopStageInfoMapper.java @@ -118,7 +118,7 @@ public interface ShopStageInfoMapper extends Mapper { */ Page getRentContractToDoPage(@Param("userId") String userId, @Param("shopSubStage")Integer shopSubStage, - @Param("shopSubStageStatus") Integer shopSubStageStatus, + @Param("shopSubStageStatusList") List shopSubStageStatusList, @Param("authRegionIds") List authRegionIds, @Param("keyword") String keyword); List getShopIdListByStageStatus(@Param("shopSubStageStatus") Integer shopSubStageStatus); diff --git a/coolstore-partner-dao/src/main/resources/mapper/ShopStageInfoMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/ShopStageInfoMapper.xml index a7dc9bdc7..cf1efb325 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/ShopStageInfoMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/ShopStageInfoMapper.xml @@ -245,9 +245,14 @@ left join xfsg_shop_info c on a.shop_id = c.id where c.deleted=0 and a.shop_sub_stage = #{shopSubStage} - and a.shop_sub_stage_status = #{shopSubStageStatus} and a.deleted = 0 and b.deleted = 0 + + and a.shop_sub_stage_status in + + #{shopSubStageStatus} + + and c.invest_region_id in diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/PointServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/PointServiceImpl.java index 5808f4445..686c261e7 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/PointServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/PointServiceImpl.java @@ -32,6 +32,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.google.common.collect.Lists; +import io.swagger.models.auth.In; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; @@ -50,6 +51,9 @@ import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; +import static com.cool.store.enums.point.ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21; +import static com.cool.store.enums.point.ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21_5; + /** * @author zhangchenbiao * @FileName: ShopPointServiceImpl @@ -1235,7 +1239,7 @@ public class PointServiceImpl implements PointService { MessageEnum.MESSAGE_15, map); } - return shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21); + return shopStageInfoDAO.updateShopStageInfo(shopId, SHOP_SUB_STAGE_STATUS_21); } @Override @@ -1274,8 +1278,8 @@ public class PointServiceImpl implements PointService { } ShopStageInfoDO shopStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_2); //招商大区总审核 或者 分部内勤审核 其他状态不能审核 - if (!(shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus())|| - shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21_5.getShopSubStageStatus()))) { + if (!(shopStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus())|| + shopStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_21_5.getShopSubStageStatus()))) { throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE); } @@ -1283,10 +1287,10 @@ public class PointServiceImpl implements PointService { ShopSubStageStatusEnum subStageStatus = null; if (AuditResultTypeEnum.PASS.getCode().equals(request.getResultType())){ - if (shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus())){ - subStageStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21_5; + if (shopStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus())){ + subStageStatus = SHOP_SUB_STAGE_STATUS_21_5; } - if (shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21_5.getShopSubStageStatus())){ + if (shopStageInfo.getShopSubStageStatus().equals(SHOP_SUB_STAGE_STATUS_21_5.getShopSubStageStatus())){ subStageStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_23; } }else { @@ -1328,7 +1332,7 @@ public class PointServiceImpl implements PointService { ShopRentInfoDO shopRentInfo = UpdateRentContractRequest.convertDO(request); ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_2); if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_22.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())) { - shopStageInfoDAO.updateShopStageAndAuditInfo(shopRentInfo.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21, null); + shopStageInfoDAO.updateShopStageAndAuditInfo(shopRentInfo.getShopId(), SHOP_SUB_STAGE_STATUS_21, null); LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopSubStageInfo.getLineId()); ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopSubStageInfo.getShopId()); if (shopInfo!=null){ @@ -1370,10 +1374,20 @@ public class PointServiceImpl implements PointService { public PageInfo getRentContractToDoPage(String userId, Integer pageNumber, Integer pageSize,String keyword) { List authRegionIds = new ArrayList<>(); //如果是管理员 查询所有 如果是其他角色 根据管辖大区权限查询 菜单根据配置来 + List list = new ArrayList<>(); if (!sysRoleService.checkIsAdmin(userId)) { authRegionIds = userAuthMappingService.getAuthRegionIdByUserId(userId,Boolean.TRUE); + List sysRoleDOS = sysRoleMapper.listRoleByUserId(userId); + if (sysRoleDOS.stream().anyMatch(x -> x.getId().equals(UserRoleEnum.REGION_MANAGER.getCode()))) { + list.add(SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus()); + } + if (sysRoleDOS.stream().anyMatch(x -> x.getId().equals(UserRoleEnum.BRANCH_OFFICE.getCode()))) { + list.add(SHOP_SUB_STAGE_STATUS_21_5.getShopSubStageStatus()); + } + }else { + list.addAll(Arrays.asList(SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus(),SHOP_SUB_STAGE_STATUS_21_5.getShopSubStageStatus())); } - Page todoPage = shopStageInfoDAO.getRentContractToDoPage(userId, pageNumber, pageSize,authRegionIds,keyword); + Page todoPage = shopStageInfoDAO.getRentContractToDoPage(userId, pageNumber, pageSize,authRegionIds,keyword,list); List resultList = null; if (Objects.nonNull(todoPage) && CollectionUtils.isNotEmpty(todoPage.getResult())) { List shopIds = todoPage.getResult().stream().map(RentInfoToDoVO::getShopId).collect(Collectors.toList());