取消鉴权操作

1. 流水明细
2. 充值记录
3. 个人消费统计
4. 食堂消费统计
This commit is contained in:
hejiayang
2025-12-11 17:01:49 +08:00
parent e94886989a
commit e364fad645
4 changed files with 104 additions and 102 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)){
@@ -393,6 +393,7 @@ public class StClientMemberBalanceController {
@PostMapping("/backOutTopUpAll")
@Operation(summary = "用户充值-撤销充值(线下线下二合一)", description = "流水表主键id")
@AutoLog(value = "户充值-撤销充值(线下线下二合一)")
public Result<?> backOutTopUpAll(@RequestBody StClientMemberBackTopUpQueryDto query) throws Exception {
if(StringUtils.isBlank(query.getCanteenId())){//当前食堂管理员撤销充值该食堂的充值记录
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -409,7 +410,7 @@ public class StClientMemberBalanceController {
@PostMapping("/changeBalanceAndIntegral")
@Operation(summary = "用户充值-余额调整", description = "传入条件")
@SendNotification()
@AutoLog(value = "用户充值-余额调整")
public Result<?> changeBalanceAndIntegral(@RequestBody StClientMemberChangeBalanceDTO query) {
if(StringUtils.isBlank(query.getCanteenId())){//当前食堂管理员撤销充值该食堂的充值记录
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -434,9 +435,10 @@ public class StClientMemberBalanceController {
query.setStartTime(query.getDates().get(0));
query.setEndTime(query.getDates().get(1));
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String canteenId = sysUser.getCanteenId();
query.setCanteenId(canteenId);
//余: 去掉鉴权, 要能看到所有的
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// String canteenId = sysUser.getCanteenId();
// query.setCanteenId(canteenId);
//消费=101
query.setStatus(101);
return Result.OK(iStClientMemberTransactionRecordService.pageQueryNew(query));
@@ -455,20 +457,20 @@ public class StClientMemberBalanceController {
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(1);//消费=101
List<StClientMemberTransactionRecordVO> statisticsCanteenBusiness = iStClientMemberTransactionRecordService.queryList(query);
StClientMemberTransactionRecordVO sumResult = GenericSumUtil.sumList(statisticsCanteenBusiness, StClientMemberTransactionRecordVO.class);
@@ -495,20 +497,20 @@ public class StClientMemberBalanceController {
if(StringUtils.isNotBlank(query.getEndDate())){
query.setEndTime(query.getEndDate());
}
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(1);//消费=101
List<StClientMemberTransactionRecordVO> statisticsCanteenBusiness = iStClientMemberTransactionRecordService.queryList(query);
@@ -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(canteenIds,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(null,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= "获得食堂数据")