瀏覽代碼

1.海运进出口单据复制时费用明细系统自动生成状态修改
2.财务金额处理负数问题修改
3.计算超期箱使费逻辑修改
4.箱池动态,按港口查询列表,导出,导出明细接口逻辑修改
5.放箱号保存接口判断放箱号是否存在重复增加类型条件
6.OW(放)空箱出场,客户还箱流程测试及bug修改

纪新园 1 天之前
父節點
當前提交
6ede86eb39

+ 23 - 0
blade-service/blade-los/src/main/java/org/springblade/los/Util/EntryExitDataHandleUtils.java

@@ -636,6 +636,29 @@ public class EntryExitDataHandleUtils {
 			tradingBoxItem.setActualEtd(null);
 			tradingBoxItem.setActualEta(null);
 			tradingBoxItem.setTemporaryId(item.getTemporaryId());
+		}else if ("8".equals(type)){
+			tradingBoxItem = new TradingBoxItem();
+			tradingBoxItem.setBoxBelongsTo("SOC");
+			tradingBoxItem.setBoxCategory("OW(放)");
+			tradingBoxItem.setBoxSource(tradingBox.getBoxClass());
+			tradingBoxItem.setBoxCondition("新");
+			tradingBoxItem.setContainerNumber(item.getContainerNumber());
+			tradingBoxItem.setCode(item.getBoxCode());
+			tradingBoxItem.setBoxType(item.getBoxType());
+			if (ObjectUtils.isNotNull(item.getApproachExitDate())) {
+				tradingBoxItem.setRentEndDate(item.getApproachExitDate());
+				tradingBoxItem.setPolPickUpDate(item.getApproachExitDate());
+				tradingBoxItem.setPolPreAppearanceDate(item.getApproachExitDate());
+				tradingBoxItem.setPolStationEmptyContainerExitDate(item.getApproachExitDate());
+			} else {
+				tradingBoxItem.setRentEndDate(new Date());
+				tradingBoxItem.setPolPickUpDate(new Date());
+				tradingBoxItem.setPolPreAppearanceDate(new Date());
+				tradingBoxItem.setPolStationEmptyContainerExitDate(new Date());
+			}
+			tradingBoxItem.setCreateUser(AuthUtil.getUserId());
+			tradingBoxItem.setCreateUserName(AuthUtil.getUserName());
+			tradingBoxItem.setCreateTime(new Date());
 		}
 		tradingBoxItem.setPid(tradingBox.getId());
 		tradingBoxItem.setHblno(item.getHblno());

+ 18 - 11
blade-service/blade-los/src/main/java/org/springblade/los/Util/OwBoxUsageFeeUtils.java

