yudao-module-hrm/src/main/java/cn/iocoder/yudao/module/hrm/controller/admin/salary/HrmSalaryPaymentController.java
@@ -15,6 +15,7 @@
import cn.iocoder.yudao.module.hrm.service.salary.HrmSalaryPaymentService;
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.storage.StorageAttachmentApi;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -41,10 +42,12 @@
    private HrmEmployeeService employeeService;
    @Resource
    private DeptApi deptApi;
    @Resource
    private StorageAttachmentApi storageAttachmentApi;
    @GetMapping("/page")
    @Operation(summary = "获得薪资发放分页")
    @PreAuthorize("@ss.hasPermission('hrm:salary:query')")
    @PreAuthorize("@ss.hasPermission('hrm:salary-payment:query')")
    public CommonResult<PageResult<HrmSalaryPaymentRespVO>> getSalaryPaymentPage(@Valid HrmSalaryPaymentPageReqVO pageReqVO) {
        PageResult<HrmSalaryPaymentDO> pageResult = salaryPaymentService.getSalaryPaymentPage(pageReqVO);
        return success(BeanUtils.toBean(pageResult, HrmSalaryPaymentRespVO.class));
@@ -53,16 +56,18 @@
    @GetMapping("/get")
    @Operation(summary = "获得薪资发放")
    @Parameter(name = "id", description = "发放ID", required = true)
    @PreAuthorize("@ss.hasPermission('hrm:salary:query')")
    @PreAuthorize("@ss.hasPermission('hrm:salary-payment:query')")
    public CommonResult<HrmSalaryPaymentRespVO> getSalaryPayment(@RequestParam("id") Long id) {
        HrmSalaryPaymentDO salaryPayment = salaryPaymentService.getSalaryPayment(id);
        return success(BeanUtils.toBean(salaryPayment, HrmSalaryPaymentRespVO.class));
        HrmSalaryPaymentRespVO respVO = BeanUtils.toBean(salaryPayment, HrmSalaryPaymentRespVO.class);
        respVO.setAttachmentList(storageAttachmentApi.listAttachments("hrm_salary_payment", id));
        return success(respVO);
    }
    @PostMapping("/generate")
    @Operation(summary = "生成薪资发放台账")
    @Parameter(name = "period", description = "核算周期", required = true, example = "2024-01")
    @PreAuthorize("@ss.hasPermission('hrm:salary:generate')")
    @PreAuthorize("@ss.hasPermission('hrm:salary-payment:generate')")
    public CommonResult<Long> generatePayment(@RequestParam("period") String period) {
        return success(salaryPaymentService.generatePayment(period));
    }
@@ -70,7 +75,7 @@
    @PostMapping("/pay")
    @Operation(summary = "发放薪资(整个台账)")
    @Parameter(name = "id", description = "发放台账ID", required = true)
    @PreAuthorize("@ss.hasPermission('hrm:salary:pay')")
    @PreAuthorize("@ss.hasPermission('hrm:salary-payment:pay')")
    public CommonResult<Boolean> paySalary(@RequestParam("id") Long id) {
        salaryPaymentService.paySalary(id);
        return success(true);
@@ -78,7 +83,7 @@
    @PostMapping("/pay-detail")
    @Operation(summary = "批量发放薪资明细")
    @PreAuthorize("@ss.hasPermission('hrm:salary:pay')")
    @PreAuthorize("@ss.hasPermission('hrm:salary-payment:pay')")
    public CommonResult<Boolean> paySalaryDetail(@RequestBody Map<String, List<Long>> request) {
        List<Long> detailIds = request.get("detailIds");
        salaryPaymentService.paySalaryDetail(detailIds);
@@ -87,7 +92,7 @@
    @PostMapping("/revoke-detail")
    @Operation(summary = "批量撤销薪资发放明细")
    @PreAuthorize("@ss.hasPermission('hrm:salary:pay')")
    @PreAuthorize("@ss.hasPermission('hrm:salary-payment:pay')")
    public CommonResult<Boolean> revokeSalaryPaymentDetail(@RequestBody Map<String, List<Long>> request) {
        List<Long> detailIds = request.get("detailIds");
        salaryPaymentService.revokeSalaryPaymentDetail(detailIds);
@@ -97,7 +102,7 @@
    @DeleteMapping("/delete")
    @Operation(summary = "删除薪资发放台账")
    @Parameter(name = "id", description = "发放台账ID", required = true)
    @PreAuthorize("@ss.hasPermission('hrm:salary:delete')")
    @PreAuthorize("@ss.hasPermission('hrm:salary-payment:delete')")
    public CommonResult<Boolean> deleteSalaryPayment(@RequestParam("id") Long id) {
        salaryPaymentService.deleteSalaryPayment(id);
        return success(true);
@@ -105,7 +110,7 @@
    @GetMapping("/detail/page")
    @Operation(summary = "获得薪资发放明细分页")
    @PreAuthorize("@ss.hasPermission('hrm:salary:query')")
    @PreAuthorize("@ss.hasPermission('hrm:salary-payment:query')")
    public CommonResult<PageResult<HrmSalaryPaymentDetailRespVO>> getSalaryPaymentDetailPage(@Valid HrmSalaryPaymentDetailPageReqVO pageReqVO) {
        PageResult<HrmSalaryPaymentDetailDO> pageResult = salaryPaymentService.getSalaryPaymentDetailPage(pageReqVO);
        List<HrmSalaryPaymentDetailRespVO> list = BeanUtils.toBean(pageResult.getList(), HrmSalaryPaymentDetailRespVO.class);
@@ -119,7 +124,7 @@
    @GetMapping("/detail/list")
    @Operation(summary = "获得薪资发放明细列表")
    @Parameter(name = "paymentId", description = "发放台账ID", required = true)
    @PreAuthorize("@ss.hasPermission('hrm:salary:query')")
    @PreAuthorize("@ss.hasPermission('hrm:salary-payment:query')")
    public CommonResult<List<HrmSalaryPaymentDetailRespVO>> getSalaryPaymentDetailList(@RequestParam("paymentId") Long paymentId) {
        List<HrmSalaryPaymentDetailDO> detailList = salaryPaymentService.getSalaryPaymentDetailListByPaymentId(paymentId);
        List<HrmSalaryPaymentDetailRespVO> list = BeanUtils.toBean(detailList, HrmSalaryPaymentDetailRespVO.class);