xiaoyi
7 天以前 481d8165f26fc7e37f0e87f6444ac0340bb563a3
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,11 @@
    private HrmEmployeeService employeeService;
    @Resource
    private DeptApi deptApi;
    @Resource
    private StorageAttachmentApi storageAttachmentApi;
    @GetMapping("/page")
    @Operation(summary = "获得薪资发放分页")
    @PreAuthorize("@ss.hasPermission('hrm:salary:query')")
    public CommonResult<PageResult<HrmSalaryPaymentRespVO>> getSalaryPaymentPage(@Valid HrmSalaryPaymentPageReqVO pageReqVO) {
        PageResult<HrmSalaryPaymentDO> pageResult = salaryPaymentService.getSalaryPaymentPage(pageReqVO);
        return success(BeanUtils.toBean(pageResult, HrmSalaryPaymentRespVO.class));
@@ -53,10 +55,11 @@
    @GetMapping("/get")
    @Operation(summary = "获得薪资发放")
    @Parameter(name = "id", description = "发放ID", required = true)
    @PreAuthorize("@ss.hasPermission('hrm:salary: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")
@@ -105,7 +108,6 @@
    @GetMapping("/detail/page")
    @Operation(summary = "获得薪资发放明细分页")
    @PreAuthorize("@ss.hasPermission('hrm:salary: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 +121,6 @@
    @GetMapping("/detail/list")
    @Operation(summary = "获得薪资发放明细列表")
    @Parameter(name = "paymentId", description = "发放台账ID", required = true)
    @PreAuthorize("@ss.hasPermission('hrm:salary:query')")
    public CommonResult<List<HrmSalaryPaymentDetailRespVO>> getSalaryPaymentDetailList(@RequestParam("paymentId") Long paymentId) {
        List<HrmSalaryPaymentDetailDO> detailList = salaryPaymentService.getSalaryPaymentDetailListByPaymentId(paymentId);
        List<HrmSalaryPaymentDetailRespVO> list = BeanUtils.toBean(detailList, HrmSalaryPaymentDetailRespVO.class);
@@ -166,4 +167,4 @@
        }
    }
}
}