Browse Source

1.提取成本接口逻辑修改
2.分单添加主单,合并唛头,货描等,不要用特殊符号隔开,直接另起一行
3.收付汇总,收付明细,未收付明细,业务利润,箱量利润列表,合计,导出接口增加权限判断
4.生成单号增加所属公司区分逻辑
5.新增模版导入接口及测试
6.箱池动态-导入接口同步海运出口配箱明细放箱号

纪新园 8 months ago
parent
commit
e10a49496b
31 changed files with 919 additions and 247 deletions
  1. 10 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Containers.java
  2. 54 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/vo/GenerateMailVo.java
  3. 6 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/DecisionAnalysis.java
  4. 5 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSettlementExcel.java
  5. 5 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java
  6. 5 0
      blade-service/blade-los/pom.xml
  7. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/basic/fees/controller/LosBFeesTemplateController.java
  8. 6 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/controller/ReportsController.java
  9. 9 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/IReportsService.java
  10. 74 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java
  11. 2 3
      blade-service/blade-los/src/main/java/org/springblade/los/billno/service/impl/BusinessBillNoServiceImpl.java
  12. 9 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxController.java
  13. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/ITradingBoxService.java
  14. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java
  15. 54 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java
  16. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java
  17. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/release/service/impl/SeaReleaseBillServiceImpl.java
  18. 10 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/HYCKTemplateImportController.java
  19. 48 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/UpdatePodStationController.java
  20. 3 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml
  21. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/ITemplateImportService.java
  22. 14 10
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  23. 331 126
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/TemplateImportServiceImpl.java
  24. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/check/service/impl/AuditProecessServiceImpl.java
  25. 168 68
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java
  26. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FinAccBillsServiceImpl.java
  27. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/impl/FinInvoicesServiceImpl.java
  28. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/stl/service/impl/FinStlBillsServiceImpl.java
  29. 80 36
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java
  30. 1 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml
  31. 10 0
      pom.xml

+ 10 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Containers.java

@@ -280,6 +280,11 @@ public class Containers implements Serializable {
 	@ApiModelProperty(value = "是否食品箱,(0 否 1是)")
 	private Integer isFood;
 	/**
+	 * 皮重
+	 */
+	@ApiModelProperty(value = "皮重")
+	private BigDecimal tare;
+	/**
 	 * VGM 称重方法,SM1, SM2
 	 */
 	@ApiModelProperty(value = "VGM 称重方法,SM1, SM2")
@@ -492,6 +497,11 @@ public class Containers implements Serializable {
 	 */
 	@ApiModelProperty(value = "来源分单id")
 	private Long srcSplitOrderId;
+	/**
+	 * 放箱号
+	 */
+	@ApiModelProperty(value = "放箱号")
+	private String containerNumber;
 
 	/**
 	 * 配箱类型

+ 54 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/vo/GenerateMailVo.java

@@ -0,0 +1,54 @@
+package org.springblade.los.business.sea.vo;
+
+import lombok.Data;
+
+/**
+ * @author Rain
+ */
+@Data
+public class GenerateMailVo {
+
+	/**
+	 * 文件内容
+	 */
+	private byte[] fileContent;
+
+	/**
+	 * 文件名
+	 */
+	private String fileName;
+
+	/**
+	 * 文件类型
+	 */
+	private String fileType;
+
+	/**
+	 * 接收人
+	 * 多个以 ; 分号间隔
+	 */
+	private String sendTo;
+
+	/**
+	 * 抄送人
+	 * 多个以 ; 分号间隔
+	 */
+	private String sendCc;
+
+	/**
+	 * 密松人
+	 * 多个以 ; 分号间隔
+	 */
+	private String sendBcc;
+
+	/**
+	 * 邮件标题
+	 */
+	private String mailTitle;
+
+	/**
+	 * 	邮件内容
+	 */
+	private String mailContent;
+
+}

+ 6 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/DecisionAnalysis.java

@@ -1,5 +1,6 @@
 package org.springblade.los.statisticAnalysis;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -140,4 +141,9 @@ public class DecisionAnalysis {
 	 */
 	private String sort;
 
+	/**
+	 * 所属公司
+	 */
+	private String branchId;
+
 }

+ 5 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSettlementExcel.java

@@ -67,6 +67,11 @@ public class FeeSettlementExcel {
 	 */
 	@ExcelIgnore
 	private Long srcId;
+	/**
+	 * 所属公司
+	 */
+	@ExcelIgnore
+	private String branchId;
 
 
 }

+ 5 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java

@@ -146,4 +146,9 @@ public class User extends TenantEntity {
 	 */
 	@ApiModelProperty(value = "小程序id")
 	private String appletsId;
+
+	/**
+	 * 邮箱授权码
+	 */
+	private String emailAuthorization;
 }

+ 5 - 0
blade-service/blade-los/pom.xml

@@ -12,6 +12,11 @@
     <artifactId>blade-los</artifactId>
 
     <dependencies>
+        <dependency>
+            <groupId>com.echepei</groupId>
+            <artifactId>common-utils</artifactId>
+            <version>1.2</version>
+        </dependency>
         <!-- 邮件依赖,配置hutool工具包发送邮件  -->
         <dependency>
             <groupId>com.sun.mail</groupId>

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/basic/fees/controller/LosBFeesTemplateController.java

@@ -99,7 +99,7 @@ public class LosBFeesTemplateController extends BladeController {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			lambdaQueryWrapper.apply("(find_in_set('" + AuthUtil.getDeptId() + "',branch_id) or branch_id is null)");
 		} else {
-			lambdaQueryWrapper.eq(ObjectUtils.isNotNull(losBFeesTemplate.getBranchId()), LosBFeesTemplate::getBranchId, losBFeesTemplate.getBranchId());
+			lambdaQueryWrapper.like(ObjectUtils.isNotNull(losBFeesTemplate.getBranchId()), LosBFeesTemplate::getBranchId, losBFeesTemplate.getBranchId());
 		}
 		IPage<LosBFeesTemplate> pages = losBFeesTemplateService.page(Condition.getPage(query), lambdaQueryWrapper);
 		return R.data(pages);
@@ -230,7 +230,7 @@ public class LosBFeesTemplateController extends BladeController {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			lambdaQueryWrapper.apply("(find_in_set('" + AuthUtil.getDeptId() + "',branch_id) or branch_id is null)");
 		} else {
-			lambdaQueryWrapper.eq(ObjectUtils.isNotNull(losBFeesTemplate.getBranchId()), LosBFeesTemplate::getBranchId, losBFeesTemplate.getBranchId());
+			lambdaQueryWrapper.like(ObjectUtils.isNotNull(losBFeesTemplate.getBranchId()), LosBFeesTemplate::getBranchId, losBFeesTemplate.getBranchId());
 		}
 		IPage<LosBFeesTemplate> pages = losBFeesTemplateService.page(Condition.getPage(query), lambdaQueryWrapper);
 		return R.data(pages);

+ 6 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/controller/ReportsController.java

@@ -36,6 +36,7 @@ import org.springblade.los.basic.reports.entity.Reports;
 import org.springblade.los.basic.reports.service.IReportsBoxService;
 import org.springblade.los.basic.reports.service.IReportsService;
 import org.springblade.los.basic.reports.vo.ReportsVO;
+import org.springblade.los.business.sea.vo.GenerateMailVo;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
@@ -202,5 +203,10 @@ public class ReportsController extends BladeController {
 		return reportsBoxService.getReportData(billId, reportCode, groupCode, corpIds, itemIds, type, curCode);
 	}
 
+	@PostMapping("/generateMailFileAndSend")
+	public R<String> generateMailFileAndSend(@RequestBody GenerateMailVo generateMailVo) {
+		return reportsService.generateMailFileAndSend(generateMailVo);
+	}
+
 
 }

+ 9 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/IReportsService.java

@@ -21,6 +21,7 @@ import org.springblade.los.basic.reports.entity.Reports;
 import org.springblade.los.basic.reports.vo.ReportsVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.business.sea.vo.GenerateMailVo;
 
 import java.util.List;
 
@@ -55,4 +56,12 @@ public interface IReportsService extends IService<Reports> {
 					String itemIds,String type,String curCode);
 
     List<Reports> getReports(Reports reports);
+
+	/**
+	 * 生成邮件文件并发送
+	 *
+	 * @param generateMailVo 参数
+	 * @return 结果
+	 */
+	R<String> generateMailFileAndSend(GenerateMailVo generateMailVo);
 }

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

@@ -20,8 +20,12 @@ 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 com.echepei.dto.mail.MailDto;
+import com.echepei.enums.MailTypeEnum;
+import com.echepei.utils.mail.SendMailUtil;
 import lombok.AllArgsConstructor;
 import org.springblade.common.enums.CommonEnum;
+import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
@@ -42,6 +46,7 @@ import org.springblade.los.business.amends.service.IAmendsService;
 import org.springblade.los.business.sea.dto.ContainersReports;
 import org.springblade.los.business.sea.entity.*;
 import org.springblade.los.business.sea.service.*;
+import org.springblade.los.business.sea.vo.GenerateMailVo;
 import org.springblade.los.enums.AmendType;
 import org.springblade.los.finance.agreement.entity.AgreementPrice;
 import org.springblade.los.finance.agreement.entity.AgreementPriceItems;
@@ -70,8 +75,12 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
+import java.io.File;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.time.LocalDate;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.Function;
@@ -3479,6 +3488,71 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 		return baseMapper.getReports(reports);
 	}
 
+	@Override
+	public R<String> generateMailFileAndSend(GenerateMailVo generateMailVo) {
+		String baseFilePath = sysClient.getParamService("stimulsoft.send.mail.path");
+		if (!StringUtils.hasText(baseFilePath)) {
+			return R.fail("请配置发送邮件文件路径");
+		}
+		BladeUser bladeUser = AuthUtil.getUser();
+		R<User> userInfoResult = userClient.userInfoById(bladeUser.getUserId());
+		if (!userInfoResult.isSuccess()) {
+			return R.fail(userInfoResult.getMsg());
+		}
+		User userInfo = userInfoResult.getData();
+		if (org.springframework.util.ObjectUtils.isEmpty(userInfo)) {
+			return R.fail("用户不存在,请重新登录");
+		}
+		String userMail = userInfo.getEmail();
+		String userMailAuthorization = userInfo.getEmailAuthorization();
+		if (!StringUtils.hasText(userMail) || !StringUtils.hasText(userMailAuthorization)) {
+			R<List<DictBiz>> bizResult = dictBizClient.getList("mail_send");
+			if (!bizResult.isSuccess()) {
+				return R.fail("请完善邮箱信息");
+			}
+			List<DictBiz> dictBizList = bizResult.getData();
+			if (CollectionUtils.isEmpty(dictBizList)) {
+				return R.fail("请完善邮箱信息");
+			}
+			DictBiz dictBiz = dictBizList.stream().filter(db -> db.getTenantId().equals(bladeUser.getTenantId())
+				&& db.getIsDeleted() == 0 && db.getIsSealed() == 0).sorted(Comparator.comparingInt(DictBiz::getSort)).findFirst().orElse(null);
+			if (dictBiz == null) {
+				return R.fail("请完善有效的邮箱信息");
+			}
+			userMail = dictBiz.getDictKey();
+			userMailAuthorization = dictBiz.getDictValue();
+			if (!StringUtils.hasText(userMail) || !StringUtils.hasText(userMailAuthorization)) {
+				return R.fail("请维护邮箱信息");
+			}
+		}
+		LocalDate nowDate = LocalDate.now();
+		baseFilePath = baseFilePath + "/" + nowDate.getYear() + "/" + nowDate.getMonthValue() + "/" + nowDate.getDayOfMonth();
+		if (!Files.exists(Paths.get(baseFilePath))) {
+			new File(baseFilePath).mkdirs();
+		}
+		String realFileName = generateMailVo.getFileName() + "." + generateMailVo.getFileType().toLowerCase();
+		String filePath =  baseFilePath + "/" + realFileName;
+		try {
+			Files.write(Paths.get(filePath), generateMailVo.getFileContent());
+		} catch (Exception e) {
+			log.error(e.toString());
+			return R.fail("文件写入失败");
+		}
+		MailDto mailDto = new MailDto();
+		mailDto.setMailFrom(userMail);
+		mailDto.setMailUserName(userMail);
+		mailDto.setMailPassword(userMailAuthorization);
+		mailDto.setMailType(MailTypeEnum.QQ.mailType);
+		mailDto.setMailTo(generateMailVo.getSendTo());
+		mailDto.setMailCc(generateMailVo.getSendCc());
+		mailDto.setMailBcc(generateMailVo.getSendBcc());
+		mailDto.setMailTitle(generateMailVo.getMailTitle());
+		mailDto.setMailContent(generateMailVo.getMailContent());
+		mailDto.setMailFilePath(Arrays.asList(filePath));
+		SendMailUtil.sendHtmlFileMail(mailDto);
+		return R.data("发送成功");
+	}
+
 
 	private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
 		Set<Object> seen = ConcurrentHashMap.newKeySet();

+ 2 - 3
blade-service/blade-los/src/main/java/org/springblade/los/billno/service/impl/BusinessBillNoServiceImpl.java

