Merge branch 'cc_20240918_data_insulate' into 'master'

数据隔离

See merge request hangzhou/java/custom_zxjp!18
This commit is contained in:
苏竹红
2024-09-26 09:33:49 +00:00
8 changed files with 50 additions and 11 deletions

View File

@@ -247,8 +247,10 @@ public class ShopStageInfoDAO {
}
public List<ShopStageInfoDO> getSpecialShopStageInfo(List<Long> shopIds, Integer shopSubStage,
List<Integer> shopSubStageStatusList,String investmentUserId){
return shopStageInfoMapper.getSpecialShopStageInfo( shopIds, shopSubStage, shopSubStageStatusList,investmentUserId);
List<Integer> shopSubStageStatusList,
String investmentUserId,
List<String> authRegionIds){
return shopStageInfoMapper.getSpecialShopStageInfo( shopIds, shopSubStage, shopSubStageStatusList,investmentUserId,authRegionIds);
}
/**
* @Auther: wangshuo

View File

@@ -130,7 +130,7 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
List<ShopStageInfoDO> getSpecialShopStageInfo(@Param("shopIds") List<Long> shopIds,
@Param("shopSubStage") Integer shopSubStage,
@Param("shopSubStageStatusList") List<Integer> shopSubStageStatusList,
@Param("investmentUserId") String investmentUserId);
@Param("investmentUserId") String investmentUserId, @Param("authRegionIds") List<String> authRegionIds);
List<ShopStageInfoDO> getSubStageList(@Param("shopIds") List<Long> shopIds,@Param("shopSubStage") Integer shopSubStage);
/**

View File

@@ -74,6 +74,12 @@
#{regionId}
</foreach>
</if>
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
and si.region_id in
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
</select>

View File

@@ -237,6 +237,9 @@
<if test="investmentUserId!=null and investmentUserId!=''">
left join xfsg_line_info b on a.line_id = b.id
</if>
<if test="authRegionIds != null and authRegionIds.size() > 0">
left join xfsg_shop_info si on a.shop_id = si.id
</if>
<where>
<if test="shopIds != null and shopIds.size() > 0">
and a.shop_id in
@@ -253,9 +256,15 @@
#{stageStatus}
</foreach>
</if>
<if test="investmentUserId!=null and investmentUserId!=''">
<if test="investmentUserId!=null and investmentUserId!='' and authRegionIds.size()==0">
and b.investment_manager = #{investmentUserId}
</if>
<if test="authRegionIds != null and authRegionIds.size() > 0">
and si.region_id in
<foreach collection="authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
</where>
</select>

View File

@@ -31,4 +31,9 @@ public class PlanListRequest {
@ApiModelProperty ("分页大小")
private Integer pageSize;
@ApiModelProperty(value = "当前登录用户", hidden = true)
private String curUserId;
@ApiModelProperty(value = "管辖区域",hidden = true)
private List<String> authRegionIds;
}

View File

@@ -17,6 +17,8 @@ import com.cool.store.mapper.IntentAgreementMapper;
import com.cool.store.mapper.TrainingExperienceMapper;
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.StringUtil;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.poi.constant.Constants;
@@ -62,6 +64,10 @@ public class DeskServiceImpl implements DeskService {
EnterpriseUserDAO enterpriseUserDAO;
@Resource
RegionService regionService;
@Resource
SysRoleService sysRoleService;
@Resource
UserAuthMappingService userAuthMappingService;
@Override
public PageInfo<IntendPendingVO> intendPendingList(Integer pageNum, Integer pageSize,String userId) {
@@ -333,18 +339,18 @@ public class DeskServiceImpl implements DeskService {
@Override
public PageInfo<PreparationCommonPendingVO> payFranchiseFeesPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7,
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus()), Constants.ZERO_INTEGER);
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus()), Boolean.FALSE);
}
@Override
public PageInfo<PreparationCommonPendingVO> signingOfFranchiseContractPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPendingVOPageInfo(pageNum, pageSize, null, ShopSubStageEnum.SHOP_STAGE_8,
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_80.getShopSubStageStatus(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_85.getShopSubStageStatus()), Constants.ZERO_INTEGER);
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_8,
Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_80.getShopSubStageStatus(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_85.getShopSubStageStatus()), Boolean.TRUE);
}
@Override
public PageInfo<PreparationCommonPendingVO> openingAndOperationPlanPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_14, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_140.getShopSubStageStatus()), Constants.ONE_INTEGER);
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_14, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_140.getShopSubStageStatus()), Boolean.FALSE);
}
@Override
@@ -362,11 +368,17 @@ public class DeskServiceImpl implements DeskService {
* @param subStageStatusList
* @return
*/
private PageInfo<PreparationCommonPendingVO> commonPendingVOPageInfo(Integer pageNum, Integer pageSize, LoginUserInfo user,ShopSubStageEnum shopSubStageEnum,List<Integer> subStageStatusList,Integer type){
private PageInfo<PreparationCommonPendingVO> commonPendingVOPageInfo(Integer pageNum, Integer pageSize, LoginUserInfo user,ShopSubStageEnum shopSubStageEnum,List<Integer> subStageStatusList,Boolean filterFlag){
PageHelper.startPage(pageNum, pageSize);
//user.getJobNumber()
List<String> authRegionIds = new ArrayList<>();
if (filterFlag){
if (!sysRoleService.checkIsAdmin(user.getUserId())) {
authRegionIds = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(user.getUserId());
}
}
List<ShopStageInfoDO> specialShopStageInfo = shopStageInfoDAO.getSpecialShopStageInfo(null, shopSubStageEnum.getShopSubStage(),
subStageStatusList, user==null?null:user.getUserId());
subStageStatusList, user==null?null:user.getUserId(),authRegionIds);
PageInfo result = new PageInfo<>(specialShopStageInfo);
List<Long> shopIds = specialShopStageInfo.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
List<Long> lineIds = specialShopStageInfo.stream().map(ShopStageInfoDO::getLineId).collect(Collectors.toList());

View File

@@ -65,6 +65,8 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
@Resource
UserAuthMappingService userAuthMappingService;
@Resource
SysRoleService sysRoleService;
@Override
@Transactional(rollbackFor = Exception.class)
@@ -147,6 +149,9 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
@Override
public PageInfo<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
log.info("getPlanListPage request:{}", JSONObject.toJSONString(request));
if (!sysRoleService.checkIsAdmin(request.getCurUserId())) {
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(request.getCurUserId()));
}
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
//不指定时间为3个月数据 去shop_info表查询店铺名字店铺code开店负责人id督导id区域idopen_plan,提交时间,审核状态
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = openingOperationPlanDAO.getOpenPlanShopListByCondition(request);

View File

@@ -73,7 +73,7 @@ public class PCOpenPreparationController {
@PostMapping("/openingOperationPlan/planList")
@ApiOperation("查询运营方案列表")
public ResponseResult<PageInfo<OpeningOperationPlanListVO>> planList(@RequestBody PlanListRequest request) {
request.setCurUserId(CurrentUserHolder.getUserId());
return ResponseResult.success(openingOperationPlanService.getPlanListPage(request));
}
@PostMapping("/openingOperationPlan/audit")