|
|
@@ -264,7 +264,11 @@ public class EDISenderServiceImpl implements IEDISenderService {
|
|
|
}
|
|
|
|
|
|
private static FilesCenter createEDIFilesCenter(InttraSoDto inttraSoDto, File file) {
|
|
|
- Map<String, String> send = sendEDIFileToRemote(inttraSoDto, file);
|
|
|
+ // Map<String, String> send = sendEDIFileToRemote(inttraSoDto, file);
|
|
|
+ Map<String, String> send = new HashMap<>();
|
|
|
+ send.put("code", "200");
|
|
|
+ send.put("message", "模拟发送成功");
|
|
|
+
|
|
|
if ("500".equals(send.get("code"))) {
|
|
|
throw new RuntimeException(send.get("message"));
|
|
|
}
|
|
|
@@ -2604,9 +2608,9 @@ public class EDISenderServiceImpl implements IEDISenderService {
|
|
|
if (ObjectUtils.isNull(cc.getPackingUnitCode())) {
|
|
|
errMsg += "箱内货物包装单位没有填写或缺少EDI代码,";
|
|
|
}
|
|
|
- if (ObjectUtils.isNull(cc.getQuantity().equals(BigDecimal.ZERO))
|
|
|
- || ObjectUtils.isNull(cc.getGrossWeight().equals(BigDecimal.ZERO))
|
|
|
- || ObjectUtils.isNull(cc.getMeasurement().equals(BigDecimal.ZERO))
|
|
|
+ if (cc.getQuantity().equals(BigDecimal.ZERO)
|
|
|
+ || cc.getGrossWeight().equals(BigDecimal.ZERO)
|
|
|
+ || cc.getMeasurement().equals(BigDecimal.ZERO)
|
|
|
) {
|
|
|
errMsg += "箱内货物件重尺填写不全,";
|
|
|
}
|
|
|
@@ -3605,9 +3609,9 @@ public class EDISenderServiceImpl implements IEDISenderService {
|
|
|
writer.write("54 " + RegularUtils.paddingLeft("" + cargoline, '0', 3));
|
|
|
writer.write(RegularUtils.paddingLeft("" + cargoline, '0', 3));
|
|
|
writer.write("C" + RegularUtils.paddingLeft(5 + 5));
|
|
|
- writer.write(Regular_PIL.formatTempNumber((BigDecimal) map1.get("rawTemperature"), 5, 2) + "N");
|
|
|
- writer.write(Regular_PIL.formatTempNumber((BigDecimal) map1.get("rawVentilation"), 5, 2) + "N");
|
|
|
- writer.write(Regular_PIL.formatTempNumber((BigDecimal) map1.get("rawTemperature"), 5, 2));
|
|
|
+ writer.write(Regular_PIL.formatTempNumber(map1.get("rawTemperature").toString(), "T", "温度",5, 2) + "N");
|
|
|
+ writer.write(Regular_PIL.formatTempNumber(map1.get("rawVentilation").toString(), "V", "通风度", 5, 2) + "N");
|
|
|
+ writer.write(Regular_PIL.formatTempNumber(map1.get("rawTemperature").toString(), "T", "温度", 5, 2));
|
|
|
writer.write("CLOSED".equals(map1.get("rawVentilation")) ? "C" : "H");
|
|
|
writer.write(RegularUtils.paddingLeft(210));
|
|
|
writer.newLine();
|
|
|
@@ -4099,9 +4103,9 @@ public class EDISenderServiceImpl implements IEDISenderService {
|
|
|
line = "54 " + RegularUtils.paddingLeft("" + cargoline, '0', 3);
|
|
|
line += RegularUtils.paddingLeft("" + cntrLine, '0', 3);
|
|
|
line += RegularUtils.paddingRight("C", 1 + 5 + 5);
|
|
|
- line += Regular_PIL.formatTempNumber((BigDecimal) map1.get("rawTemperature"), 5, 2) + "N";
|
|
|
- line += Regular_PIL.formatTempNumber((BigDecimal) mapLoaded.get("rawVentilation"), 5, 2) + "N";
|
|
|
- line += Regular_PIL.formatTempNumber((BigDecimal) mapLoaded.get("rawTemperature"), 5, 2);
|
|
|
+ line += Regular_PIL.formatTempNumber(mapLoaded.get("rawTemperature").toString(), "T", "温度", 5, 2) + "N";
|
|
|
+ line += Regular_PIL.formatTempNumber(mapLoaded.get("rawVentilation").toString(), "V", "通风度", 5, 2) + "N";
|
|
|
+ line += Regular_PIL.formatTempNumber(mapLoaded.get("rawTemperature").toString(), "T", "温度", 5, 2);
|
|
|
line += "CLOSED".equals(mapLoaded.get("rawVentilation")) ? "C" : "H";
|
|
|
writer.write(RegularUtils.paddingRight(line, 250));
|
|
|
writer.newLine();
|
|
|
@@ -4468,9 +4472,9 @@ public class EDISenderServiceImpl implements IEDISenderService {
|
|
|
writer.write("54 " + RegularUtils.paddingLeft("" + cargoline, '0', 3));
|
|
|
writer.write(RegularUtils.paddingLeft("" + cargoline, '0', 3));
|
|
|
writer.write("C" + RegularUtils.paddingLeft(5 + 5));
|
|
|
- writer.write(Regular_PIL.formatTempNumber((BigDecimal) map1.get("rawTemperature"), 5, 2) + "N");
|
|
|
- writer.write(Regular_PIL.formatTempNumber((BigDecimal) map1.get("rawVentilation"), 5, 2) + "N");
|
|
|
- writer.write(Regular_PIL.formatTempNumber((BigDecimal) map1.get("rawTemperature"), 5, 2));
|
|
|
+ writer.write(Regular_PIL.formatTempNumber(map1.get("rawTemperature").toString(), "T", "温度", 5, 2) + "N");
|
|
|
+ writer.write(Regular_PIL.formatTempNumber(map1.get("rawVentilation").toString(), "V", "通风度", 5, 2) + "N");
|
|
|
+ writer.write(Regular_PIL.formatTempNumber(map1.get("rawTemperature").toString(), "T", "温度", 5, 2));
|
|
|
writer.write("CLOSED".equals(map1.get("rawVentilation")) ? "C" : "H");
|
|
|
writer.write(RegularUtils.paddingLeft(210));
|
|
|
writer.newLine();
|
|
|
@@ -4960,9 +4964,9 @@ public class EDISenderServiceImpl implements IEDISenderService {
|
|
|
line = "54 " + RegularUtils.paddingLeft("" + cargoline, '0', 3);
|
|
|
line += RegularUtils.paddingLeft("" + cntrLine, '0', 3);
|
|
|
line += RegularUtils.paddingRight("C", 1 + 5 + 5);
|
|
|
- line += Regular_PIL.formatTempNumber((BigDecimal) map1.get("rawTemperature"), 5, 2) + "N";
|
|
|
- line += Regular_PIL.formatTempNumber((BigDecimal) mapLoaded.get("rawVentilation"), 5, 2) + "N";
|
|
|
- line += Regular_PIL.formatTempNumber((BigDecimal) mapLoaded.get("rawTemperature"), 5, 2);
|
|
|
+ line += Regular_PIL.formatTempNumber(mapLoaded.get("rawTemperature").toString(), "T", "温度", 5, 2) + "N";
|
|
|
+ line += Regular_PIL.formatTempNumber(mapLoaded.get("rawVentilation").toString(), "V", "通风度", 5, 2) + "N";
|
|
|
+ line += Regular_PIL.formatTempNumber(mapLoaded.get("rawTemperature").toString(), "T", "温度", 5, 2);
|
|
|
line += "CLOSED".equals(mapLoaded.get("rawVentilation")) ? "C" : "H";
|
|
|
writer.write(RegularUtils.paddingRight(line, 250));
|
|
|
writer.newLine();
|
|
|
@@ -5044,5 +5048,641 @@ public class EDISenderServiceImpl implements IEDISenderService {
|
|
|
mkdirs(sftp, dirs, tempPath, length, index);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public FilesCenter sendingHmmBooking(InttraSoDto hmmSoDto, JsonNode ediParamCarrier){
|
|
|
+ try {
|
|
|
+ String localFolder = genEdiLocalFolder(hmmSoDto, ediParamCarrier);
|
|
|
+ String localFileName = genEdiLocalFileName(hmmSoDto, ediParamCarrier);
|
|
|
+ File file = new File(localFolder, localFileName);
|
|
|
+ file.createNewFile();
|
|
|
+ // 打开文件输出流进行写入操作
|
|
|
+ BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
|
|
+ int count = 0;
|
|
|
+ String carrierCode = hmmSoDto.getCarrierCode();
|
|
|
+ String cargoType = hmmSoDto.getCargoType();
|
|
|
+
|
|
|
+ // 向文件写入数据
|
|
|
+ // 00 HEAD RECORD
|
|
|
+ // 2=增加 3=删除 4=变更 9=原始
|
|
|
+ writer.write("00:IFTMBF:BOOKING:9:" + hmmSoDto.getSenderCode() + ":HMM:" + hmmSoDto.getFileDate() + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 02 BOOKING 订舱信息
|
|
|
+ // 记录类型标识
|
|
|
+ writer.write("02");
|
|
|
+ // 运编号
|
|
|
+ writer.write(":" + hmmSoDto.getMblNo());
|
|
|
+ // 提单号
|
|
|
+ writer.write(":" + hmmSoDto.getMblNo());
|
|
|
+ // 交货条款 CY-CY(pier-pier/port):30
|
|
|
+ //CY-CFS(pier/port-door): 29
|
|
|
+ //CFS-CY(door-pier/port): 28
|
|
|
+ //CFS-CFS(door-door): 27
|
|
|
+ writer.write(":" + ("CY-DOOR".equals(hmmSoDto.getTransportTermName()) ? "CY-DR" : hmmSoDto.getTransportTermName()));
|
|
|
+ // 货代方企业名称
|
|
|
+ writer.write(":" + hmmSoDto.getSenderCode());
|
|
|
+ // 即接受订舱的人的代码 + 签单人说明 + 询价单位 + 国外订舱单位 + 转船标识 + 分批 + 装期 + 效期 + 运费协议号 + 费率本代码 + 服务合同号 + BOND NO + 舱位互用标识
|
|
|
+ writer.write(":HMM::::::::" + hmmSoDto.getCarrierArgreementNo() + "::"+hmmSoDto.getCorpArgreementNo()+"::'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 03 提单信息,不填
|
|
|
+ // 提单类型(ORI: BILL OF LADING EXP: WAYBILL) + 提单签发地代码 + 提单签发地 + 签发日期 + 正本提单份数 + 预付地点 + 到付地点
|
|
|
+ writer.write("03:::" + hmmSoDto.getIssuanceLand() + ":" + hmmSoDto.getIssueDate() + ":3:"
|
|
|
+ + ("PP".equals(hmmSoDto.getPaymentType()) ? hmmSoDto.getPaymentLand() : "")
|
|
|
+ + ("CC".equals(hmmSoDto.getPaymentType()) ? hmmSoDto.getPaymentLand() : ""));
|
|
|
+ // AMS Ams Tag AmsCode
|
|
|
+ // V_AMSPROP IF(AMSPROP='Y','Y',IF(AMSPROP='N','N',IF(AMSPROP='1',' ','')))
|
|
|
+ writer.write(":");
|
|
|
+
|
|
|
+ // ACI Canada Aci
|
|
|
+ // V_ACIPROP IF(ACIPROP='Y','Y',IF(ACIPROP='N','N',IF(ACIPROP='1',' ','')))
|
|
|
+ // ACI NO VarChar(35)
|
|
|
+ writer.write(":'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 11 VESSEL 船舶信息
|
|
|
+ // 记录类型标识 + 船舶呼号 + 船名 + 航次 + 船舶经营人
|
|
|
+ writer.write("11:::::::::::"+hmmSoDto.getVesselCode()+":"+hmmSoDto.getVesselName()+":"+hmmSoDto.getVoyageNo()+"'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 12 PORTS 地点信息
|
|
|
+ writer.write("12");
|
|
|
+ // 收货地代码 + 收货地代名称
|
|
|
+ writer.write(":" + hmmSoDto.getPlaceReceiptCode() + ":" + hmmSoDto.getPlaceReceiptName());
|
|
|
+ // 装货港代码 + 装货港
|
|
|
+ writer.write(":" + hmmSoDto.getPolCode() + ":" + hmmSoDto.getPolName());
|
|
|
+ // 卸货港代码 + 卸货港代
|
|
|
+ writer.write(":" + hmmSoDto.getPodCode() + ":" + hmmSoDto.getPodName());
|
|
|
+ // 中转港代码 + 中转港 不填
|
|
|
+ writer.write(":" + hmmSoDto.getPotCode() + ":" + hmmSoDto.getPotName());
|
|
|
+ // 交货地代码 + 交货地
|
|
|
+ writer.write(":" + hmmSoDto.getPlaceDeliveryCode() + ":" + hmmSoDto.getPlaceDeliveryName());
|
|
|
+ // 目的地代码 + 目的地
|
|
|
+ writer.write(":" + hmmSoDto.getPlaceDestinationCode() + ":" + hmmSoDto.getPlaceDestinationName() + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 14 FREIGHT CLAUSE 运费条款
|
|
|
+ String pm = hmmSoDto.getPaymentType();
|
|
|
+ String pmc = "PP".equals(pm) ? "P" : ("CC".equals(pm) ? "C" : "OTH");
|
|
|
+ writer.write("14:" + pm + ":" + ("PP".equals(pm) ? "FREIGHT PREPAID" : ("CC".equals(pm) ? "FREIGHT COLLECT" : "OTHER")) + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 15 运费及费用项目
|
|
|
+ writer.write("15::NONE:" + pm + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 17 REMARKS 订舱备注 其他信息
|
|
|
+ // 有订舱备注,填订舱备注,否则填 IEIEC
|
|
|
+ List<String> bookingRemarksAddtion = new ArrayList<>();
|
|
|
+
|
|
|
+ String IEIEC = ObjectUtils.isNotNull(hmmSoDto.getEdiIeiec()) ? hmmSoDto.getEdiIeiec().trim() : "";
|
|
|
+ List<String> bookingRemarks = RegularUtils.reformatEDIText(hmmSoDto.getBookingRemarks(), 35, true);
|
|
|
+ if (bookingRemarks.size()>0 || !IEIEC.isEmpty()) {
|
|
|
+ writer.write("17"); // 发货人代码为空
|
|
|
+ if(IEIEC.isEmpty()) {
|
|
|
+ int lc = 0;
|
|
|
+ for (int l = 0; l < bookingRemarks.size(); l++) {
|
|
|
+ String line = bookingRemarks.get(l);
|
|
|
+ if (line.trim().isEmpty()) {
|
|
|
+ line = ".";
|
|
|
+ }
|
|
|
+ lc++;
|
|
|
+ if (l <= 5) {
|
|
|
+ writer.write(":" + line);
|
|
|
+ } else {
|
|
|
+ bookingRemarksAddtion.add(line);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ writer.write(":" + IEIEC);
|
|
|
+ if(ObjectUtils.isNotNull(hmmSoDto.getEdiIegstin())){
|
|
|
+ writer.write(":" + hmmSoDto.getEdiIegstin());
|
|
|
+ }
|
|
|
+ if(ObjectUtils.isNotNull(hmmSoDto.getEdiIemail())){
|
|
|
+ writer.write(":" + RegularUtils.escapeEDILine(hmmSoDto.getEdiIemail()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 20 SHIPPER 发货人
|
|
|
+ // 处理收发通之前,先处理货描,因为收发通多余的部分要追加到货描
|
|
|
+ List<String> goodsDescAddtion = new ArrayList<>();
|
|
|
+ // 发货人
|
|
|
+ String shpr = ObjectUtils.isNull(hmmSoDto.getMShipper()) ? hmmSoDto.getHShipper() : hmmSoDto.getMShipper();
|
|
|
+ List<String> hShipper = RegularUtils.reformatEDIText(shpr, 35, true);
|
|
|
+ writer.write("20:"); // 发货人代码为空
|
|
|
+ for (int l = 0; l < hShipper.size(); l++) {
|
|
|
+ if (l < 5) {
|
|
|
+ writer.write(":" + hShipper.get(l));
|
|
|
+ } else {
|
|
|
+ goodsDescAddtion.add("*" + hShipper.get(l));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 21 CONSIGNEE 收货人
|
|
|
+ String cnee = ObjectUtils.isNull(hmmSoDto.getMConsignee()) ? hmmSoDto.getHConsignee() : hmmSoDto.getMConsignee();
|
|
|
+ List<String> hConsignee = RegularUtils.reformatEDIText(cnee, 35, true);
|
|
|
+ writer.write("21:"); // 收货人代码为空
|
|
|
+ for (int l = 0; l < hConsignee.size(); l++) {
|
|
|
+ if (l < 5) {
|
|
|
+ writer.write(":" + hConsignee.get(l));
|
|
|
+ } else {
|
|
|
+ goodsDescAddtion.add("**" + hConsignee.get(l));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 22 NOTIFY PARTY 通知人
|
|
|
+ String notify = ObjectUtils.isNull(hmmSoDto.getMNotify()) ? hmmSoDto.getHNotify() : hmmSoDto.getMNotify();
|
|
|
+ List<String> hNotify = RegularUtils.reformatEDIText(notify, 35, true);
|
|
|
+ writer.write("22:"); // 通知人代码为空
|
|
|
+ for (int l = 0; l < hNotify.size(); l++) {
|
|
|
+ if (l < 5) {
|
|
|
+ writer.write(":" + hNotify.get(l));
|
|
|
+ } else {
|
|
|
+ goodsDescAddtion.add("***" + hNotify.get(l));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 41 CARGO OF BOOKING 订舱货物
|
|
|
+ // 注:1)货物有两种包装,如是大包装(如托盘),则必须同时填小包装件数和包装类型;
|
|
|
+ // 2) CARGO ID (货物标识)的填法: S=普通, R=冷冻, D=危险 , O=非标
|
|
|
+ // 41:1::S:8378:CT:CARTONS:20559:138.8::::::20559'
|
|
|
+ // 记录类型标识 + 货物序号 + 货类代码 + 货物标识
|
|
|
+ writer.write("41:1::" + ("danger".equals(cargoType) ? "D" : ("reefer".equals(cargoType) ? "R" : "S")));
|
|
|
+ // 第一层包装件数 + 第一层包装类型 + 第一层包装说明
|
|
|
+ writer.write(":" + hmmSoDto.getPackagesNumber() + ":" + hmmSoDto.getPackagesCode() + ":" + hmmSoDto.getPackagesDescribe());
|
|
|
+ // 第一层包装皮重 + 第一层包装尺码
|
|
|
+ writer.write(":" + hmmSoDto.getGrossWeight().setScale(3, BigDecimal.ROUND_HALF_UP));
|
|
|
+ writer.write(":" + hmmSoDto.getVolumeOfGoods().setScale(3, BigDecimal.ROUND_HALF_UP));
|
|
|
+ // 第二层包装件数 + 第二层包装类型 + 第二层包装说明 + 第二层包装皮重 + 第二层包装尺码 + 货毛重
|
|
|
+ writer.write("::::::" + hmmSoDto.getGrossWeight().setScale(3, BigDecimal.ROUND_HALF_UP) + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 43 DANGEROUS, REEFER & OOG 危险品,冷藏和超标信息
|
|
|
+ // 温度中,除正(+)负(-)号及小数点外,最多只能三位数字。
|
|
|
+ if (ObjectUtils.isNotNull(hmmSoDto.getPreCntrs())) {
|
|
|
+ List<Map<String, Object>> mapList = hmmSoDto.getPreCntrs();
|
|
|
+ if (mapList.size() > 0) {
|
|
|
+ Map<String, Object> map = mapList.get(0);
|
|
|
+ String T = map.get("temperature").toString();
|
|
|
+ String V = map.get("ventilation").toString();
|
|
|
+ if((ObjectUtils.isNotNull(T) && ObjectUtils.isNull(V)) || (ObjectUtils.isNull(T) && ObjectUtils.isNotNull(V))){
|
|
|
+ throw new SecurityException("温度和通风度必须同时填写!");
|
|
|
+ }
|
|
|
+
|
|
|
+ writer.write("43:"+hmmSoDto.getDgImdgCode()+"::"+hmmSoDto.getDgUnCode()+":::::::" + map.get("ventilation") + ":C:" + map.get("temperature") + "::::::::'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 44 MARKS & NOS. 唛头 1-10 行
|
|
|
+ List<String> goodsMarks = RegularUtils.reformatEDIText(hmmSoDto.getMarks(), 47, true);
|
|
|
+ List<String> goodsMarksAddtion = new ArrayList<>();
|
|
|
+ writer.write("44");
|
|
|
+ for (int l = 0; l < goodsMarks.size(); l++) {
|
|
|
+ if (l < 5) {
|
|
|
+ writer.write(":" + goodsMarks.get(l));
|
|
|
+ } else {
|
|
|
+ goodsMarksAddtion.add(goodsMarks.get(l));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 47 CARGO DESCRIPTION 货物描述 5行一组
|
|
|
+ List<String> goodsDesc = RegularUtils.reformatEDIText(hmmSoDto.getGoodsDesc(), 47, true);
|
|
|
+ List<String> goodsDescAddtion2 = new ArrayList<>();
|
|
|
+ writer.write("47");
|
|
|
+ for (int l = 0; l < goodsDesc.size(); l++) {
|
|
|
+ String line = goodsDesc.get(l);
|
|
|
+ line = line.trim().isEmpty() ? "." : line;
|
|
|
+ if (l < 5) {
|
|
|
+ writer.write(":" + line);
|
|
|
+ } else {
|
|
|
+ goodsDescAddtion2.add(line);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 48 CONTAINER OF BOOKING 订舱预配箱
|
|
|
+ if (ObjectUtils.isNotNull(hmmSoDto.getPreCntrs())) {
|
|
|
+ List<Map<String, Object>> mapList = hmmSoDto.getPreCntrs();
|
|
|
+ for (Map<String, Object> map1 : mapList) {
|
|
|
+ // 记录类型标识 + 集装箱尺寸类 + 集装箱箱数
|
|
|
+ writer.write("48:" + map1.get("sizeType") + ":" + map1.get("cntrQty"));
|
|
|
+ // 集装箱状态 + 主拼号 + 装箱方式 自选/内装/自派车队等
|
|
|
+ writer.write(":" + ("FCL".equals(hmmSoDto.getLoadType()) ? "F" : "L") + "::");
|
|
|
+ // 装箱地点代码 + 装箱地点说明 + 货主箱标志
|
|
|
+ writer.write(":::"+("1".equals(map1.get("isSoc").toString()) ? "Y" : "N")+"'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 90 订舱人联系信息
|
|
|
+ writer.write("90:QJM:QINGDAO JMS-LOGISTICS SERVICE CO.,LTD.::Miya Wang:0086-532-82668811-216:0086-532-82668660-216:hmm-seataocn@jms-logistics.com'");
|
|
|
+
|
|
|
+ // 99 TRAILER RECORD 尾记录
|
|
|
+ // RECORD TOTAL OF FILE 记录总数 9(6) 包括:头、尾记录
|
|
|
+ writer.write("99:" + (++count) + "'");
|
|
|
+
|
|
|
+ writer.close();
|
|
|
+
|
|
|
+ return createEDIFilesCenter(hmmSoDto, file);
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new SecurityException("生成edi文件失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public FilesCenter sendingHmmSI(InttraSoDto hmmSiDto, JsonNode ediParamCarrier){
|
|
|
+ try {
|
|
|
+ String localFolder = genEdiLocalFolder(hmmSiDto, ediParamCarrier);
|
|
|
+ String localFileName = genEdiLocalFileName(hmmSiDto, ediParamCarrier);
|
|
|
+ File file = new File(localFolder, localFileName);
|
|
|
+ file.createNewFile();
|
|
|
+ // 打开文件输出流进行写入操作
|
|
|
+ BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
|
|
+ int count = 0;
|
|
|
+ String carrierCode = hmmSiDto.getCarrierCode();
|
|
|
+ String cargoType = hmmSiDto.getCargoType();
|
|
|
+
|
|
|
+ // 向文件写入数据
|
|
|
+ // 00 HEAD RECORD
|
|
|
+ // 2=增加 3=删除 4=变更 9=原始
|
|
|
+ writer.write("00:IFTMIN:shipping request:9:" + hmmSiDto.getSenderCode() + ":HMM:" + hmmSiDto.getFileDate() + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 02 BOOKING 订舱信息
|
|
|
+ // 记录类型标识
|
|
|
+ writer.write("02");
|
|
|
+ // 运编号
|
|
|
+ writer.write(":" + hmmSiDto.getMblNo());
|
|
|
+ // 提单号
|
|
|
+ writer.write(":" + hmmSiDto.getMblNo());
|
|
|
+ // 交货条款 CY-CY(pier-pier/port):30
|
|
|
+ //CY-CFS(pier/port-door): 29
|
|
|
+ //CFS-CY(door-pier/port): 28
|
|
|
+ //CFS-CFS(door-door): 27
|
|
|
+ writer.write(":" + ("CY-DOOR".equals(hmmSiDto.getTransportTermName()) ? "CY-DR" : hmmSiDto.getTransportTermName()));
|
|
|
+ // 货代方企业名称
|
|
|
+ writer.write(":" + hmmSiDto.getSenderCode());
|
|
|
+ // 即接受订舱的人的代码 + 签单人说明 + 询价单位 + 国外订舱单位 + 转船标识 + 分批 + 装期 + 效期 + 运费协议号 + 费率本代码 + 服务合同号 + BOND NO + 舱位互用标识
|
|
|
+ writer.write(":HMM::::::::" + hmmSiDto.getCarrierArgreementNo() + "::"+hmmSiDto.getCorpArgreementNo()+"::'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 03 提单信息,不填
|
|
|
+ // 提单类型(ORI: BILL OF LADING EXP: WAYBILL) + 提单签发地代码 + 提单签发地 + 签发日期 + 正本提单份数 + 预付地点 + 到付地点
|
|
|
+ String issueType = "ORI".equals(hmmSiDto.getIssueType()) || "EXP".equals(hmmSiDto.getIssueType()) ? hmmSiDto.getIssueType() : "";
|
|
|
+ writer.write("03:"+issueType+"::" + hmmSiDto.getIssuanceLand() + ":" + hmmSiDto.getIssueDate() + ":3:"
|
|
|
+ + ("PP".equals(hmmSiDto.getPaymentType()) ? hmmSiDto.getPaymentLand() : "")
|
|
|
+ + ("CC".equals(hmmSiDto.getPaymentType()) ? hmmSiDto.getPaymentLand() : ""));
|
|
|
+ // AMS Ams Tag AmsCode
|
|
|
+ // V_AMSPROP IF(AMSPROP='Y','Y',IF(AMSPROP='N','N',IF(AMSPROP='1',' ','')))
|
|
|
+ writer.write(":");
|
|
|
+
|
|
|
+ // ACI Canada Aci
|
|
|
+ // V_ACIPROP IF(ACIPROP='Y','Y',IF(ACIPROP='N','N',IF(ACIPROP='1',' ','')))
|
|
|
+ // ACI NO VarChar(35)
|
|
|
+ writer.write(":'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 11 VESSEL 船舶信息
|
|
|
+ // 记录类型标识 + 船舶呼号 + 船名 + 航次 + 船舶经营人
|
|
|
+ writer.write("11:::::::::::"+hmmSiDto.getVesselCode()+":"+hmmSiDto.getVesselName()+":"+hmmSiDto.getVoyageNo()+"'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 12 PORTS 地点信息
|
|
|
+ writer.write("12");
|
|
|
+ // 收货地代码 + 收货地代名称
|
|
|
+ writer.write(":" + hmmSiDto.getPlaceReceiptCode() + ":" + hmmSiDto.getPlaceReceiptName());
|
|
|
+ // 装货港代码 + 装货港
|
|
|
+ writer.write(":" + hmmSiDto.getPolCode() + ":" + hmmSiDto.getPolName());
|
|
|
+ // 卸货港代码 + 卸货港代
|
|
|
+ writer.write(":" + hmmSiDto.getPodCode() + ":" + hmmSiDto.getPodName());
|
|
|
+ // 中转港代码 + 中转港 不填
|
|
|
+ writer.write(":"+hmmSiDto.getPotCode()+":"+hmmSiDto.getPotName());
|
|
|
+ // 交货地代码 + 交货地
|
|
|
+ writer.write(":" + hmmSiDto.getPlaceDeliveryCode() + ":" + hmmSiDto.getPlaceDeliveryName());
|
|
|
+ // 目的地代码 + 目的地
|
|
|
+ writer.write(":" + hmmSiDto.getPlaceDestinationCode() + ":" + hmmSiDto.getPlaceDestinationName() + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 14 FREIGHT CLAUSE 运费条款
|
|
|
+ String pm = hmmSiDto.getPaymentType();
|
|
|
+ String pmc = "PP".equals(pm) ? "P" : ("CC".equals(pm) ? "C" : "OTH");
|
|
|
+ writer.write("14:" + pm + ":" + ("PP".equals(pm) ? "FREIGHT PREPAID" : ("CC".equals(pm) ? "FREIGHT COLLECT" : "OTHER")) + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 15 运费及费用项目
|
|
|
+ writer.write("15::NONE:" + pm + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+
|
|
|
+ // 17 REMARKS 订舱备注 其他信息
|
|
|
+ // 有订舱备注,填订舱备注,否则填 IEIEC
|
|
|
+ String IEIEC = ObjectUtils.isNotNull(hmmSiDto.getEdiIeiec()) ? hmmSiDto.getEdiIeiec().trim() : "";
|
|
|
+ String IEGSTIN = ObjectUtils.isNotNull(hmmSiDto.getEdiIegstin()) ? hmmSiDto.getEdiIegstin().trim() : "";
|
|
|
+ String IEMAIL = ObjectUtils.isNotNull(hmmSiDto.getEdiIemail()) ? hmmSiDto.getEdiIemail().trim() : "";
|
|
|
+ if(!IEIEC.isEmpty()){
|
|
|
+ writer.write("17:" + IEIEC + ":" + IEGSTIN +":" + IEMAIL + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count++;
|
|
|
+ }
|
|
|
+// List<String> bookingRemarksAddtion = new ArrayList<>();
|
|
|
+// List<String> bookingRemarks = RegularUtils.reformatEDIText(hmmSiDto.getBookingRemarks(), 35, true);
|
|
|
+// if (bookingRemarks.size()>0 || !IEIEC.isEmpty()) {
|
|
|
+// writer.write("17"); // 发货人代码为空
|
|
|
+// if(IEIEC.isEmpty()) {
|
|
|
+// int lc = 0;
|
|
|
+// for (int l = 0; l < bookingRemarks.size(); l++) {
|
|
|
+// String line = bookingRemarks.get(l);
|
|
|
+// if (line.trim().isEmpty()) {
|
|
|
+// line = ".";
|
|
|
+// }
|
|
|
+// lc++;
|
|
|
+// if (l <= 5) {
|
|
|
+// writer.write(":" + line);
|
|
|
+// } else {
|
|
|
+// bookingRemarksAddtion.add(line);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// writer.write(":" + IEIEC);
|
|
|
+// if(ObjectUtils.isNotNull(hmmSiDto.getEdiIegstin())){
|
|
|
+// writer.write(":" + hmmSiDto.getEdiIegstin());
|
|
|
+// }
|
|
|
+// if(ObjectUtils.isNotNull(hmmSiDto.getEdiIemail())){
|
|
|
+// writer.write(":" + RegularUtils.escapeEDILine(hmmSiDto.getEdiIemail()));
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// writer.write("'");
|
|
|
+// writer.newLine();
|
|
|
+// count++;
|
|
|
+// }
|
|
|
+
|
|
|
+ // 20 SHIPPER 发货人
|
|
|
+ // 处理收发通之前,先处理货描,因为收发通多余的部分要追加到货描
|
|
|
+ List<String> goodsDescAddtion = new ArrayList<>();
|
|
|
+ // 发货人
|
|
|
+ String shpr = ObjectUtils.isNull(hmmSiDto.getMShipper()) ? hmmSiDto.getHShipper() : hmmSiDto.getMShipper();
|
|
|
+ List<String> hShipper = RegularUtils.reformatEDIText(shpr, 35, true);
|
|
|
+ writer.write("20:"); // 发货人代码为空
|
|
|
+ for (int l = 0; l < hShipper.size(); l++) {
|
|
|
+ if (l < 5) {
|
|
|
+ writer.write(":" + hShipper.get(l));
|
|
|
+ } else {
|
|
|
+ goodsDescAddtion.add("*" + hShipper.get(l));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 21 CONSIGNEE 收货人
|
|
|
+ String cnee = ObjectUtils.isNull(hmmSiDto.getMConsignee()) ? hmmSiDto.getHConsignee() : hmmSiDto.getMConsignee();
|
|
|
+ List<String> hConsignee = RegularUtils.reformatEDIText(cnee, 35, true);
|
|
|
+ writer.write("21:"); // 收货人代码为空
|
|
|
+ for (int l = 0; l < hConsignee.size(); l++) {
|
|
|
+ if (l < 5) {
|
|
|
+ writer.write(":" + hConsignee.get(l));
|
|
|
+ } else {
|
|
|
+ goodsDescAddtion.add("**" + hConsignee.get(l));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 22 NOTIFY PARTY 通知人
|
|
|
+ String notify = ObjectUtils.isNull(hmmSiDto.getMNotify()) ? hmmSiDto.getHNotify() : hmmSiDto.getMNotify();
|
|
|
+ List<String> hNotify = RegularUtils.reformatEDIText(notify, 35, true);
|
|
|
+ writer.write("22:"); // 通知人代码为空
|
|
|
+ for (int l = 0; l < hNotify.size(); l++) {
|
|
|
+ if (l < 5) {
|
|
|
+ writer.write(":" + hNotify.get(l));
|
|
|
+ } else {
|
|
|
+ goodsDescAddtion.add("***" + hNotify.get(l));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 23 SEC NOTIFY PARTY 第二通知人
|
|
|
+ String notify2 = ObjectUtils.isNull(hmmSiDto.getMNotify2()) ? hmmSiDto.getHNotify2() : hmmSiDto.getMNotify2();
|
|
|
+ List<String> hNotify2 = RegularUtils.reformatEDIText(notify2, 35, true);
|
|
|
+ writer.write("23:"); // 通知人代码为空
|
|
|
+ for (int l = 0; l < hNotify2.size(); l++) {
|
|
|
+ if (l < 5) {
|
|
|
+ writer.write(":" + hNotify2.get(l));
|
|
|
+ } else {
|
|
|
+ goodsDescAddtion.add("****" + hNotify2.get(l));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 41 CARGO OF BOOKING 订舱货物
|
|
|
+ // 注:1)货物有两种包装,如是大包装(如托盘),则必须同时填小包装件数和包装类型;
|
|
|
+ // 2) CARGO ID (货物标识)的填法: S=普通, R=冷冻, D=危险 , O=非标
|
|
|
+ // 41:1::S:8378:CT:CARTONS:20559:138.8::::::20559'
|
|
|
+ // 记录类型标识 + 货物序号 + 货类代码 + 货物标识
|
|
|
+ writer.write("41:1::" + ("danger".equals(cargoType) ? "D" : ("reefer".equals(cargoType) ? "R" : "S")));
|
|
|
+ // 第一层包装件数 + 第一层包装类型 + 第一层包装说明
|
|
|
+ writer.write(":" + hmmSiDto.getPackagesNumber() + ":" + hmmSiDto.getPackagesCode() + ":" + hmmSiDto.getPackagesDescribe());
|
|
|
+ // 第一层包装皮重 + 第一层包装尺码
|
|
|
+ writer.write(":" + hmmSiDto.getGrossWeight().setScale(3, BigDecimal.ROUND_HALF_UP));
|
|
|
+ writer.write(":" + hmmSiDto.getVolumeOfGoods().setScale(3, BigDecimal.ROUND_HALF_UP));
|
|
|
+ // 第二层包装件数 + 第二层包装类型 + 第二层包装说明 + 第二层包装皮重 + 第二层包装尺码 + 货毛重
|
|
|
+ writer.write("::::::" + hmmSiDto.getGrossWeight().setScale(3, BigDecimal.ROUND_HALF_UP) + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // 43 DANGEROUS, REEFER & OOG 危险品,冷藏和超标信息
|
|
|
+ // 温度中,除正(+)负(-)号及小数点外,最多只能三位数字。
|
|
|
+ if (ObjectUtils.isNotNull(hmmSiDto.getPreCntrs())) {
|
|
|
+ List<Map<String, Object>> mapList = hmmSiDto.getPreCntrs();
|
|
|
+ if (mapList.size() > 0) {
|
|
|
+ Map<String, Object> map = mapList.get(0);
|
|
|
+ String T = map.get("temperature").toString();
|
|
|
+ String V = map.get("ventilation").toString();
|
|
|
+ if((ObjectUtils.isNotNull(T) && ObjectUtils.isNull(V)) || (ObjectUtils.isNull(T) && ObjectUtils.isNotNull(V))){
|
|
|
+ throw new SecurityException("温度和通风度必须同时填写!");
|
|
|
+ }
|
|
|
+
|
|
|
+ writer.write("43:"+hmmSiDto.getDgImdgCode()+"::"+hmmSiDto.getDgUnCode()+":::::::" + map.get("ventilation") + ":C:" + map.get("temperature") + "::::::::'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 44 MARKS & NOS. 唛头 12 节
|
|
|
+ List<String> goodsMarks = RegularUtils.reformatEDIText(hmmSiDto.getMarks(), 35, true);
|
|
|
+ int marksLineCount = goodsMarks.size();
|
|
|
+ for (int l = 0; l < marksLineCount; l++) {
|
|
|
+ String line = goodsMarks.get(l);
|
|
|
+ if(line.trim().isEmpty()){
|
|
|
+ line=".";
|
|
|
+ }
|
|
|
+ if((l % 9)==0){
|
|
|
+ writer.write("44");
|
|
|
+ }
|
|
|
+ writer.write(":" + line);
|
|
|
+ if((l % 9)==8 || l==(marksLineCount - 1)){
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 47 CARGO DESCRIPTION 货物描述 5行一组
|
|
|
+ List<String> goodsDesc = RegularUtils.reformatEDIText(hmmSiDto.getGoodsDesc(), 70, true);
|
|
|
+ int descrLineCount = goodsDesc.size();
|
|
|
+ for (int l = 0; l < descrLineCount; l++) {
|
|
|
+ String line = goodsMarks.get(l);
|
|
|
+ if(line.trim().isEmpty()){
|
|
|
+ line=".";
|
|
|
+ }
|
|
|
+ if((l % 5)==0){
|
|
|
+ writer.write("47");
|
|
|
+ }
|
|
|
+ writer.write(":" + line);
|
|
|
+ if((l % 5)==7 || l==(descrLineCount - 1)){
|
|
|
+ writer.write("'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 附加文本,Shpr, Cnee, Notify, Notify2
|
|
|
+ for(String line : goodsDescAddtion){
|
|
|
+ writer.write("47:" + line + "'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 48 CONTAINER OF BOOKING 订舱预配箱
|
|
|
+ if (ObjectUtils.isNotNull(hmmSiDto.getPreCntrs())) {
|
|
|
+ List<Map<String, Object>> mapList = hmmSiDto.getPreCntrs();
|
|
|
+ for (Map<String, Object> map1 : mapList) {
|
|
|
+ // 记录类型标识 + 集装箱尺寸类 + 集装箱箱数
|
|
|
+ writer.write("48:" + map1.get("sizeType") + ":" + map1.get("cntrQty"));
|
|
|
+ // 集装箱状态
|
|
|
+ writer.write(":" + (ObjectUtils.isNotNull(hmmSiDto.getBookingNo()) && !hmmSiDto.getBookingNo().equals(hmmSiDto.getLoadType()) ? "L" : "F"));
|
|
|
+ // 主拼号 + 装箱方式 自选/内装/自派车队等
|
|
|
+ writer.write(":" + (ObjectUtils.isNotNull(hmmSiDto.getBookingNo()) && !hmmSiDto.getBookingNo().equals(hmmSiDto.getLoadType()) ? hmmSiDto.getBookingNo() : ""));
|
|
|
+ writer.write("::::N'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // DD, MM + HH
|
|
|
+ List<InttraSoDto> billsList = new ArrayList<>();
|
|
|
+ billsList.add(hmmSiDto);
|
|
|
+ hmmSiDto.setIsMasterBill(true);
|
|
|
+ if (ObjectUtils.isNotNull(hmmSiDto.getHblBillsList())) {
|
|
|
+ for (InttraSoDto bill : hmmSiDto.getHblBillsList()) {
|
|
|
+ bill.setIsMasterBill(false);
|
|
|
+ billsList.add(bill);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for(InttraSoDto bill : billsList) {
|
|
|
+ if (ObjectUtils.isNotNull(bill.getLoadedCntrs())) {
|
|
|
+ List<Map<String, Object>> mapLoadedList = bill.getLoadedCntrs();
|
|
|
+ for (Map<String, Object> map : mapLoadedList) {
|
|
|
+ // 箱号
|
|
|
+ String cntrNo=map.get("cntrNo").toString();
|
|
|
+ String sealNo=map.get("sealNo").toString();
|
|
|
+ if(!(cntrNo.isEmpty() && sealNo.isEmpty())){
|
|
|
+ if(cntrNo.isEmpty() || sealNo.isEmpty()){
|
|
|
+ throw new SecurityException("箱号、铅封号必须同时填写!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String sizeType=map.get("sizeType").toString();
|
|
|
+ if(sizeType.isEmpty()) {
|
|
|
+ throw new SecurityException("HMM EDI 箱型代码没有维护!");
|
|
|
+ }
|
|
|
+ BigDecimal pkgs = ((BigDecimal) map.get("quantity")).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal gwt = ((BigDecimal) map.get("grossWeight")).setScale(3, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal vol = ((BigDecimal) map.get("volume")).setScale(3, BigDecimal.ROUND_HALF_UP);
|
|
|
+ if (ObjectUtils.isNull(pkgs.equals(BigDecimal.ZERO))
|
|
|
+ || ObjectUtils.isNull(gwt.equals(BigDecimal.ZERO))
|
|
|
+ || ObjectUtils.isNull(vol.equals(BigDecimal.ZERO))
|
|
|
+ ) {
|
|
|
+ throw new SecurityException("箱内货物件重尺填写不全!");
|
|
|
+ }
|
|
|
+
|
|
|
+ writer.write("51:"+cntrNo+":"+sizeType+":" + sealNo + ":" + pkgs.toString());
|
|
|
+ writer.write(":" + gwt.toString() + ":" + ((BigDecimal) map.get("tareWeight")).setScale(3, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ writer.write(":" + vol.toString());
|
|
|
+ writer.write("::::::");
|
|
|
+ // VGM WT + VGM DATE + VGM METHOD + VGM LOCATION
|
|
|
+ // wfg
|
|
|
+ writer.write("::::'");
|
|
|
+ writer.newLine();
|
|
|
+ count += 1;
|
|
|
+
|
|
|
+ // VGM Shipper
|
|
|
+ // wfg
|
|
|
+ writer.write("58::::::::'");
|
|
|
+
|
|
|
+ // VGM WEIGHT COMPANY
|
|
|
+ // wfg
|
|
|
+ writer.write("59::::::::'");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 90 订舱人联系信息
|
|
|
+ writer.write("90:QJM:QINGDAO JMS-LOGISTICS SERVICE CO.,LTD.::Miya Wang:0532-82668811 Ext.171:0532-82668660 Ext.171:hmm-seataocn@jms-logistics.com'");
|
|
|
+
|
|
|
+ // 99 TRAILER RECORD 尾记录
|
|
|
+ // RECORD TOTAL OF FILE 记录总数 9(6) 包括:头、尾记录
|
|
|
+ writer.write("99:" + (++count) + "'");
|
|
|
+
|
|
|
+ writer.close();
|
|
|
+
|
|
|
+ return createEDIFilesCenter(hmmSiDto, file);
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new SecurityException("生成edi文件失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|