From 1d915922d8197aa5d5dc3e40e3088d983dd6e141 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期五, 13 三月 2026 17:57:59 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New_kthg' into dev_New_kthg
---
src/main/java/com/ruoyi/consumables/controller/ConsumablesInventoryController.java | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 108 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/ruoyi/consumables/controller/ConsumablesInventoryController.java b/src/main/java/com/ruoyi/consumables/controller/ConsumablesInventoryController.java
new file mode 100644
index 0000000..8687fa2
--- /dev/null
+++ b/src/main/java/com/ruoyi/consumables/controller/ConsumablesInventoryController.java
@@ -0,0 +1,108 @@
+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.StockInQualifiedRecordTypeEnum;
+import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.consumables.dto.ConsumablesInventoryDto;
+import com.ruoyi.consumables.execl.ConsumablesInventoryExportData;
+import com.ruoyi.consumables.service.ConsumablesInventoryService;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+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 org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 鑰楁潗搴撳瓨琛� 鍓嶇鎺у埗鍣�
+ * </p>
+ *
+ * @author 鑺杞欢锛堟睙鑻忥級鏈夐檺鍏徃
+ * @since 2026-01-21 04:16:36
+ */
+@RestController
+@RequestMapping("/consumablesInventory")
+@Api(tags = "鑰楁潗搴撳瓨琛�")
+public class ConsumablesInventoryController {
+
+ @Autowired
+ private ConsumablesInventoryService ConsumablesInventoryService;
+
+ @GetMapping("/pageConsumablesInventory")
+ @ApiOperation("鍒嗛〉鏌ヨ搴撳瓨")
+ public R pageConsumablesInventory(Page page, ConsumablesInventoryDto ConsumablesInventoryDto) {
+ IPage<ConsumablesInventoryDto> ConsumablesInventoryDtoIPage = ConsumablesInventoryService.pageConsumablesInventory(page, ConsumablesInventoryDto);
+ return R.ok(ConsumablesInventoryDtoIPage);
+ }
+
+ @PostMapping("/addConsumablesInventory")
+ @ApiOperation("鏂板搴撳瓨")
+ public R addConsumablesInventory(@RequestBody ConsumablesInventoryDto ConsumablesInventoryDto) {
+ ConsumablesInventoryDto.setRecordType(String.valueOf(StockInQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_IN.getCode()));
+ ConsumablesInventoryDto.setRecordId(0L);
+ return R.ok(ConsumablesInventoryService.addConsumablesInventory(ConsumablesInventoryDto));
+ }
+
+
+ @PostMapping("/subtractConsumablesInventory")
+ @ApiOperation("鎵e噺搴撳瓨")
+ public R subtractConsumablesInventory(@RequestBody ConsumablesInventoryDto ConsumablesInventoryDto) {
+ ConsumablesInventoryDto.setRecordType(String.valueOf(StockOutQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_OUT.getCode()));
+ ConsumablesInventoryDto.setRecordId(0L);
+ return R.ok(ConsumablesInventoryService.subtractConsumablesInventory(ConsumablesInventoryDto));
+ }
+
+
+ @PostMapping("importConsumablesInventory")
+ @ApiOperation("瀵煎叆搴撳瓨")
+ public R importConsumablesInventory(MultipartFile file) {
+ return ConsumablesInventoryService.importConsumablesInventory(file);
+ }
+
+ @Log(title = "涓嬭浇搴撳瓨瀵煎叆妯℃澘", businessType = BusinessType.EXPORT)
+ @PostMapping("/downloadConsumablesInventory")
+ public void downloadConsumablesInventory(HttpServletResponse response) {
+ List<ConsumablesInventoryExportData> list = new ArrayList<>();
+ ExcelUtil<ConsumablesInventoryExportData> util = new ExcelUtil<>(ConsumablesInventoryExportData.class);
+ util.exportExcel(response, list, "搴撳瓨妯℃澘");
+ }
+
+ @PostMapping("/exportConsumablesInventory")
+ @ApiOperation("瀵煎嚭搴撳瓨")
+ public void exportConsumablesInventory(HttpServletResponse response, ConsumablesInventoryDto ConsumablesInventoryDto) {
+ ConsumablesInventoryService.exportConsumablesInventory(response, ConsumablesInventoryDto);
+ }
+
+ @GetMapping("ConsumablesInventoryPage")
+ @ApiOperation("搴撳瓨鎶ヨ〃鏌ヨ")
+ public R ConsumablesInventoryPage(Page page, ConsumablesInventoryDto consumablesInventoryDto) {
+ return R.ok(ConsumablesInventoryService.consumablesInventoryPage(consumablesInventoryDto,page));
+ }
+
+ @GetMapping("ConsumablesInAndOutRecord")
+ @ApiOperation("缁熻鍚勪釜浜у搧鐨勫叆搴撳拰鍑哄簱璁板綍")
+ public R ConsumablesInAndOutRecord(ConsumablesInventoryDto consumablesInventoryDto, Page page) {
+ return R.ok(ConsumablesInventoryService.consumablesInAndOutRecord(consumablesInventoryDto,page));
+ }
+
+ @PostMapping("/frozenConsumables")
+ @ApiOperation("鍐荤粨搴撳瓨")
+ public R frozenConsumables(@RequestBody ConsumablesInventoryDto ConsumablesInventoryDto) {
+ return R.ok(ConsumablesInventoryService.frozenConsumables(ConsumablesInventoryDto));
+ }
+
+ @PostMapping("/thawConsumables")
+ @ApiOperation("瑙e喕搴撳瓨")
+ public R thawConsumables(@RequestBody ConsumablesInventoryDto ConsumablesInventoryDto) {
+ return R.ok(ConsumablesInventoryService.thawConsumables(ConsumablesInventoryDto));
+ }
+}
--
Gitblit v1.9.3