|
@@ -30,6 +30,7 @@ import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.los.Util.CurrencyUtils;
|
|
import org.springblade.los.Util.CurrencyUtils;
|
|
|
import org.springblade.los.basic.business.entity.BusinessType;
|
|
import org.springblade.los.basic.business.entity.BusinessType;
|
|
|
import org.springblade.los.basic.business.service.IBusinessTypeService;
|
|
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.cntr.service.IBCntrTypesService;
|
|
|
import org.springblade.los.basic.corps.entity.BCorps;
|
|
import org.springblade.los.basic.corps.entity.BCorps;
|
|
|
import org.springblade.los.basic.corps.service.IBCorpsService;
|
|
import org.springblade.los.basic.corps.service.IBCorpsService;
|
|
@@ -64,7 +65,6 @@ import org.springblade.los.business.sea.mapper.BillsMapper;
|
|
|
import org.springblade.los.business.sea.service.IContainersService;
|
|
import org.springblade.los.business.sea.service.IContainersService;
|
|
|
import org.springblade.los.finance.fee.entity.FeeCenter;
|
|
import org.springblade.los.finance.fee.entity.FeeCenter;
|
|
|
import org.springblade.los.finance.fee.service.IFeeCenterService;
|
|
import org.springblade.los.finance.fee.service.IFeeCenterService;
|
|
|
-import org.springblade.los.ftp.service.CyFtpService;
|
|
|
|
|
import org.springblade.resource.feign.IOssClient;
|
|
import org.springblade.resource.feign.IOssClient;
|
|
|
import org.springblade.system.feign.ISysClient;
|
|
import org.springblade.system.feign.ISysClient;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -131,7 +131,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
|
|
|
|
|
private final IFeeCenterService feeCenterService;
|
|
private final IFeeCenterService feeCenterService;
|
|
|
|
|
|
|
|
- private final CyFtpService cyFtpService;
|
|
|
|
|
|
|
+ private final IBCntrTypesService cntrTypesService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public IPage<BoxDynamicsRecordVO> selectBoxDynamicsRecordPage(IPage<BoxDynamicsRecordVO> page, BoxDynamicsRecordVO boxDynamicsRecord) {
|
|
public IPage<BoxDynamicsRecordVO> selectBoxDynamicsRecordPage(IPage<BoxDynamicsRecordVO> page, BoxDynamicsRecordVO boxDynamicsRecord) {
|
|
@@ -167,6 +167,15 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
.eq(BCorps::getIsDeleted, 0)
|
|
.eq(BCorps::getIsDeleted, 0)
|
|
|
.in(BCorps::getCnName, stationName));
|
|
.in(BCorps::getCnName, stationName));
|
|
|
}
|
|
}
|
|
|
|
|
+ List<String> boxType = excelList.stream().map(EmptyContainerAppearance::getBoxType).filter(Objects::nonNull)
|
|
|
|
|
+ .distinct().collect(Collectors.toList());
|
|
|
|
|
+ List<BCntrTypes> boxTypeList = new ArrayList<>();
|
|
|
|
|
+ if (!portName.isEmpty()) {
|
|
|
|
|
+ boxTypeList = cntrTypesService.list(new LambdaQueryWrapper<BCntrTypes>()
|
|
|
|
|
+ .eq(BCntrTypes::getTenantId, AuthUtil.getTenantId())
|
|
|
|
|
+ .eq(BCntrTypes::getIsDeleted, 0)
|
|
|
|
|
+ .in(BCntrTypes::getCode95, boxType));
|
|
|
|
|
+ }
|
|
|
String blacklist = sysClient.getParamService("box.blacklist");
|
|
String blacklist = sysClient.getParamService("box.blacklist");
|
|
|
if (ObjectUtils.isNotNull(blacklist)) {
|
|
if (ObjectUtils.isNotNull(blacklist)) {
|
|
|
StringBuilder text = new StringBuilder();
|
|
StringBuilder text = new StringBuilder();
|
|
@@ -212,7 +221,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
recordItems.setBranchId(AuthUtil.getDeptId());
|
|
recordItems.setBranchId(AuthUtil.getDeptId());
|
|
|
recordItems.setContainerNumber(item.getContainerNumber());
|
|
recordItems.setContainerNumber(item.getContainerNumber());
|
|
|
recordItems.setBoxCode(item.getBoxCode());
|
|
recordItems.setBoxCode(item.getBoxCode());
|
|
|
- recordItems.setBoxType(item.getBoxType());
|
|
|
|
|
|
|
+ BCntrTypes cntrTypes = boxTypeList.stream().filter(e -> e.getCode95().equals(item.getBoxType())).findFirst().orElse(null);
|
|
|
|
|
+ if (cntrTypes == null) {
|
|
|
|
|
+ throw new RuntimeException("请先维护箱型:" + item.getBoxType() + "基础资料");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ recordItems.setBoxType(cntrTypes.getCnName());
|
|
|
|
|
+ }
|
|
|
BPorts ports = portsList.stream().filter(e -> e.getCnName().equals(item.getPortName())).findFirst().orElse(null);
|
|
BPorts ports = portsList.stream().filter(e -> e.getCnName().equals(item.getPortName())).findFirst().orElse(null);
|
|
|
if (ports == null) {
|
|
if (ports == null) {
|
|
|
throw new RemoteException("请先维护港口:" + item.getPortName() + "基础资料");
|
|
throw new RemoteException("请先维护港口:" + item.getPortName() + "基础资料");
|
|
@@ -267,7 +281,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
throw new SecurityException("数据不能为空");
|
|
throw new SecurityException("数据不能为空");
|
|
|
}
|
|
}
|
|
|
if ("JC".equals(boxDynamicsRecord.getApproachExit())) {
|
|
if ("JC".equals(boxDynamicsRecord.getApproachExit())) {
|
|
|
- List<BoxDynamicsRecordItems> itemsListJC = itemsList.stream().filter(e -> "C".equals(e.getObjective())).collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<BoxDynamicsRecordItems> itemsListJC = itemsList.stream().filter(e -> !e.getObjective().equals("C")).collect(Collectors.toList());
|
|
|
if (!itemsListJC.isEmpty()) {
|
|
if (!itemsListJC.isEmpty()) {
|
|
|
List<String> boxCodeList = itemsListJC.stream().map(BoxDynamicsRecordItems::getBoxCode).filter(Objects::nonNull)
|
|
List<String> boxCodeList = itemsListJC.stream().map(BoxDynamicsRecordItems::getBoxCode).filter(Objects::nonNull)
|
|
|
.distinct().collect(Collectors.toList());
|
|
.distinct().collect(Collectors.toList());
|
|
@@ -714,21 +728,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
if (!tradingBoxItems.isEmpty()) {
|
|
if (!tradingBoxItems.isEmpty()) {
|
|
|
tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
|
|
tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
|
|
|
}
|
|
}
|
|
|
- List<String> fileName = new ArrayList<>();
|
|
|
|
|
- fileName.add(boxDynamicsRecord.getFileName());
|
|
|
|
|
- cyFtpService.ftpFilescopy(itemsListJC.get(0).getStationId(), fileName, "IN");
|
|
|
|
|
}
|
|
}
|
|
|
- List<BoxDynamicsRecordItems> itemsListFC = itemsList.stream().filter(e -> "T".equals(e.getObjective())).collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<BoxDynamicsRecordItems> itemsListFC = itemsList.stream().filter(e -> "C".equals(e.getObjective())).collect(Collectors.toList());
|
|
|
if (!itemsListFC.isEmpty()) {
|
|
if (!itemsListFC.isEmpty()) {
|
|
|
- List<Containers> containersHYJKList = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
|
|
|
- .eq(Containers::getTenantId, AuthUtil.getTenantId())
|
|
|
|
|
- .eq(Containers::getIsDeleted, 0)
|
|
|
|
|
- .in(Containers::getHblno, itemsListFC.stream().map(BoxDynamicsRecordItems::getHblno).collect(Collectors.toList())));
|
|
|
|
|
- if (containersHYJKList.isEmpty()) {
|
|
|
|
|
- throw new RuntimeException("未查到配箱信息");
|
|
|
|
|
- }
|
|
|
|
|
- List<Long> billsIds = containersHYJKList.stream().map(Containers::getPid).distinct().collect(Collectors.toList());
|
|
|
|
|
- List<String> boxNum = containersHYJKList.stream().map(Containers::getCntrNo).filter(Objects::nonNull)
|
|
|
|
|
|
|
+ List<String> boxNum = itemsListFC.stream().map(BoxDynamicsRecordItems::getBoxCode).filter(Objects::nonNull)
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
if (boxNum.isEmpty()) {
|
|
if (boxNum.isEmpty()) {
|
|
|
throw new RuntimeException("所选配箱信息箱号不能为空");
|
|
throw new RuntimeException("所选配箱信息箱号不能为空");
|
|
@@ -767,6 +770,9 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
.eq(PutBoxItems::getIsDeleted, 0)
|
|
.eq(PutBoxItems::getIsDeleted, 0)
|
|
|
.eq(PutBoxItems::getTenantId, AuthUtil.getTenantId())
|
|
.eq(PutBoxItems::getTenantId, AuthUtil.getTenantId())
|
|
|
.in(PutBoxItems::getPid, putBoxIdList));
|
|
.in(PutBoxItems::getPid, putBoxIdList));
|
|
|
|
|
+ if (putBoxItemsList.isEmpty()) {
|
|
|
|
|
+ throw new RuntimeException("未查到放箱号箱明细");
|
|
|
|
|
+ }
|
|
|
List<Long> srcIdList = putBoxList.stream().map(PutBox::getSrcId).collect(Collectors.toList());
|
|
List<Long> srcIdList = putBoxList.stream().map(PutBox::getSrcId).collect(Collectors.toList());
|
|
|
List<TradingBox> tradingBoxList = new ArrayList<>();
|
|
List<TradingBox> tradingBoxList = new ArrayList<>();
|
|
|
if (!srcIdList.isEmpty()) {
|
|
if (!srcIdList.isEmpty()) {
|
|
@@ -795,10 +801,21 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
List<Bills> billsHYJKListFD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
List<Bills> billsHYJKListFD = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
.eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
.eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(Bills::getIsDeleted, 0)
|
|
.eq(Bills::getIsDeleted, 0)
|
|
|
- .in(Bills::getId, billsIds));
|
|
|
|
|
|
|
+ .eq(Bills::getBusinessType, "SI")
|
|
|
|
|
+ .apply("find_in_set(bill_type,'MH,DD')")
|
|
|
|
|
+ .in(Bills::getHblno, putBoxItemsList.stream().map(PutBoxItems::getHblno).distinct().collect(Collectors.toList())));
|
|
|
if (billsHYJKListFD.isEmpty()) {
|
|
if (billsHYJKListFD.isEmpty()) {
|
|
|
throw new RuntimeException("未查到海运进口单据");
|
|
throw new RuntimeException("未查到海运进口单据");
|
|
|
}
|
|
}
|
|
|
|
|
+ List<Containers> containersHYJKList = 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()))
|
|
|
|
|
+ .in(Containers::getCntrNo, itemsListFC.stream().map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.toList()))
|
|
|
|
|
+ );
|
|
|
|
|
+ if (containersHYJKList.isEmpty()) {
|
|
|
|
|
+ throw new RuntimeException("未查到配箱信息");
|
|
|
|
|
+ }
|
|
|
List<Containers> containersListNew = new ArrayList<>();
|
|
List<Containers> containersListNew = new ArrayList<>();
|
|
|
for (Bills billsHYJK : billsHYJKListFD) {
|
|
for (Bills billsHYJK : billsHYJKListFD) {
|
|
|
//目的港生成新放箱号单据
|
|
//目的港生成新放箱号单据
|
|
@@ -1111,9 +1128,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
if (!putBoxItemsOldList.isEmpty()) {
|
|
if (!putBoxItemsOldList.isEmpty()) {
|
|
|
putBoxItemsService.updateBatchById(putBoxItemsOldList);
|
|
putBoxItemsService.updateBatchById(putBoxItemsOldList);
|
|
|
}
|
|
}
|
|
|
- /*if (!tradingBoxItemOldList.isEmpty()) {
|
|
|
|
|
- tradingBoxItemService.updateBatchById(tradingBoxItemOldList);
|
|
|
|
|
- }*/
|
|
|
|
|
if (!archivesArrayList.isEmpty()) {
|
|
if (!archivesArrayList.isEmpty()) {
|
|
|
archivesService.updateBatchById(archivesArrayList);
|
|
archivesService.updateBatchById(archivesArrayList);
|
|
|
}
|
|
}
|
|
@@ -1284,17 +1298,17 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
List<String> containerNumberList = itemsList.stream().map(BoxDynamicsRecordItems::getContainerNumber)
|
|
List<String> containerNumberList = itemsList.stream().map(BoxDynamicsRecordItems::getContainerNumber)
|
|
|
.distinct().collect(Collectors.toList());
|
|
.distinct().collect(Collectors.toList());
|
|
|
|
|
|
|
|
- List<String> mblno = itemsList.stream().map(BoxDynamicsRecordItems::getMblno).filter(Objects::nonNull)
|
|
|
|
|
|
|
+ List<String> hblno = itemsList.stream().map(BoxDynamicsRecordItems::getHblno).filter(Objects::nonNull)
|
|
|
.distinct().collect(Collectors.toList());
|
|
.distinct().collect(Collectors.toList());
|
|
|
List<Containers> containersList = new ArrayList<>();
|
|
List<Containers> containersList = new ArrayList<>();
|
|
|
List<Containers> containersListNew = new ArrayList<>();
|
|
List<Containers> containersListNew = new ArrayList<>();
|
|
|
List<Bills> billsList = new ArrayList<>();
|
|
List<Bills> billsList = new ArrayList<>();
|
|
|
- if (!mblno.isEmpty()) {
|
|
|
|
|
|
|
+ if (!hblno.isEmpty()) {
|
|
|
billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
|
|
|
.eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
.eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(Bills::getIsDeleted, 0)
|
|
.eq(Bills::getIsDeleted, 0)
|
|
|
.eq(Bills::getBusinessType, "SE")
|
|
.eq(Bills::getBusinessType, "SE")
|
|
|
- .in(Bills::getHblno, mblno));
|
|
|
|
|
|
|
+ .in(Bills::getHblno, hblno));
|
|
|
if (!billsList.isEmpty()) {
|
|
if (!billsList.isEmpty()) {
|
|
|
containersList = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
containersList = containersService.list(new LambdaQueryWrapper<Containers>()
|
|
|
.eq(Containers::getTenantId, AuthUtil.getTenantId())
|
|
.eq(Containers::getTenantId, AuthUtil.getTenantId())
|
|
@@ -1354,7 +1368,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
List<TradingBox> tradingBoxes = new ArrayList<>();
|
|
List<TradingBox> tradingBoxes = new ArrayList<>();
|
|
|
for (BoxDynamicsRecordItems item : itemsList) {
|
|
for (BoxDynamicsRecordItems item : itemsList) {
|
|
|
PutBox putBoxData;
|
|
PutBox putBoxData;
|
|
|
- PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getMblno())
|
|
|
|
|
|
|
+ PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getHblno())
|
|
|
&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(item.getPortId())
|
|
&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(item.getPortId())
|
|
|
&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(item.getStationId())).findFirst().orElse(null);
|
|
&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(item.getStationId())).findFirst().orElse(null);
|
|
|
if (putBox != null) {
|
|
if (putBox != null) {
|
|
@@ -1436,7 +1450,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
}
|
|
}
|
|
|
Bills bills = null;
|
|
Bills bills = null;
|
|
|
if (!containersList.isEmpty()) {
|
|
if (!containersList.isEmpty()) {
|
|
|
- List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getHblno())
|
|
|
|
|
|
|
+ List<Containers> containerItemList = containersList.stream().filter(e -> item.getHblno().equals(e.getHblno())
|
|
|
&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
|
|
&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
|
|
|
if (!containerItemList.isEmpty()) {
|
|
if (!containerItemList.isEmpty()) {
|
|
|
List<Long> billsIds = containerItemList.stream().map(Containers::getPid).distinct().collect(Collectors.toList());
|
|
List<Long> billsIds = containerItemList.stream().map(Containers::getPid).distinct().collect(Collectors.toList());
|
|
@@ -1688,9 +1702,9 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
} else {
|
|
} else {
|
|
|
throw new RuntimeException("未查到放箱号:" + item.getContainerNumber() + "单据");
|
|
throw new RuntimeException("未查到放箱号:" + item.getContainerNumber() + "单据");
|
|
|
}
|
|
}
|
|
|
- if (!"OW(放)".equals(putBoxData.getBusType()) && ObjectUtils.isNotNull(item.getMblno())) {
|
|
|
|
|
|
|
+ if (!"OW(放)".equals(putBoxData.getBusType()) && ObjectUtils.isNotNull(item.getHblno())) {
|
|
|
if (!containersList.isEmpty()) {
|
|
if (!containersList.isEmpty()) {
|
|
|
- List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getHblno())
|
|
|
|
|
|
|
+ List<Containers> containerItemList = containersList.stream().filter(e -> item.getHblno().equals(e.getHblno())
|
|
|
&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
|
|
&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
|
|
|
for (Containers containers : containerItemList) {
|
|
for (Containers containers : containerItemList) {
|
|
|
containers.setPolCyId(item.getStationId());
|
|
containers.setPolCyId(item.getStationId());
|
|
@@ -1884,11 +1898,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
|
|
tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
|
|
|
}
|
|
}
|
|
|
this.countOverdueFee(putBoxList, tradingBoxList, tradingBoxItems, containersListNew, putBoxItems);
|
|
this.countOverdueFee(putBoxList, tradingBoxList, tradingBoxItems, containersListNew, putBoxItems);
|
|
|
- if ("edi".equals(boxDynamicsRecord.getFileType())) {
|
|
|
|
|
- List<String> fileName = new ArrayList<>();
|
|
|
|
|
- fileName.add(boxDynamicsRecord.getFileName());
|
|
|
|
|
- cyFtpService.ftpFilescopy(itemsList.get(0).getStationId(), fileName, "OUT");
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
for (BoxDynamicsRecordItems item : itemsList) {
|
|
for (BoxDynamicsRecordItems item : itemsList) {
|
|
|
item.setWhetherSynchronous("1");
|
|
item.setWhetherSynchronous("1");
|
|
@@ -1897,9 +1906,8 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
|
|
|
return R.success("操作成功");
|
|
return R.success("操作成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void countOverdueFee
|
|
|
|
|
- (List<PutBox> putBoxList, List<TradingBox> tradingBoxList, List<TradingBoxItem> tradingBoxItemOldList,
|
|
|
|
|
- List<Containers> containersListNew, List<PutBoxItems> putBoxItems) {
|
|
|
|
|
|
|
+ private void countOverdueFee(List<PutBox> putBoxList, List<TradingBox> tradingBoxList, List<TradingBoxItem> tradingBoxItemOldList,
|
|
|
|
|
+ List<Containers> containersListNew, List<PutBoxItems> putBoxItems) {
|
|
|
List<FeeCenter> feeCenterList = new ArrayList<>();
|
|
List<FeeCenter> feeCenterList = new ArrayList<>();
|
|
|
List<PutBoxItems> putBoxItemsList = new ArrayList<>();
|
|
List<PutBoxItems> putBoxItemsList = new ArrayList<>();
|
|
|
List<TradingBoxItem> tradingBoxItemList = new ArrayList<>();
|
|
List<TradingBoxItem> tradingBoxItemList = new ArrayList<>();
|