|
|
|
|
@ -127,7 +127,14 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
private final IWorkPlanService workPlanService; |
|
|
|
|
private final IPrWorkPlanService prWorkPlanService; |
|
|
|
|
private final IPrWorkOrderService prWorkOrderService; |
|
|
|
|
/** |
|
|
|
|
* 订单中心服务:管理站点与工位的关联关系 |
|
|
|
|
*/ |
|
|
|
|
private final IStationCenterService stationCenterService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* PR工单服务:查询生产工单信息 |
|
|
|
|
*/ |
|
|
|
|
private final IPrYieldOrderService prYieldOrderService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -346,9 +353,20 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
log.warn("【回库任务创建】参数DTO为空,操作终止"); |
|
|
|
|
return R.fail("回库参数不能为空"); |
|
|
|
|
} |
|
|
|
|
if (Objects.isNull(returnToWarehouseDto.getEndWcId())) { |
|
|
|
|
if (Objects.isNull(returnToWarehouseDto.getEndWcId())&&(returnToWarehouseDto.getEndStationCode() == null ||returnToWarehouseDto.getEndStationCode().isEmpty())) { |
|
|
|
|
log.warn("【回库任务创建】结束工位ID为空,操作终止"); |
|
|
|
|
return R.fail("结束位置不能为空"); |
|
|
|
|
return R.fail("结束位置获取结束站码不能为空"); |
|
|
|
|
} |
|
|
|
|
List<Station> stationList =null; |
|
|
|
|
if (returnToWarehouseDto.getEndStationCode() != null && !returnToWarehouseDto.getEndStationCode().isEmpty()) { |
|
|
|
|
stationList=stationService.list(new LambdaQueryWrapper<Station>() |
|
|
|
|
.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("当前结束站点码被占用或不支持运送"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
agvSend = Objects.nonNull(agvSend) ? agvSend : false; // 默认不发送AGV
|
|
|
|
|
|
|
|
|
|
@ -382,7 +400,14 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
if (returnToWarehouseDto.getStationRegion() != null) { |
|
|
|
|
task.setStationRegion(returnToWarehouseDto.getStationRegion()); |
|
|
|
|
} |
|
|
|
|
if (endWcId == 0) { |
|
|
|
|
if(stationList!=null&&stationList.size()!=0){ |
|
|
|
|
Station station = stationList.get(0); |
|
|
|
|
station.setStationStatus(PRE_STATUS_OCCUPIED); |
|
|
|
|
stationService.updateStation(station); |
|
|
|
|
task.setStationId(station.getId()); |
|
|
|
|
task.setStationRegion(station.getStationRegion()); |
|
|
|
|
task.setWcId(stationCenterService.list(new LambdaQueryWrapper<StationCenter>().select(StationCenter::getWcId).eq(StationCenter::getStationId,station.getId())).get(0).getWcId()); |
|
|
|
|
}else if (endWcId == 0) { |
|
|
|
|
// 5.1 输送线回库:校验空箱数量
|
|
|
|
|
// R<?> conveyorCheckResult = checkConveyorEmptyBoxCount();
|
|
|
|
|
// if (!conveyorCheckResult.isSuccess()) {
|
|
|
|
|
@ -676,6 +701,9 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
} |
|
|
|
|
String wcName = bsWorkCenterService.getById(task.getWcId()).getWcName(); |
|
|
|
|
if (freeStationList != null && freeStationList.size() != 0) { |
|
|
|
|
if (!task.getStationRegion().isEmpty()) { |
|
|
|
|
freeStationList = freeStationList.stream().filter(s -> s.getStationRegion().equals(task.getStationRegion())).toList(); |
|
|
|
|
} |
|
|
|
|
//判断是不是镀后库作业中心
|
|
|
|
|
if (DistinguishRegionsEnum.includeByWcName(wcName) && !agvSend) { |
|
|
|
|
freeStationList = freeStationList.stream().filter(s -> s.getStationRegion().equals(task.getStationRegion())).toList(); |
|
|
|
|
@ -689,6 +717,7 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
// 锁定站点(预占用)
|
|
|
|
|
station.setStationStatus(PRE_STATUS_OCCUPIED); |
|
|
|
|
stationService.updateById(station); |
|
|
|
|
|
|
|
|
|
log.info("【资源分配】工位{}分配到空闲站点{}", task.getWcId(), station.getId()); |
|
|
|
|
return R.data(task); |
|
|
|
|
} |
|
|
|
|
@ -926,9 +955,16 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据箱条码查询箱数量和工位信息 |
|
|
|
|
* <p>查询箱条码绑定的订单数量及关联工位信息</p> |
|
|
|
|
* |
|
|
|
|
* @param boxBarcode 箱条码 |
|
|
|
|
* @return R<QuantityLocationVO> 包含数量、工位名称、区域信息 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public R getQuantityLocation(String boxBarcode) { |
|
|
|
|
// 1. 校验箱条码非空(增加空白字符校验)
|
|
|
|
|
// 1. 校验箱条码非空(增加空白字符校验)
|
|
|
|
|
if (StringUtils.isEmpty(boxBarcode) || boxBarcode.trim().isEmpty()) { |
|
|
|
|
return R.fail("箱条码信息不能为空"); |
|
|
|
|
} |
|
|
|
|
@ -963,6 +999,13 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
return R.data(quantityLocationVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询箱条码详细信息 |
|
|
|
|
* <p>查询箱条码绑定的订单详情、总重量、数量、工位区域等信息</p> |
|
|
|
|
* |
|
|
|
|
* @param boxBarcode 箱条码 |
|
|
|
|
* @return R<BoxbarcodeDetailsVO> 箱条码详细信息 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public R getBoxbarcodeDetails(String boxBarcode) { |
|
|
|
|
if (StringUtils.isBlank(boxBarcode)) { |
|
|
|
|
@ -1118,6 +1161,13 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
return yieldOrder; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据站点编码查询站点及箱条码详情 |
|
|
|
|
* <p>查询站点信息,并返回该站点最新的任务关联的箱条码详情</p> |
|
|
|
|
* |
|
|
|
|
* @param stationCode 站点编码 |
|
|
|
|
* @return R<StationNameBoxBarcodeVO> 站点及箱条码详情 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public R getStationNameBoxBarcode(String stationCode) { |
|
|
|
|
R stationR = stationService.getStationName(stationCode); |
|
|
|
|
@ -1140,6 +1190,12 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
return R.data(stationNameBoxBarcodeVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询站点区域列表 |
|
|
|
|
* <p>查询所有被占用的站点区域,并按区域分组返回站点编码列表</p> |
|
|
|
|
* |
|
|
|
|
* @return R<List<StationRegionVo>> 区域列表(含区域下站点编码) |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public R getStationRegion() { |
|
|
|
|
List<StationVO> freeStationList = stationService.getStatusStationList(STATUS_FREE, false, null, CONVEYOR_LINE_RECEIVE_ONLY, false); |
|
|
|
|
|