|
|
@@ -150,10 +150,33 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
if (CollectionUtils.isEmpty(excelList)) {
|
|
|
throw new SecurityException("数据不能为空");
|
|
|
}
|
|
|
+ String err = "";
|
|
|
+ int count = 1;
|
|
|
for (EmptyContainerAppearance item : excelList) {
|
|
|
if (ObjectUtils.isNotNull(item.getBoxCode())) {
|
|
|
item.setBoxCode(item.getBoxCode().toUpperCase());
|
|
|
}
|
|
|
+ if (ObjectUtils.isNull(item.getContainerNumber())) {
|
|
|
+ err = "第" + count + "行放箱号不能为空,";
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNull(item.getBoxCode())) {
|
|
|
+ err = "第" + count + "行箱号不能为空,";
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNull(item.getBoxType())) {
|
|
|
+ err = "第" + count + "行箱型不能为空,";
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNull(item.getPortName())) {
|
|
|
+ err = "第" + count + "行港口不能为空,";
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNull(item.getStationName())) {
|
|
|
+ err = "第" + count + "行场站不能为空,";
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNull(item.getObjective())) {
|
|
|
+ err = "第" + count + "行目的不能为空,";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(err)) {
|
|
|
+ throw new RemoteException(err);
|
|
|
}
|
|
|
List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearance::getBoxCode).filter(Objects::nonNull)
|
|
|
.distinct().collect(Collectors.toList());
|
|
|
@@ -183,7 +206,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
List<String> boxType = excelList.stream().map(EmptyContainerAppearance::getBoxType).filter(Objects::nonNull)
|
|
|
.distinct().collect(Collectors.toList());
|
|
|
List<BCntrTypes> boxTypeList = new ArrayList<>();
|
|
|
- if (!portName.isEmpty()) {
|
|
|
+ if (!boxType.isEmpty()) {
|
|
|
boxTypeList = cntrTypesService.list(new LambdaQueryWrapper<BCntrTypes>()
|
|
|
.eq(BCntrTypes::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(BCntrTypes::getIsDeleted, 0)
|
|
|
@@ -640,6 +663,8 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
int version = StringUtil.isBlank(item.getVersion()) ? 1 : Integer.parseInt(item.getVersion());
|
|
|
item.setVersion(String.valueOf(version + 1));
|
|
|
+ item.setCode((ObjectUtils.isNotNull(item.getCode()) ? item.getCode() + "," : "") + itemList.stream()
|
|
|
+ .map(TradingBoxItem::getCode).collect(Collectors.joining(",")));
|
|
|
tradingBoxMapper.updateById(item);
|
|
|
}
|
|
|
}
|
|
|
@@ -975,6 +1000,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public R splitBoxNumber(Long billId, Long billIdNew, String containersIds) {
|
|
|
Bills bills = billsMapper.selectById(billId);
|
|
|
Bills billsNew = billsMapper.selectById(billIdNew);
|
|
|
@@ -1001,7 +1027,14 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
billsNew.setExtendedData((ObjectUtils.isNotNull(billsNew.getExtendedData()) ? billsNew.getExtendedData() + "," : "")
|
|
|
+ containersList.stream().map(Containers::getCntrNo).collect(Collectors.joining(",")));
|
|
|
List<String> boxType = containersList.stream().map(Containers::getCntrTypeCode).distinct().collect(Collectors.toList());
|
|
|
+ List<String> boxCode = containersList.stream().map(Containers::getCntrNo).distinct().collect(Collectors.toList());
|
|
|
for (Containers item : containersList) {
|
|
|
+ if (ObjectUtils.isNull(item.getCntrNo())) {
|
|
|
+ throw new RuntimeException("箱号为空不能拆单!");
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNull(item.getContainerNumber())) {
|
|
|
+ throw new RuntimeException("箱号:" + item.getCntrNo() + "未出场!");
|
|
|
+ }
|
|
|
item.setPid(billsNew.getId());
|
|
|
item.setHblno(billsNew.getHblno());
|
|
|
item.setMblno(billsNew.getMblno());
|
|
|
@@ -1076,6 +1109,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
} else {
|
|
|
seaContainerNumberItem = new SeaContainerNumberItem();
|
|
|
BeanUtil.copyProperties(containerNumberItem, seaContainerNumberItem);
|
|
|
+ seaContainerNumberItem.setId(null);
|
|
|
seaContainerNumberItem.setUpdateUser(null);
|
|
|
seaContainerNumberItem.setUpdateUserName(null);
|
|
|
seaContainerNumberItem.setUpdateTime(null);
|
|
|
@@ -1095,9 +1129,9 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
PreContainers preContainers1 = preContainersListNew.stream().filter(e -> e.getCntrTypeCode().equals(item.getCntrTypeCode()))
|
|
|
.findFirst().orElse(null);
|
|
|
if (preContainers1 != null) {
|
|
|
- preContainers1.setQuantity(item.getQuantity() + boxNumber);
|
|
|
- preContainers1.setActualQuantity(item.getQuantity());
|
|
|
- preContainers1.setOccupyNum(item.getQuantity());
|
|
|
+ preContainers1.setQuantity(preContainers1.getQuantity() + boxNumber);
|
|
|
+ preContainers1.setActualQuantity(preContainers1.getQuantity());
|
|
|
+ preContainers1.setOccupyNum(preContainers1.getQuantity());
|
|
|
preContainers1.setUpdateUser(AuthUtil.getUserId());
|
|
|
preContainers1.setUpdateUserName(AuthUtil.getUserName());
|
|
|
preContainers1.setUpdateTime(new Date());
|
|
|
@@ -1212,6 +1246,68 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
}
|
|
|
if (!containerNumberItems.isEmpty()) {
|
|
|
seaContainerNumberItemService.saveOrUpdateBatch(containerNumberItems);
|
|
|
+ List<Long> srcIdList = containerNumberItems.stream().map(SeaContainerNumberItem::getSrcId)
|
|
|
+ .filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
|
|
+ if (!srcIdList.isEmpty()) {
|
|
|
+ List<PutBoxItems> putBoxItemsList = putBoxItemsService.list(new LambdaQueryWrapper<PutBoxItems>()
|
|
|
+ .eq(PutBoxItems::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PutBoxItems::getIsDeleted, 0)
|
|
|
+ .in(PutBoxItems::getPid, srcIdList)
|
|
|
+ .in(PutBoxItems::getBoxCode, boxCode));
|
|
|
+ if (!putBoxItemsList.isEmpty()) {
|
|
|
+ for (PutBoxItems putBoxItem : putBoxItemsList) {
|
|
|
+ putBoxItem.setMblno(billsNew.getMblno());
|
|
|
+ putBoxItem.setHblno(billsNew.getHblno());
|
|
|
+ putBoxItem.setAgentName(billsNew.getForeignAgencyCnName());
|
|
|
+ putBoxItem.setVoyage(billsNew.getVoyageNo());
|
|
|
+ putBoxItem.setShipNameId(billsNew.getVesselId());
|
|
|
+ putBoxItem.setAgentName(billsNew.getForeignAgencyCnName());
|
|
|
+ putBoxItem.setShipCname(billsNew.getVesselCnName());
|
|
|
+ putBoxItem.setShipEname(billsNew.getVesselEnName());
|
|
|
+ putBoxItem.setEtd(billsNew.getEtd());
|
|
|
+ putBoxItem.setActualEtd(billsNew.getActualEtd());
|
|
|
+ putBoxItem.setUpdateTime(new Date());
|
|
|
+ putBoxItem.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ putBoxItem.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ }
|
|
|
+ putBoxItemsService.updateBatchById(putBoxItemsList);
|
|
|
+ List<PutBox> putBoxList = putBoxService.list(new LambdaQueryWrapper<PutBox>()
|
|
|
+ .eq(PutBox::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PutBox::getIsDeleted, 0)
|
|
|
+ .in(PutBox::getId, srcIdList));
|
|
|
+ if (!putBoxList.isEmpty()) {
|
|
|
+ List<Long> srcIdOWList = putBoxList.stream().map(PutBox::getSrcId)
|
|
|
+ .filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
|
|
+ if (!srcIdOWList.isEmpty()) {
|
|
|
+ List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
|
|
|
+ .eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(TradingBoxItem::getIsDeleted, 0)
|
|
|
+ .in(TradingBoxItem::getPid, srcIdOWList)
|
|
|
+ .in(TradingBoxItem::getCode, boxCode));
|
|
|
+ if (!putBoxItemsList.isEmpty()) {
|
|
|
+ for (TradingBoxItem tradingBoxItem : tradingBoxItemList) {
|
|
|
+ tradingBoxItem.setAgentName(billsNew.getForeignAgencyCnName());
|
|
|
+ tradingBoxItem.setActualEtd(billsNew.getActualEtd());
|
|
|
+ tradingBoxItem.setMblno(billsNew.getMblno());
|
|
|
+ tradingBoxItem.setHblno(billsNew.getHblno());
|
|
|
+ tradingBoxItem.setCorpId(billsNew.getCorpId());
|
|
|
+ tradingBoxItem.setCorpName(billsNew.getCorpCnName());
|
|
|
+ tradingBoxItem.setVoyage(billsNew.getVoyageNo());
|
|
|
+ tradingBoxItem.setShipNameId(billsNew.getVesselId());
|
|
|
+ tradingBoxItem.setShipCname(billsNew.getVesselCnName());
|
|
|
+ tradingBoxItem.setShipEname(billsNew.getVesselEnName());
|
|
|
+ tradingBoxItem.setPolFreeBoxUseDays(billsNew.getPolFreeBoxUseDays());
|
|
|
+ tradingBoxItem.setEtd(billsNew.getEtd());
|
|
|
+ tradingBoxItem.setUpdateTime(new Date());
|
|
|
+ tradingBoxItem.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ tradingBoxItem.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ }
|
|
|
+ tradingBoxItemService.updateBatchById(tradingBoxItemList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
billsMapper.updateById(bills);
|
|
|
billsMapper.updateById(billsNew);
|
|
|
@@ -1412,7 +1508,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
putBoxItem.setContainerNumber(item.getContainerNumber());
|
|
|
putBoxItem.setBoxCode(item.getBoxCode());
|
|
|
putBoxItem.setBoxType(item.getBoxType());
|
|
|
- putBoxItem.setBoxClass(putBox.getBoxClass());
|
|
|
putBoxItem.setTenantId(tenantId);
|
|
|
putBoxItem.setCreateUser(AuthUtil.getUserId());
|
|
|
putBoxItem.setCreateUserName(AuthUtil.getUserName());
|
|
|
@@ -1426,7 +1521,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
putBoxItem.setContainerNumber(item.getContainerNumber());
|
|
|
putBoxItem.setBoxCode(item.getBoxCode());
|
|
|
putBoxItem.setBoxType(item.getBoxType());
|
|
|
- putBoxItem.setBoxClass(putBox.getBoxClass());
|
|
|
putBoxItem.setTenantId(tenantId);
|
|
|
putBoxItem.setCreateUser(AuthUtil.getUserId());
|
|
|
putBoxItem.setCreateUserName(AuthUtil.getUserName());
|
|
|
@@ -1676,6 +1770,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
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());
|
|
|
@@ -1863,7 +1963,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
archives.setUpdateTime(new Date());
|
|
|
archives.setUpdateUserName(AuthUtil.getUserName());
|
|
|
archives.setUpdateUser(AuthUtil.getUserId());
|
|
|
- if (ObjectUtils.isNotNull(item.getSrcBoxStatus()) && !"待使用".equals(archives.getStatus())) {
|
|
|
+ if (ObjectUtils.isNotNull(item.getSrcBoxStatus())) {
|
|
|
archives.setStatus(item.getSrcBoxStatus());
|
|
|
archives.setBoxDynamics(item.getSrcBoxDynamics());
|
|
|
archives.setBoxStatus(item.getSrcBoxGoodBad());
|
|
|
@@ -1927,8 +2027,8 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
}
|
|
|
}
|
|
|
if ("HX".equals(type)) {
|
|
|
- if (!"待使用".equals(putBoxItem.getStatus())) {
|
|
|
- throw new RemoteException("箱号:" + putBoxItem.getBoxCode() + "状态不是待使用,撤销还箱失败");
|
|
|
+ if (!"已还箱".equals(putBoxItem.getStatus())) {
|
|
|
+ throw new RemoteException("箱号:" + putBoxItem.getBoxCode() + "状态不是已还箱,撤销还箱失败");
|
|
|
}
|
|
|
putBoxItem.setPodEmptyContainerReturnDate(null);
|
|
|
putBoxItem.setPodStationId(null);
|
|
|
@@ -2022,8 +2122,14 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
item.setVersion(item.getVersion() + 1);
|
|
|
if ("JC,DBJ,TG".contains(type)) {
|
|
|
if (!"OW(拿)".equals(item.getBoxClass()) && !"DBJ".equals(type)) {
|
|
|
+ if (item.getRemainingNum()<count){
|
|
|
+ throw new RemoteException("可用数量不足,撤销失败");
|
|
|
+ }
|
|
|
item.setRemainingNum(item.getRemainingNum() - Integer.parseInt(count + ""));
|
|
|
}
|
|
|
+ if (item.getStorageNum()<count){
|
|
|
+ throw new RemoteException("盘存数量不足,撤销失败");
|
|
|
+ }
|
|
|
item.setStorageNum(item.getStorageNum() - Integer.parseInt(count + ""));
|
|
|
putBoxes.add(item);
|
|
|
} else if ("DBC,TZ".contains(type)) {
|
|
|
@@ -2048,10 +2154,11 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
e.getContainerNumber().equals(item.getContainerNumber()) && boxList.contains(e.getCntrNo())).count();
|
|
|
boolean whetherAppearStatus = false;
|
|
|
if (!containerNumberItemList.isEmpty()) {
|
|
|
- SeaContainerNumberItem containerNumberItems = containerNumberItemList.stream().filter(e -> e.getSrcId().equals(item.getId())).findFirst().orElse(null);
|
|
|
+ SeaContainerNumberItem containerNumberItems = containerNumberItemList.stream()
|
|
|
+ .filter(e -> e.getSrcId().equals(item.getId())).findFirst().orElse(null);
|
|
|
if (containerNumberItems != null) {
|
|
|
containerNumberItems.setOutNum(containerNumberItems.getOutNum() - Integer.parseInt(size + ""));
|
|
|
- if (containerNumberItems.getOutNum().equals(containerNumberItems.getOccupyNum())) {
|
|
|
+ if (!containerNumberItems.getOutNum().equals(containerNumberItems.getOccupyNum())) {
|
|
|
containerNumberItems.setWhetherAppearStatus("0");
|
|
|
whetherAppearStatus = true;
|
|
|
}
|
|
|
@@ -2466,9 +2573,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
archives.setStationCode(recordItems.getStationCname());
|
|
|
archives.setStationCname(recordItems.getStationEname());
|
|
|
archives.setStationEname(recordItems.getStationCode());
|
|
|
- archives.setContainerNumberOw("");
|
|
|
- archives.setContainerNumberTypeOw("");
|
|
|
- archives.setBillNo("");
|
|
|
archives.setTemporaryId(recordItems.getTemporaryId());
|
|
|
archivesArrayList.add(archives);
|
|
|
if (!containerNumberType.equals("OW(拿)")) {
|
|
|
@@ -2579,11 +2683,20 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
if (!putBoxNewList.isEmpty()) {
|
|
|
for (PutBox item : putBoxNewList) {
|
|
|
if (!putBoxItemsNewList.isEmpty()) {
|
|
|
- long count = putBoxItemsNewList.stream().filter(e -> e.getPid().equals(item.getId())).count();
|
|
|
- item.setTotalNum((ObjectUtils.isNull(item.getTotalNum()) ? 0 : item.getTotalNum())
|
|
|
- + Integer.parseInt(count + ""));
|
|
|
- item.setRemainingNum((ObjectUtils.isNull(item.getRemainingNum()) ? 0 : item.getRemainingNum()) + Integer.parseInt(count + ""));
|
|
|
- item.setStorageNum((ObjectUtils.isNull(item.getStorageNum()) ? 0 : item.getStorageNum()) + Integer.parseInt(count + ""));
|
|
|
+ List<PutBoxItems> putBoxItems = putBoxItemsNewList.stream().filter(e -> e.getPid().equals(item.getId())).collect(Collectors.toList());
|
|
|
+ if (!putBoxItems.isEmpty()) {
|
|
|
+ item.setTotalNum((ObjectUtils.isNull(item.getTotalNum()) ? 0 : item.getTotalNum())
|
|
|
+ + putBoxItems.size());
|
|
|
+ item.setRemainingNum((ObjectUtils.isNull(item.getRemainingNum()) ? 0 : item.getRemainingNum()) + putBoxItems.size());
|
|
|
+ item.setStorageNum((ObjectUtils.isNull(item.getStorageNum()) ? 0 : item.getStorageNum()) + putBoxItems.size());
|
|
|
+ for (PutBoxItems boxItems : putBoxItems) {
|
|
|
+ if (ObjectUtils.isNotNull(item.getCode())) {
|
|
|
+ item.setCode(item.getCode() + "," + boxItems.getBoxCode());
|
|
|
+ } else {
|
|
|
+ item.setCode(boxItems.getBoxCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
item.setVersion(ObjectUtils.isNull(item.getVersion()) ? 1 : item.getVersion() + 1);
|
|
|
}
|
|
|
}
|
|
|
@@ -2617,6 +2730,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
archivesTrajectory.setBoxDynamics(BoxDynamicsEnums.getName(dynamicsRecordItems.getObjective()));
|
|
|
archivesTrajectory.setNewDate(dynamicsRecordItems.getApproachExitDate());
|
|
|
}
|
|
|
+ if (ObjectUtils.isNotNull(putBox.getPodId()) && !putBox.getPodId().contains(",")) {
|
|
|
+ archivesTrajectory.setPodId(Long.parseLong(putBox.getPodId()));
|
|
|
+ archivesTrajectory.setPodCode(putBox.getPodCode());
|
|
|
+ archivesTrajectory.setPodCname(putBox.getPodCname());
|
|
|
+ archivesTrajectory.setPodEname(putBox.getPodEname());
|
|
|
+ }
|
|
|
archivesTrajectory.setStatus(archivesTrajectory.getBoxDynamics());
|
|
|
archivesTrajectory.setBillType(putBox.getBoxClass());
|
|
|
archivesTrajectory.setCode(item.getBoxCode());
|
|
|
@@ -2651,6 +2770,75 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
archivesTrajectoryMapper.insert(archivesTrajectory);
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if (!putBoxItemsOldList.isEmpty()) {
|
|
|
+ for (PutBoxItems item : putBoxItemsOldList) {
|
|
|
+ PutBox putBox = putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
|
|
|
+ if (putBox != null) {
|
|
|
+ //记录箱轨迹信息
|
|
|
+ ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
|
|
|
+ archivesTrajectory.setPortId(putBox.getPolId());
|
|
|
+ archivesTrajectory.setPortCode(putBox.getPolCode());
|
|
|
+ archivesTrajectory.setPortCname(putBox.getPolCname());
|
|
|
+ archivesTrajectory.setPortEname(putBox.getPolEname());
|
|
|
+ archivesTrajectory.setStationId(putBox.getPolStationId());
|
|
|
+ archivesTrajectory.setStationCode(putBox.getPolStationCode());
|
|
|
+ archivesTrajectory.setStationCname(putBox.getPolStationCname());
|
|
|
+ archivesTrajectory.setStationEname(putBox.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 = itemsListFC.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode())).findFirst().orElse(null);
|
|
|
+ if (dynamicsRecordItems != null) {
|
|
|
+ archivesTrajectory.setBoxDynamics(BoxDynamicsEnums.getName(dynamicsRecordItems.getObjective()));
|
|
|
+ archivesTrajectory.setNewDate(dynamicsRecordItems.getApproachExitDate());
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(putBox.getPodId()) && !putBox.getPodId().contains(",")) {
|
|
|
+ archivesTrajectory.setPodId(Long.parseLong(putBox.getPodId()));
|
|
|
+ archivesTrajectory.setPodCode(putBox.getPodCode());
|
|
|
+ archivesTrajectory.setPodCname(putBox.getPodCname());
|
|
|
+ archivesTrajectory.setPodEname(putBox.getPodEname());
|
|
|
+ }
|
|
|
+ archivesTrajectory.setStatus(archivesTrajectory.getBoxDynamics());
|
|
|
+ archivesTrajectory.setBillType(putBox.getBoxClass());
|
|
|
+ archivesTrajectory.setCode(item.getBoxCode());
|
|
|
+ archivesTrajectory.setCreateTime(new Date());
|
|
|
+ archivesTrajectory.setCreateUser(AuthUtil.getUserId());
|
|
|
+ archivesTrajectory.setCreateUserName(AuthUtil.getUserName());
|
|
|
+ archivesTrajectory.setTenantId(AuthUtil.getTenantId());
|
|
|
+ archivesTrajectory.setSrcId(putBox.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());
|
|
|
+ archivesTrajectoryMapper.insert(archivesTrajectory);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if (!putBoxItemsOldList.isEmpty()) {
|
|
|
putBoxItemsService.updateBatchById(putBoxItemsOldList);
|
|
|
@@ -3083,6 +3271,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
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());
|
|
|
@@ -3562,6 +3756,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
archivesTrajectory.setBoxDynamics(BoxDynamicsEnums.getName(dynamicsRecordItems.getObjective()));
|
|
|
archivesTrajectory.setNewDate(dynamicsRecordItems.getApproachExitDate());
|
|
|
}
|
|
|
+ if (ObjectUtils.isNotNull(putBox.getPodId()) && !putBox.getPodId().contains(",")) {
|
|
|
+ archivesTrajectory.setPodId(Long.parseLong(putBox.getPodId()));
|
|
|
+ archivesTrajectory.setPodCode(putBox.getPodCode());
|
|
|
+ archivesTrajectory.setPodCname(putBox.getPodCname());
|
|
|
+ archivesTrajectory.setPodEname(putBox.getPodEname());
|
|
|
+ }
|
|
|
archivesTrajectory.setStatus(archivesTrajectory.getBoxDynamics());
|
|
|
archivesTrajectory.setBillType(putBox.getBoxClass());
|
|
|
archivesTrajectory.setCode(item.getBoxCode());
|
|
|
@@ -3783,6 +3983,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
archivesTrajectory.setBoxDynamics(BoxDynamicsEnums.getName(dynamicsRecordItems.getObjective()));
|
|
|
archivesTrajectory.setNewDate(dynamicsRecordItems.getApproachExitDate());
|
|
|
}
|
|
|
+ if (ObjectUtils.isNotNull(putBox.getPodId()) && !putBox.getPodId().contains(",")) {
|
|
|
+ archivesTrajectory.setPodId(Long.parseLong(putBox.getPodId()));
|
|
|
+ archivesTrajectory.setPodCode(putBox.getPodCode());
|
|
|
+ archivesTrajectory.setPodCname(putBox.getPodCname());
|
|
|
+ archivesTrajectory.setPodEname(putBox.getPodEname());
|
|
|
+ }
|
|
|
archivesTrajectory.setStatus(archivesTrajectory.getBoxDynamics());
|
|
|
archivesTrajectory.setBillType(putBox.getBoxClass());
|
|
|
archivesTrajectory.setCode(item.getBoxCode());
|
|
|
@@ -4168,20 +4374,19 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
if (!putBoxItems.isEmpty()) {
|
|
|
count = putBoxItems.stream().filter(e -> item.getId().equals(e.getPid())).count();
|
|
|
}
|
|
|
- item.setTotalNum(item.getTotalNum() - Integer.parseInt(count + ""));
|
|
|
item.setStorageNum(item.getStorageNum() - Integer.parseInt(count + ""));
|
|
|
if (item.getStorageNum() < 0) {
|
|
|
failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "剩余场地盘存小于本次导入箱数");
|
|
|
return false;
|
|
|
}
|
|
|
- item.setRemainingNum(item.getRemainingNum() - 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);
|
|
|
- if (!tradingBoxes.isEmpty()) {
|
|
|
+ if (tradingBoxes.isEmpty()) {
|
|
|
+ item.setTotalNum(item.getTotalNum() - Integer.parseInt(count + ""));
|
|
|
+ item.setRemainingNum(item.getRemainingNum() - Integer.parseInt(count + ""));
|
|
|
+ if (item.getRemainingNum() < 0) {
|
|
|
+ failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "剩余可用小于本次导入箱数");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
TradingBox tradingBox = tradingBoxes.stream().filter(e -> e.getId().equals(item.getSrcId())).findFirst().orElse(null);
|
|
|
if (tradingBox != null) {
|
|
|
if (ObjectUtils.isNotNull(tradingBox.getCode())) {
|
|
|
@@ -4202,6 +4407,8 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
tradingBoxMapper.updateById(tradingBox);
|
|
|
}
|
|
|
}
|
|
|
+ item.setVersion(ObjectUtils.isNull(item.getVersion()) ? 1 : item.getVersion() + 1);
|
|
|
+ putBoxList1.add(item);
|
|
|
}
|
|
|
putBoxService.saveOrUpdateBatch(putBoxList1);
|
|
|
}
|
|
|
@@ -4233,6 +4440,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
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());
|
|
|
@@ -4595,6 +4808,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
putBoxItem.setShipEname(bills.getVesselEnName());
|
|
|
putBoxItem.setEtd(bills.getEtd());
|
|
|
putBoxItem.setActualEtd(bills.getActualEtd());
|
|
|
+ putBoxItem.setPolFreeBoxUseDays(bills.getPolFreeBoxUseDays());
|
|
|
} else {
|
|
|
putBoxItem.setUnoccupied("1");
|
|
|
}
|
|
|
@@ -4730,6 +4944,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
tradingBoxItem.setShipEname(bills.getVesselEnName());
|
|
|
tradingBoxItem.setPolFreeBoxUseDays(bills.getPolFreeBoxUseDays());
|
|
|
tradingBoxItem.setEtd(bills.getEtd());
|
|
|
+ tradingBoxItem.setPolFreeBoxUseDays(bills.getPolFreeBoxUseDays());
|
|
|
}
|
|
|
tradingBoxItem.setHblno(item.getHblno());
|
|
|
tradingBoxItem.setTemporaryId(item.getTemporaryId());
|
|
|
@@ -4790,6 +5005,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
containers.setPodCyTel(tradingBoxItem.getPodCyTel());
|
|
|
}
|
|
|
}
|
|
|
+ logUtils.saveOperationLog(OperatorType.API_DATA_SYNCHRONIZATION, OperatorType.CC, containers.getId());
|
|
|
}
|
|
|
} else {
|
|
|
BoxDynamicsRecordItems recordItems = hblnoList.stream().filter(e -> containers.getCntrNo().equals(e.getBoxCode())).findFirst().orElse(null);
|
|
|
@@ -4815,6 +5031,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
containers.setPodCyTel(tradingBoxItem.getPodCyTel());
|
|
|
}
|
|
|
}
|
|
|
+ logUtils.saveOperationLog(OperatorType.API_DATA_SYNCHRONIZATION, OperatorType.CC, containers.getId());
|
|
|
}
|
|
|
}
|
|
|
containers.setBoxSrcType(putBoxData.getBoxClass());
|
|
|
@@ -4822,7 +5039,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
int version = StringUtil.isBlank(containers.getVersion()) ? 1 : Integer.parseInt(containers.getVersion());
|
|
|
containers.setVersion(String.valueOf(version + 1));
|
|
|
containersListNew.add(containers);
|
|
|
- logUtils.saveOperationLog(OperatorType.API_DATA_SYNCHRONIZATION, OperatorType.CC, containers.getId());
|
|
|
}
|
|
|
} else {
|
|
|
failureHandling(type, boxDynamicsRecord, "未查到对应提单号:" + item.getMblno() + "配箱单据");
|
|
|
@@ -5007,6 +5223,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
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());
|