@@ -25,7 +25,6 @@ import net.logstash.logback.encoder.org.apache.commons.lang3.time.DateFormatUtil
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
-import org.springblade.los.Util.IDeptUtils;
 import org.springblade.los.billno.entity.BillNoCenter;
 import org.springblade.los.billno.entity.BillNoSerial;
 import org.springblade.los.billno.entity.BusinessBillNo;
@@ -68,7 +67,7 @@ public class BusinessBillNoServiceImpl extends ServiceImpl<BusinessBillNoMapper,
 
 	@Override
 	public R<String> getBillNoLos(BusinessBillNo businessBillNo) {
-		String branchId = AuthUtil.getDeptId();
+		String branchId = ObjectUtils.isNull(businessBillNo.getBranchId()) ? AuthUtil.getDeptId() : businessBillNo.getBranchId();
 		BusinessBillNo detail = baseMapper.selectOne(new LambdaQueryWrapper<BusinessBillNo>()
 			.eq(BusinessBillNo::getTenantId, AuthUtil.getTenantId())
 			.eq(BusinessBillNo::getIsDeleted, 0)
@@ -183,7 +182,7 @@ public class BusinessBillNoServiceImpl extends ServiceImpl<BusinessBillNoMapper,
 
 	@Override
 	public R<String> getVoucherNoLos(BusinessBillNo businessBillNo) {
-		String branchId = AuthUtil.getDeptId();
+		String branchId = ObjectUtils.isNull(businessBillNo.getBranchId()) ? AuthUtil.getDeptId() : businessBillNo.getBranchId();
 		BusinessBillNo detail = baseMapper.selectOne(new LambdaQueryWrapper<BusinessBillNo>()
 			.eq(BusinessBillNo::getTenantId, AuthUtil.getTenantId())
 			.eq(BusinessBillNo::getIsDeleted, 0)

+ 9 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxController.java

@@ -35,6 +35,7 @@ import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.los.box.dto.ExportTradingBoxItemOut;
 import org.springblade.los.box.dto.ExportTradingBoxOut;
+import org.springblade.los.box.entity.PutBox;
 import org.springblade.los.box.entity.TradingBox;
 import org.springblade.los.box.entity.TradingBoxItem;
 import org.springblade.los.box.service.ITradingBoxItemService;
@@ -366,4 +367,12 @@ public class TradingBoxController extends BladeController {
 		return tradingBoxService.revokeCountOverdueFee(tradingBox);
 	}
 
+	/**
+	 * 批量修改pod还箱堆存
+	 */
+	@PostMapping("/batchUpdatePodStation")
+	public R batchUpdatePodStation(@Valid @RequestBody TradingBox tradingBox) {
+		return tradingBoxService.batchUpdatePodStation(tradingBox);
+	}
+
 }

+ 2 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/ITradingBoxService.java

@@ -69,4 +69,6 @@ public interface ITradingBoxService extends IService<TradingBox> {
 	R countOverdueFee(TradingBox tradingBox);
 
 	R revokeCountOverdueFee(TradingBox tradingBox);
+
+	R batchUpdatePodStation(TradingBox tradingBox);
 }

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

@@ -1011,6 +1011,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					containers.setPolCyCname(corps.getCnName());
 					containers.setPolCyEname(corps.getEnName());
 					containers.setPolStationEmptyContainerExitDate(item.getBoxStatusDate());
+					containers.setContainerNumber(item.getContainerNumber());
 					containersListNew.add(containers);
 				}
 			}
@@ -1342,6 +1343,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					containers.setPodStationCname(corps.getCnName());
 					containers.setPodStationEname(corps.getEnName());
 					containers.setPodEmptyContainerReturnDate(item.getBoxStatusDate());
+					containers.setContainerNumber(item.getContainerNumber());
 					containersListNew.add(containers);
 				}
 			}
@@ -1889,7 +1891,6 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 					putBox1.setPolStationCode(corps.getCode());
 					putBox1.setPolStationCname(corps.getCnName());
 					putBox1.setPolStationEname(corps.getEnName());
-					putBox1.setBoxCondition("好");
 					putBox1.setBoxType(archives.getTypeName());
 					putBox1.setBoxClass("自有箱");
 					putBox1.setTotalNum(1);
@@ -1939,7 +1940,6 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				putBox.setPolStationCode(corps.getCode());
 				putBox.setPolStationCname(corps.getCnName());
 				putBox.setPolStationEname(corps.getEnName());
-				putBox.setBoxCondition("好");
 				putBox.setBoxType(archives.getTypeName());
 				putBox.setBoxClass("自有箱");
 				putBox.setTotalNum(1);

+ 54 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java

@@ -2698,4 +2698,58 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		return R.data(tradingBox);
 	}
 
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R batchUpdatePodStation(TradingBox tradingBox) {
+		if (ObjectUtils.isNull(tradingBox.getTradingBoxItemsList()) || tradingBox.getTradingBoxItemsList().isEmpty()) {
+			throw new RuntimeException("请选择明细");
+		}
+		if (ObjectUtils.isNull(tradingBox.getPodStationId())) {
+			throw new RuntimeException("请选择更改还箱场站");
+		}
+		PutBox putBox = putBoxService.getOne(new LambdaQueryWrapper<PutBox>()
+			.eq(PutBox::getTenantId, AuthUtil.getTenantId())
+			.eq(PutBox::getIsDeleted, 0)
+			.eq(PutBox::getSrcId, tradingBox.getId())
+			.eq(PutBox::getSrcNo, tradingBox.getSysNo()));
+		if (putBox == null) {
+			throw new RuntimeException("未查到放箱号");
+		}
+		List<PutBoxItems> putBoxItemsList = putBoxItemsService.list(new LambdaQueryWrapper<PutBoxItems>()
+			.eq(PutBoxItems::getTenantId, AuthUtil.getTenantId())
+			.eq(PutBoxItems::getIsDeleted, 0)
+			.eq(PutBoxItems::getPid, putBox.getId())
+			.in(PutBoxItems::getBoxCode, tradingBox.getTradingBoxItemsList().stream().map(TradingBoxItem::getCode).collect(Collectors.toList())));
+		if (putBoxItemsList.isEmpty()) {
+			throw new RuntimeException("未查到放箱号箱明细");
+		}
+		List<PutBoxItems> putBoxItems = new ArrayList<>();
+		for (TradingBoxItem item : tradingBox.getTradingBoxItemsList()) {
+			item.setPodStationId(tradingBox.getPodStationId());
+			item.setPodStationCname(tradingBox.getPodStationCname());
+			item.setPodStationCode(tradingBox.getPodStationCode());
+			item.setPodStationEname(tradingBox.getPodStationEname());
+			item.setUpdateUser(AuthUtil.getUserId());
+			item.setUpdateUserName(AuthUtil.getUserName());
+			item.setUpdateTime(new Date());
+			PutBoxItems boxItems = putBoxItemsList.stream().filter(e -> e.getBoxCode().equals(item.getCode())).findFirst().orElse(null);
+			if (boxItems == null) {
+				throw new RuntimeException("未查到放箱号中箱号:" + item.getCode() + "明细");
+			}
+			boxItems.setPodStationId(tradingBox.getPodStationId());
+			boxItems.setPodStationCname(tradingBox.getPodStationCname());
+			boxItems.setPodStationCode(tradingBox.getPodStationCode());
+			boxItems.setPodStationEname(tradingBox.getPodStationEname());
+			boxItems.setUpdateUser(AuthUtil.getUserId());
+			boxItems.setUpdateUserName(AuthUtil.getUserName());
+			boxItems.setUpdateTime(new Date());
+			putBoxItems.add(boxItems);
+		}
+		tradingBoxItemService.updateBatchById(tradingBox.getTradingBoxItemsList());
+		if (!putBoxItems.isEmpty()) {
+			putBoxItemsService.updateBatchById(putBoxItems);
+		}
+		return null;
+	}
+
 }

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

@@ -144,6 +144,7 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 			BusinessBillNo businessBillNo = new BusinessBillNo();
 			businessBillNo.setBusinessTypeId(businessType.getId());
 			businessBillNo.setCode(amends.getBillNoFormat());
+			businessBillNo.setBranchId(branchId);
 			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 			if (!clientBillNo.isSuccess()) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

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

@@ -127,6 +127,7 @@ public class SeaReleaseBillServiceImpl extends ServiceImpl<SeaReleaseBillMapper,
 			BusinessBillNo businessBillNo = new BusinessBillNo();
 			businessBillNo.setBusinessTypeId(businessType.getId());
 			businessBillNo.setCode(releaseBill.getBillNoFormat());
+			businessBillNo.setBranchId(branchId);
 			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 			if (!clientBillNo.isSuccess()) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -416,6 +417,7 @@ public class SeaReleaseBillServiceImpl extends ServiceImpl<SeaReleaseBillMapper,
 		BusinessBillNo businessBillNo = new BusinessBillNo();
 		businessBillNo.setBusinessTypeId(businessType.getId());
 		businessBillNo.setCode("FDDU");
+		businessBillNo.setBranchId(branchId);
 		R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 		if (!clientBillNo.isSuccess()) {
 			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

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

@@ -69,4 +69,14 @@ public class HYCKTemplateImportController {
 		return templateImportService.importHisense(file,billId);
 	}
 
+
+	/**
+	 * 海运出口模版导入(提单样本)
+	 */
+	@PostMapping("/importBills")
+	@RepeatSubmit
+	public R<Bills> importBills(@RequestParam("file") MultipartFile file,@RequestParam("billId") Long billId) throws Exception {
+		return templateImportService.importBills(file,billId);
+	}
+
 }

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

@@ -0,0 +1,48 @@
+package org.springblade.los.business.sea.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.box.entity.TradingBox;
+import org.springblade.los.box.entity.TradingBoxItem;
+import org.springblade.los.business.sea.service.ISeaContainerNumberItemService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author :jixinyuan
+ * @date : 2025/6/18
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/UpdatePodStation")
+public class UpdatePodStationController {
+
+	private final ISeaContainerNumberItemService seaContainerNumberItemService;
+
+
+	/**
+	 * 分页 买箱、卖箱、租箱、代理箱表
+	 */
+	@GetMapping("/list")
+	public R<IPage<TradingBox>> list(TradingBox tradingBox, Query query) {
+
+//		IPage<TradingBox> pages = seaContainerNumberItemService.page(Condition.getPage(query), lambdaQueryWrapper);
+
+		return R.data(null);
+	}
+
+
+}

+ 3 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml

@@ -506,6 +506,9 @@
         <if test="data.sort!=null and data.sort != ''">
             ORDER BY #{data.sort}
         </if>
+        <if test='data.branchId != null and data.branchId != ""'>
+            and branch_id = #{data.branchId}
+        </if>
     </select>
     <select id="decisionAnalysisByCGS" resultType="java.util.Map">
         SELECT c.cn_name                     as cname,

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

@@ -41,4 +41,6 @@ public interface ITemplateImportService {
 	R<Bills> importHisenseBill(MultipartFile file,Long billId)throws Exception ;
 
 	R<List<Containers>> importHisense(MultipartFile file,Long billId)throws Exception ;
+
+	R<Bills> importBills(MultipartFile file, Long billId)throws Exception;
 }

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

@@ -271,6 +271,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			BusinessBillNo businessBillNo = new BusinessBillNo();
 			businessBillNo.setBusinessTypeId(businessType.getId());
 			businessBillNo.setCode(bills.getBillNoFormat());
