Browse Source

1.集装箱生成放箱号增加字段判断是否系统自动生成
2.箱池动态导入接口增加手动创建放箱号重新计算箱量逻辑
3.海运进出口客户查询增加编码查询

纪新园 5 months ago
parent
commit
bc96fcfcf9

+ 6 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/PutBox.java

@@ -365,6 +365,12 @@ public class PutBox implements Serializable {
 	private String priorityLevel;
 	private String priorityLevel;
 
 
 	/**
 	/**
+	 * 是否手动创建  0手动 1系统
+	 */
+	@ApiModelProperty(value = "是否手动创建")
+	private String whetherManuallyCreate;
+
+	/**
 	 * 明细
 	 * 明细
 	 */
 	 */
 	@TableField(exist = false)
 	@TableField(exist = false)

+ 38 - 30
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -220,6 +220,9 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			putBox.setCreateUser(AuthUtil.getUserId());
 			putBox.setCreateUser(AuthUtil.getUserId());
 			putBox.setCreateUserName(AuthUtil.getUserName());
 			putBox.setCreateUserName(AuthUtil.getUserName());
 			putBox.setTenantId(AuthUtil.getTenantId());
 			putBox.setTenantId(AuthUtil.getTenantId());
+			putBox.setWhetherManuallyCreate("0");
+			putBox.setBusType("自有箱");
+			putBox.setBoxClass("自有箱");
 			baseMapper.insert(putBox);
 			baseMapper.insert(putBox);
 		} else {
 		} else {
 			if (putBoxList.stream().anyMatch(e -> !e.getId().equals(putBox.getId()) && e.getPolId().equals(putBox.getPolId())
 			if (putBoxList.stream().anyMatch(e -> !e.getId().equals(putBox.getId()) && e.getPolId().equals(putBox.getPolId())
@@ -623,7 +626,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (CollectionUtils.isEmpty(excelList)) {
 		if (CollectionUtils.isEmpty(excelList)) {
 			throw new SecurityException("数据不能为空");
 			throw new SecurityException("数据不能为空");
 		}
 		}
-		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearanceAnalysis::getBoxCode)
+		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearanceAnalysis::getBoxCode).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 			.distinct().collect(Collectors.toList());
 		//箱档案数据
 		//箱档案数据
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
@@ -1076,11 +1079,11 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				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.getMblno())) {
-				PutBox putBox1 = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getMblno())
+				/*PutBox putBox1 = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getMblno())
 					&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(ports.getId())
 					&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(ports.getId())
 					&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(corps.getId()) &&
 					&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(corps.getId()) &&
 					putBoxData.getBusType().equals(e.getBusType())).findFirst().orElse(null);
 					putBoxData.getBusType().equals(e.getBusType())).findFirst().orElse(null);
-				if (putBox1 != null) {
+				if (putBox1 != null) {*/
 					if (!containersList.isEmpty()) {
 					if (!containersList.isEmpty()) {
 						List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getMblno())
 						List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getMblno())
 							&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
 							&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
@@ -1096,7 +1099,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					} else {
 					} else {
 						throw new RuntimeException("未查到对应提单号:" + item.getMblno() + "配箱单据");
 						throw new RuntimeException("未查到对应提单号:" + item.getMblno() + "配箱单据");
 					}
 					}
-				}
+//				}
 			}
 			}
 		}
 		}
 		if (!putBoxes.isEmpty()) {
 		if (!putBoxes.isEmpty()) {
@@ -1262,8 +1265,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		this.countOverdueFee(putBoxList, tradingBoxList, tradingBoxItems, containersListNew, putBoxItems);
 		this.countOverdueFee(putBoxList, tradingBoxList, tradingBoxItems, containersListNew, putBoxItems);
 		List<String> fileName = excelList.stream().map(EmptyContainerAppearanceAnalysis::getSrcFile).distinct()
 		List<String> fileName = excelList.stream().map(EmptyContainerAppearanceAnalysis::getSrcFile).distinct()
 			.filter(Objects::nonNull).collect(Collectors.toList());
 			.filter(Objects::nonNull).collect(Collectors.toList());
-		if (!fileName.isEmpty()){
-			cyFtpService.ftpFilescopy(excelList.get(0).getCorpId(),fileName,"OUT");
+		if (!fileName.isEmpty()) {
+			cyFtpService.ftpFilescopy(excelList.get(0).getCorpId(), fileName, "OUT");
 		}
 		}
 		return R.data("操作成功");
 		return R.data("操作成功");
 	}
 	}
