Browse Source

Merge remote-tracking branch 'origin/dev' into dev

liyuan 3 months ago
parent
commit
ce772416ea

+ 5 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/entity/FinAccBills.java

@@ -772,5 +772,10 @@ public class FinAccBills implements Serializable {
 	@ApiModelProperty(value = "集装箱箱数英文")
 	private String quantityCntrDescr;
 
+	/**
+	 * 是否审核时生成账单
+	 */
+	@TableField(exist = false)
+	private Boolean isAuditing;
 
 }

+ 89 - 20
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java

@@ -202,9 +202,15 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if ("1".equals(status)) {
 				R<User> resUser = userClient.userInfoById(AuthUtil.getUserId());
 				if (resUser.isSuccess() && resUser.getData() != null) {
-					dept.setEmail(resUser.getData().getEmail());
-					dept.setTel(resUser.getData().getPhone());
-					dept.setContacts(resUser.getData().getRealName());
+					if(ObjectUtils.isNotNull(resUser.getData().getEmail())) {
+						dept.setEmail(resUser.getData().getEmail());
+					}
+					if(ObjectUtils.isNotNull(resUser.getData().getPhone())) {
+						dept.setTel(resUser.getData().getPhone());
+					}
+					if(ObjectUtils.isNotNull(resUser.getData().getRealName())) {
+						dept.setContacts(resUser.getData().getRealName());
+					}
 				}
 			}
 		} else {
@@ -853,6 +859,10 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 		// String debug = System.getProperty("java.debug");
 		boolean isDebug = true; // (debug != null && debug.toLowerCase().startsWith("true"));
 
+		List<Long> psFeeIds = new ArrayList<>();
+		psFeeIds.add(220L);
+		psFeeIds.add(623L);
+
 		R<Dept> res = sysClient.getDept(deptUtils.getDeptPid());
 		Dept dept;
 		if (res.isSuccess() && res.getData() != null) {
@@ -861,9 +871,15 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			if ("1".equals(status)) {
 				R<User> resUser = userClient.userInfoById(AuthUtil.getUserId());
 				if (resUser.isSuccess() && resUser.getData() != null) {
-					dept.setEmail(resUser.getData().getEmail());
-					dept.setTel(resUser.getData().getPhone());
-					dept.setContacts(resUser.getData().getRealName());
+					if(ObjectUtils.isNotNull(resUser.getData().getEmail())) {
+						dept.setEmail(resUser.getData().getEmail());
+					}
+					if(ObjectUtils.isNotNull(resUser.getData().getPhone())) {
+						dept.setTel(resUser.getData().getPhone());
+					}
+					if(ObjectUtils.isNotNull(resUser.getData().getRealName())) {
+						dept.setContacts(resUser.getData().getRealName());
+					}
 				}
 			}
 		} else {
@@ -1833,6 +1849,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
 				List<FeeCenter> feeCenterList;
 				List<Long> ids = new ArrayList<>();
+				// 第一条费用的制单人
+				Long firstFeeUser = 0L;
 				if (MagicValues.MM.equals(bills.getBillType())) {
 					List<Bills> billsList = billsService.list(new LambdaQueryWrapper<Bills>()
 						.eq(Bills::getTenantId, AuthUtil.getTenantId())
@@ -1856,7 +1874,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 					.eq(FeeCenter::getDc, MagicValues.D)
-					.eq(FeeCenter::getIsDeleted, 0);
+					.eq(FeeCenter::getIsDeleted, 0)
+					.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds);
 				lambdaQueryWrapper.in(FeeCenter::getPid, ids);
 				if (MagicValues.RECEIVABLE_BILL.equals(groupCode)) {
 					lambdaQueryWrapper.eq(FeeCenter::getAccStatus, 1);
@@ -1886,6 +1905,9 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				BigDecimal amountProfitLoc;
 				List<FeeCenterReports> feeCenterReportsList = new ArrayList<>();
 				for (FeeCenter item : feeCenterList) {
+					if(firstFeeUser==0){
+						firstFeeUser = ObjectUtils.isNotNull(item.getCreateUser()) ? item.getCreateUser() : 0;
+					}
 					if (ObjectUtils.isNotNull(item.getShortName())) {
 						item.setCorpCnName(item.getShortName());
 					} else {
@@ -1938,7 +1960,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocD(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReports.setExrate(item.getExrate());
 					feeCenterReports.setQuantity(item.getQuantity());
 					feeCenterReports.setUnitNo(item.getUnitNo());
@@ -1985,6 +2007,25 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					bills.setAddress(bCorpsBanks.get(0).getAddress());
 					bills.setSwiftCode(bCorpsBanks.get(0).getSwiftCode());
 				}
+
+				String status = firstFeeUser > 0 ? "1" : "0";
+				if ("1".equals(status)) {
+					R<User> resUser = userClient.userInfoById(firstFeeUser);
+					if (resUser.isSuccess() && resUser.getData() != null) {
+						if(ObjectUtils.isNotNull(resUser.getData().getEmail())) {
+							dept.setEmail(resUser.getData().getEmail());
+						}
+						/*
+						if(ObjectUtils.isNotNull(resUser.getData().getPhone())) {
+							dept.setTel(resUser.getData().getPhone());
+						}
+						if(ObjectUtils.isNotNull(resUser.getData().getRealName())) {
+							dept.setContacts(resUser.getData().getRealName());
+						}
+  					 */
+					}
+				}
+
 				bills.setDept(dept);
 				map.put(MagicValues.DATA, bills);
 			} else {
@@ -2002,6 +2043,10 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
 				List<FeeCenter> feeCenterList;
 				List<Long> ids = new ArrayList<>();
+
+				// 第一条费用的制单人
+				Long firstFeeUser = 0L;
+
 				if (MagicValues.MM.equals(bills.getBillType())) {
 					List<Bills> billsList = billsService.list(new LambdaQueryWrapper<Bills>()
 						.eq(Bills::getTenantId, AuthUtil.getTenantId())
@@ -2025,7 +2070,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 					.eq(FeeCenter::getDc, MagicValues.C)
-					.eq(FeeCenter::getIsDeleted, 0);
+					.eq(FeeCenter::getIsDeleted, 0)
+					.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds);
 				lambdaQueryWrapper.in(FeeCenter::getPid, ids);
 				if (ObjectUtils.isNotNull(corpIds)) {
 					lambdaQueryWrapper.eq(FeeCenter::getCorpId, corpIds);
@@ -2055,6 +2101,10 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				BigDecimal amountProfitLoc;
 				List<FeeCenterReports> feeCenterReportsList = new ArrayList<>();
 				for (FeeCenter item : feeCenterList) {
+					if(firstFeeUser==0){
+						firstFeeUser = ObjectUtils.isNotNull(item.getCreateUser()) ? item.getCreateUser() : 0;
+					}
+
 					if (ObjectUtils.isNotNull(item.getShortName())) {
 						item.setCorpCnName(item.getShortName());
 					} else {
@@ -2107,7 +2157,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocC(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReports.setExrate(item.getExrate());
 					feeCenterReports.setQuantity(item.getQuantity());
 					feeCenterReports.setUnitNo(item.getUnitNo());
@@ -2145,6 +2195,25 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					bills.setCapitalLettersUsd(BigDecimalUtils.convertToEnglish(amountCrLoc.divide(exrateD, 2, RoundingMode.HALF_UP)));
 				}*/
 				bills.setAmountProfitLoc(amountProfitLoc);
+
+				String status = firstFeeUser > 0 ? "1" : "0";
+				if ("1".equals(status)) {
+					R<User> resUser = userClient.userInfoById(firstFeeUser);
+					if (resUser.isSuccess() && resUser.getData() != null) {
+						if(ObjectUtils.isNotNull(resUser.getData().getEmail())) {
+							dept.setEmail(resUser.getData().getEmail());
+						}
+						/*
+						if(ObjectUtils.isNotNull(resUser.getData().getPhone())) {
+							dept.setTel(resUser.getData().getPhone());
+						}
+						if(ObjectUtils.isNotNull(resUser.getData().getRealName())) {
+							dept.setContacts(resUser.getData().getRealName());
+						}
+  					 */
+					}
+				}
+
 				bills.setDept(dept);
 				map.put(MagicValues.DATA, bills);
 			} else {
@@ -3652,7 +3721,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocD(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				if (!feeCenterList.isEmpty()) {
@@ -3781,7 +3850,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocD(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				if (!feeCenterList.isEmpty()) {
@@ -3909,7 +3978,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocC(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				if (!feeCenterList.isEmpty()) {
@@ -4028,7 +4097,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocC(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				if (!feeCenterList.isEmpty()) {
@@ -4174,7 +4243,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocC(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				if (!feeCenterList.isEmpty()) {
@@ -4292,7 +4361,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocC(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				if (!feeCenterList.isEmpty()) {
@@ -6789,7 +6858,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocD(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				if (!feeCenterList.isEmpty()) {
@@ -6903,7 +6972,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocD(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				if (!feeCenterList.isEmpty()) {
@@ -7016,7 +7085,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocC(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				if (!feeCenterList.isEmpty()) {
@@ -7120,7 +7189,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 					feeCenterReports.setAmountLocC(item.getAmountLoc());
 					feeCenterReports.setHblno(item.getHblno());
-					feeCenterReports.setAmount(item.getQuantity() + "*" + item.getPrice());
+					feeCenterReports.setAmount(item.getQuantity().setScale(2) + "*" + item.getPrice().setScale(2));
 					feeCenterReportsList.add(feeCenterReports);
 				}
 				if (!feeCenterList.isEmpty()) {

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/impl/AeaBillsServiceImpl.java

@@ -1028,6 +1028,7 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 			finAccBills.setBillNoFormat("HYZD");
 			finAccBills.setAccountType("");
 			finAccBills.setRefno(bills.getRefno());
+			finAccBills.setIsAuditing(true);
 			finAccBillsService.generateBill(finAccBills);
 		}
 		return R.success("操作成功");

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java

@@ -518,6 +518,7 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 			finAccBills.setBookingNo(bills.getBookingNo());
 			finAccBills.setPolNamePrint(bills.getPolNamePrint());
 			finAccBills.setPodNamePrint(bills.getPodNamePrint());
+			finAccBills.setIsAuditing(true);
 			finAccBillsService.generateBill(finAccBills);
 		}
 		return R.success("操作成功");

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/customsDeclaration/service/impl/CustomsDeclarationServiceImpl.java

@@ -509,6 +509,7 @@ public class CustomsDeclarationServiceImpl extends ServiceImpl<CustomsDeclaratio
 			finAccBills.setBillNoFormat("HYZD");
 			finAccBills.setAccountType("");
 			finAccBills.setRefno(customsDeclaration.getRefno());
+			finAccBills.setIsAuditing(true);
 			finAccBillsService.generateBill(finAccBills);
 		}
 		return R.success("操作成功");

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

@@ -1680,6 +1680,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			finAccBills.setBookingNo(bills.getBookingNo());
 			finAccBills.setPolNamePrint(bills.getPolNamePrint());
 			finAccBills.setPodNamePrint(bills.getPodNamePrint());
+			finAccBills.setIsAuditing(true);
 			finAccBillsService.generateBill(finAccBills);
 		}
 		return R.success("操作成功");

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

@@ -1966,6 +1966,8 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 						containers.setCreateUser(bills.getCreateUser());
 						containers.setCreateUserName(bills.getCreateUserName());
 						containers.setTenantId(AuthUtil.getTenantId());
+						containers.setMblno(bills.getMblno());
+						containers.setHblno(bills.getHblno());
 
 						containers.setCntrTypeCode(cntrType);
 						containers.setCntrNo(cntrNo);

+ 2 - 3
blade-service/blade-los/src/main/java/org/springblade/los/business/update/controller/UpdateItemController.java

@@ -45,7 +45,6 @@ import org.springblade.core.boot.ctrl.BladeController;
 @RequestMapping("/updateitem")
 @Api(value = "业务修改明细表", tags = "业务修改明细表接口")
 public class UpdateItemController extends BladeController {
-
 	private final IUpdateItemService updateItemService;
 
 	/**
@@ -111,7 +110,7 @@ public class UpdateItemController extends BladeController {
 		return R.status(updateItemService.saveOrUpdate(updateItem));
 	}
 
-	
+
 	/**
 	 * 删除 业务修改明细表
 	 */
@@ -122,5 +121,5 @@ public class UpdateItemController extends BladeController {
 		return R.status(updateItemService.removeByIds(Func.toLongList(ids)));
 	}
 
-	
+
 }

+ 5 - 0
blade-service/blade-los/src/main/java/org/springblade/los/check/service/impl/AuditProecessServiceImpl.java

@@ -622,6 +622,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 					finAccBills.setPodNamePrint(bills.getPodNamePrint());
 					finAccBills.setTeamId(bills.getTeamId());
 					finAccBills.setTeamName(bills.getTeamName());
+					finAccBills.setIsAuditing(true);
 					finAccBillsService.generateBill(finAccBills);
 				}
 				feeCenterService.saveOrUpdateBatch(feeCenterList);
@@ -1318,6 +1319,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 					finAccBills.setBookingNo(bills.getBookingNo());
 					finAccBills.setPolNamePrint(bills.getPolNamePrint());
 					finAccBills.setPodNamePrint(bills.getPodNamePrint());
+					finAccBills.setIsAuditing(true);
 					finAccBillsService.generateBill(finAccBills);
 				}
 				String status = sysClient.getParamServiceNew("automatic.generate.voucher");
@@ -3044,6 +3046,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 					finAccBills.setWarehousingDate(bills.getWarehousingDate());
 					finAccBills.setOutboundDate(bills.getOutboundDate());
 					finAccBills.setRefno(bills.getRefno());
+					finAccBills.setIsAuditing(true);
 					finAccBillsService.generateBill(finAccBills);
 				}
 				feeCenterService.saveOrUpdateBatch(feeCenterList);
@@ -3318,6 +3321,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 					finAccBills.setBillNoFormat("HYZD");
 					finAccBills.setAccountType("");
 					finAccBills.setRefno(customsDeclaration.getRefno());
+					finAccBills.setIsAuditing(true);
 					finAccBillsService.generateBill(finAccBills);
 				}
 				feeCenterService.saveOrUpdateBatch(feeCenterList);
@@ -3830,6 +3834,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 					finAccBills.setBillNoFormat("HYZD");
 					finAccBills.setAccountType("");
 					finAccBills.setRefno(bills.getRefno());
+					finAccBills.setIsAuditing(true);
 					finAccBillsService.generateBill(finAccBills);
 				}
 				feeCenterService.saveOrUpdateBatch(feeCenterList);

+ 31 - 13
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java

@@ -57,10 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -1091,13 +1088,19 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 
 	@Override
 	public List<BCorps> getFeeCenterCorpIds(Long billId, String dc, String type, String accBillNo) {
+		List<Long> psFeeIds = new ArrayList<>();
+		psFeeIds.add(220L);
+		psFeeIds.add(623L);
+
 		if (ObjectUtils.isNotNull(accBillNo) && "1".equals(accBillNo)) {
 			List<FeeCenter> feeCenterList = baseMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
 				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 				.eq(FeeCenter::getIsDeleted, 0)
 				.eq(FeeCenter::getAccStatus, 1)
 				.eq(FeeCenter::getPid, billId)
-				.eq(FeeCenter::getDc, dc));
+				.eq(FeeCenter::getDc, dc)
+				.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds)
+			);
 			List<BCorps> bCorpsList = new ArrayList<>();
 			if (!feeCenterList.isEmpty()) {
 				List<String> accBillNoList = feeCenterList.stream().map(FeeCenter::getAccBillNo).filter(Objects::nonNull)
@@ -1126,7 +1129,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 							.eq(Bills::getTenantId, AuthUtil.getTenantId())
 							.eq(Bills::getIsDeleted, 0)
 							.eq(Bills::getMasterId, bills.getId())
-							.eq(Bills::getMasterBillNo, bills.getBillNo()));
+							.eq(Bills::getMasterBillNo, bills.getBillNo())
+						);
 						if (!billsList.isEmpty()) {
 							List<Long> billIds;
 							billIds = billsList.stream().map(Bills::getId).collect(Collectors.toList());
@@ -1140,7 +1144,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 								.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 								.eq(FeeCenter::getIsDeleted, 0)
 								.eq(FeeCenter::getDc, dc)
-								.in(FeeCenter::getPid, billIds));
+								.in(FeeCenter::getPid, billIds)
+								.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds)
+							);
 							if (!feeCenterList.isEmpty()) {
 								corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
 							}
@@ -1150,7 +1156,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 						.eq(FeeCenter::getIsDeleted, 0)
 						.eq(FeeCenter::getDc, dc)
-						.eq(FeeCenter::getPid, billId));
+						.eq(FeeCenter::getPid, billId)
+						.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds)
+					);
 					if (!feeCenterList.isEmpty()) {
 						corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
 					}
@@ -1177,7 +1185,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 								.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 								.eq(FeeCenter::getIsDeleted, 0)
 								.eq(FeeCenter::getDc, dc)
-								.in(FeeCenter::getPid, billIds));
+								.in(FeeCenter::getPid, billIds)
+								.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds)
+							);
 							if (!feeCenterList.isEmpty()) {
 								corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
 							}
@@ -1187,7 +1197,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 						.eq(FeeCenter::getIsDeleted, 0)
 						.eq(FeeCenter::getDc, dc)
-						.eq(FeeCenter::getPid, billId));
+						.eq(FeeCenter::getPid, billId)
+						.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds)
+					);
 					if (!feeCenterList.isEmpty()) {
 						corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
 					}
@@ -1199,7 +1211,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 						.eq(FeeCenter::getIsDeleted, 0)
 						.eq(FeeCenter::getDc, dc)
-						.eq(FeeCenter::getPid, billId));
+						.eq(FeeCenter::getPid, billId)
+						.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds)
+					);
 					if (!feeCenterList.isEmpty()) {
 						corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
 					}
@@ -1211,7 +1225,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 						.eq(FeeCenter::getIsDeleted, 0)
 						.eq(FeeCenter::getDc, dc)
-						.eq(FeeCenter::getPid, billId));
+						.eq(FeeCenter::getPid, billId)
+						.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds)
+					);
 					if (!feeCenterList.isEmpty()) {
 						corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
 					}
