Bladeren bron

2024年1月8日17:24:11

纪新园 2 jaren geleden
bovenliggende
commit
def898a47f

+ 10 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java

@@ -268,6 +268,16 @@ public class BillsController extends BladeController {
 		return billsService.disembarking(ids);
 	}
 
+	/**
+	 * 取消退舱
+	 */
+	@PostMapping("/revokeDisembarking")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "取消退舱", notes = "传入ids")
+	public R revokeDisembarking(@RequestParam String ids) {
+		return billsService.revokeDisembarking(ids);
+	}
+
 
 	/**
 	 * 删除 业务-海运进出口

+ 7 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IBillsService.java

@@ -133,4 +133,11 @@ public interface IBillsService extends IService<Bills> {
 	 * @return
 	 */
 	Bills copyBills(Bills bills);
+
+	/**
+	 * 取消退舱
+	 * @param ids
+	 * @return
+	 */
+	R revokeDisembarking(String ids);
 }

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

@@ -157,8 +157,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			.eq(Bills::getBookingNo, bills.getBookingNo())
 		);
 		if (bills.getId() == null) {
-			if (count.size() > 0) {
-				throw new RuntimeException("提单号不允许重复");
+			if ("MH".equals(bills.getBillType())) {
+				if (count.size() > 0) {
+					throw new RuntimeException("提单号不允许重复");
+				}
 			}
 			BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
 				.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
@@ -187,8 +189,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			}
 		} else {
 			List<Long> ids = count.stream().map(Bills::getId).distinct().collect(Collectors.toList());
-			if (count.size() > 0 && !ids.contains(bills.getId())) {
-				throw new RuntimeException("提单号不允许重复");
+			if ("MH".equals(bills.getBillType())) {
+				if (count.size() > 0 && !ids.contains(bills.getId())) {
+					throw new RuntimeException("提单号不允许重复");
+				}
 			}
 			bills.setUpdateUser(AuthUtil.getUserId());
 			bills.setUpdateTime(new Date());
@@ -489,6 +493,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			}
 			feeCenterService.submitList(bills.getFeeCenterListD());
 		}
