wfg 1 year ago
parent
commit
14b8abc27d

+ 7 - 1
blade-service/blade-los/src/main/java/org/springblade/los/Util/RegularUtils.java

@@ -429,7 +429,13 @@ public class RegularUtils {
 			c++;
 		}
 		sb.append(suffix);
-		return sb.toString();
+
+		String  r = sb.toString();
+		if(r.length()>length){
+			r = copySubstring(r, 0, length);
+		}
+
+		return r;
 	}
 
 	/**

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/Util/Regular_PIL.java

@@ -136,11 +136,11 @@ public class Regular_PIL {
 		}
 		//交货地代码
 		if (ObjectUtils.isNull(ediData.getPlaceDeliveryCode())) {
-			msg += "交货地代码,";
+			// msg += "交货地代码,";
 		}
 		//交货地
 		if (ObjectUtils.isNull(ediData.getPlaceDeliveryName())) {
-			msg += "交货地,";
+			// msg += "交货地,";
 		} else {
 			Map<String, String> mapString = RegularUtils.regularEn(ediData.getPlaceDeliveryName(),false);
 			if (!"200".equals(mapString.get("code"))) {

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

@@ -7390,6 +7390,112 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
+		}else{
+			// 默认取单据数据,包括主表、预配箱、配箱、费用
+			Bills bills = billsService.getById(billId);
+			if (bills != null) {
+				R<String> biz = dictBizClient.getOneValue("src_type_los", bills.getSrcType(), AuthUtil.getTenantId());
+				if (biz.isSuccess()) {
+					bills.setSrcType(biz.getData());
+				}
+				SeaBillsDetail seaBillsDetail = seaBillsDetailService.getOne(new LambdaQueryWrapper<SeaBillsDetail>()
+					.eq(SeaBillsDetail::getTenantId, AuthUtil.getTenantId())
+					.eq(SeaBillsDetail::getPid, bills.getId()));
+				if (seaBillsDetail != null) {
+					bills.setInttraToDoorCorpName(seaBillsDetail.getInttraToDoorCorpName());
+					bills.setInttraToDoorCorpAddr(seaBillsDetail.getInttraToDoorCorpAddr());
+					bills.setInttraToDoorCorpContacts(seaBillsDetail.getInttraToDoorCorpContacts());
+					bills.setInttraToDoorCorpTel(seaBillsDetail.getInttraToDoorCorpTel());
+					bills.setInttraDoorToCorpName(seaBillsDetail.getInttraDoorToCorpName());
+					bills.setInttraDoorToCorpAddr(seaBillsDetail.getInttraDoorToCorpAddr());
+					bills.setInttraDoorToCorpContacts(seaBillsDetail.getInttraDoorToCorpContacts());
+					bills.setInttraDoorToCorpTel(seaBillsDetail.getInttraDoorToCorpTel());
+					bills.setHshipperId(seaBillsDetail.getHshipperId());
+					bills.setHshipperCode(seaBillsDetail.getHshipperCode());
+					bills.setHshipperCnName(seaBillsDetail.getHshipperCnName());
+					bills.setHshipperEnName(seaBillsDetail.getHshipperEnName());
+					bills.setHshipperDetails(seaBillsDetail.getHshipperDetails());
+					bills.setHconsigneeId(seaBillsDetail.getHconsigneeId());
+					bills.setHconsigneeCode(seaBillsDetail.getHconsigneeCode());
+					bills.setHconsigneeCnName(seaBillsDetail.getHconsigneeCnName());
+					bills.setHconsigneeEnName(seaBillsDetail.getHconsigneeEnName());
+					bills.setHconsigneeDetails(seaBillsDetail.getHconsigneeDetails());
+					bills.setHnotifyId(seaBillsDetail.getHnotifyId());
+					bills.setHnotifyCode(seaBillsDetail.getHnotifyCode());
+					bills.setHnotifyCnName(seaBillsDetail.getHnotifyCnName());
+					bills.setHnotifyEnName(seaBillsDetail.getHnotifyEnName());
+					bills.setHnotifyDetails(seaBillsDetail.getHnotifyDetails());
+					bills.setHnotify2Id(seaBillsDetail.getHnotify2Id());
+					bills.setHnotify2Code(seaBillsDetail.getHnotify2Code());
+					bills.setHnotify2CnName(seaBillsDetail.getHnotify2CnName());
+					bills.setHnotify2EnName(seaBillsDetail.getHnotify2EnName());
+					bills.setHnotify2Details(seaBillsDetail.getHnotify2Details());
+					bills.setMshipperId(seaBillsDetail.getMshipperId());
+					bills.setMshipperCode(seaBillsDetail.getMshipperCode());
+					bills.setMshipperCnName(seaBillsDetail.getMshipperCnName());
+					bills.setMshipperEnName(seaBillsDetail.getMshipperEnName());
+					bills.setMshipperDetails(seaBillsDetail.getMshipperDetails());
+					bills.setMconsigneeId(seaBillsDetail.getMconsigneeId());
+					bills.setMconsigneeCode(seaBillsDetail.getMconsigneeCode());
+					bills.setMconsigneeCnName(seaBillsDetail.getMconsigneeCnName());
+					bills.setMconsigneeEnName(seaBillsDetail.getMconsigneeEnName());
+					bills.setMconsigneeDetails(seaBillsDetail.getMconsigneeDetails());
+					bills.setMnotifyId(seaBillsDetail.getMnotifyId());
+					bills.setMnotifyCode(seaBillsDetail.getMnotifyCode());
+					bills.setMnotifyCnName(seaBillsDetail.getMnotifyCnName());
+					bills.setMnotifyEnName(seaBillsDetail.getMnotifyEnName());
+					bills.setMnotifyDetails(seaBillsDetail.getMnotifyDetails());
+					bills.setMnotify2Id(seaBillsDetail.getMnotify2Id());
+					bills.setMnotify2Code(seaBillsDetail.getMnotify2Code());
+					bills.setMnotify2CnName(seaBillsDetail.getMnotify2CnName());
+					bills.setMnotify2EnName(seaBillsDetail.getMnotify2EnName());
+					bills.setMnotify2Details(seaBillsDetail.getMnotify2Details());
+					bills.setMforwarderDetails(seaBillsDetail.getMforwarderDetails());
+				}
+				R<DictBiz> resDictBiz = dictBizClient.getDictBiz("payment_method_los", bills.getHpaymode(), AuthUtil.getTenantId());
+				if (resDictBiz.isSuccess() && ObjectUtils.isNotNull(resDictBiz.getData())) {
+					bills.setHpaymode(resDictBiz.getData().getRemark());
+				}
+				R<DictBiz> resDictBiz1 = dictBizClient.getDictBiz("issue_type_F", bills.getIssueType(), AuthUtil.getTenantId());
+				if (resDictBiz1.isSuccess() && ObjectUtils.isNotNull(resDictBiz1.getData())) {
+					bills.setIssueType(resDictBiz1.getData().getRemark());
+				}
+//				bills.setFM(MagicValues.FM);
+				bills.setCapitalLetters("SAY "+BigDecimalUtils.convertToEnglish(bills.getQuantity()) + " " + bills.getPackingUnit() +" ONLY.");
+				bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
+				BigDecimal boxWeightSum = BigDecimal.ZERO;
+				List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+					.eq(Containers::getTenantId, AuthUtil.getTenantId())
+					.eq(Containers::getIsDeleted, 0)
+					.eq(Containers::getPid, bills.getId()));
+				List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
+					.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
+					.eq(PreContainers::getIsDeleted, 0)
+					.eq(PreContainers::getPid, bills.getId()));
+				if (!containersList.isEmpty()) {
+					boxWeightSum = boxWeightSum.add(containersList.get(0).getGrossWeight());
+					if (!preContainersList.isEmpty()) {
+						List<PreContainers> preContainers = preContainersList.stream().filter(e -> e.getCntrTypeCode().equals(containersList.get(0).getCntrTypeCode()))
+							.collect(Collectors.toList());
+						if (!preContainers.isEmpty()) {
+							boxWeightSum = boxWeightSum.add(containersList.get(0).getGrossWeight());
+						}
+					}
+				}
+				bills.setBoxWeightSum(boxWeightSum);
+				StringBuilder text = new StringBuilder();
+				for (Containers item : containersList) {
+					text.append(item.getCntrNo()).append("/").append(item.getSealNo())
+						.append(item.getQuantity()).append(item.getPackingUnit()).append("/")
+						.append(item.getGrossWeight()).append(item.getPackingUnit()).append("/")
+						.append(item.getMeasurement()).append("CBM");
+				}
+				bills.setCntryString(text.toString());
+				bills.setDept(dept);
+				map.put(MagicValues.DATA, bills);
+			} else {
+				map.put(MagicValues.DATA, null);
+			}
 		}
 		return R.data(map);
 	}

+ 4 - 0
blade-service/blade-los/src/main/java/org/springblade/los/edi/dto/InttraSoDto.java

@@ -620,6 +620,10 @@ public class InttraSoDto {
 	 */
 	private String dgUnCode;
 	/**
+	 * 危险品外包装
+	 */
+	private String dgOuterPackageCode;
+	/**
 	 * 闪点
 	 */
 	private String dgFlashPoint;

