From 131280b87a8a5d171d9e59362fe3d68767548953 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 10 十月 2025 17:03:54 +0800
Subject: [PATCH] 获取IFS订单:添加WG-04-001库位

---
 inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderController.java |   62 ++++++++++++++-----------------
 1 files changed, 28 insertions(+), 34 deletions(-)

diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderController.java b/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderController.java
index b8f1002..37fb641 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderController.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderController.java
@@ -27,6 +27,7 @@
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.ServletException;
@@ -34,6 +35,7 @@
 import java.io.IOException;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -76,6 +78,7 @@
     }
 
     @ApiOperation(value = "娣诲姞妫�楠屼笅鍗曟暟鎹�")
+    @PreAuthorize("@ss.hasPermi('add:insOrder')")
     @PostMapping("/addInsOrder")
     public Result<?> addInsOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) {
         return Result.success(insOrderService.addInsOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getInsOrder()));
@@ -99,7 +102,6 @@
             @ApiImplicitParam(name = "id", value = "妫�楠屽崟id", dataTypeClass = Integer.class),
             @ApiImplicitParam(name = "state", value = "瀹℃牳缁撴灉 1:閫氳繃 2锛氫笉閫氳繃", dataTypeClass = Integer.class)
     })
-
     @PostMapping("/upInsOrderOfState")
     public Result<?> upInsOrderOfState(@RequestBody InsOrder insOrder) {
         return Result.success(insOrderService.upInsOrderOfState(insOrder));
@@ -135,25 +137,6 @@
         return Result.success(insOrderService.selectSampleAndProductByOrderId(page, sampleProductDto));
     }
 
-    @ApiOperation(value = "璐圭敤缁熻")
-    @GetMapping("/costStatistics")
-    public Result<?> costStatistics(Page page, CostStatisticsDto costStatisticsDto){
-        return Result.success(insOrderService.costStatistics(page, costStatisticsDto));
-    }
-
-    @ApiOperation(value = "璐圭敤缁熻鑾峰彇鎬讳环")
-    @GetMapping("/costStatistics2")
-    public Result<?> costStatistics2(CostStatisticsDto costStatisticsDto){
-        return Result.success(insOrderService.costStatistics2(costStatisticsDto));
-    }
-
-
-    @ApiOperation(value = "鏍峰搧缂洪櫡鎸囨暟")
-    @GetMapping("/selectSampleDefects")
-    public Result selectSampleDefects(Integer size, Integer current, String inspectionItems, String orderNumber) {
-        return Result.success(insOrderService.selectSampleDefects(new Page<>(current, size),inspectionItems, orderNumber));
-    }
-
 
     @ApiOperation(value = "鎾ら攢")
     @PostMapping("/updateStatus")
@@ -176,7 +159,7 @@
         Integer orderId = (Integer) param.get("orderId");
         String ids = (String) param.get("ids");
         Integer typeSource = (Integer) param.get("typeSource");
-        Integer ifsInventoryId = (Integer) param.get("ifsInventoryId");
+        Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString());
         if(Objects.nonNull(typeSource) && typeSource == 1){
             ifsInventoryQuantityMapper.update(null,new LambdaUpdateWrapper<IfsInventoryQuantity>()
                     .set(IfsInventoryQuantity::getState,0)
@@ -197,17 +180,13 @@
     }
 
 
-    @ApiOperation(value = "璐圭敤缁熻瀵煎嚭")
-    @GetMapping("/export")
-    public void export(CostStatisticsDto costStatisticsDto,HttpServletResponse response) throws ServletException, IOException {
-       insOrderService.export(costStatisticsDto,response);
-    }
-
-
     @ApiOperation(value = "鑾峰彇ifs璁㈠崟")
     @GetMapping("/getIfsOrder")
     public Result<?> getIfsOrder() {
-        insOrderService.getIfsOrder();
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("LOCATION_NO","1302;WG-04-001");
+        map.put("STATE_DB","To be Inspected");
+        insOrderService.getIfsOrder(map,false);
         return Result.success();
     }
 
@@ -243,7 +222,7 @@
     public Result<?> delInsOrder(Integer insOrderId) {
         // 鏌ヨ璁㈠崟
         InsOrder order = insOrderService.getById(insOrderId);
-        if (!order.getState().equals(2)) {
+        if (!(order.getState().equals(2) || order.getState().equals(3))) {
             throw new ErrorException("鍙湁閫�鍥炶鍗曟墠鑳藉垹闄�");
         }
 
@@ -260,8 +239,7 @@
     @ApiOperation(value = "鏍规嵁璁㈠崟id鏌ヨ鏍峰搧")
     @GetMapping("/getSampleByOrderId")
     public Result<List<InsSample>> getSampleByOrderId(Integer insOrderId) {
-        return Result.success(insSampleService.list(Wrappers.<InsSample>lambdaQuery()
-                .eq(InsSample::getInsOrderId, insOrderId)));
+        return Result.success(insSampleService.getSampleByOrderId(insOrderId));
     }
 
     @ApiOperation(value = "鏍规嵁鏍峰搧id鏌ヨ妫�楠岄」鏍�")
@@ -278,9 +256,25 @@
     }
 
     @ApiOperation(value = "鎴愬搧妫�楠屽崟鍏ㄩ儴淇℃伅瀵煎嚭")
-    @PostMapping("/rawAllInsOrderExport")
-    public void rawAllInsOrderExport(@RequestBody SampleOrderDto sampleOrderDto, HttpServletResponse response){
+    @GetMapping("/rawAllInsOrderExport")
+    public void rawAllInsOrderExport(SampleOrderDto sampleOrderDto, HttpServletResponse response){
         insOrderService.rawAllInsOrderExport(sampleOrderDto,response);
     }
 
+
+    @ApiOperation(value = "淇敼鏍峰搧鍨嬪彿")
+    @PostMapping("/updateSampleModel")
+    public Result<?> updateSampleModel(@RequestBody List<InsSample> insSampleList) {
+        for (InsSample insSample : insSampleList) {
+            insOrderService.updateSampleModel(insSample);
+        }
+        return Result.success();
+    }
+
+    @ApiOperation(value = "鏌ヨ褰撳墠鏃堕棿鏄惁娌℃湁璇ユ娴嬮」鐨勬娊鏍疯鍒�")
+    @PostMapping("/judgeNotSpotCheckOrder")
+    public Result<?> judgeNotSpotCheckOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) {
+        return insOrderService.judgeNotSpotCheckOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getInsOrder());
+    }
+
 }

--
Gitblit v1.9.3