From c2bb8ac8fd2bb217364162ee84af3baf8a34fb8d Mon Sep 17 00:00:00 2001
From: cpT <1@123>
Date: 星期四, 19 六月 2025 14:17:31 +0800
Subject: [PATCH] #改造

---
 src/main/webapp/views/deviceError/deviceError.html          |   10 ++--
 src/main/java/com/zy/asrs/controller/OpenController.java    |   60 +++++++++++++++++++++++++++++-
 src/main/webapp/static/wms/js/deviceError/deviceError.js    |   10 ++--
 src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java |   19 +++++++++
 4 files changed, 87 insertions(+), 12 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/OpenController.java b/src/main/java/com/zy/asrs/controller/OpenController.java
index 9dfc007..032c79e 100644
--- a/src/main/java/com/zy/asrs/controller/OpenController.java
+++ b/src/main/java/com/zy/asrs/controller/OpenController.java
@@ -6,6 +6,7 @@
 import com.core.common.BaseRes;
 import com.core.common.Cools;
 import com.core.common.R;
+import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
 import com.zy.asrs.entity.*;
 import com.zy.asrs.entity.param.*;
@@ -345,18 +346,43 @@
         auth(appkey, params, request);
 //        List<WMSAndAGVInterfaceParam> params1 =new ArrayList<>();
         for (CarryParam param:params){
-            param.updateIoTyoe(param.getIoType());//涓埅涓嬪彂  1锛氬嚭搴擄紝2锛氱Щ搴� 3锛氬叆搴�   ====杞崲涓�====>  1锛氬叆搴擄紝2锛氬嚭搴擄紝3锛氱Щ搴�
-            param.updateLocNo();
             if (Cools.isEmpty(param)){
+                try{
+                    DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                    deviceErrorService.addDeviceError("wms", 1, "鍙傛暟涓虹┖,params:"+JSON.toJSONString(params));
+                } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+                }
                 return R.error("鍙傛暟涓虹┖锛�");
             } else if (Cools.isEmpty(param.getTaskNo())){
+                try{
+                    DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                    deviceErrorService.addDeviceError("wms", 1, "浠诲姟鍙蜂负绌�,taskNo:"+JSON.toJSONString(param));
+                } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+                }
                 return R.error("浠诲姟鍙蜂负绌猴紒");
             } else if (Cools.isEmpty(param.getIoType())){
+                try{
+                    DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                    deviceErrorService.addDeviceError("wms", 1, "浠诲姟绫诲瀷涓虹┖,ioType:"+JSON.toJSONString(param));
+                } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+                }
                 return R.error("浠诲姟绫诲瀷涓虹┖锛�");
             }
             if (Cools.isEmpty(param.getStartPoint()) || Cools.isEmpty(param.getTargetPoint())){
+                try{
+                    DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                    deviceErrorService.addDeviceError("wms", 1, "鍒濆鐩爣鎴栬�呯洰鏍囦綅涓虹┖,Point:"+JSON.toJSONString(param));
+                } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+                }
                 return R.error("鍒濆鐩爣鎴栬�呯洰鏍囦綅涓虹┖");
             }
+
+            param.updateIoTyoe(param.getIoType());//涓埅涓嬪彂  1锛氬嚭搴擄紝2锛氱Щ搴� 3锛氬叆搴�   ====杞崲涓�====>  1锛氬叆搴擄紝2锛氬嚭搴擄紝3锛氱Щ搴�
+            param.updateLocNo();
 //            if (Cools.isEmpty(param.getContainerCode())){
 //                return R.error("瀹瑰櫒缂栫爜(鎵樼洏鐮�)涓虹┖锛�");
 //            }
@@ -378,6 +404,12 @@
             }
             LocMast locMast = locMastService.selectByLocNo(locNo);
             if(Cools.isEmpty(locMast)){
+                try{
+                    DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                    deviceErrorService.addDeviceError("wms", 1, "鍒濆搴撲綅鏃犳硶鎵惧埌,locNo:"+JSON.toJSONString(locNo));
+                } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+                }
                 return R.error("鍒濆搴撲綅鏃犳硶鎵惧埌");
             }
 
@@ -390,6 +422,12 @@
                         .eq("crn_no",locMast.getCrnNo())
                         .eq("stn_no",param.getStartPoint()));
                 if(Cools.isEmpty(staDesc)){
+                    try{
+                        DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                        deviceErrorService.addDeviceError("wms", 1, "鍏ュ簱璺姴涓嶅瓨鍦�,param:"+JSON.toJSONString(param));
+                    } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+                    }
                     return R.error("鍏ュ簱璺姴涓嶅瓨鍦�");
                 }
                 r = openService.taskCreate(new TaskCreateParam(param,staDesc.getCrnNo(),staDesc.getCrnStn()));
