|
@@ -17,6 +17,7 @@ import com.ruoyi.ams.task.mapper.WcsTaskMapper;
|
|
import com.ruoyi.ams.task.service.IWcsTaskService;
|
|
import com.ruoyi.ams.task.service.IWcsTaskService;
|
|
import com.ruoyi.base.constant.Constant;
|
|
import com.ruoyi.base.constant.Constant;
|
|
import com.ruoyi.base.domain.BaseLocationInfo;
|
|
import com.ruoyi.base.domain.BaseLocationInfo;
|
|
|
|
+import com.ruoyi.base.domain.CarInfo;
|
|
import com.ruoyi.base.service.IBaseLocationInfoService;
|
|
import com.ruoyi.base.service.IBaseLocationInfoService;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
@@ -363,6 +364,7 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
|
|
|
|
|
|
if (wcsTask.getTaskType().equals(Constant.TASK_TYPE.FORWARD.getValue())) {
|
|
if (wcsTask.getTaskType().equals(Constant.TASK_TYPE.FORWARD.getValue())) {
|
|
try {
|
|
try {
|
|
|
|
+ CarInfo carInfo = new CarInfo();
|
|
switch (state) {
|
|
switch (state) {
|
|
case 1:
|
|
case 1:
|
|
wcsTask.setStartTime(new Date());
|
|
wcsTask.setStartTime(new Date());
|
|
@@ -390,6 +392,9 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
|
|
if (!StringUtils.isEmpty(wcsTask.getExt8())) {
|
|
if (!StringUtils.isEmpty(wcsTask.getExt8())) {
|
|
redisCache.unlockCacheObject(Long.parseLong(wcsTask.getExt8()));
|
|
redisCache.unlockCacheObject(Long.parseLong(wcsTask.getExt8()));
|
|
}
|
|
}
|
|
|
|
+ carInfo.setUpdateType("status");
|
|
|
|
+ carInfo.setState("1");
|
|
|
|
+ SpringUtil.getApplicationContext().publishEvent(carInfo);
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
break;
|
|
break;
|
|
@@ -414,6 +419,11 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
|
|
if (!StringUtils.isEmpty(wcsTask.getExt8())) {
|
|
if (!StringUtils.isEmpty(wcsTask.getExt8())) {
|
|
redisCache.unlockCacheObject(Long.parseLong(wcsTask.getExt8()), wcsTask.getLocationFrom());
|
|
redisCache.unlockCacheObject(Long.parseLong(wcsTask.getExt8()), wcsTask.getLocationFrom());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ carInfo.setUpdateType("status");
|
|
|
|
+ carInfo.setState("2");
|
|
|
|
+ SpringUtil.getApplicationContext().publishEvent(carInfo);
|
|
break;
|
|
break;
|
|
case 5:
|
|
case 5:
|
|
break;
|
|
break;
|
|
@@ -459,8 +469,15 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ carInfo.setUpdateType("status");
|
|
|
|
+ carInfo.setState("1");
|
|
|
|
+ SpringUtil.getApplicationContext().publishEvent(carInfo);
|
|
break;
|
|
break;
|
|
case 8:
|
|
case 8:
|
|
|
|
+
|
|
|
|
+ carInfo.setUpdateType("status");
|
|
|
|
+ carInfo.setState("4");
|
|
|
|
+ SpringUtil.getApplicationContext().publishEvent(carInfo);
|
|
log.error("任务异常状态------------" + wcsTask.getTaskNo());
|
|
log.error("任务异常状态------------" + wcsTask.getTaskNo());
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
@@ -483,7 +500,7 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
|
|
wcsTask.setState(state.longValue());
|
|
wcsTask.setState(state.longValue());
|
|
wcsTask.setUpdateDate(new Date());
|
|
wcsTask.setUpdateDate(new Date());
|
|
wcsTaskService.updateWcsTask(wcsTask);
|
|
wcsTaskService.updateWcsTask(wcsTask);
|
|
-
|
|
+
|
|
if (statusList.contains(state)) {
|
|
if (statusList.contains(state)) {
|
|
SpringUtil.getApplicationContext().publishEvent(wcsTask);
|
|
SpringUtil.getApplicationContext().publishEvent(wcsTask);
|
|
}
|
|
}
|