From 2d6a0cdcb1e31510a6f7776abab17cc5cb82fdcb Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 13 九月 2023 17:50:04 +0800
Subject: [PATCH] 修改2.0   9.13

---
 inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java |   84 +++++++++++++++++++++++++----------------
 1 files changed, 51 insertions(+), 33 deletions(-)

diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
index ccf1740..7c686cf 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
@@ -9,6 +9,7 @@
 import com.yuanchu.mom.utils.Jwt;
 import com.yuanchu.mom.utils.MyUtil;
 import com.yuanchu.mom.vo.Result;
+import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -40,16 +41,17 @@
     @Autowired
     private OpinionService opinionService;
 
-    @ApiOperation(value = "鏌ヨ鎴愬搧涓嶅悎鏍煎搧妫�楠屽崟鍒楄〃", tags = "QMS绠$悊-->涓嶅悎鏍煎搧绠$悊")
+    @ApiOperation(value = "涓嶅悎鏍煎搧绠$悊鍒楄〃", tags = "QMS绠$悊-->涓嶅悎鏍煎搧绠$悊")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "pageSize",value = "椤垫暟",dataTypeClass  = Integer.class,required = true),
-            @ApiImplicitParam(name = "countSize",value = "鏉℃暟/椤�",dataTypeClass  = Integer.class,required = true),
-            @ApiImplicitParam(name = "formTime",value = "鏉ユ枡鏃ユ湡",dataTypeClass  = String.class),
-            @ApiImplicitParam(name = "dealState",value = "澶勭悊鐘舵��(涓虹┖=鍏ㄩ儴)",dataTypeClass  = Integer.class)
+            @ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "countSize", value = "鏉℃暟/椤�", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "formTime", value = "鏉ユ枡鏃ユ湡", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "dealState", value = "澶勭悊鐘舵��(涓虹┖=鍏ㄩ儴)", dataTypeClass = Integer.class),
+            @ApiImplicitParam(name = "productCategories", value = "浜у搧澶х被", dataTypeClass = Integer.class),
     })
     @GetMapping("/selectUnRawInspectsList")
-    public Result<?> selectUnRawInspectsList(int pageSize, int countSize, String formTime, Integer dealState){
-        IPage<Map<String, Object>> inspectionPage = inspectUnacceptedService.selectUnRawInspectsList(new Page<Object>(pageSize, countSize), formTime,dealState);
+    public Result<?> selectUnRawInspectsList(int pageSize, int countSize, String formTime, Integer dealState, Integer productCategories) {
+        IPage<Map<String, Object>> inspectionPage = inspectUnacceptedService.selectUnRawInspectsList(new Page<Object>(pageSize, countSize), formTime, dealState, productCategories);
         Map<String, Object> map = new HashMap<>();
         map.put("total", inspectionPage.getTotal());
         map.put("row", inspectionPage.getRecords());
@@ -58,20 +60,20 @@
 
     @ApiOperation(value = "鏌ヨ鍘熸潗鏂欎笉鍚堟牸鍝佹楠屽崟鍒楄〃", tags = "QMS绠$悊-->鍘熸潗鏂欎笉鍚堟牸鍝�")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "pageSize",value = "椤垫暟",dataTypeClass  = Integer.class,required = true),
-            @ApiImplicitParam(name = "countSize",value = "鏉℃暟/椤�",dataTypeClass  = Integer.class,required = true),
-            @ApiImplicitParam(name = "formTime",value = "鏉ユ枡鏃ユ湡",dataTypeClass  = String.class),
-            @ApiImplicitParam(name = "productName",value = "浜у搧鍚嶇О",dataTypeClass  = String.class),
-            @ApiImplicitParam(name = "supplier",value = "渚涘簲鍟�",dataTypeClass  = String.class),
-            @ApiImplicitParam(name = "processingStatus",value = "澶勭悊鐘舵��",dataTypeClass  = Integer.class)
+            @ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "countSize", value = "鏉℃暟/椤�", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "formTime", value = "鏉ユ枡鏃ユ湡", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "productName", value = "浜у搧鍚嶇О", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "supplier", value = "渚涘簲鍟�", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "processingStatus", value = "澶勭悊鐘舵��", dataTypeClass = Integer.class)
     })
     @GetMapping("/selectURawMaterials")
     public Result<?> selectUnqualifiedRawMaterials(int pageSize,
-                                             int countSize,
-                                             String formTime,
-                                             String productName,
-                                             String supplier,
-                                             Integer processingStatus){
+                                                   int countSize,
+                                                   String formTime,
+                                                   String productName,
+                                                   String supplier,
+                                                   Integer processingStatus) {
         IPage<Map<String, Object>> inspectionPage = inspectUnacceptedService.selectUnqualifiedRawMaterials(
                 new Page<Object>(pageSize, countSize),
                 formTime,
@@ -84,14 +86,31 @@
         return Result.success(map);
     }
 
+    @ApiOperation(value = "璇勫", tags = "QMS绠$悊-->鍘熸潗鏂欎笉鍚堟牸鍝�")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "rawId", value = "鍘熸潗鏂橧d", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "passOrNo", value = "鏄惁閫氳繃锛�0锛氫笉閫氳繃锛�1锛氶�氳繃", dataTypeClass = Integer.class, required = true)
+    })
+    @PostMapping("/evaluatePassOrNo")
+    public Result<?> rawEvaluate(Integer rawId, Integer passOrNo) {
+        if (inspectUnacceptedService.getById(rawId).getDealState() == 1) {
+            return Result.fail("宸茬粡璇勫杩囦簡涓嶈兘鍐嶆璇勫!");
+        }
+        Integer integer = inspectUnacceptedService.rawEvaluate(rawId, passOrNo);
+        if (integer >= 1) {
+            return Result.success("璇勫鎴愬姛锛�");
+        }
+        return Result.fail("璇勫澶辫触锛�");
+    }
+
     @ApiOperation(value = "涓嶅悎鏍煎搧鍒嗛〉鍒楄〃", tags = "QMS绠$悊-->涓嶅悎鏍煎搧澶勭疆")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "pageSize",value = "椤垫暟",dataTypeClass  = Integer.class,required = true),