+			businessBillNo.setBranchId(bills.getBranchId());
 			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 			if (!clientBillNo.isSuccess()) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -1230,8 +1231,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				grossWeight = grossWeight.add(billsList.stream().map(Bills::getGrossWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				quantity = quantity.add(billsList.stream().map(Bills::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				measurement = measurement.add(billsList.stream().map(Bills::getMeasurement).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
-				marks = billsList.stream().map(Bills::getMarks).filter(Objects::nonNull).collect(Collectors.joining("&"));
-				commodityDescr = billsList.stream().map(Bills::getCommodityDescr).filter(Objects::nonNull).collect(Collectors.joining("&"));
+				marks = billsList.stream().map(Bills::getMarks).filter(Objects::nonNull).collect(Collectors.joining("&|&"));
+				commodityDescr = billsList.stream().map(Bills::getCommodityDescr).filter(Objects::nonNull).collect(Collectors.joining("&|&"));
 				this.itemCopy(bills, billsList);
 			}
 			bills.setTeuTotal(teuTotal);
@@ -1250,10 +1251,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills.setSplitOrderSum(bills.getSplitOrderSum() + billsList.size());
 			if (ObjectUtils.isNotNull(marks)) {
 				marks = marks.replaceAll("N/M", "");
-				bills.setMarks(bills.getMarks() + "&" + marks);
+				bills.setMarks(bills.getMarks() + "&|&" + marks);
 			}
 			if (ObjectUtils.isNotNull(commodityDescr)) {
-				bills.setCommodityDescr(bills.getCommodityDescr() + "&" + commodityDescr);
+				bills.setCommodityDescr(bills.getCommodityDescr() + "&|&" + commodityDescr);
 			}
 			baseMapper.updateById(bills);
 		}
@@ -1397,20 +1398,20 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				.eq(Bills::getMasterId, bills.getId())
 				.notIn(Bills::getId, idArr));
 			if (!billsList1.isEmpty()) {
-				String marks = billsList.stream().map(Bills::getMarks).filter(Objects::nonNull).collect(Collectors.joining("&"));
-				String commodityDescr = billsList.stream().map(Bills::getCommodityDescr).filter(Objects::nonNull).collect(Collectors.joining("&"));
+				String marks = billsList.stream().map(Bills::getMarks).filter(Objects::nonNull).collect(Collectors.joining("&|&"));
+				String commodityDescr = billsList.stream().map(Bills::getCommodityDescr).filter(Objects::nonNull).collect(Collectors.joining("&|&"));
 				if (ObjectUtils.isNotNull(marks)) {
-					bills.setMarks(bills.getMarks() + "&" + marks);
+					bills.setMarks(bills.getMarks() + "&|&" + marks);
 				}
 				if (ObjectUtils.isNotNull(commodityDescr)) {
-					bills.setCommodityDescr(bills.getCommodityDescr() + "&" + commodityDescr);
+					bills.setCommodityDescr(bills.getCommodityDescr() + "&|&" + commodityDescr);
 				}
 			} else {
 				if (ObjectUtils.isNotNull(bills.getMarks())) {
-					bills.setMarks(bills.getMarks().substring(0, bills.getMarks().indexOf("&")));
+					bills.setMarks(bills.getMarks().substring(0, bills.getMarks().indexOf("&|&")));
 				}
 				if (ObjectUtils.isNotNull(bills.getCommodityDescr())) {
-					bills.setCommodityDescr(bills.getCommodityDescr().substring(0, bills.getCommodityDescr().indexOf("&")));
+					bills.setCommodityDescr(bills.getCommodityDescr().substring(0, bills.getCommodityDescr().indexOf("&|&")));
 				}
 			}
 			bills.setTeuTotal(teuTotal);
@@ -1503,6 +1504,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		BusinessBillNo businessBillNo = new BusinessBillNo();
 		businessBillNo.setBusinessTypeId(businessType.getId());
 		businessBillNo.setCode(bills.getBillNoFormat());
+		businessBillNo.setBranchId(bills.getBranchId());
 		R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 		if (!clientBillNo.isSuccess()) {
 			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -2772,6 +2774,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		BusinessBillNo businessBillNo = new BusinessBillNo();
 		businessBillNo.setBusinessTypeId(businessType.getId());
 		businessBillNo.setCode("HYJK");
+		businessBillNo.setBranchId(branchId);
 		R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 		if (!clientBillNo.isSuccess()) {
 			throw new RuntimeException("生成订单编号失败");
@@ -3633,6 +3636,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			} else {
 				businessBillNo.setCode(item.getBusinessTypes() + "-PH");
 			}
+			businessBillNo.setBranchId(item.getBranchId());
 			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 			if (!clientBillNo.isSuccess()) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

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

@@ -2,14 +2,10 @@ package org.springblade.los.business.sea.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.sun.org.apache.xpath.internal.operations.Bool;
 import lombok.AllArgsConstructor;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
-import org.springblade.los.Util.RegularUtils;
 import org.springblade.los.basic.packages.entity.BPackages;
 import org.springblade.los.basic.packages.service.IBPackagesService;
 import org.springblade.los.basic.ports.entity.BPorts;
@@ -23,7 +19,6 @@ import org.springblade.los.business.sea.service.IBillsService;
 import org.springblade.los.business.sea.service.ITemplateImportService;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
-import org.stringtemplate.v4.ST;
 
 import java.io.FileInputStream;
 import java.lang.reflect.Field;
@@ -33,7 +28,12 @@ import java.math.RoundingMode;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.StandardCopyOption;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * @author :jixinyuan
@@ -50,68 +50,68 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 
 	private final IBillsService billsService;
 
-	public static double splitNumericPrefixFromString(String str){
-		str=str.replace(" ","").trim();
-		String str2="", str3="";
+	public static double splitNumericPrefixFromString(String str) {
+		str = str.replace(" ", "").trim();
+		String str2 = "", str3 = "";
 		Boolean bf = false;
-		if(str != null && !"".equals(str)){
-			for(int i=0; i<str.length(); i++){
-				if(!bf && (str.charAt(i)==46||(str.charAt(i)>=48 && str.charAt(i)<=57))){
+		if (str != null && !"".equals(str)) {
+			for (int i = 0; i < str.length(); i++) {
+				if (!bf && (str.charAt(i) == 46 || (str.charAt(i) >= 48 && str.charAt(i) <= 57))) {
 					str2 += str.charAt(i);
-				}else{
+				} else {
 					bf = true;
 					str3 += str.charAt(i);
 				}
 			}
 		}
 
-		double d=0;
+		double d = 0;
 
-		try{
+		try {
 			d = Double.parseDouble(str2);
-		}catch (Exception e){
+		} catch (Exception e) {
 			d = 0;
-		}finally{
+		} finally {
 			return d;
 		}
 	}
 
-	public static Map<String, Object> splitNumericPrefixMapFromString(String str){
+	public static Map<String, Object> splitNumericPrefixMapFromString(String str) {
 		Map<String, Object> map = new HashMap<>();
-		str=str.replace(" ","").trim();
-		String str2="", str3="";
+		str = str.replace(" ", "").trim();
+		String str2 = "", str3 = "";
 		Boolean bf = false;
-		if(str != null && !"".equals(str)){
-			for(int i=0; i<str.length(); i++){
-				if(!bf && (str.charAt(i)==46||(str.charAt(i)>=48 && str.charAt(i)<=57))){
+		if (str != null && !"".equals(str)) {
+			for (int i = 0; i < str.length(); i++) {
+				if (!bf && (str.charAt(i) == 46 || (str.charAt(i) >= 48 && str.charAt(i) <= 57))) {
 					str2 += str.charAt(i);
-				}else{
+				} else {
 					bf = true;
 					str3 += str.charAt(i);
 				}
 			}
 		}
 
-		double d=0;
+		double d = 0;
 
-		try{
+		try {
 			d = Double.parseDouble(str2);
-		}catch (Exception e){
+		} catch (Exception e) {
 			d = 0;
-		}finally{
+		} finally {
 			map.put("value", d);
 			map.put("str", str3);
 			return map;
 		}
 	}
 
-	public static String getSheetCellValueAsString(Sheet sheet, int row, int col){
+	public static String getSheetCellValueAsString(Sheet sheet, int row, int col) {
 		Row r = sheet.getRow(row);
 		Cell c = ObjectUtils.isNotNull(r) ? r.getCell(col) : null;
 		String res = "";
-		if(ObjectUtils.isNotNull(c)){
+		if (ObjectUtils.isNotNull(c)) {
 			CellType ct = c.getCellTypeEnum();
-			switch (ct){
+			switch (ct) {
 				case STRING:
 					res = c.getStringCellValue().trim();
 					break;
@@ -130,17 +130,17 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		return res;
 	}
 
-	public static double getSheetCellValueAsDouble(Sheet sheet, int row, int col){
+	public static double getSheetCellValueAsDouble(Sheet sheet, int row, int col) {
 		Row r = sheet.getRow(row);
 		Cell c = ObjectUtils.isNotNull(r) ? r.getCell(col) : null;
 		double res = 0.0;
-		if(ObjectUtils.isNotNull(c)){
+		if (ObjectUtils.isNotNull(c)) {
 			CellType ct = c.getCellTypeEnum();
-			switch (ct){
+			switch (ct) {
 				case STRING:
 					try {
 						res = Double.parseDouble(c.getStringCellValue().trim());
-					}catch (Exception e) {
+					} catch (Exception e) {
 						res = 0;
 					}
 					break;
@@ -171,17 +171,17 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		return splitNumericPrefixMapFromString(str);
 	}
 
-	public static Boolean stringBuilderIsNotEmpty(StringBuilder sb){
+	public static Boolean stringBuilderIsNotEmpty(StringBuilder sb) {
 		return ObjectUtils.isNotNull(sb) && !sb.toString().trim().isEmpty();
 	}
 
-	public static String getFirstStars(String text){
+	public static String getFirstStars(String text) {
 		String ret = "";
-		if(ObjectUtils.isNotNull(text)) {
-			for (int i = 0; i<text.length(); i++){
-				if(text.charAt(i)=='*'){
+		if (ObjectUtils.isNotNull(text)) {
+			for (int i = 0; i < text.length(); i++) {
+				if (text.charAt(i) == '*') {
 					ret += '*';
-				}else{
+				} else {
 					break;
 				}
 			}
@@ -189,13 +189,13 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		return ret;
 	}
 
-	public static String getLastStars(String text){
+	public static String getLastStars(String text) {
 		String ret = "";
-		if(ObjectUtils.isNotNull(text)) {
-			for (int i = text.length() - 1; i>=0; i--){
-				if(text.charAt(i)=='*'){
+		if (ObjectUtils.isNotNull(text)) {
+			for (int i = text.length() - 1; i >= 0; i--) {
+				if (text.charAt(i) == '*') {
 					ret += '*';
-				}else{
+				} else {
 					break;
 				}
 			}
@@ -203,33 +203,33 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		return ret;
 	}
 
-	public static String getStarLines(StringBuilder sb, String starts){
+	public static String getStarLines(StringBuilder sb, String starts) {
 		StringBuilder ret = new StringBuilder();
 
-		if(ObjectUtils.isNotNull(sb) && ObjectUtils.isNotNull(starts)){
+		if (ObjectUtils.isNotNull(sb) && ObjectUtils.isNotNull(starts)) {
 			String[] lines = sb.toString().split("\n");
 			ArrayList<String> newLines = new ArrayList<String>();
 			Boolean bInStar = false;
 			for (String line : lines) {
-				if(getFirstStars(line).equals(starts)){
+				if (getFirstStars(line).equals(starts)) {
 					bInStar = true;
-					if(line.length()>starts.length()){
+					if (line.length() > starts.length()) {
 						ret.append(line.substring(starts.length() - 1).concat("\r\n"));
 					}
-				}else{
-					if(bInStar && (line.isEmpty() || line.charAt(0)!='*')){
+				} else {
+					if (bInStar && (line.isEmpty() || line.charAt(0) != '*')) {
 						ret.append(line.concat("\r\n"));
-					}else{
+					} else {
 						bInStar = false;
 					}
-					if(!bInStar) {
+					if (!bInStar) {
 						newLines.add(line);
 					}
 				}
 			}
 
 			sb.setLength(0);
-			newLines.forEach(line->{
+			newLines.forEach(line -> {
 				sb.append(line.concat("\r\n"));
 			});
 		}
@@ -237,7 +237,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		return ret.toString().trim();
 	}
 
-	public static void resetBillsNullValuesAsEmptyString(Bills bills){
+	public static void resetBillsNullValuesAsEmptyString(Bills bills) {
 		//将字符串为null的赋默认值为""
 		Field[] fields = bills.getClass().getDeclaredFields();
 		for (Field field : fields) {
@@ -254,8 +254,9 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 			}
 		}
 	}
+
 	@Override
-	public R<Bills> importOne(MultipartFile file,Long billId) throws Exception {
+	public R<Bills> importOne(MultipartFile file, Long billId) throws Exception {
 		Bills bills = billsService.getById(billId);
 		SeaBillsDetail seaBillsDetail = new SeaBillsDetail();
 		// 创建临时文件
@@ -268,16 +269,16 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		Sheet sheet = null;
 		String errMsg = "";
 
-		try{
+		try {
 			workbook = WorkbookFactory.create(fis);
 			sheet = workbook.getSheetAt(0); // 获取第一个工作表
-		}catch (Exception e){
+		} catch (Exception e) {
 			workbook = null;
 			sheet = null;
 			errMsg = e.getMessage();
 		}
 
-		if(ObjectUtils.isNull(workbook) || ObjectUtils.isNull(sheet)) {
+		if (ObjectUtils.isNull(workbook) || ObjectUtils.isNull(sheet)) {
 			throw new RuntimeException("文件读取失败,该文件可能不是 Excel 文件!" + errMsg);
 		}
 
@@ -285,14 +286,14 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 
 		int firstRow = sheet.getFirstRowNum();
 		int lastRow = sheet.getLastRowNum();
-		if(firstRow<=0 && lastRow<0){
+		if (firstRow <= 0 && lastRow < 0) {
 			throw new RuntimeException("文件内容为空!");
 		}
 
 		StringBuilder sbLines = new StringBuilder();
-		for(int r=firstRow; r<=lastRow; r++) {
+		for (int r = firstRow; r <= lastRow; r++) {
 			String val0 = getSheetCellValueAsString(sheet, r, 0).toUpperCase().replace(" ", "");
-			if(val0.isEmpty()){
+			if (val0.isEmpty()) {
 				sbLines.append(getSheetCellValueAsString(sheet, r, 1).concat("\r\n"));
 			} else if (val0.equals("TO:")) {
 				System.out.println("TO:" + getSheetCellValueAsString(sheet, r, 1).toUpperCase());
@@ -330,7 +331,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 				sbLines.setLength(0);
 
 				String blno = getSheetCellValueAsString(sheet, r, 1);
-				if(ObjectUtils.isNotNull(blno)){
+				if (ObjectUtils.isNotNull(blno)) {
 					System.out.println("blno:" + blno);
 					bills.setMblno(blno);
 				} else {
@@ -365,7 +366,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 				} else {
 					// throw new RuntimeException("船名航次不能为空");
 				}
-			}else if (val0.equals("KINDOFB/L")) {
+			} else if (val0.equals("KINDOFB/L")) {
 				String s1 = getSheetCellValueAsString(sheet, r, 1);
 				System.out.println("kindOfBl:" + s1);
 				if (ObjectUtils.isNotNull(s1)) {
@@ -379,10 +380,10 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 
 				s1 = getSheetCellValueAsString(sheet, r, 4);
 				System.out.println("PAYMODE:" + s1);
-				if(s1.indexOf("PREPAID")>=0){
+				if (s1.indexOf("PREPAID") >= 0) {
 					bills.setHpaymode("PP");
 				}
-				if(s1.indexOf("COLLECT")>=0){
+				if (s1.indexOf("COLLECT") >= 0) {
 					bills.setHpaymode("CC");
 				}
 			} else if (val0.equals("PLACEOFISSUE")) {
@@ -397,7 +398,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 					if (ports != null) {
 						bills.setIssueAtId(ports.getId());
 						bills.setIssueAt(ports.getEnName());
-					}else {
+					} else {
 						throw new RuntimeException("签单地点 " + port + " 无法识别!");
 					}
 				}
@@ -418,9 +419,9 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 				// MARKS
 				int remarkLn = 0;
 				sbLines.setLength(0);
-				for (int l = r + 1; l<=lastRow; l++) {
+				for (int l = r + 1; l <= lastRow; l++) {
 					String s1 = getSheetCellValueAsString(sheet, l, 0);
-					if("REMARK".equals(s1.trim())){
+					if ("REMARK".equals(s1.trim())) {
 						if (stringBuilderIsNotEmpty(sbLines)) {
 							System.out.println("marks:" + sbLines);
 							bills.setMarks(sbLines.toString().trim());
@@ -428,7 +429,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 
 						remarkLn = l;
 						break;
-					}else{
+					} else {
 						sbLines.append(s1.concat("\r\n"));
 					}
 				}
@@ -439,10 +440,10 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 
 				Map<String, Object> pkgs = getSheetCellValueAsNumericPrefixMap(sheet, r + 1, 1);
 				String kindPkgs = pkgs.get("str").toString();
-				if(ObjectUtils.isNull(kindPkgs)) {
+				if (ObjectUtils.isNull(kindPkgs)) {
 					kindPkgs = getSheetCellValueAsString(sheet, r, 1);
 				}
-				if(ObjectUtils.isNotNull(kindPkgs)) {
+				if (ObjectUtils.isNotNull(kindPkgs)) {
 					BPackages bPackages = bPackagesService.getOne(new LambdaQueryWrapper<BPackages>()
 						.eq(BPackages::getEnName, kindPkgs));
 					if (bPackages != null) {
@@ -463,10 +464,10 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 				System.out.println("meas:" + meas);
 				bills.setMeasurement(new BigDecimal(meas).setScale(3, RoundingMode.HALF_UP));
 
-				if(remarkLn>0) {
+				if (remarkLn > 0) {
 					// DESCRIPTION
 					sbLines.setLength(0);
-					for (int l = r + 1; l<remarkLn; l++) {
+					for (int l = r + 1; l < remarkLn; l++) {
 						String s1 = getSheetCellValueAsString(sheet, l, 2);
 						sbLines.append(s1.concat("\r\n"));
 					}
@@ -474,11 +475,11 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 					bills.setCommodityDescr(sbLines.toString().trim());
 
 					sbLines.setLength(0);
-					for (int l = remarkLn; l<=lastRow; l++) {
+					for (int l = remarkLn; l <= lastRow; l++) {
 						String s1 = getSheetCellValueAsString(sheet, l, 0);
-						if(s1.isEmpty() || "REMARK".equals(s1)){
+						if (s1.isEmpty() || "REMARK".equals(s1)) {
 							sbLines.append(getSheetCellValueAsString(sheet, l, 1).concat("\r\n"));
-						}else if("FINAL DESTINATION FOR THE MERCHANT’S REFERENCE".equals(s1)){
+						} else if ("FINAL DESTINATION FOR THE MERCHANT’S REFERENCE".equals(s1)) {
 							String port = getSheetCellValueAsString(sheet, l, 4);
 							System.out.println("finalDestination:" + port);
 							if (ObjectUtils.isNotNull(port)) {
@@ -492,7 +493,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 									bills.setFinalDestinationCode(ports.getCode());
 									bills.setFinalDestinationName(ports.getEnName());
 									bills.setFinalDestinationNamePrint(ports.getEnName());
-								}else {
+								} else {
 									throw new RuntimeException("最终目的地 " + port + " 无法识别!");
 								}
 							}
@@ -521,7 +522,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 	}
 
 	@Override
-	public R<Bills> importPilBooking(MultipartFile file,Long billId) throws Exception {
+	public R<Bills> importPilBooking(MultipartFile file, Long billId) throws Exception {
 		Bills bills = billsService.getById(billId);
 		SeaBillsDetail seaBillsDetail = new SeaBillsDetail();
 		// 创建临时文件
@@ -536,7 +537,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 
 		//SHIPPER
 		StringBuilder shipper = new StringBuilder();
-		for(int r=2; r<=6; r++) {
+		for (int r = 2; r <= 6; r++) {
 			String line = "";
 			for (int i = 0; i <= 3; i++) {
 				if (ObjectUtils.isNotNull(sheet.getRow(r).getCell(i))) {
@@ -548,13 +549,13 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		if (stringBuilderIsNotEmpty(shipper)) {
 			System.out.println("shipper:" + shipper);
 			seaBillsDetail.setHshipperDetails(shipper.toString().trim());
-		}else{
+		} else {
 			throw new RuntimeException("发货人不能为空");
 		}
 
 		//CONSIGNEE
 		StringBuilder consignee = new StringBuilder();
-		for(int r=9; r<=13; r++) {
+		for (int r = 9; r <= 13; r++) {
 			String line = "";
 			for (int i = 0; i <= 3; i++) {
 				if (ObjectUtils.isNotNull(sheet.getRow(r).getCell(i))) {
@@ -566,12 +567,12 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		if (stringBuilderIsNotEmpty(consignee)) {
 			System.out.println("consignee:" + consignee);
 			seaBillsDetail.setHconsigneeDetails(consignee.toString().trim());
-		}else{
+		} else {
 			throw new RuntimeException("收货人不能为空");
 		}
 		//NOTIFY PARTY
 		StringBuilder notifyParty = new StringBuilder();
-		for(int r=16; r<=20; r++) {
+		for (int r = 16; r <= 20; r++) {
 			String line = "";
 			for (int i = 0; i <= 3; i++) {
 				if (ObjectUtils.isNotNull(sheet.getRow(r).getCell(i))) {
@@ -583,7 +584,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		if (stringBuilderIsNotEmpty(notifyParty)) {
 			System.out.println("notifyParty:" + notifyParty);
 			seaBillsDetail.setHnotifyDetails(notifyParty.toString().trim());
-		}else{
+		} else {
 			throw new RuntimeException("通知人不能为空");
 		}
 		//VSL/VOY
@@ -710,7 +711,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		}
 		//MARKS
 		StringBuilder marks = new StringBuilder();
-		for(int r=28; r<=44; r++) {
+		for (int r = 28; r <= 44; r++) {
 			String line = "";
 			for (int i = 0; i <= 0; i++) {
 				if (ObjectUtils.isNotNull(sheet.getRow(r).getCell(i))) {
@@ -725,7 +726,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		}
 		//BAGS
 		if (ObjectUtils.isNotNull(sheet.getRow(28).getCell(2))) {
-			double bags = getSheetCellValueAsNumericPrefix(sheet,28, 2);
+			double bags = getSheetCellValueAsNumericPrefix(sheet, 28, 2);
 			System.out.println("bags:" + bags);
 			bills.setQuantity(new BigDecimal(bags).setScale(0, RoundingMode.HALF_UP));
 		} else {
@@ -735,31 +736,31 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		StringBuilder description = new StringBuilder();
 		String hscode = "";
 		Boolean findHsCode = false;
-		for(int r=28; r<=44; r++) {
+		for (int r = 28; r <= 44; r++) {
 			String line = "";
 			if (ObjectUtils.isNotNull(sheet.getRow(r).getCell(3))) {
 				line = getSheetCellValueAsString(sheet, r, 3);
 			}
-			if(!findHsCode){
+			if (!findHsCode) {
 				findHsCode = line.toUpperCase().startsWith("HS CODE:");
-				if(findHsCode){
+				if (findHsCode) {
 					hscode = line.substring(8).trim();
 					bills.setHscode(hscode);
 				}
 			}
-			if(!findHsCode) {
+			if (!findHsCode) {
 				description.append(line + "\r\n");
 			}
 		}
 		if (stringBuilderIsNotEmpty(description)) {
 			System.out.println("description:" + description.toString().trim());
 			bills.setCommodityDescr(description.toString().trim());
-		}else{
+		} else {
 			throw new RuntimeException("货物描述不能为空");
 		}
 		//G.W.
 		if (ObjectUtils.isNotNull(sheet.getRow(28).getCell(6))) {
-			double gw = getSheetCellValueAsNumericPrefix(sheet,28,6);
+			double gw = getSheetCellValueAsNumericPrefix(sheet, 28, 6);
 			System.out.println("gw:" + gw);
 			bills.setGrossWeight(new BigDecimal(gw).setScale(3, RoundingMode.HALF_UP));
 		} else {
@@ -767,7 +768,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		}
 		//MEAS
 		if (ObjectUtils.isNotNull(sheet.getRow(28).getCell(7))) {
-			double meas = getSheetCellValueAsNumericPrefix(sheet,28,7);
+			double meas = getSheetCellValueAsNumericPrefix(sheet, 28, 7);
 			System.out.println("meas:" + meas);
 			bills.setMeasurement(new BigDecimal(meas).setScale(3, RoundingMode.HALF_UP));
 		} else {
@@ -788,7 +789,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 	}
 
 	@Override
-	public R<Bills> importPilCutOffOrders(MultipartFile file,Long billId) throws Exception {
+	public R<Bills> importPilCutOffOrders(MultipartFile file, Long billId) throws Exception {
 		Bills bills = billsService.getById(billId);
 		SeaBillsDetail seaBillsDetail = new SeaBillsDetail();
 		// 创建临时文件
@@ -803,7 +804,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 
 		//SHIPPER
 		StringBuilder shipper = new StringBuilder();
-		for(int r=2; r<=6; r++) {
+		for (int r = 2; r <= 6; r++) {
 			String line = "";
 			for (int i = 0; i <= 3; i++) {
 				if (ObjectUtils.isNotNull(sheet.getRow(r).getCell(i))) {
@@ -815,13 +816,13 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		if (stringBuilderIsNotEmpty(shipper)) {
 			System.out.println("shipper:" + shipper);
 			seaBillsDetail.setHshipperDetails(shipper.toString().trim());
-		}else{
+		} else {
 			throw new RuntimeException("发货人不能为空");
 		}
 
 		//CONSIGNEE
 		StringBuilder consignee = new StringBuilder();
-		for(int r=9; r<=13; r++) {
+		for (int r = 9; r <= 13; r++) {
 			String line = "";
 			for (int i = 0; i <= 3; i++) {
 				if (ObjectUtils.isNotNull(sheet.getRow(r).getCell(i))) {
@@ -833,12 +834,12 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		if (stringBuilderIsNotEmpty(consignee)) {
 			System.out.println("consignee:" + consignee);
 			seaBillsDetail.setHconsigneeDetails(consignee.toString().trim());
-		}else{
+		} else {
 			throw new RuntimeException("收货人不能为空");
 		}
 		//NOTIFY PARTY
 		StringBuilder notifyParty = new StringBuilder();
-		for(int r=16; r<=20; r++) {
+		for (int r = 16; r <= 20; r++) {
 			String line = "";
 			for (int i = 0; i <= 3; i++) {
 				if (ObjectUtils.isNotNull(sheet.getRow(r).getCell(i))) {
@@ -850,7 +851,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		if (stringBuilderIsNotEmpty(notifyParty)) {
 			System.out.println("notifyParty:" + notifyParty);
 			seaBillsDetail.setHnotifyDetails(notifyParty.toString().trim());
-		}else{
+		} else {
 			throw new RuntimeException("通知人不能为空");
 		}
 		//VSL/VOY
@@ -977,7 +978,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		}
 		//MARKS
 		StringBuilder marks = new StringBuilder();
-		for(int r=28; r<=44; r++) {
+		for (int r = 28; r <= 44; r++) {
 			String line = "";
 			for (int i = 0; i <= 0; i++) {
 				if (ObjectUtils.isNotNull(sheet.getRow(r).getCell(i))) {
@@ -992,7 +993,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		}
 		//BAGS
 		if (ObjectUtils.isNotNull(sheet.getRow(28).getCell(2))) {
-			double bags = getSheetCellValueAsNumericPrefix(sheet,28, 2);
+			double bags = getSheetCellValueAsNumericPrefix(sheet, 28, 2);
 			System.out.println("bags:" + bags);
 			bills.setQuantity(new BigDecimal(bags).setScale(0, RoundingMode.HALF_UP));
 		} else {
@@ -1002,31 +1003,31 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		StringBuilder description = new StringBuilder();
 		String hscode = "";
 		Boolean findHsCode = false;
-		for(int r=28; r<=44; r++) {
+		for (int r = 28; r <= 44; r++) {
 			String line = "";
 			if (ObjectUtils.isNotNull(sheet.getRow(r).getCell(3))) {
 				line = getSheetCellValueAsString(sheet, r, 3);
 			}
-			if(!findHsCode){
+			if (!findHsCode) {
 				findHsCode = line.toUpperCase().startsWith("HS CODE:");
-				if(findHsCode){
+				if (findHsCode) {
 					hscode = line.substring(8).trim();
 					bills.setHscode(hscode);
 				}
 			}
-			if(!findHsCode) {
+			if (!findHsCode) {
 				description.append(line + "\r\n");
 			}
 		}
 		if (stringBuilderIsNotEmpty(description)) {
 			System.out.println("description:" + description.toString().trim());
 			bills.setCommodityDescr(description.toString().trim());
-		}else{
+		} else {
 			throw new RuntimeException("货物描述不能为空");
 		}
 		//G.W.
 		if (ObjectUtils.isNotNull(sheet.getRow(28).getCell(6))) {
-			double gw = getSheetCellValueAsNumericPrefix(sheet,28,6);
+			double gw = getSheetCellValueAsNumericPrefix(sheet, 28, 6);
 			System.out.println("gw:" + gw);
 			bills.setGrossWeight(new BigDecimal(gw).setScale(3, RoundingMode.HALF_UP));
 		} else {
@@ -1034,7 +1035,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		}
 		//MEAS
 		if (ObjectUtils.isNotNull(sheet.getRow(28).getCell(7))) {
-			double meas = getSheetCellValueAsNumericPrefix(sheet,28,7);
+			double meas = getSheetCellValueAsNumericPrefix(sheet, 28, 7);
 			System.out.println("meas:" + meas);
 			bills.setMeasurement(new BigDecimal(meas).setScale(3, RoundingMode.HALF_UP));
 		} else {
@@ -1054,7 +1055,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 	}
 
 	@Override
-	public R<Bills> importHisenseBill(MultipartFile file,Long billId) throws Exception {
+	public R<Bills> importHisenseBill(MultipartFile file, Long billId) throws Exception {
 		Bills bills = billsService.getById(billId);
 		SeaBillsDetail seaBillsDetail = new SeaBillsDetail();
 		List<Containers> containersList = new ArrayList<>();
@@ -1070,20 +1071,20 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		Sheet sheet = workbook.getSheetAt(0); // 获取第一个工作表
 
 		String header = getSheetCellValueAsString(sheet, 0, 0);
-		if(!header.toUpperCase().equals("HISENSE B/L INFORMATION")){
+		if (!header.toUpperCase().equals("HISENSE B/L INFORMATION")) {
 			throw new RuntimeException("这可能不是海信提单文件!");
 		}
 
 		int firstRow = sheet.getFirstRowNum();
 		int lastRow = sheet.getLastRowNum();
-		if(firstRow<=0 && lastRow<0){
+		if (firstRow <= 0 && lastRow < 0) {
 			throw new RuntimeException("文件内容为空!");
 		}
 
 		StringBuilder sbLines = new StringBuilder();
-		for(int r=firstRow; r<=lastRow; r++){
+		for (int r = firstRow; r <= lastRow; r++) {
 			String val0 = getSheetCellValueAsString(sheet, r, 0).toUpperCase().replace(" ", "");
-			if(val0.isEmpty()){
+			if (val0.isEmpty()) {
 				sbLines.append(getSheetCellValueAsString(sheet, r, 1).concat("\r\n"));
 			} else if (val0.equals("SHIPPER")) {
 				sbLines.setLength(0);
@@ -1109,7 +1110,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 				}
 				sbLines.setLength(0);
 				sbLines.append(getSheetCellValueAsString(sheet, r, 1).concat("\r\n"));
-			} else if (val0.equals("PORTOFLOADING")||val0.equals("PLACEOFRECEIPT")||val0.equals("PORTOFDISCHARGE")||val0.equals("PLACEOFDELIVERY")) {
+			} else if (val0.equals("PORTOFLOADING") || val0.equals("PLACEOFRECEIPT") || val0.equals("PORTOFDISCHARGE") || val0.equals("PLACEOFDELIVERY")) {
 				if (val0.equals("PORTOFLOADING") && stringBuilderIsNotEmpty(sbLines)) {
 					System.out.println("notify2:" + sbLines);
 					seaBillsDetail.setHnotify2Details(sbLines.toString().trim());
@@ -1170,7 +1171,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 					.eq(BPackages::getIsDeleted, 0)
 					.eq(BPackages::getCode, getSheetCellValueAsString(sheet, r, 3))
 					.last("limit 1"));
-				if(ObjectUtils.isNotNull(packages)){
+				if (ObjectUtils.isNotNull(packages)) {
 					bills.setPackingUnitId(packages.getId());
 					bills.setPackingUnit(packages.getCode());
 				}
@@ -1178,10 +1179,10 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 				BigDecimal sumGw = new BigDecimal(0L);
 				BigDecimal sumVol = new BigDecimal(BigInteger.ZERO);
 
-				for(int cr=r+1; cr<=lastRow; cr++) {
+				for (int cr = r + 1; cr <= lastRow; cr++) {
 					String cntrType = getSheetCellValueAsString(sheet, cr, 0);
 					String cntrNo = getSheetCellValueAsString(sheet, cr, 1);
-					if(cntrType.length()==4 && cntrNo.length()==11) {
+					if (cntrType.length() == 4 && cntrNo.length() == 11) {
 						Containers containers = new Containers();
 						containers.setCntrTypeCode(cntrType);
 						containers.setCntrNo(cntrNo);
@@ -1195,7 +1196,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 						double v1 = getSheetCellValueAsDouble(sheet, cr, 5);
 						containers.setMeasurement(BigDecimal.valueOf(v1));
 						sumVol = sumVol.add(new BigDecimal(v1));
-						if(ObjectUtils.isNotNull(packages)){
+						if (ObjectUtils.isNotNull(packages)) {
 							containers.setPackingUnitId(packages.getId());
 							containers.setPackingUnit(packages.getCode());
 						}
@@ -1218,25 +1219,25 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 
 		String lines = ObjectUtils.isNotNull(seaBillsDetail.getHshipperDetails()) ? seaBillsDetail.getHshipperDetails().trim() : "";
 		String stars = getLastStars(lines);
-		if(!stars.isEmpty()){
+		if (!stars.isEmpty()) {
 			seaBillsDetail.setHshipperDetails(lines.substring(0, lines.length() - stars.length()).concat("\r\n").concat(getStarLines(sbLines, stars)));
 		}
 
 		lines = ObjectUtils.isNotNull(seaBillsDetail.getHconsigneeDetails()) ? seaBillsDetail.getHconsigneeDetails().trim() : "";
 		stars = getLastStars(lines);
-		if(!stars.isEmpty()){
+		if (!stars.isEmpty()) {
 			seaBillsDetail.setHconsigneeDetails(lines.substring(0, lines.length() - stars.length()).concat("\r\n").concat(getStarLines(sbLines, stars)));
 		}
 
 		lines = ObjectUtils.isNotNull(seaBillsDetail.getHnotifyDetails()) ? seaBillsDetail.getHnotifyDetails().trim() : "";
 		stars = getLastStars(lines);
-		if(!stars.isEmpty()){
+		if (!stars.isEmpty()) {
 			seaBillsDetail.setHnotifyDetails(lines.substring(0, lines.length() - stars.length()).concat("\r\n").concat(getStarLines(sbLines, stars)));
 		}
 
 		lines = ObjectUtils.isNotNull(seaBillsDetail.getHnotify2Details()) ? seaBillsDetail.getHnotify2Details().trim() : "";
 		stars = getLastStars(lines);
-		if(!stars.isEmpty()){
+		if (!stars.isEmpty()) {
 			seaBillsDetail.setHnotify2Details(lines.substring(0, lines.length() - stars.length()).concat("\r\n").concat(getStarLines(sbLines, stars)));
 		}
 
@@ -1255,7 +1256,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 	}
 
 	@Override
-	public R<List<Containers>> importHisense(MultipartFile file,Long billId) throws Exception {
+	public R<List<Containers>> importHisense(MultipartFile file, Long billId) throws Exception {
 		List<Containers> containersList = new ArrayList<>();
 
 		// 创建临时文件
@@ -1291,4 +1292,208 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		}
 		return R.data(containersList);
 	}
+
+	@Override
+	public R<Bills> importBills(MultipartFile file, Long billId) throws Exception {
+		Bills bills = billsService.getById(billId);
+		SeaBillsDetail seaBillsDetail = new SeaBillsDetail();
+		// 创建临时文件
+		Path tempFile = Files.createTempFile("prefix", "suffix");
+		// 将MultipartFile的内容复制到临时文件
+		Files.copy(file.getInputStream(), tempFile, StandardCopyOption.REPLACE_EXISTING);
+		// 创建FileInputStream来读取临时文件
+		FileInputStream fis = new FileInputStream(tempFile.toFile());
+		Workbook workbook = null;
+		Sheet sheet = null;
+		String errMsg = "";
+
+		try {
+			workbook = WorkbookFactory.create(fis);
+			sheet = workbook.getSheetAt(0); // 获取第一个工作表
+		} catch (Exception e) {
+			workbook = null;
+			sheet = null;
+			errMsg = e.getMessage();
+		}
+
+		if (ObjectUtils.isNull(workbook) || ObjectUtils.isNull(sheet)) {
+			throw new RuntimeException("文件读取失败,该文件可能不是 Excel 文件!" + errMsg);
+		}
+
+		String stringCellValue = "";
+
+		int firstRow = sheet.getFirstRowNum();
+		int lastRow = sheet.getLastRowNum();
+		if (firstRow <= 0 && lastRow < 0) {
+			throw new RuntimeException("文件内容为空!");
+		}
+
+		StringBuilder sbLines = new StringBuilder();
+		//发货人提单描述
+		String hshipper = getSheetCellValueAsString(sheet, 1, 0);
+		if (ObjectUtils.isNotNull(hshipper)) {
+			seaBillsDetail.setHshipperDetails(hshipper);
+		}
+		//收货人提单描述
+		String hconsignee = getSheetCellValueAsString(sheet, 7, 0);
+		if (ObjectUtils.isNotNull(hconsignee)) {
+			seaBillsDetail.setHconsigneeDetails(hconsignee);
+		}
+		//通知人提单描述
+		String hnotify = getSheetCellValueAsString(sheet, 13, 0);
+		if (ObjectUtils.isNotNull(hnotify)) {
+			seaBillsDetail.setHnotifyDetails(hnotify);
+		}
+		//提单号
+		String mblno = getSheetCellValueAsString(sheet, 6, 10);
+		if (ObjectUtils.isNotNull(mblno)) {
+			bills.setMblno(mblno);
+		}
+		//VSL/VOY
+		String vslVoy = getSheetCellValueAsString(sheet, 17, 11);
+		if (ObjectUtils.isNotNull(vslVoy)) {
+			if (vslVoy.contains("/")) {
+				String vsl = vslVoy.substring(0, vslVoy.indexOf("/"));
+				String voy = vslVoy.substring(vslVoy.indexOf("/") + 1);
+				if (ObjectUtils.isNotNull(vsl)) {
+					BVessels vessels = bVesselsService.getOne(new LambdaQueryWrapper<BVessels>()
+						.eq(BVessels::getTenantId, AuthUtil.getTenantId())
+						.eq(BVessels::getIsDeleted, 0)
+						.like(BVessels::getEnName, vsl)
+						.last("limit 1"));
+					if (vessels != null) {
+						bills.setVesselEnName(vessels.getEnName());
+						bills.setVesselCnName(vessels.getCnName());
+						bills.setVesselId(vessels.getId());
+					}
+				}
+				bills.setVoyageNo(voy);
+				System.out.println("vsl:" + vsl);
+				System.out.println("voy:" + voy);
+				System.out.println("vslVoy:" + vslVoy);
+			} else {
+				throw new RuntimeException("船名航次不能为空");
+			}
+		}
+		//pol
+		String pol = getSheetCellValueAsString(sheet, 19, 0);
+		System.out.println("Port of Loading:" + pol);
+		if (ObjectUtils.isNotNull(pol)) {
+			BPorts ports = bPortsService.getOne(new LambdaQueryWrapper<BPorts>()
+				.eq(BPorts::getTenantId, AuthUtil.getTenantId())
+				.eq(BPorts::getIsDeleted, 0)
+				.like(BPorts::getEnName, pol)
+				.last("limit 1"));
+			if (ports != null) {
+				bills.setPolId(ports.getId());
+				bills.setPolCnName(ports.getCnName());
+				bills.setPolCode(ports.getCode());
+				bills.setPolEnName(ports.getEnName());
+			} else {
+				throw new RuntimeException("Port of Loading:" + pol + " 无法识别!");
+			}
+		}
+		//pod
+		String pod = getSheetCellValueAsString(sheet, 19, 2);
+		System.out.println("Port of Discharge:" + pod);
+		if (ObjectUtils.isNotNull(pod)) {
+			BPorts ports = bPortsService.getOne(new LambdaQueryWrapper<BPorts>()
+				.eq(BPorts::getTenantId, AuthUtil.getTenantId())
+				.eq(BPorts::getIsDeleted, 0)
+				.like(BPorts::getEnName, pod)
+				.last("limit 1"));
+			if (ports != null) {
+				bills.setPodId(ports.getId());
+				bills.setPodCnName(ports.getCnName());
+				bills.setPodCode(ports.getCode());
+				bills.setPodEnName(ports.getEnName());
+			} else {
+				throw new RuntimeException("Port of Discharge:" + pod + " 无法识别!");
+			}
+		}
+		//交货地
+		String placeDelivery = getSheetCellValueAsString(sheet, 19, 10);
+		System.out.println("Place of delivery:" + placeDelivery);
+		if (ObjectUtils.isNotNull(placeDelivery)) {
+			BPorts ports = bPortsService.getOne(new LambdaQueryWrapper<BPorts>()
+				.eq(BPorts::getTenantId, AuthUtil.getTenantId())
+				.eq(BPorts::getIsDeleted, 0)
+				.like(BPorts::getEnName, placeDelivery)
+				.last("limit 1"));
+			if (ports != null) {
+				bills.setPlaceDeliveryId(ports.getId());
+				bills.setPlaceDeliveryName(ports.getEnName());
+				bills.setPlaceDeliveryCode(ports.getCode());
+			} else {
+				throw new RuntimeException("Place of delivery:" + placeDelivery + " 无法识别!");
+			}
+		}
+		//G.W.
+		String gw = getSheetCellValueAsString(sheet, 21, 11);
+		if (ObjectUtils.isNotNull(gw)) {
+			int lastDigitIndex = this.getIndex(gw);
+			if (lastDigitIndex > 0) {
+				String number = gw.substring(0, lastDigitIndex + 1);
+				bills.setGrossWeight(new BigDecimal(number));
+			}
+		}
+		System.out.println("gw:" + gw);
+		//件数
+		String quantity = getSheetCellValueAsString(sheet, 21, 1);
+		if (ObjectUtils.isNotNull(quantity)) {
+			int lastDigitIndex = this.getIndex(quantity);
+			if (lastDigitIndex > 0) {
+				String number = quantity.substring(0, lastDigitIndex + 1);
+				bills.setQuantity(new BigDecimal(number));
+			}
+		}
+		System.out.println("quantity:" + quantity);
+		//体积
+		String measurement = getSheetCellValueAsString(sheet, 21, 13);
+		if (ObjectUtils.isNotNull(measurement)) {
+			int lastDigitIndex = this.getIndex(measurement);
+			if (lastDigitIndex > 0) {
+				String number = measurement.substring(0, lastDigitIndex + 1);
+				bills.setMeasurement(new BigDecimal(number));
+			}
+		}
+		System.out.println("measurement:" + measurement);
+		//货物描述
+		String commodityDescr = getSheetCellValueAsString(sheet, 21, 3);
+		if (ObjectUtils.isNotNull(commodityDescr)) {
+			bills.setCommodityDescr(commodityDescr);
+		}
+		//货物描述
+		String hpaymode = getSheetCellValueAsString(sheet, 31, 0);
+		if (ObjectUtils.isNotNull(hpaymode)) {
+			if ("FREIGHT PREPAID".equals(hpaymode)) {
+				bills.setHpaymode("PP");
+			} else if ("FREIGHT COLLECT".equals(hpaymode)) {
+				bills.setHpaymode("CC");
+			}
+		}
+		bills.setContainersList(new ArrayList<>());
+		bills.setPreContainersList(new ArrayList<>());
+		bills.setContainersReportsList(new ArrayList<>());
+		bills.setFeeCenterListC(new ArrayList<>());
+		bills.setFeeCenterListD(new ArrayList<>());
+		bills.setFilesList(new ArrayList<>());
+		bills.setWaitingBoxList(new ArrayList<>());
+		bills.setDetail(seaBillsDetail);
+		//将字符串为null的赋默认值为""
+		resetBillsNullValuesAsEmptyString(bills);
+
+		return R.data(bills);
+	}
+
+	private int getIndex(String gw) {
+		int lastIndex = -1; // 用于存储最后一个数字的索引
+		for (int i = gw.length() - 1; i >= 0; i--) {
+			if (Character.isDigit(gw.charAt(i))) {
+				lastIndex = i; // 找到最后一个数字,记录其位置
+				break; // 找到后退出循环
+			}
+		}
+		return lastIndex;
+	}
 }

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

@@ -1586,6 +1586,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 				BusinessBillNo businessBillNo = new BusinessBillNo();
 				businessBillNo.setBusinessTypeId(businessType.getId());
 				businessBillNo.setCode("YWZD");
+				businessBillNo.setBranchId(branchId);
 				R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 				if (!clientBillNo.isSuccess()) {
 					TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

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

@@ -236,6 +236,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					throw new RuntimeException("模版数据错误,请联系管理员");
 				}
 				FeeCenter feeCenter = new FeeCenter();
+				feeCenter.setBranchId(bills.getBranchId());
+				feeCenter.setBranchName(bills.getBranchName());
 				feeCenter.setPid(bills.getId());
 				feeCenter.setCntrNo(bills.getQuantityCntrTypesDescr());
 				feeCenter.setBillNo(bills.getBillNo());
@@ -1218,6 +1220,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 					throw new RuntimeException("模版数据错误,请联系管理员");
 				}
 				FeeCenter feeCenter = new FeeCenter();
+				feeCenter.setBranchId(bills.getBranchId());
+				feeCenter.setBranchName(bills.getBranchName());
 				feeCenter.setPid(bills.getId());
 				feeCenter.setCntrNo(bills.getQuantityCntrTypesDescr());
 				feeCenter.setBillNo(bills.getBillNo());
@@ -1414,6 +1418,13 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 		if (fees == null) {
 			throw new RuntimeException("未查到海运费信息,请先维护基础资料");
 		}
+		BFees feesD = bFeesService.getOne(new LambdaQueryWrapper<BFees>()
+			.eq(BFees::getTenantId, AuthUtil.getTenantId())
+			.eq(BFees::getIsDeleted, 0)
+			.eq(BFees::getCode, "XSJ"));
+		if (feesD == null) {
+			throw new RuntimeException("未查到销售价信息,请先维护基础资料");
+		}
 		List<FeeCenter> list = new ArrayList<>();
 		StringBuilder text = new StringBuilder();
 		for (Bills bills : billsList) {
@@ -1470,76 +1481,43 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 			List<BCurExrate> curExrateList = currencyUtils.obtainRate(date, "1", branchId);
 			int count = 1;
 			for (RouteCostItem items : routeCostItemList) {
-				FeeCenter feeCenter = new FeeCenter();
-				feeCenter.setPid(bills.getId());
-				feeCenter.setCntrNo(bills.getQuantityCntrTypesDescr());
-				feeCenter.setBillNo(bills.getBillNo());
-				feeCenter.setBusinessType(bills.getBusinessType());
-				feeCenter.setBillType(bills.getBillType());
-				feeCenter.setBillDate(bills.getBillDate());
-				feeCenter.setBillCorpId(bills.getCorpId());
-				feeCenter.setBillCorpCnName(bills.getCorpCnName());
-				feeCenter.setBillCorpEnName(bills.getCorpEnName());
-				feeCenter.setBillShortName(bills.getCorpCnName());
-				feeCenter.setLineId(bills.getLineId());
-				feeCenter.setLineCnName(bills.getLineCnName());
-				feeCenter.setLineEnName(bills.getLineEnName());
-				feeCenter.setVesselId(bills.getVesselId());
-				feeCenter.setVesselCnName(bills.getVesselCnName());
-				feeCenter.setVesselEnName(bills.getVesselEnName());
-				feeCenter.setVoyageNo(bills.getVoyageNo());
-				feeCenter.setMblno(bills.getMblno());
-				feeCenter.setHblno(bills.getHblno());
-				feeCenter.setEtd(bills.getEtd());
-				feeCenter.setEta(bills.getEta());
-				feeCenter.setPolId(bills.getPolId());
-				feeCenter.setPolCode(bills.getPolCode());
-				feeCenter.setPolCnName(bills.getPolCnName());
-				feeCenter.setPolEnName(bills.getPolEnName());
-				feeCenter.setPodId(bills.getPodId());
-				feeCenter.setPodCode(bills.getPodCode());
-				feeCenter.setPodCnName(bills.getPodCnName());
-				feeCenter.setPodEnName(bills.getPodEnName());
-				feeCenter.setDc("C");
-				feeCenter.setPaymode(bills.getMpaymode());
-				feeCenter.setSort(count);
-				count++;
-				feeCenter.setCorpId(bills.getCarrierId());
-				feeCenter.setCorpCnName(bills.getCarrierShortName());
-				feeCenter.setCorpEnName(bills.getCarrierEnName());
-				feeCenter.setShortName(bills.getCarrierShortName());
-				feeCenter.setFeeId(fees.getId());
-				feeCenter.setCorpType("船公司");
-				feeCenter.setFeeCode(fees.getCode());
-				feeCenter.setFeeCnName(fees.getCnName());
-				feeCenter.setFeeEnName(fees.getEnName());
-				feeCenter.setUnitNo(items.getBoxType());
-				if (ObjectUtils.isNotNull(bills.getPotId())) {
-					feeCenter.setPrice(items.getOceanFreight().add(items.getOceanFreightTwo()));
-				} else {
-					feeCenter.setPrice(items.getOceanFreight());
-				}
-				feeCenter.setCurCode(items.getCurCode());
-				feeCenter.setExrate(currencyUtils.obtainExrate(feeCenter.getDc(), curExrateList, feeCenter.getCurCode(), "1"));
-				Integer quantity = preContainers.stream().filter(e -> items.getBoxType().equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
-				if (quantity == 0) {
-					continue;
-				}
-				feeCenter.setQuantity(new BigDecimal(quantity + ""));
-				feeCenter.setAmount(feeCenter.getPrice().multiply(feeCenter.getQuantity()));
-				if (ObjectUtils.isNull(feeCenter.getAmount())) {
-					feeCenter.setAmount(new BigDecimal("0"));
-				}
-				if (exrateType.equals(feeCenter.getCurCode())) {
-					feeCenter.setAmountLoc(feeCenter.getAmount());
-				} else {
-					if (new BigDecimal("0").compareTo(feeCenter.getAmount()) != 0) {
-						feeCenter.setAmountLoc(feeCenter.getAmount().multiply(feeCenter.getExrate()));
-					} else {
-						feeCenter.setAmountLoc(new BigDecimal("0"));
+				if ("DD".equals(bills.getBillType())) {
+					FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "船公司", items,
+						curExrateList, preContainers, exrateType, "1");
+					if (feeCenter != null) {
+						list.add(feeCenter);
+						count++;
+					}
+					FeeCenter feeCenterD = this.addFeeCenter(bills, "D", count, feesD, "国内直接客户", items,
+						curExrateList, preContainers, exrateType, "2");
+					if (feeCenterD != null) {
+						list.add(feeCenterD);
+						count++;
+					}
+				} else if ("MM".equals(bills.getBillType())) {
+					FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "船公司", items,
+						curExrateList, preContainers, exrateType, "1");
+					if (feeCenter != null) {
+						list.add(feeCenter);
+						count++;
+					}
+					FeeCenter feeCenterD = this.addFeeCenter(bills, "D", count, feesD, "国内直接客户", items,
+						curExrateList, preContainers, exrateType, "3");
+					if (feeCenterD != null) {
+						list.add(feeCenterD);
+						count++;
+					}
+				} else if ("MH".equals(bills.getBillType())) {
+					FeeCenter feeCenter = this.addFeeCenter(bills, "C", count, fees, "国内直接客户", items,
+						curExrateList, preContainers, exrateType, "4");
+					if (feeCenter != null) {
+						list.add(feeCenter);
+						count++;
 					}
+				} else {
+					throw new RuntimeException("单据类型错误,请联系管理员");
 				}
-				list.add(feeCenter);
+
 			}
 		}
 		if (!list.isEmpty()) {
@@ -1552,4 +1530,126 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 		}
 	}
 
+	private FeeCenter addFeeCenter(Bills bills, String dc, int count, BFees fees, String corpType, RouteCostItem items,
+								   List<BCurExrate> curExrateList, List<PreContainers> preContainers,
+								   String exrateType, String type) {
+		FeeCenter feeCenter = new FeeCenter();
+		feeCenter.setBranchId(bills.getBranchId());
+		feeCenter.setBranchName(bills.getBranchName());
+		feeCenter.setPid(bills.getId());
+		feeCenter.setCntrNo(bills.getQuantityCntrTypesDescr());
+		feeCenter.setBillNo(bills.getBillNo());
+		feeCenter.setBusinessType(bills.getBusinessType());
+		feeCenter.setBillType(bills.getBillType());
+		feeCenter.setBillDate(bills.getBillDate());
+		feeCenter.setBillCorpId(bills.getCorpId());
+		feeCenter.setBillCorpCnName(bills.getCorpCnName());
+		feeCenter.setBillCorpEnName(bills.getCorpEnName());
+		feeCenter.setBillShortName(bills.getCorpCnName());
+		feeCenter.setLineId(bills.getLineId());
+		feeCenter.setLineCnName(bills.getLineCnName());
+		feeCenter.setLineEnName(bills.getLineEnName());
+		feeCenter.setVesselId(bills.getVesselId());
+		feeCenter.setVesselCnName(bills.getVesselCnName());
+		feeCenter.setVesselEnName(bills.getVesselEnName());
+		feeCenter.setVoyageNo(bills.getVoyageNo());
+		feeCenter.setMblno(bills.getMblno());
+		feeCenter.setHblno(bills.getHblno());
+		feeCenter.setEtd(bills.getEtd());
+		feeCenter.setEta(bills.getEta());
+		feeCenter.setPolId(bills.getPolId());
+		feeCenter.setPolCode(bills.getPolCode());
+		feeCenter.setPolCnName(bills.getPolCnName());
+		feeCenter.setPolEnName(bills.getPolEnName());
+		feeCenter.setPodId(bills.getPodId());
+		feeCenter.setPodCode(bills.getPodCode());
+		feeCenter.setPodCnName(bills.getPodCnName());
+		feeCenter.setPodEnName(bills.getPodEnName());
+		feeCenter.setDc(dc);
+		feeCenter.setPaymode(bills.getMpaymode());
+		feeCenter.setSort(count);
+		feeCenter.setFeeId(fees.getId());
+		feeCenter.setCorpType(corpType);
+		feeCenter.setFeeCode(fees.getCode());
+		feeCenter.setFeeCnName(fees.getCnName());
+		feeCenter.setFeeEnName(fees.getEnName());
+		feeCenter.setUnitNo(items.getBoxType());
+		feeCenter.setCurCode(items.getCurCode());
+		feeCenter.setExrate(currencyUtils.obtainExrate(feeCenter.getDc(), curExrateList, feeCenter.getCurCode(), "1"));
+		Integer quantity = preContainers.stream().filter(e -> items.getBoxType().equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
+		if (quantity == 0) {
+			return null;
+		}
+		feeCenter.setQuantity(new BigDecimal(quantity + ""));
+		if ("1".equals(type)) {
+			feeCenter.setCorpId(bills.getCarrierId());
+			feeCenter.setCorpCnName(bills.getCarrierShortName());
+			feeCenter.setCorpEnName(bills.getCarrierEnName());
+			feeCenter.setShortName(bills.getCarrierShortName());
+			if (ObjectUtils.isNotNull(bills.getPotId())) {
+				feeCenter.setPrice(items.getOceanFreight().add(items.getOceanFreightTwo()));
+			} else {
+				feeCenter.setPrice(items.getOceanFreight());
+			}
+		} else if ("2".equals(type)) {
+			feeCenter.setCorpId(bills.getCorpId());
+			feeCenter.setCorpCnName(bills.getCorpCnName());
+			feeCenter.setCorpEnName(bills.getCorpEnName());
+			feeCenter.setShortName(bills.getShortName());
+			if (ObjectUtils.isNotNull(bills.getPotId())) {
+				feeCenter.setPrice(items.getSalesPrice().add(items.getSalesPriceTwo()));
+			} else {
+				feeCenter.setPrice(items.getSalesPrice());
+			}
+		} else if ("3".equals(type)) {
+			BCorps bCorps = bCorpsService.getOne(new LambdaQueryWrapper<BCorps>()
+				.eq(BCorps::getTenantId, AuthUtil.getTenantId())
+				.eq(BCorps::getIsDeleted, 0)
+				.eq(BCorps::getEnName, bills.getBranchName()));
+			if (bCorps == null) {
+				throw new RuntimeException("基础资料未查到往来单位" + bills.getBranchName());
+			}
+			feeCenter.setCorpId(bCorps.getCorpId());
+			feeCenter.setCorpCnName(bCorps.getCnName());
+			feeCenter.setCorpEnName(bCorps.getEnName());
+			feeCenter.setShortName(bCorps.getShortName());
+			if (ObjectUtils.isNotNull(bills.getPotId())) {
+				feeCenter.setPrice(items.getSalesPrice().add(items.getSalesPriceTwo()));
+			} else {
+				feeCenter.setPrice(items.getSalesPrice());
+			}
+		} else if ("4".equals(type)) {
+			BCorps bCorps = bCorpsService.getOne(new LambdaQueryWrapper<BCorps>()
+				.eq(BCorps::getTenantId, AuthUtil.getTenantId())
+				.eq(BCorps::getIsDeleted, 0)
+				.eq(BCorps::getCode, "ZBYF"));
+			if (bCorps == null) {
+				throw new RuntimeException("基础资料未查到编码为‘ZBYF’往来单位");
+			}
+			feeCenter.setCorpId(bCorps.getCorpId());
+			feeCenter.setCorpCnName(bCorps.getCnName());
+			feeCenter.setCorpEnName(bCorps.getEnName());
+			feeCenter.setShortName(bCorps.getShortName());
+			if (ObjectUtils.isNotNull(bills.getPotId())) {
+				feeCenter.setPrice(items.getSalesPrice().add(items.getSalesPriceTwo()));
+			} else {
+				feeCenter.setPrice(items.getSalesPrice());
+			}
+		}
+		feeCenter.setAmount(feeCenter.getPrice().multiply(feeCenter.getQuantity()));
+		if (ObjectUtils.isNull(feeCenter.getAmount())) {
+			feeCenter.setAmount(new BigDecimal("0"));
+		}
+		if (exrateType.equals(feeCenter.getCurCode())) {
+			feeCenter.setAmountLoc(feeCenter.getAmount());
+		} else {
+			if (new BigDecimal("0").compareTo(feeCenter.getAmount()) != 0) {
+				feeCenter.setAmountLoc(feeCenter.getAmount().multiply(feeCenter.getExrate()));
+			} else {
+				feeCenter.setAmountLoc(new BigDecimal("0"));
+			}
+		}
+		return feeCenter;
+	}
+
 }

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

@@ -188,6 +188,7 @@ public class FinAccBillsServiceImpl extends ServiceImpl<FinAccBillsMapper, FinAc
 			BusinessBillNo businessBillNo = new BusinessBillNo();
 			businessBillNo.setBusinessTypeId(businessType.getId());
 			businessBillNo.setCode(finAccBills.getBillNoFormat());
+			businessBillNo.setBranchId(branchId);
 			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 			if (!clientBillNo.isSuccess()) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/impl/FinInvoicesServiceImpl.java

@@ -121,6 +121,7 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 			BusinessBillNo businessBillNo = new BusinessBillNo();
 			businessBillNo.setBusinessTypeId(businessType.getId());
 			businessBillNo.setCode(finInvoices.getBillNoFormat());
+			businessBillNo.setBranchId(branchId);
 			R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 			if (!clientBillNo.isSuccess()) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

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

@@ -188,6 +188,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 			BusinessBillNo businessBillNo = new BusinessBillNo();
 			businessBillNo.setBusinessTypeId(businessType.getId());
 			businessBillNo.setCode(finStlBills.getBillNoFormat());
+			businessBillNo.setBranchId(branchId);
 			R<String> clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
 			if (!clientBillNo.isSuccess()) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

+ 80 - 36
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -10,7 +10,6 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
-import org.springblade.los.Util.IDeptUtils;
 import org.springblade.los.basic.cur.entity.BCurrency;
 import org.springblade.los.basic.cur.service.IBCurrencyService;
 import org.springblade.los.box.entity.TradingBox;
@@ -35,8 +34,6 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.math.MathContext;
 import java.math.RoundingMode;
-import java.text.DateFormat;
-import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -64,6 +61,10 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 
 	@Override
 	public R<IPage<DecisionAnalysis>> decisionAnalysis(DecisionAnalysis decisionAnalysis, IPage<DecisionAnalysis> page) {
+		decisionAnalysis.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			decisionAnalysis.setBranchId(AuthUtil.getDeptId());
+		}
 		return R.data(page.setRecords(billsMapper.decisionAnalysis(decisionAnalysis, page)));
 	}
 
@@ -239,9 +240,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			lambdaQueryWrapper.eq(Bills::getBranchId, AuthUtil.getDeptId());
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
-				lambdaQueryWrapper.and(i-> i.eq(AuthUtil.getUserRole().contains("业务员"),Bills::getSrcId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("操作员"),Bills::getOperatorId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("客服"),Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+				lambdaQueryWrapper.and(i -> i.eq(AuthUtil.getUserRole().contains("业务员"), Bills::getSrcId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("操作员"), Bills::getOperatorId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("客服"), Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				/*if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
@@ -264,9 +265,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			lambdaQueryWrapperSI.eq(Bills::getBranchId, AuthUtil.getDeptId());
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
-				lambdaQueryWrapper.and(i-> i.eq(AuthUtil.getUserRole().contains("业务员"),Bills::getSrcId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("操作员"),Bills::getOperatorId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("客服"),Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+				lambdaQueryWrapper.and(i -> i.eq(AuthUtil.getUserRole().contains("业务员"), Bills::getSrcId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("操作员"), Bills::getOperatorId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("客服"), Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				/*if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapperSI.eq(Bills::getSrcId, AuthUtil.getUserId());
@@ -320,9 +321,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			lambdaQueryWrapper.eq(Bills::getBranchId, AuthUtil.getDeptId());
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
-				lambdaQueryWrapper.and(i-> i.eq(AuthUtil.getUserRole().contains("业务员"),Bills::getSrcId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("操作员"),Bills::getOperatorId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("客服"),Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+				lambdaQueryWrapper.and(i -> i.eq(AuthUtil.getUserRole().contains("业务员"), Bills::getSrcId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("操作员"), Bills::getOperatorId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("客服"), Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				/*if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapper.eq(Bills::getSrcId, AuthUtil.getUserId());
@@ -346,9 +347,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			lambdaQueryWrapperSI.eq(Bills::getBranchId, AuthUtil.getDeptId());
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
-				lambdaQueryWrapper.and(i-> i.eq(AuthUtil.getUserRole().contains("业务员"),Bills::getSrcId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("操作员"),Bills::getOperatorId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("客服"),Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+				lambdaQueryWrapper.and(i -> i.eq(AuthUtil.getUserRole().contains("业务员"), Bills::getSrcId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("操作员"), Bills::getOperatorId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("客服"), Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				/*if (AuthUtil.getUserRole().contains("业务员")) {
 					lambdaQueryWrapperSI.eq(Bills::getSrcId, AuthUtil.getUserId());
@@ -373,9 +374,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			amendsLambdaQueryWrapper.eq(Amends::getBranchId, AuthUtil.getDeptId());
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
-				lambdaQueryWrapper.and(i-> i.eq(AuthUtil.getUserRole().contains("业务员"),Bills::getSrcId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("操作员"),Bills::getOperatorId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("客服"),Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+				lambdaQueryWrapper.and(i -> i.eq(AuthUtil.getUserRole().contains("业务员"), Bills::getSrcId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("操作员"), Bills::getOperatorId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("客服"), Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				/*if (AuthUtil.getUserRole().contains("业务员")) {
 					amendsLambdaQueryWrapper.eq(Amends::getSrcId, AuthUtil.getUserId());
@@ -399,9 +400,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 			amendsLambdaQueryWrapper.eq(Amends::getBranchId, AuthUtil.getDeptId());
 			if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
-				lambdaQueryWrapper.and(i-> i.eq(AuthUtil.getUserRole().contains("业务员"),Bills::getSrcId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("操作员"),Bills::getOperatorId, AuthUtil.getUserId()).or()
-					.eq(AuthUtil.getUserRole().contains("客服"),Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+				lambdaQueryWrapper.and(i -> i.eq(AuthUtil.getUserRole().contains("业务员"), Bills::getSrcId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("操作员"), Bills::getOperatorId, AuthUtil.getUserId()).or()
+					.eq(AuthUtil.getUserRole().contains("客服"), Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
 					.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 				/*if (AuthUtil.getUserRole().contains("业务员")) {
 					amendsLambdaQueryWrapper.eq(Amends::getSrcId, AuthUtil.getUserId());
@@ -439,9 +440,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 				lambdaQueryWrapperSE.eq(Bills::getBranchId, AuthUtil.getDeptId());
 				if (!AuthUtil.getUserRole().contains("secondaryAdmin")) {
-					lambdaQueryWrapperSE.and(i-> i.eq(AuthUtil.getUserRole().contains("业务员"),Bills::getSrcId, AuthUtil.getUserId()).or()
-						.eq(AuthUtil.getUserRole().contains("操作员"),Bills::getOperatorId, AuthUtil.getUserId()).or()
-						.eq(AuthUtil.getUserRole().contains("客服"),Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
+					lambdaQueryWrapperSE.and(i -> i.eq(AuthUtil.getUserRole().contains("业务员"), Bills::getSrcId, AuthUtil.getUserId()).or()
+						.eq(AuthUtil.getUserRole().contains("操作员"), Bills::getOperatorId, AuthUtil.getUserId()).or()
+						.eq(AuthUtil.getUserRole().contains("客服"), Bills::getCustomerServiceId, AuthUtil.getUserId()).or()
 						.eq(Bills::getCreateUser, AuthUtil.getUserId()));
 					/*if (AuthUtil.getUserRole().contains("业务员")) {
 						lambdaQueryWrapperSE.eq(Bills::getSrcId, AuthUtil.getUserId());
@@ -525,41 +526,73 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 
 	@Override
 	public R<IPage<FeeSummaryRD>> feeSummary(FeeSummaryQ feeSummaryQ, IPage<FeeSummaryRD> page) {
+		feeSummaryQ.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			feeSummaryQ.setBranchId(AuthUtil.getDeptId());
+		}
 		return R.data(page.setRecords(finAccBillsMapper.feeSummary(page, feeSummaryQ)));
 	}
 
 	@Override
 	public List<FeeSummaryRD> feeSummaryExport(FeeSummaryQ feeSummaryQ) {
+		feeSummaryQ.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			feeSummaryQ.setBranchId(AuthUtil.getDeptId());
+		}
 		return finAccBillsMapper.feeSummaryExport(feeSummaryQ);
 	}
 
 	@Override
 	public R<IPage<FeeSummaryDetailRD>> feeSummaryDetail(FeeSummaryQ feeSummaryQ, IPage<FeeSummaryDetailRD> page) {
+		feeSummaryQ.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			feeSummaryQ.setBranchId(AuthUtil.getDeptId());
+		}
 		return R.data(page.setRecords(finAccBillsMapper.feeSummaryDetail(page, feeSummaryQ)));
 	}
 
 	@Override
 	public List<FeeSummaryDetailRD> feeSummaryDetailExport(FeeSummaryQ feeSummaryQ) {
+		feeSummaryQ.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			feeSummaryQ.setBranchId(AuthUtil.getDeptId());
+		}
 		return finAccBillsMapper.feeSummaryDetailExport(feeSummaryQ);
 	}
 
 	@Override
 	public R<IPage<FeeSummaryDetailNotRD>> feeSummaryDetailNot(FeeSummaryQ feeSummaryQ, IPage<FeeSummaryDetailNotRD> page) {
+		feeSummaryQ.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			feeSummaryQ.setBranchId(AuthUtil.getDeptId());
+		}
 		return R.data(page.setRecords(finAccBillsMapper.feeSummaryDetailNot(page, feeSummaryQ)));
 	}
 
 	@Override
 	public List<FeeSummaryDetailNotRD> feeSummaryDetailExportNot(FeeSummaryQ feeSummaryQ) {
+		feeSummaryQ.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			feeSummaryQ.setBranchId(AuthUtil.getDeptId());
+		}
 		return finAccBillsMapper.feeSummaryDetailExportNot(feeSummaryQ);
 	}
 
 	@Override
 	public R<IPage<AgingAnalysisRD>> agingAnalysis(FeeSummaryQ feeSummaryQ, IPage<AgingAnalysisRD> page) {
+		feeSummaryQ.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			feeSummaryQ.setBranchId(AuthUtil.getDeptId());
+		}
 		return R.data(page.setRecords(finAccBillsMapper.agingAnalysis(page, feeSummaryQ)));
 	}
 
 	@Override
 	public List<AgingAnalysisRD> agingAnalysisExport(FeeSummaryQ feeSummaryQ) {
+		feeSummaryQ.setTenantId(AuthUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			feeSummaryQ.setBranchId(AuthUtil.getDeptId());
+		}
 		return finAccBillsMapper.agingAnalysisExport(feeSummaryQ);
 	}
 
@@ -1281,7 +1314,7 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 
 	@Override
 	public R<IPage<FeeSettlementExcel>> feeSettlementStatistics(FeeSettlementExcel feeSettlementExcel, Query query) {
-		IPage<FeeCenter> feeCenterList = feeCenterMapper.selectPage(Condition.getPage(query), new LambdaQueryWrapper<FeeCenter>()
+		LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 			.eq(FeeCenter::getIsDeleted, 0)
 			.eq(ObjectUtils.isNotNull(feeSettlementExcel.getDc()), FeeCenter::getDc, feeSettlementExcel.getDc())
@@ -1293,8 +1326,14 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.like(ObjectUtils.isNotNull(feeSettlementExcel.getMblno()), FeeCenter::getMblno, feeSettlementExcel.getMblno())
 			.like(ObjectUtils.isNotNull(feeSettlementExcel.getSrcNo()), FeeCenter::getMblno, feeSettlementExcel.getSrcNo())
 			.ge(ObjectUtils.isNotNull(feeSettlementExcel.getStartDate()), FeeCenter::getBillDate, feeSettlementExcel.getStartDate())
-			.le(ObjectUtils.isNotNull(feeSettlementExcel.getEndDate()), FeeCenter::getBillDate, feeSettlementExcel.getEndDate())
-		);
+			.le(ObjectUtils.isNotNull(feeSettlementExcel.getEndDate()), FeeCenter::getBillDate, feeSettlementExcel.getEndDate());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			lambdaQueryWrapper.eq(FeeCenter::getBranchId, AuthUtil.getDeptId());
+		} else {
+			lambdaQueryWrapper.eq(ObjectUtils.isNotNull(feeSettlementExcel.getBranchId()), FeeCenter::getBranchId, feeSettlementExcel.getBranchId());
+		}
+		IPage<FeeCenter> feeCenterList = feeCenterMapper.selectPage(Condition.getPage(query), lambdaQueryWrapper);
+
 		List<FeeSettlementExcel> feeSettlementExcelList = new ArrayList<>();
 		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 		for (FeeCenter item : feeCenterList.getRecords()) {
@@ -1349,7 +1388,7 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 
 	@Override
 	public List<FeeSettlementExcel> feeSettlementList(FeeSettlementExcel feeSettlementExcel) {
-		List<FeeCenter> feeCenterList = feeCenterMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
+		LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 			.eq(FeeCenter::getIsDeleted, 0)
 			.eq(ObjectUtils.isNotNull(feeSettlementExcel.getDc()), FeeCenter::getDc, feeSettlementExcel.getDc())
@@ -1361,8 +1400,13 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			.like(ObjectUtils.isNotNull(feeSettlementExcel.getMblno()), FeeCenter::getMblno, feeSettlementExcel.getMblno())
 			.like(ObjectUtils.isNotNull(feeSettlementExcel.getSrcNo()), FeeCenter::getMblno, feeSettlementExcel.getSrcNo())
 			.ge(ObjectUtils.isNotNull(feeSettlementExcel.getStartDate()), FeeCenter::getBillDate, feeSettlementExcel.getStartDate())
-			.le(ObjectUtils.isNotNull(feeSettlementExcel.getEndDate()), FeeCenter::getBillDate, feeSettlementExcel.getEndDate())
-		);
+			.le(ObjectUtils.isNotNull(feeSettlementExcel.getEndDate()), FeeCenter::getBillDate, feeSettlementExcel.getEndDate());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			lambdaQueryWrapper.eq(FeeCenter::getBranchId, AuthUtil.getDeptId());
+		} else {
+			lambdaQueryWrapper.eq(ObjectUtils.isNotNull(feeSettlementExcel.getBranchId()), FeeCenter::getBranchId, feeSettlementExcel.getBranchId());
+		}
+		List<FeeCenter> feeCenterList = feeCenterMapper.selectList(lambdaQueryWrapper);
 		List<FeeSettlementExcel> feeSettlementExcelList = new ArrayList<>();
 		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 		for (FeeCenter item : feeCenterList) {
@@ -1496,7 +1540,7 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 	public R<IPage<Bills>> arrivalReminderList(Bills bills, Query query) {
 		int day = 5;
 		Date date = new Date();
-		if("1".equals(bills.getType())){
+		if ("1".equals(bills.getType())) {
 			String arrivalReminderDay = sysClient.getParamService("arrival.reminder");
 			if (ObjectUtils.isNotNull(arrivalReminderDay) && !"获取数据失败".equals(arrivalReminderDay)) {
 				day = Integer.parseInt(arrivalReminderDay);
@@ -1517,7 +1561,7 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 				.apply("DATE_FORMAT(etd,'%Y-%m-%d') > '" + sdf.format(date1) + "' and DATE_FORMAT(etd,'%Y-%m-%d') <= '" + sdf.format(date) + "'");
 			IPage<Bills> billsIPage = billsMapper.selectPage(Condition.getPage(query), lambdaQueryWrapper);
 			return R.data(billsIPage);
-		}else if("2".equals(bills.getType())){
+		} else if ("2".equals(bills.getType())) {
 			String arrivalReminderDay = sysClient.getParamService("sail.reminder");
 			if (ObjectUtils.isNotNull(arrivalReminderDay) && !"获取数据失败".equals(arrivalReminderDay)) {
 				day = Integer.parseInt(arrivalReminderDay);
@@ -1538,7 +1582,7 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 				.apply("DATE_FORMAT(eta,'%Y-%m-%d') > '" + sdf.format(date1) + "' and DATE_FORMAT(eta,'%Y-%m-%d') <= '" + sdf.format(date) + "'");
 			IPage<Bills> billsIPage = billsMapper.selectPage(Condition.getPage(query), lambdaQueryWrapper);
 			return R.data(billsIPage);
-		}else if("3".equals(bills.getType())){
+		} else if ("3".equals(bills.getType())) {
 			String arrivalReminderDay = sysClient.getParamService("cut.off.port.reminder");
 			if (ObjectUtils.isNotNull(arrivalReminderDay) && !"获取数据失败".equals(arrivalReminderDay)) {
 				day = Integer.parseInt(arrivalReminderDay);
@@ -1559,7 +1603,7 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 				.apply("DATE_FORMAT(cy_return_time,'%Y-%m-%d') > '" + sdf.format(date1) + "' and DATE_FORMAT(cy_return_time,'%Y-%m-%d') <= '" + sdf.format(date) + "'");
 			IPage<Bills> billsIPage = billsMapper.selectPage(Condition.getPage(query), lambdaQueryWrapper);
 			return R.data(billsIPage);
-		}else if("4".equals(bills.getType())){
+		} else if ("4".equals(bills.getType())) {
 			String arrivalReminderDay = sysClient.getParamService("cut.single.reminder");
 			if (ObjectUtils.isNotNull(arrivalReminderDay) && !"获取数据失败".equals(arrivalReminderDay)) {
 				day = Integer.parseInt(arrivalReminderDay);
@@ -1580,7 +1624,7 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 				.apply("DATE_FORMAT(cy_trailer_time,'%Y-%m-%d') > '" + sdf.format(date1) + "' and DATE_FORMAT(cy_trailer_time,'%Y-%m-%d') <= '" + sdf.format(date) + "'");
 			IPage<Bills> billsIPage = billsMapper.selectPage(Condition.getPage(query), lambdaQueryWrapper);
 			return R.data(billsIPage);
-		}else if("5".equals(bills.getType())){
+		} else if ("5".equals(bills.getType())) {
 			String arrivalReminderDay = sysClient.getParamService("sail.unpaid.reminder");
 			if (ObjectUtils.isNotNull(arrivalReminderDay) && !"获取数据失败".equals(arrivalReminderDay)) {
 				day = Integer.parseInt(arrivalReminderDay);
@@ -1602,7 +1646,7 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 				.apply("DATE_FORMAT(actual_etd,'%Y-%m-%d') > '" + sdf.format(date1) + "' and DATE_FORMAT(actual_etd,'%Y-%m-%d') <= '" + sdf.format(date) + "'");
 			IPage<Bills> billsIPage = billsMapper.selectPage(Condition.getPage(query), lambdaQueryWrapper);
 			return R.data(billsIPage);
-		}else{
+		} else {
 			return R.data(null);
 		}
 	}

+ 1 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml

@@ -26,6 +26,7 @@
         <result column="dept_id" property="deptId"/>
         <result column="post_id" property="postId"/>
         <result column="working_status" property="workingStatus"/>
+        <result column="email_authorization" property="emailAuthorization"/>
     </resultMap>
     <update id="updateByIdPointsBalance" parameterType="org.springblade.system.user.entity.User">
         update blade_user

+ 10 - 0
pom.xml

@@ -213,6 +213,16 @@
 
     <repositories>
         <repository>
+            <id>echepei-release</id>
+            <url>http://nexus.echepei.com:9111/repository/echepei-central/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </repository>
+        <repository>
             <id>aliyun-repos</id>
             <url>https://maven.aliyun.com/nexus/content/groups/public/</url>
             <snapshots>