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));
|
}
|
|
}
|