@@ -1223,7 +1239,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 						.eq(FeeCenter::getIsDeleted, 0)
 						.eq(FeeCenter::getDc, dc)
-						.eq(FeeCenter::getPid, billId));
+						.eq(FeeCenter::getPid, billId)
+						.notIn(!psFeeIds.isEmpty(), FeeCenter::getFeeId, psFeeIds)
+					);
 					if (!feeCenterList.isEmpty()) {
 						corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
 					}

+ 27 - 13
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FinAccBillsServiceImpl.java

@@ -148,18 +148,26 @@ public class FinAccBillsServiceImpl extends ServiceImpl<FinAccBillsMapper, FinAc
 		List<Amends> amendsList = new ArrayList<>();
 		List<Long> ids = finAccBills.getFeeCenterList().stream().map(FeeCenter::getPid).collect(Collectors.toList());
 		String status = sysClient.getParamService("generate.billing.rules");
+		String isAuditing = ObjectUtils.isNotNull(finAccBills.getIsAuditing()) && finAccBills.getIsAuditing()==true ? "T" : "F";
 		for (FeeCenter item : finAccBills.getFeeCenterList()) {
 			if (1 == item.getAccStatus()) {
 				throw new RuntimeException("费用:" + item.getFeeCnName() + "已生成账单");
 			}
-			boolean amountStatus = true;
+			String amountStatus = "T";
 			if (new BigDecimal("0.00").compareTo(item.getAmount()) > 0) {
-				amountStatus = false;
+				amountStatus = "F";
 			}
 			if ("1".equals(status)) {
 				if (ObjectUtils.isNotNull(item.getPid()) && ObjectUtils.isNotNull(item.getCorpId()) &&
-					ObjectUtils.isNotNull(item.getDc()) && ObjectUtils.isNotNull(item.getElementsId()) && ObjectUtils.isNotNull(item.getCurCode())) {
-					item.setBillKey(item.getPid() + "-" + item.getCorpId() + "-" + item.getDc() + "-" + item.getElementsCode() + "-" + item.getCurCode() + "-" + amountStatus);
+					ObjectUtils.isNotNull(item.getDc()) && ObjectUtils.isNotNull(item.getFeeId()) && ObjectUtils.isNotNull(item.getCurCode())) {
+					// 费用 CODE 改为核算要素 code
+					// 应收费用核算要素固定为 3 其他费用
+					// item.getPid() + "-" + item.getCorpId() + "-" + item.getDc() + "-" + item.getFeeCode() + "-" + item.getCurCode() + "-" + amountStatus;
+					String eleCode = "D".equals(item.getDc()) ? "3" : item.getElementsCode();
+					String billKey = isAuditing + item.getPid() + "-" + item.getCorpId() + "-" + item.getDc() + "-" + eleCode + "-" + item.getCurCode() + "-" + amountStatus;
+					billKey += ObjectUtils.isNotNull(item.getTaxRate()) ? "-" + item.getTaxRate().setScale(3).toString() : "-0";
+					billKey += ObjectUtils.isNotNull(item.getSurchargeRate()) ? "-" + item.getSurchargeRate().setScale(3).toString() : "-0";
+					item.setBillKey(billKey);
 				} else {
 					throw new RuntimeException("单据号、单位、费用类型、核算要素不能为空");
 				}
@@ -171,7 +179,6 @@ public class FinAccBillsServiceImpl extends ServiceImpl<FinAccBillsMapper, FinAc
 					throw new RuntimeException("单据号、单位、费用类型、费用名称不能为空");
 				}
 			}
