|
|
@@ -2178,7 +2178,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
if (!archivesListFXHX.isEmpty()) {
|
|
|
Archives archives = archivesListFXHX.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
|
|
|
if (archives != null) {
|
|
|
- if (ObjectUtils.isNotNull(archives.getBillNo())) {
|
|
|
+ if (ObjectUtils.isNotNull(archives.getBillNo()) && archives.getBillNo().length() >= fixedPrefix.length()) {
|
|
|
//截取提单号前缀,判断是否是OW(放)放箱号
|
|
|
String data = archives.getBillNo().substring(0, fixedPrefix.length());
|
|
|
if (fixedPrefix.equals(data)) {
|
|
|
@@ -3895,10 +3895,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
boxDynamicsRecordItemsService.updateBatchById(itemsListZD);
|
|
|
}
|
|
|
//正常出场
|
|
|
- List<BoxDynamicsRecordItems> itemsListCC = itemsList.stream().filter(e -> "BX".equals(e.getObjective())
|
|
|
+ List<BoxDynamicsRecordItems> itemsListC = itemsList.stream().filter(e -> "BX".equals(e.getObjective())
|
|
|
|| "WD".equals(e.getObjective()) || "Q".equals(e.getObjective()) || "QZ".equals(e.getObjective())
|
|
|
|| "XO".equals(e.getObjective())).collect(Collectors.toList());
|
|
|
- if (!itemsListCC.isEmpty()) {
|
|
|
+ if (!itemsListC.isEmpty()) {
|
|
|
//查询本次出场港口
|
|
|
BPorts ports = bPortsService.getById(boxDynamicsRecord.getPortId());
|
|
|
boolean intercept = false;
|
|
|
@@ -3916,6 +3916,34 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
failureHandling(type, boxDynamicsRecord, "请先维护放箱号固定前缀参数!");
|
|
|
return false;
|
|
|
}
|
|
|
+ List<BoxDynamicsRecordItems> itemsListCCOWF = new ArrayList<>();
|
|
|
+ List<BoxDynamicsRecordItems> itemsListCC = new ArrayList<>();
|
|
|
+ //区分正常出场还是OW放出场 只有提单号不为空并且符合前缀匹配的才是OW放出场箱号,其余都是正常出场
|
|
|
+ for (BoxDynamicsRecordItems item : itemsListC) {
|
|
|
+ if (ObjectUtils.isNull(item.getHblno())) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "箱号为:" + item.getBoxCode() + "的提单号不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (item.getHblno().length() >= fixedPrefix.length()) {
|
|
|
+ //截取提单号前缀,判断是否是OW(放)放箱号
|
|
|
+ String data = item.getHblno().substring(0, fixedPrefix.length());
|
|
|
+ if (fixedPrefix.equals(data)) {
|
|
|
+ itemsListCCOWF.add(item);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ itemsListCC.add(item);
|
|
|
+ }
|
|
|
+ //OW放-出场
|
|
|
+ if (!itemsListCCOWF.isEmpty()) {
|
|
|
+ Boolean status = this.synchronizationFXCC(itemsListCCOWF, boxDynamicsRecord, type);
|
|
|
+ if (!status) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (itemsListCC.isEmpty()) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
//本次出场箱号
|
|
|
List<String> boxCodeList = itemsListCC.stream().map(BoxDynamicsRecordItems::getBoxCode).filter(Objects::nonNull)
|
|
|
.distinct().collect(Collectors.toList());
|
|
|
@@ -3942,10 +3970,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
List<SeaContainerNumberItem> containerNumberItemListNew = new ArrayList<>();
|
|
|
//海运单据配箱修改后
|
|
|
List<Containers> containersListNew = new ArrayList<>();
|
|
|
- if (hblno.isEmpty()) {
|
|
|
- failureHandling(type, boxDynamicsRecord, "提单号不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
//海运单据
|
|
|
List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
.eq(Bills::getTenantId, boxDynamicsRecord.getTenantId())
|
|
|
@@ -4009,10 +4033,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
}
|
|
|
//放箱号箱明细修改后
|
|
|
List<PutBoxItems> putBoxItems = new ArrayList<>();
|
|
|
- //OW(放)放箱号箱明细
|
|
|
- List<PutBoxItems> putBoxItemsOwf = new ArrayList<>();
|
|
|
- //OW(放)放箱号
|
|
|
- List<PutBox> putBoxesOwf = new ArrayList<>();
|
|
|
//放箱号对应来源箱管单据明细修改后
|
|
|
List<TradingBoxItem> tradingBoxItems = new ArrayList<>();
|
|
|
//箱档案修改后
|
|
|
@@ -4023,10 +4043,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
List<TradingBox> tradingBoxes = new ArrayList<>();
|
|
|
//出场箱处理
|
|
|
for (BoxDynamicsRecordItems item : itemsListCC) {
|
|
|
- if (ObjectUtils.isNull(item.getHblno())) {
|
|
|
- failureHandling(type, boxDynamicsRecord, "箱号为:" + item.getBoxCode() + "的提单号不能为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
if (ObjectUtils.isNull(item.getApproachExitDate())) {
|
|
|
item.setApproachExitDate(new Date());
|
|
|
}
|
|
|
@@ -4054,40 +4070,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
failureHandling(type, boxDynamicsRecord, "箱号:" + item.getBoxCode() + "状态为使用中");
|
|
|
return false;
|
|
|
}
|
|
|
- //截取提单号前缀,判断是否是OW(放)放箱号
|
|
|
- String data = item.getHblno().substring(0, fixedPrefix.length());
|
|
|
- boolean whetherFX = false;
|
|
|
- if (fixedPrefix.equals(data)) {
|
|
|
- whetherFX = true;
|
|
|
- PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())
|
|
|
- && ObjectUtils.isNotNull(e.getPolId()) && item.getHblno().equals(e.getSrcContainerNumber())).findFirst().orElse(null);
|
|
|
- if (putBox != null) {
|
|
|
- if (!putBoxesOwf.isEmpty()) {
|
|
|
- if (!putBoxesOwf.stream().map(PutBox::getId).collect(Collectors.toList()).contains(putBox.getId())) {
|
|
|
- putBoxesOwf.add(putBox);
|
|
|
- }
|
|
|
- } else {
|
|
|
- putBoxesOwf.add(putBox);
|
|
|
- }
|
|
|
- if (!putBoxItemsList.isEmpty()) {
|
|
|
- PutBoxItems putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()) &&
|
|
|
- e.getPid().equals(putBox.getId())).findFirst().orElse(null);
|
|
|
- if (putBoxItem == null) {
|
|
|
- putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, item, putBox, false, null, "空箱出场", "使用中", "8", false);
|
|
|
- putBoxItemsOwf.add(putBoxItem);
|
|
|
- } else {
|
|
|
- failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "中箱号:" + item.getBoxCode() + "已存在");
|
|
|
- return false;
|
|
|
- }
|
|
|
- } else {
|
|
|
- failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "中箱号:" + item.getBoxCode() + "已存在");
|
|
|
- return false;
|
|
|
- }
|
|
|
- } else {
|
|
|
- failureHandling(type, boxDynamicsRecord, "未查到OW(放)放箱号:" + item.getHblno() + "单据");
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
//获取对应放箱号数据
|
|
|
PutBox putBoxData;
|
|
|
//1.非正常出场 提单号为放箱号
|
|
|
@@ -4124,7 +4106,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
}
|
|
|
//海运单据
|
|
|
Bills bills;
|
|
|
- if (!billsList.isEmpty() && !whetherFX) {
|
|
|
+ if (!billsList.isEmpty()) {
|
|
|
//只查分单加直单
|
|
|
bills = billsList.stream().filter(e -> "MH,DD".contains(e.getBillType())
|
|
|
&& ObjectUtils.isNotNull(item.getHblno()) && item.getHblno().equals(e.getHblno())).findFirst().orElse(null);
|
|
|
@@ -4175,14 +4157,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
}
|
|
|
} else {
|
|
|
bills = null;
|
|
|
- if (!whetherFX) {
|
|
|
- //判断出场港口是否国内或越南港口,是提单号必须存在 否需提示但箱正常出场
|
|
|
- if (intercept) {
|
|
|
- failureHandling(type, boxDynamicsRecord, "未查到提单号:" + item.getHblno() + "对应海运出口单据");
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- failureHandling("3", boxDynamicsRecord, "未查到提单号:" + item.getHblno() + "对应海运出口单据");
|
|
|
- }
|
|
|
+ //判断出场港口是否国内或越南港口,是提单号必须存在 否需提示但箱正常出场
|
|
|
+ if (intercept) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "未查到提单号:" + item.getHblno() + "对应海运出口单据");
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ failureHandling("3", boxDynamicsRecord, "未查到提单号:" + item.getHblno() + "对应海运出口单据");
|
|
|
}
|
|
|
}
|
|
|
//放箱号明细数据处理
|
|
|
@@ -4191,7 +4171,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()) &&
|
|
|
e.getPid().equals(putBoxData.getId())).findFirst().orElse(null);
|
|
|
if (putBoxItem != null) {
|
|
|
- putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, item, putBoxData, whetherExistence, bills, "空箱出场", "使用中", "3", whetherFX);
|
|
|
+ putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, item, putBoxData, whetherExistence, bills, "空箱出场", "使用中", "3", false);
|
|
|
putBoxItems.add(putBoxItem);
|
|
|
} else {
|
|
|
failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "未查到箱号:" + item.getBoxCode() + "进场记录");
|
|
|
@@ -4604,29 +4584,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
if (!archivesArrayList.isEmpty()) {
|
|
|
archivesService.saveOrUpdateBatch(archivesArrayList);
|
|
|
}
|
|
|
- if (!putBoxItemsOwf.isEmpty()) {
|
|
|
- putBoxItemsService.saveOrUpdateBatch(putBoxItemsOwf);
|
|
|
- if (!putBoxesOwf.isEmpty()) {
|
|
|
- for (PutBox item : putBoxesOwf) {
|
|
|
- //主表增加本次出场箱号数据
|
|
|
- if (ObjectUtils.isNotNull(item.getCode())) {
|
|
|
- //获取对应放箱号本次出场箱号
|
|
|
- List<String> codeList = putBoxItemsOwf.stream().filter(e -> e.getPid().equals(item.getId()))
|
|
|
- .map(PutBoxItems::getBoxCode).collect(Collectors.toList());
|
|
|
- for (String e : codeList) {
|
|
|
- if (!item.getCode().contains(e)) {
|
|
|
- item.setCode(item.getCode() + "," + e);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- item.setCode(itemsListCC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
|
|
|
- .map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.joining(",")));
|
|
|
- }
|
|
|
- item.setVersion(ObjectUtils.isNull(item.getVersion()) ? 1 : item.getVersion() + 1);
|
|
|
- }
|
|
|
- putBoxService.updateBatchById(putBoxesOwf);
|
|
|
- }
|
|
|
- }
|
|
|
if (!tradingBoxItems.isEmpty()) {
|
|
|
tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
|
|
|
}
|
|
|
@@ -4669,6 +4626,426 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ private Boolean synchronizationFXCC(List<BoxDynamicsRecordItems> itemsListCC, BoxDynamicsRecord boxDynamicsRecord, String type) throws IOException {
|
|
|
+ //本次出场箱号
|
|
|
+ List<String> boxCodeList = itemsListCC.stream().map(BoxDynamicsRecordItems::getBoxCode).filter(Objects::nonNull)
|
|
|
+ .distinct().collect(Collectors.toList());
|
|
|
+ //箱档案数据
|
|
|
+ List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
|
|
|
+ .eq(Archives::getTenantId, boxDynamicsRecord.getTenantId())
|
|
|
+ .eq(Archives::getIsDeleted, 0)
|
|
|
+ .in(Archives::getCode, boxCodeList));
|
|
|
+ //本次出场放箱号
|
|
|
+ List<String> containerNumberList = itemsListCC.stream().map(BoxDynamicsRecordItems::getContainerNumber)
|
|
|
+ .distinct().collect(Collectors.toList());
|
|
|
+ //放箱号
|
|
|
+ List<PutBox> putBoxList = putBoxService.list(new LambdaQueryWrapper<PutBox>()
|
|
|
+ .eq(PutBox::getTenantId, boxDynamicsRecord.getTenantId())
|
|
|
+ .eq(PutBox::getIsDeleted, 0)
|
|
|
+ .and(i -> i.in(PutBox::getContainerNumber, containerNumberList).or()
|
|
|
+ .in(PutBox::getSrcContainerNumber, containerNumberList)));
|
|
|
+ if (putBoxList.isEmpty()) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "未查到放箱号单据");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ List<Long> putBoxIdList = putBoxList.stream().map(PutBox::getId).collect(Collectors.toList());
|
|
|
+ //放箱号箱明细
|
|
|
+ List<PutBoxItems> putBoxItemsList = putBoxItemsService.list(new LambdaQueryWrapper<PutBoxItems>()
|
|
|
+ .eq(PutBoxItems::getIsDeleted, 0)
|
|
|
+ .eq(PutBoxItems::getTenantId, boxDynamicsRecord.getTenantId())
|
|
|
+ .in(PutBoxItems::getPid, putBoxIdList));
|
|
|
+ //验证黑名单
|
|
|
+ String blacklist = sysClient.getParamService("box.blacklist");
|
|
|
+ String text = BoxNumUtils.verifyBlacklist(blacklist, boxCodeList, boxDynamicsRecord.getTenantId());
|
|
|
+ if (ObjectUtils.isNotNull(text)) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "箱号:" + text + "为黑名单箱,请修改数据后再操作");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ List<Long> srcIdList = putBoxList.stream().map(PutBox::getSrcId).collect(Collectors.toList());
|
|
|
+ //放箱号对应来源箱管单据信息
|
|
|
+ List<TradingBox> tradingBoxList = new ArrayList<>();
|
|
|
+ List<SeaContainerNumberItem> containerNumberItemList = new ArrayList<>();
|
|
|
+ List<SeaContainerNumberItem> containerNumberItems = new ArrayList<>();
|
|
|
+ if (!srcIdList.isEmpty()) {
|
|
|
+ tradingBoxList = tradingBoxMapper.selectList(new LambdaQueryWrapper<TradingBox>()
|
|
|
+ .eq(TradingBox::getTenantId, boxDynamicsRecord.getTenantId())
|
|
|
+ .eq(TradingBox::getIsDeleted, 0)
|
|
|
+ .in(TradingBox::getId, srcIdList));
|
|
|
+ containerNumberItemList = seaContainerNumberItemService.list(new LambdaQueryWrapper<SeaContainerNumberItem>()
|
|
|
+ .eq(SeaContainerNumberItem::getTenantId, boxDynamicsRecord.getTenantId())
|
|
|
+ .eq(SeaContainerNumberItem::getIsDeleted, 0)
|
|
|
+ .in(SeaContainerNumberItem::getPid, srcIdList));
|
|
|
+ }
|
|
|
+ //放箱号对应来源箱管单据明细信息
|
|
|
+ List<TradingBoxItem> tradingBoxItemList = new ArrayList<>();
|
|
|
+ if (!tradingBoxList.isEmpty()) {
|
|
|
+ List<Long> tradingBoxIdList = tradingBoxList.stream().map(TradingBox::getId).collect(Collectors.toList());
|
|
|
+ tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
|
|
|
+ .eq(TradingBoxItem::getIsDeleted, 0)
|
|
|
+ .eq(TradingBoxItem::getTenantId, boxDynamicsRecord.getTenantId())
|
|
|
+ .in(TradingBoxItem::getPid, tradingBoxIdList));
|
|
|
+ }
|
|
|
+ //放箱号箱明细修改后
|
|
|
+ List<PutBoxItems> putBoxItems = new ArrayList<>();
|
|
|
+ //OW(放)放箱号箱明细
|
|
|
+ List<PutBoxItems> putBoxItemsOwf = new ArrayList<>();
|
|
|
+ //OW(放)放箱号
|
|
|
+ List<PutBox> putBoxesOwf = new ArrayList<>();
|
|
|
+ //放箱号对应来源箱管单据明细修改后
|
|
|
+ List<TradingBoxItem> tradingBoxItems = new ArrayList<>();
|
|
|
+ //箱档案修改后
|
|
|
+ List<Archives> archivesArrayList = new ArrayList<>();
|
|
|
+ //放箱号修改后
|
|
|
+ List<PutBox> putBoxes = new ArrayList<>();
|
|
|
+ //放箱号对应来源箱管单据修改后
|
|
|
+ List<TradingBox> tradingBoxes = new ArrayList<>();
|
|
|
+ //出场箱处理
|
|
|
+ for (BoxDynamicsRecordItems item : itemsListCC) {
|
|
|
+ if (ObjectUtils.isNull(item.getApproachExitDate())) {
|
|
|
+ item.setApproachExitDate(new Date());
|
|
|
+ }
|
|
|
+ //随机字符串数据 用来关联箱明细与出场记录,出场记录存储对应箱信息id,撤销出场时通过id还原数据
|
|
|
+ item.setTemporaryId(StringTools.generateRandomString(32));
|
|
|
+ //箱档案数据处理
|
|
|
+ Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
|
|
|
+ //出场时箱号对应箱档案不能为空
|
|
|
+ if (archives == null) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "箱档案中未查到箱号:" + item.getBoxCode());
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //本次出场放箱号与箱档案需一致
|
|
|
+ if (!archives.getContainerNumber().equals(item.getContainerNumber())) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "箱号:" + archives.getCode() + "在箱档案中放箱号与本次出场放箱号不符");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //本次出场箱号箱型与箱档案需一致
|
|
|
+ if (!archives.getTypeName().equals(item.getBoxType())) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "箱号:" + item.getBoxCode() + "与箱档案中箱型不符");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //出场时箱状态不能为使用中
|
|
|
+ if ("使用中".equals(archives.getStatus())) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "箱号:" + item.getBoxCode() + "状态为使用中");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //OW放-放箱号数据处理
|
|
|
+ PutBox putBox = putBoxList.stream().filter(e -> e.getSrcContainerNumber().equals(item.getHblno())
|
|
|
+ && ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(item.getPortId())
|
|
|
+ && ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(item.getStationId())).findFirst().orElse(null);
|
|
|
+ if (putBox != null) {
|
|
|
+ if (!putBoxesOwf.isEmpty()) {
|
|
|
+ if (!putBoxes.stream().map(PutBox::getId).collect(Collectors.toList()).contains(putBox.getId())) {
|
|
|
+ putBoxesOwf.add(putBox);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ putBoxesOwf.add(putBox);
|
|
|
+ }
|
|
|
+ if (!putBoxItemsList.isEmpty()) {
|
|
|
+ PutBoxItems putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()) &&
|
|
|
+ e.getPid().equals(putBox.getId())).findFirst().orElse(null);
|
|
|
+ if (putBoxItem == null) {
|
|
|
+ putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, item, putBox, false, null, "空箱出场", "使用中", "8", false);
|
|
|
+ putBoxItemsOwf.add(putBoxItem);
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "中箱号:" + item.getBoxCode() + "已存在");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "中箱号:" + item.getBoxCode() + "已存在");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //OW(放)数据处理
|
|
|
+ if (!tradingBoxList.isEmpty()) {
|
|
|
+ //获取放箱号来源OW(放)单据
|
|
|
+ TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBox.getSrcId()))
|
|
|
+ .findFirst().orElse(null);
|
|
|
+ if (tradingBox != null) {
|
|
|
+ item.setSrcTradingBoxId(tradingBox.getId());
|
|
|
+ //OW(放)单据修改单据
|
|
|
+ if (!tradingBoxes.isEmpty()) {
|
|
|
+ if (!tradingBoxes.stream().map(TradingBox::getId).collect(Collectors.toList()).contains(tradingBox.getId())) {
|
|
|
+ tradingBoxes.add(tradingBox);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ tradingBoxes.add(tradingBox);
|
|
|
+ }
|
|
|
+ //OW(放)单据明细箱号数据
|
|
|
+ TradingBoxItem tradingBoxItem;
|
|
|
+ if (!tradingBoxItemList.isEmpty()) {
|
|
|
+ tradingBoxItem = tradingBoxItemList.stream().filter(e -> e.getCode().equals(item.getBoxCode()))
|
|
|
+ .findFirst().orElse(null);
|
|
|
+ if (tradingBoxItem != null) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "OW(放)放箱号:" + item.getContainerNumber() + "中箱号:" + item.getBoxCode() + "已存在");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tradingBoxItem = EntryExitDataHandleUtils.tradingBoxItemDataHandle(null, item, tradingBox, false
|
|
|
+ , null, "空箱出场", "使用中", "8");
|
|
|
+ tradingBoxItems.add(tradingBoxItem);
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "未查到OW单据");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "未查到OW单据");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "未查到OW放-放箱号:" + item.getHblno() + "单据");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //获取对应放箱号数据
|
|
|
+ PutBox putBoxData = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())
|
|
|
+ && ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(item.getPortId())
|
|
|
+ && ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(item.getStationId())).findFirst().orElse(null);
|
|
|
+ if (putBoxData != null) {
|
|
|
+ item.setSrcPutBoxId(putBoxData.getId());
|
|
|
+ //放箱号修改后数组存储
|
|
|
+ if (!putBoxes.isEmpty()) {
|
|
|
+ if (!putBoxes.stream().map(PutBox::getId).collect(Collectors.toList()).contains(putBoxData.getId())) {
|
|
|
+ putBoxes.add(putBoxData);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ putBoxes.add(putBoxData);
|
|
|
+ }
|
|
|
+ //放箱号箱型与本次出场箱型需一致
|
|
|
+ if (ObjectUtils.isNotNull(putBoxData.getBoxType()) && !putBoxData.getBoxType().equals(item.getBoxType())) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "箱型不符合");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //放箱号明细数据处理
|
|
|
+ PutBoxItems putBoxItem;
|
|
|
+ if (!putBoxItemsList.isEmpty()) {
|
|
|
+ putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()) &&
|
|
|
+ e.getPid().equals(putBoxData.getId())).findFirst().orElse(null);
|
|
|
+ if (putBoxItem != null) {
|
|
|
+ putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, item, putBoxData, false, null, "空箱出场", "使用中", "3", true);
|
|
|
+ putBoxItems.add(putBoxItem);
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "未查到箱号:" + item.getBoxCode() + "进场记录");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "未查到箱号:" + item.getBoxCode() + "进场记录");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //存储上一步数据
|
|
|
+ BoxNumUtils.storagePreviousStepData(archives, item);
|
|
|
+ //箱档案数据处理
|
|
|
+ archives = ArchivesUtils.dataAssembly(archives, item, "空箱出场", "使用中", putBoxData.getBoxClass());
|
|
|
+ archivesArrayList.add(archives);
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "未查到放箱号:" + item.getContainerNumber() + "单据");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //放箱号单据
|
|
|
+ if (!putBoxes.isEmpty()) {
|
|
|
+ List<PutBox> putBoxList1 = new ArrayList<>();
|
|
|
+ //本次出场相关放箱号数据处理
|
|
|
+ for (PutBox item : putBoxes) {
|
|
|
+ //主表增加本次出场箱号数据
|
|
|
+ if (ObjectUtils.isNotNull(item.getCode())) {
|
|
|
+ //获取对应放箱号本次出场箱号
|
|
|
+ List<String> codeList = itemsListCC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
|
|
|
+ .map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.toList());
|
|
|
+ for (String e : codeList) {
|
|
|
+ if (!item.getCode().contains(e)) {
|
|
|
+ item.setCode(item.getCode() + "," + e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ item.setCode(itemsListCC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
|
|
|
+ .map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
+ //获取本次出场箱量
|
|
|
+ long count = 0;
|
|
|
+ if (!putBoxItems.isEmpty()) {
|
|
|
+ count = putBoxItems.stream().filter(e -> e.getPid().equals(item.getId())).count();
|
|
|
+ }
|
|
|
+ //放箱号合计箱量-本次出场数量
|
|
|
+ item.setTotalNum(item.getTotalNum() - Integer.parseInt(count + ""));
|
|
|
+ //放箱号盘存箱量-本次出场数量
|
|
|
+ item.setStorageNum(item.getStorageNum() - Integer.parseInt(count + ""));
|
|
|
+ //放箱号占用箱量-本次出场数量
|
|
|
+ item.setOccupyNum(item.getOccupyNum() - Integer.parseInt(count + ""));
|
|
|
+ if (item.getStorageNum() < 0) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "剩余场地盘存小于本次导入箱数");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ item.setVersion(ObjectUtils.isNull(item.getVersion()) ? 1 : item.getVersion() + 1);
|
|
|
+ putBoxList1.add(item);
|
|
|
+ }
|
|
|
+ putBoxService.saveOrUpdateBatch(putBoxList1);
|
|
|
+ }
|
|
|
+ if (!putBoxItems.isEmpty()) {
|
|
|
+ putBoxItemsService.saveOrUpdateBatch(putBoxItems);
|
|
|
+ //记录对应箱号出场箱轨迹
|
|
|
+ for (PutBoxItems item : putBoxItems) {
|
|
|
+ PutBox tradingBox = putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
|
|
|
+ if (tradingBox != null) {
|
|
|
+ //记录箱轨迹信息
|
|
|
+ ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
|
|
|
+ archivesTrajectory.setPortId(tradingBox.getPolId());
|
|
|
+ archivesTrajectory.setPortCode(tradingBox.getPolCode());
|
|
|
+ archivesTrajectory.setPortCname(tradingBox.getPolCname());
|
|
|
+ archivesTrajectory.setPortEname(tradingBox.getPolEname());
|
|
|
+ archivesTrajectory.setStationId(tradingBox.getPolStationId());
|
|
|
+ archivesTrajectory.setStationCode(tradingBox.getPolStationCode());
|
|
|
+ archivesTrajectory.setStationCname(tradingBox.getPolStationCname());
|
|
|
+ archivesTrajectory.setStationEname(tradingBox.getPolStationEname());
|
|
|
+ archivesTrajectory.setContainerNumber(item.getContainerNumber());
|
|
|
+ archivesTrajectory.setBoxStatus(item.getBoxStatus());
|
|
|
+ archivesTrajectory.setBoxType(item.getBoxType());
|
|
|
+ archivesTrajectory.setBoxCategory(item.getBoxClass());
|
|
|
+ archivesTrajectory.setBoxEastId(item.getBoxEastId());
|
|
|
+ archivesTrajectory.setBoxEastName(item.getBoxEastName());
|
|
|
+ archivesTrajectory.setMblno(item.getMblno());
|
|
|
+ archivesTrajectory.setHblno(item.getHblno());
|
|
|
+ BoxDynamicsRecordItems dynamicsRecordItems = itemsListCC.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode())).findFirst().orElse(null);
|
|
|
+ if (dynamicsRecordItems != null) {
|
|
|
+ if ("QZ".equals(dynamicsRecordItems.getObjective())) {
|
|
|
+ archivesTrajectory.setBoxDynamics(BoxDynamicsEnums.getName(dynamicsRecordItems.getObjective() + "C"));
|
|
|
+ } else {
|
|
|
+ archivesTrajectory.setBoxDynamics(BoxDynamicsEnums.getName(dynamicsRecordItems.getObjective()));
|
|
|
+ archivesTrajectory.setNewDate(dynamicsRecordItems.getApproachExitDate());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(tradingBox.getPodId()) && !tradingBox.getPodId().contains(",")) {
|
|
|
+ archivesTrajectory.setPodId(Long.parseLong(tradingBox.getPodId()));
|
|
|
+ archivesTrajectory.setPodCode(tradingBox.getPodCode());
|
|
|
+ archivesTrajectory.setPodCname(tradingBox.getPodCname());
|
|
|
+ archivesTrajectory.setPodEname(tradingBox.getPodEname());
|
|
|
+ }
|
|
|
+ archivesTrajectory.setStatus(archivesTrajectory.getBoxDynamics());
|
|
|
+ archivesTrajectory.setCorpId(item.getBoxEastId());
|
|
|
+ archivesTrajectory.setCorpName(item.getBoxEastName());
|
|
|
+ archivesTrajectory.setBillType(tradingBox.getBoxType());
|
|
|
+ archivesTrajectory.setCode(item.getBoxCode());
|
|
|
+ archivesTrajectory.setCreateTime(new Date());
|
|
|
+ archivesTrajectory.setCreateUser(AuthUtil.getUserId());
|
|
|
+ archivesTrajectory.setCreateUserName(AuthUtil.getUserName());
|
|
|
+ archivesTrajectory.setTenantId(AuthUtil.getTenantId());
|
|
|
+ archivesTrajectory.setSrcId(tradingBox.getId());
|
|
|
+ archivesTrajectory.setEtd(item.getEtd());
|
|
|
+ archivesTrajectory.setPolCyId(item.getPolCyId());
|
|
|
+ archivesTrajectory.setPolCyCode(item.getPolCyCode());
|
|
|
+ archivesTrajectory.setPolCyCname(item.getPolCyCname());
|
|
|
+ archivesTrajectory.setPolCyEname(item.getPolCyEname());
|
|
|
+ archivesTrajectory.setPolFreeBoxUseDays(item.getPolFreeBoxUseDays());
|
|
|
+ archivesTrajectory.setPolPreAppearanceDate(item.getPolPreAppearanceDate());
|
|
|
+ archivesTrajectory.setPolStationEmptyContainerExitDate(item.getPolStationEmptyContainerExitDate());
|
|
|
+ archivesTrajectory.setPolReturnDate(item.getPolReturnDate());
|
|
|
+ archivesTrajectory.setPolOverdueBoxUseDays(item.getPolOverdueBoxUseDays());
|
|
|
+ archivesTrajectory.setEta(item.getEta());
|
|
|
+ archivesTrajectory.setPodEmptyContainerReturnDate(item.getPodEmptyContainerReturnDate());
|
|
|
+ archivesTrajectory.setPodStationId(item.getPodStationId());
|
|
|
+ archivesTrajectory.setPodStationCode(item.getPodStationCode());
|
|
|
+ archivesTrajectory.setPodStationCname(item.getPodStationCname());
|
|
|
+ archivesTrajectory.setPodStationEname(item.getPodStationEname());
|
|
|
+ archivesTrajectory.setPodFreeBoxUseDays(item.getPodFreeBoxUseDays());
|
|
|
+ archivesTrajectory.setPodBoxUseDays(item.getPodBoxUseDays());
|
|
|
+ archivesTrajectory.setShipNameId(item.getShipNameId());
|
|
|
+ archivesTrajectory.setShipCname(item.getShipCname());
|
|
|
+ archivesTrajectory.setShipEname(item.getShipEname());
|
|
|
+ archivesTrajectory.setShipCode(item.getShipCode());
|
|
|
+ archivesTrajectory.setVoyage(item.getVoyage());
|
|
|
+ archivesTrajectory.setTenantId(boxDynamicsRecord.getTenantId());
|
|
|
+ archivesTrajectoryMapper.insert(archivesTrajectory);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!archivesArrayList.isEmpty()) {
|
|
|
+ archivesService.saveOrUpdateBatch(archivesArrayList);
|
|
|
+ }
|
|
|
+ //OW放-放箱号单据
|
|
|
+ if (!putBoxItemsOwf.isEmpty()) {
|
|
|
+ putBoxItemsService.saveOrUpdateBatch(putBoxItemsOwf);
|
|
|
+ if (!putBoxesOwf.isEmpty()) {
|
|
|
+ for (PutBox item : putBoxesOwf) {
|
|
|
+ //主表增加本次出场箱号数据
|
|
|
+ if (ObjectUtils.isNotNull(item.getCode())) {
|
|
|
+ //获取对应放箱号本次出场箱号
|
|
|
+ List<String> codeList = putBoxItemsOwf.stream().filter(e -> e.getPid().equals(item.getId()))
|
|
|
+ .map(PutBoxItems::getBoxCode).collect(Collectors.toList());
|
|
|
+ for (String e : codeList) {
|
|
|
+ if (!item.getCode().contains(e)) {
|
|
|
+ item.setCode(item.getCode() + "," + e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ item.setCode(itemsListCC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
|
|
|
+ .map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
+ item.setVersion(ObjectUtils.isNull(item.getVersion()) ? 1 : item.getVersion() + 1);
|
|
|
+ }
|
|
|
+ putBoxService.updateBatchById(putBoxesOwf);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //OW放单据
|
|
|
+ if (!tradingBoxItems.isEmpty()) {
|
|
|
+ tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
|
|
|
+ if (!tradingBoxes.isEmpty()) {
|
|
|
+ for (TradingBox item : tradingBoxes) {
|
|
|
+ List<TradingBoxItem> itemList = tradingBoxItems.stream().filter(e -> e.getPid().equals(item.getId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (!itemList.isEmpty()) {
|
|
|
+ if (ObjectUtils.isNotNull(item.getCode())) {
|
|
|
+ List<String> codeList = itemList.stream().map(TradingBoxItem::getCode).collect(Collectors.toList());
|
|
|
+ for (String e : codeList) {
|
|
|
+ if (!item.getCode().contains(e)) {
|
|
|
+ item.setCode(item.getCode() + "," + e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ item.setCode(itemList.stream().map(TradingBoxItem::getCode).collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
+ item.setSuitcaseNum(item.getSuitcaseNum() + itemList.size());
|
|
|
+ item.setNotSuitcaseNum(item.getBoxNumber() - item.getSuitcaseNum() - item.getCancelNumber());
|
|
|
+ if (item.getNotSuitcaseNum() < 0) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "剩余未提箱小于本次导入箱数");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!containerNumberItemList.isEmpty()) {
|
|
|
+ SeaContainerNumberItem containerNumberItem = containerNumberItemList.stream().filter(e -> e.getPid().equals(item.getId()))
|
|
|
+ .findFirst().orElse(null);
|
|
|
+ if (containerNumberItem != null) {
|
|
|
+ containerNumberItem.setOutNum(containerNumberItem.getOutNum() + itemList.size());
|
|
|
+ if (Objects.equals(containerNumberItem.getOccupyNum(), containerNumberItem.getOutNum())) {
|
|
|
+ containerNumberItem.setWhetherAppearStatus("1");
|
|
|
+ }
|
|
|
+ containerNumberItem.setUpdateTime(new Date());
|
|
|
+ containerNumberItem.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ containerNumberItem.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ containerNumberItems.add(containerNumberItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ item.setVersion(ObjectUtils.isNull(item.getVersion()) ? "1" : (Integer.parseInt(item.getVersion()) + 1) + "");
|
|
|
+ tradingBoxMapper.updateById(item);
|
|
|
+ }
|
|
|
+ if (!containerNumberItems.isEmpty()) {
|
|
|
+ seaContainerNumberItemService.updateBatchById(containerNumberItems);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //修改同步记录状态并保存对应箱号信息id
|
|
|
+ for (BoxDynamicsRecordItems item : itemsListCC) {
|
|
|
+ item.setWhetherSynchronous("1");
|
|
|
+ if (!putBoxItems.isEmpty()) {
|
|
|
+ putBoxItems.stream().filter(e -> item.getTemporaryId().equals(e.getTemporaryId())).findFirst().ifPresent(putBox -> item.setSrcPutBoxItemsId(putBox.getId()));
|
|
|
+ }
|
|
|
+ if (!tradingBoxItems.isEmpty()) {
|
|
|
+ tradingBoxItems.stream().filter(e -> item.getTemporaryId().equals(e.getTemporaryId())).findFirst().ifPresent(putBox -> item.setSrcTradingBoxItemsId(putBox.getId()));
|
|
|
+ }
|
|
|
+ if (!archivesArrayList.isEmpty()) {
|
|
|
+ archivesArrayList.stream().filter(e -> item.getTemporaryId().equals(e.getTemporaryId())).findFirst().ifPresent(putBox -> item.setSrcArchivesId(putBox.getId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ boxDynamicsRecordItemsService.updateBatchById(itemsListCC);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
private Boolean synchronizationFXHX(List<BoxDynamicsRecordItems> itemsListFXHX, BoxDynamicsRecord boxDynamicsRecord, String type) throws IOException {
|
|
|
List<String> boxNum = itemsListFXHX.stream().map(BoxDynamicsRecordItems::getBoxCode).filter(Objects::nonNull)
|
|
|
.collect(Collectors.toList());
|
|
|
@@ -4693,7 +5070,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
.eq(PutBox::getTenantId, boxDynamicsRecord.getTenantId())
|
|
|
.eq(PutBox::getIsDeleted, 0)
|
|
|
.and(i -> i.in(PutBox::getContainerNumber, containerNumberList).or()
|
|
|
- .in(PutBox::getContainerNumber, billNoList)));
|
|
|
+ .in(PutBox::getSrcContainerNumber, billNoList)));
|
|
|
if (putBoxList.isEmpty()) {
|
|
|
failureHandling(type, boxDynamicsRecord, "未查到放箱号单据");
|
|
|
return false;
|
|
|
@@ -4750,7 +5127,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
|
|
|
//原OW放-放箱号数据处理
|
|
|
Archives finalArchives = archives;
|
|
|
- PutBox putBoxOldFX = putBoxList.stream().filter(e -> e.getContainerNumber().equals(finalArchives.getBillNo()))
|
|
|
+ PutBox putBoxOldFX = putBoxList.stream().filter(e -> e.getSrcContainerNumber().equals(finalArchives.getBillNo()))
|
|
|
.findFirst().orElse(null);
|
|
|
if (putBoxOldFX != null) {
|
|
|
PutBoxItems putBoxItem;
|
|
|
@@ -4766,7 +5143,13 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
return false;
|
|
|
}
|
|
|
putBoxItemsOldFXList.add(putBoxItem);
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "原OW放-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
|
|
|
+ return false;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "原OW放-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
|
|
|
+ return false;
|
|
|
}
|
|
|
if (!tradingBoxList.isEmpty()) {
|
|
|
TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBoxOldFX.getSrcId()))
|
|
|
@@ -4788,9 +5171,21 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
tradingBoxItem = EntryExitDataHandleUtils.tradingBoxItemDataHandle(tradingBoxItem, recordItems, tradingBox,
|
|
|
false, null, "已返场", "已还箱", "5");
|
|
|
tradingBoxItemOldList.add(tradingBoxItem);
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "原OW放单据-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
|
|
|
+ return false;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "原OW放单据-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
|
|
|
+ return false;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "原OW放单据-放箱号:" + recordItems.getContainerNumber() + "未查到");
|
|
|
+ return false;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "原OW放单据-放箱号:" + recordItems.getContainerNumber() + "未查到");
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
//原自有箱放箱号数据处理
|
|
|
@@ -4819,7 +5214,13 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
return false;
|
|
|
}
|
|
|
putBoxItemsOldList.add(putBoxItem);
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "原自有箱-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
|
|
|
+ return false;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "原自有箱-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
//箱档案数据处理
|
|
|
@@ -4835,16 +5236,13 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
if (!putBoxItemsList.isEmpty()) {
|
|
|
putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(recordItems.getBoxCode())
|
|
|
&& putBox.getId().equals(e.getPid())).findFirst().orElse(null);
|
|
|
- if (putBoxItem != null) {
|
|
|
- putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, recordItems, putBox,
|
|
|
- false, null, "空箱提箱进场", "待使用", "5", false);
|
|
|
- putBoxItemsNewList.add(putBoxItem);
|
|
|
- }
|
|
|
+ putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, recordItems, putBox,
|
|
|
+ false, null, "空箱提箱进场", "待使用", "9", false);
|
|
|
} else {
|
|
|
putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(null, recordItems, putBox,
|
|
|
- false, null, "空箱提箱进场", "待使用", "5", false);
|
|
|
- putBoxItemsNewList.add(putBoxItem);
|
|
|
+ false, null, "空箱提箱进场", "待使用", "9", false);
|
|
|
}
|
|
|
+ putBoxItemsNewList.add(putBoxItem);
|
|
|
recordItems.setSrcPutBoxPodId(putBox.getId());
|
|
|
if (putBoxNewList.isEmpty()) {
|
|
|
putBoxNewList.add(putBox);
|