@@ -1280,7 +1283,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (CollectionUtils.isEmpty(excelList)) {
 		if (CollectionUtils.isEmpty(excelList)) {
 			throw new SecurityException("数据不能为空");
 			throw new SecurityException("数据不能为空");
 		}
 		}
-		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearanceAnalysis::getBoxCode)
+		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearanceAnalysis::getBoxCode).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 			.distinct().collect(Collectors.toList());
 		//箱档案数据
 		//箱档案数据
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
@@ -2163,7 +2166,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (CollectionUtils.isEmpty(excelList)) {
 		if (CollectionUtils.isEmpty(excelList)) {
 			throw new SecurityException("数据不能为空");
 			throw new SecurityException("数据不能为空");
 		}
 		}
-		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearanceAnalysis::getBoxCode)
+		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearanceAnalysis::getBoxCode).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 			.distinct().collect(Collectors.toList());
 		//箱档案数据
 		//箱档案数据
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
@@ -2541,7 +2544,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (CollectionUtils.isEmpty(excelList)) {
 		if (CollectionUtils.isEmpty(excelList)) {
 			throw new SecurityException("数据不能为空");
 			throw new SecurityException("数据不能为空");
 		}
 		}
-		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearanceAnalysis::getBoxCode)
+		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearanceAnalysis::getBoxCode).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 			.distinct().collect(Collectors.toList());
 		//箱档案数据
 		//箱档案数据
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
@@ -2928,6 +2931,11 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						.map(EmptyContainerAppearanceAnalysis::getBoxCode).collect(Collectors.joining(",")));
 						.map(EmptyContainerAppearanceAnalysis::getBoxCode).collect(Collectors.joining(",")));
 				}
 				}
 				long count = excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())).count();
 				long count = excelList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())).count();
+				if ("0".equals(item.getWhetherManuallyCreate())) {
+					item.setTotalNum(item.getTotalNum() + Integer.parseInt(count + ""));
+					item.setRemainingNum(item.getRemainingNum() + Integer.parseInt(count + ""));
+					item.setStorageNum(item.getStorageNum() + Integer.parseInt(count + ""));
+				}
 				if ("OW(拿)".equals(item.getBusType())) {
 				if ("OW(拿)".equals(item.getBusType())) {
 					item.setSuitcaseNum(item.getSuitcaseNum() + Integer.parseInt(count + ""));
 					item.setSuitcaseNum(item.getSuitcaseNum() + Integer.parseInt(count + ""));
 					item.setNotSuitcaseNum(item.getTotalNum() - item.getSuitcaseNum());
 					item.setNotSuitcaseNum(item.getTotalNum() - item.getSuitcaseNum());
@@ -3010,8 +3018,8 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		}
 		}
 		List<String> fileName = excelList.stream().map(EmptyContainerAppearanceAnalysis::getSrcFile).distinct()
 		List<String> fileName = excelList.stream().map(EmptyContainerAppearanceAnalysis::getSrcFile).distinct()
 			.filter(Objects::nonNull).collect(Collectors.toList());
 			.filter(Objects::nonNull).collect(Collectors.toList());
-		if (!fileName.isEmpty()){
-			cyFtpService.ftpFilescopy(excelList.get(0).getCorpId(),fileName,"IN");
+		if (!fileName.isEmpty()) {
+			cyFtpService.ftpFilescopy(excelList.get(0).getCorpId(), fileName, "IN");
 		}
 		}
 		return R.data("操作成功");
 		return R.data("操作成功");
 	}
 	}