@@ -411,7 +411,7 @@ public class OwBoxUsageFeeUtils {
 					int overdueDays = (int) ChronoUnit.DAYS.between(ldt1, ldt2);
 					//超期天数
 					if (overdueDays > 0) {
-						FeeCenter feeCenter = this.addFeeCenter(item, bills, fees, storageFeesItems, curExrateList, overdueDays, exrateType);
+						FeeCenter feeCenter = this.addFeeCenter(item, bills, fees, storageFeesItems, curExrateList, overdueDays, exrateType,"1");
 						if (feeCenter != null) {
 							FeeCenter feeCenterC = new FeeCenter();
 							BeanUtil.copyProperties(feeCenter, feeCenterC);
@@ -753,7 +753,7 @@ public class OwBoxUsageFeeUtils {
 				LocalDateTime ldt2 = item.getPolStationEmptyContainerExitDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
 				int overdueDays = (int) ChronoUnit.DAYS.between(ldt1, ldt2);
 				if (overdueDays > 0) {
-					FeeCenter feeCenter = this.addFeeCenter(item, bills, fees, storageFeesItems, curExrateList, overdueDays, exrateType);
+					FeeCenter feeCenter = this.addFeeCenter(item, bills, fees, storageFeesItems, curExrateList, overdueDays, exrateType,"3");
 					if (feeCenter != null) {
 						FeeCenter feeCenterC = new FeeCenter();
 						BeanUtil.copyProperties(feeCenter, feeCenterC);
@@ -945,7 +945,7 @@ public class OwBoxUsageFeeUtils {
 				int overdueDays = (int) ChronoUnit.DAYS.between(ldt2, ldt1);
 				//超期天数
 				if (overdueDays > 0) {
-					FeeCenter feeCenter = this.addFeeCenter(item, billsHYJK, fees, storageFeesItems, curExrateList, overdueDays, exrateType);
+					FeeCenter feeCenter = this.addFeeCenter(item, billsHYJK, fees, storageFeesItems, curExrateList, overdueDays, exrateType,"2");
 					if (feeCenter != null) {
 						FeeCenter feeCenterC = new FeeCenter();
 						BeanUtil.copyProperties(feeCenter, feeCenterC);
@@ -1178,10 +1178,11 @@ public class OwBoxUsageFeeUtils {
 	 * @param curExrateList    汇率明细
 	 * @param overdueDays      超期天数
 	 * @param exrateType       本币币别
+	 * @param type       业务类型 1=pol,2=pod,3=无货返空
 	 */
 	public FeeCenter addFeeCenter(PutBoxItems item, Bills bills, BFees fees,
 								  List<StorageFeesItems> storageFeesItems, List<BCurExrate> curExrateList,
-								  int overdueDays, String exrateType) {
+								  int overdueDays, String exrateType,String type) {
 		FeeCenter feeCenter = new FeeCenter();
 		feeCenter.setBillType(bills.getBillType());
 		feeCenter.setCorpType("国内同行及代理");
@@ -1204,22 +1205,28 @@ public class OwBoxUsageFeeUtils {
 		feeCenter.setUnitNo(item.getBoxType());
 		//免箱使天数
 		int overdueBoxUseDays = 0;
-		if (ObjectUtils.isNotNull(bills.getPolFreeBoxUseDays())) {
-			overdueBoxUseDays = bills.getPolFreeBoxUseDays();
+		if("1".equals(type)){
+			if (ObjectUtils.isNotNull(bills.getPolFreeBoxUseDays())) {
+				overdueBoxUseDays = bills.getPolFreeBoxUseDays();
+			}
+		}else if ("2".equals(type)){
+			if (ObjectUtils.isNotNull(bills.getPodFreeBoxUseDays())) {
+				overdueBoxUseDays = bills.getPodFreeBoxUseDays();
+			}
 		}
 		//判断是否超期
 		if (overdueDays < overdueBoxUseDays) {
 			return null;
 		}
 		//获取第一档计费规则明细
-		int finalOverdueBoxUseDays = overdueBoxUseDays;
-		StorageFeesItems feesItems = storageFeesItems.stream().filter(e -> finalOverdueBoxUseDays > e.getStartDay()
-			&& finalOverdueBoxUseDays < e.getEndDay()).findFirst().orElse(null);
+		int finalOverdueBoxUseDays = overdueBoxUseDays + 1;
+		StorageFeesItems feesItems = storageFeesItems.stream().filter(e -> finalOverdueBoxUseDays >= e.getStartDay()
+			&& finalOverdueBoxUseDays <= e.getEndDay()).findFirst().orElse(null);
 		if (feesItems == null) {
 			return null;
 		}
 		//开始计费-第一档应计费天数
-		int firstTierChargeableFeeDays = feesItems.getEndDay() - overdueBoxUseDays + 1;
+		int firstTierChargeableFeeDays = feesItems.getEndDay() - overdueBoxUseDays;
 		//计算过程
 		String text;
 		//超期金额
@@ -1252,7 +1259,7 @@ public class OwBoxUsageFeeUtils {
 				continue;
 			}
 			//剩余计费天数需从免箱使天数所在下一档次开始计算
-			if (term.getStartDay() > feesItems.getEndDay()) {
+			if (term.getStartDay() > finalOverdueBoxUseDays) {
 				//本档次需计费天数
 				int dayLength = term.getEndDay() - term.getStartDay() + 1;
 				//剩余计费天数是否大于本档次计费天数

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

@@ -2178,7 +2178,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 					if (!archivesListFXHX.isEmpty()) {
 						Archives archives = archivesListFXHX.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
 						if (archives != null) {
-							if (ObjectUtils.isNotNull(archives.getBillNo())) {
+							if (ObjectUtils.isNotNull(archives.getBillNo()) && archives.getBillNo().length() >= fixedPrefix.length()) {
 								//截取提单号前缀,判断是否是OW(放)放箱号
 								String data = archives.getBillNo().substring(0, fixedPrefix.length());
 								if (fixedPrefix.equals(data)) {
@@ -3895,10 +3895,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				boxDynamicsRecordItemsService.updateBatchById(itemsListZD);
 			}
 			//正常出场
-			List<BoxDynamicsRecordItems> itemsListCC = itemsList.stream().filter(e -> "BX".equals(e.getObjective())
+			List<BoxDynamicsRecordItems> itemsListC = itemsList.stream().filter(e -> "BX".equals(e.getObjective())
 				|| "WD".equals(e.getObjective()) || "Q".equals(e.getObjective()) || "QZ".equals(e.getObjective())
 				|| "XO".equals(e.getObjective())).collect(Collectors.toList());
-			if (!itemsListCC.isEmpty()) {
+			if (!itemsListC.isEmpty()) {
 				//查询本次出场港口
 				BPorts ports = bPortsService.getById(boxDynamicsRecord.getPortId());
 				boolean intercept = false;
@@ -3916,6 +3916,34 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 					failureHandling(type, boxDynamicsRecord, "请先维护放箱号固定前缀参数!");
 					return false;
 				}
+				List<BoxDynamicsRecordItems> itemsListCCOWF = new ArrayList<>();
+				List<BoxDynamicsRecordItems> itemsListCC = new ArrayList<>();
+				//区分正常出场还是OW放出场  只有提单号不为空并且符合前缀匹配的才是OW放出场箱号,其余都是正常出场
+				for (BoxDynamicsRecordItems item : itemsListC) {
+					if (ObjectUtils.isNull(item.getHblno())) {
+						failureHandling(type, boxDynamicsRecord, "箱号为:" + item.getBoxCode() + "的提单号不能为空");
+						return false;
+					}
+					if (item.getHblno().length() >= fixedPrefix.length()) {
+						//截取提单号前缀,判断是否是OW(放)放箱号
+						String data = item.getHblno().substring(0, fixedPrefix.length());
+						if (fixedPrefix.equals(data)) {
+							itemsListCCOWF.add(item);
+							continue;
+						}
+					}
+					itemsListCC.add(item);
+				}
+				//OW放-出场
+				if (!itemsListCCOWF.isEmpty()) {
+					Boolean status = this.synchronizationFXCC(itemsListCCOWF, boxDynamicsRecord, type);
+					if (!status) {
+						return false;
+					}
+				}
+				if (itemsListCC.isEmpty()) {
+					return true;
+				}
 				//本次出场箱号
 				List<String> boxCodeList = itemsListCC.stream().map(BoxDynamicsRecordItems::getBoxCode).filter(Objects::nonNull)
 					.distinct().collect(Collectors.toList());
@@ -3942,10 +3970,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				List<SeaContainerNumberItem> containerNumberItemListNew = new ArrayList<>();
 				//海运单据配箱修改后
 				List<Containers> containersListNew = new ArrayList<>();
-				if (hblno.isEmpty()) {
-					failureHandling(type, boxDynamicsRecord, "提单号不能为空");
-					return false;
-				}
 				//海运单据
 				List<Bills> billsList = billsMapper.selectList(new LambdaQueryWrapper<Bills>()
 					.eq(Bills::getTenantId, boxDynamicsRecord.getTenantId())
@@ -4009,10 +4033,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				}
 				//放箱号箱明细修改后
 				List<PutBoxItems> putBoxItems = new ArrayList<>();
-				//OW(放)放箱号箱明细
-				List<PutBoxItems> putBoxItemsOwf = new ArrayList<>();
-				//OW(放)放箱号
-				List<PutBox> putBoxesOwf = new ArrayList<>();
 				//放箱号对应来源箱管单据明细修改后
 				List<TradingBoxItem> tradingBoxItems = new ArrayList<>();
 				//箱档案修改后
@@ -4023,10 +4043,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				List<TradingBox> tradingBoxes = new ArrayList<>();
 				//出场箱处理
 				for (BoxDynamicsRecordItems item : itemsListCC) {
-					if (ObjectUtils.isNull(item.getHblno())) {
-						failureHandling(type, boxDynamicsRecord, "箱号为:" + item.getBoxCode() + "的提单号不能为空");
-						return false;
-					}
 					if (ObjectUtils.isNull(item.getApproachExitDate())) {
 						item.setApproachExitDate(new Date());
 					}
@@ -4054,40 +4070,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						failureHandling(type, boxDynamicsRecord, "箱号:" + item.getBoxCode() + "状态为使用中");
 						return false;
 					}
-					//截取提单号前缀,判断是否是OW(放)放箱号
-					String data = item.getHblno().substring(0, fixedPrefix.length());
-					boolean whetherFX = false;
-					if (fixedPrefix.equals(data)) {
-						whetherFX = true;
-						PutBox putBox = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())
-							&& ObjectUtils.isNotNull(e.getPolId()) && item.getHblno().equals(e.getSrcContainerNumber())).findFirst().orElse(null);
-						if (putBox != null) {
-							if (!putBoxesOwf.isEmpty()) {
-								if (!putBoxesOwf.stream().map(PutBox::getId).collect(Collectors.toList()).contains(putBox.getId())) {
-									putBoxesOwf.add(putBox);
-								}
-							} else {
-								putBoxesOwf.add(putBox);
-							}
-							if (!putBoxItemsList.isEmpty()) {
-								PutBoxItems putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()) &&
-									e.getPid().equals(putBox.getId())).findFirst().orElse(null);
-								if (putBoxItem == null) {
-									putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, item, putBox, false, null, "空箱出场", "使用中", "8", false);
-									putBoxItemsOwf.add(putBoxItem);
-								} else {
-									failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "中箱号:" + item.getBoxCode() + "已存在");
-									return false;
-								}
-							} else {
-								failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "中箱号:" + item.getBoxCode() + "已存在");
-								return false;
-							}
-						} else {
-							failureHandling(type, boxDynamicsRecord, "未查到OW(放)放箱号:" + item.getHblno() + "单据");
-							return false;
-						}
-					}
 					//获取对应放箱号数据
 					PutBox putBoxData;
 					//1.非正常出场 提单号为放箱号
@@ -4124,7 +4106,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 					}
 					//海运单据
 					Bills bills;
-					if (!billsList.isEmpty() && !whetherFX) {
+					if (!billsList.isEmpty()) {
 						//只查分单加直单
 						bills = billsList.stream().filter(e -> "MH,DD".contains(e.getBillType())
 							&& ObjectUtils.isNotNull(item.getHblno()) && item.getHblno().equals(e.getHblno())).findFirst().orElse(null);
@@ -4175,14 +4157,12 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						}
 					} else {
 						bills = null;
-						if (!whetherFX) {
-							//判断出场港口是否国内或越南港口,是提单号必须存在  否需提示但箱正常出场
-							if (intercept) {
-								failureHandling(type, boxDynamicsRecord, "未查到提单号:" + item.getHblno() + "对应海运出口单据");
-								return false;
-							} else {
-								failureHandling("3", boxDynamicsRecord, "未查到提单号:" + item.getHblno() + "对应海运出口单据");
-							}
+						//判断出场港口是否国内或越南港口,是提单号必须存在  否需提示但箱正常出场
+						if (intercept) {
+							failureHandling(type, boxDynamicsRecord, "未查到提单号:" + item.getHblno() + "对应海运出口单据");
+							return false;
+						} else {
+							failureHandling("3", boxDynamicsRecord, "未查到提单号:" + item.getHblno() + "对应海运出口单据");
 						}
 					}
 					//放箱号明细数据处理
@@ -4191,7 +4171,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()) &&
 							e.getPid().equals(putBoxData.getId())).findFirst().orElse(null);
 						if (putBoxItem != null) {
-							putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, item, putBoxData, whetherExistence, bills, "空箱出场", "使用中", "3", whetherFX);
+							putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, item, putBoxData, whetherExistence, bills, "空箱出场", "使用中", "3", false);
 							putBoxItems.add(putBoxItem);
 						} else {
 							failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "未查到箱号:" + item.getBoxCode() + "进场记录");
@@ -4604,29 +4584,6 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				if (!archivesArrayList.isEmpty()) {
 					archivesService.saveOrUpdateBatch(archivesArrayList);
 				}
-				if (!putBoxItemsOwf.isEmpty()) {
-					putBoxItemsService.saveOrUpdateBatch(putBoxItemsOwf);
-					if (!putBoxesOwf.isEmpty()) {
-						for (PutBox item : putBoxesOwf) {
-							//主表增加本次出场箱号数据
-							if (ObjectUtils.isNotNull(item.getCode())) {
-								//获取对应放箱号本次出场箱号
-								List<String> codeList = putBoxItemsOwf.stream().filter(e -> e.getPid().equals(item.getId()))
-									.map(PutBoxItems::getBoxCode).collect(Collectors.toList());
-								for (String e : codeList) {
-									if (!item.getCode().contains(e)) {
-										item.setCode(item.getCode() + "," + e);
-									}
-								}
-							} else {
-								item.setCode(itemsListCC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
-									.map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.joining(",")));
-							}
-							item.setVersion(ObjectUtils.isNull(item.getVersion()) ? 1 : item.getVersion() + 1);
-						}
-						putBoxService.updateBatchById(putBoxesOwf);
-					}
-				}
 				if (!tradingBoxItems.isEmpty()) {
 					tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
 				}
@@ -4669,6 +4626,426 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 		return true;
 	}
 
+	private Boolean synchronizationFXCC(List<BoxDynamicsRecordItems> itemsListCC, BoxDynamicsRecord boxDynamicsRecord, String type) throws IOException {
+		//本次出场箱号
+		List<String> boxCodeList = itemsListCC.stream().map(BoxDynamicsRecordItems::getBoxCode).filter(Objects::nonNull)
+			.distinct().collect(Collectors.toList());
+		//箱档案数据
+		List<Archives> archivesList = archivesService.list(new LambdaQueryWrapper<Archives>()
+			.eq(Archives::getTenantId, boxDynamicsRecord.getTenantId())
+			.eq(Archives::getIsDeleted, 0)
+			.in(Archives::getCode, boxCodeList));
+		//本次出场放箱号
+		List<String> containerNumberList = itemsListCC.stream().map(BoxDynamicsRecordItems::getContainerNumber)
+			.distinct().collect(Collectors.toList());
+		//放箱号
+		List<PutBox> putBoxList = putBoxService.list(new LambdaQueryWrapper<PutBox>()
+			.eq(PutBox::getTenantId, boxDynamicsRecord.getTenantId())
+			.eq(PutBox::getIsDeleted, 0)
+			.and(i -> i.in(PutBox::getContainerNumber, containerNumberList).or()
+				.in(PutBox::getSrcContainerNumber, containerNumberList)));
+		if (putBoxList.isEmpty()) {
+			failureHandling(type, boxDynamicsRecord, "未查到放箱号单据");
+			return false;
+		}
+		List<Long> putBoxIdList = putBoxList.stream().map(PutBox::getId).collect(Collectors.toList());
+		//放箱号箱明细
+		List<PutBoxItems> putBoxItemsList = putBoxItemsService.list(new LambdaQueryWrapper<PutBoxItems>()
+			.eq(PutBoxItems::getIsDeleted, 0)
+			.eq(PutBoxItems::getTenantId, boxDynamicsRecord.getTenantId())
+			.in(PutBoxItems::getPid, putBoxIdList));
+		//验证黑名单
+		String blacklist = sysClient.getParamService("box.blacklist");
+		String text = BoxNumUtils.verifyBlacklist(blacklist, boxCodeList, boxDynamicsRecord.getTenantId());
+		if (ObjectUtils.isNotNull(text)) {
+			failureHandling(type, boxDynamicsRecord, "箱号:" + text + "为黑名单箱,请修改数据后再操作");
+			return false;
+		}
+		List<Long> srcIdList = putBoxList.stream().map(PutBox::getSrcId).collect(Collectors.toList());
+		//放箱号对应来源箱管单据信息
+		List<TradingBox> tradingBoxList = new ArrayList<>();
+		List<SeaContainerNumberItem> containerNumberItemList = new ArrayList<>();
+		List<SeaContainerNumberItem> containerNumberItems = new ArrayList<>();
+		if (!srcIdList.isEmpty()) {
+			tradingBoxList = tradingBoxMapper.selectList(new LambdaQueryWrapper<TradingBox>()
+				.eq(TradingBox::getTenantId, boxDynamicsRecord.getTenantId())
+				.eq(TradingBox::getIsDeleted, 0)
+				.in(TradingBox::getId, srcIdList));
+			containerNumberItemList = seaContainerNumberItemService.list(new LambdaQueryWrapper<SeaContainerNumberItem>()
+				.eq(SeaContainerNumberItem::getTenantId, boxDynamicsRecord.getTenantId())
+				.eq(SeaContainerNumberItem::getIsDeleted, 0)
+				.in(SeaContainerNumberItem::getPid, srcIdList));
+		}
+		//放箱号对应来源箱管单据明细信息
+		List<TradingBoxItem> tradingBoxItemList = new ArrayList<>();
+		if (!tradingBoxList.isEmpty()) {
+			List<Long> tradingBoxIdList = tradingBoxList.stream().map(TradingBox::getId).collect(Collectors.toList());
+			tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
+				.eq(TradingBoxItem::getIsDeleted, 0)
+				.eq(TradingBoxItem::getTenantId, boxDynamicsRecord.getTenantId())
+				.in(TradingBoxItem::getPid, tradingBoxIdList));
+		}
+		//放箱号箱明细修改后
+		List<PutBoxItems> putBoxItems = new ArrayList<>();
+		//OW(放)放箱号箱明细
+		List<PutBoxItems> putBoxItemsOwf = new ArrayList<>();
+		//OW(放)放箱号
+		List<PutBox> putBoxesOwf = new ArrayList<>();
+		//放箱号对应来源箱管单据明细修改后
+		List<TradingBoxItem> tradingBoxItems = new ArrayList<>();
+		//箱档案修改后
+		List<Archives> archivesArrayList = new ArrayList<>();
+		//放箱号修改后
+		List<PutBox> putBoxes = new ArrayList<>();
+		//放箱号对应来源箱管单据修改后
+		List<TradingBox> tradingBoxes = new ArrayList<>();
+		//出场箱处理
+		for (BoxDynamicsRecordItems item : itemsListCC) {
+			if (ObjectUtils.isNull(item.getApproachExitDate())) {
+				item.setApproachExitDate(new Date());
+			}
+			//随机字符串数据  用来关联箱明细与出场记录,出场记录存储对应箱信息id,撤销出场时通过id还原数据
+			item.setTemporaryId(StringTools.generateRandomString(32));
+			//箱档案数据处理
+			Archives archives = archivesList.stream().filter(e -> e.getCode().equals(item.getBoxCode())).findFirst().orElse(null);
+			//出场时箱号对应箱档案不能为空
+			if (archives == null) {
+				failureHandling(type, boxDynamicsRecord, "箱档案中未查到箱号:" + item.getBoxCode());
+				return false;
+			}
+			//本次出场放箱号与箱档案需一致
+			if (!archives.getContainerNumber().equals(item.getContainerNumber())) {
+				failureHandling(type, boxDynamicsRecord, "箱号:" + archives.getCode() + "在箱档案中放箱号与本次出场放箱号不符");
+				return false;
+			}
+			//本次出场箱号箱型与箱档案需一致
+			if (!archives.getTypeName().equals(item.getBoxType())) {
+				failureHandling(type, boxDynamicsRecord, "箱号:" + item.getBoxCode() + "与箱档案中箱型不符");
+				return false;
+			}
+			//出场时箱状态不能为使用中
+			if ("使用中".equals(archives.getStatus())) {
+				failureHandling(type, boxDynamicsRecord, "箱号:" + item.getBoxCode() + "状态为使用中");
+				return false;
+			}
+			//OW放-放箱号数据处理
+			PutBox putBox = putBoxList.stream().filter(e -> e.getSrcContainerNumber().equals(item.getHblno())
+				&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(item.getPortId())
+				&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(item.getStationId())).findFirst().orElse(null);
+			if (putBox != null) {
+				if (!putBoxesOwf.isEmpty()) {
+					if (!putBoxes.stream().map(PutBox::getId).collect(Collectors.toList()).contains(putBox.getId())) {
+						putBoxesOwf.add(putBox);
+					}
+				} else {
+					putBoxesOwf.add(putBox);
+				}
+				if (!putBoxItemsList.isEmpty()) {
+					PutBoxItems putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()) &&
+						e.getPid().equals(putBox.getId())).findFirst().orElse(null);
+					if (putBoxItem == null) {
+						putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, item, putBox, false, null, "空箱出场", "使用中", "8", false);
+						putBoxItemsOwf.add(putBoxItem);
+					} else {
+						failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "中箱号:" + item.getBoxCode() + "已存在");
+						return false;
+					}
+				} else {
+					failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "中箱号:" + item.getBoxCode() + "已存在");
+					return false;
+				}
+				//OW(放)数据处理
+				if (!tradingBoxList.isEmpty()) {
+					//获取放箱号来源OW(放)单据
+					TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBox.getSrcId()))
+						.findFirst().orElse(null);
+					if (tradingBox != null) {
+						item.setSrcTradingBoxId(tradingBox.getId());
+						//OW(放)单据修改单据
+						if (!tradingBoxes.isEmpty()) {
+							if (!tradingBoxes.stream().map(TradingBox::getId).collect(Collectors.toList()).contains(tradingBox.getId())) {
+								tradingBoxes.add(tradingBox);
+							}
+						} else {
+							tradingBoxes.add(tradingBox);
+						}
+						//OW(放)单据明细箱号数据
+						TradingBoxItem tradingBoxItem;
+						if (!tradingBoxItemList.isEmpty()) {
+							tradingBoxItem = tradingBoxItemList.stream().filter(e -> e.getCode().equals(item.getBoxCode()))
+								.findFirst().orElse(null);
+							if (tradingBoxItem != null) {
+								failureHandling(type, boxDynamicsRecord, "OW(放)放箱号:" + item.getContainerNumber() + "中箱号:" + item.getBoxCode() + "已存在");
+								return false;
+							}
+						}
+						tradingBoxItem = EntryExitDataHandleUtils.tradingBoxItemDataHandle(null, item, tradingBox, false
+							, null, "空箱出场", "使用中", "8");
+						tradingBoxItems.add(tradingBoxItem);
+					} else {
+						failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "未查到OW单据");
+						return false;
+					}
+				} else {
+					failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "未查到OW单据");
+					return false;
+				}
+			} else {
+				failureHandling(type, boxDynamicsRecord, "未查到OW放-放箱号:" + item.getHblno() + "单据");
+				return false;
+			}
+			//获取对应放箱号数据
+			PutBox putBoxData = putBoxList.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber())
+				&& ObjectUtils.isNotNull(e.getPolId()) && e.getPolId().equals(item.getPortId())
+				&& ObjectUtils.isNotNull(e.getPolStationId()) && e.getPolStationId().equals(item.getStationId())).findFirst().orElse(null);
+			if (putBoxData != null) {
+				item.setSrcPutBoxId(putBoxData.getId());
+				//放箱号修改后数组存储
+				if (!putBoxes.isEmpty()) {
+					if (!putBoxes.stream().map(PutBox::getId).collect(Collectors.toList()).contains(putBoxData.getId())) {
+						putBoxes.add(putBoxData);
+					}
+				} else {
+					putBoxes.add(putBoxData);
+				}
+				//放箱号箱型与本次出场箱型需一致
+				if (ObjectUtils.isNotNull(putBoxData.getBoxType()) && !putBoxData.getBoxType().equals(item.getBoxType())) {
+					failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "箱型不符合");
+					return false;
+				}
+				//放箱号明细数据处理
+				PutBoxItems putBoxItem;
+				if (!putBoxItemsList.isEmpty()) {
+					putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode()) &&
+						e.getPid().equals(putBoxData.getId())).findFirst().orElse(null);
+					if (putBoxItem != null) {
+						putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, item, putBoxData, false, null, "空箱出场", "使用中", "3", true);
+						putBoxItems.add(putBoxItem);
+					} else {
+						failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "未查到箱号:" + item.getBoxCode() + "进场记录");
+						return false;
+					}
+				} else {
+					failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "未查到箱号:" + item.getBoxCode() + "进场记录");
+					return false;
+				}
+				//存储上一步数据
+				BoxNumUtils.storagePreviousStepData(archives, item);
+				//箱档案数据处理
+				archives = ArchivesUtils.dataAssembly(archives, item, "空箱出场", "使用中", putBoxData.getBoxClass());
+				archivesArrayList.add(archives);
+			} else {
+				failureHandling(type, boxDynamicsRecord, "未查到放箱号:" + item.getContainerNumber() + "单据");
+				return false;
+			}
+		}
+		//放箱号单据
+		if (!putBoxes.isEmpty()) {
+			List<PutBox> putBoxList1 = new ArrayList<>();
+			//本次出场相关放箱号数据处理
+			for (PutBox item : putBoxes) {
+				//主表增加本次出场箱号数据
+				if (ObjectUtils.isNotNull(item.getCode())) {
+					//获取对应放箱号本次出场箱号
+					List<String> codeList = itemsListCC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
+						.map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.toList());
+					for (String e : codeList) {
+						if (!item.getCode().contains(e)) {
+							item.setCode(item.getCode() + "," + e);
+						}
+					}
+				} else {
+					item.setCode(itemsListCC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
+						.map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.joining(",")));
+				}
+				//获取本次出场箱量
+				long count = 0;
+				if (!putBoxItems.isEmpty()) {
+					count = putBoxItems.stream().filter(e -> e.getPid().equals(item.getId())).count();
+				}
+				//放箱号合计箱量-本次出场数量
+				item.setTotalNum(item.getTotalNum() - Integer.parseInt(count + ""));
+				//放箱号盘存箱量-本次出场数量
+				item.setStorageNum(item.getStorageNum() - Integer.parseInt(count + ""));
+				//放箱号占用箱量-本次出场数量
+				item.setOccupyNum(item.getOccupyNum() - Integer.parseInt(count + ""));
+				if (item.getStorageNum() < 0) {
+					failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "剩余场地盘存小于本次导入箱数");
+					return false;
+				}
+				item.setVersion(ObjectUtils.isNull(item.getVersion()) ? 1 : item.getVersion() + 1);
+				putBoxList1.add(item);
+			}
+			putBoxService.saveOrUpdateBatch(putBoxList1);
+		}
+		if (!putBoxItems.isEmpty()) {
+			putBoxItemsService.saveOrUpdateBatch(putBoxItems);
+			//记录对应箱号出场箱轨迹
+			for (PutBoxItems item : putBoxItems) {
+				PutBox tradingBox = putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
+				if (tradingBox != null) {
+					//记录箱轨迹信息
+					ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
+					archivesTrajectory.setPortId(tradingBox.getPolId());
+					archivesTrajectory.setPortCode(tradingBox.getPolCode());
+					archivesTrajectory.setPortCname(tradingBox.getPolCname());
+					archivesTrajectory.setPortEname(tradingBox.getPolEname());
+					archivesTrajectory.setStationId(tradingBox.getPolStationId());
+					archivesTrajectory.setStationCode(tradingBox.getPolStationCode());
+					archivesTrajectory.setStationCname(tradingBox.getPolStationCname());
+					archivesTrajectory.setStationEname(tradingBox.getPolStationEname());
+					archivesTrajectory.setContainerNumber(item.getContainerNumber());
+					archivesTrajectory.setBoxStatus(item.getBoxStatus());
+					archivesTrajectory.setBoxType(item.getBoxType());
+					archivesTrajectory.setBoxCategory(item.getBoxClass());
+					archivesTrajectory.setBoxEastId(item.getBoxEastId());
+					archivesTrajectory.setBoxEastName(item.getBoxEastName());
+					archivesTrajectory.setMblno(item.getMblno());
+					archivesTrajectory.setHblno(item.getHblno());
+					BoxDynamicsRecordItems dynamicsRecordItems = itemsListCC.stream().filter(e -> e.getBoxCode().equals(item.getBoxCode())).findFirst().orElse(null);
+					if (dynamicsRecordItems != null) {
+						if ("QZ".equals(dynamicsRecordItems.getObjective())) {
+							archivesTrajectory.setBoxDynamics(BoxDynamicsEnums.getName(dynamicsRecordItems.getObjective() + "C"));
+						} else {
+							archivesTrajectory.setBoxDynamics(BoxDynamicsEnums.getName(dynamicsRecordItems.getObjective()));
+							archivesTrajectory.setNewDate(dynamicsRecordItems.getApproachExitDate());
+						}
+					}
+					if (ObjectUtils.isNotNull(tradingBox.getPodId()) && !tradingBox.getPodId().contains(",")) {
+						archivesTrajectory.setPodId(Long.parseLong(tradingBox.getPodId()));
+						archivesTrajectory.setPodCode(tradingBox.getPodCode());
+						archivesTrajectory.setPodCname(tradingBox.getPodCname());
+						archivesTrajectory.setPodEname(tradingBox.getPodEname());
+					}
+					archivesTrajectory.setStatus(archivesTrajectory.getBoxDynamics());
+					archivesTrajectory.setCorpId(item.getBoxEastId());
+					archivesTrajectory.setCorpName(item.getBoxEastName());
+					archivesTrajectory.setBillType(tradingBox.getBoxType());
+					archivesTrajectory.setCode(item.getBoxCode());
+					archivesTrajectory.setCreateTime(new Date());
+					archivesTrajectory.setCreateUser(AuthUtil.getUserId());
+					archivesTrajectory.setCreateUserName(AuthUtil.getUserName());
+					archivesTrajectory.setTenantId(AuthUtil.getTenantId());
+					archivesTrajectory.setSrcId(tradingBox.getId());
+					archivesTrajectory.setEtd(item.getEtd());
+					archivesTrajectory.setPolCyId(item.getPolCyId());
+					archivesTrajectory.setPolCyCode(item.getPolCyCode());
+					archivesTrajectory.setPolCyCname(item.getPolCyCname());
+					archivesTrajectory.setPolCyEname(item.getPolCyEname());
+					archivesTrajectory.setPolFreeBoxUseDays(item.getPolFreeBoxUseDays());
+					archivesTrajectory.setPolPreAppearanceDate(item.getPolPreAppearanceDate());
+					archivesTrajectory.setPolStationEmptyContainerExitDate(item.getPolStationEmptyContainerExitDate());
+					archivesTrajectory.setPolReturnDate(item.getPolReturnDate());
+					archivesTrajectory.setPolOverdueBoxUseDays(item.getPolOverdueBoxUseDays());
+					archivesTrajectory.setEta(item.getEta());
+					archivesTrajectory.setPodEmptyContainerReturnDate(item.getPodEmptyContainerReturnDate());
+					archivesTrajectory.setPodStationId(item.getPodStationId());
+					archivesTrajectory.setPodStationCode(item.getPodStationCode());
+					archivesTrajectory.setPodStationCname(item.getPodStationCname());
+					archivesTrajectory.setPodStationEname(item.getPodStationEname());
+					archivesTrajectory.setPodFreeBoxUseDays(item.getPodFreeBoxUseDays());
+					archivesTrajectory.setPodBoxUseDays(item.getPodBoxUseDays());
+					archivesTrajectory.setShipNameId(item.getShipNameId());
+					archivesTrajectory.setShipCname(item.getShipCname());
+					archivesTrajectory.setShipEname(item.getShipEname());
+					archivesTrajectory.setShipCode(item.getShipCode());
+					archivesTrajectory.setVoyage(item.getVoyage());
+					archivesTrajectory.setTenantId(boxDynamicsRecord.getTenantId());
+					archivesTrajectoryMapper.insert(archivesTrajectory);
+				}
+			}
+		}
+		if (!archivesArrayList.isEmpty()) {
+			archivesService.saveOrUpdateBatch(archivesArrayList);
+		}
+		//OW放-放箱号单据
+		if (!putBoxItemsOwf.isEmpty()) {
+			putBoxItemsService.saveOrUpdateBatch(putBoxItemsOwf);
+			if (!putBoxesOwf.isEmpty()) {
+				for (PutBox item : putBoxesOwf) {
+					//主表增加本次出场箱号数据
+					if (ObjectUtils.isNotNull(item.getCode())) {
+						//获取对应放箱号本次出场箱号
+						List<String> codeList = putBoxItemsOwf.stream().filter(e -> e.getPid().equals(item.getId()))
+							.map(PutBoxItems::getBoxCode).collect(Collectors.toList());
+						for (String e : codeList) {
+							if (!item.getCode().contains(e)) {
+								item.setCode(item.getCode() + "," + e);
+							}
+						}
+					} else {
+						item.setCode(itemsListCC.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
+							.map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.joining(",")));
+					}
+					item.setVersion(ObjectUtils.isNull(item.getVersion()) ? 1 : item.getVersion() + 1);
+				}
+				putBoxService.updateBatchById(putBoxesOwf);
+			}
+		}
+		//OW放单据
+		if (!tradingBoxItems.isEmpty()) {
+			tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
+			if (!tradingBoxes.isEmpty()) {
+				for (TradingBox item : tradingBoxes) {
+					List<TradingBoxItem> itemList = tradingBoxItems.stream().filter(e -> e.getPid().equals(item.getId()))
+						.collect(Collectors.toList());
+					if (!itemList.isEmpty()) {
+						if (ObjectUtils.isNotNull(item.getCode())) {
+							List<String> codeList = itemList.stream().map(TradingBoxItem::getCode).collect(Collectors.toList());
+							for (String e : codeList) {
+								if (!item.getCode().contains(e)) {
+									item.setCode(item.getCode() + "," + e);
+								}
+							}
+						} else {
+							item.setCode(itemList.stream().map(TradingBoxItem::getCode).collect(Collectors.joining(",")));
+						}
+						item.setSuitcaseNum(item.getSuitcaseNum() + itemList.size());
+						item.setNotSuitcaseNum(item.getBoxNumber() - item.getSuitcaseNum() - item.getCancelNumber());
+						if (item.getNotSuitcaseNum() < 0) {
+							failureHandling(type, boxDynamicsRecord, "放箱号:" + item.getContainerNumber() + "剩余未提箱小于本次导入箱数");
+							return false;
+						}
+						if (!containerNumberItemList.isEmpty()) {
+							SeaContainerNumberItem containerNumberItem = containerNumberItemList.stream().filter(e -> e.getPid().equals(item.getId()))
+								.findFirst().orElse(null);
+							if (containerNumberItem != null) {
+								containerNumberItem.setOutNum(containerNumberItem.getOutNum() + itemList.size());
+								if (Objects.equals(containerNumberItem.getOccupyNum(), containerNumberItem.getOutNum())) {
+									containerNumberItem.setWhetherAppearStatus("1");
+								}
+								containerNumberItem.setUpdateTime(new Date());
+								containerNumberItem.setUpdateUserName(AuthUtil.getUserName());
+								containerNumberItem.setUpdateUser(AuthUtil.getUserId());
+								containerNumberItems.add(containerNumberItem);
+							}
+						}
+					}
+					item.setVersion(ObjectUtils.isNull(item.getVersion()) ? "1" : (Integer.parseInt(item.getVersion()) + 1) + "");
+					tradingBoxMapper.updateById(item);
+				}
+				if (!containerNumberItems.isEmpty()) {
+					seaContainerNumberItemService.updateBatchById(containerNumberItems);
+				}
+			}
+		}
+		//修改同步记录状态并保存对应箱号信息id
+		for (BoxDynamicsRecordItems item : itemsListCC) {
+			item.setWhetherSynchronous("1");
+			if (!putBoxItems.isEmpty()) {
+				putBoxItems.stream().filter(e -> item.getTemporaryId().equals(e.getTemporaryId())).findFirst().ifPresent(putBox -> item.setSrcPutBoxItemsId(putBox.getId()));
+			}
+			if (!tradingBoxItems.isEmpty()) {
+				tradingBoxItems.stream().filter(e -> item.getTemporaryId().equals(e.getTemporaryId())).findFirst().ifPresent(putBox -> item.setSrcTradingBoxItemsId(putBox.getId()));
+			}
+			if (!archivesArrayList.isEmpty()) {
+				archivesArrayList.stream().filter(e -> item.getTemporaryId().equals(e.getTemporaryId())).findFirst().ifPresent(putBox -> item.setSrcArchivesId(putBox.getId()));
+			}
+		}
+		boxDynamicsRecordItemsService.updateBatchById(itemsListCC);
+		return true;
+	}
+
 	private Boolean synchronizationFXHX(List<BoxDynamicsRecordItems> itemsListFXHX, BoxDynamicsRecord boxDynamicsRecord, String type) throws IOException {
 		List<String> boxNum = itemsListFXHX.stream().map(BoxDynamicsRecordItems::getBoxCode).filter(Objects::nonNull)
 			.collect(Collectors.toList());
@@ -4693,7 +5070,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 			.eq(PutBox::getTenantId, boxDynamicsRecord.getTenantId())
 			.eq(PutBox::getIsDeleted, 0)
 			.and(i -> i.in(PutBox::getContainerNumber, containerNumberList).or()
-				.in(PutBox::getContainerNumber, billNoList)));
+				.in(PutBox::getSrcContainerNumber, billNoList)));
 		if (putBoxList.isEmpty()) {
 			failureHandling(type, boxDynamicsRecord, "未查到放箱号单据");
 			return false;
@@ -4750,7 +5127,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 
 			//原OW放-放箱号数据处理
 			Archives finalArchives = archives;
-			PutBox putBoxOldFX = putBoxList.stream().filter(e -> e.getContainerNumber().equals(finalArchives.getBillNo()))
+			PutBox putBoxOldFX = putBoxList.stream().filter(e -> e.getSrcContainerNumber().equals(finalArchives.getBillNo()))
 				.findFirst().orElse(null);
 			if (putBoxOldFX != null) {
 				PutBoxItems putBoxItem;
@@ -4766,7 +5143,13 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							return false;
 						}
 						putBoxItemsOldFXList.add(putBoxItem);
+					} else {
+						failureHandling(type, boxDynamicsRecord, "原OW放-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
+						return false;
 					}
+				} else {
+					failureHandling(type, boxDynamicsRecord, "原OW放-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
+					return false;
 				}
 				if (!tradingBoxList.isEmpty()) {
 					TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBoxOldFX.getSrcId()))
