|
|
@ -45,12 +45,18 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { |
|
|
Date currentTime = new Date(); |
|
|
Date currentTime = new Date(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询下这些栈板有没有不是结束 取消 失败状态的运输单 |
|
|
|
|
|
|
|
|
//查询下这些栈板有没有不是结束 取消 失败状态的运输单,以及是否正在被调用 |
|
|
for (int i = 0; i < data.size(); i++) { |
|
|
for (int i = 0; i < data.size(); i++) { |
|
|
List<WmsTransportTask> checkPalletTask = wcsIntegrationMapper.checkPalletTask(data.get(i).getSite(),data.get(i).getPalletId()); |
|
|
List<WmsTransportTask> checkPalletTask = wcsIntegrationMapper.checkPalletTask(data.get(i).getSite(),data.get(i).getPalletId()); |
|
|
if(checkPalletTask != null && !checkPalletTask.isEmpty()){ |
|
|
if(checkPalletTask != null && !checkPalletTask.isEmpty()){ |
|
|
throw new RuntimeException(checkPalletTask.getFirst().getPalletId()+ "栈板已有未完成的运输任务,请选择其他栈板"); |
|
|
throw new RuntimeException(checkPalletTask.getFirst().getPalletId()+ "栈板已有未完成的运输任务,请选择其他栈板"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 再次检查栈板是否已经被调用(双重保险) |
|
|
|
|
|
String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(data.get(i).getSite(), data.get(i).getPalletId()); |
|
|
|
|
|
if ("Y".equals(callingFlag)) { |
|
|
|
|
|
throw new RuntimeException(data.get(i).getPalletId() + "栈板正在被调用中,请选择其他栈板"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
// 生成任务编号 |
|
|
// 生成任务编号 |
|
|
TransNoControl transData = transNoService.getTransNo(data.getFirst().getSite(), "WTT", 10); |
|
|
TransNoControl transData = transNoService.getTransNo(data.getFirst().getSite(), "WTT", 10); |
|
|
@ -92,6 +98,11 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { |
|
|
// 批量插入运输任务 |
|
|
// 批量插入运输任务 |
|
|
wcsIntegrationMapper.batchSaveTransportTask(saveList); |
|
|
wcsIntegrationMapper.batchSaveTransportTask(saveList); |
|
|
|
|
|
|
|
|
|
|
|
// 更新栈板调用状态为Y |
|
|
|
|
|
for (WmsLabelAndPalletData item : data) { |
|
|
|
|
|
wcsIntegrationMapper.updatePalletCallingFlag(item.getSite(), item.getPalletId(), "Y", username); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// TODO: 这里可以调用WCS接口通知立库执行运输任务 |
|
|
// TODO: 这里可以调用WCS接口通知立库执行运输任务 |
|
|
wcsApiService.pushAgvTaskApi(saveList); |
|
|
wcsApiService.pushAgvTaskApi(saveList); |
|
|
} |
|
|
} |
|
|
@ -113,6 +124,12 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { |
|
|
throw new Exception("栈板不存在"); |
|
|
throw new Exception("栈板不存在"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 检查栈板是否正在被调用 |
|
|
|
|
|
String callingFlag = (String) palletInfo.get("calling_flag"); |
|
|
|
|
|
if ("Y".equals(callingFlag)) { |
|
|
|
|
|
throw new Exception("栈板正在被调用中,无法进行打托操作"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 获取栈板类型的位置信息 |
|
|
// 获取栈板类型的位置信息 |
|
|
String palletType = (String) palletInfo.get("pallet_type"); |
|
|
String palletType = (String) palletInfo.get("pallet_type"); |
|
|
List<String> positions = wcsIntegrationMapper.getPalletTypePositions(site, palletType); |
|
|
List<String> positions = wcsIntegrationMapper.getPalletTypePositions(site, palletType); |
|
|
@ -169,6 +186,12 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { |
|
|
throw new Exception("参数不能为空"); |
|
|
throw new Exception("参数不能为空"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 检查栈板是否正在被调用 |
|
|
|
|
|
String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId); |
|
|
|
|
|
if ("Y".equals(callingFlag)) { |
|
|
|
|
|
throw new Exception("栈板正在被调用中,无法进行打托操作"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 1. 验证标签 |
|
|
// 1. 验证标签 |
|
|
Map<String, Object> labelInfo = wcsIntegrationMapper.validateLabel(site, serialNo); |
|
|
Map<String, Object> labelInfo = wcsIntegrationMapper.validateLabel(site, serialNo); |
|
|
if (labelInfo == null) { |
|
|
if (labelInfo == null) { |
|
|
@ -250,6 +273,12 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { |
|
|
throw new Exception("参数不能为空"); |
|
|
throw new Exception("参数不能为空"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 检查栈板是否正在被调用 |
|
|
|
|
|
String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId); |
|
|
|
|
|
if ("Y".equals(callingFlag)) { |
|
|
|
|
|
throw new Exception("栈板正在被调用中,无法进行扫出操作"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 检查标签是否在本栈板中 |
|
|
// 检查标签是否在本栈板中 |
|
|
Map<String, Object> existingPalletInfo = wcsIntegrationMapper.findPalletByLabel(site, serialNo); |
|
|
Map<String, Object> existingPalletInfo = wcsIntegrationMapper.findPalletByLabel(site, serialNo); |
|
|
if (existingPalletInfo == null) { |
|
|
if (existingPalletInfo == null) { |
|
|
@ -325,6 +354,12 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { |
|
|
throw new Exception("参数不能为空"); |
|
|
throw new Exception("参数不能为空"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 检查栈板是否正在被调用 |
|
|
|
|
|
String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId); |
|
|
|
|
|
if ("Y".equals(callingFlag)) { |
|
|
|
|
|
throw new Exception("栈板正在被调用中,无法进行位置调整"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 验证标签是否在当前栈板中 |
|
|
// 验证标签是否在当前栈板中 |
|
|
Map<String, Object> currentDetail = wcsIntegrationMapper.findPalletByLabel(site, serialNo); |
|
|
Map<String, Object> currentDetail = wcsIntegrationMapper.findPalletByLabel(site, serialNo); |
|
|
if (currentDetail == null || !palletId.equals(currentDetail.get("palletId"))) { |
|
|
if (currentDetail == null || !palletId.equals(currentDetail.get("palletId"))) { |
|
|
|