|
@@ -400,7 +400,8 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
break;
|
|
|
}
|
|
|
if (locationInfo == null) {
|
|
|
- throw new ServiceException("出库目标点没有可以分配的库位", token);
|
|
|
+ // 出库没有可分配库位,不报错,返回空
|
|
|
+// throw new ServiceException("出库目标点没有可以分配的库位", token);
|
|
|
}
|
|
|
}
|
|
|
} else { //移库
|
|
@@ -553,7 +554,7 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
}
|
|
|
if (flowConfigHeaderVO.getLocationToStrategyFlag().equals("N")) {
|
|
|
if (locationTo == null) {
|
|
|
- throw new ServiceException("目标库位不能为空", token);
|
|
|
+// throw new ServiceException("目标库位不能为空", token);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -569,6 +570,8 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
if (locationTo != null) {
|
|
|
wcsTask.setAreaTo(locationTo.getZoneId() + "");
|
|
|
wcsTask.setLocationTo(locationTo.getId().toString());
|
|
|
+ } else {
|
|
|
+ wcsTask.setLocationTo("待分配");
|
|
|
}
|
|
|
wcsTask.setState(9L);
|
|
|
wcsTask.setPriority(1L);
|
|
@@ -585,30 +588,31 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
wcsTask.setRemark(agvCallDTO.getAgvCallItemDTOList().get(0).isSuperHigh() ? "超高!" : "");
|
|
|
wcsTaskList.add(wcsTask);
|
|
|
businessService.addTask(wcsTask);
|
|
|
- // 入库任务,记录当前是哪辆车接了任务
|
|
|
- if (locationTo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue())) {
|
|
|
- if (locationTo.getFoldedTag().equals("1")) {
|
|
|
- redisCache.setCacheObject(RedisKey.AGV_TASK_CAR_NO, 1);
|
|
|
- } else if (locationTo.getFoldedTag().equals("2")) {
|
|
|
- redisCache.setCacheObject(RedisKey.AGV_TASK_CAR_NO, 2);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 入库任务,统计两辆车分别发了多少任务
|
|
|
- if (locationTo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue())) {
|
|
|
- if (locationTo.getFoldedTag().equals("1")) {
|
|
|
- if (redisCache.getCacheObject(RedisKey.AGV01_TASK_NUM) == null) {
|
|
|
- redisCache.setCacheObject(RedisKey.AGV01_TASK_NUM, 1);
|
|
|
- } else {
|
|
|
- int num = redisCache.getCacheObject(RedisKey.AGV01_TASK_NUM);
|
|
|
- redisCache.setCacheObject(RedisKey.AGV01_TASK_NUM, 1 + num);
|
|
|
+ if (locationTo != null) {
|
|
|
+ // 入库任务,记录当前是哪辆车接了任务
|
|
|
+ if (locationTo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue())) {
|
|
|
+ if (locationTo.getFoldedTag().equals("1")) {
|
|
|
+ redisCache.setCacheObject(RedisKey.AGV_TASK_CAR_NO, 1);
|
|
|
+ } else if (locationTo.getFoldedTag().equals("2")) {
|
|
|
+ redisCache.setCacheObject(RedisKey.AGV_TASK_CAR_NO, 2);
|
|
|
}
|
|
|
- } else if (locationTo.getFoldedTag().equals("2")) {
|
|
|
- if (redisCache.getCacheObject(RedisKey.AGV02_TASK_NUM) == null) {
|
|
|
- redisCache.setCacheObject(RedisKey.AGV02_TASK_NUM, 1);
|
|
|
- } else {
|
|
|
- int num = redisCache.getCacheObject(RedisKey.AGV02_TASK_NUM);
|
|
|
- redisCache.setCacheObject(RedisKey.AGV02_TASK_NUM, 1 + num);
|
|
|
+ }
|
|
|
+ // 入库任务,统计两辆车分别发了多少任务
|
|
|
+ if (locationTo.getZoneId().equals(Constant.ZONE_TYPE.ZONE_INV.getValue())) {
|
|
|
+ if (locationTo.getFoldedTag().equals("1")) {
|
|
|
+ if (redisCache.getCacheObject(RedisKey.AGV01_TASK_NUM) == null) {
|
|
|
+ redisCache.setCacheObject(RedisKey.AGV01_TASK_NUM, 1);
|
|
|
+ } else {
|
|
|
+ int num = redisCache.getCacheObject(RedisKey.AGV01_TASK_NUM);
|
|
|
+ redisCache.setCacheObject(RedisKey.AGV01_TASK_NUM, 1 + num);
|
|
|
+ }
|
|
|
+ } else if (locationTo.getFoldedTag().equals("2")) {
|
|
|
+ if (redisCache.getCacheObject(RedisKey.AGV02_TASK_NUM) == null) {
|
|
|
+ redisCache.setCacheObject(RedisKey.AGV02_TASK_NUM, 1);
|
|
|
+ } else {
|
|
|
+ int num = redisCache.getCacheObject(RedisKey.AGV02_TASK_NUM);
|
|
|
+ redisCache.setCacheObject(RedisKey.AGV02_TASK_NUM, 1 + num);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -788,6 +792,18 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
wcsTaskService.updateWcsTask(wcsTask);
|
|
|
break;
|
|
|
}
|
|
|
+ // 出库任务分配目标库位
|
|
|
+ if (wcsTask.getLocationTo().equals("待分配")) {
|
|
|
+ AjaxResult ajaxResult = allocateTargetLocation(wcsTask);
|
|
|
+ if (!ajaxResult.isSuccess()) {
|
|
|
+ continue;
|
|
|
+ } else {
|
|
|
+ BaseLocationInfo locationInfo = ajaxResult.getDataParseObject(BaseLocationInfo.class);
|
|
|
+ wcsTask.setAreaTo(locationInfo.getZoneId().toString());
|
|
|
+ wcsTask.setLocationTo(locationInfo.getId().toString());
|
|
|
+ wcsTaskService.updateWcsTask(wcsTask);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//转发任务
|
|
|
if (StringUtils.isNotEmpty(wcsTask.getTaskType())
|
|
@@ -809,6 +825,24 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 分配出库目标库位
|
|
|
+ * 目标库位为待分配
|
|
|
+ *
|
|
|
+ * @param wcsTask
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private AjaxResult allocateTargetLocation(WcsTask wcsTask) {
|
|
|
+ List<BaseLocationInfo> locationToList = this.convertLocation(Constant.ZONE_TYPE.ZONE_OUT.getValue().toString()
|
|
|
+ , Constant.WAREHOUSE_ID, null);
|
|
|
+ BaseLocationInfo locationTo = this.zoneLocationAllocation(locationToList, "locationTo", "SO"
|
|
|
+ , null, null, Long.valueOf(wcsTask.getExt8()));
|
|
|
+ if (locationTo == null) {
|
|
|
+ return AjaxResult.error("");
|
|
|
+ }
|
|
|
+ return AjaxResult.success("", locationTo);
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public boolean taskDispatchStack(WcsTask wcsTask) {
|