鉴权相关操作还原

This commit is contained in:
hejiayang
2025-12-15 09:10:22 +08:00
parent 8763fd66e6
commit a939ff4f4b
3 changed files with 70 additions and 70 deletions
@@ -294,18 +294,18 @@ public class StBbzxOrderInfoController {
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//餐品总库只查询内置食堂
// if(sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_0) || sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_1)){
// // 后期分数据权限时在解开注释,此处管理员账户能看到所有食堂数据
//// ScreenVo screenVo = new ScreenVo();
//// screenVo.setId(CommonConstant.INLAY_CANTEEN_ID);
//// canteenIdList.add(screenVo);
// } else if (sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_4)) {
// //查询当前登录用户的食堂列表
// String canteenId = sysUser.getCanteenId();
// query.setCanteenId(canteenId);
// } else {
// return Result.OK();
// }
if(sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_0) || sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_1)){
// 后期分数据权限时在解开注释,此处管理员账户能看到所有食堂数据
// ScreenVo screenVo = new ScreenVo();
// screenVo.setId(CommonConstant.INLAY_CANTEEN_ID);
// canteenIdList.add(screenVo);
} else if (sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_4)) {
//查询当前登录用户的食堂列表
String canteenId = sysUser.getCanteenId();
query.setCanteenId(canteenId);
} else {
return Result.OK();
}
query.setStatus(3);//(充值=102
return Result.OK(iStClientMemberTransactionRecordService.pageQuery(query));
}
@@ -323,20 +323,20 @@ public class StBbzxOrderInfoController {
query.setStartTime(split[0]);
query.setEndTime(split[1]);
}
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// //餐品总库只查询内置食堂
// if(sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_0) || sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_1)){
// // 后期分数据权限时在解开注释,此处管理员账户能看到所有食堂数据
//// ScreenVo screenVo = new ScreenVo();
//// screenVo.setId(CommonConstant.INLAY_CANTEEN_ID);
//// canteenIdList.add(screenVo);
// } else if (sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_4)) {
// //查询当前登录用户的食堂列表
// String canteenId = sysUser.getCanteenId();
// query.setCanteenId(canteenId);
// } else {
// return Result.OK();
// }
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//餐品总库只查询内置食堂
if(sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_0) || sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_1)){
// 后期分数据权限时在解开注释,此处管理员账户能看到所有食堂数据
// ScreenVo screenVo = new ScreenVo();
// screenVo.setId(CommonConstant.INLAY_CANTEEN_ID);
// canteenIdList.add(screenVo);
} else if (sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_4)) {
//查询当前登录用户的食堂列表
String canteenId = sysUser.getCanteenId();
query.setCanteenId(canteenId);
} else {
return Result.OK();
}
query.setStatus(3);//(充值=102
List<StClientMemberTransactionRecordVO> statisticsCanteenBusiness = iStClientMemberTransactionRecordService.queryList(query);
StClientMemberTransactionRecordVO sumResult = GenericSumUtil.sumList(statisticsCanteenBusiness, StClientMemberTransactionRecordVO.class);
@@ -358,20 +358,20 @@ public class StBbzxOrderInfoController {
query.setStartTime(split[0]);
query.setEndTime(split[1]);
}
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// //餐品总库只查询内置食堂
// if(sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_0) || sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_1)){
// // 后期分数据权限时在解开注释,此处管理员账户能看到所有食堂数据
//// ScreenVo screenVo = new ScreenVo();
//// screenVo.setId(CommonConstant.INLAY_CANTEEN_ID);
//// canteenIdList.add(screenVo);
// } else if (sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_4)) {
// //查询当前登录用户的食堂列表
// String canteenId = sysUser.getCanteenId();
// query.setCanteenId(canteenId);
// } else {
// return;
// }
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//餐品总库只查询内置食堂
if(sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_0) || sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_1)){
// 后期分数据权限时在解开注释,此处管理员账户能看到所有食堂数据
// ScreenVo screenVo = new ScreenVo();
// screenVo.setId(CommonConstant.INLAY_CANTEEN_ID);
// canteenIdList.add(screenVo);
} else if (sysUser.getUserIdentity().equals(CommonConstant.USER_IDENTITY_4)) {
//查询当前登录用户的食堂列表
String canteenId = sysUser.getCanteenId();
query.setCanteenId(canteenId);
} else {
return;
}
query.setStatus(3);//(充值=102
List<StClientMemberTransactionRecordVO> statisticsCanteenBusiness = iStClientMemberTransactionRecordService.queryList(query);
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(statisticsCanteenBusiness)){
@@ -445,15 +445,15 @@ public class StBbzxOrderInfoServiceImpl extends JeecgServiceImpl<StBbzxOrderInfo
//权限校验
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> canteenIds = new ArrayList<>();
// if(StringUtils.isEmpty(canteenId)){
// if(sysUser != null){
// canteenIds = sysUser.getCanteenIdList().stream().map(ScreenVo::getId).collect(Collectors.toList());
// }
// }else {
if(StringUtils.isEmpty(canteenId)){
if(sysUser != null){
canteenIds = sysUser.getCanteenIdList().stream().map(ScreenVo::getId).collect(Collectors.toList());
}
}else {
canteenIds = Collections.singletonList(canteenId);
// }
}
//获取数据列表
List<StatisticsTheAmountSpentVo> statisticsTheAmountSpentVos = baseMapper.statisticsTheAmountSpent(canteenIds, startDate, endDate);
if(CollectionUtils.isEmpty(statisticsTheAmountSpentVos)){
@@ -505,15 +505,15 @@ public class StBbzxOrderInfoServiceImpl extends JeecgServiceImpl<StBbzxOrderInfo
//权限校验
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> canteenIds = new ArrayList<>();
// if(StringUtils.isEmpty(canteenId)){
// if(sysUser != null){
// canteenIds = sysUser.getCanteenIdList().stream().map(ScreenVo::getId).collect(Collectors.toList());
// }
// }else {
if(StringUtils.isEmpty(canteenId)){
if(sysUser != null){
canteenIds = sysUser.getCanteenIdList().stream().map(ScreenVo::getId).collect(Collectors.toList());
}
}else {
canteenIds = Collections.singletonList(canteenId);
// }
}
//获取数据列表
List<StatisticsTheAmountSpentVo> statisticsTheAmountSpentVos = baseMapper.statisticsTheAmountSpent(canteenIds, startDate, endDate);
if(CollectionUtils.isEmpty(statisticsTheAmountSpentVos)){
@@ -577,16 +577,16 @@ public class StBbzxOrderInfoServiceImpl extends JeecgServiceImpl<StBbzxOrderInfo
eatDay = startDate + "~" + endDate;
}
//权限校验
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// List<String> canteenIds = new ArrayList<>();
// if(StringUtils.isEmpty(canteenId)){
// if(sysUser != null){
// canteenIds = sysUser.getCanteenIdList().stream().map(ScreenVo::getId).collect(Collectors.toList());
// }
// }else {
// canteenIds = Collections.singletonList(canteenId);
// }
List<StatisticsTheAmountSpentVo> statisticsTheAmountSpentVos = baseMapper.statisticsTheAmountSpentEveryMember(null,name,payName,startDate, endDate, secondDepartId, thirdDepartId);
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> canteenIds = new ArrayList<>();
if(StringUtils.isEmpty(canteenId)){
if(sysUser != null){
canteenIds = sysUser.getCanteenIdList().stream().map(ScreenVo::getId).collect(Collectors.toList());
}
}else {
canteenIds = Collections.singletonList(canteenId);
}
List<StatisticsTheAmountSpentVo> statisticsTheAmountSpentVos = baseMapper.statisticsTheAmountSpentEveryMember(canteenIds,name,payName,startDate, endDate, secondDepartId, thirdDepartId);
if(CollectionUtils.isEmpty(statisticsTheAmountSpentVos)){
return new Page<>();
}
@@ -34,11 +34,11 @@ public class StBaseRestaurantDeptController {
@Operation(summary = "获得食堂数据", description= "获得食堂数据")
@GetMapping(value = "/getRestaurantList")
public Result<?> getRestaurantList() {
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// List<ScreenVo> list = user.getCanteenIdList();
// if(CollectionUtils.isNotEmpty(list)){
// return Result.OK(list);
// } else {//解决管理员(医生)角色,查看 营养监控 没有食堂列表问题
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<ScreenVo> list = user.getCanteenIdList();
if(CollectionUtils.isNotEmpty(list)){
return Result.OK(list);
} else {//解决管理员(医生)角色,查看 营养监控 没有食堂列表问题
List<ScreenVo> screenVoArrayList = new ArrayList<>();
List<SlBaseRestaurant> slBaseRestaurantList = slBaseRestaurantService.list();
if(CollectionUtils.isNotEmpty(slBaseRestaurantList)){
@@ -52,7 +52,7 @@ public class StBaseRestaurantDeptController {
});
}
return Result.OK(screenVoArrayList);
// }
}
}
@Operation(summary = "获得食堂数据", description= "获得食堂数据")