-            @ApiImplicitParam(name = "countSize",value = "鏉℃暟/椤�",dataTypeClass  = Integer.class,required = true),
-            @ApiImplicitParam(name = "specificationModel",value = "瑙勬牸鍨嬪彿",dataTypeClass  = String.class),
-            @ApiImplicitParam(name = "productName",value = "浜у搧鍚嶇О",dataTypeClass  = String.class),
-            @ApiImplicitParam(name = "productCategories",value = "浜у搧澶х被",dataTypeClass  = Integer.class),
-            @ApiImplicitParam(name = "state",value = "鐘舵��",dataTypeClass  = Integer.class)
+            @ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "countSize", value = "鏉℃暟/椤�", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "specificationModel", value = "瑙勬牸鍨嬪彿", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "productName", value = "浜у搧鍚嶇О", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "productCategories", value = "浜у搧澶х被", dataTypeClass = Integer.class),
+            @ApiImplicitParam(name = "state", value = "鐘舵��", dataTypeClass = Integer.class)
     })
     @GetMapping("/selectDisposal")
     public Result<?> selectDisposal(int pageSize,
@@ -99,7 +118,7 @@
                                     String specificationModel,
                                     String productName,
                                     Integer productCategories,
-                                    Integer state){
+                                    Integer state) {
         IPage<Map<String, Object>> inspectionPage = inspectUnacceptedService.selectDisposal(
                 new Page<Object>(pageSize, countSize),
                 specificationModel,
@@ -114,18 +133,17 @@
 
     @ApiOperation(value = "缂栬緫鎰忚-->纭畾鎸夐挳", tags = "QMS绠$悊-->涓嶅悎鏍煎搧澶勭疆")
     @PostMapping("/addOpinion")
-    public Result<?> updateOpinion(@RequestHeader("token") String token, @Validated @RequestBody List<Opinion> opinion) throws Exception {
-        MyUtil.PrintLog(opinion.toString());
-
+    public Result<?> updateOpinion(@RequestHeader("token") String token, @RequestBody Map<String, Object> opinion) throws Exception {
+        List<?> opinion1 = JackSonUtil.unmarshal(JackSonUtil.marshal(opinion.get("opinion")), List.class);
         Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
         String id = data.get("id").replaceAll("\"", "");
-        opinionService.updateOpinion(id, opinion);
+        opinionService.updateOpinion(id, opinion1);
         return Result.success("娣诲姞鎴愬姛锛�");
     }
 
     @ApiOperation(value = "鏌ョ湅缂栬緫鎰忚", tags = "QMS绠$悊-->涓嶅悎鏍煎搧澶勭疆")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "rawUnacceptedId",value = "涓嶅悎鏍煎搧澶勭疆Id",dataTypeClass  = Integer.class,required = true)
+            @ApiImplicitParam(name = "rawUnacceptedId", value = "涓嶅悎鏍煎搧澶勭疆Id", dataTypeClass = Integer.class, required = true)
     })
     @GetMapping("/viewEditorial")
     public Result<?> viewEditorialComments(Integer rawUnacceptedId) {
@@ -134,8 +152,8 @@
 
     @ApiOperation(value = "澶辩劍鏇存柊鐜板儚鎻忚堪", tags = "QMS绠$悊-->涓嶅悎鏍煎搧澶勭疆")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "rawUnacceptedId",value = "涓嶅悎鏍煎搧澶勭疆Id",dataTypeClass  = Integer.class,required = true),
-            @ApiImplicitParam(name = "tell",value = "鐜拌薄鎻忚堪",dataTypeClass  = Integer.class,required = true)
+            @ApiImplicitParam(name = "rawUnacceptedId", value = "涓嶅悎鏍煎搧澶勭疆Id", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "tell", value = "鐜拌薄鎻忚堪", dataTypeClass = Integer.class, required = true)
     })
     @GetMapping("/descriptionUpdate")
     public Result<?> descriptionUpdate(Integer rawUnacceptedId, String tell) {
@@ -148,7 +166,7 @@
 
     @ApiOperation(value = "鐐瑰嚮缂栬緫鎰忚瑙﹀彂鏌ヨ", tags = "QMS绠$悊-->涓嶅悎鏍煎搧澶勭疆")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "rawUnacceptedId",value = "涓嶅悎鏍煎搧澶勭疆Id",dataTypeClass  = Integer.class,required = true)
+            @ApiImplicitParam(name = "rawUnacceptedId", value = "涓嶅悎鏍煎搧澶勭疆Id", dataTypeClass = Integer.class, required = true)
     })
     @GetMapping("/clickEditing")
     public Result<?> clickEditingTriggerQuery(@RequestParam("rawUnacceptedId") Integer rawUnacceptedId) {

--
Gitblit v1.9.3