|
|
@@ -679,6 +679,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
.eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(Bills::getIsDeleted, 0)
|
|
|
+ .eq(Bills::getBusinessType, "SE")
|
|
|
.in(Bills::getMblno, mblno));
|
|
|
if (!billsList.isEmpty()) {
|
|
|
containersList = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
|
@@ -841,8 +842,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
//放箱号明细数据处理
|
|
|
PutBoxItems putBoxItem;
|
|
|
if (!putBoxItemsList.isEmpty()) {
|
|
|
- putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()))
|
|
|
- .findFirst().orElse(null);
|
|
|
+ putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()) &&
|
|
|
+ e.getPid().equals(putBoxData.getId())).findFirst().orElse(null);
|
|
|
if (putBoxItem != null) {
|
|
|
putBoxItem.setPid(putBoxData.getId());
|
|
|
putBoxItem.setMblno(item.getMblno());
|
|
|
@@ -1026,7 +1027,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
PutBox putBox1 = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getMblno())
|
|
|
&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(ports.getId())
|
|
|
&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(corps.getId()) &&
|
|
|
- "OW(放)".equals(e.getBusType())).findFirst().orElse(null);
|
|
|
+ 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.getMblno())
|
|
|
@@ -1092,8 +1093,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
|
|
|
Comparator.comparing(f -> f.getContainerNumber() + f.getCntrNo()))), ArrayList::new));
|
|
|
if (!containers.isEmpty()) {
|
|
|
- long size = containers.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()) &&
|
|
|
- boxList.contains(e.getCntrNo())).count();
|
|
|
+ long size = containers.stream().filter(e -> ObjectUtils.isNotNull(e.getContainerNumber()) &&
|
|
|
+ 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() + "剩余操作占用小于本次导入箱数");
|
|
|
@@ -1135,8 +1136,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
if (!putBoxListOld.isEmpty()) {
|
|
|
List<PutBox> putBoxListNew = new ArrayList<>();
|
|
|
for (PutBox item : putBoxListOld) {
|
|
|
- if ("OW(放)".equals(item.getBusType()) && ObjectUtils.isNotNull(item.getSrcId())) {
|
|
|
- PutBox putBox = putBoxList.stream().filter(e -> e.getId().equals(item.getSrcId()) &&
|
|
|
+ if ("OW(放)".equals(item.getBusType()) && ObjectUtils.isNotNull(item.getSrcContainerNumber())) {
|
|
|
+ PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getSrcContainerNumber()) &&
|
|
|
!"OW(放)".equals(e.getBusType())).findFirst().orElse(null);
|
|
|
if (putBox != null) {
|
|
|
item.setThisSuitcaseNum(ObjectUtils.isNull(item.getThisSuitcaseNum()) ? 0 : item.getThisSuitcaseNum());
|
|
|
@@ -1620,12 +1621,22 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
if (ObjectUtils.isNull(overdueProportion) || "获取数据失败".equals(overdueProportion)) {
|
|
|
throw new RuntimeException("超期箱使费比例");
|
|
|
}
|
|
|
+ BCorps bCorps = bCorpsService.getOne(new LambdaQueryWrapper<BCorps>()
|
|
|
+ .eq(BCorps::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(BCorps::getIsDeleted, 0)
|
|
|
+ .eq(BCorps::getCode, "ZBYF"));
|
|
|
+ if (bCorps == null) {
|
|
|
+ throw new RuntimeException("基础资料未查到编码为‘ZBYF’往来单位");
|
|
|
+ }
|
|
|
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单据");
|
|
|
}
|
|
|
+ if ("OW-F".equals(tradingBox.getType())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
//查找OW明细提单号对应海运进出口单据
|
|
|
Bills bills = billsList.stream().filter(e -> e.getMblno().equals(item.getMblno())).findFirst().orElse(null);
|
|
|
if (bills == null) {
|
|
|
@@ -1670,7 +1681,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
FeeCenter feeCenterC = new FeeCenter();
|
|
|
BeanUtil.copyProperties(feeCenter, feeCenterC);
|
|
|
feeCenterC.setDc("C");
|
|
|
- feeCenterC.setPrice(feeCenterC.getPrice().multiply(new BigDecimal(overdueProportion)).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ feeCenter.setCorpType("国内直接客户");
|
|
|
+ feeCenter.setCorpId(bCorps.getId());
|
|
|
+ feeCenter.setCorpCnName(bCorps.getCnName());
|
|
|
+ feeCenter.setCorpEnName(bCorps.getEnName());
|
|
|
+ feeCenter.setShortName(bCorps.getShortName());
|
|
|
+ feeCenterC.setPrice(feeCenterC.getPrice().multiply(new BigDecimal(overdueProportion))
|
|
|
+ .divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP));
|
|
|
feeCenterC.setAmount(feeCenterC.getQuantity().multiply(feeCenterC.getPrice()));
|
|
|
feeCenterC.setAmountLoc(feeCenterC.getAmount().multiply(feeCenter.getExrate()));
|
|
|
feeCenterList.add(feeCenterC);
|
|
|
@@ -1710,10 +1727,11 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
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.setCorpType("国内同行及代理");
|
|
|
+ feeCenter.setCorpId(bills.getCorpId());
|
|
|
+ feeCenter.setCorpCnName(bills.getCorpCnName());
|
|
|
+ feeCenter.setCorpEnName(bills.getCorpEnName());
|
|
|
+ feeCenter.setShortName(bills.getShortName());
|
|
|
feeCenter.setCreateTime(new Date());
|
|
|
feeCenter.setCreateUser(AuthUtil.getUserId());
|
|
|
feeCenter.setCreateUserName(AuthUtil.getUserName());
|
|
|
@@ -2914,7 +2932,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
if (containersHYJKList.isEmpty()) {
|
|
|
throw new RuntimeException("未查到配箱信息");
|
|
|
}
|
|
|
- if ("HYJK".equals(podStationR.getBusinessType())) {
|
|
|
+ if ("SI".equals(podStationR.getBusinessType())) {
|
|
|
List<String> boxNum = containersHYJKList.stream().map(Containers::getCntrNo).filter(Objects::nonNull)
|
|
|
.collect(Collectors.toList());
|
|
|
if (boxNum.isEmpty()) {
|
|
|
@@ -2979,28 +2997,28 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
if (businessType == null) {
|
|
|
throw new RuntimeException("未找到可用业务类型");
|
|
|
}
|
|
|
- List<Bills> billsHYJKList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
+ List<Bills> billsHYJKListFD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
.eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(Bills::getIsDeleted, 0)
|
|
|
.in(Bills::getId, billsIds));
|
|
|
- if (billsHYJKList.isEmpty()) {
|
|
|
+ if (billsHYJKListFD.isEmpty()) {
|
|
|
throw new RuntimeException("未查到海运进口单据");
|
|
|
}
|
|
|
List<Long> idHYJKList = new ArrayList<>();
|
|
|
- List<Bills> billsHYJKListFD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
+ List<Bills> billsHYJKListZD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
.eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(Bills::getIsDeleted, 0)
|
|
|
- .in(Bills::getMasterId, billsIds));
|
|
|
- if (!billsHYJKListFD.isEmpty()) {
|
|
|
+ .in(Bills::getMasterId, billsHYJKListFD.stream().map(Bills::getMasterId).collect(Collectors.toList())));
|
|
|
+ if (!billsHYJKListZD.isEmpty()) {
|
|
|
idHYJKList.addAll(billsHYJKListFD.stream().map(Bills::getId).collect(Collectors.toList()));
|
|
|
}
|
|
|
- List<Containers> containersHYJKListFD = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
|
+ List<Containers> containersHYJKListZD = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
|
.eq(Containers::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(Containers::getIsDeleted, 0)
|
|
|
.in(Containers::getPid, idHYJKList)
|
|
|
.in(Containers::getCntrNo, boxNum));
|
|
|
List<Containers> containersListNew = new ArrayList<>();
|
|
|
- for (Bills billsHYJK : billsHYJKList){
|
|
|
+ for (Bills billsHYJK : billsHYJKListFD){
|
|
|
//目的港生成新放箱号单据
|
|
|
List<PutBox> putBoxNewList = new ArrayList<>();
|
|
|
//目的港生成新放箱号单据明细数据
|
|
|
@@ -3025,8 +3043,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
containersListNew.add(item);
|
|
|
//进口分单配箱信息处理
|
|
|
- if (!containersHYJKListFD.isEmpty()) {
|
|
|
- Containers containers = containersHYJKListFD.stream().filter(e -> e.getCntrNo().equals(item.getCntrNo()))
|
|
|
+ if (!containersHYJKListZD.isEmpty()) {
|
|
|
+ Containers containers = containersHYJKListZD.stream().filter(e -> e.getCntrNo().equals(item.getCntrNo()))
|
|
|
.findFirst().orElse(null);
|
|
|
if (containers != null) {
|
|
|
containers.setPodStationId(podStationR.getPodStationId());
|
|
|
@@ -3456,6 +3474,36 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
}
|
|
|
containersService.updateBatchById(containersHYJKList);
|
|
|
+ List<Bills> billsHYJKList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
+ .eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(Bills::getIsDeleted, 0)
|
|
|
+ .in(Bills::getId, billsIds));
|
|
|
+ if (billsHYJKList.isEmpty()) {
|
|
|
+ throw new RuntimeException("未查到海运出口单据");
|
|
|
+ }
|
|
|
+ List<Long> idHYJKList = billsHYJKList.stream().map(Bills::getMasterId).distinct().collect(Collectors.toList());
|
|
|
+ List<Bills> billsHYJKListFD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
+ .eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(Bills::getIsDeleted, 0)
|
|
|
+ .in(Bills::getId, idHYJKList));
|
|
|
+ if (!billsHYJKListFD.isEmpty()) {
|
|
|
+ List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
|
+ .eq(Containers::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(Containers::getIsDeleted, 0)
|
|
|
+ .in(Containers::getPid, billsHYJKListFD.stream().map(Bills::getId).collect(Collectors.toList())));
|
|
|
+ if (!containersList.isEmpty()) {
|
|
|
+ for (Containers item : containersList) {
|
|
|
+ item.setPodStationId(podStationR.getPodStationId());
|
|
|
+ item.setPodStationCname(podStationR.getPodStationCname());
|
|
|
+ item.setPodStationEname(podStationR.getPodStationEname());
|
|
|
+ item.setPodStationCode(podStationR.getPodStationCode());
|
|
|
+ item.setUpdateTime(new Date());
|
|
|
+ item.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ }
|
|
|
+ containersService.updateBatchById(containersList);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return R.data("操作成功");
|
|
|
}
|
|
|
@@ -5019,6 +5067,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
if (ObjectUtils.isNull(overdueProportion) || "获取数据失败".equals(overdueProportion)) {
|
|
|
throw new RuntimeException("超期箱使费比例");
|
|
|
}
|
|
|
+ BCorps bCorps = bCorpsService.getOne(new LambdaQueryWrapper<BCorps>()
|
|
|
+ .eq(BCorps::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(BCorps::getIsDeleted, 0)
|
|
|
+ .eq(BCorps::getCode, "ZBYF"));
|
|
|
+ if (bCorps == null) {
|
|
|
+ throw new RuntimeException("基础资料未查到编码为‘ZBYF’往来单位");
|
|
|
+ }
|
|
|
for (TradingBoxItem item : tradingBoxItemOldList) {
|
|
|
//查找OW明细对应主表
|
|
|
TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
|
|
|
@@ -5059,7 +5114,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
|
|
|
FeeCenter feeCenterC = new FeeCenter();
|
|
|
BeanUtil.copyProperties(feeCenter, feeCenterC);
|
|
|
feeCenterC.setDc("C");
|
|
|
- feeCenterC.setPrice(feeCenterC.getPrice().multiply(new BigDecimal(overdueProportion)).setScale(2, RoundingMode.HALF_UP));
|
|
|
+ feeCenterC.setCorpType("国内直接客户");
|
|
|
+ feeCenterC.setCorpId(bCorps.getId());
|
|
|
+ feeCenterC.setCorpCnName(bCorps.getCnName());
|
|
|
+ feeCenterC.setCorpEnName(bCorps.getEnName());
|
|
|
+ feeCenterC.setShortName(bCorps.getShortName());
|
|
|
+ feeCenterC.setPrice(feeCenterC.getPrice().multiply(new BigDecimal(overdueProportion))
|
|
|
+ .divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP));
|
|
|
feeCenterC.setAmount(feeCenterC.getQuantity().multiply(feeCenterC.getPrice()));
|
|
|
feeCenterC.setAmountLoc(feeCenterC.getAmount().multiply(feeCenter.getExrate()));
|
|
|
feeCenterList.add(feeCenterC);
|