From f682213b9ff8a7d41ea16edfb1b68d996c46e080 Mon Sep 17 00:00:00 2001
From: zhuo <2089219845@qq.com>
Date: 星期六, 29 三月 2025 14:03:36 +0800
Subject: [PATCH] 1.清除无用方法 2.检测项目预警修改 3.数采绑定调整

---
 inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderController.java |   59 +++++++++++++++++++----------------------------------------
 1 files changed, 19 insertions(+), 40 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 b3a36ef..880fad5 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
@@ -1,4 +1,4 @@
-package com.ruoyi.basic.controller;
+package com.ruoyi.inspect.controller;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -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;
@@ -76,6 +77,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()));
@@ -85,7 +87,7 @@
     @GetMapping("/selectOrderManDay")
     public Result<?> selectOrderManDay(Integer id) {
         int day = insProductService.selectOrderManDay(id);
-        return Result.success("鎴愬姛", LocalDateTime.now().plusHours(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+        return Result.success(LocalDateTime.now().plusHours(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
     }
 
     @ApiOperation(value = "鏌ヨ妫�楠屼笅鍗曞唴瀹硅鎯�")
@@ -99,7 +101,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));
@@ -120,7 +121,7 @@
     @ApiOperation(value = "閫氳繃妫�楠屽崟妯℃澘id鑾峰彇妫�楠屽崟妯℃澘鍐呭")
     @GetMapping("/selectInsOrderTemplateById")
     public Result<?> selectInsOrderTemplateById(Integer id) {
-        return Result.success("鎴愬姛", insOrderTemplateService.selectInsOrderTemplateById(id));
+        return Result.success(insOrderTemplateService.selectInsOrderTemplateById(id));
     }
 
     @ApiOperation(value = "鍒犻櫎妫�楠屽崟妯℃澘")
@@ -133,25 +134,6 @@
     @GetMapping("/selectSampleAndProductByOrderId")
     public Result<?> selectSampleAndProductByOrderId(Page page, SampleProductDto2 sampleProductDto){
         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));
     }
 
 
@@ -197,23 +179,11 @@
     }
 
 
-    @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();
         return Result.success();
-    }
-
-    @Scheduled(fixedDelay = 1200000)
-    public void getIfsOrderTiming() {
-        insOrderService.getIfsOrder();
     }
 
 
@@ -248,7 +218,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("鍙湁閫�鍥炶鍗曟墠鑳藉垹闄�");
         }
 
@@ -265,8 +235,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鏌ヨ妫�楠岄」鏍�")
@@ -283,9 +252,19 @@
     }
 
     @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();
+    }
+
 }

--
Gitblit v1.9.3