Просмотр исходного кода

1.放箱号Pod统计空值
2.场站api增加判断港口是否国内
3.OW拿批量修改POD接口修改

纪新园 18 часов назад
Родитель
Сommit
22127a9e19

+ 10 - 1
blade-service/blade-los/src/main/java/org/springblade/los/box/dynamics/service/impl/BoxDynamicsRecordServiceImpl.java

@@ -645,7 +645,16 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 			// 6.提单号有效性校验
 			// 6.提单号有效性校验
 			List<String> mblnoList = apiRequest.getItem().stream().map(ApiItem::getMblno).filter(Objects::nonNull)
 			List<String> mblnoList = apiRequest.getItem().stream().map(ApiItem::getMblno).filter(Objects::nonNull)
 				.distinct().collect(Collectors.toList());
 				.distinct().collect(Collectors.toList());
-			if (!mblnoList.isEmpty()) {
+			boolean intercept = false;
+			//是否国内港口参数
+			String restriction = sysClient.getParamService("whether.start.restriction");
+			if (ports != null) {
+				if (ObjectUtils.isNotNull(ports.getUnCode()) && (ports.getUnCode().contains("CN") || ports.getUnCode().contains("VN"))
+					&& "1".equals(restriction)) {
+					intercept = true;
+				}
+			}
+			if (!mblnoList.isEmpty() && intercept) {
 				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)

+ 7 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -5202,6 +5202,13 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					mapList.add(map);
 					mapList.add(map);
 				}
 				}
 			}
 			}
+			long count = putBoxItemsList.stream().filter(e -> ObjectUtils.isNull(e.getPodCname())).count();
+			if (count>0){
+				Map<String, String> map = new HashMap<>();
+				map.put("port", "");
+				map.put("count", count + "");
+				mapList.add(map);
+			}
 		}
 		}
 		return R.data(mapList);
 		return R.data(mapList);
 	}
 	}

+ 54 - 26
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java

@@ -2748,38 +2748,66 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			throw new RuntimeException("未查到放箱号箱明细");
 			throw new RuntimeException("未查到放箱号箱明细");
 		}
 		}
 		List<PutBoxItems> putBoxItems = new ArrayList<>();
 		List<PutBoxItems> putBoxItems = new ArrayList<>();
+		List<TradingBoxItem> tradingBoxItemsList = new ArrayList<>();
 		for (TradingBoxItem item : tradingBox.getTradingBoxItemsList()) {
 		for (TradingBoxItem item : tradingBox.getTradingBoxItemsList()) {
-			item.setPodStationId(tradingBox.getPodStationId());
-			item.setPodStationCname(tradingBox.getPodStationCname());
-			item.setPodStationCode(tradingBox.getPodStationCode());
-			item.setPodStationEname(tradingBox.getPodStationEname());
-			item.setPodCyAddress(tradingBox.getPodCyAddress());
-			item.setPodCyContact(tradingBox.getPodCyContact());
-			item.setPodCyEmail(tradingBox.getPodCyEmail());
-			item.setPodCyTel(tradingBox.getPodCyTel());
-			item.setUpdateUser(AuthUtil.getUserId());
-			item.setUpdateUserName(AuthUtil.getUserName());
-			item.setUpdateTime(new Date());
-			item.setOffhireReference(tradingBox.getOffhireReference());
-			item.setWorkContent(tradingBox.getWorkContent());
 			PutBoxItems boxItems = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getCode())).findFirst().orElse(null);
 			PutBoxItems boxItems = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getCode())).findFirst().orElse(null);
 			if (boxItems == null) {
 			if (boxItems == null) {
 				throw new RuntimeException("未查到放箱号中箱号:" + item.getCode() + "明细");
 				throw new RuntimeException("未查到放箱号中箱号:" + item.getCode() + "明细");
 			}
 			}
