buhuazhen
2 天以前 d562551c7efd2c19fd037ab4fb1b7a355ff80f42
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.ruoyi.consumables.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum;
import com.ruoyi.common.enums.StockOutUnQualifiedRecordTypeEnum;
import com.ruoyi.consumables.dto.ConsumablesInventoryDto;
import com.ruoyi.consumables.dto.ConsumablesUnInventoryDto;
import com.ruoyi.consumables.service.ConsumablesUnInventoryService;
import com.ruoyi.framework.web.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletResponse;
 
/**
 * <p>
 * 耗材不合格库存表 前端控制器
 * </p>
 *
 * @author 芯导软件(江苏)有限公司
 * @since 2026-01-22 10:17:45
 */
@Api(tags = "耗材不合格")
@RestController
@RequestMapping("/consumablesUnInventory")
public class ConsumablesUnInventoryController {
    @Autowired
    private ConsumablesUnInventoryService consumablesUnInventoryService;
 
    @GetMapping("/pageConsumablesUnInventory")
    @ApiOperation("分页查询库存")
    public R pageConsumablesUnInventory(Page page, ConsumablesUnInventoryDto consumablesUnInventoryDto) {
        IPage<ConsumablesUnInventoryDto> ConsumablesUnInventoryDtoIPage = consumablesUnInventoryService.pageConsumablesUnInventory(page, consumablesUnInventoryDto);
        return R.ok(ConsumablesUnInventoryDtoIPage);
    }
 
    @PostMapping("/addConsumablesUnInventory")
    @ApiOperation("新增库存")
    public R addConsumablesUnInventory(@RequestBody ConsumablesUnInventoryDto consumablesUnInventoryDto) {
        consumablesUnInventoryDto.setRecordType(String.valueOf(StockInUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_IN.getCode()));
        consumablesUnInventoryDto.setRecordId(0L);
        return R.ok(consumablesUnInventoryService.addConsumablesUnInventory(consumablesUnInventoryDto));
    }
 
 
    @PostMapping("/subtractConsumablesUnInventory")
    @ApiOperation("扣减库存")
    public R subtractConsumablesUnInventory(@RequestBody ConsumablesUnInventoryDto consumablesUnInventoryDto) {
        consumablesUnInventoryDto.setRecordType(String.valueOf(StockOutUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_OUT.getCode()));
        consumablesUnInventoryDto.setRecordId(0L);
        return R.ok(consumablesUnInventoryService.subtractConsumablesUnInventory(consumablesUnInventoryDto));
    }
 
    @PostMapping("/exportConsumablesUnInventory")
    @ApiOperation("导出库存")
    public void exportConsumablesUnInventory(HttpServletResponse response, ConsumablesUnInventoryDto consumablesUnInventoryDto) {
        consumablesUnInventoryService.exportConsumablesUnInventory(response,consumablesUnInventoryDto);
    }
 
 
    @PostMapping("/frozenConsumables")
    @ApiOperation("冻结库存")
    public R frozenConsumables(@RequestBody ConsumablesInventoryDto consumablesUnInventoryDto) {
        return R.ok(consumablesUnInventoryService.frozenConsumables(consumablesUnInventoryDto));
    }
 
    @PostMapping("/thawConsumables")
    @ApiOperation("解冻库存")
    public R thawConsumables(@RequestBody ConsumablesInventoryDto consumablesUnInventoryDto) {
        return R.ok(consumablesUnInventoryService.thawConsumables(consumablesUnInventoryDto));
    }
 
}