@@ -4788,9 +5171,21 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 								tradingBoxItem = EntryExitDataHandleUtils.tradingBoxItemDataHandle(tradingBoxItem, recordItems, tradingBox,
 									false, null, "已返场", "已还箱", "5");
 								tradingBoxItemOldList.add(tradingBoxItem);
+							} else {
+								failureHandling(type, boxDynamicsRecord, "原OW放单据-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
+								return false;
 							}
+						} else {
+							failureHandling(type, boxDynamicsRecord, "原OW放单据-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
+							return false;
 						}
+					} else {
+						failureHandling(type, boxDynamicsRecord, "原OW放单据-放箱号:" + recordItems.getContainerNumber() + "未查到");
+						return false;
 					}
+				} else {
+					failureHandling(type, boxDynamicsRecord, "原OW放单据-放箱号:" + recordItems.getContainerNumber() + "未查到");
+					return false;
 				}
 			}
 			//原自有箱放箱号数据处理
@@ -4819,7 +5214,13 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							return false;
 						}
 						putBoxItemsOldList.add(putBoxItem);
+					} else {
+						failureHandling(type, boxDynamicsRecord, "原自有箱-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
+						return false;
 					}
+				} else {
+					failureHandling(type, boxDynamicsRecord, "原自有箱-放箱号:" + recordItems.getContainerNumber() + "未查到箱号:" + recordItems.getBoxCode() + "明细数据");
+					return false;
 				}
 			}
 			//箱档案数据处理