-
 		}
 		BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
 			.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
@@ -544,30 +551,37 @@ public class FinAccBillsServiceImpl extends ServiceImpl<FinAccBillsMapper, FinAc
 		List<Amends> amendsList = new ArrayList<>();
 		List<Long> ids = Func.toLongList(billsIds);
 		String status = sysClient.getParamService("generate.billing.rules");
+		String isAuditing = "T";
 		for (FeeCenter item : feeCenterListOld) {
 			if (1 == item.getAccStatus()) {
 				throw new RuntimeException("费用:" + item.getFeeCnName() + "已生成账单");
 			}
-			boolean amountStatus = true;
+			String amountStatus = "T";
 			if (new BigDecimal("0.00").compareTo(item.getAmount()) > 0) {
-				amountStatus = false;
+				amountStatus = "F";
 			}
 			if ("1".equals(status)) {
 				if (ObjectUtils.isNotNull(item.getPid()) && ObjectUtils.isNotNull(item.getCorpId()) &&
-					ObjectUtils.isNotNull(item.getDc()) && ObjectUtils.isNotNull(item.getElementsId()) && ObjectUtils.isNotNull(item.getCurCode())) {
-					item.setBillKey(item.getPid() + "-" + item.getCorpId() + "-" + item.getDc() + "-" + item.getElementsCode() + "-" + item.getCurCode() + "-" + amountStatus);
+					ObjectUtils.isNotNull(item.getDc()) && ObjectUtils.isNotNull(item.getFeeId()) && ObjectUtils.isNotNull(item.getCurCode())) {
+					// 费用 CODE 改为核算要素 code
+					// 应收费用核算要素固定为 3 其他费用
+					// item.getPid() + "-" + item.getCorpId() + "-" + item.getDc() + "-" + item.getFeeCode() + "-" + item.getCurCode() + "-" + amountStatus;
+					String eleCode = "D".equals(item.getDc()) ? "3" : item.getElementsCode();
+					String billKey = isAuditing + item.getPid() + "-" + item.getCorpId() + "-" + item.getDc() + "-" + eleCode + "-" + item.getCurCode() + "-" + amountStatus;
+					billKey += ObjectUtils.isNotNull(item.getTaxRate()) ? "-" + item.getTaxRate().setScale(3).toString() : "-0";
+					billKey += ObjectUtils.isNotNull(item.getSurchargeRate()) ? "-" + item.getSurchargeRate().setScale(3).toString() : "-0";
+					item.setBillKey(billKey);
 				} else {
-					throw new RuntimeException("单据号、单位、费用类型、核算要素不能为空");
+					throw new RuntimeException("单据号、单位、费用类型、费用名称不能为空");
 				}
 			} else {
 				if (ObjectUtils.isNotNull(item.getPid()) && ObjectUtils.isNotNull(item.getCorpId()) &&
-					ObjectUtils.isNotNull(item.getDc()) && ObjectUtils.isNotNull(item.getFeeId()) && ObjectUtils.isNotNull(item.getCurCode())) {
+					ObjectUtils.isNotNull(item.getDc()) && ObjectUtils.isNotNull(item.getElementsId()) && ObjectUtils.isNotNull(item.getCurCode())) {
 					item.setBillKey(item.getPid() + "-" + item.getCorpId() + "-" + item.getDc() + "-" + item.getFeeCode() + "-" + item.getCurCode() + "-" + amountStatus);
 				} else {
-					throw new RuntimeException("单据号、单位、费用类型、费用名称不能为空");
+					throw new RuntimeException("单据号、单位、费用类型、核算要素不能为空");
 				}
 			}
-
 		}
 		BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
 			.eq(BusinessType::getTenantId, AuthUtil.getTenantId())

