|
|
@@ -1090,21 +1090,21 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(corps.getId()) &&
|
|
|
putBoxData.getBusType().equals(e.getBusType())).findFirst().orElse(null);
|
|
|
if (putBox1 != null) {*/
|
|
|
- if (!containersList.isEmpty()) {
|
|
|
- List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getHblno())
|
|
|
- && item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
|
|
|
- for (Containers containers : containerItemList) {
|
|
|
- containers.setPodStationId(corps.getId());
|
|
|
- containers.setPodStationCode(corps.getCode());
|
|
|
- containers.setPodStationCname(corps.getCnName());
|
|
|
- containers.setPodStationEname(corps.getEnName());
|
|
|
- containers.setPodEmptyContainerReturnDate(item.getBoxStatusDate());
|
|
|
- containers.setContainerNumber(item.getContainerNumber());
|
|
|
- containersListNew.add(containers);
|
|
|
- }
|
|
|
- } else {
|
|
|
- throw new RuntimeException("未查到对应提单号:" + item.getMblno() + "配箱单据");
|
|
|
+ if (!containersList.isEmpty()) {
|
|
|
+ List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getHblno())
|
|
|
+ && item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
|
|
|
+ for (Containers containers : containerItemList) {
|
|
|
+ containers.setPodStationId(corps.getId());
|
|
|
+ containers.setPodStationCode(corps.getCode());
|
|
|
+ containers.setPodStationCname(corps.getCnName());
|
|
|
+ containers.setPodStationEname(corps.getEnName());
|
|
|
+ containers.setPodEmptyContainerReturnDate(item.getBoxStatusDate());
|
|
|
+ containers.setContainerNumber(item.getContainerNumber());
|
|
|
+ containersListNew.add(containers);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("未查到对应提单号:" + item.getMblno() + "配箱单据");
|
|
|
+ }
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
@@ -1158,7 +1158,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
e.getContainerNumber().equals(item.getContainerNumber()) && boxList.contains(e.getCntrNo())).count();
|
|
|
item.setOccupyNum(item.getOccupyNum() - Integer.parseInt(size + ""));
|
|
|
if (item.getOccupyNum() < 0) {
|
|
|
- throw new RemoteException("放箱号:" + item.getContainerNumber() + "剩余操作占用小于本次导入箱数");
|
|
|
+ throw new RemoteException("放箱号:" + item.getContainerNumber() + "箱号未被操作占用");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1218,46 +1218,31 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
}
|
|
|
if (!putBoxItems.isEmpty()) {
|
|
|
putBoxItemsService.saveOrUpdateBatch(putBoxItems);
|
|
|
- }
|
|
|
- if (!containersListNew.isEmpty()) {
|
|
|
- containersService.saveOrUpdateBatch(containersListNew);
|
|
|
- }
|
|
|
- if (!archivesArrayList.isEmpty()) {
|
|
|
- archivesService.saveOrUpdateBatch(archivesArrayList);
|
|
|
- }
|
|
|
- if (!tradingBoxItems.isEmpty()) {
|
|
|
- tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
|
|
|
- for (TradingBoxItem item : tradingBoxItems) {
|
|
|
- TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
|
|
|
+ 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.getAddressId());
|
|
|
- archivesTrajectory.setPortCode(tradingBox.getAddressCode());
|
|
|
- archivesTrajectory.setPortCname(tradingBox.getAddressCname());
|
|
|
- archivesTrajectory.setPortEname(tradingBox.getAddressEname());
|
|
|
- archivesTrajectory.setStationId(tradingBox.getAddressId());
|
|
|
- archivesTrajectory.setStationCode(tradingBox.getAddressCode());
|
|
|
- archivesTrajectory.setStationCname(tradingBox.getAddressCname());
|
|
|
- archivesTrajectory.setStationEname(tradingBox.getAddressEname());
|
|
|
+ archivesTrajectory.setPortId(tradingBox.getPolId());
|
|
|
+ archivesTrajectory.setPortCode(tradingBox.getPolCode());
|
|
|
+ archivesTrajectory.setPortCname(tradingBox.getPodCname());
|
|
|
+ archivesTrajectory.setPortEname(tradingBox.getPodEname());
|
|
|
+ archivesTrajectory.setStationId(tradingBox.getPolStationId());
|
|
|
+ archivesTrajectory.setStationCode(tradingBox.getPolStationCode());
|
|
|
+ archivesTrajectory.setStationCname(tradingBox.getPolStationCname());
|
|
|
+ archivesTrajectory.setStationEname(tradingBox.getPolStationEname());
|
|
|
archivesTrajectory.setContainerNumber(item.getContainerNumber());
|
|
|
archivesTrajectory.setBoxType(item.getBoxType());
|
|
|
- archivesTrajectory.setBoxCategory(item.getBoxCategory());
|
|
|
+ archivesTrajectory.setBoxCategory(item.getBoxClass());
|
|
|
archivesTrajectory.setBoxEastId(item.getBoxEastId());
|
|
|
archivesTrajectory.setBoxEastName(item.getBoxEastName());
|
|
|
archivesTrajectory.setMblno(item.getMblno());
|
|
|
archivesTrajectory.setBoxDynamics("空箱出场");
|
|
|
- if ("OW-N".equals(tradingBox.getType())) {
|
|
|
- archivesTrajectory.setStatus("OW-拿");
|
|
|
- } else if ("OW-F".equals(tradingBox.getType())) {
|
|
|
- archivesTrajectory.setStatus("OW-放");
|
|
|
- }
|
|
|
- archivesTrajectory.setCorpId(tradingBox.getPurchaseCompanyId());
|
|
|
- archivesTrajectory.setCorpName(tradingBox.getPurchaseCompanyName());
|
|
|
- archivesTrajectory.setContractNo(tradingBox.getContractNo());
|
|
|
- archivesTrajectory.setBillType(tradingBox.getType());
|
|
|
- archivesTrajectory.setCode(item.getCode());
|
|
|
- archivesTrajectory.setPortCname(tradingBox.getAddressCname());
|
|
|
+ archivesTrajectory.setStatus(tradingBox.getBusType());
|
|
|
+ archivesTrajectory.setCorpId(item.getBoxEastId());
|
|
|
+ archivesTrajectory.setCorpName(item.getBoxEastName());
|
|
|
+ archivesTrajectory.setBillType(tradingBox.getBoxType());
|
|
|
+ archivesTrajectory.setCode(item.getBoxCode());
|
|
|
archivesTrajectory.setNewDate(new Date());
|
|
|
archivesTrajectory.setCreateTime(new Date());
|
|
|
archivesTrajectory.setCreateUser(AuthUtil.getUserId());
|
|
|
@@ -1268,6 +1253,15 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (!containersListNew.isEmpty()) {
|
|
|
+ containersService.saveOrUpdateBatch(containersListNew);
|
|
|
+ }
|
|
|
+ if (!archivesArrayList.isEmpty()) {
|
|
|
+ archivesService.saveOrUpdateBatch(archivesArrayList);
|
|
|
+ }
|
|
|
+ if (!tradingBoxItems.isEmpty()) {
|
|
|
+ tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
|
|
|
+ }
|
|
|
this.countOverdueFee(putBoxList, tradingBoxList, tradingBoxItems, containersListNew, putBoxItems);
|
|
|
List<String> fileName = excelList.stream().map(EmptyContainerAppearanceAnalysis::getSrcFile).distinct()
|
|
|
.filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
@@ -1648,7 +1642,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
List<FeeCenter> feeCenterList = new ArrayList<>();
|
|
|
List<PutBoxItems> putBoxItemsList = new ArrayList<>();
|
|
|
List<TradingBoxItem> tradingBoxItemList = new ArrayList<>();
|
|
|
- List<String> mblnoList = putBoxItems.stream().map(PutBoxItems::getMblno).collect(Collectors.toList());
|
|
|
+ List<String> mblnoList = putBoxItems.stream().map(PutBoxItems::getHblno).collect(Collectors.toList());
|
|
|
if (!mblnoList.isEmpty()) {
|
|
|
//海运进出口单据
|
|
|
List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
@@ -1706,7 +1700,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
throw new RuntimeException("箱号未在配箱信息中查到");
|
|
|
}
|
|
|
//查找OW明细提单号对应海运进出口单据
|
|
|
- Bills bills = billsList.stream().filter(e -> e.getHblno().equals(item.getMblno()) && e.getId().equals(containers.getPid()))
|
|
|
+ Bills bills = billsList.stream().filter(e -> e.getHblno().equals(item.getHblno()) && e.getId().equals(containers.getPid()))
|
|
|
.findFirst().orElse(null);
|
|
|
if (bills == null) {
|
|
|
throw new RuntimeException("未查到提单号:" + item.getMblno() + "海运进出口单据");
|
|
|
@@ -1738,7 +1732,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
days > bills.getPolFreeBoxUseDays()) {
|
|
|
overdueDays = (int) (days - bills.getPolFreeBoxUseDays());
|
|
|
}
|
|
|
- if (overdueDays != 0) {
|
|
|
+ if (overdueDays > 0) {
|
|
|
FeeCenter feeCenter = this.addFeeCenter(item, bills, fees, storageFeesItems, curExrateList, overdueDays, exrateType);
|
|
|
if (feeCenter != null) {
|
|
|
feeCenterList.add(feeCenter);
|
|
|
@@ -2974,43 +2968,31 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
}
|
|
|
if (!putBoxItems.isEmpty()) {
|
|
|
putBoxItemsService.saveOrUpdateBatch(putBoxItems);
|
|
|
- }
|
|
|
- if (!archivesArrayList.isEmpty()) {
|
|
|
- archivesService.saveOrUpdateBatch(archivesArrayList);
|
|
|
- }
|
|
|
- if (!tradingBoxItems.isEmpty()) {
|
|
|
- tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
|
|
|
- for (TradingBoxItem item : tradingBoxItems) {
|
|
|
- TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
|
|
|
+ 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.getAddressId());
|
|
|
- archivesTrajectory.setPortCode(tradingBox.getAddressCode());
|
|
|
- archivesTrajectory.setPortCname(tradingBox.getAddressCname());
|
|
|
- archivesTrajectory.setPortEname(tradingBox.getAddressEname());
|
|
|
- archivesTrajectory.setStationId(tradingBox.getAddressId());
|
|
|
- archivesTrajectory.setStationCode(tradingBox.getAddressCode());
|
|
|
- archivesTrajectory.setStationCname(tradingBox.getAddressCname());
|
|
|
- archivesTrajectory.setStationEname(tradingBox.getAddressEname());
|
|
|
+ archivesTrajectory.setPortId(tradingBox.getPolId());
|
|
|
+ archivesTrajectory.setPortCode(tradingBox.getPolCode());
|
|
|
+ archivesTrajectory.setPortCname(tradingBox.getPodCname());
|
|
|
+ archivesTrajectory.setPortEname(tradingBox.getPodEname());
|
|
|
+ archivesTrajectory.setStationId(tradingBox.getPolStationId());
|
|
|
+ archivesTrajectory.setStationCode(tradingBox.getPolStationCode());
|
|
|
+ archivesTrajectory.setStationCname(tradingBox.getPolStationCname());
|
|
|
+ archivesTrajectory.setStationEname(tradingBox.getPolStationEname());
|
|
|
archivesTrajectory.setContainerNumber(item.getContainerNumber());
|
|
|
archivesTrajectory.setBoxType(item.getBoxType());
|
|
|
- archivesTrajectory.setBoxCategory(item.getBoxCategory());
|
|
|
+ archivesTrajectory.setBoxCategory(item.getBoxClass());
|
|
|
archivesTrajectory.setBoxEastId(item.getBoxEastId());
|
|
|
archivesTrajectory.setBoxEastName(item.getBoxEastName());
|
|
|
archivesTrajectory.setMblno(item.getMblno());
|
|
|
- archivesTrajectory.setBoxDynamics("空箱提箱进场");
|
|
|
- if ("OW-N".equals(tradingBox.getType())) {
|
|
|
- archivesTrajectory.setStatus("OW-拿");
|
|
|
- } else if ("OW-F".equals(tradingBox.getType())) {
|
|
|
- archivesTrajectory.setStatus("OW-放");
|
|
|
- }
|
|
|
- archivesTrajectory.setCorpId(tradingBox.getPurchaseCompanyId());
|
|
|
- archivesTrajectory.setCorpName(tradingBox.getPurchaseCompanyName());
|
|
|
- archivesTrajectory.setContractNo(tradingBox.getContractNo());
|
|
|
- archivesTrajectory.setBillType(tradingBox.getType());
|
|
|
- archivesTrajectory.setCode(item.getCode());
|
|
|
- archivesTrajectory.setPortCname(tradingBox.getAddressCname());
|
|
|
+ archivesTrajectory.setBoxDynamics("空箱出场");
|
|
|
+ archivesTrajectory.setStatus(tradingBox.getBusType());
|
|
|
+ archivesTrajectory.setCorpId(item.getBoxEastId());
|
|
|
+ archivesTrajectory.setCorpName(item.getBoxEastName());
|
|
|
+ archivesTrajectory.setBillType(tradingBox.getBoxType());
|
|
|
+ archivesTrajectory.setCode(item.getBoxCode());
|
|
|
archivesTrajectory.setNewDate(new Date());
|
|
|
archivesTrajectory.setCreateTime(new Date());
|
|
|
archivesTrajectory.setCreateUser(AuthUtil.getUserId());
|
|
|
@@ -3021,6 +3003,12 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (!archivesArrayList.isEmpty()) {
|
|
|
+ archivesService.saveOrUpdateBatch(archivesArrayList);
|
|
|
+ }
|
|
|
+ if (!tradingBoxItems.isEmpty()) {
|
|
|
+ tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
|
|
|
+ }
|
|
|
List<String> fileName = excelList.stream().map(EmptyContainerAppearanceAnalysis::getSrcFile).distinct()
|
|
|
.filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
if (!fileName.isEmpty()) {
|
|
|
@@ -5270,7 +5258,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
days > billsHYJK.getPodFreeBoxUseDays()) {
|
|
|
overdueDays = (int) (days - billsHYJK.getPodFreeBoxUseDays());
|
|
|
}
|
|
|
- if (overdueDays != 0) {
|
|
|
+ if (overdueDays > 0) {
|
|
|
FeeCenter feeCenter = this.addFeeCenter(item, billsHYJK, fees, storageFeesItems, curExrateList, overdueDays, exrateType);
|
|
|
if (feeCenter != null) {
|
|
|
feeCenterList.add(feeCenter);
|