|
|
|
@ -1342,6 +1342,39 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { |
|
|
|
.ifPresent(detail -> { |
|
|
|
throw new RuntimeException("标签{" + detail.getSerialNo() + "}已经被预留"); |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
//---异常区校验 是否存在被预留且在SOIssueNotifyOrderMaterialList_detail表里面找不到out_wcs_flag='N'的数据 说明数据上已经出货 必须要在异常位拿出来 - rqrq |
|
|
|
// 1. 筛选出已预留的标签 - rqrq |
|
|
|
List<PalletDetailData> reservedDetails = newDetail.stream() |
|
|
|
.filter(detail -> "Y".equals(detail.getReserveFlag())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
if (!reservedDetails.isEmpty()) { |
|
|
|
// 2. 收集已预留标签的serialNo - rqrq |
|
|
|
List<String> reservedSerialNos = reservedDetails.stream() |
|
|
|
.map(PalletDetailData::getSerialNo) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 3. 查询SOIssueNotifyOrderMaterialList_detail表中out_wcs_flag='N'的记录 - rqrq |
|
|
|
List<com.gaotao.modules.notify.entity.SOIssueNotifyOrderMaterialListDetail> notifyDetails = |
|
|
|
wcsIntegrationMapper.getSOIssueNotifyDetailsBySerialNos(site, reservedSerialNos); |
|
|
|
|
|
|
|
// 4. 获取查询结果中的serialNo集合 - rqrq |
|
|
|
Set<String> notifySerialNoSet = notifyDetails.stream() |
|
|
|
.map(com.gaotao.modules.notify.entity.SOIssueNotifyOrderMaterialListDetail::getSerialNo) |
|
|
|
.collect(Collectors.toSet()); |
|
|
|
|
|
|
|
// 5. 找出已预留但在表中找不到out_wcs_flag='N'的标签(说明已出货,需要拿出来)- rqrq |
|
|
|
List<String> needRemoveSerialNos = reservedSerialNos.stream() |
|
|
|
.filter(serialNo -> !notifySerialNoSet.contains(serialNo)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
// 6. 如果有需要拿出的标签,返回异常 - rqrq |
|
|
|
if (!needRemoveSerialNos.isEmpty()) { |
|
|
|
String serialNoStr = String.join(", ", needRemoveSerialNos); |
|
|
|
throw new RuntimeException("有" + needRemoveSerialNos.size() + "个标签需要被拿出,条码号为:" + serialNoStr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 生成入库任务编号 |
|
|
|
TransNoControl transData2 = transNoService.getTransNo(site, "WOT", 10); |
|
|
|
|