|
@@ -167,9 +167,10 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 增加充电任务(TS触发触发任务反馈)
|
|
* 增加充电任务(TS触发触发任务反馈)
|
|
- * @param agvNo 车号
|
|
|
|
|
|
+ *
|
|
|
|
+ * @param agvNo 车号
|
|
* @param chargingSite 充电桩号
|
|
* @param chargingSite 充电桩号
|
|
- * @param index TS任务号
|
|
|
|
|
|
+ * @param index TS任务号
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
@@ -359,11 +360,11 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
|
|
wcsTask.setAgvNo(carNo + "");
|
|
wcsTask.setAgvNo(carNo + "");
|
|
}
|
|
}
|
|
|
|
|
|
- if (wcsTask.getState() == 2 || wcsTask.getState() == 7) {
|
|
|
|
|
|
+ if (wcsTask.getState() == 2) {
|
|
log.info("已完成的任务无需反馈");
|
|
log.info("已完成的任务无需反馈");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- //todo 转发类型任务才回调
|
|
|
|
|
|
+ //转发类型任务才回调
|
|
if (wcsTask.getTaskType().equals(Constant.TASK_TYPE.FORWARD.getValue())) {
|
|
if (wcsTask.getTaskType().equals(Constant.TASK_TYPE.FORWARD.getValue())) {
|
|
try {
|
|
try {
|
|
switch (state) {
|
|
switch (state) {
|
|
@@ -371,23 +372,26 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
|
|
wcsTask.setStartTime(new Date());
|
|
wcsTask.setStartTime(new Date());
|
|
break;
|
|
break;
|
|
case 2://完成
|
|
case 2://完成
|
|
- if (wcsTask.getState() != 6) {
|
|
|
|
- if (wcsTask.getState() == 2) {
|
|
|
|
- log.info("不能重复放货," + taskNo);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- wcsTask.setEndTime(new Date());
|
|
|
|
- // 解锁终点库位
|
|
|
|
- baseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationTo())
|
|
|
|
- , Constant.WAREHOUSE_ID, updateBy);
|
|
|
|
- // 将中间缓存位库存移动到终点
|
|
|
|
- moveMiddleCacheToDestination(wcsTask);
|
|
|
|
- // 修改库存标识标识 因为接驳位可以出库也可以入库 所以需要标识当前接驳位的库存是入库还是出库
|
|
|
|
- updateInvAsnSoMarking(wcsTask);
|
|
|
|
- //释放redis锁
|
|
|
|
- if (!StringUtils.isEmpty(wcsTask.getExt8())) {
|
|
|
|
- redisCache.unlockCacheObject(Long.parseLong(wcsTask.getExt8()));
|
|
|
|
- }
|
|
|
|
|
|
+ if (wcsTask.getState() != 4 && wcsTask.getState() != 7) {
|
|
|
|
+ log.info("任务未取货,不能直接完成!" + taskNo);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (wcsTask.getState() == 2) {
|
|
|
|
+ log.info("不能重复放货," + taskNo);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (wcsTask.getState() == 6) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ wcsTask.setEndTime(new Date());
|
|
|
|
+ // 解锁终点库位
|
|
|
|
+ baseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationTo())
|
|
|
|
+ , Constant.WAREHOUSE_ID, updateBy);
|
|
|
|
+ // 将中间缓存位库存移动到终点
|
|
|
|
+ moveMiddleCacheToDestination(wcsTask);
|
|
|
|
+ //释放redis锁
|
|
|
|
+ if (!StringUtils.isEmpty(wcsTask.getExt8())) {
|
|
|
|
+ redisCache.unlockCacheObject(Long.parseLong(wcsTask.getExt8()));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
@@ -397,11 +401,6 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
|
|
log.info("不能重复取货," + taskNo);
|
|
log.info("不能重复取货," + taskNo);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- // 如果是接驳位(模具-东)的点位取货完成 反馈关闭靠墙第二层自动门
|
|
|
|
- if (wcsTask.getLocationFrom().equals(Constant.LOC_MJ_EAST.toString())) {
|
|
|
|
- Thread.sleep(3000);
|
|
|
|
- autoDoorClient.sendClose(AutoDoorClient.AUTO_DOOR_NO.C);
|
|
|
|
- }
|
|
|
|
// 解锁起始库位
|
|
// 解锁起始库位
|
|
baseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom())
|
|
baseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationFrom())
|
|
, Constant.WAREHOUSE_ID, updateBy);
|
|
, Constant.WAREHOUSE_ID, updateBy);
|
|
@@ -416,23 +415,26 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
|
|
case 5:
|
|
case 5:
|
|
break;
|
|
break;
|
|
case 6://卸货
|
|
case 6://卸货
|
|
- if (wcsTask.getState() != 2) {
|
|
|
|
- if (wcsTask.getState() == 6) {
|
|
|
|
- log.info("不能重复放货," + taskNo);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- wcsTask.setEndTime(new Date());
|
|
|
|
- // 解锁终点库位
|
|
|
|
- baseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationTo())
|
|
|
|
- , Constant.WAREHOUSE_ID, updateBy);
|
|
|
|
- // 将中间缓存位库存移动到终点
|
|
|
|
- moveMiddleCacheToDestination(wcsTask);
|
|
|
|
- // 修改库存标识标识 因为接驳位可以出库也可以入库 所以需要标识当前接驳位的库存是入库还是出库
|
|
|
|
- updateInvAsnSoMarking(wcsTask);
|
|
|
|
- //释放redis锁
|
|
|
|
- if (!StringUtils.isEmpty(wcsTask.getExt8())) {
|
|
|
|
- redisCache.unlockCacheObject(Long.parseLong(wcsTask.getExt8()));
|
|
|
|
- }
|
|
|
|
|
|
+ if (wcsTask.getState() != 4 && wcsTask.getState() != 7) {
|
|
|
|
+ log.info("任务未取货,不能直接完成!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (wcsTask.getState() == 6) {
|
|
|
|
+ log.info("不能重复放货," + taskNo);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (wcsTask.getState() == 2) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ wcsTask.setEndTime(new Date());
|
|
|
|
+ // 解锁终点库位
|
|
|
|
+ baseLocationInfoService.unLockLocationStockStatus(Long.parseLong(wcsTask.getLocationTo())
|
|
|
|
+ , Constant.WAREHOUSE_ID, updateBy);
|
|
|
|
+ // 将中间缓存位库存移动到终点
|
|
|
|
+ moveMiddleCacheToDestination(wcsTask);
|
|
|
|
+ //释放redis锁
|
|
|
|
+ if (!StringUtils.isEmpty(wcsTask.getExt8())) {
|
|
|
|
+ redisCache.unlockCacheObject(Long.parseLong(wcsTask.getExt8()));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 7://取消
|
|
case 7://取消
|