@@ -3033,7 +3041,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			throw new RuntimeException("未查到配箱信息");
 			throw new RuntimeException("未查到配箱信息");
 		}
 		}
 		if ("SI".equals(podStationR.getBusinessType())) {
 		if ("SI".equals(podStationR.getBusinessType())) {
-			if ("1".equals(podStationR.getType())){
+			if ("1".equals(podStationR.getType())) {
 				List<String> boxNum = containersHYJKList.stream().map(Containers::getCntrNo).filter(Objects::nonNull)
 				List<String> boxNum = containersHYJKList.stream().map(Containers::getCntrNo).filter(Objects::nonNull)
 					.collect(Collectors.toList());
 					.collect(Collectors.toList());
 				if (boxNum.isEmpty()) {
 				if (boxNum.isEmpty()) {
@@ -3579,7 +3587,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					//计算超期箱使费
 					//计算超期箱使费
 					this.countOverdueFeeV1(billsHYJK, tradingBoxList, tradingBoxItemOldList, putBoxItemsOldList, putBoxList);
 					this.countOverdueFeeV1(billsHYJK, tradingBoxList, tradingBoxItemOldList, putBoxItemsOldList, putBoxList);
 				}
 				}
-			}else{
+			} else {
 				for (Containers item : containersHYJKList) {
 				for (Containers item : containersHYJKList) {
 					if (ObjectUtils.isNull(item.getHblno())) {
 					if (ObjectUtils.isNull(item.getHblno())) {
 						throw new RuntimeException("分单号不能为空");
 						throw new RuntimeException("分单号不能为空");
@@ -3683,7 +3691,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (CollectionUtils.isEmpty(excelList)) {
 		if (CollectionUtils.isEmpty(excelList)) {
 			throw new SecurityException("数据不能为空");
 			throw new SecurityException("数据不能为空");
 		}
 		}
-		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearance::getBoxCode)
+		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearance::getBoxCode).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 			.distinct().collect(Collectors.toList());
 		//箱档案数据
 		//箱档案数据
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
@@ -3868,7 +3876,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (CollectionUtils.isEmpty(excelList)) {
 		if (CollectionUtils.isEmpty(excelList)) {
 			throw new SecurityException("数据不能为空");
 			throw new SecurityException("数据不能为空");
 		}
 		}
-		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearance::getBoxCode)
+		List<String> boxCodeList = excelList.stream().map(EmptyContainerAppearance::getBoxCode).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 			.distinct().collect(Collectors.toList());
 		//箱档案数据
 		//箱档案数据
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
@@ -4061,27 +4069,27 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					}
 					}
 				}
 				}
 				if (!"OW(放)".equals(putBoxData.getBusType()) && ObjectUtils.isNotNull(item.getMblno())) {
 				if (!"OW(放)".equals(putBoxData.getBusType()) && ObjectUtils.isNotNull(item.getMblno())) {
-					PutBox putBox1 = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getMblno())
+					/*PutBox putBox1 = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getMblno())
 						&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(ports.getId())
 						&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(ports.getId())
 						&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(corps.getId()) &&
 						&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(corps.getId()) &&
 						"OW(放)".equals(e.getBusType())).findFirst().orElse(null);
 						"OW(放)".equals(e.getBusType())).findFirst().orElse(null);
-					if (putBox1 == null) {
-						if (!containersList.isEmpty()) {
-							List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getMblno())
-								&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
-							if (containerItemList.isEmpty()) {
-								analysis.setResult("失败");
-								analysis.setReason("未查到对应提单号:" + item.getMblno() + "配箱单据");
-								analysisList.add(analysis);
-								continue;
-							}
-						} else {
+					if (putBox1 == null) {*/
+					if (!containersList.isEmpty()) {
+						List<Containers> containerItemList = containersList.stream().filter(e -> item.getMblno().equals(e.getMblno())
+							&& item.getBoxCode().equals(e.getCntrNo())).collect(Collectors.toList());
+						if (containerItemList.isEmpty()) {
 							analysis.setResult("失败");
 							analysis.setResult("失败");
 							analysis.setReason("未查到对应提单号:" + item.getMblno() + "配箱单据");
 							analysis.setReason("未查到对应提单号:" + item.getMblno() + "配箱单据");
 							analysisList.add(analysis);
 							analysisList.add(analysis);
 							continue;
 							continue;
 						}
 						}
+					} else {
+						analysis.setResult("失败");
+						analysis.setReason("未查到对应提单号:" + item.getMblno() + "配箱单据");
+						analysisList.add(analysis);
+						continue;
 					}
 					}
