|
@@ -655,14 +655,6 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- //转发任务
|
|
|
- if (StringUtils.isNotEmpty(wcsTask.getTaskType())
|
|
|
- && wcsTask.getTaskType().equals(Constant.TASK_TYPE.FORWARD.getValue())) {
|
|
|
- sendTask(wcsTask);
|
|
|
- wcsTask.setState(10L);
|
|
|
- wcsTaskService.updateWcsTask(wcsTask);
|
|
|
- break;
|
|
|
- }
|
|
|
|
|
|
try {
|
|
|
//任务下发判断
|
|
@@ -720,7 +712,7 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
//起始库位
|
|
|
basLocationInfoFrom = baseLocationInfoService.selectBaseLocationInfoById(Long.parseLong(wcsTask.getLocationFrom()));
|
|
|
//目标库位
|
|
|
- BaseLocationInfo locationInfoTo = baseLocationInfoService.selectBaseLocationInfoById(Long.parseLong(wcsTask.getLocationTo()));
|
|
|
+// BaseLocationInfo locationInfoTo = baseLocationInfoService.selectBaseLocationInfoById(Long.parseLong(wcsTask.getLocationTo()));
|
|
|
//TODO 前置任务未完成不进行下发
|
|
|
if (businessService.taskDispatchCheck(wcsTask) == false) {
|
|
|
return false;
|
|
@@ -735,99 +727,99 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
}
|
|
|
|
|
|
//起始库位巷道检测(起始库位检测是否同巷道)
|
|
|
- if (!StringUtils.isEmpty(basLocationInfoFrom.getColNo())) {
|
|
|
- List<BaseLocationInfo> locationInfoList = baseLocationInfoMapper.laneCheck(basLocationInfoFrom.getColNo(), "LANE_FROM", Constant.WAREHOUSE_ID);
|
|
|
- if (locationInfoList != null && locationInfoList.size() > 0) {
|
|
|
- wcsTask.setRemark("起始库位同列或同巷道有车辆在任务中,等待其他任务完成");
|
|
|
- wcsTaskService.updateWcsTask(wcsTask);
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
+// if (!StringUtils.isEmpty(basLocationInfoFrom.getColNo())) {
|
|
|
+// List<BaseLocationInfo> locationInfoList = baseLocationInfoMapper.laneCheck(basLocationInfoFrom.getColNo(), "LANE_FROM", Constant.WAREHOUSE_ID);
|
|
|
+// if (locationInfoList != null && locationInfoList.size() > 0) {
|
|
|
+// wcsTask.setRemark("起始库位同列或同巷道有车辆在任务中,等待其他任务完成");
|
|
|
+// wcsTaskService.updateWcsTask(wcsTask);
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
//起始库位是地堆需要判断是否有阻挡
|
|
|
- if (basLocationInfoFrom.getLocationType().equals("2")) {
|
|
|
- //判断队列中是否有阻挡在当前任务之前
|
|
|
- List<WcsTaskLocationDTO> locationDTOS = wcsTaskService.selectTaskByColNo(basLocationInfoFrom.getColNo(), basLocationInfoFrom.getColIndex(), basLocationInfoFrom.getZoneId(), null);
|
|
|
- if (locationDTOS.size() > 0) {
|
|
|
- wcsTask.setRemark("队列中有其他任务阻挡,让其他任务先执行");
|
|
|
- wcsTaskService.updateWcsTask(wcsTask);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- //判断出库库位前是否有阻挡
|
|
|
- List<BaseLocationInfo> beforeLoc = baseLocationInfoService.selectBeforeLocationByColNo(basLocationInfoFrom.getColNo(), basLocationInfoFrom.getColIndex());
|
|
|
- if (beforeLoc != null) {
|
|
|
- for (BaseLocationInfo b : beforeLoc) {
|
|
|
- //如果前面库位不为空,或者状态占用
|
|
|
- //TODO 去除已经在任务中的
|
|
|
- if (b.getIsEmpty().equals("N")) {
|
|
|
- wcsTask.setRemark("有阻挡物,任务无法执行");
|
|
|
- wcsTaskService.updateWcsTask(wcsTask);
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// if (basLocationInfoFrom.getLocationType().equals("2")) {
|
|
|
+// //判断队列中是否有阻挡在当前任务之前
|
|
|
+// List<WcsTaskLocationDTO> locationDTOS = wcsTaskService.selectTaskByColNo(basLocationInfoFrom.getColNo(), basLocationInfoFrom.getColIndex(), basLocationInfoFrom.getZoneId(), null);
|
|
|
+// if (locationDTOS.size() > 0) {
|
|
|
+// wcsTask.setRemark("队列中有其他任务阻挡,让其他任务先执行");
|
|
|
+// wcsTaskService.updateWcsTask(wcsTask);
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+//
|
|
|
+// //判断出库库位前是否有阻挡
|
|
|
+// List<BaseLocationInfo> beforeLoc = baseLocationInfoService.selectBeforeLocationByColNo(basLocationInfoFrom.getColNo(), basLocationInfoFrom.getColIndex());
|
|
|
+// if (beforeLoc != null) {
|
|
|
+// for (BaseLocationInfo b : beforeLoc) {
|
|
|
+// //如果前面库位不为空,或者状态占用
|
|
|
+// //TODO 去除已经在任务中的
|
|
|
+// if (b.getIsEmpty().equals("N")) {
|
|
|
+// wcsTask.setRemark("有阻挡物,任务无法执行");
|
|
|
+// wcsTaskService.updateWcsTask(wcsTask);
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
currentTask = wcsTask;
|
|
|
|
|
|
//目标库位如果是地堆需要判断是否有阻挡
|
|
|
- if (locationInfoTo != null && locationInfoTo.getLocationType().equals("2")) {
|
|
|
- List<BaseLocationInfo> beforeLoc = baseLocationInfoService.selectBeforeLocationByColNo(locationInfoTo.getColNo(), locationInfoTo.getColIndex());
|
|
|
- if (beforeLoc != null) {
|
|
|
- for (BaseLocationInfo b : beforeLoc) {
|
|
|
- //跳过起始库位
|
|
|
- if (b.getId().equals(locationInfoTo.getId())) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- //如果前面库位不为空,或者状态占用
|
|
|
- //TODO 排除已经在任务中的
|
|
|
- if (b.getIsEmpty().equals("N")) {
|
|
|
- currentTask.setRemark("目标库位前方有阻挡1");
|
|
|
- currentTask.setUpdateDate(new Date());
|
|
|
- wcsTaskService.updateWcsTask(currentTask);
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<WcsTaskLocationDTO> dtos = wcsTaskService.selectTaskByColNoAfter(locationInfoTo.getColNo(), locationInfoTo.getColIndex(), locationInfoTo.getZoneId(), null);
|
|
|
- if (dtos != null && dtos.size() > 0) {
|
|
|
- currentTask.setRemark("目标库位同列有未完成的任务");
|
|
|
- wcsTaskService.updateWcsTask(currentTask);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+// if (locationInfoTo != null && locationInfoTo.getLocationType().equals("2")) {
|
|
|
+// List<BaseLocationInfo> beforeLoc = baseLocationInfoService.selectBeforeLocationByColNo(locationInfoTo.getColNo(), locationInfoTo.getColIndex());
|
|
|
+// if (beforeLoc != null) {
|
|
|
+// for (BaseLocationInfo b : beforeLoc) {
|
|
|
+// //跳过起始库位
|
|
|
+// if (b.getId().equals(locationInfoTo.getId())) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// //如果前面库位不为空,或者状态占用
|
|
|
+// //TODO 排除已经在任务中的
|
|
|
+// if (b.getIsEmpty().equals("N")) {
|
|
|
+// currentTask.setRemark("目标库位前方有阻挡1");
|
|
|
+// currentTask.setUpdateDate(new Date());
|
|
|
+// wcsTaskService.updateWcsTask(currentTask);
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// List<WcsTaskLocationDTO> dtos = wcsTaskService.selectTaskByColNoAfter(locationInfoTo.getColNo(), locationInfoTo.getColIndex(), locationInfoTo.getZoneId(), null);
|
|
|
+// if (dtos != null && dtos.size() > 0) {
|
|
|
+// currentTask.setRemark("目标库位同列有未完成的任务");
|
|
|
+// wcsTaskService.updateWcsTask(currentTask);
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
|
|
|
//查询是否有更里面的位置可以存放
|
|
|
- if (locationInfoTo != null) {
|
|
|
- if (locationInfoTo.getZoneId() != 10) {
|
|
|
- String locationtoTmp = "";
|
|
|
- List<BaseLocationInfoSameColDTO> b = baseLocationInfoService.selectSameColCanToLoc(locationInfoTo.getColNo(), locationInfoTo.getColIndex());
|
|
|
- for (BaseLocationInfoSameColDTO bt : b) {
|
|
|
- if (bt.getIsOb() == false) {
|
|
|
- locationtoTmp = bt.getId().toString();
|
|
|
- } else {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (!StringUtils.isEmpty(locationtoTmp)) {
|
|
|
- wcsTask.setLocationTo(locationtoTmp);
|
|
|
- wcsTaskService.updateWcsTask(wcsTask);
|
|
|
-
|
|
|
- //释放原库位
|
|
|
- locationInfoTo.setStockStatus("00");
|
|
|
- baseLocationInfoService.updateBaseLocationInfo(locationInfoTo);
|
|
|
-
|
|
|
- //占用新库位
|
|
|
- BaseLocationInfo newlocationInfoTo = baseLocationInfoService.selectBaseLocationInfoById(Long.parseLong(locationtoTmp));
|
|
|
- newlocationInfoTo.setStockStatus("10");
|
|
|
- baseLocationInfoService.updateBaseLocationInfo(newlocationInfoTo);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// if (locationInfoTo != null) {
|
|
|
+// if (locationInfoTo.getZoneId() != 10) {
|
|
|
+// String locationtoTmp = "";
|
|
|
+// List<BaseLocationInfoSameColDTO> b = baseLocationInfoService.selectSameColCanToLoc(locationInfoTo.getColNo(), locationInfoTo.getColIndex());
|
|
|
+// for (BaseLocationInfoSameColDTO bt : b) {
|
|
|
+// if (bt.getIsOb() == false) {
|
|
|
+// locationtoTmp = bt.getId().toString();
|
|
|
+// } else {
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (!StringUtils.isEmpty(locationtoTmp)) {
|
|
|
+// wcsTask.setLocationTo(locationtoTmp);
|
|
|
+// wcsTaskService.updateWcsTask(wcsTask);
|
|
|
+//
|
|
|
+// //释放原库位
|
|
|
+// locationInfoTo.setStockStatus("00");
|
|
|
+// baseLocationInfoService.updateBaseLocationInfo(locationInfoTo);
|
|
|
+//
|
|
|
+// //占用新库位
|
|
|
+// BaseLocationInfo newlocationInfoTo = baseLocationInfoService.selectBaseLocationInfoById(Long.parseLong(locationtoTmp));
|
|
|
+// newlocationInfoTo.setStockStatus("10");
|
|
|
+// baseLocationInfoService.updateBaseLocationInfo(newlocationInfoTo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
currentTask.setState(10L);
|
|
|
currentTask.setRemark("");
|