mitao
4 天以前 6365012e69b76d2a7804f5a462745f09a5fa0105
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
44
45
46
47
48
49
50
51
52
package com.ruoyi.web.controller.api;
 
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.dto.asset.AddInventoryTaskDTO;
import com.ruoyi.system.query.AssertInventoryQuery;
import com.ruoyi.system.service.AssetInventoryTaskService;
import com.ruoyi.system.vo.asset.AssetInventoryTaskVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.validation.Valid;
 
/**
 * <p>
 * 盘点任务表 前端控制器
 * </p>
 *
 * @author WuGuanFengYue
 * @since 2025-09-15
 */
@Slf4j
@Api(tags = {"资产盘点相关接口"})
@RestController
@RequestMapping("/asset-inventory-task")
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class AssetInventoryTaskController {
    private final AssetInventoryTaskService assetInventoryTaskService;
 
    @ApiOperation("资产盘点列表")
    @PostMapping("/page")
    public R<IPage<AssetInventoryTaskVO>> getInventoryTaskPage(@RequestBody AssertInventoryQuery query){
        IPage<AssetInventoryTaskVO> page = assetInventoryTaskService.getInventoryTaskPage(query);
        return R.ok(page);
    }
 
    @ApiOperation("创建盘点任务")
    @PostMapping("/create")
    public R<String> createInventoryTask(@RequestBody @Valid AddInventoryTaskDTO dto){
        boolean result = assetInventoryTaskService.createInventoryTask(dto);
        return result ? R.ok("创建成功") : R.fail("创建失败");
    }
 
}