+//					}
 				}
 				}
 			} else {
 			} else {
 				analysis.setResult("失败");
 				analysis.setResult("失败");
@@ -4115,7 +4123,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (CollectionUtils.isEmpty(excelList)) {
 		if (CollectionUtils.isEmpty(excelList)) {
 			throw new SecurityException("数据不能为空");
 			throw new SecurityException("数据不能为空");
 		}
 		}
-		List<String> boxCodeList = excelList.stream().map(GiveAnEncore::getBoxCode)
+		List<String> boxCodeList = excelList.stream().map(GiveAnEncore::getBoxCode).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 			.distinct().collect(Collectors.toList());
 		//箱档案数据
 		//箱档案数据
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
@@ -4397,7 +4405,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 		if (CollectionUtils.isEmpty(excelList)) {
 		if (CollectionUtils.isEmpty(excelList)) {
 			throw new SecurityException("数据不能为空");
 			throw new SecurityException("数据不能为空");
 		}
 		}
-		List<String> boxCodeList = excelList.stream().map(GiveAnEncore::getBoxCode)
+		List<String> boxCodeList = excelList.stream().map(GiveAnEncore::getBoxCode).filter(Objects::nonNull)
 			.distinct().collect(Collectors.toList());
 			.distinct().collect(Collectors.toList());
 		//箱档案数据
 		//箱档案数据
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
 		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
@@ -5275,7 +5283,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						feeCenterC.setAmountLoc(feeCenterC.getAmount().multiply(feeCenter.getExrate()));
 						feeCenterC.setAmountLoc(feeCenterC.getAmount().multiply(feeCenter.getExrate()));
 						feeCenterList.add(feeCenterC);
 						feeCenterList.add(feeCenterC);
 					}
 					}
-					item.setPodBoxUseDays(Integer.parseInt(days+""));
+					item.setPodBoxUseDays(Integer.parseInt(days + ""));
 					putBoxItemsList.add(item);
 					putBoxItemsList.add(item);
 					if ("OW(拿),OW(放)".contains(putBox.getBusType())) {
 					if ("OW(拿),OW(放)".contains(putBox.getBusType())) {
 						TradingBoxItem tradingBoxItem = tradingBoxItemOldList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
 						TradingBoxItem tradingBoxItem = tradingBoxItemOldList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);

+ 2 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java

@@ -1544,6 +1544,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				putBox.setCreateUser(AuthUtil.getUserId());
 				putBox.setCreateUser(AuthUtil.getUserId());
 				putBox.setCreateTime(new Date());
 				putBox.setCreateTime(new Date());
 				putBox.setCreateUserName(AuthUtil.getUserName());
 				putBox.setCreateUserName(AuthUtil.getUserName());
+				putBox.setWhetherManuallyCreate("1");
 				BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
 				BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
 					.select(BusinessType::getId)
 					.select(BusinessType::getId)
 					.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
 					.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
@@ -1890,6 +1891,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				putBox.setCreateUser(AuthUtil.getUserId());
 				putBox.setCreateUser(AuthUtil.getUserId());
 				putBox.setCreateTime(new Date());
 				putBox.setCreateTime(new Date());
 				putBox.setCreateUserName(AuthUtil.getUserName());
 				putBox.setCreateUserName(AuthUtil.getUserName());
+				putBox.setWhetherManuallyCreate("1");
 				BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
 				BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
 					.select(BusinessType::getId)
 					.select(BusinessType::getId)
 					.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
 					.eq(BusinessType::getTenantId, AuthUtil.getTenantId())