|
|
|
|
@ -360,27 +360,29 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
List<Station> stationList =null; |
|
|
|
|
if (returnToWarehouseDto.getEndStationCode() != null && !returnToWarehouseDto.getEndStationCode().isEmpty()) { |
|
|
|
|
stationList=stationService.list(new LambdaQueryWrapper<Station>() |
|
|
|
|
.ne(Station::getStatus, CONVEYOR_LINE_RECEIVE_ONLY) |
|
|
|
|
// .ne(Station::getStatus, CONVEYOR_LINE_RECEIVE_ONLY)
|
|
|
|
|
.eq(Station::getStationStatus, STATUS_FREE) |
|
|
|
|
.eq(Station::getStationCode, returnToWarehouseDto.getEndStationCode())); |
|
|
|
|
if (stationList==null||stationList.size()==0) { |
|
|
|
|
return R.fail("当前结束站点码被占用或不支持运送"); |
|
|
|
|
return R.fail("当前结束站点码被占用"); |
|
|
|
|
} |
|
|
|
|
List<StationCenter> stationCenterList = stationCenterService.list(new LambdaQueryWrapper<StationCenter>().select(StationCenter::getWcId).eq(StationCenter::getStationId, stationList.get(0).getId())); |
|
|
|
|
if (stationCenterList==null||stationCenterList.size()==0) { |
|
|
|
|
return R.fail("当前结束站点码没有对应的作业中心"); |
|
|
|
|
} |
|
|
|
|
List<BsWorkCenterEntity> bsWorkCenterEntityList = bsWorkCenterService.list(new LambdaQueryWrapper<BsWorkCenterEntity>().select(BsWorkCenterEntity::getWcName).eq(BsWorkCenterEntity::getId, stationCenterList.get(0).getWcId())); |
|
|
|
|
if (bsWorkCenterEntityList==null||bsWorkCenterEntityList.size()==0) { |
|
|
|
|
return R.fail("当前结束站点码没有对应的作业中心"); |
|
|
|
|
} |
|
|
|
|
if (!bsWorkCenterEntityList.get(0).getWcName().equals("镀后检验作业中心")) { |
|
|
|
|
stationList=stationList.stream().filter(s->!s.getStatus().equals(CONVEYOR_LINE_RECEIVE_ONLY)).toList(); |
|
|
|
|
if (stationList==null||stationList.size()==0) { |
|
|
|
|
return R.fail("当前结束站点码被占用"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
agvSend = Objects.nonNull(agvSend) ? agvSend : false; // 默认不发送AGV
|
|
|
|
|
|
|
|
|
|
// 1.2 若传了结束站点编码,校验站点是否空闲可用
|
|
|
|
|
List<Station> stationArrayList = null; |
|
|
|
|
if (returnToWarehouseDto.getEndStationCode() != null && !returnToWarehouseDto.getEndStationCode().isEmpty()) { |
|
|
|
|
stationArrayList = stationService.list(new LambdaQueryWrapper<Station>() |
|
|
|
|
.ne(Station::getStatus, CONVEYOR_LINE_RECEIVE_ONLY) |
|
|
|
|
.eq(Station::getStationStatus, STATUS_FREE) |
|
|
|
|
.eq(Station::getStationCode, returnToWarehouseDto.getEndStationCode())); |
|
|
|
|
if (stationArrayList == null || stationArrayList.size() == 0) { |
|
|
|
|
return R.fail("当前结束站点码被占用或不支持运送"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 2. 初始化变量
|
|
|
|
|
String startStationCode = ""; |
|
|
|
|
@ -412,8 +414,8 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
if (returnToWarehouseDto.getStationRegion() != null) { |
|
|
|
|
task.setStationRegion(returnToWarehouseDto.getStationRegion()); |
|
|
|
|
} |
|
|
|
|
if(stationArrayList!=null&&stationArrayList.size()!=0){ |
|
|
|
|
Station station = stationArrayList.get(0); |
|
|
|
|
if(stationList!=null&&stationList.size()!=0){ |
|
|
|
|
Station station = stationList.get(0); |
|
|
|
|
station.setStationStatus(PRE_STATUS_OCCUPIED); |
|
|
|
|
stationService.updateStation(station); |
|
|
|
|
task.setStationId(station.getId()); |
|
|
|
|
|