+		BigDecimal quantity = bills.getQuantity();
+		BigDecimal grossWeight = bills.getGrossWeight();
+		BigDecimal measurement = bills.getMeasurement();
 		//主单应加上分单费用
 		if ("MM".equals(bills.getBillType()) && ObjectUtils.isNotNull(bills.getId())) {
 			List<Bills> details = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
@@ -502,6 +509,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				amountCrUsd = amountCrUsd.add(details.stream().map(Bills::getAmountCrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountDrLoc = amountDrLoc.add(details.stream().map(Bills::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCrLoc = amountCrLoc.add(details.stream().map(Bills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				quantity = quantity.add(details.stream().map(Bills::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				grossWeight = grossWeight.add(details.stream().map(Bills::getGrossWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				measurement = measurement.add(details.stream().map(Bills::getMeasurement).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+
 			}
 		} else if ("MH".equals(bills.getBillType()) && ObjectUtils.isNotNull(bills.getId())) {
 			Bills details = baseMapper.selectById(bills.getMasterId());
@@ -516,6 +527,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				BigDecimal amountDrLocM = new BigDecimal("0.00");
 				BigDecimal amountCrLocM = new BigDecimal("0.00");
 				BigDecimal amountProfitLocM = new BigDecimal("0.00");
+				BigDecimal quantityM = new BigDecimal("0.00");
+				BigDecimal grossWeightM = new BigDecimal("0.00");
+				BigDecimal measurementM = new BigDecimal("0.00");
 				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
 					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 					.eq(FeeCenter::getIsDeleted, 0)
@@ -553,6 +567,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 					amountCrUsdM = amountCrUsdM.add(billsLists.stream().map(Bills::getAmountCrUsd).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 					amountDrLocM = amountDrLocM.add(billsLists.stream().map(Bills::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 					amountCrLocM = amountCrLocM.add(billsLists.stream().map(Bills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					quantityM = quantityM.add(billsLists.stream().map(Bills::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					grossWeightM = grossWeightM.add(billsLists.stream().map(Bills::getGrossWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+					measurementM = measurementM.add(billsLists.stream().map(Bills::getMeasurement).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				}
 				amountDrM = amountDrM.add(amountDr);
 				amountCrM = amountCrM.add(amountCr);
@@ -575,6 +592,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				details.setAmountDrLoc(amountDrLocM);
 				details.setAmountCrLoc(amountCrLocM);
 				details.setAmountProfitLoc(amountProfitLocM);
+				details.setQuantity(quantityM);
+				details.setGrossWeight(grossWeightM);
+				details.setMeasurement(measurementM);
 				baseMapper.updateById(details);
 			}
 		}
@@ -593,6 +613,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		bills.setAmountDrLoc(amountDrLoc);
 		bills.setAmountCrLoc(amountCrLoc);
 		bills.setAmountProfitLoc(amountProfitLoc);
+		bills.setQuantity(quantity);
+		bills.setGrossWeight(grossWeight);
+		bills.setMeasurement(measurement);
 		this.saveOrUpdate(bills);
 		/**-------------费用计算---------*/
 		return R.data(bills);
@@ -793,6 +816,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			BigDecimal amountDrLoc = bills.getAmountDrLoc();
 			BigDecimal amountCrLoc = bills.getAmountCrLoc();
 			BigDecimal amountProfitLoc = bills.getAmountProfitLoc();
+			BigDecimal quantity = bills.getQuantity();
+			BigDecimal grossWeight = bills.getGrossWeight();
+			BigDecimal measurement = bills.getMeasurement();
 			if (billsList.size() > 0) {
 				amountDr = amountDr.add(billsList.stream().map(Bills::getAmountDr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCr = amountCr.add(billsList.stream().map(Bills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
@@ -803,6 +829,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				amountDrLoc = amountDrLoc.add(billsList.stream().map(Bills::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCrLoc = amountCrLoc.add(billsList.stream().map(Bills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountProfitLoc = amountProfitLoc.add(billsList.stream().map(Bills::getAmountProfitLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				quantity = quantity.add(billsList.stream().map(Bills::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				grossWeight = grossWeight.add(billsList.stream().map(Bills::getGrossWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				measurement = measurement.add(billsList.stream().map(Bills::getMeasurement).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 			}
 			bills.setAmountDr(amountDr);
 			bills.setAmountCr(amountCr);
@@ -813,6 +842,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills.setAmountDrLoc(amountDrLoc);
 			bills.setAmountCrLoc(amountCrLoc);
 			bills.setAmountProfitLoc(amountProfitLoc);
+			bills.setQuantity(quantity);
+			bills.setGrossWeight(grossWeight);
+			bills.setMeasurement(measurement);
 			baseMapper.updateById(bills);
 		}
 		return R.data("操作成功");
@@ -849,6 +881,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			BigDecimal amountDrLoc = bills.getAmountDrLoc();
 			BigDecimal amountCrLoc = bills.getAmountCrLoc();
 			BigDecimal amountProfitLoc = bills.getAmountProfitLoc();
+			BigDecimal quantity = bills.getQuantity();
+			BigDecimal grossWeight = bills.getGrossWeight();
+			BigDecimal measurement = bills.getMeasurement();
 			if (billsList.size() > 0) {
 				amountDr = amountDr.subtract(billsList.stream().map(Bills::getAmountDr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCr = amountCr.subtract(billsList.stream().map(Bills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
@@ -859,6 +894,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				amountDrLoc = amountDrLoc.subtract(billsList.stream().map(Bills::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCrLoc = amountCrLoc.subtract(billsList.stream().map(Bills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountProfitLoc = amountProfitLoc.subtract(billsList.stream().map(Bills::getAmountProfitLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				quantity = quantity.subtract(billsList.stream().map(Bills::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				grossWeight = grossWeight.subtract(billsList.stream().map(Bills::getGrossWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				measurement = measurement.subtract(billsList.stream().map(Bills::getMeasurement).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 			}
 			bills.setAmountDr(amountDr);
 			bills.setAmountCr(amountCr);
@@ -871,6 +909,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills.setAmountProfitLoc(amountProfitLoc);
 			bills.setMasterBillNo("");
 			bills.setMasterId(0L);
+			bills.setQuantity(quantity);
+			bills.setGrossWeight(grossWeight);
+			bills.setMeasurement(measurement);
 			baseMapper.updateById(bills);
 		}
 		return R.data("操作成功");
@@ -1368,13 +1409,35 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		copyBills.setFeeCenterListC(feeCenterListC);
 		copyBills.setFeeCenterListD(feeCenterListD);
 		copyBills.setPreContainersList(preContainersList);
+		copyBills.setQuantity(new BigDecimal("0.00"));
+		copyBills.setGrossWeight(new BigDecimal("0.00"));
+		copyBills.setMeasurement(new BigDecimal("0.00"));
 		copyBills.setCfsQuantity(new BigDecimal("0.00"));
-		copyBills.setCfsQuantity(new BigDecimal("0.00"));
-		copyBills.setCfsQuantity(new BigDecimal("0.00"));
+		copyBills.setCfsGrossWeight(new BigDecimal("0.00"));
+		copyBills.setCfsMeasurement(new BigDecimal("0.00"));
 		copyBills.setFilesList(filesList);
 		return copyBills;
 	}
 
+	@Override
+	public R revokeDisembarking(String ids) {
+		List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+			.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0)
+			.in(Bills::getId, ids));
+		for (Bills item : billsList) {
+			if (item.getBillStatus() == 0) {
+				throw new RuntimeException("已取消退舱,请勿重复操作");
+			}
+			if (item.getBillStatus() == 3) {
+				throw new RuntimeException("单据已完成,取消退舱失败");
+			}
+			item.setBillStatus(0);
+			item.setBookingWithdrawTime(new Date());
+		}
+		this.updateBatchById(billsList);
+		return R.data("操作成功");
+	}
 
 
 }

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

@@ -96,7 +96,23 @@ public class ContainersServiceImpl extends ServiceImpl<ContainersMapper, Contain
 				branchId = deptId;
 			}
 		}
+		long sealNoCount = baseMapper.selectCount(new LambdaQueryWrapper<Containers>()
+			.eq(Containers::getTenantId, AuthUtil.getTenantId())
+			.eq(Containers::getIsDeleted, 0)
+			.eq(Containers::getPid, containers.getPid())
+			.eq(Containers::getSealNo, containers.getSealNo()));
+		long cntrNoCount = baseMapper.selectCount(new LambdaQueryWrapper<Containers>()
+			.eq(Containers::getTenantId, AuthUtil.getTenantId())
+			.eq(Containers::getIsDeleted, 0)
+			.eq(Containers::getPid, containers.getPid())
+			.eq(Containers::getCntrNo, containers.getCntrNo()));
 		if (containers.getId() == null) {
+			if (cntrNoCount > 0) {
+				throw new RuntimeException("箱号不允许重复");
+			}
+			if (sealNoCount > 0) {
+				throw new RuntimeException("铅封号不允许重复");
+			}
 			containers.setCreateTime(new Date());
 			containers.setCreateUser(AuthUtil.getUserId());
 			containers.setCreateUserName(AuthUtil.getUserName());
@@ -106,6 +122,12 @@ public class ContainersServiceImpl extends ServiceImpl<ContainersMapper, Contain
 				containers.setCreateDeptName(deptName);
 			}
 		} else {
+			if (cntrNoCount > 1) {
+				throw new RuntimeException("箱号不允许重复");
+			}
+			if (sealNoCount > 1) {
+				throw new RuntimeException("铅封号不允许重复");
+			}
 			containers.setUpdateUser(AuthUtil.getUserId());
 			containers.setUpdateTime(new Date());
 			containers.setUpdateUserName(AuthUtil.getUserName());
@@ -407,7 +429,23 @@ public class ContainersServiceImpl extends ServiceImpl<ContainersMapper, Contain
 		List<ContainersBills> subtractContainersBillsList = new ArrayList<>();
 		List<ContainersCommodity> containersCommodityList = new ArrayList<>();
 		for (Containers containers : list) {
+			long sealNoCount = baseMapper.selectCount(new LambdaQueryWrapper<Containers>()
+				.eq(Containers::getTenantId, AuthUtil.getTenantId())
+				.eq(Containers::getIsDeleted, 0)
+				.eq(Containers::getPid, containers.getPid())
+				.eq(Containers::getSealNo, containers.getSealNo()));
+			long cntrNoCount = baseMapper.selectCount(new LambdaQueryWrapper<Containers>()
+				.eq(Containers::getTenantId, AuthUtil.getTenantId())
+				.eq(Containers::getIsDeleted, 0)
+				.eq(Containers::getPid, containers.getPid())
+				.eq(Containers::getCntrNo, containers.getCntrNo()));
 			if (containers.getId() == null) {
+				if (cntrNoCount > 0) {
+					throw new RuntimeException("箱号不允许重复");
+				}
+				if (sealNoCount > 0) {
+					throw new RuntimeException("铅封号不允许重复");
+				}
 				containers.setCreateTime(new Date());
 				containers.setCreateUser(AuthUtil.getUserId());
 				containers.setCreateUserName(AuthUtil.getUserName());
@@ -417,6 +455,12 @@ public class ContainersServiceImpl extends ServiceImpl<ContainersMapper, Contain
 					containers.setCreateDeptName(deptName);
 				}
 			} else {
+				if (cntrNoCount > 1) {
+					throw new RuntimeException("箱号不允许重复");
+				}
+				if (sealNoCount > 1) {
+					throw new RuntimeException("铅封号不允许重复");
+				}
 				containers.setUpdateUser(AuthUtil.getUserId());
 				containers.setUpdateTime(new Date());
 				containers.setUpdateUserName(AuthUtil.getUserName());

+ 564 - 0
blade-service/blade-los/src/main/java/org/springblade/los/edi/api/EDISender.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.los.business.files.entity.FilesCenter;
 import org.springblade.los.edi.dto.EdiAddress;
+import org.springblade.los.edi.dto.InttraSiBillDto;
 import org.springblade.los.edi.dto.InttraSiDto;
 import org.springblade.los.edi.dto.InttraSoDto;
 
@@ -24,6 +25,12 @@ import java.util.List;
 public class EDISender {
 
 
+	/**
+	 * edi  SO
+	 *
+	 * @param inttraSoDto 数据
+	 * @return 结果
+	 */
 	public static FilesCenter sendingInttraSo(@Valid InttraSoDto inttraSoDto) {
 		try {
 			SimpleDateFormat sdf1 = new SimpleDateFormat("yyMMddhhmmss");
@@ -497,6 +504,12 @@ public class EDISender {
 		}
 	}
 
+	/**
+	 * edi  SI
+	 *
+	 * @param inttraSiDto 数据
+	 * @return 结果
+	 */
 	public static FilesCenter sendingInttraSI(@Valid InttraSiDto inttraSiDto) {
 		try {
 			SimpleDateFormat sdf1 = new SimpleDateFormat("yyMMddhhmmss");
@@ -897,6 +910,557 @@ public class EDISender {
 		}
 	}
 
+	/**
+	 * edi  SI-提单
+	 *
+	 * @param inttraSiBillDto 数据
+	 * @return 结果
+	 */
+	public static FilesCenter sendingInttraSiBill(@Valid InttraSiBillDto inttraSiBillDto) {
+		try {
+			SimpleDateFormat sdf1 = new SimpleDateFormat("yyMMddhhmmss");
+			Date date = new Date();
+			//生成edi文件
+			File file = new File("/home/minio/file/" + AuthUtil.getTenantId() + "-bladex/upload", sdf1.format(date) + "-edi.txt");
+			file.createNewFile();
+			// 打开文件输出流进行写入操作
+			BufferedWriter writer = new BufferedWriter(new FileWriter(file));
+			// 向文件写入数据
+			/* =================0005=================  */
+			writer.write("UNB+UNOC:2+" + inttraSiBillDto.getIdentifying() + ":ZZZ+INTTRA:ZZZ+" + inttraSiBillDto.getDate() + "+" + inttraSiBillDto.getFileExchangeNumber() + "'");
+			writer.newLine();
+			/* =================0010=================  */
+			writer.write("UNH+" + inttraSiBillDto.getInformationNo() + "+IFTMIN:D:99B:UN'");
+			writer.newLine();
+			/* =================0020=================  */
+			writer.write("BGM+340+" + inttraSiBillDto.getIdentificationCode() + "+" + inttraSiBillDto.getFilesFunction() + "'");
+			writer.newLine();
+			/* =================0050=================  */
+			writer.write("DTM+137:" + inttraSiBillDto.getFilesDate() + "203'");
+			writer.newLine();
+			/* =================0060=================  */
+			writer.write("TSR+" + inttraSiBillDto.getTransportTermCode() + "+" + inttraSiBillDto.getLclType() + "'");
+			writer.newLine();
+			/* =================0070=================  */
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCurCode())) {
+				writer.write("CUX+4:" + inttraSiBillDto.getCurCode() + "'");
+				writer.newLine();
+			}
+			/* =================0080=================  */
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getFeeAmount())) {
+				writer.write("MOA+44:" + inttraSiBillDto.getFeeAmount() + "'");
+				writer.newLine();
+			}
+			/* =================0090=================  */
+			writer.write("FTX+" + inttraSiBillDto.getRemarksCode() + "");
+			if ("CCI".equals(inttraSiBillDto.getRemarksCode())) {
+				writer.write("++MFS");
+				inttraSiBillDto.setRemarksContentCode("MFS");
+			} else if ("DOC".equals(inttraSiBillDto.getRemarksCode())) {
+				writer.write("++SMI");
+				inttraSiBillDto.setRemarksContentCode("SMI");
+			} else {
+				//todo
+			}
+			if ("BLC".equals(inttraSiBillDto.getRemarksCode())) {
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getRemarks())) {
+					if (inttraSiBillDto.getRemarks().indexOf("NA") > 0) {
+						throw new RuntimeException("edi数据错误");
+					}
+				}
+			}
+			if ("MFS".equals(inttraSiBillDto.getRemarksContentCode())) {
+				writer.write("+" + inttraSiBillDto.getRemarks());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getRemarksTwo())) {
+					writer.write(":" + inttraSiBillDto.getRemarksTwo());
+				} else {
+					throw new RuntimeException("文本内容2不能为空");
+				}
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getRemarksThree())) {
+				writer.write(":" + inttraSiBillDto.getRemarksThree() + "'");
+				writer.newLine();
+			} else {
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================0100=================  */
+			writer.write("CNT+" + inttraSiBillDto.getSumType() + ":" + inttraSiBillDto.getSumValue());
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getSumUnit())) {
+				writer.write(":" + inttraSiBillDto.getSumUnit() + "'");
+				writer.newLine();
+			} else {
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================0140=================  */
+			writer.write("LOC+" + inttraSiBillDto.getLocationType());
+			if ("73".equals(inttraSiBillDto.getLocationType())) {
+				if (ObjectUtils.isNull(inttraSiBillDto.getLocationCode())) {
+					throw new RuntimeException("提单签发地点代码不能为空");
+				}
+				if (ObjectUtils.isNull(inttraSiBillDto.getDefine())) {
+					throw new RuntimeException("提单签发地点代码定义者不能为空");
+				}
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getLocationCode())) {
+				writer.write("+" + inttraSiBillDto.getLocationCode());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getDefine())) {
+				writer.write("::" + inttraSiBillDto.getDefine());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getLocation())) {
+				writer.write(":" + inttraSiBillDto.getLocation());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCountryCode())) {
+				writer.write("+" + inttraSiBillDto.getCountryCode());
+			}
+			writer.write("'");
+			writer.newLine();
+			/* =================0150=================  */
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getIssueDate())) {
+				writer.write("DTM+95:" + inttraSiBillDto.getIssueDate());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getIssueDateType())) {
+					writer.write(":" + inttraSiBillDto.getIssueDateType());
+					writer.newLine();
+				} else {
+					writer.write("'");
+					writer.newLine();
+				}
+			}
+			/* =================0200=================  */
+			writer.write("RFF+" + inttraSiBillDto.getBillNoType() + ":" + inttraSiBillDto.getBillNoValue() + "'");
+			writer.newLine();
+			/* =================0210=================  */
+			if ("LC".equals(inttraSiBillDto.getBillNoType())) {
+				writer.write("DTM+" + inttraSiBillDto.getValidityPeriodType());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getValidityPeriod())) {
+					writer.write(":" + inttraSiBillDto.getValidityPeriod());
+				}
+				writer.write(":102'");
+				writer.newLine();
+			}
+			/* =================0320=================  */
+			writer.write("CPI++" + inttraSiBillDto.getPaymentType() + "++" + inttraSiBillDto.getPaymentTypeCode() + "'");
+			writer.newLine();
+			/* =================0480=================  */
+			writer.write("TDT+20");
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getVoyageNo())) {
+				writer.write("+" + inttraSiBillDto.getVoyageNo());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getTransportMode())) {
+				writer.write("+" + inttraSiBillDto.getTransportMode());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getVesselCarrierCode())) {
+				writer.write("++" + inttraSiBillDto.getVesselCarrierCode());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getVesselCarrierListCode())) {
+				writer.write(":" + inttraSiBillDto.getVesselCarrierListCode());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getVesselCode())) {
+				writer.write("+++" + inttraSiBillDto.getVesselCode());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getVesselDefine())) {
+				writer.write("::" + inttraSiBillDto.getVesselDefine());
+			}
+			writer.write(":" + inttraSiBillDto.getVesselName() + "'");
+			writer.newLine();
+			/* =================0520=================  */
+			writer.write("LOC+" + inttraSiBillDto.getAddressType());
+			if ("9".equals(inttraSiBillDto.getAddressType()) || "11".equals(inttraSiBillDto.getAddressType())) {
+				if (ObjectUtils.isNull(inttraSiBillDto.getAddressCode())) {
+					throw new RuntimeException("edi地点代码不能为空");
+				}
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getAddressCode())) {
+				writer.write("+" + inttraSiBillDto.getAddressCode() + "::" + inttraSiBillDto.getAddressDefine());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getAddressDescribe())) {
+				writer.write("+" + inttraSiBillDto.getAddressDescribe());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getAddressCountryCode())) {
+				writer.write("+" + inttraSiBillDto.getAddressCountryCode());
+			}
+			writer.write("'");
+			writer.newLine();
+			/* =================0580=================  */
+			writer.write("NAD+" + inttraSiBillDto.getCompanyType());
+			if ("CA".equals(inttraSiBillDto.getCompanyType()) || "HI".equals(inttraSiBillDto.getCompanyType())) {
+				if (ObjectUtils.isNull(inttraSiBillDto.getCompanyCode()) ||
+					ObjectUtils.isNull(inttraSiBillDto.getCompanyListName()) ||
+					ObjectUtils.isNull(inttraSiBillDto.getCompanyDefine())) {
+					throw new RuntimeException("edi公司代码/列表名/代码定义者不能为空");
+				}
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCompanyCode()) &&
+				ObjectUtils.isNotNull(inttraSiBillDto.getCompanyListName()) &&
+				ObjectUtils.isNotNull(inttraSiBillDto.getCompanyDefine())) {
+				writer.write("+" + inttraSiBillDto.getCompanyCode() + ":" + inttraSiBillDto.getCompanyListName() + ":" + inttraSiBillDto.getCompanyDefine());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getStructuredAddressOne())) {
+				writer.write("+" + inttraSiBillDto.getStructuredAddressOne());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getStructuredAddressTwo())) {
+				writer.write(":" + inttraSiBillDto.getStructuredAddressTwo());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCompanyNameOne())) {
+				writer.write("+" + inttraSiBillDto.getCompanyNameOne());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCompanyNameTwo())) {
+				writer.write(":" + inttraSiBillDto.getCompanyNameTwo());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCompanyAddressOne())) {
+				writer.write("+" + inttraSiBillDto.getCompanyAddressOne());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCompanyAddressTwo())) {
+				writer.write(":" + inttraSiBillDto.getCompanyAddressTwo());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCompanyAddressThree())) {
+				writer.write(":" + inttraSiBillDto.getCompanyAddressThree());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCompanyAddressFour())) {
+				writer.write(":" + inttraSiBillDto.getCompanyAddressFour());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCityName())) {
+				writer.write("+" + inttraSiBillDto.getCityName());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getRegionCode())) {
+				writer.write("+" + inttraSiBillDto.getRegionCode());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getZipCode())) {
+				writer.write("+" + inttraSiBillDto.getZipCode());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCompanyCountryCode())) {
+				writer.write("+" + inttraSiBillDto.getCompanyCountryCode());
+			}
+			writer.write("'");
+			writer.newLine();
+			/* =================0620=================  */
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getContactsType())) {
+				writer.write("CTA+" + inttraSiBillDto.getContactsType());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getContactsCode())) {
+					writer.write("+" + inttraSiBillDto.getContactsCode());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getContactsName())) {
+					writer.write(":" + inttraSiBillDto.getContactsName());
+				}
+				writer.write("'");
+				writer.newLine();
+				/* =================0630=================  */
+				writer.write("COM+" + inttraSiBillDto.getContactsValue() + ":" + inttraSiBillDto.getContactsInformation() + "'");
+				writer.newLine();
+			}
+			/* =================0650=================  */
+			writer.write("DOC+" + inttraSiBillDto.getBillLadingType());
+			if ("714".equals(inttraSiBillDto.getBillLadingType())) {
+				if (ObjectUtils.isNull(inttraSiBillDto.getBillNo())) {
+					throw new RuntimeException("edi提单号不能为空");
+				} else {
+					writer.write(":::" + inttraSiBillDto.getBillNo() + "'");
+					if (ObjectUtils.isNotNull(inttraSiBillDto.getPaymentStatus())) {
+						writer.write("+:" + inttraSiBillDto.getPaymentStatus());
+					}
+					if (ObjectUtils.isNotNull(inttraSiBillDto.getBillLadingNumber())) {
+						writer.write("++" + inttraSiBillDto.getBillLadingNumber());
+					}
+					writer.write("'");
+					writer.newLine();
+				}
+			} else {
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getBillNo())) {
+					writer.write(":::" + inttraSiBillDto.getBillNo() + "'");
+					writer.newLine();
+				} else {
+					if (ObjectUtils.isNotNull(inttraSiBillDto.getPaymentStatus())) {
+						writer.write("+:" + inttraSiBillDto.getPaymentStatus());
+					}
+					if (ObjectUtils.isNotNull(inttraSiBillDto.getBillLadingNumber())) {
+						writer.write("++" + inttraSiBillDto.getBillLadingNumber());
+					}
+					writer.write("'");
+					writer.newLine();
+				}
+			}
+			/* =================0760=================  */
+			writer.write("RFF+" + inttraSiBillDto.getNumberTypes() + ":" + inttraSiBillDto.getNumberValue() + "'");
+			writer.newLine();
+			/* =================0910=================  */
+			writer.write("GID+" + inttraSiBillDto.getGoodsSort());
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getPackagesNumbers())) {
+				writer.write("+" + inttraSiBillDto.getPackagesNumbers());
+				if (ObjectUtils.isNull(inttraSiBillDto.getPackagesCode()) &&
+					ObjectUtils.isNull(inttraSiBillDto.getPackagesDescribe())) {
+					throw new RuntimeException("edi包装代码与包装描述不能同时为空");
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getPackagesCode())) {
+					writer.write(":" + inttraSiBillDto.getPackagesCode());
+					if (ObjectUtils.isNotNull(inttraSiBillDto.getPackagesDefine())) {
+						writer.write("+:" + inttraSiBillDto.getPackagesDefine());
+					}
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getPackagesDescribe())) {
+					writer.write("+:" + inttraSiBillDto.getPackagesDescribe());
+				}
+			}
+			writer.write("'");
+			writer.newLine();
+			/* =================0980=================  */
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getHsCode())) {
+				writer.write("PIA+5+" + inttraSiBillDto.getHsCode());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getHsType())) {
+					writer.write(":" + inttraSiBillDto.getHsType());
+				}
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================0990=================  */
+			writer.write("FTX+" + inttraSiBillDto.getProductType());
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getProductCode())) {
+				writer.write("++" + inttraSiBillDto.getProductCode());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getProductContent())) {
+				writer.write("+" + inttraSiBillDto.getProductContent());
+			}
+			if ("CCI".equals(inttraSiBillDto.getProductType())) {
+				inttraSiBillDto.setProductCode("MFS");
+			}
+			if ("MFS".equals(inttraSiBillDto.getProductCode())) {
+				if (ObjectUtils.isNull(inttraSiBillDto.getProductContentTwo())) {
+					throw new RuntimeException("edi文本内容2不能为空");
+				}
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getProductContentTwo())) {
+				writer.write(":" + inttraSiBillDto.getProductContentTwo());
+			}
+			if ("MFS".equals(inttraSiBillDto.getProductCode()) && "1".equals(inttraSiBillDto.getProductContent())) {
+				if (ObjectUtils.isNull(inttraSiBillDto.getProductContentThree())) {
+					throw new RuntimeException("edi文本内容3不能为空");
+				}
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getProductContentThree())) {
+				writer.write(":" + inttraSiBillDto.getProductContentThree());
+			}
+			writer.write("'");
+			writer.newLine();
+			/* =================1010=================  */
+			writer.write("NAD+" + inttraSiBillDto.getCarrierType());
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCarrierNameOne())) {
+				writer.write("+++" + inttraSiBillDto.getCarrierNameOne());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCarrierNameTwo())) {
+				writer.write(":" + inttraSiBillDto.getCarrierNameTwo());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCarrierAddressOne())) {
+				writer.write("+" + inttraSiBillDto.getCarrierAddressOne());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCarrierAddressTwo())) {
+				writer.write(":" + inttraSiBillDto.getCarrierAddressTwo());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCarrierAddressThree())) {
+				writer.write(":" + inttraSiBillDto.getCarrierAddressThree());
+			}
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getCarrierAddressFour())) {
+				writer.write(":" + inttraSiBillDto.getCarrierAddressFour());
+			}
+			writer.write("'");
+			writer.newLine();
+			/* =================1070=================  */
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getGoodsNumberType())) {
+				writer.write("MEA+AAE+" + inttraSiBillDto.getGoodsNumberType());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getGoodsNumberUnit())) {
+					writer.write("+" + inttraSiBillDto.getGoodsNumberUnit());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getGoodsNumber())) {
+					writer.write(":" + inttraSiBillDto.getGoodsNumber());
+				}
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================1010=================  */
+			writer.write("RFF+" + inttraSiBillDto.getNumberType() + ":" + inttraSiBillDto.getNumberCode() + "'");
+			writer.newLine();
+			/* =================1160=================  */
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getMarks())) {
+				writer.write("PCI++" + inttraSiBillDto.getMarks());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getMarkss())) {
+					writer.write(":" + inttraSiBillDto.getMarkss());
+				}
+				writer.newLine();
+			}
+			/* =================1380=================  */
+			writer.write("SGP+" + inttraSiBillDto.getBoxNo() + "+" + inttraSiBillDto.getBoxGoodNumber() + "'");
+			writer.newLine();
+			/* =================1400=================  */
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getGoodsNumberTypeTwo())) {
+				writer.write("MEA+AAE+" + inttraSiBillDto.getGoodsNumberTypeTwo());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getGoodsNumberUnitTwo())) {
+					writer.write("+" + inttraSiBillDto.getGoodsNumberUnitTwo());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getGoodsNumberTwo())) {
+					writer.write(":" + inttraSiBillDto.getGoodsNumberTwo());
+				}
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================1520=================  */
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getDgImdgCode())) {
+				writer.write("DGS+IMD+" + inttraSiBillDto.getDgImdgCode());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getPageNumber())) {
+					writer.write(":" + inttraSiBillDto.getPageNumber());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getDgUnCode())) {
+					writer.write("+" + inttraSiBillDto.getDgUnCode());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getDgFlashPoint())) {
+					writer.write("+" + inttraSiBillDto.getDgFlashPoint());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getDgFlashPointUnit())) {
+					writer.write("+" + inttraSiBillDto.getDgFlashPointUnit());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getPackingGroup())) {
+					writer.write("+" + inttraSiBillDto.getPackingGroup());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getEmergencyMeasureNo())) {
+					writer.write("+" + inttraSiBillDto.getEmergencyMeasureNo());
+				}
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================1530=================  */
+			writer.write("FTX+" + inttraSiBillDto.getDgRemarksType() + "+++" + inttraSiBillDto.getDgRemarks() + "'");
+			writer.newLine();
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getDgImdgCode())) {
+				if (ObjectUtils.isNull(inttraSiBillDto.getDgContacts())) {
+					throw new RuntimeException("edi危险品联系方不能为空");
+				} else {
+					if (ObjectUtils.isNull(inttraSiBillDto.getDgTel())) {
+						throw new RuntimeException("edi危险品联系电话号码不能为空");
+					}
+				}
+				/* =================1550=================  */
+				writer.write("CTA+HG+:" + inttraSiBillDto.getDgImdgCode() + "'");
+				writer.newLine();
+				/* =================1560=================  */
+				writer.write("COM+" + inttraSiBillDto.getDgTel() + "TE'");
+				writer.newLine();
+			}
+			/* =================1660=================  */
+			if (ObjectUtils.isNull(inttraSiBillDto.getBoxNo())) {
+				writer.write("EQD+CN+" + inttraSiBillDto.getBoxNo());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getBoxCode())) {
+					writer.write("+" + inttraSiBillDto.getBoxCode());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getBoxTypeDescribe())) {
+					writer.write(":::" + inttraSiBillDto.getBoxTypeDescribe());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getShipperBoxIdentification())) {
+					writer.write("+" + inttraSiBillDto.getShipperBoxIdentification());
+				}
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================1690=================  */
+			if (ObjectUtils.isNull(inttraSiBillDto.getGoodsNumberTypeThree())) {
+				writer.write("MEA+AAE+" + inttraSiBillDto.getGoodsNumberTypeThree());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getGoodsNumberUnitThree())) {
+					writer.write("+" + inttraSiBillDto.getGoodsNumberUnitThree());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getGoodsNumberThree())) {
+					writer.write(":" + inttraSiBillDto.getGoodsNumberThree());
+				}
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================1710=================  */
+			if (ObjectUtils.isNull(inttraSiBillDto.getSeal())) {
+				writer.write("SEL+" + inttraSiBillDto.getSeal());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getSealUnit())) {
+					writer.write("+" + inttraSiBillDto.getSealUnit());
+				}
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================1740=================  */
+			if (ObjectUtils.isNull(inttraSiBillDto.getTemperature())) {
+				writer.write("TMP+2+" + inttraSiBillDto.getTemperature());
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getTemperatureUnit())) {
+					writer.write(":" + inttraSiBillDto.getTemperatureUnit());
+				}
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================1740=================  */
+			writer.write("FTX+" + inttraSiBillDto.getRemarksCodes());
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getRemarksContent())) {
+				writer.write("+++" + inttraSiBillDto.getRemarksContent());
+			}
+			writer.write("'");
+			writer.newLine();
+			/* =================1760=================  */
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getBillNumber())) {
+				writer.write("RFF+AHZ:" + inttraSiBillDto.getBillNumber() + "'");
+				writer.newLine();
+			}
+			/* =================1860=================  */
+			if (ObjectUtils.isNull(inttraSiBillDto.getAddCode())) {
+				writer.write("NAD+CS+" + inttraSiBillDto.getAddCode() + ":263");
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getAddDefine())) {
+					writer.write(":" + inttraSiBillDto.getAddDefine());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getAddDescribe())) {
+					writer.write("++++" + inttraSiBillDto.getAddDescribe());
+				}
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getAddCountryCode())) {
+					writer.write("+++" + inttraSiBillDto.getAddCountryCode());
+				}
+				writer.write("'");
+				writer.newLine();
+			}
+			/* =================2000=================  */
+			writer.write("UNT+" + inttraSiBillDto.getRecordRows() + "+" + inttraSiBillDto.getInformationNoEnd() + "'");
+			writer.newLine();
+			/* =================2010=================  */
+			writer.write("UNZ+" + inttraSiBillDto.getInformationNumber() + "+" + inttraSiBillDto.getFileExchangeNumberEnd() + "'");
+			writer.newLine();
+
+			// 关闭文件输出流
+			writer.close();
+			//文件地址
+			String url = file.getAbsolutePath();
+			//替换地址
+			url = url.replace("/home/minio", "http://121.37.83.47");
+
+			if (ObjectUtils.isNotNull(inttraSiBillDto.getEdiTypes())) {
+				if (ObjectUtils.isNotNull(inttraSiBillDto.getEdiTypes().getAddress())) {
+					List<EdiAddress> ediAddressList = JSONArray.parseArray(inttraSiBillDto.getEdiTypes().getAddress(), EdiAddress.class);
+					for (EdiAddress item : ediAddressList) {
+						if ("email".equals(item.getMode())) {
+
+						} else if ("ftp".equals(item.getMode())) {
+
+						} else {
+							throw new RuntimeException("edi地址配置错误");
+						}
+					}
+				}
+			}
+			FilesCenter filesCenter = new FilesCenter();
+			filesCenter.setUrl(url);
+			filesCenter.setFileName(file.getName());
+			// 查找最后一个点号的索引位置
+			int dotIndex = file.getName().lastIndexOf('.');
+			// 确保点号不是第一个字符且不是最后一个字符
+			if (dotIndex > -1 && dotIndex < file.getName().length() - 1) {
+				// 提取从点号开始到结尾之间的部分作为扩展名
+				filesCenter.setFileExt(file.getName().substring(dotIndex + 1));
+			}
+			filesCenter.setReceivedData(new Date());
+			return filesCenter;
+		} catch (IOException e) {
+			throw new SecurityException("生成edi文件失败");
+		}
+	}
+
 
 	public static FilesCenter sending(String content) {
 		try {

+ 820 - 0
blade-service/blade-los/src/main/java/org/springblade/los/edi/dto/InttraSiBillDto.java

@@ -0,0 +1,820 @@
+package org.springblade.los.edi.dto;
+
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+import org.springblade.los.edi.entity.EdiTypes;
+
+import javax.validation.constraints.NotEmpty;
+import java.math.BigDecimal;
+
+/**
+ * @author :jixinyuan
+ * @date : 2023/12/20
+ */
+@Data
+public class InttraSiBillDto {
+
+
+	/* UNB+UNOC:2+  */
+	/**
+	 * 发送方标识
+	 */
+	@NotEmpty(message = "发送方标识不能为空")
+	@Length(min = 35, max = 35, message = "发送方标识不能超过35字符")
+	private String identifying;
+	/**
+	 * 日期  (日期(yymmdd):时间(hhmm))
+	 */
+	@NotEmpty(message = "日期不能为空")
+	@Length(min = 1, max = 11, message = "文件交换编号不能超过11字符")
+	private String date;
+	/**
+	 * 文件交换编号
+	 */
+	@NotEmpty(message = "文件交换编号不能为空")
+	@Length(min = 1, max = 14, message = "文件交换编号不能超过14字符")
+	private String fileExchangeNumber;
+
+	/*  UNH+  */
+	/**
+	 * 信息编号
+	 */
+	@NotEmpty(message = "信息编号不能为空")
+	@Length(min = 1, max = 14, message = "信息编号不能超过14字符")
+	private String informationNo;
+
+	/*    BGM+340+     */
+	/**
+	 * 提单辨识码
+	 */
+	@NotEmpty(message = "提单辨识码不能为空")
+	@Length(min = 1, max = 35, message = "提单辨识码不能超过35字符")
+	private String identificationCode;
+	/**
+	 * 修订号
+	 */
+	@Length(min = 1, max = 6, message = "修订号不能超过6字符")
+	private String revisionNumber;
+	/**
+	 * 文件功能
+	 */
+	@NotEmpty(message = "文件功能不能为空")
+	private String filesFunction;
+
+	/*   DTM+137:   */
+	/**
+	 * 文件建立时间  (ccyymmddhhmm)
+	 */
+	@NotEmpty(message = "文件建立时间不能为空")
+	private String filesDate;
+
+	/**
+	 * 文件建立时间 格式
+	 */
+	private String filesDateFormat;
+
+	/*   TSR+   */
+	/**
+	 * 运输条款代码
+	 */
+	@NotEmpty(message = "运输条款代码不能为空")
+	private String transportTermCode;
+	/**
+	 * 拼箱类型
+	 */
+	@NotEmpty(message = "拼箱类型不能为空")
+	private String lclType;
+
+	/*   CUX+4:   */
+	/**
+	 * 货币代码
+	 */
+	@Length(min = 1, max = 3, message = "备注不能超过3字符")
+	private String curCode;
+
+	/*   MOA+44:   */
+	/**
+	 * 费用值
+	 */
+	@Length(min = 1, max = 35, message = "备注不能超过35长度")
+	private BigDecimal feeAmount;
+
+	/*   FTX+   */
+	/**
+	 * 文本主题代码
+	 */
+	@NotEmpty(message = "文本主题代码不能为空")
+	private String remarksCode;
+	/**
+	 * 文本内容代码
+	 */
+	private String remarksContentCode;
+	/**
+	 * 文本内容
+	 */
+	private String remarks;
+	/**
+	 * 文本内容2
+	 */
+	private String remarksTwo;
+	/**
+	 * 文本内容3
+	 */
+	private String remarksThree;
+
+	/*    CNT+7:   */
+	/**
+	 * 总数的类型
+	 */
+	@NotEmpty(message = "总数的类型不能为空")
+	private String sumType;
+	/**
+	 * 总数的值
+	 */
+	@NotEmpty(message = "总数的值不能为空")
+	private String sumValue;
+	/**
+	 * 总数的单位
+	 */
+	@NotEmpty(message = "总数的单位不能为空")
+	private String sumUnit;
+
+	/*   LOC+  */
+	/**
+	 * 地点类型   57 付款地点;73 提单签发地点
+	 */
+	@NotEmpty(message = "地点类型不能为空")
+	private String locationType;
+	/**
+	 * 地点代码
+	 */
+	private String locationCode;
+	/**
+	 * 代码定义者
+	 */
+	private String define = "6";
+	/**
+	 * 详细地点
+	 */
+	@Length(min = 1, max = 256, message = "详细地点不能超过256字符")
+	private String location;
+	/**
+	 * 国家代码
+	 */
+	@Length(min = 1, max = 25, message = "国家代码不能超过25字符")
+	private String countryCode;
+
+	/*   DTM+95:   */
+	/**
+	 * 签单日期(yyyymmdd)
+	 */
+	private String issueDate;
+	/**
+	 * 签单格式
+	 */
+	private String issueDateType;
+
+	/*    RFF+   */
+	/**
+	 * 编号类型  BN 必须有,订舱号;一般就是提单号
+	 * BM 提单号
+	 * FF 货代相关编号
+	 * CT 运费协议号
+	 * ON 订单号,PO 编号;若这里出现了,后面的 RFF(1130)就不能再出现 RFF+ON 了
+	 * SI 特殊编号,根据船司的需求,填其需要的编号;
+	 * EX 出口编号
+	 * ADU/CG/ERN/GN/IV/LC/TN
+	 */
+	@NotEmpty(message = "编号类型不能为空")
+	private String billNoType;
+	/**
+	 * 编号值
+	 */
+	@Length(min = 1, max = 30, message = "提单号不能超过30字符")
+	@NotEmpty(message = "编号值不能为空")
+	private String billNoValue;
+
+	/*  DTM+   */
+	/**
+	 * 日期类型
+	 */
+	@NotEmpty(message = "日期类型不能为空")
+	private String validityPeriodType;
+	/**
+	 * 日期
+	 */
+	private String validityPeriod;
+
+	/*   CPI+   */
+	/**
+	 * 款项类型
+	 * 1 所有费用
+	 * 2 额外费用
+	 * 4 基本费用
+	 * 5 目的地拖运费用
+	 * 7目的地港口费用
+	 * 10 出发地港口费用
+	 * 11 出发地拖运费用
+	 */
+	@NotEmpty(message = "款项类型不能为空")
+	private String paymentType;
+	/**
+	 * 付款方式代码
+	 */
+	@NotEmpty(message = "付款方式代码不能为空")
+	private String paymentTypeCode;
+
+	/*   TDT+20+   */
+	/**
+	 * 航次
+	 */
+	@Length(min = 1, max = 17, message = "航次不能超过17字符")
+	private String voyageNo;
+	/**
+	 * 运输模式
+	 */
+	private String transportMode = "1";
+	/**
+	 * 船司代码
+	 */
+	private String vesselCarrierCode;
+	/**
+	 * 船司代码列表名的代码
+	 */
+	private String vesselCarrierListCode;
+	/**
+	 * 船名代码
+	 */
+	@Length(min = 1, max = 9, message = "船名不能超过9字符")
+	private String vesselCode;
+	/**
+	 * 代码定义者
+	 */
+	private String vesselDefine = "11";
+	/**
+	 * 船名
+	 */
+	@Length(min = 1, max = 35, message = "船名不能超过35字符")
+	private String vesselName;
+
+	/*   LOC+   */
+	/**
+	 * 地点类型
+	 * 88 收货地,当是 door to 的数据时,必须有;
+	 * 9 装货港,必须有
+	 * 11 卸货港,必须有
+	 * 7 交货地,当是 to door 的数据时,必须有;
+	 * 198 出发地
+	 */
+	@NotEmpty(message = "地点类型不能为空")
+	private String addressType;
+	/**
+	 * 地点代码
+	 */
+	@NotEmpty(message = "地点代码不能为空")
+	private String addressCode;
+	/**
+	 * 代码定义者
+	 */
+	private String addressDefine = "6";
+	/**
+	 * 地点描述
+	 */
+	@Length(min = 1, max = 256, message = "地点描述不能超过256字符")
+	private String addressDescribe;
+	/**
+	 * 国家代码
+	 */
+	@Length(min = 1, max = 25, message = "国家代码不能超过25字符")
+	private String addressCountryCode;
+
+
+	/*   NAD+   */
+	/**
+	 * 公司类型
+	 * CA 船公司,必须有;公司代码必须使用 SCAC 代码或者”IUCA”,且代码定义者必须是 86
+	 * CN 收货人
+	 * CZ 发货人
+	 * NI 通知人
+	 * HI 信息发送方,必须有
+	 * EX 出口者
+	 * FW 货代
+	 * GO 货物拥有者
+	 * N1 额外通知人 1
+	 * N2 额外通知人 2
+	 * MR 传输信息接收者;用来接收一些传输过程中产生的信息,后面的 CTA 必须是 CTA+BN
+	 * PJ 协调信息接收者;后面的 CTA 出现的话必须是 CTA+NT
+	 */
+	@NotEmpty(message = "公司类型不能为空")
+	private String companyType;
+	/**
+	 * 公司代码
+	 */
+	private String companyCode;
+	/**
+	 * 列表名
+	 */
+	private String companyListName;
+	/**
+	 * 代码定义者
+	 */
+	private String companyDefine;
+	/**
+	 * 结构地址1
+	 */
+	@Length(min = 1, max = 35, message = "结构地址1不能超过35字符")
+	private String structuredAddressOne;
+	/**
+	 * 结构地址2
+	 */
+	@Length(min = 1, max = 35, message = "结构地址2不能超过35字符")
+	private String structuredAddressTwo;
+	/**
+	 * 公司名字 1
+	 */
+	@Length(min = 1, max = 35, message = "公司名字 1不能超过35字符")
+	private String companyNameOne;
+	/**
+	 * 公司名字 2
+	 */
+	@Length(min = 1, max = 35, message = "公司名字 2不能超过35字符")
+	private String companyNameTwo;
+	/**
+	 * 公司地址 1
+	 */
+	@Length(min = 1, max = 35, message = "公司地址 1不能超过35字符")
+	private String companyAddressOne;
+	/**
+	 * 公司地址 2
+	 */
+	@Length(min = 1, max = 35, message = "公司地址 2不能超过35字符")
+	private String companyAddressTwo;
+	/**
+	 * 公司地址 3
+	 */
+	@Length(min = 1, max = 35, message = "公司地址 3不能超过35字符")
+	private String companyAddressThree;
+	/**
+	 * 公司地址 4
+	 */
+	@Length(min = 1, max = 35, message = "公司地址 4不能超过35字符")
+	private String companyAddressFour;
+	/**
+	 * 城市名称
+	 */
+	@Length(min = 1, max = 35, message = "城市名称不能超过35字符")
+	private String cityName;
+	/**
+	 * 地区代码
+	 */
+	@Length(min = 1, max =9, message = "地区代码不能超过9字符")
+	private String regionCode;
+	/**
+	 * 邮编
+	 */
+	@Length(min = 1, max =17, message = "邮编不能超过17字符")
+	private String zipCode;
+	/**
+	 * 国家代码
+	 */
+	@Length(min = 1, max = 25, message = "国家代码不能超过25字符")
+	private String companyCountryCode;
+
+
+	/*   CTA+  */
+	/**
+	 * 联系类型
+	 */
+	private String contactsType;
+	/**
+	 * 联系方代码
+	 */
+	private String contactsCode;
+	/**
+	 * 联系方
+	 */
+	@Length(min = 1, max = 35, message = "联系方不能超过35字符")
+	private String contactsName;
+
+	/*     COM+    */
+	/**
+	 * 联系值
+	 */
+	@NotEmpty(message = "联系值不能为空")
+	@Length(min = 1, max = 80, message = "联系值不能超过80字符")
+	private String contactsValue;
+
+	/**
+	 * 联系方式
+	 */
+	@NotEmpty(message = "联系方式不能为空")
+	private String contactsInformation;
+
+	/*     DOC+    */
+	/**
+	 * 提单类型
+	 * 706 原始单正本;
+	 * 707 原始单副本
+	 * 710 SEA WAYBILL;
+	 * 714 House bill 不是用来打印提单的
+	 */
+	@NotEmpty(message = "提单类型不能为空")
+	private String billLadingType;
+	/**
+	 * 提单号
+	 */
+	@Length(min = 1, max =35, message = "提单号不能超过35字符")
+	private String billNo;
+	/**
+	 * 付款状态
+	 */
+	private String paymentStatus;
+	/**
+	 * 提单份数
+	 */
+	@Length(min = 1, max = 2, message = "提单份数不能超过2位")
+	@NotEmpty(message = "提单份数不能为空")
+	private BigDecimal billLadingNumber;
+
+	/*    RFF+   */
+	/**
+	 * 编号类型
+	 */
+	@NotEmpty(message = "编号类型不能为空")
+	private String numberTypes;
+	/**
+	 * 编号值
+	 */
+	@NotEmpty(message = "编号值不能为空")
+	@Length(min = 1, max =35, message = "编号值不能超过35字符")
+	private String numberValue;
+
+	/*     GID+1+   */
+	/**
+	 * 货物序号
+	 */
+	@NotEmpty(message = "货物序号不能为空")
+	@Length(min = 1, max = 5, message = "货物序号不能超过5位")
+	private Integer goodsSort;
+	/**
+	 * 包装件数
+	 */
+	@Length(min = 1, max = 8, message = "包装件数不能超过8位")
+	private BigDecimal packagesNumbers;
+	/**
+	 * 包装代码
+	 */
+	@Length(min = 1, max = 35, message = "包装代码不能超过17字符")
+	private String packagesCode;
+	/**
+	 * 代码定义者
+	 */
+	private String packagesDefine;
+	/**
+	 * 包装描述
+	 */
+	@Length(min = 1, max = 35, message = "包装描述不能超过35字符")
+	private String packagesDescribe;
+
+	/*     PIA+5+   */
+	/**
+	 * 编码类型
+	 */
+	private BigDecimal hsType;
+	/**
+	 * 编码值
+	 */
+	@Length(min = 1, max = 35, message = "HS 编码不能超过35字符")
+	private BigDecimal hsCode;
+
+	/*     FTX+   */
+	/**
+	 * 类型
+	 */
+	@NotEmpty(message = "类型不能为空")
+	@Length(min = 1, max = 512, message = "品名不能超过512字符")
+	private String productType;
+	/**
+	 * 文本内容代码
+	 */
+	private String productCode;
+	/**
+	 * 文本内容
+	 */
+	@Length(min = 1, max = 512, message = "文本内容不能超过512字符")
+	private String productContent;
+	/**
+	 * 文本内容2
+	 */
+	@Length(min = 1, max = 512, message = "文本内容2不能超过512字符")
+	private String productContentTwo;
+	/**
+	 * 文本内容3
+	 */
+	@Length(min = 1, max = 512, message = "文本内容3不能超过512字符")
+	private String productContentThree;
+
+	/*     NAD+   */
+	/**
+	 * 公司类型
+	 */
+	@NotEmpty(message = "公司类型不能为空")
+	private String carrierType;
+	/**
+	 * 公司名字 1
+	 */
+	@Length(min = 1, max = 35, message = "公司名字 1不能超过35字符")
+	private String carrierNameOne;
+	/**
+	 * 公司名字 2
+	 */
+	@Length(min = 1, max = 35, message = "公司名字 2不能超过35字符")
+	private String carrierNameTwo;
+	/**
+	 * 公司地址 1
+	 */
+	@Length(min = 1, max = 35, message = "公司地址 1不能超过35字符")
+	private String carrierAddressOne;
+	/**
+	 * 公司地址 2
+	 */
+	@Length(min = 1, max = 35, message = "公司地址 2不能超过35字符")
+	private String carrierAddressTwo;
+	/**
+	 * 公司地址 3
+	 */
+	@Length(min = 1, max = 35, message = "公司地址 3不能超过35字符")
+	private String carrierAddressThree;
+	/**
+	 * 公司地址 4
+	 */
+	@Length(min = 1, max = 35, message = "公司地址 4不能超过35字符")
+	private String carrierAddressFour;
+
+	/*     MEA+AAE+  */
+	/**
+	 * 货物量类型
+	 */
+	@NotEmpty(message = "货物量类型不能为空")
+	private String goodsNumberType;
+	/**
+	 * 货物量单位
+	 */
+	@NotEmpty(message = "货物量单位不能为空")
+	private BigDecimal goodsNumberUnit;
+	/**
+	 * 货物量
+	 */
+	@Length(min = 1, max = 18, message = "货物量不能超过18位")
+	private BigDecimal goodsNumber;
+
+	/*     RFF+   */
+	/**
+	 * 编号类型
+	 */
+	@NotEmpty(message = "编号类型不能为空")
+	private BigDecimal numberType;
+	/**
+	 * 编号值
+	 */
+	@Length(min = 1, max = 35, message = "编号值不能超过35字符")
+	private BigDecimal numberCode;
+
+	/*      PCI++   */
+	/**
+	 * 麦头1
+	 */
+	@Length(min = 1, max = 35, message = "麦头不能超过35字符")
+	private String marks;
+	/**
+	 * 麦头2-10
+	 */
+	@Length(min = 1, max = 323, message = "麦头不能超过35字符")
+	private String markss;
+
+	/*    SGP+   */
+	/**
+	 * 箱号
+	 */
+	@NotEmpty(message = "箱号不能为空")
+	@Length(min = 1, max = 17, message = "麦头不能超过17字符")
+	private String boxNo;
+
+	/**
+	 * 单箱包装件数
+	 */
+	@NotEmpty(message = "单箱包装件数不能为空")
+	@Length(min = 1, max = 18, message = "单箱包装件数不能超过18为")
+	private BigDecimal boxGoodNumber;
+
+	/*     MEA+AAE+  */
+	/**
+	 * 货物量类型
+	 */
+	@NotEmpty(message = "货物量类型不能为空")
+	private String goodsNumberTypeTwo;
+	/**
+	 * 货物量单位
+	 */
+	@NotEmpty(message = "货物量单位不能为空")
+	private BigDecimal goodsNumberUnitTwo;
+	/**
+	 * 货物量
+	 */
+	@Length(min = 1, max = 18, message = "货物量不能超过18位")
+	private BigDecimal goodsNumberTwo;
+
+	/*      DGS+IMD+   */
+	/**
+	 * 危险品分类代码
+	 */
+	private String dgImdgCode;
+	/**
+	 * 页号
+	 */
+	@Length(min = 1, max = 7, message = "页号不能超过7位")
+	private BigDecimal pageNumber;
+	/**
+	 * 联合国编号
+	 */
+	@Length(min = 4, max = 4, message = "联合国编号必须4位")
+	private Integer dgUnCode;
+	/**
+	 * 闪点
+	 */
+	@Length(min = 3, max = 3, message = "闪点必须3位")
+	private BigDecimal dgFlashPoint;
+	/**
+	 * 闪点单位
+	 */
+	private String dgFlashPointUnit;
+	/**
+	 * 包装组别
+	 */
+	private String packingGroup;
+	/**
+	 * 应急措施号
+	 */
+	@Length(min = 1, max = 6, message = "应急措施号不能超过6字符")
+	private String emergencyMeasureNo;
+
+	/*      FTX+AAC+++   */
+	/**
+	 * 危险品备注类型
+	 */
+	@NotEmpty(message = "危险品备注类型不能为空")
+	private String dgRemarksType;
+	/**
+	 * 危险品备注
+	 */
+	@Length(min = 1, max = 512, message = "危险品备注不能超过512字符")
+	private String dgRemarks;
+
+	/*     CTA+HG+:   */
+	/**
+	 * 危险品联系方
+	 */
+	@Length(min = 1, max = 35, message = "危险品联系方不能超过35字符")
+	private String dgContacts;
+
+	/*     COM+   */
+	/**
+	 * 危险品电话号码
+	 */
+	@Length(min = 1, max = 512, message = "危险品电话号码不能超过512字符")
+	private String dgTel;
+
+	/*    EQD+CN++   */
+
+	/**
+	 * 箱型代码
+	 */
+	@Length(min = 1, max = 10, message = "箱型代码不能超过10字符")
+	private String boxCode;
+	/**
+	 * 箱型描述
+	 */
+	@Length(min = 1, max = 35, message = "箱型描述不能超过35字符")
+	private String boxTypeDescribe;
+	/**
+	 * 货主箱标识
+	 */
+	private String shipperBoxIdentification;
+
+	/*     MEA+AAE+  */
+	/**
+	 * 货物量类型
+	 */
+	@NotEmpty(message = "货物量类型不能为空")
+	private String goodsNumberTypeThree;
+	/**
+	 * 货物量单位
+	 */
+	@NotEmpty(message = "货物量单位不能为空")
+	private BigDecimal goodsNumberUnitThree;
+	/**
+	 * 货物量
+	 */
+	@Length(min = 1, max = 18, message = "货物量不能超过18位")
+	private BigDecimal goodsNumberThree;
+
+	/*    SEL+   */
+	/**
+	 * 封号
+	 */
+	@Length(min = 1, max = 10, message = "封号不能超过10字符")
+	private String seal;
+
+	/**
+	 * 封箱单位
+	 */
+	@Length(min = 1, max = 3, message = "封箱单位不能超过3字符")
+	private String sealUnit;
+
+	/*    TMP+2+   */
+	/**
+	 * 温度
+	 */
+	@Length(min = 1, max = 3, message = "温度不能超过3位")
+	private Integer temperature;
+	/**
+	 * 温度单位
+	 */
+	private String temperatureUnit;
+
+	/*    TMP+2+   */
+	/**
+	 * 备注代码
+	 */
+	@NotEmpty(message = "备注代码不能为空")
+	private String remarksCodes;
+	/**
+	 * 文本内容
+	 */
+	@Length(min = 1, max = 512, message = "文本内容不能超过512字符")
+	private String remarksContent;
+
+	/*    RFF+AHZ:   */
+	/**
+	 * 编号值
+	 */
+	@Length(min = 1, max = 30, message = "编号值不能超过30字符")
+	private String billNumber;
+
+	/*    RFF+AHZ:   */
+	/**
+	 * 地点代码
+	 */
+	private String addCode;
+
+	/**
+	 * 代码定义者
+	 */
+	private String addDefine;
+
+	/**
+	 * 地点描述
+	 */
+	@Length(min = 1, max = 256, message = "地点描述不能超过256字符")
+	private String addDescribe;
+
+	/**
+	 * 国家代码
+	 */
+	@Length(min = 1, max = 25, message = "国家代码不能超过25字符")
+	private String addCountryCode;
+
+	/*    UNT+   */
+	/**
+	 * 记录行数
+	 */
+	@NotEmpty(message = "记录行数不能为空")
+	@Length(min = 1, max = 6, message = "记录行数不能超过6字符")
+	private BigDecimal recordRows;
+	/**
+	 * 信息编号
+	 */
+	@NotEmpty(message = "信息编号不能为空")
+	@Length(min = 1, max = 14, message = "信息编号不能超过14字符")
+	private String informationNoEnd;
+
+	/*     UNZ+   */
+	/**
+	 * 信息数量
+	 */
+	@NotEmpty(message = "信息数量不能为空")
+	@Length(min = 1, max = 6, message = "信息数量不能超过6为")
+	private Integer informationNumber;
+	/**
+	 * 文件交换编号
+	 */
+	@NotEmpty(message = "文件交换编号不能为空")
+	@Length(min = 1, max = 14, message = "文件交换编号不能超过14字符")
+	private String fileExchangeNumberEnd;
+
+	/**
+	 * edi发送地址
+	 */
+	private EdiTypes ediTypes;
+
+}

+ 424 - 7
blade-service/blade-los/src/main/java/org/springblade/los/edi/service/impl/EdiTypesServiceImpl.java

@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.seata.spring.annotation.GlobalTransactional;
 import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
@@ -33,8 +34,12 @@ import org.springblade.los.basic.vessels.service.IBVesselsService;
 import org.springblade.los.business.files.entity.FilesCenter;
 import org.springblade.los.business.files.service.IFilesCenterService;
 import org.springblade.los.business.sea.entity.Bills;
+import org.springblade.los.business.sea.entity.Containers;
 import org.springblade.los.business.sea.service.IBillsService;
+import org.springblade.los.business.sea.service.IContainersService;
 import org.springblade.los.edi.api.EDISender;
+import org.springblade.los.edi.dto.InttraSiBillDto;
+import org.springblade.los.edi.dto.InttraSiDto;
 import org.springblade.los.edi.dto.InttraSoDto;
 import org.springblade.los.edi.entity.EdiLog;
 import org.springblade.los.edi.entity.EdiTypes;
@@ -44,12 +49,15 @@ import org.springblade.los.edi.service.IEdiTypesService;
 import org.springblade.los.edi.vo.EdiTypesVO;
 import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * 基础资料-EDI 类型表 服务实现类
@@ -75,6 +83,8 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 
 	private final IEdiLogService ediLogService;
 
+	private final IContainersService containersService;
+
 	@Override
 	public IPage<EdiTypesVO> selectEdiTypesPage(IPage<EdiTypesVO> page, EdiTypesVO ediTypes) {
 		return page.setRecords(baseMapper.selectEdiTypesPage(page, ediTypes));
@@ -110,6 +120,8 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R sendingEdi(EdiTypes ediTypes) {
 
 		if (ediTypes.getBillId() == null) {
@@ -120,14 +132,13 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 			.eq(Bills::getTenantId, AuthUtil.getTenantId())
 			.eq(Bills::getIsDeleted, 0)
 			.apply("find_in_set(id,'" + ediTypes.getBillId() + "')"));
-		if ("HYCK".equals(ediTypes.getType())) {
+		List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+			.eq(Containers::getTenantId, AuthUtil.getTenantId())
+			.eq(Containers::getIsDeleted, 0)
+			.apply("find_in_set(pid,'" + ediTypes.getBillId() + "')"));
+		if ("HYCK".equals(ediTypes.getType()) && "INITRRA-SO".equals(ediTypes.getCode())) {
 			Date date = new Date();
 			for (Bills details : billsList) {
-				if ("1".equals(details.getEdiStatus())) {
-					throw new RuntimeException("单据号:" + details.getBillNo() + "已发送过edi");
-				} else {
-					details.setEdiStatus("1");
-				}
 				InttraSoDto inttraSoDto = new InttraSoDto();
 				inttraSoDto.setIdentifying("发送方标识");
 				SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd:hhmm");
@@ -140,7 +151,13 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 				details.setMblno(RegularUtils.regularEn(details.getMblno()));
 				inttraSoDto.setIdentificationCode(details.getMblno() + "SO");
 
-				inttraSoDto.setFilesFunction("9");
+				if (ObjectUtils.isNotNull(details.getEdiStatus()) && Integer.parseInt(details.getEdiStatus()) > 0) {
+					inttraSoDto.setFilesFunction("5");
+					details.setEdiStatus(Integer.parseInt(details.getEdiStatus()) + 1 + "");
+				} else {
+					inttraSoDto.setFilesFunction("9");
+					details.setEdiStatus("1");
+				}
 				inttraSoDto.setFilesDate("cc" + sdf1.format(date));
 
 				details.setServiceTerms(RegularUtils.regularEn(details.getServiceTerms()));
@@ -396,6 +413,406 @@ public class EdiTypesServiceImpl extends ServiceImpl<EdiTypesMapper, EdiTypes> i
 			}
 			billsService.updateBatchById(billsList);
 		}
+		else if ("HYCK".equals(ediTypes.getType()) && "INITRRA-SI".equals(ediTypes.getCode())) {
+			Date date = new Date();
+			for (Bills details : billsList) {
+				InttraSiDto inttraSoDto = new InttraSiDto();
+				inttraSoDto.setIdentifying("发送方标识");
+				SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd:hhmm");
+				inttraSoDto.setDate(sdf.format(date));
+				SimpleDateFormat sdf1 = new SimpleDateFormat("yyMMddhhmm");
+				String corpId = details.getCorpId().toString();
+				inttraSoDto.setFileExchangeNumber(sdf1.format(date) + corpId.substring(corpId.length() - 4));
+				inttraSoDto.setInformationNo(inttraSoDto.getFileExchangeNumber());
+
+				details.setMblno(RegularUtils.regularEn(details.getMblno()));
+				inttraSoDto.setIdentificationCode(details.getMblno());
+
+				if (ObjectUtils.isNotNull(details.getEdiStatus()) && Integer.parseInt(details.getEdiStatus()) > 0) {
+					inttraSoDto.setFilesFunction("5");
+					details.setEdiStatus(Integer.parseInt(details.getEdiStatus()) + 1 + "");
+				} else {
+					inttraSoDto.setFilesFunction("9");
+					details.setEdiStatus("1");
+				}
+				inttraSoDto.setFilesDate(sdf1.format(date));
+
+				details.setServiceTerms(RegularUtils.regularEn(details.getServiceTerms()));
+				inttraSoDto.setTransportTermCode(details.getServiceTerms());
+
+				inttraSoDto.setLclType("2");
+
+				details.setRemarks(RegularUtils.regularEn(details.getRemarks()));
+				inttraSoDto.setRemarks(details.getRemarks());
+
+				details.setBookingRemarks(RegularUtils.regularEn(details.getBookingRemarks()));
+				inttraSoDto.setCarrySingleRemarks(details.getBookingRemarks());
+
+				inttraSoDto.setWeightOfGoods(details.getGrossWeight().toString());
+				inttraSoDto.setPackagesNumber(details.getQuantity());
+				inttraSoDto.setVolumeOfGoods(details.getMeasurement());
+				Integer sum = details.getQuantityV20() + details.getQuantityV40() + details.getQuantityV45()
+					+ details.getQuantityV48() + details.getQuantityV40hc();
+				inttraSoDto.setTotalBoxNumber(new BigDecimal(sum + ""));
+				if (ObjectUtils.isNotNull(details.getMpayplace())) {
+					BPorts bPorts = bPortsService.getOne(new LambdaQueryWrapper<BPorts>()
+						.eq(BPorts::getTenantId, AuthUtil.getTenantId())
+						.eq(BPorts::getIsDeleted, 0)
+						.eq(BPorts::getEnName, details.getMpayplace()));
+					if (bPorts != null) {
+						bPorts.setCode(RegularUtils.regularEn(bPorts.getCode()));
+						inttraSoDto.setPaymentLocationCode(bPorts.getCode());
+					}
+				}
+
+				details.setMpayplace(RegularUtils.regularEn(details.getMpayplace()));
+				inttraSoDto.setPaymentLand(details.getMpayplace());
+				if (ObjectUtils.isNotNull(details.getIssueAtId())) {
+					BPorts bPorts = bPortsService.getById(details.getIssueAtId());
+					if (bPorts != null) {
+						bPorts.setCode(RegularUtils.regularEn(bPorts.getCode()));
+						inttraSoDto.setIssuanceLandCode(bPorts.getCode());
+					}
+				}
+
+				details.setIssueAt(RegularUtils.regularEn(details.getIssueAt()));
+				inttraSoDto.setIssuanceLand(details.getIssueAt());
+
+				SimpleDateFormat sdf2 = new SimpleDateFormat("yyyymmdd");
+				if (ObjectUtils.isNotNull(details.getIssueDate())) {
+					inttraSoDto.setIssueDate(sdf2.format(details.getIssueDate()));
+				}
+				details.setBookingNo(RegularUtils.regularEn(details.getBookingNo()));
+				inttraSoDto.setBookingNo(details.getBookingNo());
+
+				details.setRefno(RegularUtils.regularEn(details.getRefno()));
+				inttraSoDto.setBillNo(details.getRefno());
+
+				details.setCorpArgreementNo(RegularUtils.regularEn(details.getCorpArgreementNo()));
+				inttraSoDto.setFreightProtocolNumber(details.getCorpArgreementNo());
+
+
+				inttraSoDto.setMainPinyin("");
+				inttraSoDto.setOrderNo(details.getMblno());
+
+				inttraSoDto.setPaymentType(details.getMpaymode());
+
+				details.setVoyageNo(RegularUtils.regularEn(details.getVoyageNo()));
+				inttraSoDto.setVoyageNo(details.getVoyageNo());
+				if (ObjectUtils.isNotNull(details.getVesselId())) {
+					BVessels bVessels = bVesselsService.getById(details.getVesselId());
+					if (bVessels != null) {
+						BCorps bCorps = bCorpsService.getById(bVessels.getCarrierId());
+						if (bCorps != null) {
+							bCorps.setCarrierCode(RegularUtils.regularEn(bCorps.getCarrierCode()));
+							inttraSoDto.setVesselCarrierCode(bCorps.getCarrierCode());
+						}
+					}
+				}
+
+				details.setVesselCnName(RegularUtils.regularEn(details.getVesselCnName()));
+				inttraSoDto.setVesselName(details.getVesselCnName());
+
+				details.setPolCode(RegularUtils.regularEn(details.getPolCode()));
+				inttraSoDto.setPolCode(details.getPolCode());
+
+				details.setServiceTerms(RegularUtils.regularEn(details.getPolCnName()));
+				inttraSoDto.setPolName(details.getPolCnName());
+
+				details.setPlaceReceiptCode(RegularUtils.regularEn(details.getPlaceReceiptCode()));
+				inttraSoDto.setPlaceReceiptCode(details.getPlaceReceiptCode());
+
+				details.setPlaceReceiptName(RegularUtils.regularEn(details.getPlaceReceiptName()));
+				inttraSoDto.setPlaceReceiptName(details.getPlaceReceiptName());
+
+				details.setPodCode(RegularUtils.regularEn(details.getPodCode()));
+				inttraSoDto.setPodCode(details.getPodCode());
+
+				details.setPodCnName(RegularUtils.regularEn(details.getPodCnName()));
+				inttraSoDto.setPodName(details.getPodCnName());
+
+				details.setPlaceDeliveryCode(RegularUtils.regularEn(details.getPlaceDeliveryCode()));
+				inttraSoDto.setPlaceDeliveryCode(details.getPlaceDeliveryCode());
+
+				details.setPlaceDeliveryName(RegularUtils.regularEn(details.getPlaceDeliveryName()));
+				inttraSoDto.setPlaceDeliveryName(details.getPlaceDeliveryName());
+
+				details.setHshipperCnName(RegularUtils.regularEn(details.getHshipperCnName()));
+				inttraSoDto.setHsHipperOne(details.getHshipperCnName());
+				inttraSoDto.setHsHipperTwo("发货人 2");
+				inttraSoDto.setHsHipperThree("发货人 3");
+				inttraSoDto.setHsHipperFour("发货人 4");
+				inttraSoDto.setHsHipperFive("发货人 5");
+
+				details.setHconsigneeCnName(RegularUtils.regularEn(details.getHconsigneeCnName()));
+				inttraSoDto.setHConsigneeOne(details.getHconsigneeCnName());
+				inttraSoDto.setHConsigneeTwo("收货人 2");
+				inttraSoDto.setHConsigneeThree("收货人3");
+				inttraSoDto.setHConsigneeFour("收货人 4");
+				inttraSoDto.setHConsigneeFive("收货人 5");
+
+				details.setHnotifyCnName(RegularUtils.regularEn(details.getHnotifyCnName()));
+				inttraSoDto.setHNotifyOne(details.getHnotifyCnName());
+				inttraSoDto.setHNotifyTwo("通知人 2");
+				inttraSoDto.setHNotifyThree("通知人 3");
+				inttraSoDto.setHNotifyFour("通知人 4");
+				inttraSoDto.setHNotifyFive("通知人 5");
+
+				details.setCarrierCnName(RegularUtils.regularEn(details.getCarrierCnName()));
+				inttraSoDto.setCarrierName(details.getCarrierCnName());
+				if (ObjectUtils.isNotNull(details.getCarrierId())) {
+					BCorps bCorps = bCorpsService.getById(details.getCarrierId());
+					if (bCorps != null) {
+						bCorps.setCarrierCode(RegularUtils.regularEn(bCorps.getCarrierCode()));
+						inttraSoDto.setCarrierCode(bCorps.getCarrierCode());
+					}
+				}
+				inttraSoDto.setSenderCode("发送方代码");
+				inttraSoDto.setSenderName("发送方称呼");
+				inttraSoDto.setSenderContacts("发送方联系人");
+				inttraSoDto.setSenderTel("发送方联系电话");
+				inttraSoDto.setSenderEmail("发送方联系邮件");
+				inttraSoDto.setBillLadingType("提单类型");
+				if (details.getStlCrStatus() >= 3 || details.getStlDrStatus() >= 3) {
+					inttraSoDto.setPaymentStatus("已付款");
+				} else {
+					inttraSoDto.setPaymentStatus("未付款");
+				}
+				inttraSoDto.setBillLadingNumber(new BigDecimal("0"));
+				inttraSoDto.setPackagesNumbers(details.getQuantity());
+				inttraSoDto.setPackagesCode(details.getPackingUnit());
+				inttraSoDto.setPackagesDescribe("包装描述");
+				inttraSoDto.setHsCode(new BigDecimal("001"));
+				details.setCommodityCnName(RegularUtils.regularEn(details.getCommodityCnName()));
+				inttraSoDto.setProductName(details.getCommodityCnName());
+				inttraSoDto.setGrossWeight(details.getGrossWeight());
+				inttraSoDto.setMeasurement(details.getMeasurement());
+				inttraSoDto.setMarks(details.getMarks());
+				BigDecimal boxGoodNumber = new BigDecimal("0.00");
+				BigDecimal boxGoodWeight = new BigDecimal("0.00");
+				BigDecimal boxGoodMeasurement = new BigDecimal("0.00");
+				if (containersList.size() > 0) {
+					inttraSoDto.setBoxGoodNumber(containersList.get(0).getQuantity());
+					inttraSoDto.setBoxGoodWeight(containersList.get(0).getGrossWeight());
+					inttraSoDto.setBoxGoodMeasurement(containersList.get(0).getMeasurement());
+
+					String boxNumber = containersList.stream().map(Containers::getCntrNo).filter(Objects::nonNull).distinct().collect(Collectors.joining("/"));
+					inttraSoDto.setBoxNo(boxNumber);
+					inttraSoDto.setShipperBoxIdentification("货主箱标识");
+
+				} else {
+					inttraSoDto.setBoxGoodNumber(boxGoodNumber);
+					inttraSoDto.setBoxGoodWeight(boxGoodWeight);
+					inttraSoDto.setBoxGoodMeasurement(boxGoodMeasurement);
+				}
+				details.setDgImdgCode(RegularUtils.regularEn(details.getDgImdgCode()));
+				inttraSoDto.setDgImdgCode(details.getDgImdgCode());
+				inttraSoDto.setPageNumber(new BigDecimal("007"));
+				inttraSoDto.setDgUnCode(1);
+				inttraSoDto.setDgFlashPoint(1);
+				inttraSoDto.setDgFlashPointUnit(details.getDgFlashPointUnit());
+				inttraSoDto.setPackingGroup("包装组别");
+				inttraSoDto.setEmergencyMeasureNo("应急措施号");
+				details.setDgRemarks(RegularUtils.regularEn(details.getDgRemarks()));
+				inttraSoDto.setDgRemarks(details.getDgRemarks());
+				inttraSoDto.setDgContacts(details.getDgContacts());
+				inttraSoDto.setDgTel(details.getDgTel());
+				inttraSoDto.setBoxCode(details.getQuantityCntrDescr());
+				inttraSoDto.setTemperature(1);
+				inttraSoDto.setTemperatureUnit("温度单位");
+				inttraSoDto.setRecordRows(new BigDecimal("10"));
+				inttraSoDto.setInformationNoEnd(inttraSoDto.getInformationNo());
+				inttraSoDto.setFileExchangeNumberEnd(inttraSoDto.getFileExchangeNumber());
+
+				FilesCenter filesCenter = EDISender.sendingInttraSI(inttraSoDto);
+
+				//发送edi记录
+				EdiLog ediLog = new EdiLog();
+				ediLog.setBillId(details.getId());
+				ediLog.setBillNo(details.getBillNo());
+				ediLog.setMblno(details.getMblno());
+				ediLog.setHblno(details.getHblno());
+				ediLog.setPid(ediTypes.getId());
+				ediLog.setSenderDate(new Date());
+				ediLog.setBranchId(details.getBranchId());
+				ediLog.setCreateDept(details.getCreateDept());
+				ediLog.setCreateTime(details.getCreateTime());
+				ediLog.setCreateDeptName(details.getCreateDeptName());
+				ediLog.setCreateUser(details.getCreateUser());
+				ediLog.setCreateUserName(details.getCreateUserName());
+				ediLog.setRemarks("发送成功");
+				ediLog.setStatus(1);
+				ediLogService.save(ediLog);
+
+				//发送edi文件
+				filesCenter.setMblno(details.getMblno());
+				filesCenter.setHblno(details.getHblno());
+				filesCenter.setBillNo(details.getBillNo());
+				filesCenter.setBranchId(details.getBranchId());
+				filesCenter.setCreateDept(details.getCreateDept());
+				filesCenter.setCreateTime(details.getCreateTime());
+				filesCenter.setCreateDeptName(details.getCreateDeptName());
+				filesCenter.setCreateUser(details.getCreateUser());
+				filesCenter.setCreateUserName(details.getCreateUserName());
+				filesCenter.setPid(details.getId());
+				filesCenter.setItemId(ediLog.getId());
+				filesCenter.setBusinessType(details.getBusinessType());
+				filesCenter.setClassifyCode("edi");
+				filesCenter.setGroupCode("SI");
+				filesCenter.setSerialNo(1);
+				filesCenter.setSort(1);
+				filesCenter.setReceivedData(new Date());
+				filesCenter.setIsImage(0);
+				filesCenter.setTenantId(AuthUtil.getTenantId());
+				filesCenterList.add(filesCenter);
+			}
+			billsService.updateBatchById(billsList);
+		}
+		else if ("HYCK".equals(ediTypes.getType()) && "SI-bill".equals(ediTypes.getCode())) {
+			Date date = new Date();
+			for (Bills details : billsList) {
+				InttraSiBillDto inttraSoDto = new InttraSiBillDto();
+				inttraSoDto.setIdentifying("发送方标识");
+				SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd:hhmm");
+				inttraSoDto.setDate(sdf.format(date));
+				SimpleDateFormat sdf1 = new SimpleDateFormat("yyMMddhhmm");
+				String corpId = details.getCorpId().toString();
+				inttraSoDto.setFileExchangeNumber(sdf1.format(date) + corpId.substring(corpId.length() - 4));
+				inttraSoDto.setInformationNo(inttraSoDto.getFileExchangeNumber());
+
+				details.setMblno(RegularUtils.regularEn(details.getMblno()));
+				inttraSoDto.setIdentificationCode(details.getMblno());
+
+				if (ObjectUtils.isNotNull(details.getEdiStatus()) && Integer.parseInt(details.getEdiStatus()) > 0) {
+					inttraSoDto.setFilesFunction("5");
+					details.setEdiStatus(Integer.parseInt(details.getEdiStatus()) + 1 + "");
+				} else {
+					inttraSoDto.setFilesFunction("9");
+					details.setEdiStatus("1");
+				}
+				inttraSoDto.setFilesDate(sdf1.format(date));
+
+				details.setServiceTerms(RegularUtils.regularEn(details.getServiceTerms()));
+				inttraSoDto.setTransportTermCode(details.getServiceTerms());
+
+				inttraSoDto.setLclType("2");
+
+				details.setRemarks(RegularUtils.regularEn(details.getRemarks()));
+				inttraSoDto.setRemarks(details.getRemarks());
+
+				SimpleDateFormat sdf2 = new SimpleDateFormat("yyyymmdd");
+				if (ObjectUtils.isNotNull(details.getIssueDate())) {
+					inttraSoDto.setIssueDate(sdf2.format(details.getIssueDate()));
+				}
+
+				details.setRefno(RegularUtils.regularEn(details.getRefno()));
+				inttraSoDto.setBillNo(details.getRefno());
+
+				inttraSoDto.setPaymentType(details.getMpaymode());
+
+				details.setVoyageNo(RegularUtils.regularEn(details.getVoyageNo()));
+				inttraSoDto.setVoyageNo(details.getVoyageNo());
+				if (ObjectUtils.isNotNull(details.getVesselId())) {
+					BVessels bVessels = bVesselsService.getById(details.getVesselId());
+					if (bVessels != null) {
+						BCorps bCorps = bCorpsService.getById(bVessels.getCarrierId());
+						if (bCorps != null) {
+							bCorps.setCarrierCode(RegularUtils.regularEn(bCorps.getCarrierCode()));
+							inttraSoDto.setVesselCarrierCode(bCorps.getCarrierCode());
+						}
+					}
+				}
+
+				details.setVesselCnName(RegularUtils.regularEn(details.getVesselCnName()));
+				inttraSoDto.setVesselName(details.getVesselCnName());
+
+				inttraSoDto.setBillLadingType("提单类型");
+				if (details.getStlCrStatus() >= 3 || details.getStlDrStatus() >= 3) {
+					inttraSoDto.setPaymentStatus("已付款");
+				} else {
+					inttraSoDto.setPaymentStatus("未付款");
+				}
+				inttraSoDto.setBillLadingNumber(new BigDecimal("0"));
+				inttraSoDto.setPackagesNumbers(details.getQuantity());
+				inttraSoDto.setPackagesCode(details.getPackingUnit());
+				inttraSoDto.setPackagesDescribe("包装描述");
+				inttraSoDto.setHsCode(new BigDecimal("001"));
+
+				inttraSoDto.setMarks(details.getMarks());
+				BigDecimal boxGoodNumber = new BigDecimal("0.00");
+				if (containersList.size() > 0) {
+					inttraSoDto.setBoxGoodNumber(containersList.get(0).getQuantity());
+
+					String boxNumber = containersList.stream().map(Containers::getCntrNo).filter(Objects::nonNull).distinct().collect(Collectors.joining("/"));
+					inttraSoDto.setBoxNo(boxNumber);
+					inttraSoDto.setShipperBoxIdentification("货主箱标识");
+
+				} else {
+					inttraSoDto.setBoxGoodNumber(boxGoodNumber);
+				}
+				details.setDgImdgCode(RegularUtils.regularEn(details.getDgImdgCode()));
+				inttraSoDto.setDgImdgCode(details.getDgImdgCode());
+				inttraSoDto.setPageNumber(new BigDecimal("007"));
+				inttraSoDto.setDgUnCode(1);
+				inttraSoDto.setDgFlashPoint(new BigDecimal("1"));
+				inttraSoDto.setDgFlashPointUnit(details.getDgFlashPointUnit());
+				inttraSoDto.setPackingGroup("包装组别");
+				inttraSoDto.setEmergencyMeasureNo("应急措施号");
+				details.setDgRemarks(RegularUtils.regularEn(details.getDgRemarks()));
+				inttraSoDto.setDgRemarks(details.getDgRemarks());
+				inttraSoDto.setDgContacts(details.getDgContacts());
+				inttraSoDto.setDgTel(details.getDgTel());
+				inttraSoDto.setBoxCode(details.getQuantityCntrDescr());
+				inttraSoDto.setTemperature(1);
+				inttraSoDto.setTemperatureUnit("温度单位");
+				inttraSoDto.setRecordRows(new BigDecimal("10"));
+				inttraSoDto.setInformationNoEnd(inttraSoDto.getInformationNo());
+				inttraSoDto.setFileExchangeNumberEnd(inttraSoDto.getFileExchangeNumber());
+
+				FilesCenter filesCenter = EDISender.sendingInttraSiBill(inttraSoDto);
+
+				//发送edi记录
+				EdiLog ediLog = new EdiLog();
+				ediLog.setBillId(details.getId());
+				ediLog.setBillNo(details.getBillNo());
+				ediLog.setMblno(details.getMblno());
+				ediLog.setHblno(details.getHblno());
+				ediLog.setPid(ediTypes.getId());
+				ediLog.setSenderDate(new Date());
+				ediLog.setBranchId(details.getBranchId());
+				ediLog.setCreateDept(details.getCreateDept());
+				ediLog.setCreateTime(details.getCreateTime());
+				ediLog.setCreateDeptName(details.getCreateDeptName());
+				ediLog.setCreateUser(details.getCreateUser());
+				ediLog.setCreateUserName(details.getCreateUserName());
+				ediLog.setRemarks("发送成功");
+				ediLog.setStatus(1);
+				ediLogService.save(ediLog);
+
+				//发送edi文件
+				filesCenter.setMblno(details.getMblno());
+				filesCenter.setHblno(details.getHblno());
+				filesCenter.setBillNo(details.getBillNo());
+				filesCenter.setBranchId(details.getBranchId());
+				filesCenter.setCreateDept(details.getCreateDept());
+				filesCenter.setCreateTime(details.getCreateTime());
+				filesCenter.setCreateDeptName(details.getCreateDeptName());
+				filesCenter.setCreateUser(details.getCreateUser());
+				filesCenter.setCreateUserName(details.getCreateUserName());
+				filesCenter.setPid(details.getId());
+				filesCenter.setItemId(ediLog.getId());
+				filesCenter.setBusinessType(details.getBusinessType());
+				filesCenter.setClassifyCode("edi");
+				filesCenter.setGroupCode("SI");
+				filesCenter.setSerialNo(1);
+				filesCenter.setSort(1);
+				filesCenter.setReceivedData(new Date());
+				filesCenter.setIsImage(0);
+				filesCenter.setTenantId(AuthUtil.getTenantId());
+				filesCenterList.add(filesCenter);
+			}
+			billsService.updateBatchById(billsList);
+		}
 		filesCenterService.saveOrUpdateBatch(filesCenterList);
 		return R.data("发送成功");
 	}