|
|
|
|
@ -425,6 +425,18 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
return R.data(bsWorkCenterVOList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R getBSWORKCENTER() { |
|
|
|
|
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getStationStatus, STATUS_FREE)); |
|
|
|
|
if (!stationList.isEmpty()) { |
|
|
|
|
List<Long> list = stationList.stream().map(Station::getWcId).distinct().collect(Collectors.toList()); |
|
|
|
|
List<BsWorkCenterVO> bwList = bsWorkCenterService.getByIds(list); |
|
|
|
|
return R.data(bwList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量保存订单与任务的绑定关系 |
|
|
|
|
* 核心:创建订单绑定记录并批量插入,插入失败则回滚任务(删除已创建的任务) |
|
|
|
|
@ -484,7 +496,7 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
|
*/ |
|
|
|
|
private R getSiteLocation(Task task) { |
|
|
|
|
// 1. 查询当前工位可用的站点(状态为占用的站点)
|
|
|
|
|
List<Station> list = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getWcId, task.getWcId()).eq(Station::getStationStatus, STATUS_OCCUPIED)); |
|
|
|
|
List<Station> list = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getWcId, task.getWcId()).eq(Station::getStationStatus, STATUS_FREE)); |
|
|
|
|
if (!CollectionUtils.isEmpty(list)) { |
|
|
|
|
task.setStationId(list.get(0).getId()); // 分配第一个可用站点
|
|
|
|
|
// 更新站点状态为预占用(锁定站点)
|
|
|
|
|
|