@@ -4835,16 +5236,13 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				if (!putBoxItemsList.isEmpty()) {
 					putBoxItem = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(recordItems.getBoxCode())
 						&& putBox.getId().equals(e.getPid())).findFirst().orElse(null);
-					if (putBoxItem != null) {
-						putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, recordItems, putBox,
-							false, null, "空箱提箱进场", "待使用", "5", false);
-						putBoxItemsNewList.add(putBoxItem);
-					}
+					putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(putBoxItem, recordItems, putBox,
+						false, null, "空箱提箱进场", "待使用", "9", false);
 				} else {
 					putBoxItem = EntryExitDataHandleUtils.putBoxItemDataHandle(null, recordItems, putBox,
-						false, null, "空箱提箱进场", "待使用", "5", false);
-					putBoxItemsNewList.add(putBoxItem);
+						false, null, "空箱提箱进场", "待使用", "9", false);
 				}
+				putBoxItemsNewList.add(putBoxItem);
 				recordItems.setSrcPutBoxPodId(putBox.getId());
 				if (putBoxNewList.isEmpty()) {
 					putBoxNewList.add(putBox);

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/PutBoxItemsMapper.xml

@@ -78,7 +78,7 @@
             and lpb.pol_id = #{portId}
         </if>
         <if test="stationId !=null and stationId != ''">
-            and lpb.pol_station_id = #{stationId}
+            and item.pol_cy_id = #{stationId}
         </if>
         <if test="busType != null and busType != ''">
             and lpb.box_class like concat(concat('%', #{busType}),'%')

+ 48 - 21
blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/PutBoxMapper.xml

@@ -107,20 +107,23 @@
     </select>
     <select id="listPort" resultType="org.springblade.los.box.dto.BoxPoolPortDTO">
         SELECT
-        lp.id as portId,
-        lp.cn_name as portName,
-        lpb.pol_station_cname as stationName,
-        lpb.pol_station_id as stationId,
-        lpb.box_class as busType,
-        sum(lpb.remaining_num) as remainingTotal
+        lp.id AS portId,
+        lp.cn_name AS portName,
+        item.pol_cy_cname AS stationName,
+        item.pol_cy_id AS stationId,
+        lpb.box_class AS busType,
+        sum( lpb.remaining_num ) AS remainingTotal
         FROM
-        logistics_put_box lpb
+        logistics_put_box_items item
+        LEFT JOIN logistics_put_box lpb on item.pid = lpb.id
         LEFT JOIN los_b_ports lp ON FIND_IN_SET( lp.id, lpb.pol_id )
         WHERE
         lpb.tenant_id = #{data.tenantId}
         AND lpb.is_deleted = '0'
         AND lp.tenant_id = #{data.tenantId}
         AND lp.is_deleted = '0'
+        AND item.is_deleted = '0'
+        AND item.tenant_id = #{data.tenantId}
         AND lpb.remaining_num > 0
         AND lpb.whether_deactivate = '0'
         <if test='data.containerNumber != null and data.containerNumber != ""'>
@@ -130,7 +133,7 @@
             and lpb.pol_id like concat(concat('%', #{data.polId}),'%')
         </if>
         <if test="data.stationId!=null and data.stationId != ''">
-            and lpb.pol_station_id = #{data.stationId}
+            and item.pol_cy_id = #{data.stationId}
         </if>
         <if test="data.podId!=null and data.podId != ''">
             and lpb.pod_id like concat(concat('%', #{data.podId}),'%')
@@ -158,7 +161,7 @@
             and DATE_FORMAT(lpb.effective_end_date,'%Y-%m-%d') &lt;= DATE_FORMAT(CURDATE(), '%Y-%m-%d')
         </if>
         GROUP BY
-        lp.id,lpb.box_class,lpb.pol_station_id
+        lp.id,lpb.box_class,item.pol_cy_id
     </select>
     <select id="selectBoxNumber" resultType="java.util.Map">
         SELECT
@@ -174,6 +177,9 @@
         AND box_status = '好箱'
         AND status = '待使用'
         AND box_type = '20GP'
+        <if test="stationId !=null and stationId != ''">
+            and pol_cy_id = #{stationId}
+        </if>
         ) AS gP20Good,
         (
         SELECT
@@ -187,6 +193,9 @@
         AND box_status = '好箱'
         AND status = '待使用'
         AND box_type = '40GP'
+        <if test="stationId !=null and stationId != ''">
+            and pol_cy_id = #{stationId}
+        </if>
         ) AS gP40Good,
         (
         SELECT
@@ -200,6 +209,9 @@
         AND box_status = '好箱'
         AND status = '待使用'
         AND box_type = '40HC'
+        <if test="stationId !=null and stationId != ''">
+            and pol_cy_id = #{stationId}
+        </if>
         ) AS hG40Good,
         (
         SELECT
@@ -213,6 +225,9 @@
         AND box_status = '好箱'
         AND status = '待使用'
         AND NOT FIND_IN_SET( box_type, '40HC,40GP,20GP' )
+        <if test="stationId !=null and stationId != ''">
+            and pol_cy_id = #{stationId}
+        </if>
         ) AS otherGood,
         (
         SELECT
@@ -226,6 +241,9 @@
         AND box_status = '坏箱'
         AND status = '待使用'
         AND box_type = '20GP'
+        <if test="stationId !=null and stationId != ''">
+            and pol_cy_id = #{stationId}
+        </if>
         ) AS gP20Bad,
         (
         SELECT
@@ -239,6 +257,9 @@
         AND box_status = '坏箱'
         AND status = '待使用'
         AND box_type = '40GP'
+        <if test="stationId !=null and stationId != ''">
+            and pol_cy_id = #{stationId}
+        </if>
         ) AS gP40Bad,
         (
         SELECT
@@ -252,6 +273,9 @@
         AND box_status = '坏箱'
         AND status = '待使用'
         AND box_type = '40HC'
+        <if test="stationId !=null and stationId != ''">
+            and pol_cy_id = #{stationId}
+        </if>
         ) AS hG40Bad,
         (
         SELECT
@@ -265,6 +289,9 @@
         AND box_status = '坏箱'
         AND status = '待使用'
         AND NOT FIND_IN_SET( box_type, '40HC,40GP,20GP' )
+        <if test="stationId !=null and stationId != ''">
+            and pol_cy_id = #{stationId}
+        </if>
         ) AS otherBad
         FROM
             logistics_put_box lpb
@@ -275,9 +302,6 @@
         <if test="portId !=null and portId != ''">
             and lpb.pol_id like concat(concat('%', #{portId}),'%')
         </if>
-        <if test="stationId !=null and stationId != ''">
-            and lpb.pol_station_id = #{stationId}
-        </if>
         <if test="busType != null and busType != ''">
             and lpb.box_class like concat(concat('%', #{busType}),'%')
         </if>
@@ -313,20 +337,23 @@
     </select>
     <select id="listPortExport" resultType="org.springblade.los.box.dto.BoxPoolPortDTO">
         SELECT
-        lp.id as portId,
-        lp.cn_name as portName,
-        lpb.pol_station_cname as stationName,
-        lpb.pol_station_id as stationId,
-        lpb.box_class as busType,
-        sum(lpb.remaining_num) as remainingTotal
+        lp.id AS portId,
+        lp.cn_name AS portName,
+        item.pol_cy_cname AS stationName,
+        item.pol_cy_id AS stationId,
+        lpb.box_class AS busType,
+        sum( lpb.remaining_num ) AS remainingTotal
         FROM
-        logistics_put_box lpb
+        logistics_put_box_items item
+        LEFT JOIN logistics_put_box lpb on item.pid = lpb.id
         LEFT JOIN los_b_ports lp ON FIND_IN_SET( lp.id, lpb.pol_id )
         WHERE
         lpb.tenant_id = #{data.tenantId}
         AND lpb.is_deleted = '0'
         AND lp.tenant_id = #{data.tenantId}
         AND lp.is_deleted = '0'
+        AND item.is_deleted = '0'
+        AND item.tenant_id = #{data.tenantId}
         AND lpb.remaining_num > 0
         AND lpb.whether_deactivate = '0'
         <if test='data.containerNumber != null and data.containerNumber != ""'>
@@ -336,7 +363,7 @@
             and lpb.pol_id like concat(concat('%', #{data.polId}),'%')
         </if>
         <if test="data.stationId!=null and data.stationId != ''">
-            and lpb.pol_station_id = #{data.stationId}
+            and item.pol_cy_id = #{data.stationId}
         </if>
         <if test="data.podId!=null and data.podId != ''">
             and lpb.pod_id like concat(concat('%', #{data.podId}),'%')
@@ -364,7 +391,7 @@
             and DATE_FORMAT(lpb.effective_end_date,'%Y-%m-%d') &lt;= DATE_FORMAT(CURDATE(), '%Y-%m-%d')
         </if>
         GROUP BY
-        lp.id,lpb.box_class,lpb.pol_station_id
+        lp.id,lpb.box_class,item.pol_cy_id
     </select>
     <select id="listContainerNumberExport" resultType="org.springblade.los.box.dto.BoxPoolContainerNumberDTO">
         SELECT

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

@@ -169,6 +169,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 			lambdaQueryWrapper.eq(PutBox::getIsDeleted, 0)
 				.eq(PutBox::getTenantId, AuthUtil.getTenantId())
 				.eq(PutBox::getContainerNumber, putBox.getContainerNumber())
+				.eq(PutBox::getBoxClass, putBox.getBoxClass())
 			;
 			putBoxList = baseMapper.selectList(lambdaQueryWrapper);
 		}

+ 4 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java

@@ -2449,6 +2449,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				item.setApproveTime(null);
 				item.setAuditStatus("0");
 				item.setStlPid(null);
+				item.setAutomaticGenerated("0");
 			}
 		}
 		List<FeeCenter> feeCenterListD = new ArrayList<>();
@@ -2536,6 +2537,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				item.setApproveTime(null);
 				item.setAuditStatus("0");
 				item.setStlPid(null);
+				item.setAutomaticGenerated("0");
 			}
 		}
 		Bills copyBills = new Bills();
@@ -4450,6 +4452,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 						feeCenter.setApproveTime(null);
 						feeCenter.setAuditStatus("0");
 						feeCenter.setStlPid(null);
+						feeCenter.setAutomaticGenerated("0");
 						copyFeeCenterList.add(feeCenter);
 					}
 				}
@@ -4528,6 +4531,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 						feeCenter.setApproveTime(null);
 						feeCenter.setAuditStatus("0");
 						feeCenter.setStlPid(null);
+						feeCenter.setAutomaticGenerated("0");
 						copyFeeCenterList.add(feeCenter);
 					}
 				}

+ 57 - 57
blade-service/blade-los/src/main/java/org/springblade/los/finance/stl/service/impl/FinStlBillsServiceImpl.java

@@ -2340,7 +2340,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 						finAccBills.setUpdateUserName(AuthUtil.getUserName());
 						int isChecked = 0;
 						if (exrateType.equals(item.getCurCode())) {
-							finAccBills.setReconciliationAmount(finAccBills.getReconciliationAmount().abs().add(item.getCurrentStlAmount().abs()));
+							finAccBills.setReconciliationAmount(finAccBills.getReconciliationAmount().add(item.getCurrentStlAmount()));
 							if ("D".equals(finAccBills.getAccountDc())) {
 								if (finAccBills.getAmountDr().abs().compareTo(finAccBills.getReconciliationAmount().abs()) > 0) {
 									isChecked = 1;
@@ -2361,7 +2361,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 								}
 							}
 						} else {
-							finAccBills.setReconciliationAmountUsd(finAccBills.getReconciliationAmountUsd().abs().add(item.getCurrentStlAmount().abs()));
+							finAccBills.setReconciliationAmountUsd(finAccBills.getReconciliationAmountUsd().add(item.getCurrentStlAmount()));
 							if ("D".equals(finAccBills.getAccountDc())) {
 								if (finAccBills.getAmountDrUsd().abs().compareTo(finAccBills.getReconciliationAmountUsd().abs()) > 0) {
 									isChecked = 1;
@@ -2386,7 +2386,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 						finAccBillsList.add(finAccBills);
 						List<FeeCenter> feeCenters = feeCenterListAll.stream().filter(e -> e.getAccBillId().equals(finAccBills.getId()))
 							.collect(Collectors.toList());
-						BigDecimal currentStlAmount = item.getCurrentStlAmount().abs();
+						BigDecimal currentStlAmount = item.getCurrentStlAmount();
 						for (FeeCenter feeCenter : feeCenters) {
 							feeCenter.setCheckBillId(stlBills.getId());
 							feeCenter.setCheckBillNo(stlBills.getBillNo());
@@ -2401,18 +2401,18 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 								break;
 							} else {
 								if (feeCenter.getAmount().abs().subtract(feeCenter.getReconciliationAmount().abs()).compareTo(currentStlAmount.abs()) > 0) {
-									feeCenter.setReconciliationAmount(feeCenter.getReconciliationAmount().abs().add(currentStlAmount));
+									feeCenter.setReconciliationAmount(feeCenter.getReconciliationAmount().add(currentStlAmount));
 									currentStlAmount = new BigDecimal("0.00");
 								} else if (feeCenter.getAmount().abs().subtract(feeCenter.getReconciliationAmount().abs()).compareTo(currentStlAmount.abs()) == 0) {
-									feeCenter.setReconciliationAmount(feeCenter.getReconciliationAmount().abs().add(currentStlAmount));
+									feeCenter.setReconciliationAmount(feeCenter.getReconciliationAmount().add(currentStlAmount));
 									currentStlAmount = new BigDecimal("0.00");
 								} else {
 									if (new BigDecimal("0.00").compareTo(currentStlAmount) > 0) {
 										currentStlAmount = currentStlAmount.add((feeCenter.getAmount().abs().subtract(feeCenter.getReconciliationAmount().abs())).abs());
 									} else {
-										currentStlAmount = currentStlAmount.subtract((feeCenter.getAmount().abs().subtract(feeCenter.getReconciliationAmount().abs())));
+										currentStlAmount = currentStlAmount.subtract((feeCenter.getAmount().subtract(feeCenter.getReconciliationAmount())));
 									}
-									feeCenter.setReconciliationAmount(feeCenter.getAmount().abs());
+									feeCenter.setReconciliationAmount(feeCenter.getAmount());
 								}
 							}
 							feeCenterList.add(feeCenter);
@@ -2492,7 +2492,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 								throw new RuntimeException("本次申请金额大于未申请金额");
 							}
 						}
-						finAccBills.setAppliedAmountUsd(finAccBills.getAppliedAmountUsd().abs().add(item.getCurrentStlAmount().abs()));
+						finAccBills.setAppliedAmountUsd(finAccBills.getAppliedAmountUsd().add(item.getCurrentStlAmount()));
 					}
 					finAccBillsList.add(finAccBills);
 					//计算字段null值处理
@@ -2501,7 +2501,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 					item.setCurrentStlDiscount(ObjectUtils.isNotNull(item.getCurrentStlDiscount()) ? item.getCurrentStlDiscount() : new BigDecimal("0.00"));
 					List<FeeCenter> feeCenters = feeCenterListAll.stream().filter(e -> e.getAccBillId().equals(finAccBills.getId()))
 						.collect(Collectors.toList());
-					BigDecimal currentStlAmount = item.getCurrentStlAmount().abs();
+					BigDecimal currentStlAmount = item.getCurrentStlAmount();
 					for (FeeCenter e : feeCenters) {
 						int version = StringUtil.isBlank(e.getVersion()) ? 1 : Integer.parseInt(e.getVersion());
 						e.setVersion(String.valueOf(version + 1));
@@ -2512,15 +2512,15 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 							e.setAmount(ObjectUtils.isNotNull(e.getAmount()) ? e.getAmount() : new BigDecimal("0.00"));
 							e.setStlTtlAmount(ObjectUtils.isNotNull(e.getStlTtlAmount()) ? e.getStlTtlAmount() : new BigDecimal("0.00"));
 							if (e.getAmount().abs().subtract(e.getAppliedAmount().abs()).subtract(e.getStlTtlAmount().abs()).compareTo(currentStlAmount.abs()) > 0) {
-								e.setAppliedAmount(e.getAppliedAmount().abs().add(currentStlAmount));
+								e.setAppliedAmount(e.getAppliedAmount().add(currentStlAmount));
 								currentStlAmount = new BigDecimal("0.00");
 							} else if (e.getAmount().abs().subtract(e.getAppliedAmount().abs()).subtract(e.getStlTtlAmount().abs()).compareTo(currentStlAmount.abs()) == 0) {
-								e.setAppliedAmount(e.getAppliedAmount().abs().add(currentStlAmount));
+								e.setAppliedAmount(e.getAppliedAmount().add(currentStlAmount));
 								currentStlAmount = new BigDecimal("0.00");
 							} else {
-								BigDecimal subAmount = e.getAmount().abs().subtract(e.getAppliedAmount().abs());
+								BigDecimal subAmount = e.getAmount().subtract(e.getAppliedAmount());
 								currentStlAmount = currentStlAmount.subtract(subAmount);
-								e.setAppliedAmount(e.getAmount().abs());
+								e.setAppliedAmount(e.getAmount());
 							}
 							feeCenterList.add(e);
 						}
@@ -2593,12 +2593,12 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 					//计算字段null值处理
 					if ("D".equals(item.getDc())) {
 						if (exrateType.equals(item.getCurCode())) {
-							finAccBills.setStlAmountDr(finAccBills.getStlAmountDr().abs().add(item.getCurrentStlAmount().abs()));
-							finAccBills.setStlAmountDrLoc(finAccBills.getStlAmountDrLoc().abs().add(item.getCurrentStlAmount().abs()));
+							finAccBills.setStlAmountDr(finAccBills.getStlAmountDr().add(item.getCurrentStlAmount()));
+							finAccBills.setStlAmountDrLoc(finAccBills.getStlAmountDrLoc().add(item.getCurrentStlAmount()));
 						} else {
-							finAccBills.setStlAmountDrUsd(finAccBills.getStlAmountDrUsd().abs().add(item.getCurrentStlAmount().abs()));
-							BigDecimal cny = item.getCurrentStlAmount().abs().multiply(item.getCurrentStlExrate());
-							finAccBills.setStlAmountDrLoc(finAccBills.getStlAmountDrLoc().abs().add(cny));
+							finAccBills.setStlAmountDrUsd(finAccBills.getStlAmountDrUsd().add(item.getCurrentStlAmount()));
+							BigDecimal cny = item.getCurrentStlAmount().multiply(item.getCurrentStlExrate());
+							finAccBills.setStlAmountDrLoc(finAccBills.getStlAmountDrLoc().add(cny));
 						}
 						if (finAccBills.getAmountDr().abs().compareTo(finAccBills.getStlAmountDr().abs()) == 0 &&
 							finAccBills.getAmountDrUsd().abs().compareTo(finAccBills.getStlAmountDrUsd().abs()) == 0) {
@@ -2611,12 +2611,12 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 						}
 					} else if ("C".equals(item.getDc())) {
 						if (exrateType.equals(item.getCurCode())) {
-							finAccBills.setStlAmountCr(finAccBills.getStlAmountCr().abs().add(item.getCurrentStlAmount().abs()));
-							finAccBills.setStlAmountCrLoc(finAccBills.getStlAmountCrLoc().abs().add(item.getCurrentStlAmount().abs()));
+							finAccBills.setStlAmountCr(finAccBills.getStlAmountCr().add(item.getCurrentStlAmount()));
+							finAccBills.setStlAmountCrLoc(finAccBills.getStlAmountCrLoc().add(item.getCurrentStlAmount()));
 						} else {
-							finAccBills.setStlAmountCrUsd(finAccBills.getStlAmountCrUsd().abs().add(item.getCurrentStlAmount().abs()));
-							BigDecimal cny = item.getCurrentStlAmount().abs().multiply(item.getCurrentStlExrate());
-							finAccBills.setStlAmountCrLoc(finAccBills.getStlAmountCrLoc().abs().add(cny));
+							finAccBills.setStlAmountCrUsd(finAccBills.getStlAmountCrUsd().add(item.getCurrentStlAmount()));
+							BigDecimal cny = item.getCurrentStlAmount().multiply(item.getCurrentStlExrate());
+							finAccBills.setStlAmountCrLoc(finAccBills.getStlAmountCrLoc().add(cny));
 						}
 						if (finAccBills.getAmountCr().abs().compareTo(finAccBills.getStlAmountCr().abs()) == 0 &&
 							finAccBills.getAmountCrUsd().abs().compareTo(finAccBills.getStlAmountCrUsd().abs()) == 0) {
@@ -2642,7 +2642,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 					finAccBillsList.add(finAccBills);
 					List<FeeCenter> feeCenters = feeCenterListAll.stream().filter(e -> e.getAccBillId().equals(finAccBills.getId()))
 						.collect(Collectors.toList());
-					BigDecimal currentStlAmount = item.getCurrentStlAmount().abs();
+					BigDecimal currentStlAmount = item.getCurrentStlAmount();
 					BigDecimal stlTtlAmount = feeCenters.stream().map(FeeCenter::getStlTtlAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 					if (item.getCurrentStlAmount().compareTo(new BigDecimal("0.00")) == 0 ||
 						item.getCurrentStlAmount().abs().compareTo(item.getAmount().abs().subtract(stlTtlAmount).abs()) > 0) {
@@ -2674,17 +2674,17 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 							e.setStlById(stlBills.getCreateUser());
 							e.setStlByName(stlBills.getCreateUserName());
 							if (e.getAmount().abs().subtract(e.getStlTtlAmount().abs()).compareTo(currentStlAmount.abs()) > 0) {
-								e.setUnsettledAmount(e.getAmount().abs().subtract(e.getStlTtlAmount().abs()).subtract(currentStlAmount));
-								e.setStlTtlAmount(e.getAmount().abs().subtract(e.getUnsettledAmount().abs()));
+								e.setUnsettledAmount(e.getAmount().subtract(e.getStlTtlAmount()).subtract(currentStlAmount));
+								e.setStlTtlAmount(e.getAmount().subtract(e.getUnsettledAmount()));
 								currentStlAmount = new BigDecimal("0.00");
 							} else if (e.getAmount().abs().subtract(e.getStlTtlAmount().abs()).compareTo(currentStlAmount.abs()) == 0) {
 								e.setUnsettledAmount(new BigDecimal("0.00"));
-								e.setStlTtlAmount(e.getAmount().abs().subtract(e.getUnsettledAmount().abs()));
+								e.setStlTtlAmount(e.getAmount().subtract(e.getUnsettledAmount()));
 								currentStlAmount = new BigDecimal("0.00");
 							} else {
 								e.setUnsettledAmount(new BigDecimal("0.00"));
-								currentStlAmount = currentStlAmount.subtract((e.getAmount().abs().subtract(e.getStlTtlAmount().abs())));
-								e.setStlTtlAmount(e.getAmount().abs().subtract(e.getUnsettledAmount().abs()));
+								currentStlAmount = currentStlAmount.subtract((e.getAmount().subtract(e.getStlTtlAmount())));
+								e.setStlTtlAmount(e.getAmount().subtract(e.getUnsettledAmount()));
 							}
 							feeCenterList.add(e);
 						}
@@ -3002,7 +3002,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 							if (finAccBills.getReconciliationAmount().abs().compareTo(item.getCurrentStlAmount().abs()) < 0) {
 								throw new RuntimeException("撤销失败,本次对账金额大于已对账金额");
 							}
-							finAccBills.setReconciliationAmount(finAccBills.getReconciliationAmount().abs().subtract(item.getCurrentStlAmount().abs()));
+							finAccBills.setReconciliationAmount(finAccBills.getReconciliationAmount().subtract(item.getCurrentStlAmount()));
 							if ("D".equals(finAccBills.getAccountDc())) {
 								if (finAccBills.getAmountDr().abs().compareTo(finAccBills.getReconciliationAmount().abs()) > 0) {
 									isChecked = 1;
@@ -3016,7 +3016,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 							if (finAccBills.getReconciliationAmountUsd().abs().compareTo(item.getCurrentStlAmount().abs()) < 0) {
 								throw new RuntimeException("撤销失败,本次对账金额大于已对账金额");
 							}
-							finAccBills.setReconciliationAmountUsd(finAccBills.getReconciliationAmountUsd().abs().subtract(item.getCurrentStlAmount().abs()));
+							finAccBills.setReconciliationAmountUsd(finAccBills.getReconciliationAmountUsd().subtract(item.getCurrentStlAmount()));
 							if ("D".equals(finAccBills.getAccountDc())) {
 								if (finAccBills.getAmountDrUsd().abs().compareTo(finAccBills.getReconciliationAmountUsd().abs()) > 0) {
 									isChecked = 1;
@@ -3031,7 +3031,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 						finAccBillsList.add(finAccBills);
 						List<FeeCenter> feeCenters = feeCenterListAll.stream().filter(e -> e.getAccBillId().equals(finAccBills.getId()))
 							.collect(Collectors.toList());
-						BigDecimal currentStlAmount = item.getCurrentStlAmount().abs();
+						BigDecimal currentStlAmount = item.getCurrentStlAmount();
 						for (FeeCenter feeCenter : feeCenters) {
 							feeCenter.setCheckBillId(0L);
 							feeCenter.setCheckBillNo("");
@@ -3046,14 +3046,14 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 								break;
 							} else {
 								if (feeCenter.getReconciliationAmount().abs().compareTo(currentStlAmount.abs()) > 0) {
-									feeCenter.setReconciliationAmount(feeCenter.getReconciliationAmount().abs().subtract(currentStlAmount));
+									feeCenter.setReconciliationAmount(feeCenter.getReconciliationAmount().subtract(currentStlAmount));
 									currentStlAmount = new BigDecimal("0.00");
 								} else if (feeCenter.getReconciliationAmount().abs().compareTo(currentStlAmount.abs()) == 0) {
-									feeCenter.setReconciliationAmount(feeCenter.getReconciliationAmount().abs().subtract(currentStlAmount));
+									feeCenter.setReconciliationAmount(feeCenter.getReconciliationAmount().subtract(currentStlAmount));
 									currentStlAmount = new BigDecimal("0.00");
 								} else {
 									feeCenter.setReconciliationAmount(new BigDecimal("0.00"));
-									currentStlAmount = currentStlAmount.subtract(feeCenter.getAmount().abs());
+									currentStlAmount = currentStlAmount.subtract(feeCenter.getAmount());
 								}
 							}
 							feeCenterList.add(feeCenter);
@@ -3071,12 +3071,12 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 						if (item.getCurrentStlAmount().abs().compareTo(finAccBills.getAppliedAmount().abs()) > 0) {
 							throw new RuntimeException("本次申请金额大于未申请金额");
 						}
-						finAccBills.setAppliedAmount(finAccBills.getAppliedAmount().abs().subtract(item.getCurrentStlAmount().abs()));
+						finAccBills.setAppliedAmount(finAccBills.getAppliedAmount().subtract(item.getCurrentStlAmount()));
 					} else {
 						if (item.getCurrentStlAmount().abs().compareTo(finAccBills.getAppliedAmountUsd().abs()) > 0) {
 							throw new RuntimeException("本次申请金额大于未申请金额");
 						}
-						finAccBills.setAppliedAmountUsd(finAccBills.getAppliedAmountUsd().abs().subtract(item.getCurrentStlAmount().abs()));
+						finAccBills.setAppliedAmountUsd(finAccBills.getAppliedAmountUsd().subtract(item.getCurrentStlAmount()));
 					}
 					finAccBillsList.add(finAccBills);
 					//计算字段null值处理
@@ -3085,7 +3085,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 					item.setCurrentStlDiscount(ObjectUtils.isNotNull(item.getCurrentStlDiscount()) ? item.getCurrentStlDiscount() : new BigDecimal("0.00"));
 					List<FeeCenter> feeCenters = feeCenterListAll.stream().filter(e -> e.getAccBillId().equals(finAccBills.getId()))
 						.collect(Collectors.toList());
-					BigDecimal currentStlAmount = item.getCurrentStlAmount().abs();
+					BigDecimal currentStlAmount = item.getCurrentStlAmount();
 					for (FeeCenter e : feeCenters) {
 						int version = StringUtil.isBlank(e.getVersion()) ? 1 : Integer.parseInt(e.getVersion());
 						e.setVersion(String.valueOf(version + 1));
@@ -3097,14 +3097,14 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 							e.setStlTtlAmount(ObjectUtils.isNotNull(e.getStlTtlAmount()) ? e.getStlTtlAmount() : new BigDecimal("0.00"));
 
 							if (e.getAppliedAmount().abs().compareTo(currentStlAmount.abs()) > 0) {
-								e.setAppliedAmount(e.getAppliedAmount().abs().subtract(currentStlAmount));
+								e.setAppliedAmount(e.getAppliedAmount().subtract(currentStlAmount));
 								currentStlAmount = new BigDecimal("0.00");
 							} else if (e.getAppliedAmount().abs().compareTo(currentStlAmount.abs()) == 0) {
-								e.setAppliedAmount(e.getAppliedAmount().abs().subtract(currentStlAmount));
+								e.setAppliedAmount(e.getAppliedAmount().subtract(currentStlAmount));
 								currentStlAmount = new BigDecimal("0.00");
 							} else {
 								e.setAppliedAmount(new BigDecimal("0.00"));
-								currentStlAmount = currentStlAmount.subtract(e.getAmount().abs());
+								currentStlAmount = currentStlAmount.subtract(e.getAmount());
 							}
 							feeCenterList.add(e);
 						}
@@ -3124,12 +3124,12 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 					//计算字段null值处理
 					if ("D".equals(item.getDc())) {
 						if (exrateType.equals(item.getCurCode())) {
-							finAccBills.setStlAmountDr(finAccBills.getStlAmountDr().abs().subtract(item.getCurrentStlAmount().abs()));
-							finAccBills.setStlAmountDrLoc(finAccBills.getStlAmountDrLoc().abs().subtract(item.getCurrentStlAmount().abs()));
+							finAccBills.setStlAmountDr(finAccBills.getStlAmountDr().subtract(item.getCurrentStlAmount()));
+							finAccBills.setStlAmountDrLoc(finAccBills.getStlAmountDrLoc().subtract(item.getCurrentStlAmount()));
 						} else {
-							finAccBills.setStlAmountDrUsd(finAccBills.getStlAmountDrUsd().abs().subtract(item.getCurrentStlAmount().abs()));
-							BigDecimal cny = currencyUtils.converter(item.getDc(), curExrateList, item.getCurrentStlAmount().abs(), item.getCurCode(), "2");
-							finAccBills.setStlAmountDrLoc(finAccBills.getStlAmountDrLoc().abs().subtract(cny));
+							finAccBills.setStlAmountDrUsd(finAccBills.getStlAmountDrUsd().subtract(item.getCurrentStlAmount()));
+							BigDecimal cny = currencyUtils.converter(item.getDc(), curExrateList, item.getCurrentStlAmount(), item.getCurCode(), "2");
+							finAccBills.setStlAmountDrLoc(finAccBills.getStlAmountDrLoc().subtract(cny));
 						}
 						if (finAccBills.getAmountDr().compareTo(new BigDecimal("0.00")) == 0 &&
 							finAccBills.getAmountDrUsd().compareTo(new BigDecimal("0.00")) == 0) {
@@ -3151,12 +3151,12 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 
 					} else if ("C".equals(item.getDc())) {
 						if (exrateType.equals(item.getCurCode())) {
-							finAccBills.setStlAmountCr(finAccBills.getStlAmountCr().abs().subtract(item.getCurrentStlAmount().abs()));
-							finAccBills.setStlAmountCrLoc(finAccBills.getStlAmountCrLoc().abs().subtract(item.getCurrentStlAmount().abs()));
+							finAccBills.setStlAmountCr(finAccBills.getStlAmountCr().subtract(item.getCurrentStlAmount()));
+							finAccBills.setStlAmountCrLoc(finAccBills.getStlAmountCrLoc().subtract(item.getCurrentStlAmount()));
 						} else {
-							finAccBills.setStlAmountCrUsd(finAccBills.getStlAmountCrUsd().abs().subtract(item.getCurrentStlAmount().abs()));
-							BigDecimal cny = currencyUtils.converter(item.getDc(), curExrateList, item.getCurrentStlAmount().abs(), item.getCurCode(), "2");
-							finAccBills.setStlAmountCrLoc(finAccBills.getStlAmountCrLoc().abs().subtract(cny));
+							finAccBills.setStlAmountCrUsd(finAccBills.getStlAmountCrUsd().subtract(item.getCurrentStlAmount()));
+							BigDecimal cny = currencyUtils.converter(item.getDc(), curExrateList, item.getCurrentStlAmount(), item.getCurCode(), "2");
+							finAccBills.setStlAmountCrLoc(finAccBills.getStlAmountCrLoc().subtract(cny));
 						}
 						if (finAccBills.getAmountCr().compareTo(new BigDecimal("0.00")) == 0 &&
 							finAccBills.getAmountCrUsd().compareTo(new BigDecimal("0.00")) == 0) {
@@ -3185,7 +3185,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 					finAccBillsList.add(finAccBills);
 					List<FeeCenter> feeCenters = feeCenterListAll.stream().filter(e -> e.getAccBillId().equals(finAccBills.getId()))
 						.collect(Collectors.toList());
-					BigDecimal currentStlAmount = item.getCurrentStlAmount().abs();
+					BigDecimal currentStlAmount = item.getCurrentStlAmount();
 					for (FeeCenter e : feeCenters) {
 						int version = StringUtil.isBlank(e.getVersion()) ? 1 : Integer.parseInt(e.getVersion());
 						e.setVersion(String.valueOf(version + 1));
@@ -3208,17 +3208,17 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 							e.setStlById(0L);
 							e.setStlByName("");
 							if (e.getStlTtlAmount().abs().compareTo(currentStlAmount.abs()) > 0) {
-								e.setStlTtlAmount(e.getStlTtlAmount().abs().subtract(currentStlAmount));
-								e.setUnsettledAmount(e.getAmount().abs().subtract(e.getStlTtlAmount().abs()));
+								e.setStlTtlAmount(e.getStlTtlAmount().subtract(currentStlAmount));
+								e.setUnsettledAmount(e.getAmount().subtract(e.getStlTtlAmount()));
 								currentStlAmount = new BigDecimal("0.00");
 							} else if (e.getStlTtlAmount().abs().compareTo(currentStlAmount.abs()) == 0) {
 								e.setStlTtlAmount(new BigDecimal("0.00"));
-								e.setUnsettledAmount(e.getAmount().abs().subtract(e.getStlTtlAmount().abs()));
+								e.setUnsettledAmount(e.getAmount().subtract(e.getStlTtlAmount()));
 								currentStlAmount = new BigDecimal("0.00");
 							} else {
 								e.setStlTtlAmount(new BigDecimal("0.00"));
-								e.setUnsettledAmount(e.getAmount().abs().subtract(e.getStlTtlAmount().abs()));
-								currentStlAmount = currentStlAmount.subtract(e.getAmount().abs());
+								e.setUnsettledAmount(e.getAmount().subtract(e.getStlTtlAmount()));
+								currentStlAmount = currentStlAmount.subtract(e.getAmount());
 							}
 							feeCenterList.add(e);
 						}