diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseclaim/ExpenseClaimServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseclaim/ExpenseClaimServiceImpl.java index 39fa9e4c..2f745891 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseclaim/ExpenseClaimServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/expenseclaim/ExpenseClaimServiceImpl.java @@ -22,6 +22,7 @@ import cn.iocoder.yudao.module.bs.enums.ExpenseApplyStatusEnum; import cn.iocoder.yudao.module.bs.enums.ExpenseClaimSettleStatusEnum; import cn.iocoder.yudao.module.bs.service.budget.BudgetService; import cn.iocoder.yudao.module.bs.service.feemanage.FeeManageService; +import cn.iocoder.yudao.module.bs.service.feemanage.FeeQueryReqVo; import cn.iocoder.yudao.module.system.api.dept.DeptApi; import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import cn.iocoder.yudao.module.system.api.user.AdminUserApi; @@ -153,7 +154,7 @@ public class ExpenseClaimServiceImpl extends MPJBaseServiceImpl0) { return CommonResult.error("第" + aa + "条行程" + ",第" + bb + "条费用明细超出费控设置金额,费控设置金额为:" + setAmount.stripTrailingZeros().toPlainString()); } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/feemanage/FeeManageController.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/feemanage/FeeManageController.java index 359a76e4..f7d64f70 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/feemanage/FeeManageController.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/feemanage/FeeManageController.java @@ -1,13 +1,16 @@ package cn.iocoder.yudao.module.bs.controller.admin.feemanage; +import cn.hutool.crypto.SecureUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.bs.controller.admin.feemanage.vo.*; import cn.iocoder.yudao.module.bs.convert.feemanage.FeeManageConvert; import cn.iocoder.yudao.module.bs.dal.dataobject.feemanage.FeeManageDO; import cn.iocoder.yudao.module.bs.service.feemanage.FeeManageService; +import cn.iocoder.yudao.module.bs.service.feemanage.FeeQueryReqVo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -95,5 +98,11 @@ public class FeeManageController { List datas = FeeManageConvert.INSTANCE.convertList02(list); ExcelUtils.write(response, "费用控制.xls", "数据", FeeManageExcelVO.class, datas); } - + @GetMapping("/findByClaim") + @Operation(summary = "获取费控金额") + @PreAuthorize("@ss.hasPermission('bs:fee-manage:query')") + public CommonResult findByClaim(@Valid @RequestBody FeeQueryReqVo pageVO) { + pageVO.setUserId(SecurityFrameworkUtils.getLoginUserId()); + return success(feeManageService.findByClaim(pageVO)); + } } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/feemanage/vo/FeeManagePageReqVO.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/feemanage/vo/FeeManagePageReqVO.java index 00e1ca11..cbc2827b 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/feemanage/vo/FeeManagePageReqVO.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/controller/admin/feemanage/vo/FeeManagePageReqVO.java @@ -20,7 +20,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ToString(callSuper = true) public class FeeManagePageReqVO extends PageParam { - @Schema(description = "部门ID", example = "29962") + @Schema(description = "费用部门ID", example = "29962") private Long deptId; @Schema(description = "角色") diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageService.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageService.java index c82adf00..c6d67764 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageService.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageService.java @@ -74,5 +74,5 @@ public interface FeeManageService extends MPJBaseService { */ List getFeeManageList(FeeManageExportReqVO exportReqVO); - BigDecimal findByClaim(String feeType, Long id, Long costDeptId, String destinationLocation); + BigDecimal findByClaim(FeeQueryReqVo feeQueryReqVo); } diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageServiceImpl.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageServiceImpl.java index d4afd412..2c62cbe1 100644 --- a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageServiceImpl.java +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeManageServiceImpl.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.bs.service.feemanage; -import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.NumberUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; @@ -119,11 +118,11 @@ public class FeeManageServiceImpl extends MPJBaseServiceImpl roleIds = permissionApi.getUserRoleIdListByUserId(userId); + public BigDecimal findByClaim(FeeQueryReqVo feeQueryReqVo) { + Set roleIds = permissionApi.getUserRoleIdListByUserId(feeQueryReqVo.getUserId()); BigDecimal amount = null; for (Long roleId : roleIds) { - LambdaQueryWrapperX queryWrapperX = getFeeManageByUniq(roleId, destinationLocation, costDeptId, feeType); + LambdaQueryWrapperX queryWrapperX = getFeeManageByUniq(roleId, feeQueryReqVo.getDestinationLocation(), feeQueryReqVo.getCostDeptId(), feeQueryReqVo.getFeeType()); FeeManageDO feeManageDO = getOne(queryWrapperX); if (feeManageDO !=null) { if (amount == null) { diff --git a/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeQueryReqVo.java b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeQueryReqVo.java new file mode 100644 index 00000000..97727813 --- /dev/null +++ b/yudao-module-bs/yudao-module-bs-biz/src/main/java/cn/iocoder/yudao/module/bs/service/feemanage/FeeQueryReqVo.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.bs.service.feemanage; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@AllArgsConstructor +@Data +public class FeeQueryReqVo { + private String feeType; + private Long userId; + private Long costDeptId; + private String destinationLocation; + +}