|
|
@@ -263,18 +263,12 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
List<PutBoxItems> putBoxItems = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()))
|
|
|
.collect(Collectors.toList());
|
|
|
if (item.getId() == null) {
|
|
|
- if (!putBoxItems.isEmpty()) {
|
|
|
- throw new RuntimeException("箱号" + item.getBoxCode() + "已在其他放箱号中存在,请勿重复添加");
|
|
|
- }
|
|
|
item.setCreateUser(AuthUtil.getUserId());
|
|
|
item.setCreateTime(new Date());
|
|
|
item.setCreateUserName(AuthUtil.getUserName());
|
|
|
item.setTenantId(AuthUtil.getTenantId());
|
|
|
item.setPid(putBox.getId());
|
|
|
} else {
|
|
|
- if (putBoxItems.stream().anyMatch(e -> !e.getId().equals(item.getId()))) {
|
|
|
- throw new RuntimeException("箱号" + item.getBoxCode() + "已在其他放箱号中存在,请勿重复添加");
|
|
|
- }
|
|
|
item.setUpdateTime(new Date());
|
|
|
item.setUpdateUser(AuthUtil.getUserId());
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
@@ -742,6 +736,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
if (ObjectUtils.isNull(item.getBoxStatusDate())) {
|
|
|
throw new RemoteException("动态日期不能为空");
|
|
|
}
|
|
|
+ if (ObjectUtils.isNull(item.getMblno())) {
|
|
|
+ throw new RemoteException("提单号不能为空");
|
|
|
+ }
|
|
|
BCntrTypes cntrTypes = cntrTypesList.stream().filter(e -> e.getCnName().equals(item.getBoxType())).findFirst().orElse(null);
|
|
|
if (cntrTypes == null) {
|
|
|
throw new RemoteException("请先维护箱型:" + item.getBoxType() + "基础资料");
|
|
|
@@ -1258,6 +1255,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
if (ObjectUtils.isNull(item.getBoxStatusDate())) {
|
|
|
throw new RemoteException("动态日期不能为空");
|
|
|
}
|
|
|
+ if (ObjectUtils.isNull(item.getMblno())) {
|
|
|
+ throw new RemoteException("提单号不能为空");
|
|
|
+ }
|
|
|
BPorts ports = portsList.stream().filter(e -> e.getCnName().equals(item.getPortName())).findFirst().orElse(null);
|
|
|
if (ports == null) {
|
|
|
throw new RemoteException("请先维护港口:" + item.getPortName() + "基础资料");
|
|
|
@@ -1474,7 +1474,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
tradingBoxItemService.updateBatchById(tradingBoxItemOldList);
|
|
|
}
|
|
|
//计算超期箱使费
|
|
|
- this.countOverdueFee(tradingBoxList, tradingBoxItemOldList, "2");
|
|
|
+ this.countOverdueFee(tradingBoxList, tradingBoxItemOldList);
|
|
|
ArchivesFiles archivesFiles = new ArchivesFiles();
|
|
|
archivesFiles.setCreateUser(AuthUtil.getUserId());
|
|
|
archivesFiles.setCreateTime(new Date());
|
|
|
@@ -1491,8 +1491,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
return R.data("操作成功");
|
|
|
}
|
|
|
|
|
|
- private void countOverdueFee(List<TradingBox> tradingBoxList, List<TradingBoxItem> tradingBoxItemOldList,
|
|
|
- String type) {
|
|
|
+ private void countOverdueFee(List<TradingBox> tradingBoxList, List<TradingBoxItem> tradingBoxItemOldList) {
|
|
|
List<FeeCenter> feeCenterList = new ArrayList<>();
|
|
|
List<String> mblnoList = tradingBoxItemOldList.stream().map(TradingBoxItem::getMblno).collect(Collectors.toList());
|
|
|
if (!mblnoList.isEmpty()) {
|
|
|
@@ -1548,7 +1547,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
//对应海运进出口单据所属公司所有币别
|
|
|
List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", bills.getBranchId());
|
|
|
//所属公司具体超期标准
|
|
|
- StorageFees storageFees = new StorageFees();
|
|
|
+ StorageFees storageFees;
|
|
|
if ("SE".equals(bills.getBusinessType())) {
|
|
|
storageFees = storageFeesList.stream().filter(e -> e.getBranchId().equals(bills.getBranchId()) &&
|
|
|
"出口超期箱".equals(e.getType())).findFirst().orElse(null);
|
|
|
@@ -1569,136 +1568,42 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
if (storageFeesItems.isEmpty()) {
|
|
|
throw new RuntimeException("请先维护基础资料-超期标准");
|
|
|
}
|
|
|
- //超期天数
|
|
|
- int overdueDays = 0;
|
|
|
- if ("1".equals(type)) {
|
|
|
- //起运港超期天数
|
|
|
- if (ObjectUtils.isNotNull(item.getPolPickUpDate()) && ObjectUtils.isNotNull(bills.getEtd())) {
|
|
|
- LocalDateTime ldt1 = bills.getEtd().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
|
- LocalDateTime ldt2 = item.getPolPickUpDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
|
- long days = ChronoUnit.DAYS.between(ldt1, ldt2);
|
|
|
- if (ObjectUtils.isNull(bills.getPolFreeBoxUseDays()) || 0 == bills.getPolFreeBoxUseDays() ||
|
|
|
- days > bills.getPolFreeBoxUseDays()) {
|
|
|
- overdueDays = (int) (days - bills.getPolFreeBoxUseDays());
|
|
|
- }
|
|
|
+ //起运港超期天数
|
|
|
+ if (ObjectUtils.isNotNull(item.getPolPickUpDate()) && ObjectUtils.isNotNull(bills.getEtd())) {
|
|
|
+ LocalDateTime ldt1 = bills.getEtd().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
|
+ LocalDateTime ldt2 = item.getPolPickUpDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
|
+ long days = ChronoUnit.DAYS.between(ldt2, ldt1);
|
|
|
+ //超期天数
|
|
|
+ int overdueDays = 0;
|
|
|
+ if (ObjectUtils.isNull(bills.getPolFreeBoxUseDays()) || 0 == bills.getPolFreeBoxUseDays() ||
|
|
|
+ days > bills.getPolFreeBoxUseDays()) {
|
|
|
+ overdueDays = (int) (days - bills.getPolFreeBoxUseDays());
|
|
|
}
|
|
|
- } else if ("2".equals(type)) {
|
|
|
- //目的港超期天数
|
|
|
- if (ObjectUtils.isNotNull(item.getPodEmptyContainerReturnDate()) &&
|
|
|
- ObjectUtils.isNotNull(bills.getEta())) {
|
|
|
- LocalDateTime ldt1 = item.getPodEmptyContainerReturnDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
|
- LocalDateTime ldt2 = bills.getEta().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
|
- long days = ChronoUnit.DAYS.between(ldt1, ldt2);
|
|
|
- if (ObjectUtils.isNull(bills.getPodFreeBoxUseDays()) || 0 == bills.getPodFreeBoxUseDays() ||
|
|
|
- days > bills.getPodFreeBoxUseDays()) {
|
|
|
- overdueDays = (int) (days - bills.getPodFreeBoxUseDays());
|
|
|
+ if (overdueDays != 0) {
|
|
|
+ FeeCenter feeCenter = this.addFeeCenter(tradingBox, item, bills, fees, storageFeesItems, curExrateList, overdueDays, exrateType);
|
|
|
+ if (feeCenter != null) {
|
|
|
+ feeCenterList.add(feeCenter);
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- throw new RuntimeException("业务类型错误,请联系管理员");
|
|
|
}
|
|
|
- if (overdueDays != 0) {
|
|
|
- FeeCenter feeCenter = new FeeCenter();
|
|
|
- feeCenter.setBillType("箱东");
|
|
|
- feeCenter.setCorpId(tradingBox.getPurchaseCompanyId());
|
|
|
- feeCenter.setCorpCnName(tradingBox.getPurchaseCompanyName());
|
|
|
- feeCenter.setCorpEnName(tradingBox.getPurchaseCompanyName());
|
|
|
- feeCenter.setCreateTime(new Date());
|
|
|
- feeCenter.setCreateUser(AuthUtil.getUserId());
|
|
|
- feeCenter.setCreateUserName(AuthUtil.getUserName());
|
|
|
- feeCenter.setPid(item.getPid());
|
|
|
- if ("OW(拿)".equals(tradingBox.getType())) {
|
|
|
- feeCenter.setDc("C");
|
|
|
- } else {
|
|
|
- feeCenter.setDc("D");
|
|
|
- }
|
|
|
- feeCenter.setFeeId(fees.getId());
|
|
|
- feeCenter.setFeeCode(fees.getCode());
|
|
|
- feeCenter.setFeeCnName(fees.getCnName());
|
|
|
- feeCenter.setFeeEnName(fees.getEnName());
|
|
|
- feeCenter.setCurCode(storageFeesItems.get(0).getCurCode());
|
|
|
- feeCenter.setCntrNo(item.getCode());
|
|
|
- feeCenter.setUnitNo(item.getBoxType());
|
|
|
- //计算天数
|
|
|
- int days = overdueDays + 1;
|
|
|
- int earlySumDays = 0;
|
|
|
- String text = "";
|
|
|
- int dayLength;
|
|
|
- BigDecimal amount = new BigDecimal("0.00");
|
|
|
- for (StorageFeesItems term : storageFeesItems) {
|
|
|
- BigDecimal rate;
|
|
|
- //根据箱型获取具体超期单价
|
|
|
- if ("20GP".equals(item.getBoxType())) {
|
|
|
- rate = term.getPrice20gp();
|
|
|
- } else if ("40HC".equals(item.getBoxType())) {
|
|
|
- rate = term.getPrice40hc();
|
|
|
- } else if ("40GP".equals(item.getBoxType())) {
|
|
|
- rate = term.getPrice40gp();
|
|
|
- } else {
|
|
|
- continue;
|
|
|
- }
|
|
|
- dayLength = term.getEndDay() - term.getStartDay() + 1;
|
|
|
- if (earlySumDays >= dayLength) {
|
|
|
- earlySumDays -= dayLength;
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (earlySumDays + days > dayLength) {
|
|
|
- int tempDays = dayLength - earlySumDays;
|
|
|
- earlySumDays = 0;
|
|
|
- days -= tempDays;
|
|
|
- BigDecimal calculate = rate.multiply(new BigDecimal(tempDays + ""));
|
|
|
- amount = amount.add(calculate);
|
|
|
- text = text + tempDays + "天*" + rate + "元=" + calculate + "元,";
|
|
|
- } else {
|
|
|
- BigDecimal calculate = rate.multiply(new BigDecimal(days + ""));
|
|
|
- amount = amount.add(calculate);
|
|
|
- text = text + days + "天*" + rate + "元=" + calculate + "元";
|
|
|
- days = 0;
|
|
|
- break;
|
|
|
- }
|
|
|
+ //目的港超期天数
|
|
|
+ if (ObjectUtils.isNotNull(item.getPodEmptyContainerReturnDate()) &&
|
|
|
+ ObjectUtils.isNotNull(bills.getEta())) {
|
|
|
+ LocalDateTime ldt1 = item.getPodEmptyContainerReturnDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
|
+ LocalDateTime ldt2 = bills.getEta().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
|
+ long days = ChronoUnit.DAYS.between(ldt2, ldt1);
|
|
|
+ //超期天数
|
|
|
+ int overdueDays = 0;
|
|
|
+ if (ObjectUtils.isNull(bills.getPodFreeBoxUseDays()) || 0 == bills.getPodFreeBoxUseDays() ||
|
|
|
+ days > bills.getPodFreeBoxUseDays()) {
|
|
|
+ overdueDays = (int) (days - bills.getPodFreeBoxUseDays());
|
|
|
}
|
|
|
- if (days != 0) {
|
|
|
- if ("20GP".equals(item.getBoxType())) {
|
|
|
- BigDecimal calculate = storageFeesItems.get(storageFeesItems.size() - 1).getPrice20gp().multiply(new BigDecimal(days + ""));
|
|
|
- amount = amount.add(calculate);
|
|
|
- text = text + "超出费用:" + days + "天*" + storageFeesItems.get(storageFeesItems.size() - 1).getPrice20gp() + "元=" + calculate + "元,";
|
|
|
- } else if ("40HC".equals(item.getBoxType())) {
|
|
|
- BigDecimal calculate = storageFeesItems.get(storageFeesItems.size() - 1).getPrice40hc().multiply(new BigDecimal(days + ""));
|
|
|
- amount = amount.add(calculate);
|
|
|
- text = text + "超出费用:" + days + "天*" + storageFeesItems.get(storageFeesItems.size() - 1).getPrice40hc() + "元=" + calculate + "元,";
|
|
|
- } else if ("40GP".equals(item.getBoxType())) {
|
|
|
- BigDecimal calculate = storageFeesItems.get(storageFeesItems.size() - 1).getPrice40gp().multiply(new BigDecimal(days + ""));
|
|
|
- amount = amount.add(calculate);
|
|
|
- text = text + "超出费用:" + days + "天*" + storageFeesItems.get(storageFeesItems.size() - 1).getPrice40gp() + "元=" + calculate + "元,";
|
|
|
- } else {
|
|
|
- continue;
|
|
|
+ if (overdueDays != 0) {
|
|
|
+ FeeCenter feeCenter = this.addFeeCenter(tradingBox, item, bills, fees, storageFeesItems, curExrateList, overdueDays, exrateType);
|
|
|
+ if (feeCenter != null) {
|
|
|
+ feeCenterList.add(feeCenter);
|
|
|
}
|
|
|
}
|
|
|
- if (exrateType.equals(feeCenter.getCurCode())) {
|
|
|
- feeCenter.setExrate(new BigDecimal("1.00"));
|
|
|
- } else {
|
|
|
- feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList, feeCenter.getCurCode(), "1"));
|
|
|
- }
|
|
|
- feeCenter.setAmount(amount);
|
|
|
- feeCenter.setAmountLoc(amount.multiply(feeCenter.getExrate()));
|
|
|
- feeCenter.setPrice(amount);
|
|
|
- feeCenter.setRemarks(text);
|
|
|
- feeCenter.setQuantity(new BigDecimal("1"));
|
|
|
- feeCenter.setOutboundDate(tradingBox.getRentDate());
|
|
|
- feeCenter.setBillNo(tradingBox.getSysNo());
|
|
|
- feeCenter.setBusinessType(tradingBox.getType());
|
|
|
- feeCenter.setBillDate(tradingBox.getPurchaseDate());
|
|
|
- feeCenter.setBillCorpId(tradingBox.getPurchaseCompanyId());
|
|
|
- feeCenter.setBillCorpCnName(tradingBox.getPurchaseCompanyName());
|
|
|
- feeCenter.setBillCorpEnName(tradingBox.getPurchaseCompanyName());
|
|
|
- feeCenter.setBillShortName(tradingBox.getPurchaseCompanyName());
|
|
|
- feeCenter.setMblno(tradingBox.getContainerNumber());
|
|
|
- feeCenter.setPolId(tradingBox.getPolId());
|
|
|
- feeCenter.setPolCode(tradingBox.getPolCode());
|
|
|
- feeCenter.setPolCnName(tradingBox.getPolCname());
|
|
|
- feeCenter.setPolEnName(tradingBox.getPolEname());
|
|
|
- feeCenter.setAutomaticGenerated("1");
|
|
|
- feeCenterList.add(feeCenter);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1707,6 +1612,110 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private FeeCenter addFeeCenter(TradingBox tradingBox, TradingBoxItem item, Bills bills, BFees fees,
|
|
|
+ List<StorageFeesItems> storageFeesItems, List<BCurExrate> curExrateList,
|
|
|
+ int overdueDays, String exrateType) {
|
|
|
+ FeeCenter feeCenter = new FeeCenter();
|
|
|
+ feeCenter.setBillType(bills.getBillType());
|
|
|
+ feeCenter.setCorpType("箱东");
|
|
|
+ feeCenter.setCorpId(tradingBox.getPurchaseCompanyId());
|
|
|
+ feeCenter.setCorpCnName(tradingBox.getPurchaseCompanyName());
|
|
|
+ feeCenter.setCorpEnName(tradingBox.getPurchaseCompanyName());
|
|
|
+ feeCenter.setCreateTime(new Date());
|
|
|
+ feeCenter.setCreateUser(AuthUtil.getUserId());
|
|
|
+ feeCenter.setCreateUserName(AuthUtil.getUserName());
|
|
|
+ feeCenter.setPid(bills.getId());
|
|
|
+ feeCenter.setDc("D");
|
|
|
+ feeCenter.setFeeId(fees.getId());
|
|
|
+ feeCenter.setFeeCode(fees.getCode());
|
|
|
+ feeCenter.setFeeCnName(fees.getCnName());
|
|
|
+ feeCenter.setFeeEnName(fees.getEnName());
|
|
|
+ feeCenter.setCurCode(storageFeesItems.get(0).getCurCode());
|
|
|
+ feeCenter.setCntrNo(item.getCode());
|
|
|
+ feeCenter.setUnitNo(item.getBoxType());
|
|
|
+ //计算天数
|
|
|
+ int days = overdueDays + 1;
|
|
|
+ int earlySumDays = 0;
|
|
|
+ String text = "";
|
|
|
+ int dayLength;
|
|
|
+ BigDecimal amount = new BigDecimal("0.00");
|
|
|
+ for (StorageFeesItems term : storageFeesItems) {
|
|
|
+ BigDecimal rate;
|
|
|
+ //根据箱型获取具体超期单价
|
|
|
+ if ("20GP".equals(item.getBoxType())) {
|
|
|
+ rate = term.getPrice20gp();
|
|
|
+ } else if ("40HC".equals(item.getBoxType())) {
|
|
|
+ rate = term.getPrice40hc();
|
|
|
+ } else if ("40GP".equals(item.getBoxType())) {
|
|
|
+ rate = term.getPrice40gp();
|
|
|
+ } else {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ dayLength = term.getEndDay() - term.getStartDay() + 1;
|
|
|
+ if (earlySumDays >= dayLength) {
|
|
|
+ earlySumDays -= dayLength;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (earlySumDays + days > dayLength) {
|
|
|
+ int tempDays = dayLength - earlySumDays;
|
|
|
+ earlySumDays = 0;
|
|
|
+ days -= tempDays;
|
|
|
+ BigDecimal calculate = rate.multiply(new BigDecimal(tempDays + ""));
|
|
|
+ amount = amount.add(calculate);
|
|
|
+ text = text + tempDays + "天*" + rate + "元=" + calculate + "元,";
|
|
|
+ } else {
|
|
|
+ BigDecimal calculate = rate.multiply(new BigDecimal(days + ""));
|
|
|
+ amount = amount.add(calculate);
|
|
|
+ text = text + days + "天*" + rate + "元=" + calculate + "元";
|
|
|
+ days = 0;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (days != 0) {
|
|
|
+ if ("20GP".equals(item.getBoxType())) {
|
|
|
+ BigDecimal calculate = storageFeesItems.get(storageFeesItems.size() - 1).getPrice20gp().multiply(new BigDecimal(days + ""));
|
|
|
+ amount = amount.add(calculate);
|
|
|
+ text = text + "超出费用:" + days + "天*" + storageFeesItems.get(storageFeesItems.size() - 1).getPrice20gp() + "元=" + calculate + "元,";
|
|
|
+ } else if ("40HC".equals(item.getBoxType())) {
|
|
|
+ BigDecimal calculate = storageFeesItems.get(storageFeesItems.size() - 1).getPrice40hc().multiply(new BigDecimal(days + ""));
|
|
|
+ amount = amount.add(calculate);
|
|
|
+ text = text + "超出费用:" + days + "天*" + storageFeesItems.get(storageFeesItems.size() - 1).getPrice40hc() + "元=" + calculate + "元,";
|
|
|
+ } else if ("40GP".equals(item.getBoxType())) {
|
|
|
+ BigDecimal calculate = storageFeesItems.get(storageFeesItems.size() - 1).getPrice40gp().multiply(new BigDecimal(days + ""));
|
|
|
+ amount = amount.add(calculate);
|
|
|
+ text = text + "超出费用:" + days + "天*" + storageFeesItems.get(storageFeesItems.size() - 1).getPrice40gp() + "元=" + calculate + "元,";
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (exrateType.equals(feeCenter.getCurCode())) {
|
|
|
+ feeCenter.setExrate(new BigDecimal("1.00"));
|
|
|
+ } else {
|
|
|
+ feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList, feeCenter.getCurCode(), "1"));
|
|
|
+ }
|
|
|
+ feeCenter.setAmount(amount);
|
|
|
+ feeCenter.setAmountLoc(amount.multiply(feeCenter.getExrate()));
|
|
|
+ feeCenter.setPrice(amount);
|
|
|
+ feeCenter.setRemarks(text);
|
|
|
+ feeCenter.setQuantity(new BigDecimal("1"));
|
|
|
+ feeCenter.setBillNo(bills.getBillNo());
|
|
|
+ feeCenter.setBusinessType(bills.getBusinessType());
|
|
|
+ feeCenter.setBillDate(bills.getBillDate());
|
|
|
+ feeCenter.setBillCorpId(bills.getCorpId());
|
|
|
+ feeCenter.setBillCorpCnName(bills.getCorpCnName());
|
|
|
+ feeCenter.setBillCorpEnName(bills.getCorpEnName());
|
|
|
+ feeCenter.setBillShortName(bills.getCorpShortName());
|
|
|
+ feeCenter.setMblno(bills.getMblno());
|
|
|
+ feeCenter.setPolId(bills.getPolId());
|
|
|
+ feeCenter.setPolCode(bills.getPolCode());
|
|
|
+ feeCenter.setPolCnName(bills.getPolCnName());
|
|
|
+ feeCenter.setPolEnName(bills.getPolEnName());
|
|
|
+ feeCenter.setAutomaticGenerated("1");
|
|
|
+ feeCenter.setBranchId(bills.getBranchId());
|
|
|
+ feeCenter.setBranchName(bills.getBranchName());
|
|
|
+ return feeCenter;
|
|
|
+ }
|
|
|
+
|
|
|
private Archives updateArchives(Archives archives, GiveAnEncore item, BPorts ports, BCorps corps) {
|
|
|
archives.setUpdateTime(new Date());
|
|
|
archives.setUpdateUser(AuthUtil.getUserId());
|
|
|
@@ -1730,7 +1739,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
List<TradingBoxItem> tradingBoxItemList, BPorts ports, String status) {
|
|
|
PutBox putBoxOld;
|
|
|
if ("1".equals(status)) {
|
|
|
- putBoxOld = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumberOw())).findFirst().orElse(null);
|
|
|
+ putBoxOld = putBoxList.stream().filter(e -> ObjectUtils.isNotNull(e.getSrcContainerNumber()) && e.getSrcContainerNumber().equals(archives.getContainerNumberOw())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
putBoxOld = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumber())
|
|
|
&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(archives.getAddressId())
|
|
|
@@ -1789,7 +1798,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
BCorps corps, List<PutBoxItems> putBoxItemsList, String status) {
|
|
|
PutBox putBoxOld;
|
|
|
if ("1".equals(status)) {
|
|
|
- putBoxOld = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumberOw())).findFirst().orElse(null);
|
|
|
+ putBoxOld = putBoxList.stream().filter(e -> ObjectUtils.isNotNull(e.getSrcContainerNumber()) && e.getSrcContainerNumber().equals(archives.getContainerNumberOw())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
putBoxOld = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumber())
|
|
|
&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(archives.getAddressId())
|
|
|
@@ -1830,9 +1839,10 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
private List<PutBox> create(List<PutBox> putBoxList, Archives archives, BPorts ports, BCorps corps, List<PutBox> putBoxNewList, Long id, String status) {
|
|
|
PutBox putBox;
|
|
|
if ("1".equals(status)) {
|
|
|
- putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumberOw())
|
|
|
+ putBox = putBoxList.stream().filter(e -> ObjectUtils.isNotNull(e.getSrcContainerNumber()) && e.getSrcContainerNumber().equals(archives.getContainerNumberOw())
|
|
|
&& e.getPolId().equals(ports.getId()) && e.getPolStationId().equals(corps.getId())
|
|
|
- && e.getBusType().equals(archives.getContainerNumberTypeOw())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getSrcType()) && e.getSrcType().equals(archives.getContainerNumberTypeOw()))
|
|
|
+ .findFirst().orElse(null);
|
|
|
} else {
|
|
|
putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(archives.getContainerNumber())
|
|
|
&& e.getPolId().equals(ports.getId()) && e.getPolStationId().equals(corps.getId())
|
|
|
@@ -1861,6 +1871,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
}
|
|
|
putBox1.setSysNo((String) clientBillNo.getData());
|
|
|
putBox1.setContainerNumber(archives.getContainerNumber());
|
|
|
+ putBox1.setSrcContainerNumber(archives.getContainerNumberOw());
|
|
|
+ putBox1.setSrcType(archives.getContainerNumberTypeOw());
|
|
|
BusinessBillNo businessBillNo1 = new BusinessBillNo();
|
|
|
businessBillNo1.setBusinessTypeId(id);
|
|
|
businessBillNo1.setCode("FXH-N");
|
|
|
@@ -1909,6 +1921,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
putBox.setBoxBelongsTo("SOC");
|
|
|
putBox.setBoxEastId(archives.getBoxEastId() + "");
|
|
|
putBox.setBoxEastName(archives.getBoxEastName());
|
|
|
+ putBox.setSrcContainerNumber(archives.getContainerNumberOw());
|
|
|
+ putBox.setSrcType(archives.getContainerNumberTypeOw());
|
|
|
BusinessBillNo businessBillNo1 = new BusinessBillNo();
|
|
|
businessBillNo1.setBusinessTypeId(id);
|
|
|
businessBillNo1.setCode("FXH-N");
|
|
|
@@ -2758,8 +2772,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //计算超期箱使费
|
|
|
- this.countOverdueFee(tradingBoxList, tradingBoxItemList, "1");
|
|
|
+ /*//计算超期箱使费
|
|
|
+ this.countOverdueFee(tradingBoxList, tradingBoxItemList);*/
|
|
|
ArchivesFiles archivesFiles = new ArchivesFiles();
|
|
|
archivesFiles.setCreateUser(AuthUtil.getUserId());
|
|
|
archivesFiles.setCreateTime(new Date());
|