@@ -401,15 +439,33 @@
                         .eq("crn_no",locMast.getCrnNo())
                         .eq("stn_no",param.getTargetPoint()));
                 if(Cools.isEmpty(staDesc)){
+                    try{
+                        DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                        deviceErrorService.addDeviceError("wms", 1, "鍑哄簱璺姴涓嶅瓨鍦�,param:"+JSON.toJSONString(param));
+                    } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+                    }
                     return R.error("鍑哄簱璺姴涓嶅瓨鍦�");
                 }
                 r = openService.taskCreate(new TaskCreateParam(param,staDesc.getCrnNo(),staDesc.getStnNo()));
             }else if (param.getIoType() == 3){
                 LocMast locMast2 = locMastService.selectByLocNo(param.getTargetPoint());
                 if(Cools.isEmpty(locMast2)){
+                    try{
+                        DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                        deviceErrorService.addDeviceError("wms", 1, "鐩爣搴撲綅鏃犳硶鎵惧埌,locNo:"+JSON.toJSONString(param.getTargetPoint()));
+                    } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+                    }
                     return R.error("鐩爣搴撲綅鏃犳硶鎵惧埌");
                 }
                 if (!locMast2.getCrnNo().equals(locMast.getCrnNo())){
+                    try{
+                        DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                        deviceErrorService.addDeviceError("wms", 1, "璧峰搴撲綅涓庣洰鏍囧簱浣嶄笉鍐嶅悓涓�宸烽亾,param:"+JSON.toJSONString(param));
+                    } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+                    }
                     return R.error("璧峰搴撲綅涓庣洰鏍囧簱浣嶄笉鍐嶅悓涓�宸烽亾");
                 }
                 //绉诲簱浠诲姟鍒涘缓
diff --git a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
index 338659a..8690b3d 100644
--- a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -5,6 +5,7 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.core.common.Cools;
 import com.core.common.R;
+import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
 import com.zy.asrs.domain.enums.TaskStatusType;
 import com.zy.asrs.domain.enums.WorkNoType;
@@ -65,9 +66,21 @@
     public R taskCreate(TaskCreateParam param) {
         TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo());
         if (taskWrk != null) {
+            try{
+                DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                deviceErrorService.addDeviceError("wms", 1, "浠诲姟宸插瓨鍦紝璇峰嬁閲嶅鎻愪氦,taskWrk:"+JSON.toJSONString(taskWrk));
+            } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+            }
             throw new CoolException(param.getTaskNo() + "浠诲姟宸插瓨鍦紝璇峰嬁閲嶅鎻愪氦");
         }
         if (param.getIoType().equals(0)){
+            try{
+                DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                deviceErrorService.addDeviceError("wms", 1, "鐢熸垚浠诲姟澶辫触锛屼换鍔$被鍨嬩笉瀛樺湪锛�,iotype:"+JSON.toJSONString(param.getIoType()));
+            } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+            }
             throw new CoolException("鐢熸垚浠诲姟澶辫触锛屼换鍔$被鍨嬩笉瀛樺湪锛�");
         }
 
@@ -139,6 +152,12 @@
         }
 
         if (!taskWrkService.insert(taskWrk)) {
+            try{
+                DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
+                deviceErrorService.addDeviceError("wms", 1, "鍒涘缓浠诲姟澶辫触锛�,param:"+JSON.toJSONString(param));
+            } catch (Exception e2){
+//                    log.error("e2:"+e2.getMessage());
+            }
             return R.error("鍒涘缓浠诲姟澶辫触");
         }
         return R.ok();
diff --git a/src/main/webapp/static/wms/js/deviceError/deviceError.js b/src/main/webapp/static/wms/js/deviceError/deviceError.js
index e2fe52d..2b30f32 100644
--- a/src/main/webapp/static/wms/js/deviceError/deviceError.js
+++ b/src/main/webapp/static/wms/js/deviceError/deviceError.js
@@ -22,11 +22,11 @@
         height: 'full-120',
         cols: [[
             {type: 'checkbox'}
-            ,{field: 'id', align: 'center',title: '缂栧彿'}
-            ,{field: 'device', align: 'center',title: '璁惧'}
-            ,{field: 'deviceId', align: 'center',title: '璁惧ID'}
-            ,{field: 'msg', align: 'center',title: '寮傚父淇℃伅'}
-            ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿'}
+            ,{field: 'id', align: 'center',title: '缂栧彿',hide : true}
+            ,{field: 'device', align: 'center',title: '绫诲瀷', hide: false}
+            ,{field: 'deviceId', align: 'center',title: '鐩稿叧ID', hide: false}
+            ,{field: 'msg', align: 'center',title: '寮傚父淇℃伅', hide: false}
+            ,{field: 'createTime$', align: 'center',title: '鏃ユ湡', hide: false}
 
             ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120}
         ]],
diff --git a/src/main/webapp/views/deviceError/deviceError.html b/src/main/webapp/views/deviceError/deviceError.html
index 7172561..cfc2573 100644
--- a/src/main/webapp/views/deviceError/deviceError.html
+++ b/src/main/webapp/views/deviceError/deviceError.html
@@ -17,11 +17,11 @@
         <div class="layui-card-body">
             <div class="layui-form toolbar" id="search-box">
                 <div class="layui-form-item">
-                    <div class="layui-inline">
-                        <div class="layui-input-inline">
-                            <input class="layui-input" type="text" name="id" placeholder="缂栧彿" autocomplete="off">
-                        </div>
-                    </div>
+<!--                    <div class="layui-inline">-->
+<!--                        <div class="layui-input-inline">-->
+<!--                            <input class="layui-input" type="text" name="id" placeholder="缂栧彿" autocomplete="off">-->
+<!--                        </div>-->
+<!--                    </div>-->
                     <div class="layui-inline">
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="device" placeholder="璁惧" autocomplete="off">

--
Gitblit v1.9.1