| | |
| | | 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> |
| | |
| | | * @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("创建失败"); |
| | | } |
| | | |
| | | } |
| | | |