liyong
11 小时以前 1cf91e355038837f30f2d727507b2229263d7de7
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
package com.ruoyi.stock.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.enums.StockUnQualifiedRecordTypeEnum;
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.stock.dto.StockInventoryDto;
import com.ruoyi.stock.dto.StockUninventoryDto;
import com.ruoyi.stock.service.StockUninventoryService;
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
 */
@RestController
@RequestMapping("/stockUninventory")
public class StockUninventoryController {
    @Autowired
    private StockUninventoryService stockUninventoryService;
 
    @GetMapping("/pagestockUninventory")
    @ApiOperation("分页查询库存")
    public R pagestockUninventory(Page page, StockUninventoryDto stockUninventoryDto) {
        IPage<StockUninventoryDto> stockUninventoryDtoIPage = stockUninventoryService.pageStockUninventory(page, stockUninventoryDto);
        return R.ok(stockUninventoryDtoIPage);
    }
 
    @PostMapping("/addstockUninventory")
    @ApiOperation("新增库存")
    public R addstockUninventory(@RequestBody StockUninventoryDto stockUninventoryDto) {
        stockUninventoryDto.setRecordType(String.valueOf(StockUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_IN.getCode()));
        stockUninventoryDto.setRecordId(0L);
        return R.ok(stockUninventoryService.addStockUninventory(stockUninventoryDto));
    }
 
 
    @PostMapping("/subtractstockUninventory")
    @ApiOperation("扣减库存")
    public R subtractstockUninventory(@RequestBody StockUninventoryDto stockUninventoryDto) {
        stockUninventoryDto.setRecordType(String.valueOf(StockUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_OUT.getCode()));
        stockUninventoryDto.setRecordId(0L);
        return R.ok(stockUninventoryService.subtractStockUninventory(stockUninventoryDto));
    }
 
    @PostMapping("/exportStockUninventory")
    @ApiOperation("导出库存")
    public void exportStockUninventory(HttpServletResponse response, StockUninventoryDto stockUninventoryDto) {
        stockUninventoryService.exportStockUninventory(response,stockUninventoryDto);
    }
 
 
    @PostMapping("/frozenStock")
    @ApiOperation("冻结库存")
    public R frozenStock(@RequestBody StockInventoryDto stockInventoryDto) {
        return R.ok(stockUninventoryService.frozenStock(stockInventoryDto));
    }
 
    @PostMapping("/thawStock")
    @ApiOperation("解冻库存")
    public R thawStock(@RequestBody StockInventoryDto stockInventoryDto) {
        return R.ok(stockUninventoryService.thawStock(stockInventoryDto));
    }
 
}