From df0b6fcc2486c78677acdb8ac2570ae26c62909a Mon Sep 17 00:00:00 2001
From: lsh <1>
Date: 星期三, 10 一月 2024 21:20:59 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/task/handler/WrkMastStaInItHandler.java |   45 +++++++++++++++++++++++++++++++++++++--------
 1 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/zy/asrs/task/handler/WrkMastStaInItHandler.java b/src/main/java/com/zy/asrs/task/handler/WrkMastStaInItHandler.java
index 8cd2ed4..d13466b 100644
--- a/src/main/java/com/zy/asrs/task/handler/WrkMastStaInItHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/WrkMastStaInItHandler.java
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.core.common.Cools;
+import com.core.common.R;
 import com.zy.asrs.entity.BasDevp;
 import com.zy.asrs.entity.WrkMast;
 import com.zy.asrs.entity.WrkMastSta;
@@ -29,13 +30,41 @@
     @Autowired
     private WrkMastStaService wrkMastStaService;
 
-    public ReturnT<String> start(WrkMast wrkMast,BasDevp basDevp) {
+    public ReturnT<String> start(WrkMast wrkMast,BasDevp basDevp,Integer type) {
         try {
             WrkMastSta wrkMastSta = wrkMastStaService.selectOne(new EntityWrapper<WrkMastSta>().eq("wrk_no", wrkMast.getWrkNo().longValue()));
-            if (Cools.isEmpty(wrkMastSta)){
-                WrkMastSta wrkMastSta1 = new WrkMastSta(wrkMast,new Date(),basDevp);
-                wrkMastSta1.setType(fillKM(wrkMast)? 0:1);
-                wrkMastStaService.insert(wrkMastSta1);
+            switch (type){
+                case 13://鍑�  3锛氬彇鏀�
+                    if (Cools.isEmpty(wrkMastSta)){
+                        WrkMastSta wrkMastSta1 = new WrkMastSta(wrkMast,new Date(),basDevp);
+                        wrkMastSta1.setType(fullKM(wrkMast)? 1:2);      //绫诲瀷 1:闈炵┖  2:绌烘澘
+                        wrkMastSta1.setWrkType(3);                      //宸ヤ綔绫诲瀷  1:鍙栵紙鍙犵洏锛�  2锛氭媶鐩�  3锛氬彇鏀� 5锛氭弧鍙�  6锛氭弧鏀�
+                        wrkMastStaService.insert(wrkMastSta1);
+                    }
+                    break;
+                case 21://1:鍙栵紙鍙犵洏锛�
+                    if (Cools.isEmpty(wrkMastSta)){
+                        WrkMastSta wrkMastSta1 = new WrkMastSta(wrkMast,new Date(),basDevp);
+                        wrkMastSta1.setType(fullKM(wrkMast)? 1:2);
+                        wrkMastSta1.setWrkType(1);
+                        wrkMastStaService.insert(wrkMastSta1);
+                    }
+                case 22://2锛氭斁
+                    if (Cools.isEmpty(wrkMastSta)){
+                        WrkMastSta wrkMastSta1 = new WrkMastSta(wrkMast,new Date(),basDevp);
+                        wrkMastSta1.setType(fullKM(wrkMast)? 1:2);
+                        wrkMastSta1.setWrkType(5);
+                        wrkMastStaService.insert(wrkMastSta1);
+                    }
+//                case 23://3锛氬彇鏀�
+//                    if (Cools.isEmpty(wrkMastSta)){
+//                        WrkMastSta wrkMastSta1 = new WrkMastSta(wrkMast,new Date(),basDevp);
+//                        wrkMastSta1.setType(fullKM(wrkMast)? 1:2);
+//                        wrkMastSta1.setWrkType(3);
+//                        wrkMastStaService.insert(wrkMastSta1);
+//                    }
+                default:
+                    return FAIL;
             }
 
         }catch (Exception e){
@@ -45,10 +74,10 @@
         return FAIL;
     }
 
-    public boolean fillKM(WrkMast wrkMast){
+    public boolean fullKM(WrkMast wrkMast){
         if (wrkMast.getIoType()!=10 && wrkMast.getIoType()!=110){
-            return false;
+            return true;
         }
-        return true;
+        return false;
     }
 }

--
Gitblit v1.9.1