|
|
@@ -27,14 +27,22 @@ import org.springblade.core.oss.model.BladeFile;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
+import org.springblade.los.Util.CurrencyUtils;
|
|
|
import org.springblade.los.basic.business.entity.BusinessType;
|
|
|
import org.springblade.los.basic.business.service.IBusinessTypeService;
|
|
|
import org.springblade.los.basic.cntr.entity.BCntrTypes;
|
|
|
import org.springblade.los.basic.cntr.service.IBCntrTypesService;
|
|
|
import org.springblade.los.basic.corps.entity.BCorps;
|
|
|
import org.springblade.los.basic.corps.service.IBCorpsService;
|
|
|
+import org.springblade.los.basic.cur.entity.BCurExrate;
|
|
|
+import org.springblade.los.basic.fees.entity.BFees;
|
|
|
+import org.springblade.los.basic.fees.service.IBFeesService;
|
|
|
import org.springblade.los.basic.ports.entity.BPorts;
|
|
|
import org.springblade.los.basic.ports.service.IBPortsService;
|
|
|
+import org.springblade.los.basic.storage.entity.StorageFees;
|
|
|
+import org.springblade.los.basic.storage.entity.StorageFeesItems;
|
|
|
+import org.springblade.los.basic.storage.service.IStorageFeesItemsService;
|
|
|
+import org.springblade.los.basic.storage.service.IStorageFeesService;
|
|
|
import org.springblade.los.billno.entity.BusinessBillNo;
|
|
|
import org.springblade.los.billno.service.IBusinessBillNoService;
|
|
|
import org.springblade.los.box.dto.BoxPoolContainerNumberDTO;
|
|
|
@@ -52,9 +60,10 @@ import org.springblade.los.box.vo.PutBoxVO;
|
|
|
import org.springblade.los.business.sea.entity.Bills;
|
|
|
import org.springblade.los.business.sea.entity.Containers;
|
|
|
import org.springblade.los.business.sea.mapper.BillsMapper;
|
|
|
-import org.springblade.los.business.sea.service.IBillsService;
|
|
|
import org.springblade.los.business.sea.service.IContainersService;
|
|
|
import org.springblade.los.excel.RouteCostProfitExcel;
|
|
|
+import org.springblade.los.finance.fee.entity.FeeCenter;
|
|
|
+import org.springblade.los.finance.fee.service.IFeeCenterService;
|
|
|
import org.springblade.resource.feign.IOssClient;
|
|
|
import org.springblade.system.feign.ISysClient;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -62,7 +71,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.rmi.RemoteException;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.ZoneId;
|
|
|
+import java.time.temporal.ChronoUnit;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -107,6 +120,16 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
|
|
|
private final IContainersService containersService;
|
|
|
|
|
|
+ private final IStorageFeesService storageFeesService;
|
|
|
+
|
|
|
+ private final IStorageFeesItemsService storageFeesItemsService;
|
|
|
+
|
|
|
+ private final IBFeesService bFeesService;
|
|
|
+
|
|
|
+ private final CurrencyUtils currencyUtils;
|
|
|
+
|
|
|
+ private final IFeeCenterService feeCenterService;
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<PutBoxVO> selectPutBoxPage(IPage<PutBoxVO> page, PutBoxVO putBox) {
|
|
|
return null;
|
|
|
@@ -716,6 +739,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
List<PutBox> putBoxes = new ArrayList<>();
|
|
|
List<TradingBox> tradingBoxes = new ArrayList<>();
|
|
|
for (EmptyContainerAppearance item : excelList) {
|
|
|
+ if (ObjectUtils.isNull(item.getBoxStatusDate())) {
|
|
|
+ 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() + "基础资料");
|
|
|
@@ -1065,7 +1091,6 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
archivesTrajectory.setBoxEastName(item.getBoxEastName());
|
|
|
archivesTrajectory.setMblno(item.getMblno());
|
|
|
archivesTrajectory.setBoxDynamics("空箱出场");
|
|
|
- archivesTrajectory.setNewDate(tradingBox.getRentDate());
|
|
|
if ("OW-N".equals(tradingBox.getType())) {
|
|
|
archivesTrajectory.setStatus("OW-拿");
|
|
|
} else if ("OW-F".equals(tradingBox.getType())) {
|
|
|
@@ -1230,6 +1255,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
throw new RuntimeException("未找到可用业务类型");
|
|
|
}
|
|
|
for (GiveAnEncore item : excelList) {
|
|
|
+ if (ObjectUtils.isNull(item.getBoxStatusDate())) {
|
|
|
+ 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() + "基础资料");
|
|
|
@@ -1243,7 +1271,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
if (archives == null) {
|
|
|
throw new RemoteException("箱号:" + item.getBoxCode() + "未查到数据");
|
|
|
}
|
|
|
- if (!archives.getBoxType().equals(item.getBoxType())) {
|
|
|
+ if (!archives.getTypeName().equals(item.getBoxType())) {
|
|
|
throw new RemoteException("箱号:" + item.getBoxCode() + "与箱档案中箱型不符");
|
|
|
}
|
|
|
if (ObjectUtils.isNotNull(archives.getContainerNumberTypeOw()) && "OW(放)".equals(archives.getContainerNumberTypeOw())) {
|
|
|
@@ -1445,6 +1473,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
if (!tradingBoxItemOldList.isEmpty()) {
|
|
|
tradingBoxItemService.updateBatchById(tradingBoxItemOldList);
|
|
|
}
|
|
|
+ //计算超期箱使费
|
|
|
+ this.countOverdueFee(tradingBoxList, tradingBoxItemOldList, "2");
|
|
|
ArchivesFiles archivesFiles = new ArchivesFiles();
|
|
|
archivesFiles.setCreateUser(AuthUtil.getUserId());
|
|
|
archivesFiles.setCreateTime(new Date());
|
|
|
@@ -1461,6 +1491,222 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
return R.data("操作成功");
|
|
|
}
|
|
|
|
|
|
+ private void countOverdueFee(List<TradingBox> tradingBoxList, List<TradingBoxItem> tradingBoxItemOldList,
|
|
|
+ String type) {
|
|
|
+ List<FeeCenter> feeCenterList = new ArrayList<>();
|
|
|
+ List<String> mblnoList = tradingBoxItemOldList.stream().map(TradingBoxItem::getMblno).collect(Collectors.toList());
|
|
|
+ if (!mblnoList.isEmpty()) {
|
|
|
+ //海运进出口单据
|
|
|
+ List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
+ .eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(Bills::getIsDeleted, 0)
|
|
|
+ .in(Bills::getMblno, mblnoList)
|
|
|
+ .apply("find_in_set(bill_type,'DD,MH')")
|
|
|
+ );
|
|
|
+ if (billsList.isEmpty()) {
|
|
|
+ throw new RuntimeException("未查到对应提单号海运进出口单据");
|
|
|
+ }
|
|
|
+ List<String> branchIdList = billsList.stream().map(Bills::getBranchId).distinct().collect(Collectors.toList());
|
|
|
+ //超期标准
|
|
|
+ List<StorageFees> storageFeesList = storageFeesService.list(new LambdaQueryWrapper<StorageFees>()
|
|
|
+ .eq(StorageFees::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(StorageFees::getIsDeleted, 0)
|
|
|
+ .in(StorageFees::getBranchId, branchIdList));
|
|
|
+ if (storageFeesList.isEmpty()) {
|
|
|
+ throw new RuntimeException("请先维护基础资料-超期标准");
|
|
|
+ }
|
|
|
+ List<Long> idList = storageFeesList.stream().map(StorageFees::getId).collect(Collectors.toList());
|
|
|
+ //超期标准明细
|
|
|
+ List<StorageFeesItems> storageFeesItemsList = storageFeesItemsService.list(new LambdaQueryWrapper<StorageFeesItems>()
|
|
|
+ .eq(StorageFeesItems::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(StorageFeesItems::getIsDeleted, 0)
|
|
|
+ .in(StorageFeesItems::getPid, idList));
|
|
|
+ if (storageFeesItemsList.isEmpty()) {
|
|
|
+ throw new RuntimeException("请先维护基础资料-超期标准");
|
|
|
+ }
|
|
|
+ //超期箱使费
|
|
|
+ BFees fees = bFeesService.getOne(new LambdaQueryWrapper<BFees>()
|
|
|
+ .eq(BFees::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(BFees::getIsDeleted, 0)
|
|
|
+ .eq(BFees::getCode, "CQXSF"));
|
|
|
+ if (fees == null) {
|
|
|
+ throw new RuntimeException("请先维护费用基础信息");
|
|
|
+ }
|
|
|
+ for (TradingBoxItem item : tradingBoxItemOldList) {
|
|
|
+ //查找OW明细对应主表
|
|
|
+ TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
|
|
|
+ if (tradingBox == null) {
|
|
|
+ throw new RuntimeException("未查到OW单据");
|
|
|
+ }
|
|
|
+ //查找OW明细提单号对应海运进出口单据
|
|
|
+ Bills bills = billsList.stream().filter(e -> e.getMblno().equals(item.getMblno())).findFirst().orElse(null);
|
|
|
+ if (bills == null) {
|
|
|
+ throw new RuntimeException("未查到提单号:" + item.getMblno() + "海运进出口单据");
|
|
|
+ }
|
|
|
+ //对应海运进出口单据所属公司本位币
|
|
|
+ String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
|
|
|
+ //对应海运进出口单据所属公司所有币别
|
|
|
+ List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", bills.getBranchId());
|
|
|
+ //所属公司具体超期标准
|
|
|
+ StorageFees storageFees = new StorageFees();
|
|
|
+ if ("SE".equals(bills.getBusinessType())) {
|
|
|
+ storageFees = storageFeesList.stream().filter(e -> e.getBranchId().equals(bills.getBranchId()) &&
|
|
|
+ "出口超期箱".equals(e.getType())).findFirst().orElse(null);
|
|
|
+ } else if ("SI".equals(bills.getBusinessType())) {
|
|
|
+ storageFees = storageFeesList.stream().filter(e -> e.getBranchId().equals(bills.getBranchId()) &&
|
|
|
+ "进口超期箱".equals(e.getType())).findFirst().orElse(null);
|
|
|
+ } else {
|
|
|
+ storageFees = storageFeesList.stream().filter(e -> e.getBranchId().equals(bills.getBranchId()) &&
|
|
|
+ "退关、无货返空箱".equals(e.getType())).findFirst().orElse(null);
|
|
|
+ }
|
|
|
+ if (storageFees == null) {
|
|
|
+ throw new RuntimeException("请先维护基础资料-超期标准");
|
|
|
+ }
|
|
|
+ StorageFees finalStorageFees = storageFees;
|
|
|
+ //所属公司具体超期标准明细
|
|
|
+ List<StorageFeesItems> storageFeesItems = storageFeesItemsList.stream().filter(e -> e.getPid().equals(finalStorageFees.getId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ 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());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } 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());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } 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 (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 (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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!feeCenterList.isEmpty()) {
|
|
|
+ feeCenterService.saveBatch(feeCenterList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private Archives updateArchives(Archives archives, GiveAnEncore item, BPorts ports, BCorps corps) {
|
|
|
archives.setUpdateTime(new Date());
|
|
|
archives.setUpdateUser(AuthUtil.getUserId());
|
|
|
@@ -1812,6 +2058,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
throw new RuntimeException("未找到可用业务类型");
|
|
|
}
|
|
|
for (GiveAnEncore item : excelList) {
|
|
|
+ if (ObjectUtils.isNull(item.getBoxStatusDate())) {
|
|
|
+ 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() + "基础资料");
|
|
|
@@ -2012,14 +2261,14 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
archivesService.removeByIds(archivesDateleList);
|
|
|
}
|
|
|
if (!putBoxItemsOldList.isEmpty()) {
|
|
|
- for (PutBoxItems item : putBoxItemsOldList){
|
|
|
+ for (PutBoxItems item : putBoxItemsOldList) {
|
|
|
item.setPolReturnDate(item.getPodEmptyContainerReturnDate());
|
|
|
item.setPodEmptyContainerReturnDate(null);
|
|
|
}
|
|
|
putBoxItemsService.updateBatchById(putBoxItemsOldList);
|
|
|
}
|
|
|
if (!tradingBoxItemOldList.isEmpty()) {
|
|
|
- for (TradingBoxItem item : tradingBoxItemOldList){
|
|
|
+ for (TradingBoxItem item : tradingBoxItemOldList) {
|
|
|
item.setPolReturnDate(item.getPodEmptyContainerReturnDate());
|
|
|
item.setPodEmptyContainerReturnDate(null);
|
|
|
}
|
|
|
@@ -2150,6 +2399,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
List<PutBox> putBoxes = new ArrayList<>();
|
|
|
List<TradingBox> tradingBoxes = new ArrayList<>();
|
|
|
for (EmptyContainerAppearance item : excelList) {
|
|
|
+ if (ObjectUtils.isNull(item.getBoxStatusDate())) {
|
|
|
+ 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() + "基础资料");
|
|
|
@@ -2485,7 +2737,6 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
archivesTrajectory.setBoxEastName(item.getBoxEastName());
|
|
|
archivesTrajectory.setMblno(item.getMblno());
|
|
|
archivesTrajectory.setBoxDynamics("空箱提箱进场");
|
|
|
- archivesTrajectory.setNewDate(tradingBox.getRentDate());
|
|
|
if ("OW-N".equals(tradingBox.getType())) {
|
|
|
archivesTrajectory.setStatus("OW-拿");
|
|
|
} else if ("OW-F".equals(tradingBox.getType())) {
|
|
|
@@ -2507,6 +2758,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //计算超期箱使费
|
|
|
+ this.countOverdueFee(tradingBoxList, tradingBoxItemList, "1");
|
|
|
ArchivesFiles archivesFiles = new ArchivesFiles();
|
|
|
archivesFiles.setCreateUser(AuthUtil.getUserId());
|
|
|
archivesFiles.setCreateTime(new Date());
|