Prechádzať zdrojové kódy

永湖光栅对接最终版

zhangxin 1 rok pred
rodič
commit
86195b6d14

+ 2 - 17
ruoyi-admin/src/main/java/com/ruoyi/thread/ClientHandler.java

@@ -1,9 +1,6 @@
 package com.ruoyi.thread;
 
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.ruoyi.ams.agv.ndc.common.ByteUtil;
-import com.ruoyi.ams.agv.ndc.common.CRC16Util;
-import com.ruoyi.ams.agv.ndc.domain.AmsTask;
 import com.ruoyi.ams.agv.ndc.service.IAmsTaskService;
 import com.ruoyi.base.constant.Constant;
 import com.ruoyi.common.core.redis.RedisCache;
@@ -156,14 +153,14 @@ public class ClientHandler {
                             //入库区域光栅检测到信号
                             if (redisCache.checkIsExist(Constant.AREA_INFO.STORAGE_AREA.getKey()) || redisCache.checkIsExist(Constant.GRATING_RELIEVE_CMD.STORAGE_GRATING.getKey())) break;
                             log.info("storage area control is trigger ......");
-                            insertAmsTask(Constant.AREA_INFO.STORAGE_AREA.getValue());
+                            amsTaskService.insertGratingAmsTask(Constant.AREA_INFO.STORAGE_AREA.getValue(), Constant.TASK_BUSINESS_TYPE.TASK_76.getValue());
                             redisCache.setCacheObject(Constant.AREA_INFO.STORAGE_AREA.getKey(), Boolean.TRUE);
                             break;
                         case "3F00600D0A":
                             //出库区域光栅检测到信号
                             if (redisCache.checkIsExist(Constant.AREA_INFO.EXIT_AREA.getKey()) || redisCache.checkIsExist(Constant.GRATING_RELIEVE_CMD.EXIT_GRATING.getKey())) break;
                             log.info("exit area control is trigger ......");
-                            insertAmsTask(Constant.AREA_INFO.EXIT_AREA.getValue());
+                            amsTaskService.insertGratingAmsTask(Constant.AREA_INFO.EXIT_AREA.getValue(), Constant.TASK_BUSINESS_TYPE.TASK_76.getValue());
                             redisCache.setCacheObject(Constant.AREA_INFO.EXIT_AREA.getKey(), Boolean.TRUE);
                             break;
                     }
@@ -182,16 +179,4 @@ public class ClientHandler {
         }
     }
 
-    private void insertAmsTask(String op){
-        AmsTask amsTask = new AmsTask();
-        amsTask.setTaskNo(IdWorker.getIdStr());
-        amsTask.setIkey(Long.parseLong(String.valueOf(CRC16Util.calcCrc16(ByteUtil.string2byteArray(amsTask.getTaskNo())))));
-        amsTask.setStFrom(Integer.valueOf(Constant.LOC_MIDDLE_CACHE.toString()));
-        amsTask.setStTo(Integer.valueOf(Constant.LOC_SORTATION_CACHE.toString()));
-        amsTask.setPriority(1);
-        amsTask.setBusinessType(Constant.TASK_BUSINESS_TYPE.TASK_76.getValue());
-        amsTask.setExt1(op);
-        amsTaskService.insertAmsTask(amsTask);
-    }
-
 }

+ 3 - 0
warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/service/impl/AmsTaskServiceImpl.java

@@ -6,6 +6,7 @@ import com.ruoyi.ams.agv.ndc.common.CRC16Util;
 import com.ruoyi.ams.agv.ndc.domain.AmsTask;
 import com.ruoyi.ams.agv.ndc.mapper.AmsTaskMapper;
 import com.ruoyi.ams.agv.ndc.service.IAmsTaskService;
+import com.ruoyi.base.constant.Constant;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -122,6 +123,8 @@ public class AmsTaskServiceImpl implements IAmsTaskService
         AmsTask amsTask = new AmsTask();
         amsTask.setTaskNo(IdWorker.getIdStr());
         amsTask.setIkey(Long.parseLong(String.valueOf(CRC16Util.calcCrc16(ByteUtil.string2byteArray(amsTask.getTaskNo())))));
+        amsTask.setStFrom(Integer.valueOf(Constant.LOC_MIDDLE_CACHE.toString()));
+        amsTask.setStTo(Integer.valueOf(Constant.LOC_SORTATION_CACHE.toString()));
         amsTask.setPriority(1);
         amsTask.setBusinessType(businessType);
         amsTask.setExt1(op);

+ 2 - 2
warewms-ams/src/main/java/com/ruoyi/ams/wcs/service/impl/WcsServiceImpl.java

@@ -85,8 +85,8 @@ public class WcsServiceImpl implements IWcsService {
      */
     private static final Map<String, String> ndcReleaseControlBusinessTypeMap= new HashMap<String, String>(){
         {
-            put(Constant.AREA_INFO.STORAGE_AREA.getValue(), Constant.TASK_BUSINESS_TYPE.TASK_77.getValue());
-            put(Constant.AREA_INFO.EXIT_AREA.getValue(), Constant.TASK_BUSINESS_TYPE.TASK_78.getValue());
+            put(Constant.AREA_INFO.EXIT_AREA.getValue(), Constant.TASK_BUSINESS_TYPE.TASK_77.getValue());
+            put(Constant.AREA_INFO.STORAGE_AREA.getValue(), Constant.TASK_BUSINESS_TYPE.TASK_78.getValue());
         }
     };