-			boxItems.setPodStationId(tradingBox.getPodStationId());
-			boxItems.setPodStationCname(tradingBox.getPodStationCname());
-			boxItems.setPodStationCode(tradingBox.getPodStationCode());
-			boxItems.setPodStationEname(tradingBox.getPodStationEname());
-			boxItems.setPodCyAddress(tradingBox.getPodCyAddress());
-			boxItems.setPodCyContact(tradingBox.getPodCyContact());
-			boxItems.setPodCyEmail(tradingBox.getPodCyEmail());
-			boxItems.setPodCyTel(tradingBox.getPodCyTel());
-			boxItems.setUpdateUser(AuthUtil.getUserId());
-			boxItems.setUpdateUserName(AuthUtil.getUserName());
-			boxItems.setUpdateTime(new Date());
-			putBoxItems.add(boxItems);
+			if (ObjectUtils.isNotNull(tradingBox.getPodStationId())) {
+				item.setPodStationId(tradingBox.getPodStationId());
+				item.setPodStationCname(tradingBox.getPodStationCname());
+				item.setPodStationCode(tradingBox.getPodStationCode());
+				item.setPodStationEname(tradingBox.getPodStationEname());
+
+				boxItems.setPodStationId(tradingBox.getPodStationId());
+				boxItems.setPodStationCname(tradingBox.getPodStationCname());
+				boxItems.setPodStationCode(tradingBox.getPodStationCode());
+				boxItems.setPodStationEname(tradingBox.getPodStationEname());
+			}
+			if (ObjectUtils.isNotNull(tradingBox.getPodCyAddress())) {
+				item.setPodCyAddress(tradingBox.getPodCyAddress());
+				boxItems.setPodCyAddress(tradingBox.getPodCyAddress());
+			}
+			if (ObjectUtils.isNotNull(tradingBox.getPodCyContact())) {
+				item.setPodCyContact(tradingBox.getPodCyContact());
+				boxItems.setPodCyContact(tradingBox.getPodCyContact());
+			}
+			if (ObjectUtils.isNotNull(tradingBox.getPodCyEmail())) {
+				item.setPodCyEmail(tradingBox.getPodCyEmail());
+				boxItems.setPodCyEmail(tradingBox.getPodCyEmail());
+			}
+			if (ObjectUtils.isNotNull(tradingBox.getPodCyTel())) {
+				item.setPodCyTel(tradingBox.getPodCyTel());
+				boxItems.setPodCyTel(tradingBox.getPodCyTel());
+			}
+			if (ObjectUtils.isNotNull(tradingBox.getOffhireReference())) {
+				item.setOffhireReference(tradingBox.getOffhireReference());
+			}
+			if (ObjectUtils.isNotNull(tradingBox.getWorkContent())) {
+				item.setWorkContent(tradingBox.getWorkContent());
+			}
+			if (ObjectUtils.isNotNull(tradingBox.getPodStationId()) || ObjectUtils.isNotNull(tradingBox.getPodCyAddress())
+				|| ObjectUtils.isNotNull(tradingBox.getPodCyContact()) || ObjectUtils.isNotNull(tradingBox.getPodCyEmail())
+				|| ObjectUtils.isNotNull(tradingBox.getPodCyTel()) || ObjectUtils.isNotNull(tradingBox.getOffhireReference())
+				|| ObjectUtils.isNotNull(tradingBox.getWorkContent())) {
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateUserName(AuthUtil.getUserName());
+				item.setUpdateTime(new Date());
+				tradingBoxItemsList.add(item);
+			}
+			if (ObjectUtils.isNotNull(tradingBox.getPodStationId()) || ObjectUtils.isNotNull(tradingBox.getPodCyAddress())
+				|| ObjectUtils.isNotNull(tradingBox.getPodCyContact()) || ObjectUtils.isNotNull(tradingBox.getPodCyEmail())
+				|| ObjectUtils.isNotNull(tradingBox.getPodCyTel())) {
+				boxItems.setUpdateUser(AuthUtil.getUserId());
+				boxItems.setUpdateUserName(AuthUtil.getUserName());
+				boxItems.setUpdateTime(new Date());
+				putBoxItems.add(boxItems);
+			}
+		}
+		if (!tradingBoxItemsList.isEmpty()){
+			tradingBoxItemService.updateBatchById(tradingBox.getTradingBoxItemsList());
 		}
 		}
-		tradingBoxItemService.updateBatchById(tradingBox.getTradingBoxItemsList());
 		List<String> hblno = new ArrayList<>();
 		List<String> hblno = new ArrayList<>();
 		if (!putBoxItems.isEmpty()) {
 		if (!putBoxItems.isEmpty()) {
 			putBoxItemsService.updateBatchById(putBoxItems);
 			putBoxItemsService.updateBatchById(putBoxItems);