From 6b908076f80a2c2933058caf5311ae2dc9048409 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期二, 28 四月 2026 15:20:52 +0800
Subject: [PATCH] feat(approve): 更新审批流程配置节点查询逻辑

---
 src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java |  183 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 166 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java b/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
index a106fb2..e567eea 100644
--- a/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
+++ b/src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
@@ -2,21 +2,26 @@
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.pojo.ProductModel;
+import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.procurementrecord.dto.*;
+import com.ruoyi.procurementrecord.mapper.CustomStorageMapper;
+import com.ruoyi.procurementrecord.pojo.CustomStorage;
 import com.ruoyi.procurementrecord.service.ProcurementRecordService;
-import com.ruoyi.purchase.dto.InvoicePurchaseReportDto;
-import com.ruoyi.quality.pojo.QualityInspect;
-import io.swagger.annotations.Api;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.AllArgsConstructor;
+import org.apache.ibatis.annotations.Delete;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
+
 import java.util.List;
 
 /**
@@ -24,18 +29,31 @@
  * @date : 2025/7/7 14:32
  */
 @RestController
-@Api(tags = "閲囪喘鍏ュ簱")
+@Tag(name = "閲囪喘鍏ュ簱")
 @RequestMapping("/stockin")
+@AllArgsConstructor
 public class ProcurementRecordController extends BaseController {
 
-
-    @Autowired
     private ProcurementRecordService procurementRecordService;
+    private CustomStorageMapper customStorageMapper;
+
+    /**
+     * 閫氳繃閿�鍞骇鍝乮d鑾峰彇鍏ュ簱鏁伴噺
+     *
+     * @param salesProductId
+     * @return
+     */
+    @GetMapping("/getProcurementAmount")
+    @Operation(summary = "閫氳繃閿�鍞骇鍝乮d鑾峰彇鍏ュ簱鏁伴噺")
+    public AjaxResult getProcurementAmount(@RequestParam("salesProductId") Long salesProductId) {
+        return AjaxResult.success(procurementRecordService.getProcurementAmount(salesProductId));
+    }
+
 
     @GetMapping("/productlist")
     @Log(title = "閲囪喘鍏ュ簱-鍏ュ簱绠$悊-鏂板鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
     public AjaxResult list(ProcurementDto procurementDto) {
-        List<ProcurementDto> result =procurementRecordService.listProcurementBySalesLedgerId(procurementDto);
+        List<ProcurementDto> result = procurementRecordService.listProcurementBySalesLedgerId(procurementDto);
         return AjaxResult.success(result);
     }
 
@@ -43,7 +61,30 @@
     @Log(title = "閲囪喘鍏ュ簱-鍏ュ簱绠$悊-鏂板鍏ュ簱", businessType = BusinessType.INSERT)
     @Transactional
     public AjaxResult add(@RequestBody ProcurementAddDto procurementDto) {
+        procurementDto.setType(1);
+        procurementDto.setTypeName("閲囪喘鍏ュ簱");
         return AjaxResult.success(procurementRecordService.add(procurementDto));
+    }
+
+    @PostMapping("/addCustom")
+    @Log(title = "鑷畾涔夊叆搴�-鍏ュ簱绠$悊-鏂板鍏ュ簱", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult addCustom(@RequestBody List<CustomStorage> customStorage) {
+        return procurementRecordService.addCustom(customStorage);
+    }
+
+    @PostMapping("/updateCustom")
+    @Log(title = "鑷畾涔夊叆搴�-鍏ュ簱绠$悊-淇敼鍏ュ簱", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult updateCustom(@RequestBody CustomStorage customStorage) {
+        return procurementRecordService.updateCustom(customStorage);
+    }
+
+    @Delete("/delteCustom")
+    @Log(title = "鑷畾涔夊叆搴�-鍏ュ簱绠$悊-鍒犻櫎鍏ュ簱", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult deleteCustom(@RequestBody List<Long> ids) {
+        return procurementRecordService.deleteCustom(ids);
     }
 
     @PostMapping("/update")
@@ -54,10 +95,17 @@
     }
 
     @PostMapping("/updateManagement")
-    @Log(title = "閲囪喘鍏ュ簱-搴撳瓨鍙拌处-淇敼", businessType = BusinessType.UPDATE)
+    @Log(title = "鎴愬搧鍏ュ簱-搴撳瓨鍙拌处-淇敼", businessType = BusinessType.UPDATE)
     @Transactional
     public AjaxResult updateManagement(@RequestBody ProcurementManagementUpdateDto procurementDto) {
         return AjaxResult.success(procurementRecordService.updateManagement(procurementDto));
+    }
+
+    @PostMapping("/updateManagementByCustom")
+    @Log(title = "鑷畾涔夊叆搴�-搴撳瓨鍙拌处-淇敼", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult updateManagementByCustom(@RequestBody ProcurementManagementUpdateDto procurementDto) {
+        return AjaxResult.success(procurementRecordService.updateManagementByCustom(procurementDto));
     }
 
     @PostMapping("/del")
@@ -69,35 +117,136 @@
 
     @GetMapping("/listPage")
     @Log(title = "閲囪喘鍏ュ簱-鍏ュ簱绠$悊-鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
+    @Operation(summary = "鍏ュ簱鏌ヨ")
     public AjaxResult listPage(Page page, ProcurementPageDto procurementDto) {
-        IPage<ProcurementPageDto> result =procurementRecordService.listPage(page, procurementDto);
+        IPage<ProcurementPageDto> result = procurementRecordService.listPage(page, procurementDto);
+        return AjaxResult.success(result);
+    }
+
+    @GetMapping("/listReport")
+    @Operation(summary = "鏌ヨ搴撳瓨鍥捐〃鏁版嵁")
+    public AjaxResult listReport() {
+        return AjaxResult.success(procurementRecordService.getReportList());
+    }
+
+    @GetMapping("/listPageByProduction")
+    @Log(title = "鐢熶骇鍏ュ簱-鍏ュ簱绠$悊-鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
+    @Operation(summary = "鍏ュ簱鏌ヨ")
+    public AjaxResult listPageByProduction(Page page, ProcurementPageDto procurementDto) {
+        IPage<ProcurementPageDto> result = procurementRecordService.listPageByProduction(page, procurementDto);
+        return AjaxResult.success(result);
+    }
+
+    @GetMapping("/listPageByProductProduction")
+    @Log(title = "鐢熶骇鍏ュ簱-鍏ュ簱绠$悊-鐢熶骇鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
+    @Operation(summary = "鍏ュ簱鏌ヨ")
+    public AjaxResult listPageByProductProduction(Page page, ProcurementPageDto procurementDto) {
+        IPage<ProcurementPageDto> result = procurementRecordService.listPageByProductProduction(page, procurementDto);
+        return AjaxResult.success(result);
+    }
+
+    @GetMapping("/listPageByCustom")
+    @Log(title = "鑷畾涔夊叆搴�-鍏ュ簱绠$悊-鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
+    @Operation(summary = "鍏ュ簱鏌ヨ")
+    public AjaxResult listPageByCustom(Page page, CustomStorage customStorage) {
+        IPage<CustomStorage> result = procurementRecordService.listPageByCustom(page, customStorage);
         return AjaxResult.success(result);
     }
 
     @GetMapping("/listPageCopy")
-    @Log(title = "閲囪喘鍏ュ簱-鍏ュ簱绠$悊-鍏ュ簱鏌ヨ", businessType = BusinessType.OTHER)
+    @Log(title = "閲囪喘鍏ュ簱-搴撳瓨绠$悊-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
     public AjaxResult listPageCopy(Page page, ProcurementPageDto procurementDto) {
-        IPage<ProcurementPageDtoCopy> result =procurementRecordService.listPageCopy(page, procurementDto);
+        IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopy(page, procurementDto);
         return AjaxResult.success(result);
     }
 
+    @GetMapping("/listPageCopyByProduction")
+    @Log(title = "鐢熶骇鍏ュ簱-搴撳瓨绠$悊-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
+    public AjaxResult listPageCopyByProduction(Page page, ProcurementPageDto procurementDto) {
+        IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopyByProduction(page, procurementDto);
+        return AjaxResult.success(result);
+    }
+
+    @GetMapping("/listPageCopyByCustom")
+    @Log(title = "鑷畾涔夊叆搴�-搴撳瓨绠$悊-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
+    public AjaxResult listPageCopyByCustom(Page page, CustomStorage customStorage) {
+        IPage<CustomStorage> result = procurementRecordService.listPageCopyByCustom(page, customStorage);
+        return AjaxResult.success(result);
+    }
+
+    @GetMapping("/getReportList")
+    @Log(title = "搴撳瓨鎶ヨ〃鏌ヨ", businessType = BusinessType.OTHER)
+    public AjaxResult getReportList(Page page, ProcurementPageDto procurementDto) {
+        return AjaxResult.success(procurementRecordService.getReportList(page, procurementDto));
+    }
+
     /**
-     * 瀵煎嚭
+     * 搴撳瓨绠$悊閲囪喘瀵煎嚭
+     *
      * @param response
      */
     @PostMapping("/exportCopy")
     public void exportCopy(HttpServletResponse response) {
-        procurementRecordService.exportCopy(response);
+        procurementRecordService.exportCopy(response, 1);
     }
 
     /**
-     * 瀵煎嚭
+     * 搴撳瓨绠$悊鐢熶骇瀵煎嚭
+     *
+     * @param response
+     */
+    @PostMapping("/exportCopyOne")
+    public void exportCopyOne(HttpServletResponse response) {
+        procurementRecordService.exportCopy(response, 2);
+    }
+
+    /**
+     * 搴撳瓨绠$悊鑷畾涔夊鍑�
+     *
+     * @param response
+     */
+    @PostMapping("/exportCopyTwo")
+    public void exportCopyTwo(HttpServletResponse response) {
+        procurementRecordService.exportCopyTwo(response, 3);
+    }
+
+    /**
+     * 鍏ュ簱锛屽嚭搴撶鐞嗛噰璐鍑�
+     *
      * @param response
      */
     @PostMapping("/export")
     public void export(HttpServletResponse response) {
-        procurementRecordService.export(response);
+        procurementRecordService.export(response, 1);
+    }
+
+    /**
+     * 鍏ュ簱锛屽嚭搴撶鐞嗙敓浜у鍑�
+     *
+     * @param response
+     */
+    @PostMapping("/exportOne")
+    public void exportOne(HttpServletResponse response) {
+        procurementRecordService.export(response, 2);
     }
 
 
+    /**
+     * 鍏ュ簱锛屽嚭搴撶鐞嗚嚜瀹氫箟瀵煎嚭
+     *
+     * @param response
+     */
+    @PostMapping("/exportTwo")
+    public void exportTwo(HttpServletResponse response) {
+        List<CustomStorage> customStorages = customStorageMapper.selectList(null);
+        ExcelUtil<CustomStorage> util = new ExcelUtil<CustomStorage>(CustomStorage.class);
+        util.exportExcel(response, customStorages, "鍏ュ簱鍙拌处");
+    }
+
+    @GetMapping("/listPageProductionStock")
+    @Log(title = "搴撳瓨绠$悊-鎴愬搧搴撳瓨", businessType = BusinessType.OTHER)
+    public AjaxResult listPageProductionStock(Page page, ProcurementPageDto procurementDto) {
+        IPage<ProductModel> result = procurementRecordService.listPageProductionStock(page, procurementDto);
+        return AjaxResult.success(result);
+    }
 }

--
Gitblit v1.9.3