gaoluyang
8 天以前 9e9f0e2d9f6fcce7dcea88b181b3c7e6069e8a1b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package cn.iocoder.yudao.module.hrm.controller.admin.asset;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.hrm.controller.admin.asset.vo.HrmAssetHandoverPageReqVO;
import cn.iocoder.yudao.module.hrm.controller.admin.asset.vo.HrmAssetHandoverRespVO;
import cn.iocoder.yudao.module.hrm.controller.admin.asset.vo.HrmAssetHandoverSaveReqVO;
import cn.iocoder.yudao.module.hrm.service.asset.HrmAssetService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
@Tag(name = "管理后台 - HRM 资产交接记录")
@RestController
@RequestMapping("/hrm/asset/handover")
@Validated
public class HrmAssetHandoverController {
 
    @Resource
    private HrmAssetService assetService;
 
    @PostMapping("/create")
    @Operation(summary = "新增资产交接记录", description = "领用后资产变为在用、变更为接收方;归还后资产变为闲置、清空使用人;调拨只变更使用人与部门")
    @PreAuthorize("@ss.hasPermission('hrm:asset-handover:create')")
    public CommonResult<Long> createAssetHandover(@Valid @RequestBody HrmAssetHandoverSaveReqVO createReqVO) {
        return success(assetService.createAssetHandover(createReqVO));
    }
 
    @GetMapping("/page")
    @Operation(summary = "获得资产交接记录分页")
    @PreAuthorize("@ss.hasPermission('hrm:asset-handover:query')")
    public CommonResult<PageResult<HrmAssetHandoverRespVO>> getAssetHandoverPage(
            @Valid HrmAssetHandoverPageReqVO pageReqVO) {
        return success(assetService.getAssetHandoverPage(pageReqVO));
    }
 
}