|
@@ -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);
|
|
|
- }
|
|
|
-
|
|
|
}
|