+ 70 - 45
blade-service/blade-los/src/main/java/org/springblade/los/edi/service/impl/EDISenderServiceImpl.java

@@ -511,7 +511,7 @@ public class EDISenderServiceImpl implements IEDISenderService {
 			count += 1;
 			/* =================0530=================  */
 			// MAEU 发送 ETD,其他不发送
-			if ("MAEU".equals(carrierCode)) {
+			if ("MAEU".equals(carrierCode) || "CMDU".equals(carrierCode)) {
 				if (ObjectUtils.isNotNull(inttraSoDto.getEtd())) {
 					writer.write("DTM+133:" + inttraSoDto.getEtd() + ":102'");
 					writer.newLine();
@@ -2876,7 +2876,7 @@ public class EDISenderServiceImpl implements IEDISenderService {
 				// ZIM 业务缺少服务合同号
 				// if(CARRIERID=9,'ZIM','747209574a')
 				// wfg
-				writer.write(":ZIM::::::::" + oneSoDto.getCorpArgreementNo() + "::" + oneSoDto.getCarrierArgreementNo() + "::" + "'");
+				writer.write(":ZIM::::::::" + oneSoDto.getCorpArgreementNo() + "::" + oneSoDto.getCarrierArgreementNo() + "::" + oneSoDto.getSenderEmail() + "'");
 				writer.newLine();
 				count++;
 
@@ -2886,7 +2886,7 @@ public class EDISenderServiceImpl implements IEDISenderService {
 				String issueType = "ORI".equals(oneSoDto.getIssueType()) ? "ORI" : ("EXP".equals(oneSoDto.getIssueType()) ? "EXP" : "");
 				writer.write("03:" + issueType + "::" + oneSoDto.getIssuanceLand() + ":" + oneSoDto.getIssueDate() + ":3:"
 					+ ("PP".equals(oneSoDto.getMPayMode()) ? oneSoDto.getMPayPlaceName() : "")
-					+ ("CC".equals(oneSoDto.getMPayMode()) ? oneSoDto.getMPayPlaceName() : "") + "'");
+					+ ("CC".equals(oneSoDto.getMPayMode()) ? oneSoDto.getMPayPlaceName() : "") + ":'");
 				writer.newLine();
 				count++;
 
@@ -2894,7 +2894,7 @@ public class EDISenderServiceImpl implements IEDISenderService {
 				// 记录类型标识 + 船舶呼号 +  船名 + 航次 + 船舶经营人
 				// 此处 getVesselCode 取船舶呼号
 				// wfg
-				writer.write("11:" + oneSoDto.getVesselCode() + ":" + oneSoDto.getVesselName() + ":" + oneSoDto.getVoyageNo() + "::::");
+				writer.write("11:" + oneSoDto.getVesselCode() + ":" + oneSoDto.getVesselName() + ":" + oneSoDto.getVoyageNo() + ":::::");
 				// 亿通 航线代码 lineNo
 				String lineNo = "";
 				if (ObjectUtils.isNotNull(oneSoDto.getLineId())) {
@@ -2939,7 +2939,7 @@ public class EDISenderServiceImpl implements IEDISenderService {
 
 				// 17 REMARKS 订舱备注 其他信息
 				if (ObjectUtils.isNotNull(bill.getBookingRemarks())) {
-					List<String> bookingRemarks = RegularUtils.reformatEDIText(bill.getBookingRemarks(), 35, true);
+					List<String> bookingRemarks = RegularUtils.reformatEDIText(bill.getBookingRemarks(), 35, false);
 					writer.write("17"); // 发货人代码为空
 					int lc = 0;
 					for (int l = 0; l < bookingRemarks.size(); l++) {
@@ -3058,11 +3058,11 @@ public class EDISenderServiceImpl implements IEDISenderService {
 								writer.write("44:" + line);
 							} else {
 								writer.write(":" + line);
-								if (lc % 5 == 4 || lc == (goodsMarks.size() - 1)) {
-									writer.write("'");
-									writer.newLine();
-									count += 1;
-								}
+							}
+							if (lc % 5 == 4 || lc == (goodsMarks.size() - 1)) {
+								writer.write("'");
+								writer.newLine();
+								count += 1;
 							}
 						} else {
 							goodsDescAddtionShipperMarks.add("*" + line);
@@ -3083,11 +3083,11 @@ public class EDISenderServiceImpl implements IEDISenderService {
 								writer.write("47:" + line);
 							} else {
 								writer.write(":" + line);
-								if (lc % 5 == 4 || lc == (goodsDesc.size() - 1)) {
-									writer.write("'");
-									writer.newLine();
-									count += 1;
-								}
+							}
+							if (lc % 5 == 4 || lc == (goodsDesc.size() - 1)) {
+								writer.write("'");
+								writer.newLine();
+								count += 1;
 							}
 						}
 
@@ -3103,11 +3103,11 @@ public class EDISenderServiceImpl implements IEDISenderService {
 							writer.write("47:" + line);
 						} else {
 							writer.write(":" + line);
-							if (lc % 5 == 4 || lc == (goodsDescAddtionShipperMarks.size() - 1)) {
-								writer.write("'");
-								writer.newLine();
-								count += 1;
-							}
+						}
+						if (lc % 5 == 4 || lc == (goodsDescAddtionShipperMarks.size() - 1)) {
+							writer.write("'");
+							writer.newLine();
+							count += 1;
 						}
 
 						lc++;
@@ -3121,11 +3121,11 @@ public class EDISenderServiceImpl implements IEDISenderService {
 							writer.write("47:" + line);
 						} else {
 							writer.write(":" + line);
-							if (lc % 5 == 4 || lc == (goodsDescAddtionCnee.size() - 1)) {
-								writer.write("'");
-								writer.newLine();
-								count += 1;
-							}
+						}
+						if (lc % 5 == 4 || lc == (goodsDescAddtionCnee.size() - 1)) {
+							writer.write("'");
+							writer.newLine();
+							count += 1;
 						}
 
 						lc++;
@@ -3139,11 +3139,11 @@ public class EDISenderServiceImpl implements IEDISenderService {
 							writer.write("47:" + line);
 						} else {
 							writer.write(":" + line);
-							if (lc % 5 == 4 || lc == (goodsDescAddtionNotify.size() - 1)) {
-								writer.write("'");
-								writer.newLine();
-								count += 1;
-							}
+						}
+						if (lc % 5 == 4 || lc == (goodsDescAddtionNotify.size() - 1)) {
+							writer.write("'");
+							writer.newLine();
+							count += 1;
 						}
 
 						lc++;
@@ -3547,7 +3547,8 @@ public class EDISenderServiceImpl implements IEDISenderService {
 			pm = Objects.equals(pm, "PP") ? "P" : (Objects.equals(pm, "CC") ? "C" : " ");
 
 			writer.write(RegularUtils.paddingRight(loadType, 2 + 2) + RegularUtils.paddingRight(serviceTerm, 2 + 3) + pm);
-			writer.write(RegularUtils.paddingRight("NN", 2 + 8) + RegularUtils.paddingRight(pilSoDto.getMblNo(), 20 + 20) + "F");
+
+			writer.write(RegularUtils.paddingRight("NN", 2 + 16) + RegularUtils.paddingRight(pilSoDto.getMblNo(), 20 + 12) + "F");
 			writer.write(RegularUtils.paddingRight(20 + 20 + 12));
 
 			SimpleDateFormat sdf_bkgDate = new SimpleDateFormat("yyyyMMdd");
@@ -3593,8 +3594,9 @@ public class EDISenderServiceImpl implements IEDISenderService {
 			//	if(CORPID.Asinteger=8563,'SHANDONG GOODFARMER FRUITS AND VEGETABLES CO.,LT D',
 			//	 'QINGDAO JET MARINE LOGISTICS CO.,LTD. '))
 			// wfg
-			String senderTel = "0530-8312038";
-			String senderName = "QINGDAO JET MARINE LOGISTICS CO.,LTD.";
+			Long corpId = pilSoDto.getCorpId();
+			String senderTel = corpId==8562?"0530-8312038":(corpId==8563?"0530-8312038":"0532-82668811-175");
+			String senderName = corpId==8562?"SHANDONG GOODFARMER INTERNATIONAL TRADING CO., LTD":(corpId==8563?"SHANDONG GOODFARMER FRUITS AND VEGETABLES CO.,LTD":"QINGDAO JET MARINE LOGISTICS CO.,LTD.");
 			writer.write(RegularUtils.paddingRight(senderName, 70) + RegularUtils.paddingRight(senderTel, 35 + 35 + 35 + 17 + 18 + 4));
 			writer.write(RegularUtils.paddingRight(ObjectUtils.isNotNull(pilSoDto.getCarrierArgreementNo()) ? pilSoDto.getCarrierArgreementNo() : "CN900160", 8 + 6));
 			writer.newLine();
@@ -3605,7 +3607,8 @@ public class EDISenderServiceImpl implements IEDISenderService {
 			for (int l = 0; l <= 6; l++) {
 				deciding.add("");
 			}
-			writer.write("18   " + RegularUtils.paddingRight(pilSoDto.getCorpArgreementNo(), 11 + 3 + 3));
+			writer.write("18   " + RegularUtils.paddingLeft(pilSoDto.getCorpArgreementNo(), 11));
+			writer.write(RegularUtils.paddingRight( 3 + 3));
 			for (int l = 0; l < deciding.size(); l++) {
 				if (l < 6) {
 					writer.write(RegularUtils.paddingRight(deciding.get(l), 35));
@@ -3734,7 +3737,7 @@ public class EDISenderServiceImpl implements IEDISenderService {
 
 					// 件数单位
 					writer.write("47   " + RegularUtils.paddingLeft("" + cargoline, '0', 3));
-					js = pilSoDto.getPackagesNumber().toString() + pilSoDto.getPackagesDescribe();
+					js = pilSoDto.getPackagesNumber().setScale(0, BigDecimal.ROUND_HALF_UP).toString() + pilSoDto.getPackagesDescribe();
 					List<String> goodsDesc1 = RegularUtils.reformatEDIText(js, 30, false);
 					for (int l = 0; l <= 8; l++) {
 						goodsDesc1.add("");
@@ -3792,25 +3795,47 @@ public class EDISenderServiceImpl implements IEDISenderService {
 						writer.newLine();
 						count += 1;
 
+//						writer.write("56 01" + RegularUtils.paddingLeft("" + cargoline, '0', 3));
+//						writer.write(RegularUtils.paddingLeft("" + dangerLine, '0', 3));
+//						writer.write(RegularUtils.paddingRight(pilSoDto.getDgUnCode(), 5));
+//						writer.write(RegularUtils.paddingRight(pilSoDto.getDgImdgCode(), 4));
+//						writer.write("   KGM" + RegularUtils.paddingRight(pilSoDto.getDgImdgCode(), 4));
+//						// 件重尺根据箱量求平均值
+//						BigDecimal nwt = pilSoDto.getGrossWeight().divide(BigDecimal.valueOf(cntrQty), 3, RoundingMode.HALF_UP);
+//						writer.write(RegularUtils.paddingLeft(nwt.toString(), '0', 9));
+//						BigDecimal gwt = pilSoDto.getGrossWeight().divide(BigDecimal.valueOf(cntrQty), 3, RoundingMode.HALF_UP);
+//						writer.write(RegularUtils.paddingLeft(gwt.toString(), '0', 9));
+//						writer.write(pilSoDto.getDgIsMarinePollutant() == 1 ? "Y" : "N");
+//						writer.write(RegularUtils.paddingRight(24 + 25));
+//						writer.write(RegularUtils.paddingRight(pilSoDto.getDgPackingLevel(), 3));
+//						writer.write(RegularUtils.paddingRight(pilSoDto.getDgPageNumber(), 5));
+//						BigDecimal pks = pilSoDto.getPackagesNumber().divide(BigDecimal.valueOf(cntrQty), 3, RoundingMode.HALF_UP);
+//						writer.write(RegularUtils.paddingLeft(pks.toString().replace(".", ""), '0', 9));
+//						writer.write(RegularUtils.paddingRight(28));
+//						writer.write(RegularUtils.paddingRight(ObjectUtils.isNull(pilSoDto.getGoodsName()) ? "" : pilSoDto.getGoodsName(), 50));
+//						writer.write(RegularUtils.paddingRight(57));
+
 						writer.write("56 01" + RegularUtils.paddingLeft("" + cargoline, '0', 3));
 						writer.write(RegularUtils.paddingLeft("" + dangerLine, '0', 3));
 						writer.write(RegularUtils.paddingRight(pilSoDto.getDgUnCode(), 5));
 						writer.write(RegularUtils.paddingRight(pilSoDto.getDgImdgCode(), 4));
-						writer.write("   KGM" + RegularUtils.paddingRight(pilSoDto.getDgImdgCode(), 4));
+						writer.write("   KGM" + RegularUtils.paddingRight("", 9));
 						// 件重尺根据箱量求平均值
-						BigDecimal nwt = pilSoDto.getGrossWeight().divide(BigDecimal.valueOf(cntrQty), 3, RoundingMode.HALF_UP);
-						writer.write(RegularUtils.paddingLeft(nwt.toString(), '0', 9));
+//						BigDecimal nwt = mellSoDto.getGrossWeight().divide(BigDecimal.valueOf(cntrQty), 3, RoundingMode.HALF_UP);
+//						writer.write(RegularUtils.paddingLeft(nwt.toString(), '0', 9));
 						BigDecimal gwt = pilSoDto.getGrossWeight().divide(BigDecimal.valueOf(cntrQty), 3, RoundingMode.HALF_UP);
-						writer.write(RegularUtils.paddingLeft(gwt.toString(), '0', 9));
+						js = gwt.setScale(3, RoundingMode.HALF_UP).toString();
+						// 毛重
+						writer.write(RegularUtils.paddingLeft(js.replace(".", ""), '0', 9));
 						writer.write(pilSoDto.getDgIsMarinePollutant() == 1 ? "Y" : "N");
 						writer.write(RegularUtils.paddingRight(24 + 25));
 						writer.write(RegularUtils.paddingRight(pilSoDto.getDgPackingLevel(), 3));
-						writer.write(RegularUtils.paddingRight(pilSoDto.getDgPageNumber(), 5));
+						writer.write(RegularUtils.paddingRight(pilSoDto.getDgOuterPackageCode(), 5));
 						BigDecimal pks = pilSoDto.getPackagesNumber().divide(BigDecimal.valueOf(cntrQty), 3, RoundingMode.HALF_UP);
 						writer.write(RegularUtils.paddingLeft(pks.toString().replace(".", ""), '0', 9));
 						writer.write(RegularUtils.paddingRight(28));
 						writer.write(RegularUtils.paddingRight(ObjectUtils.isNull(pilSoDto.getGoodsName()) ? "" : pilSoDto.getGoodsName(), 50));
-						writer.write(RegularUtils.paddingRight(57));
+						writer.write(RegularUtils.paddingRight(61));
 
 						writer.newLine();
 						count += 1;
@@ -3826,7 +3851,7 @@ public class EDISenderServiceImpl implements IEDISenderService {
 			writer.write("74   " + RegularUtils.paddingRight(5 + 8 + 4 + 3) + "N0301");
 			// 服务合同
 			writer.write(RegularUtils.paddingRight(10 + 5 + 5));
-			writer.write(RegularUtils.paddingLeft(pilSoDto.getPackagesNumber().setScale(3, RoundingMode.HALF_UP).toString(), 8));
+			writer.write(RegularUtils.paddingLeft(pilSoDto.getPackagesNumber().setScale(0, RoundingMode.HALF_UP).toString(), 8));
 			String pkgsDescr = ObjectUtils.isNull(pilSoDto.getPackagesDescribe()) ? "" : pilSoDto.getPackagesDescribe();
 			writer.write(RegularUtils.paddingRight(RegularUtils.copySubstring(pkgsDescr, 0, 8), 8));
 			writer.write(RegularUtils.paddingRight(12 + 1 + 1 + 8 + 8 + 5 + 5 + 8 + 5 + 5 + 126));
@@ -4413,7 +4438,7 @@ public class EDISenderServiceImpl implements IEDISenderService {
 			pm = Objects.equals(pm, "PP") ? "P" : (Objects.equals(pm, "CC") ? "C" : " ");
 
 			writer.write(RegularUtils.paddingRight(loadType, 2 + 2) + RegularUtils.paddingRight(serviceTerm, 2 + 3) + pm);
-			writer.write(RegularUtils.paddingRight("NN", 2 + 8) + RegularUtils.paddingRight(mellSoDto.getMblNo(), 20 + 20) + "F");
+			writer.write(RegularUtils.paddingRight("NN", 2 + 16) + RegularUtils.paddingRight(mellSoDto.getMblNo(), 20 + 12) + "F");
 			writer.write(RegularUtils.paddingRight(20 + 20 + 12));
 
 			SimpleDateFormat sdf_bkgDate = new SimpleDateFormat("yyyyMMdd");
@@ -4676,12 +4701,12 @@ public class EDISenderServiceImpl implements IEDISenderService {
 						writer.write(mellSoDto.getDgIsMarinePollutant() == 1 ? "Y" : "N");
 						writer.write(RegularUtils.paddingRight(24 + 25));
 						writer.write(RegularUtils.paddingRight(mellSoDto.getDgPackingLevel(), 3));
-						writer.write(RegularUtils.paddingRight(mellSoDto.getDgPageNumber(), 5));
+						writer.write(RegularUtils.paddingRight(mellSoDto.getDgOuterPackageCode(), 5));
 						BigDecimal pks = mellSoDto.getPackagesNumber().divide(BigDecimal.valueOf(cntrQty), 3, RoundingMode.HALF_UP);
 						writer.write(RegularUtils.paddingLeft(pks.toString().replace(".", ""), '0', 9));
 						writer.write(RegularUtils.paddingRight(28));
 						writer.write(RegularUtils.paddingRight(ObjectUtils.isNull(mellSoDto.getGoodsName()) ? "" : mellSoDto.getGoodsName(), 50));
-						writer.write(RegularUtils.paddingRight(57));
+						writer.write(RegularUtils.paddingRight(61));
 
 						writer.newLine();
 						count += 1;

+ 35 - 26
blade-service/blade-los/src/main/java/org/springblade/los/edi/service/impl/EdiTypesServiceImpl.java

@@ -493,13 +493,14 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 			inttraSoDto.setDgImdgCode(details.getDgImdgCode());
 			inttraSoDto.setDgPageNumber("");
 			inttraSoDto.setDgUnCode(details.getDgUnCode());
-			inttraSoDto.setDgFlashPoint(details.getDgFlashPoint().toString());
-			inttraSoDto.setDgFlashPointUnit(details.getDgFlashPointUnit());
-			inttraSoDto.setDgPackingLevel(details.getDgPackingLevel());//包装组别
+			inttraSoDto.setDgFlashPoint(RegularUtils.forceEmpty(details.getDgFlashPoint()));
+			inttraSoDto.setDgFlashPointUnit(RegularUtils.forceEmpty(details.getDgFlashPointUnit()));
+			inttraSoDto.setDgPackingLevel(RegularUtils.forceEmpty(details.getDgPackingLevel()));//包装组别
+			inttraSoDto.setDgOuterPackageCode(RegularUtils.forceEmpty(details.getDgPackage()));
 			inttraSoDto.setEmergencyMeasureNo("");//应急措施号
-			inttraSoDto.setDgRemarks(details.getDgRemarks());
-			inttraSoDto.setDgContacts(details.getDgContacts());
-			inttraSoDto.setDgTel(details.getDgTel());
+			inttraSoDto.setDgRemarks(RegularUtils.forceEmpty(details.getDgRemarks()));
+			inttraSoDto.setDgContacts(RegularUtils.forceEmpty(details.getDgContacts()));
+			inttraSoDto.setDgTel(RegularUtils.forceEmpty(details.getDgTel()));
 			inttraSoDto.setDgIsMarinePollutant(ObjectUtils.isNull(details.getDgIsMarinePollutant()) ? 0 : details.getDgIsMarinePollutant());
 		}
 
@@ -521,17 +522,17 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 			if (bCntrTypes != null) {
 				String ediCode = RegularUtils.getEdiCode(ediCodeName, bCntrTypes.getExtendedData());
 				Map<String, Object> map = new HashMap<>();
-				map.put("cntrTypeCode", item.getCntrTypeCode());
+				map.put("cntrTypeCode", RegularUtils.forceEmpty(item.getCntrTypeCode()));
 				map.put("sizeType", ediCode);
 				map.put("cntrQty", item.getQuantity());
 				map.put("isSoc", item.getIsSoc());
-				map.put("rawTemperature", item.getTemperature());
-				map.put("temperature", RegularUtils.formatTempNumber(item.getTemperature(), "T", "温度", 3));
-				map.put("temperatureUnit", item.getTemperatureUnit());
-				map.put("rawVentilation", item.getVentilation());
-				map.put("ventilation", RegularUtils.formatTempNumber(item.getVentilation(), "V", "通风度", 3));
-				map.put("rawHumidity", item.getHumidity());
-				map.put("humidity", RegularUtils.formatTempNumber(item.getHumidity(), "H", "湿度", 3));
+				map.put("rawTemperature", RegularUtils.forceEmpty(item.getTemperature()));
+				map.put("temperature", RegularUtils.formatTempNumber(RegularUtils.forceEmpty(item.getTemperature()), "T", "温度", 3));
+				map.put("temperatureUnit", RegularUtils.forceEmpty(item.getTemperatureUnit()));
+				map.put("rawVentilation", RegularUtils.forceEmpty(item.getVentilation()));
+				map.put("ventilation", RegularUtils.formatTempNumber(RegularUtils.forceEmpty(item.getVentilation()), "V", "通风度", 3));
+				map.put("rawHumidity", RegularUtils.forceEmpty(item.getHumidity()));
+				map.put("humidity", RegularUtils.formatTempNumber(RegularUtils.forceEmpty(item.getHumidity()), "H", "湿度", 3));
 
 				map.put("pkgs", item.getNumber());
 				map.put("grossWeight", item.getGrossWeight());
@@ -541,11 +542,19 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 
 				String hscode = RegularUtils.forceEmpty(item.getHsCode());
 				String goodsName = RegularUtils.forceEmpty(item.getGoodsName());
+				if(ObjectUtils.isNull(goodsName)){
+					// 英文品名
+					goodsName = RegularUtils.forceEmpty(details.getCommodityCnName());
+				}
+				if(ObjectUtils.isNull(goodsName)){
+					// 商品名称
+					goodsName = RegularUtils.forceEmpty(details.getCommodityEnName());
+				}
 				map.put("commodity_code", ObjectUtils.isNotNull(hscode) ? hscode : RegularUtils.forceEmpty(details.getHscode()));
-				map.put("commodity_name", ObjectUtils.isNotNull(goodsName) ? goodsName : RegularUtils.forceEmpty(details.getCommodityEnName()));
+				map.put("commodity_name", goodsName);
 				// 加 PIL 代码和品名 = commodity_code
 				map.put("pil_commodity_code", ObjectUtils.isNotNull(hscode) ? hscode : RegularUtils.forceEmpty(details.getHscode()));
-				map.put("pil_commodity_name", ObjectUtils.isNotNull(goodsName) ? goodsName : RegularUtils.forceEmpty(details.getCommodityEnName()));
+				map.put("pil_commodity_name", goodsName);
 				preCntrs.add(map);
 			} else {
 				throw new RuntimeException("箱型数据错误");
@@ -594,20 +603,20 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 				map.put("grossWeight", item.getGrossWeight());
 				map.put("volume", item.getMeasurement());
 				map.put("sizeType", ediCode);
-				map.put("cntrTypeName", bCntrTypes.getEnName());
-				map.put("cntrNo", item.getCntrNo());
-				map.put("sealNo", item.getSealNo());
+				map.put("cntrTypeName", RegularUtils.forceEmpty(bCntrTypes.getEnName()));
+				map.put("cntrNo", RegularUtils.forceEmpty(item.getCntrNo()));
+				map.put("sealNo", RegularUtils.forceEmpty(item.getSealNo()));
 				map.put("sealUnit", "");
 				map.put("isSoc", item.getIsSoc());
 				PreContainers preContainers = preContainersList.stream().filter(e -> e.getId().toString().equals(item.getCntrTypeCodeId())).findFirst().orElse(null);
 				if (preContainers != null) {
-					map.put("rawTemperature", preContainers.getTemperature());
-					map.put("temperature", RegularUtils.formatTempNumber(preContainers.getTemperature(), "T", "温度", 3));
-					map.put("temperatureUnit", preContainers.getTemperatureUnit());
-					map.put("rawVentilation", preContainers.getVentilation());
-					map.put("ventilation", RegularUtils.formatTempNumber(preContainers.getVentilation(), "V", "通风度", 3));
-					map.put("rawHumidity", preContainers.getHumidity());
-					map.put("humidity", RegularUtils.formatTempNumber(preContainers.getHumidity(), "H", "湿度", 3));
+					map.put("rawTemperature", RegularUtils.forceEmpty(preContainers.getTemperature()));
+					map.put("temperature", RegularUtils.formatTempNumber(RegularUtils.forceEmpty(preContainers.getTemperature()), "T", "温度", 3));
+					map.put("temperatureUnit", RegularUtils.forceEmpty(preContainers.getTemperatureUnit()));
+					map.put("rawVentilation", RegularUtils.forceEmpty(preContainers.getVentilation()));
+					map.put("ventilation", RegularUtils.formatTempNumber(RegularUtils.forceEmpty(preContainers.getVentilation()), "V", "通风度", 3));
+					map.put("rawHumidity", RegularUtils.forceEmpty(preContainers.getHumidity()));
+					map.put("humidity", RegularUtils.formatTempNumber(RegularUtils.forceEmpty(preContainers.getHumidity()), "H", "湿度", 3));
 				} else {
 					map.put("rawTemperature", "");
 					map.put("temperature", "");