恢复了站台连续拣选功能
This commit is contained in:
parent
4d35a2a337
commit
76a199028c
|
|
@ -1152,10 +1152,10 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
* @param response EWM接口返回的数据
|
||||
* @param vehicleNo 载具号
|
||||
*/
|
||||
private void saveEwmDataToTempTable(EwmApiLocalResponse response, String vehicleNo) {
|
||||
private boolean saveEwmDataToTempTable(EwmApiLocalResponse response, String vehicleNo) {
|
||||
if (response == null || response.getContent() == null || response.getContent().toString().isEmpty()) {
|
||||
log.warn("EWM返回数据为空或无任务明细,载具号: {}", vehicleNo);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
boolean deletedCount = tempEwmInboundDataService.remove(new LambdaQueryWrapper<TAppTempEwmInboundData>()
|
||||
|
|
@ -1212,6 +1212,15 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
// 将Map中的值转换为List
|
||||
List<TAppTempEwmInboundData> dataList = new ArrayList<>(dataMap.values());
|
||||
|
||||
// 新增逻辑:检查是否有多条相同matNo的数据
|
||||
Set<String> matNoSet = new HashSet<>();
|
||||
for (TAppTempEwmInboundData data : dataList) {
|
||||
if (!matNoSet.add(data.getMatNo())) {
|
||||
log.warn("EWM返回数据中存在多条相同的matNo,载具号: {}, 重复的matNo: {}", vehicleNo, data.getMatNo());
|
||||
return false; // 或者抛出异常,取决于你希望如何处理这种情况
|
||||
}
|
||||
}
|
||||
|
||||
if (!dataList.isEmpty()) {
|
||||
// 批量插入时指定合理的批次大小
|
||||
boolean saveResult = tempEwmInboundDataService.saveBatch(dataList);
|
||||
|
|
@ -1221,6 +1230,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
log.error("保存EWM数据到临时表失败,载具号: {}", vehicleNo, e);
|
||||
throw e; // 重新抛出异常以便上层处理
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1351,15 +1361,15 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
if (!response.isSuccess()) {
|
||||
return WcsApiResponse.error(response.getMessage(), null);
|
||||
}
|
||||
if (response.getContent().getTaskDetailInfo().size() > 1){
|
||||
return WcsApiResponse.error("该容器绑定了多个料,请检查。", null);
|
||||
}
|
||||
// if (response.getContent().getTaskDetailInfo().size() > 1){
|
||||
// return WcsApiResponse.error("该容器绑定了多个料,请检查。", null);
|
||||
// }
|
||||
// 判断是否为空箱
|
||||
if (response.getContent().isEmptyContainer()) {
|
||||
if (!outsCheckList.isEmpty() || !stockList.isEmpty()){
|
||||
return WcsApiResponse.error("该容器已作为拣选任务绑定的目标容器,请检查。", null);
|
||||
}
|
||||
return WcsApiResponse.success("该容器为空箱,请检查。", null);
|
||||
return WcsApiResponse.error("该容器为空箱,请检查。", null);
|
||||
// 创建空载具入库任务
|
||||
// TAppTask task = new TAppTask(
|
||||
// UUIDUtils.getNewUUID(),
|
||||
|
|
@ -1389,7 +1399,9 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
}else{
|
||||
try {
|
||||
// 2. 将EWM数据保存到临时表
|
||||
saveEwmDataToTempTable(response, wcsVehicleInRequest.getVehicleNo());
|
||||
if (!saveEwmDataToTempTable(response, wcsVehicleInRequest.getVehicleNo())){
|
||||
return WcsApiResponse.error("插入了多条不符合要求的数据。", null);
|
||||
}
|
||||
|
||||
// 3. 根据临时表数据生成WMS任务
|
||||
generateWmsTasksFromTempData(wcsVehicleInRequest);
|
||||
|
|
@ -1766,7 +1778,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
if (thisOut.size() != confirmTaskRequest.getTaskConfirm().getTotalQty()){
|
||||
return BaseWmsApiResponse.error("EWM下发新需求,请刷新后重新合并!");
|
||||
}
|
||||
|
||||
//
|
||||
// 调用EWM系统检验箱子
|
||||
SendEwmCheckContainerNo request = new SendEwmCheckContainerNo();
|
||||
request.setContainerNo(confirmTaskRequest.getTaskConfirm().getContainerNo());
|
||||
|
|
@ -1865,6 +1877,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
}
|
||||
}else {
|
||||
log.error("调用回告EWM系统出库完成接口异常,请求参数: {}", requestForCompleted);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return BaseWmsApiResponse.error("调用回告EWM系统出库完成接口异常: " + ewmResponse.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
@ -1890,12 +1903,12 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
|||
log.info("容器置空调用EWM系统接口成功,请求参数: {}", request);
|
||||
}
|
||||
}
|
||||
// if (appPickTaskService.exists(new LambdaQueryWrapper<TAppPickTask>()
|
||||
// .eq(TAppPickTask::getVehicleId, thisPickTask.getVehicleId())
|
||||
// .eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode())
|
||||
// )){
|
||||
// return BaseWmsApiResponse.success("继续拣选");
|
||||
// }
|
||||
if (appPickTaskService.exists(new LambdaQueryWrapper<TAppPickTask>()
|
||||
.eq(TAppPickTask::getVehicleId, thisPickTask.getVehicleId())
|
||||
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode())
|
||||
)){
|
||||
return BaseWmsApiResponse.success("继续拣选");
|
||||
}
|
||||
return BaseWmsApiResponse.success("确认成功。");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user