+ 359 - 0
blade-service/blade-los/src/main/java/org/springblade/los/sldc/sldcApiController.java

@@ -0,0 +1,359 @@
+package org.springblade.los.sldc;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.common.annotation.RepeatSubmit;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.Util.BigDecimalUtils;
+import org.springblade.los.basic.corps.service.IBCorpsService;
+import org.springblade.los.business.sea.entity.*;
+import org.springblade.los.business.sea.service.IBillsService;
+import org.springblade.los.business.sea.service.IContainersService;
+import org.springblade.los.business.sea.service.IPreContainersService;
+import org.springblade.los.external.Luhaitong.ApiController;
+import org.springblade.los.gmy.entity.GmyDeclHead;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import org.springblade.los.basic.corps.entity.BCorps;
+
+import javax.validation.Valid;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/sldcApi")
+@Api(value = "海运出口场站箱封号接口", tags = "海运出口场站箱封号接口")
+public class sldcApiController {
+	private final ISysClient sysClient;
+
+	private final IBillsService billsService;
+	private final IPreContainersService preContainersService;
+	private final IContainersService containersService;
+
+	private final IBCorpsService corpsService;
+
+	private final ApiController lht;
+
+	@GetMapping("/detail")
+	public R detail(@RequestParam("id") String id ) throws IOException {
+		Bills bill = billsService.getOne(new LambdaQueryWrapper<Bills>()
+			.select(Bills::getId, Bills::getBillNo, Bills::getCarrierId, Bills::getCarrierShortName,
+				Bills::getBookingNo, Bills::getMblno, Bills::getCyId, Bills::getCyCode)
+			.eq(Bills::getId, id)
+			.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0));
+		if(ObjectUtils.isNull(bill)){
+			throw new RemoteException("id " + id + " 不存在,无法查询箱封号!");
+		}
+
+		// CarrierId==10	QDCMA
+		// CarrierId==18	QDPIL
+		// CarrierId==19	QDHAPAG
+		// CarrierId==11207	QDONE
+		// CarrierId==8,MSC,地中海航运
+		Long carrierId = bill.getCarrierId();
+		String mblNo = carrierId==8 ? bill.getBookingNo() : bill.getMblno();
+		if(ObjectUtils.isNull(mblNo) || mblNo.isEmpty()){
+			throw new RemoteException("该业务没有录入提单号,无法查询箱封号!");
+		}
+
+		Long cyId = ObjectUtils.isNotNull(bill.getCyId()) ? bill.getCyId() : 0;
+		String cyCode = "";
+		if(cyId>0){
+			BCorps cyCorp =	corpsService.getOne(new LambdaQueryWrapper<BCorps>()
+				.select(BCorps::getId, BCorps::getUnCode)
+				.eq(BCorps::getId, cyId)
+				.eq(BCorps::getTenantId, AuthUtil.getTenantId())
+				.eq(BCorps::getIsDeleted, 0));
+			if(ObjectUtils.isNotNull(cyCorp)){
+				cyCode = (ObjectUtils.isNotNull(cyCorp.getUnCode()) ? cyCorp.getUnCode() : "").toLowerCase();
+			}
+		}
+		if (cyCode.isEmpty()){
+			throw new RemoteException("场站没有录入或场站代码没有维护,不能查询!");
+		}
+
+		if(cyCode.compareTo("cygj")==0) cyCode = "glj";
+		if(cyCode.compareTo("cygf")==0) cyCode = "gjf";
+		if (",glr,glj,glx,glhai,glhua,gjf,".contains("," + cyCode + ",")){
+			R r = lht.detail(mblNo, cyCode);
+			return r;
+		}
+
+		String url = "http://112.6.239.197:8096/sldc/ContainerTracking/json?";
+		url += "mblNo=" + mblNo;
+		url += "&containerNo=";
+		url += "&bookingNo=";
+		url += "&customerCode=" + cyCode;
+
+		URL Url = new URL(url);    // 把字符串转换为URL请求地址
+		HttpURLConnection connection = (HttpURLConnection) Url.openConnection();// 打开连接
+		connection.setRequestMethod("GET");
+		// 添加自定义的Header信息
+		connection.addRequestProperty("Host", "112.6.239.197");
+		connection.connect();// 连接会话
+
+		// 获取输入流
+		BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+		String line;
+		StringBuilder sb = new StringBuilder();
+		while ((line = br.readLine()) != null) {// 循环读取流
+			sb.append(line);
+		}
+		br.close();// 关闭流
+		connection.disconnect();// 断开连接
+
+		JSONObject js = JSON.parseObject(sb.toString());
+		JSONArray jaCntrs = null;
+		if(ObjectUtils.isNotNull(js) && js.containsKey("main")){
+			JSONObject main = js.getJSONObject("main");
+			if(main.containsKey("data")){
+				JSONObject jsData = main.getJSONObject("data");
+				if(jsData.containsKey("containers")){
+					jaCntrs = jsData.getJSONArray("containers");
+				}
+			}
+		}
+
+		JSONArray cntrs = JSON.parseArray("[]");
+
+		if(ObjectUtils.isNotNull(jaCntrs) && jaCntrs.size()>0){
+			// 根据船公司查询箱型
+			// CarrierId==10	QDCMA
+			// CarrierId==18	QDPIL
+			// CarrierId==19	QDHAPAG
+			// CarrierId==11207	QDONE
+			Boolean flag = false;
+			if(carrierId==10 || carrierId==18 || carrierId==19 || carrierId==11207){
+				LambdaQueryWrapper<PreContainers> qry = new LambdaQueryWrapper<PreContainers>();
+				qry.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
+					.eq(PreContainers::getIsDeleted, 0)
+					.eq(PreContainers::getPid, bill.getId());
+				if(carrierId==19 || carrierId==11207){
+					qry.eq(PreContainers::getCntrTypeCode, "40NOR");
+				}
+				if(carrierId==10){
+					qry.and(q->q.eq(PreContainers::getCntrTypeCode, "40NOR").or().eq(PreContainers::getCntrTypeCode, "40HQ"));
+				}
+				if(carrierId==18){
+					qry.eq(PreContainers::getCntrTypeCode, "40HQ");
+				}
+
+				int pc = preContainersService.count(qry);
+				flag = pc>0;
+			}
+
+			List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
+				.eq(PreContainers::getIsDeleted, 0)
+				.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
+				.eq(PreContainers::getPid, bill.getId()));
+
+			List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+				.eq(Containers::getIsDeleted, 0)
+				.eq(Containers::getTenantId, AuthUtil.getTenantId())
+				.eq(Containers::getPid, bill.getId()));
+
+			for (Object jaCntr : jaCntrs) {
+				JSONObject jc = (JSONObject) jaCntr;
+				JSONObject jo = new JSONObject();
+				jo.put("index", cntrs.size() + 1);
+				jo.put("mblNo", jc.getString("mblno"));
+
+				String cntrNo = jc.getString("containerno").trim();
+				String ct = jc.getString("containertype").trim();
+
+				jo.put("cntrNo", cntrNo);
+				jo.put("sealNo", jc.getString("containersealno"));
+				if(flag && (carrierId==19 || carrierId==11207)) {
+					ct = ct.replace("RH", "NOR");
+				}
+				if(flag && (carrierId==10)) {
+					ct = ct.replace("HC", "HQ");
+				}
+				if(flag && (carrierId==18)) {
+					if("40HC".equals(ct)) {
+						ct = ct.replace("HC", "HQ");
+					}
+					if("40RH".equals(ct)) {
+						ct = ct.replace("RH", "NOR");
+					}
+				}
+				jo.put("cntrType", ct);
+				String cntrType = ct;
+
+				PreContainers preCntr = null;
+				if(ObjectUtils.isNotNull(preContainersList)) {
+					preCntr = preContainersList.stream().filter(e->cntrType.compareTo(e.getCntrTypeCode()) == 0).findFirst().orElse(null);
+				}
+
+				jo.put("cntrTypeExists", ObjectUtils.isNotNull(preCntr));
+				jo.put("qty", jc.getInteger("quantity"));
+				jo.put("gwt", jc.getDouble("grossweight"));
+				jo.put("vol", jc.getDouble("volume"));
+
+				Containers cntr = null;
+				if(ObjectUtils.isNotNull(containersList)){
+					cntr = containersList.stream().filter(e->cntrNo.compareTo(e.getCntrNo()) == 0 && mblNo.compareTo(e.getMblno())==0).findFirst().orElse(null);
+				}
+
+				if(ObjectUtils.isNotNull(cntr)){
+					jo.put("oldCntrType", cntr.getCntrTypeCode());
+					jo.put("oldSealNo", cntr.getSealNo());
+					jo.put("oldQty", cntr.getQuantity().doubleValue());
+					jo.put("oldGwt", cntr.getGrossWeight().doubleValue());
+					jo.put("oldVol", cntr.getMeasurement().doubleValue());
+					// 是否最新数据
+					Boolean isNewest = cntr.getCntrTypeCode().compareTo(ct)!=0
+						|| cntr.getSealNo().compareTo(jc.getString("containersealno"))!=0
+						|| cntr.getQuantity().compareTo(new BigDecimal(jc.getInteger("quantity").toString()))!=0
+						|| cntr.getQuantity().compareTo(jc.getBigDecimal("grossweight"))!=0
+						|| cntr.getQuantity().compareTo(jc.getBigDecimal("volume"))!=0;
+					jo.put("isNewest", isNewest);
+					// status: 是否已配箱
+					jo.put("status", "已配箱");
+				}else {
+					jo.put("oldCntrType", "");
+					jo.put("oldSealNo", "");
+					jo.put("oldQty", 0L);
+					jo.put("oldGwt", 0F);
+					jo.put("oldVol", 0F);
+					// 是否最新数据
+					jo.put("isNewest", true);
+					// status: 是否已配箱
+					jo.put("status", "");
+				}
+				jo.put("selected", true);
+				cntrs.add(jo);
+			}
+		}
+
+		return R.data(cntrs);
+	}
+
+	/**
+	 * 提交 sldc, pil 始终不导件重尺
+	 *
+	 * @param mode true 导入箱封号、件重尺,false 只导入箱封号,不导入件重尺
+	 * @param data 箱数据
+	 */
+	@PostMapping("/submit")
+	@RepeatSubmit
+	@Transactional(rollbackFor = Exception.class)
+	public R submit(@RequestParam("mode") Boolean mode, @RequestParam("id") String id, @Valid @RequestBody String data) throws IOException {
+		Bills bill = billsService.getOne(new LambdaQueryWrapper<Bills>()
+			.select(Bills::getId, Bills::getBillNo, Bills::getCarrierId, Bills::getCarrierShortName,
+				Bills::getBookingNo, Bills::getMblno, Bills::getCyId, Bills::getCyCode,
+				Bills::getBranchId, Bills::getCreateUser, Bills::getCreateUserName, Bills::getHblno,
+				Bills::getPackingUnitId, Bills::getPackingUnit)
+			.eq(Bills::getId, id)
+			.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0));
+		if(ObjectUtils.isNull(bill)){
+			throw new RemoteException("id " + id + " 不存在,无法查询箱封号!");
+		}
+
+		JSONArray ja = JSON.parseArray(data);
+		if(ObjectUtils.isNull(ja) && ja.isEmpty()){
+			return R.fail("没有选择箱号!");
+		}
+
+		String mblNo = ObjectUtils.isNotNull(bill.getMblno()) ? bill.getMblno().trim() : "";
+		Boolean bImportPWV = mode; // && bill.getCarrierId()!=18;
+		BigDecimal sumQty = new BigDecimal(0L);
+		BigDecimal sumGw = new BigDecimal(0L);
+		BigDecimal sumVol = BigDecimal.ZERO;
+
+		List<Containers> containersList = new ArrayList<>();
+		//
+		for (Object jaCntr : ja) {
+			JSONObject jc = (JSONObject) jaCntr;
+
+			if(mblNo.compareTo(jc.getString("mblNo"))==0) {
+				Containers containers = new Containers();
+				containers.setId(null);
+				containers.setPid(bill.getId());
+				containers.setBranchId(bill.getBranchId());
+				containers.setBillNo(bill.getBillNo());
+				containers.setCreateUser(bill.getCreateUser());
+				containers.setCreateUserName(bill.getCreateUserName());
+				containers.setTenantId(AuthUtil.getTenantId());
+				containers.setMblno(bill.getMblno());
+				containers.setHblno(mblNo);
+
+				containers.setCntrTypeCode(jc.getString("cntrType"));
+				containers.setCntrNo(jc.getString("cntrNo"));
+				containers.setSealNo(jc.getString("sealNo"));
+
+				if (bImportPWV) {
+					double q1 = jc.getDouble("qty");
+					containers.setQuantity(BigDecimal.valueOf(q1));
+					sumQty = sumQty.add(new BigDecimal(q1));
+					double w1 = jc.getDouble("gwt");
+					containers.setGrossWeight(BigDecimal.valueOf(w1));
+					sumGw = sumGw.add(new BigDecimal(w1));
+					double v1 = jc.getDouble("vol");
+					containers.setMeasurement(BigDecimal.valueOf(v1));
+					sumVol = sumVol.add(new BigDecimal(v1));
+				}
+				containers.setPackingUnitId(bill.getPackingUnitId());
+				containers.setPackingUnit(bill.getPackingUnit());
+				containersList.add(containers);
+			}
+		}
+
+		// 删除
+		if (containersList.size() > 0) {
+			containersService.deleteByPid(bill.getId());
+			// 保存配箱箱号明细
+			containersService.submitList(containersList);
+		}else{
+			throw new RemoteException("没有该提单号下的箱号!");
+		}
+		if(bImportPWV) {
+			// 修改主表件重尺
+			sumQty.setScale(0, BigDecimal.ROUND_HALF_UP);
+			bill.setQuantity(sumQty);
+			bill.setQuantityPackingDescr("SAY " + BigDecimalUtils.convertToEnglish(bill.getQuantity()) + " " + bill.getPackingUnit() + " ONLY.");
+			bill.setCfsQuantity(sumQty);
+			sumGw.setScale(3, BigDecimal.ROUND_HALF_UP);
+			bill.setGrossWeight(sumGw);
+			bill.setCfsGrossWeight(sumGw);
+			sumVol.setScale(3, BigDecimal.ROUND_HALF_UP);
+			bill.setMeasurement(containersList.stream().map(Containers::getMeasurement).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP));
+			bill.setCfsMeasurement(bill.getMeasurement());
+
+			billsService.update(null, new LambdaUpdateWrapper<Bills>()
+				.set(Bills::getQuantity, bill.getQuantity())
+				.set(Bills::getQuantityPackingDescr, bill.getQuantityPackingDescr())
+				.set(Bills::getCfsQuantity, bill.getCfsQuantity())
+				.set(Bills::getGrossWeight, bill.getGrossWeight())
+				.set(Bills::getCfsGrossWeight, bill.getCfsGrossWeight())
+				.set(Bills::getMeasurement, bill.getMeasurement())
+				.set(Bills::getCfsMeasurement, bill.getCfsMeasurement())
+				.eq(Bills::getId, bill.getId())
+			);
+		}
+
+		return R.success("ok");
+	}
+}