|
|
@@ -1438,61 +1438,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
} else {
|
|
|
putBoxes.add(putBox);
|
|
|
}
|
|
|
- //箱档案数据处理
|
|
|
- Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
|
|
|
- if (archives != null) {
|
|
|
- archives.setContainerNumberOw(item.getContainerNumber());
|
|
|
- archives.setContainerNumberTypeOw(putBox.getBusType());
|
|
|
- if (!archives.getTypeName().equals(item.getBoxType())) {
|
|
|
- throw new RuntimeException("箱号:" + item.getBoxCode() + "与箱档案中箱型不符");
|
|
|
- }
|
|
|
- archives.setBoxStatus(item.getBoxStatus());
|
|
|
- archives.setUpdateTime(new Date());
|
|
|
- archives.setUpdateUser(AuthUtil.getUserId());
|
|
|
- archives.setUpdateUserName(AuthUtil.getUserName());
|
|
|
- archives.setStatus("待使用");
|
|
|
- archives.setNewDate(item.getApproachExitDate());
|
|
|
- archives.setBoxDynamics("调箱进场");
|
|
|
- archives.setWhetherTransfer("1");
|
|
|
- archives.setAddressId(item.getPortId());
|
|
|
- archives.setAddressCode(item.getPortCode());
|
|
|
- archives.setAddressCname(item.getPortCname());
|
|
|
- archives.setAddressEname(item.getPortEname());
|
|
|
- archives.setStationId(item.getStationId());
|
|
|
- archives.setStationCode(item.getStationCode());
|
|
|
- archives.setStationCname(item.getStationCname());
|
|
|
- archives.setStationEname(item.getStationEname());
|
|
|
- } else {
|
|
|
- if (!"OW(拿)".equals(putBox.getBusType())) {
|
|
|
- throw new RuntimeException("箱档案中未查到箱号:" + item.getBoxCode());
|
|
|
- }
|
|
|
- archives = new Archives();
|
|
|
- archives.setCode(item.getBoxCode());
|
|
|
- archives.setCreateTime(new Date());
|
|
|
- archives.setCreateUser(AuthUtil.getUserId());
|
|
|
- archives.setCreateUserName(AuthUtil.getUserName());
|
|
|
- archives.setStatus("待使用");
|
|
|
- archives.setBoxStatus(item.getBoxStatus());
|
|
|
- archives.setNewDate(item.getApproachExitDate());
|
|
|
- archives.setBoxDynamics("调箱进场");
|
|
|
- archives.setWhetherTransfer("1");
|
|
|
- archives.setBoxBelongsTo("SOC");
|
|
|
- archives.setContainerNumber(item.getContainerNumber());
|
|
|
- archives.setContainerNumberType(putBox.getBusType());
|
|
|
- archives.setContainerNumberOw(item.getContainerNumber());
|
|
|
- archives.setContainerNumberTypeOw(putBox.getBusType());
|
|
|
- archives.setTypeName(item.getBoxType());
|
|
|
- archives.setBoxType(putBox.getBusType());
|
|
|
- archives.setAddressId(item.getPortId());
|
|
|
- archives.setAddressCode(item.getPortCode());
|
|
|
- archives.setAddressCname(item.getPortCname());
|
|
|
- archives.setAddressEname(item.getPortEname());
|
|
|
- archives.setStationId(item.getStationId());
|
|
|
- archives.setStationCode(item.getStationCode());
|
|
|
- archives.setStationCname(item.getStationCname());
|
|
|
- archives.setStationEname(item.getStationEname());
|
|
|
- }
|
|
|
- archivesArrayList.add(archives);
|
|
|
if (ObjectUtils.isNotNull(putBox.getBoxType()) && !putBox.getBoxType().equals(item.getBoxType())) {
|
|
|
throw new RuntimeException("放箱号:" + item.getContainerNumber() + "箱型不符合");
|
|
|
}
|
|
|
@@ -1558,10 +1503,14 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
putBoxItem.setBoxEastName(putBox.getBoxEastName());
|
|
|
}
|
|
|
putBoxItems.add(putBoxItem);
|
|
|
+ boolean samePort = true;
|
|
|
if (!tradingBoxList.isEmpty()) {
|
|
|
TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBox.getSrcId()))
|
|
|
.findFirst().orElse(null);
|
|
|
if (tradingBox != null) {
|
|
|
+ if (tradingBox.getPolId().equals(tradingBox.getPodId())){
|
|
|
+ samePort = false;
|
|
|
+ }
|
|
|
if (!tradingBoxes.isEmpty()) {
|
|
|
if (!tradingBoxes.stream().map(TradingBox::getId).collect(Collectors.toList()).contains(tradingBox.getId())) {
|
|
|
tradingBoxes.add(tradingBox);
|
|
|
@@ -1606,7 +1555,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
} else if ("OW-F".equals(tradingBox.getType())) {
|
|
|
tradingBoxItem.setBoxCategory("OW(放)");
|
|
|
}
|
|
|
-// putBoxItem.setBoxClass(putBox.getBusType());
|
|
|
+ tradingBoxItem.setBoxSource(putBox.getBusType());
|
|
|
tradingBoxItem.setBoxCondition("新");
|
|
|
tradingBoxItem.setBoxStatus(item.getBoxStatus());
|
|
|
tradingBoxItem.setPid(tradingBox.getId());
|
|
|
@@ -1645,6 +1594,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
} else if ("OW-F".equals(tradingBox.getType())) {
|
|
|
tradingBoxItem.setBoxCategory("OW(放)");
|
|
|
}
|
|
|
+ tradingBoxItem.setBoxSource(putBox.getBusType());
|
|
|
tradingBoxItem.setBoxBelongsTo("SOC");
|
|
|
tradingBoxItem.setBoxCondition("新");
|
|
|
tradingBoxItem.setBoxStatus(item.getBoxStatus());
|
|
|
@@ -1681,11 +1631,70 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
tradingBoxItem.setBoxEastName(tradingBox.getPurchaseCompanyName());
|
|
|
tradingBoxItems.add(tradingBoxItem);
|
|
|
} else {
|
|
|
- throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到OW单据");
|
|
|
+ throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到调箱单据");
|
|
|
}
|
|
|
} else {
|
|
|
- throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到OW单据");
|
|
|
+ throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到调箱单据");
|
|
|
+ }
|
|
|
+ //箱档案数据处理
|
|
|
+ Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
|
|
|
+ if (archives != null) {
|
|
|
+ archives.setContainerNumberOw(item.getContainerNumber());
|
|
|
+ archives.setContainerNumberTypeOw(putBox.getBusType());
|
|
|
+ if (!archives.getTypeName().equals(item.getBoxType())) {
|
|
|
+ throw new RuntimeException("箱号:" + item.getBoxCode() + "与箱档案中箱型不符");
|
|
|
+ }
|
|
|
+ archives.setBoxStatus(item.getBoxStatus());
|
|
|
+ archives.setUpdateTime(new Date());
|
|
|
+ archives.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ archives.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ archives.setStatus("待使用");
|
|
|
+ archives.setNewDate(item.getApproachExitDate());
|
|
|
+ archives.setBoxDynamics("调箱进场");
|
|
|
+ if (samePort){
|
|
|
+ archives.setWhetherTransfer("1");
|
|
|
+ }
|
|
|
+ archives.setAddressId(item.getPortId());
|
|
|
+ archives.setAddressCode(item.getPortCode());
|
|
|
+ archives.setAddressCname(item.getPortCname());
|
|
|
+ archives.setAddressEname(item.getPortEname());
|
|
|
+ archives.setStationId(item.getStationId());
|
|
|
+ archives.setStationCode(item.getStationCode());
|
|
|
+ archives.setStationCname(item.getStationCname());
|
|
|
+ archives.setStationEname(item.getStationEname());
|
|
|
+ } else {
|
|
|
+ if (!"OW(拿)".equals(putBox.getBusType())) {
|
|
|
+ throw new RuntimeException("箱档案中未查到箱号:" + item.getBoxCode());
|
|
|
+ }
|
|
|
+ archives = new Archives();
|
|
|
+ archives.setCode(item.getBoxCode());
|
|
|
+ archives.setCreateTime(new Date());
|
|
|
+ archives.setCreateUser(AuthUtil.getUserId());
|
|
|
+ archives.setCreateUserName(AuthUtil.getUserName());
|
|
|
+ archives.setStatus("待使用");
|
|
|
+ archives.setBoxStatus(item.getBoxStatus());
|
|
|
+ archives.setNewDate(item.getApproachExitDate());
|
|
|
+ archives.setBoxDynamics("调箱进场");
|
|
|
+ if (samePort){
|
|
|
+ archives.setWhetherTransfer("1");
|
|
|
+ }
|
|
|
+ archives.setBoxBelongsTo("SOC");
|
|
|
+ archives.setContainerNumber(item.getContainerNumber());
|
|
|
+ archives.setContainerNumberType(putBox.getBusType());
|
|
|
+ archives.setContainerNumberOw(item.getContainerNumber());
|
|
|
+ archives.setContainerNumberTypeOw(putBox.getBusType());
|
|
|
+ archives.setTypeName(item.getBoxType());
|
|
|
+ archives.setBoxType(putBox.getBusType());
|
|
|
+ archives.setAddressId(item.getPortId());
|
|
|
+ archives.setAddressCode(item.getPortCode());
|
|
|
+ archives.setAddressCname(item.getPortCname());
|
|
|
+ archives.setAddressEname(item.getPortEname());
|
|
|
+ archives.setStationId(item.getStationId());
|
|
|
+ archives.setStationCode(item.getStationCode());
|
|
|
+ archives.setStationCname(item.getStationCname());
|
|
|
+ archives.setStationEname(item.getStationEname());
|
|
|
}
|
|
|
+ archivesArrayList.add(archives);
|
|
|
} else {
|
|
|
throw new RuntimeException("未查到放箱号:" + item.getContainerNumber() + "单据");
|
|
|
}
|
|
|
@@ -1725,7 +1734,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
if (!tradingBoxes.isEmpty()) {
|
|
|
TradingBox tradingBox = tradingBoxes.stream().filter(e -> e.getId().equals(item.getSrcId())).findFirst().orElse(null);
|
|
|
if (tradingBox != null) {
|
|
|
- long count1 = 0;
|
|
|
+ long count1;
|
|
|
if (ObjectUtils.isNotNull(tradingBox.getCode())) {
|
|
|
count1 = itemsListJC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()) &&
|
|
|
!tradingBox.getCode().contains(e.getBoxCode())).count();
|
|
|
@@ -1745,10 +1754,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
tradingBox.setCode(itemsListZJ.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
|
|
|
.map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.joining(",")));
|
|
|
}
|
|
|
- tradingBox.setActualBoxNumber(tradingBox.getSuitcaseNum() + Integer.parseInt(count1 + ""));
|
|
|
- if (Objects.equals(tradingBox.getActualBoxNumber(), tradingBox.getBoxNumber())){
|
|
|
- tradingBox.setStatus(1);
|
|
|
- }
|
|
|
+ tradingBox.setActualBoxNumber(tradingBox.getActualBoxNumber() + Integer.parseInt(count1 + ""));
|
|
|
+ if (Objects.equals(tradingBox.getActualBoxNumber(), tradingBox.getBoxNumber())) {
|
|
|
+ tradingBox.setStatus(1);
|
|
|
+ }
|
|
|
tradingBoxMapper.updateById(tradingBox);
|
|
|
}
|
|
|
}
|
|
|
@@ -1922,7 +1931,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
archives.setStatus("使用中");
|
|
|
archives.setNewDate(item.getApproachExitDate());
|
|
|
archives.setBoxDynamics("调箱出场");
|
|
|
- archives.setWhetherTransfer("1");
|
|
|
archives.setAddressId(item.getPortId());
|
|
|
archives.setAddressCode(item.getPortCode());
|
|
|
archives.setAddressCname(item.getPortCname());
|
|
|
@@ -1943,7 +1951,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
archives.setStatus("使用中");
|
|
|
archives.setNewDate(item.getApproachExitDate());
|
|
|
archives.setBoxDynamics("调箱出场");
|
|
|
- archives.setWhetherTransfer("1");
|
|
|
archives.setBoxBelongsTo("SOC");
|
|
|
archives.setContainerNumber(item.getContainerNumber());
|
|
|
archives.setContainerNumberType(putBoxData.getBusType());
|