Преглед изворни кода

1.审核增加客户中文字段
2.箱轨迹列表排序修改
3.增加pod免箱使申请接口
4.增加pod免箱使申请审核通过逻辑
5.计算超期箱使费逻辑修改
6.查询符合拆分箱号信息单据接口去掉pod检索条件
7.客户增加业务最后一次业务日期和类型字段
8.海运进出口保存更新客户后一次业务日期和类型字段
9.无货返空撤销bug修改
10.app-teu,票数,航线统计接口bug修改
11.app-未走货分析列表接口修改
12.增加pod免箱使申请报表接口
13.箱池动态统计bug修改

纪新园 пре 1 недеља
родитељ
комит
5f77727ffe
36 измењених фајлова са 1641 додато и 186 уклоњено
  1. 12 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/corps/entity/BCorps.java
  2. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/dto/SeaFeedayDTO.java
  3. 5 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  4. 190 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/SeaFeeday.java
  5. 54 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/vo/SeaFeedayVO.java
  6. 5 6
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/check/entity/LosAuditProecess.java
  7. 0 3
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/check/vo/LosAuditOrderVO.java
  8. 5 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/dto/FeeCenterReports.java
  9. 17 5
      blade-service/blade-los/src/main/java/org/springblade/los/Util/BillUtils.java
  10. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/Util/MagicValues.java
  11. 5 7
      blade-service/blade-los/src/main/java/org/springblade/los/Util/OwBoxUsageFeeUtils.java
  12. 35 0
      blade-service/blade-los/src/main/java/org/springblade/los/Util/UpdateCorpsUtils.java
  13. 11 50
      blade-service/blade-los/src/main/java/org/springblade/los/basic/corps/mapper/CorpsMapper.xml
  14. 79 23
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java
  15. 7 2
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/ArchivesTrajectoryController.java
  16. 69 48
      blade-service/blade-los/src/main/java/org/springblade/los/box/dynamics/service/impl/BoxDynamicsRecordServiceImpl.java
  17. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/PutBoxMapper.xml
  18. 12 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java
  19. 0 1
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java
  20. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java
  21. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java
  22. 136 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/SeaFeedayController.java
  23. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/SeaFeedayMapper.java
  24. 43 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/SeaFeedayMapper.xml
  25. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/ISeaFeedayService.java
  26. 42 5
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  27. 174 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/SeaFeedayServiceImpl.java
  28. 1 16
      blade-service/blade-los/src/main/java/org/springblade/los/check/controller/AuditProecessController.java
  29. 556 0
      blade-service/blade-los/src/main/java/org/springblade/los/check/service/impl/AuditProecessServiceImpl.java
  30. 32 2
      blade-service/blade-los/src/main/java/org/springblade/los/excel/DeliveryPaperExcel.java
  31. 0 4
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java
  32. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FinAccBillsServiceImpl.java
  33. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/stl/service/impl/FinStlBillsServiceImpl.java
  34. 18 9
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java
  35. 5 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java
  36. 1 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/SettlementServiceImpl.java

+ 12 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/corps/entity/BCorps.java

@@ -610,6 +610,18 @@ public class BCorps implements Serializable {
 	private String bookingAgentEnName;
 
 	/**
+	 * 业务类型, SE=海运出口 SI=海运进口
+	 */
+	@ApiModelProperty(value = "业务类型")
+	private String businessType;
+
+	/**
+	 * 业务最后一次修改日期
+	 */
+	@ApiModelProperty(value = "业务最后一次修改日期")
+	private Date businessDate;
+
+	/**
 	 * 客户更改授信等级记录
 	 */
 	@TableField(exist = false)

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/dto/SeaFeedayDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.sea.dto;
+
+import org.springblade.los.business.sea.entity.SeaFeeday;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * pol/pod免箱使天数申请表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2026-04-22
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class SeaFeedayDTO extends SeaFeeday {
+	private static final long serialVersionUID = 1L;
+
+}

+ 5 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java

@@ -18,7 +18,6 @@ package org.springblade.los.business.sea.entity;
 
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
@@ -2862,5 +2861,10 @@ public class Bills implements Serializable {
 	 */
 	@TableField(exist = false)
 	private String permission;
+	/**
+	 * pod免箱使天数申请记录
+	 */
+	@TableField(exist = false)
+	private SeaFeeday seaFeeday;
 
 }

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

@@ -0,0 +1,190 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.sea.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * pol/pod免箱使天数申请表实体类
+ *
+ * @author BladeX
+ * @since 2026-04-22
+ */
+@Data
+@TableName("los_sea_feeday")
+@ApiModel(value = "SeaFeeday对象", description = "pol/pod免箱使天数申请表")
+public class SeaFeeday implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 分公司 Id
+	 */
+	@ApiModelProperty(value = "分公司 Id")
+	private String branchId;
+	/**
+	 * 分公司
+	 */
+	@ApiModelProperty(value = "分公司")
+	private String branchName;
+	/**
+	 * 创建人 Id
+	 */
+	@ApiModelProperty(value = "创建人 Id")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人 Id
+	 */
+	@ApiModelProperty(value = "修改人 Id")
+	private Long updateUser;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 主表 id
+	 */
+	@ApiModelProperty(value = "主表 id")
+	private Long pid;
+	/**
+	 * 客户 id
+	 */
+	@ApiModelProperty(value = "客户 id")
+	private Long corpId;
+	/**
+	 * 客户简称
+	 */
+	@ApiModelProperty(value = "客户简称")
+	private String shortName;
+	/**
+	 * 客户中文名称
+	 */
+	@ApiModelProperty(value = "客户中文名称")
+	private String corpCnName;
+	/**
+	 * 客户英文名称
+	 */
+	@ApiModelProperty(value = "客户英文名称")
+	private String corpEnName;
+	/**
+	 * MB/L NO
+	 */
+	@ApiModelProperty(value = "MB/L NO")
+	private String mblno;
+	/**
+	 * HB/L NO
+	 */
+	@ApiModelProperty(value = "HB/L NO")
+	private String hblno;
+	/**
+	 * 免箱使天数
+	 */
+	@ApiModelProperty(value = "免箱使天数")
+	private Integer freeBoxUseDays;
+	/**
+	 * 申请天数
+	 */
+	@ApiModelProperty(value = "申请天数")
+	private Integer applyDays;
+	/**
+	 * 申请金额
+	 */
+	@ApiModelProperty(value = "申请金额")
+	private BigDecimal applyAmount;
+	/**
+	 * 币别
+	 */
+	@ApiModelProperty(value = "币别")
+	private String curCode;
+	/**
+	 * 申请类型  pol  pod
+	 */
+	@ApiModelProperty(value = "申请类型  pol  pod")
+	private String type;
+	/**
+	 * 申请状态
+	 */
+	@ApiModelProperty(value = "申请状态")
+	private String status;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+	/**
+	 * 汇率
+	 */
+	@ApiModelProperty(value = "汇率")
+	private BigDecimal exrate;
+	/**
+	 * 开船日期
+	 */
+	@ApiModelProperty(value = "开船日期")
+	private Date etd;
+	/**
+	 * 到港日期
+	 */
+	@ApiModelProperty(value = "到港日期")
+	private Date eta;
+	/**
+	 * 实际开船日期
+	 */
+	@ApiModelProperty(value = "实际开船日期")
+	private Date actualEtd;
+	/**
+	 * 实际到港日期
+	 */
+	@ApiModelProperty(value = "实际到港日期")
+	private Date actualEta;
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+
+
+}

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

@@ -0,0 +1,54 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.sea.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import org.springblade.los.business.sea.entity.SeaFeeday;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import org.springblade.system.entity.Dept;
+
+/**
+ * pol/pod免箱使天数申请表视图实体类
+ *
+ * @author BladeX
+ * @since 2026-04-22
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "SeaFeedayVO对象", description = "pol/pod免箱使天数申请表")
+public class SeaFeedayVO extends SeaFeeday {
+	private static final long serialVersionUID = 1L;
+
+	//海运单据id
+	private Long billId;
+	//跳转对应页面的路由
+	@TableField(exist = false)
+	private String url;
+	//页面枚举
+	@TableField(exist = false)
+	private String pageStatus;
+	//页面名字
+	@TableField(exist = false)
+	private String pageLabel;
+
+
+	private Dept dept;
+
+
+}

+ 5 - 6
blade-service-api/blade-los-api/src/main/java/org/springblade/los/check/entity/LosAuditProecess.java

@@ -185,6 +185,11 @@ public class LosAuditProecess implements Serializable {
 
 	private Long corpId;
 
+	/**
+	 * 客户名称
+	 */
+	private String corpsName;
+
 	@TableField(exist = false)
 	@DateTimeFormat(pattern = "yyyy-MM-dd:ss")
 	private Date applybegintime;
@@ -206,12 +211,6 @@ public class LosAuditProecess implements Serializable {
 	private String orderNo;
 
 	/**
-	 * 客户名称
-	 */
-	@TableField(exist = false)
-	private String corpsName;
-
-	/**
 	 * 请核人真实姓名
 	 */
 	@TableField(exist = false)

+ 0 - 3
blade-service-api/blade-los-api/src/main/java/org/springblade/los/check/vo/LosAuditOrderVO.java

@@ -17,9 +17,6 @@ public class LosAuditOrderVO extends LosAuditProecess {
 	@ApiModelProperty(value = "订单号")
 	private String orderNo;
 
-	@ApiModelProperty(value = "供应商名称")
-	private String corpsName;
-
 	@ApiModelProperty(value = "订单日期")
 	private Date orderDate;
 

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

@@ -226,5 +226,10 @@ public class FeeCenterReports implements Serializable {
 	 */
 	private Date createTime;
 
+	/**
+	 * 排序
+	 */
+	private Integer sort;
+
 
 }

+ 17 - 5
blade-service/blade-los/src/main/java/org/springblade/los/Util/BillUtils.java

@@ -1143,6 +1143,11 @@ public class BillUtils implements IBillUtils {
 				excel.setQuantityCntrDescr(bills1.getQuantityCntrDescr());
 				excel.setPodEnName(bills1.getPodEnName());
 				excel.setMblno(bills1.getMblno());
+				excel.setEtd(bills1.getEtd());
+				excel.setVoyageNo(bills1.getVoyageNo());
+				excel.setInboundContainerOwner(bills1.getCarrierEnName());
+				excel.setPotEnName(bills1.getPotEnName());
+				excel.setGrossWeight(bills1.getGrossWeight());
 			}
 			SeaContainerNumberItem containerNumberItems = containerNumberItemList.stream().filter(e ->
 					item.getCntrTypeCode().equals(e.getBoxType()) && 0 != e.getOccupyNum() && e.getPid().equals(item.getPid()))
@@ -1151,6 +1156,7 @@ public class BillUtils implements IBillUtils {
 				excel.setContainerNumber(containerNumberItems.getContainerNumber());
 				excel.setStationCname(containerNumberItems.getPolStationCname());
 			}
+			excel.setBoxOwner("WFL");
 			excel.setRemarks("");
 			excelList.add(excel);
 		}
@@ -1297,14 +1303,16 @@ public class BillUtils implements IBillUtils {
 					.apply("DATE_FORMAT(effective_end_date,'%Y-%m-%d') >= '" + formatter.format(bills.getEtd()) + "'")
 				);
 				if (costList.isEmpty()) {
-					throw new RuntimeException("请先维护成本!");
+					throw new RuntimeException("系统检测到" + bills.getEtd() + " " + bills.getCarrierCnName() + " " + bills.getPolEnName() +
+						"->" + bills.getPodEnName() + "没有指导价 请联系成本中心!!!");
 				}
 				List<RouteCostItem> costItemList = routeCostItemService.list(new LambdaQueryWrapper<RouteCostItem>()
 					.eq(RouteCostItem::getIsDeleted, 0)
 					.eq(RouteCostItem::getTenantId, AuthUtil.getTenantId())
 					.in(RouteCostItem::getPid, costList.stream().map(RouteCost::getId).collect(Collectors.toList())));
 				if (costItemList.isEmpty()) {
-					throw new RuntimeException("请先维护成本!");
+					throw new RuntimeException("系统检测到" + bills.getEtd() + " " + bills.getCarrierCnName() + " " + bills.getPolEnName() +
+						"->" + bills.getPodEnName() + "没有指导价 请联系成本中心!!!");
 				}
 				List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
 					.eq(PreContainers::getIsDeleted, 0)
@@ -1318,7 +1326,7 @@ public class BillUtils implements IBillUtils {
 					.eq(FeeCenter::getFeeCode, "HYF")
 					.eq(FeeCenter::getPid, bills.getId()));
 				if (feeCenterList.isEmpty()) {
-					throw new RuntimeException("未查到应收海运费");
+					throw new RuntimeException("未录入应收海运费请维护");
 				}
 				String boxBusinessConnectionTime = sysClient.getParamService("box.business.connection.time");
 				Date date = null;
@@ -1338,9 +1346,13 @@ public class BillUtils implements IBillUtils {
 						List<RouteCostItem> minCostItem = costItemList.stream().filter(e -> containers.getCntrTypeCode().equals(e.getBoxType()))
 							.sorted(Comparator.comparing(RouteCostItem::getSalesPrice))
 							.collect(Collectors.toList());
+						if (minCostItem.isEmpty()) {
+							throw new RuntimeException("系统检测到" + bills.getEtd() + " " + bills.getCarrierCnName() + " " + bills.getPolEnName() +
+								"->" + bills.getPodEnName() + "箱型" + containers.getCntrTypeCode() + "没有指导价 请联系成本中心!!!");
+						}
 						if (price.compareTo(minCostItem.get(0).getSalesPrice()) < 0) {
-							text.append("提单号:").append(bills.getHblno()).append("箱型:").append(containers.getCntrTypeCode()).append("应收海运费:" + price + "小于成本中心海运费:" + minCostItem.get(0).getSalesPrice() + "!");
-							messageBody.append("提单号:").append(bills.getHblno()).append("应收海运费:").append(price).append("小于成本中心海运费:").append(minCostItem.get(0).getSalesPrice()).append("!");
+							text.append("提单号:").append(bills.getHblno()).append("箱型:").append(containers.getCntrTypeCode()).append("应收海运费:" + price + "小于成本中心海运费指导价:" + minCostItem.get(0).getSalesPrice() + "!");
+							messageBody.append("提单号:").append(bills.getHblno()).append("应收海运费:").append(price).append("小于成本中心海运费指导价:").append(minCostItem.get(0).getSalesPrice()).append("!");
 						}
 					}
 				}

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

@@ -26,6 +26,8 @@ public class MagicValues {
 	public static final String DOCUMENT = "单证";
 	public static final String COST = "费用";
 	public static final String DECISION_ANALYSIS = "决策分析";
+
+	public static final String POD_FEE_DAY = "POD免箱使";
 	public static final String STATISTICS = "统计";
 	public static final String PAYMENT_DETAILS = "收付明细";
 	public static final String NOT_PAYMENT_DETAILS = "未收付明细";

+ 5 - 7
blade-service/blade-los/src/main/java/org/springblade/los/Util/OwBoxUsageFeeUtils.java

@@ -1286,8 +1286,6 @@ public class OwBoxUsageFeeUtils {
 			if (ObjectUtils.isNotNull(bills.getPodFreeBoxUseDays())) {
 				overdueBoxUseDays = bills.getPodFreeBoxUseDays();
 			}
-		} else {
-			overdueBoxUseDays = overdueDays;
 		}
 		//判断是否超期
 		if (overdueDays < overdueBoxUseDays) {
@@ -1302,10 +1300,10 @@ public class OwBoxUsageFeeUtils {
 		}
 		//开始计费-第一档应计费天数
 		int firstTierChargeableFeeDays;
-		if (overdueBoxUseDays < feesItems.getEndDay()) {
-			firstTierChargeableFeeDays = overdueBoxUseDays + 1;
+		if (overdueDays+1 < feesItems.getEndDay()) {
+			firstTierChargeableFeeDays = overdueDays + 1 - overdueBoxUseDays;
 		} else {
-			firstTierChargeableFeeDays = feesItems.getEndDay() - overdueBoxUseDays;
+			firstTierChargeableFeeDays = feesItems.getEndDay()+1 - feesItems.getStartDay();
 		}
 		//计算过程
 		String text;
@@ -1325,7 +1323,7 @@ public class OwBoxUsageFeeUtils {
 			return null;
 		}
 		//剩余计费天数
-		int days = overdueDays - feesItems.getEndDay();
+		int days = overdueDays+1 - feesItems.getEndDay();
 		if (days > 0) {
 			for (StorageFeesItems term : storageFeesItems) {
 				BigDecimal rate;
@@ -1342,7 +1340,7 @@ public class OwBoxUsageFeeUtils {
 				//剩余计费天数需从免箱使天数所在下一档次开始计算
 				if (term.getStartDay() > finalOverdueBoxUseDays) {
 					//本档次需计费天数
-					int dayLength = term.getEndDay() - term.getStartDay() + 1;
+					int dayLength = term.getEndDay() - term.getStartDay() ;
 					//剩余计费天数是否大于本档次计费天数
 					if (days > dayLength) {
 						days -= dayLength;

+ 35 - 0
blade-service/blade-los/src/main/java/org/springblade/los/Util/UpdateCorpsUtils.java

@@ -0,0 +1,35 @@
+package org.springblade.los.Util;
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.los.basic.corps.entity.BCorps;
+import org.springblade.los.basic.corps.service.IBCorpsService;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * @author :jixinyuan
+ * @date : 2026/3/25
+ */
+@Component
+@AllArgsConstructor
+public class UpdateCorpsUtils {
+
+	private final IBCorpsService bCorpsService;
+
+
+	public void updateCorps(Long corpId, String businessType, Date businessDate) {
+		if ("SE,SI".contains(businessType)) {
+			BCorps corps = bCorpsService.getById(corpId);
+			if (corps != null) {
+				corps.setUpdateTime(new Date());
+				corps.setUpdateUser(AuthUtil.getUserId());
+				corps.setUpdateUserName(AuthUtil.getUserName());
+				corps.setBusinessDate(businessDate);
+				corps.setBusinessType(businessType);
+				bCorpsService.updateById(corps);
+			}
+		}
+	}
+}

+ 11 - 50
blade-service/blade-los/src/main/java/org/springblade/los/basic/corps/mapper/CorpsMapper.xml

@@ -105,77 +105,38 @@
             resultType="org.springblade.los.statisticAnalysis.UnshippedGoodsAnalysis">
         SELECT
         corp.cn_name as corpName,
-        (CASE last_sea.bill_status
-        WHEN  '0' THEN '接单'
-        WHEN  '1' THEN '退舱'
-        WHEN  '3' THEN '已完成'
-        ELSE '进行中' END) as businessStatus,
-        last_sea.bill_date as businessDate,
-        (CASE last_sea.business_type
+        corp.business_date as businessDate,
+        (CASE corp.business_type
         WHEN  'SE' THEN '海运出口'
         WHEN  'SI' THEN '海运进口'
         ELSE '其他' END) as businessType
         FROM
         los_b_corps corp
-        LEFT JOIN (
-        SELECT
-        sb.corp_id,
-        (CASE sb.business_type
-        WHEN  'SE' THEN sb.actual_etd
-        WHEN  'SI' THEN sb.actual_eta
-        ELSE sb.bill_date END) as bill_date,
-        sb.bill_status as bill_status,
-        sb.business_type as business_type
-        FROM
-        los_sea_bills sb
-        INNER JOIN (
-        SELECT
-        corp_id,
-        (CASE business_type
-        WHEN  'SE' THEN MAX(actual_etd)
-        WHEN  'SI' THEN MAX(actual_eta)
-        ELSE MAX(bill_date) END)
-        as max_etd
-        FROM
-        los_sea_bills
-        WHERE
-        is_deleted = '0'
-        AND tenant_id = #{data.tenantId}
-        <if test="data.businessType != null and data.businessType != ''">
-            and business_type = #{data.businessType}
-        </if>
-        GROUP BY
-        corp_id
-        ) latest ON sb.corp_id = latest.corp_id AND sb.etd = latest.max_etd
-        WHERE
-        sb.is_deleted = '0'
-        AND sb.tenant_id = #{data.tenantId}
-        <if test="data.businessType != null and data.businessType != ''">
-            and sb.business_type = #{data.businessType}
-        </if>
-        ) last_sea ON corp.id = last_sea.corp_id
         WHERE
         corp.is_deleted = '0'
         AND corp.tenant_id = #{data.tenantId}
         <if test="data.corpName != null and data.corpName != '' ">
             AND corp.cn_name = #{data.corpName}
         </if>
+        <if test="data.businessType != null and data.businessType != '' ">
+            AND corp.business_type = #{data.businessType}
+        </if>
         <if test="data.unshippedGoodsDays != null and data.unshippedGoodsDays != '' and data.unshippedGoodsDays == '1'">
-            AND last_sea.bill_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 2 MONTH) AND DATE_SUB(CURDATE(), INTERVAL 1 MONTH)
+            AND corp.business_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 2 MONTH) AND DATE_SUB(CURDATE(), INTERVAL 1 MONTH)
         </if>
         <if test="data.unshippedGoodsDays != null and data.unshippedGoodsDays != '' and data.unshippedGoodsDays == '2'">
-            AND last_sea.bill_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 3 MONTH) AND DATE_SUB(CURDATE(), INTERVAL 2 MONTH)
+            AND corp.business_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 3 MONTH) AND DATE_SUB(CURDATE(), INTERVAL 2 MONTH)
         </if>
         <if test="data.unshippedGoodsDays != null and data.unshippedGoodsDays != '' and data.unshippedGoodsDays == '3'">
             AND (
-            last_sea.bill_date IS NULL
-            OR last_sea.bill_date &lt;= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
+            corp.business_date IS NULL
+            OR corp.business_date &lt;= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
             )
         </if>
         <if test="data.unshippedGoodsDays == null or data.unshippedGoodsDays == ''">
-            AND last_sea.bill_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 2 MONTH) AND DATE_SUB(CURDATE(), INTERVAL 1 MONTH)
+            AND corp.business_date BETWEEN DATE_SUB(CURDATE(), INTERVAL 2 MONTH) AND DATE_SUB(CURDATE(), INTERVAL 1 MONTH)
         </if>
-        ORDER BY last_sea.bill_date
+        ORDER BY corp.business_date
     </select>
 
 </mapper>

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

@@ -52,6 +52,7 @@ import org.springblade.los.business.sea.entity.*;
 import org.springblade.los.business.sea.service.*;
 import org.springblade.los.business.sea.vo.DeadlineVO;
 import org.springblade.los.business.sea.vo.GenerateMailVo;
+import org.springblade.los.business.sea.vo.SeaFeedayVO;
 import org.springblade.los.email.entity.EmailAddress;
 import org.springblade.los.email.service.IEmailAddressService;
 import org.springblade.los.enums.BusinessTypeEnums;
@@ -152,6 +153,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 
 	private final IDeadlineContainersService deadlineContainersService;
 
+	private final ISeaFeedayService seaFeedayService;
+
 	@Override
 	public IPage<ReportsVO> selectReportsPage(IPage<ReportsVO> page, ReportsVO reports) {
 		return page.setRecords(baseMapper.selectReportsPage(page, reports));
@@ -262,7 +265,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							.eq(FeeCenter::getDc, MagicValues.C)
 							.eq(FeeCenter::getAccStatus, MagicValues.ONE)
 							.apply("amount != stl_ttl_amount")
-							.eq(FeeCenter::getCorpId, finStlBills.getCorpId()));
+							.eq(FeeCenter::getCorpId, finStlBills.getCorpId())
+							.orderByAsc(FeeCenter::getSort));
 						if (!feeCenterListC.isEmpty()) {
 							amountC = feeCenterListC.stream().map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
 							amountC1 = feeCenterListC.stream().map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -273,7 +277,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							.eq(FeeCenter::getDc, MagicValues.D)
 							.eq(FeeCenter::getAccStatus, MagicValues.ONE)
 							.apply("amount != stl_ttl_amount")
-							.eq(FeeCenter::getCorpId, finStlBills.getCorpId()));
+							.eq(FeeCenter::getCorpId, finStlBills.getCorpId())
+							.orderByAsc(FeeCenter::getSort));
 						if (!feeCenterListD.isEmpty()) {
 							amountD = feeCenterListD.stream().map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
 							amountD1 = feeCenterListD.stream().map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -355,7 +360,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 										.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 										.eq(FeeCenter::getIsDeleted, 0)
 										.eq(FeeCenter::getDc, "D")
-										.apply("find_in_set(mblno,'" + mblno + "')"));
+										.apply("find_in_set(mblno,'" + mblno + "')")
+										.orderByAsc(FeeCenter::getSort));
 								}
 								for (FinStlBillsItems item : reducelList) {
 									FinStlBillsItemsReports finStlBillsItemsReports = new FinStlBillsItemsReports();
@@ -476,7 +482,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 										.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 										.eq(FeeCenter::getIsDeleted, 0)
 										.eq(FeeCenter::getDc, "D")
-										.apply("find_in_set(mblno,'" + mblno + "')"));
+										.apply("find_in_set(mblno,'" + mblno + "')")
+										.orderByAsc(FeeCenter::getSort));
 								}
 								for (FinStlBillsItems item : reducelList) {
 									FinStlBillsItemsReports finStlBillsItemsReports = new FinStlBillsItemsReports();
@@ -1263,7 +1270,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 								.in(FeeCenter::getPid, ids)
 								.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-								.eq(FeeCenter::getIsDeleted, 0);
+								.eq(FeeCenter::getIsDeleted, 0)
+								.orderByAsc(FeeCenter::getSort);
 							if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 								if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 									if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -1303,6 +1311,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									List<FeeCenterReports> feeCenterReportList = new ArrayList<>();
 									for (FeeCenter fee : feeCenterList) {
 										FeeCenterReports feeCenterReports = new FeeCenterReports();
+										feeCenterReports.setSort(fee.getSort());
 										feeCenterReports.setRemarks(fee.getRemarks());
 										feeCenterReports.setPid(item.getId());
 										feeCenterReports.setFeeCnName(fee.getFeeCnName());
@@ -1370,7 +1379,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 						.in(FeeCenter::getPid, bills.getId())
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-						.eq(FeeCenter::getIsDeleted, 0);
+						.eq(FeeCenter::getIsDeleted, 0)
+						.orderByAsc(FeeCenter::getSort);
 					if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 						if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 							if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -1410,6 +1420,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							feeCenterReports.setPid(bills.getId());
 							feeCenterReports.setFeeCnName(fee.getFeeCnName());
 							feeCenterReports.setDc(fee.getDc());
+							feeCenterReports.setSort(fee.getSort());
 							feeCenterReports.setCurCode(fee.getCurCode());
 							feeCenterReports.setCurCodeC(fee.getCurCode());
 							feeCenterReports.setHblno(fee.getHblno());
@@ -1467,12 +1478,14 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 						bills.setFeeCenterList(feeCenterReportList);
 					}
 					list.add(0, bills);
-				} else if (MagicValues.MH.equals(bills.getBillType())) {
+				}
+				else if (MagicValues.MH.equals(bills.getBillType())) {
 					// 分单
 					LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 						.eq(FeeCenter::getPid, bills.getId())
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-						.eq(FeeCenter::getIsDeleted, 0);
+						.eq(FeeCenter::getIsDeleted, 0)
+						.orderByAsc(FeeCenter::getSort);
 					if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 						if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 							if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -1512,6 +1525,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							feeCenterReports.setPid(bills.getId());
 							feeCenterReports.setFeeCnName(fee.getFeeCnName());
 							feeCenterReports.setDc(fee.getDc());
+							feeCenterReports.setSort(fee.getSort());
 							feeCenterReports.setCurCode(fee.getCurCode());
 							feeCenterReports.setCurCodeC(fee.getCurCode());
 							feeCenterReports.setHblno(fee.getHblno());
@@ -1586,6 +1600,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							List<FeeCenterReports> feeCentersD = feeCenterReportsD.stream()
 								.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
 									Comparator.comparing(e -> e.getFeeCnName() + e.getBillCorpCnName() + e.getCurCode()))), ArrayList::new));
+							feeCentersD = feeCentersD.stream().sorted(Comparator.comparing(FeeCenterReports::getSort)).collect(Collectors.toList());
 							int countC = 0;
 							// 遍历应收,并与应付对应
 							for (int i = 0; i < feeCentersD.size(); i++) {
@@ -1599,9 +1614,10 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								feeCenterReports1.setAmountLocD(feeCentersD.get(i).getAmountLocD());
 								feeCenterReports1.setAmountUsdD(feeCentersD.get(i).getAmountUsdD());
 								feeCenterReports1.setCurCode(feeCentersD.get(i).getCurCode());
+								List<FeeCenterReports> finalFeeCentersD = feeCentersD;
 								FeeCenterReports feeCenterC = feeCenterReportsC.stream()
-									.filter(e -> e.getFeeCnName().equals(feeCentersD.get(finalI).getFeeCnName())
-										&& !"1".equals(e.getMark()) && e.getCurCode().equals(feeCentersD.get(finalI).getCurCode()))
+									.filter(e -> e.getFeeCnName().equals(finalFeeCentersD.get(finalI).getFeeCnName())
+										&& !"1".equals(e.getMark()) && e.getCurCode().equals(finalFeeCentersD.get(finalI).getCurCode()))
 									.findFirst().orElse(null);
 								if (feeCenterC != null) {
 									feeCenterC.setMark("1");
@@ -1991,7 +2007,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 					.eq(FeeCenter::getDc, MagicValues.D)
 					.eq(FeeCenter::getIsDeleted, 0)
-					.in(FeeCenter::getPid, ids);
+					.in(FeeCenter::getPid, ids)
+					.orderByAsc(FeeCenter::getSort);
 				if (MagicValues.RECEIVABLE_BILL.equals(groupCode)) {
 					lambdaQueryWrapper.eq(FeeCenter::getAccStatus, 1);
 				}
@@ -2100,7 +2117,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 					.eq(FeeCenter::getDc, MagicValues.C)
-					.in(FeeCenter::getPid, ids);
+					.in(FeeCenter::getPid, ids)
+					.orderByAsc(FeeCenter::getSort);
 				if (MagicValues.MEET_BILL.equals(groupCode)) {
 					lambdaQueryWrapper.eq(FeeCenter::getAccStatus, 1);
 				}
@@ -2192,7 +2210,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							LambdaQueryWrapper<FeeCenter> feeCenterLambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 								.in(FeeCenter::getPid, mblNo)
 								.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-								.eq(FeeCenter::getIsDeleted, 0);
+								.eq(FeeCenter::getIsDeleted, 0)
+								.orderByAsc(FeeCenter::getSort);
 							if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 								if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 									if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -2247,6 +2266,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									feeCenterReports.setPid(item.getId());
 									feeCenterReports.setFeeCnName(fee.getFeeCnName());
 									feeCenterReports.setDc(fee.getDc());
+									feeCenterReports.setSort(fee.getSort());
 									List<FeeCenter> feeCenterListD = feeCenterListMh.stream()
 										.filter(e -> MagicValues.D.equals(e.getDc()) && e.getMblno().equals(item.getMblno()) &&
 											e.getFeeId().equals(fee.getFeeId()) && e.getPid().equals(item.getId())
@@ -2310,7 +2330,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					LambdaQueryWrapper<FeeCenter> feeCenterLambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 						.eq(FeeCenter::getPid, bills.getId())
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-						.eq(FeeCenter::getIsDeleted, 0);
+						.eq(FeeCenter::getIsDeleted, 0)
+						.orderByAsc(FeeCenter::getSort);
 					if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 						if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 							if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -2358,6 +2379,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							feeCenterReports.setPid(bills.getId());
 							feeCenterReports.setFeeCnName(fee.getFeeCnName());
 							feeCenterReports.setDc(fee.getDc());
+							feeCenterReports.setSort(fee.getSort());
 							Bills finalBills = bills;
 							List<FeeCenter> feeCenterListD = feeCenterList.stream()
 								.filter(e -> MagicValues.D.equals(e.getDc()) && e.getMblno().equals(finalBills.getMblno()) &&
@@ -2420,7 +2442,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					LambdaQueryWrapper<FeeCenter> feeCenterLambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 						.eq(FeeCenter::getPid, bills.getId())
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-						.eq(FeeCenter::getIsDeleted, 0);
+						.eq(FeeCenter::getIsDeleted, 0)
+						.orderByAsc(FeeCenter::getSort);
 					if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 						if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 							if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -2468,6 +2491,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							feeCenterReports.setPid(bills.getId());
 							feeCenterReports.setFeeCnName(fee.getFeeCnName());
 							feeCenterReports.setDc(fee.getDc());
+							feeCenterReports.setSort(fee.getSort());
 							Bills finalBills1 = bills;
 							List<FeeCenter> feeCenterListD = feeCenterList.stream()
 								.filter(e -> MagicValues.D.equals(e.getDc()) && e.getMblno().equals(finalBills1.getMblno()) &&
@@ -2631,6 +2655,22 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				bills.setDept(dept);
 				map.put(MagicValues.DATA, bills);
 			}
+		}else if (MagicValues.POD_FEE_DAY.equals(reportCode) && MagicValues.POD_FEE_DAY.equals(groupCode) && MagicValues.HYCK.equals(type)) {
+			SeaFeeday bills = seaFeedayService.getOne(new LambdaQueryWrapper<SeaFeeday>()
+				.eq(SeaFeeday::getTenantId, AuthUtil.getTenantId())
+				.eq(SeaFeeday::getIsDeleted, 0)
+				.ne(SeaFeeday::getStatus, "审核驳回")
+				.eq(SeaFeeday::getPid, billId)
+				.orderByDesc(SeaFeeday::getCreateTime)
+				.last("LIMIT 1"));
+			SeaFeedayVO vo = new SeaFeedayVO();
+			BeanUtil.copyProperties(bills, vo);
+			if (vo != null) {
+				vo.setDept(dept);
+				map.put(MagicValues.DATA, vo);
+			} else {
+				map.put(MagicValues.DATA, null);
+			}
 		} else {
 			// 默认取单据数据,包括主表、预配箱、配箱、费用
 			Bills bills = billsService.getById(billId);
@@ -2931,7 +2971,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 				.eq(FeeCenter::getDc, MagicValues.C)
-				.eq(FeeCenter::getIsDeleted, 0);
+				.eq(FeeCenter::getIsDeleted, 0)
+				.orderByAsc(FeeCenter::getSort);
 			if (MagicValues.MEET_BILL.equals(groupCode)) {
 				lambdaQueryWrapper.eq(FeeCenter::getAccStatus, 1);
 			}
@@ -2982,7 +3023,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 				.eq(FeeCenter::getDc, MagicValues.D)
-				.eq(FeeCenter::getIsDeleted, 0);
+				.eq(FeeCenter::getIsDeleted, 0)
+				.orderByAsc(FeeCenter::getSort);
 			if (MagicValues.RECEIVABLE_BILL.equals(groupCode)) {
 				lambdaQueryWrapper.eq(FeeCenter::getAccStatus, 1);
 			}
@@ -3047,7 +3089,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 				LambdaQueryWrapper<FeeCenter> lambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 					.in(FeeCenter::getPid, amendsIds)
 					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-					.eq(FeeCenter::getIsDeleted, 0);
+					.eq(FeeCenter::getIsDeleted, 0)
+					.orderByAsc(FeeCenter::getSort);
 				if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 					if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 						if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -3099,7 +3142,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								LambdaQueryWrapper<FeeCenter> feeCenterLambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 									.in(FeeCenter::getPid, ids)
 									.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-									.eq(FeeCenter::getIsDeleted, 0);
+									.eq(FeeCenter::getIsDeleted, 0)
+									.orderByAsc(FeeCenter::getSort);
 								if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 									if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 										if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -3143,6 +3187,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 										feeCenterReports.setPid(item.getId());
 										feeCenterReports.setFeeCnName(fee.getFeeCnName());
 										feeCenterReports.setDc(fee.getDc());
+										feeCenterReports.setSort(fee.getSort());
 										List<FeeCenter> feeCenterListD;
 										List<FeeCenter> feeCenterListUsdD;
 										List<FeeCenter> feeCenterListC;
@@ -3281,7 +3326,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									LambdaQueryWrapper<FeeCenter> amendsFeeCenterLambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 										.in(FeeCenter::getPid, ids)
 										.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-										.eq(FeeCenter::getIsDeleted, 0);
+										.eq(FeeCenter::getIsDeleted, 0)
+										.orderByAsc(FeeCenter::getSort);
 									if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 										if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 											if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -3322,6 +3368,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 													feeCenterReports.setPid(item.getId());
 													feeCenterReports.setFeeCnName(fee.getFeeCnName());
 													feeCenterReports.setDc(fee.getDc());
+													feeCenterReports.setSort(fee.getSort());
 													List<FeeCenter> feeCenterListD;
 													List<FeeCenter> feeCenterListUsdD;
 													List<FeeCenter> feeCenterListC;
@@ -3459,7 +3506,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 						LambdaQueryWrapper<FeeCenter> feeCenterLambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 							.eq(FeeCenter::getPid, bills.getId())
 							.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-							.eq(FeeCenter::getIsDeleted, 0);
+							.eq(FeeCenter::getIsDeleted, 0)
+							.orderByAsc(FeeCenter::getSort);
 						if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 							if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 								if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -3569,6 +3617,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 										.collect(Collectors.toList());
 								}
 								feeCenterReports.setDc(fee.getDc());
+								feeCenterReports.setSort(fee.getSort());
 
 								if (!feeCenterListD.isEmpty()) {
 									/*BCorps bCorps = bCorpsList.stream().filter(e -> e.getId().equals(fee.getCorpId())).findFirst().orElse(null);
@@ -3636,7 +3685,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							LambdaQueryWrapper<FeeCenter> feeCenterLambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
 								.eq(FeeCenter::getPid, bills.getId())
 								.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-								.eq(FeeCenter::getIsDeleted, 0);
+								.eq(FeeCenter::getIsDeleted, 0)
+								.orderByAsc(FeeCenter::getSort);
 							if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 								if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 									if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -3664,6 +3714,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									feeCenterReports.setPid(bills.getId());
 									feeCenterReports.setFeeCnName(fee.getFeeCnName());
 									feeCenterReports.setDc(fee.getDc());
+									feeCenterReports.setSort(fee.getSort());
 									feeCenterReports.setReportType(fee.getReportType());
 									List<FeeCenter> feeCenterListD;
 									List<FeeCenter> feeCenterListUsdD;
@@ -3769,7 +3820,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							LambdaQueryWrapper<FeeCenter> feeCenterLambdaQueryWrapperM = new LambdaQueryWrapper<FeeCenter>()
 								.eq(FeeCenter::getPid, details.getId())
 								.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-								.eq(FeeCenter::getIsDeleted, 0);
+								.eq(FeeCenter::getIsDeleted, 0)
+								.orderByAsc(FeeCenter::getSort);
 							if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
 								if (!(AuthUtil.getUserRole().contains("应付查看") && AuthUtil.getUserRole().contains("应收查看"))) {
 									if (AuthUtil.getUserRole().contains("应付查看")) {
@@ -3788,6 +3840,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								feeCenterReports.setPid(details.getId());
 								feeCenterReports.setFeeCnName(fee.getFeeCnName());
 								feeCenterReports.setDc(fee.getDc());
+								feeCenterReports.setSort(fee.getSort());
 								feeCenterReports.setReportType(fee.getReportType());
 								List<FeeCenter> feeCenterListD;
 								List<FeeCenter> feeCenterListUsdD;
@@ -3934,6 +3987,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								feeCenterReports1.setPid(fee.getPid());
 								feeCenterReports1.setReportType(fee.getReportType());
 								feeCenterReports1.setDc(fee.getDc());
+								feeCenterReports1.setSort(fee.getSort());
 								feeCenterReports1.setBillCorpCnName(fee.getBillCorpCnName());
 								List<FeeCenterReports> feeCenterD = feeCenterReportsD.stream().filter(e -> e.getFeeCnName().equals(fee.getFeeCnName())
 									&& fee.getBillCorpCnName().equals(e.getBillCorpCnName())).collect(Collectors.toList());
@@ -3971,6 +4025,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									feeCenterReports1.setPid(fee.getPid());
 									feeCenterReports1.setReportType(fee.getReportType());
 									feeCenterReports1.setDc(fee.getDc());
+									feeCenterReports1.setSort(fee.getSort());
 									fee.setMark("1");
 									feeCenterReports1.setCorpCnName(fee.getCorpCnName());
 									feeCenterReports1.setAmountC(fee.getAmountC());
@@ -4000,6 +4055,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								feeCenterReports1.setPid(fee.getPid());
 								feeCenterReports1.setReportType(fee.getReportType());
 								feeCenterReports1.setDc(fee.getDc());
+								feeCenterReports1.setSort(fee.getSort());
 								if (fee != null) {
 									if ((ObjectUtils.isNotNull(fee.getAmountD()) && fee.getAmountD().compareTo(new BigDecimal("0.00")) != 0)
 										|| (ObjectUtils.isNotNull(fee.getAmountUsdD()) && fee.getAmountUsdD().compareTo(new BigDecimal("0.00")) != 0)

+ 7 - 2
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/ArchivesTrajectoryController.java

@@ -115,8 +115,13 @@ public class ArchivesTrajectoryController extends BladeController {
 			lambdaQueryWrapper.eq(ArchivesTrajectory::getBoxDynamics,"客户还箱");
 		}
 
-		lambdaQueryWrapper.last("GROUP BY code,box_type,bill_type,box_dynamics,box_category,DATE_FORMAT(new_date, '%Y-%m-%d')," +
-			"port_id,station_id,container_number,IFNULL(mblno, ''),IFNULL(hblno, ''),src_id ORDER BY new_date DESC,code DESC");
+		if (ObjectUtils.isNotNull(archivesTrajectory.getCode())){
+			lambdaQueryWrapper.last("GROUP BY code,box_type,bill_type,box_dynamics,box_category,DATE_FORMAT(new_date, '%Y-%m-%d')," +
+				"port_id,station_id,container_number,IFNULL(mblno, ''),IFNULL(hblno, ''),src_id ORDER BY code DESC,new_date DESC");
+		}else{
+			lambdaQueryWrapper.last("GROUP BY code,box_type,bill_type,box_dynamics,box_category,DATE_FORMAT(new_date, '%Y-%m-%d')," +
+				"port_id,station_id,container_number,IFNULL(mblno, ''),IFNULL(hblno, ''),src_id ORDER BY new_date DESC");
+		}
 		IPage<ArchivesTrajectory> pages = archivesTrajectoryService.page(Condition.getPage(query), lambdaQueryWrapper);
 		return R.data(pages);
 	}

+ 69 - 48
blade-service/blade-los/src/main/java/org/springblade/los/box/dynamics/service/impl/BoxDynamicsRecordServiceImpl.java

@@ -497,7 +497,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 					}
 				}
 				//记录箱轨迹信息
-				archivesTrajectoryUtils.saveTrajectory(putBox1, null, null, boxDynamicsRecord.getTenantId(), "7",recordItems);
+				archivesTrajectoryUtils.saveTrajectory(putBox1, null, null, boxDynamicsRecord.getTenantId(), "7", recordItems);
 			}
 			if (!tradingBoxList.isEmpty()) {
 				TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getContractNo().equals(recordItems.getHblno())).findFirst().orElse(null);
@@ -944,6 +944,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 			item.setUpdateUser(AuthUtil.getUserId());
 			item.setUpdateUserName(AuthUtil.getUserName());
 			item.setUpdateTime(new Date());
+			item.setPodId(billsNew.getPodId());
+			item.setPodCode(billsNew.getPodCode());
+			item.setPodCnName(billsNew.getPodCnName());
+			item.setPodEnName(billsNew.getPodEnName());
 			logUtils.saveOperationLog("海运出口-配箱列表拆单", "提单号:" + bills.getHblno() + "=>" + billsNew.getHblno(), item.getId());
 		}
 		containersService.updateBatchById(containersList);
@@ -1200,6 +1204,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						putBoxItem.setUpdateTime(new Date());
 						putBoxItem.setUpdateUserName(AuthUtil.getUserName());
 						putBoxItem.setUpdateUser(AuthUtil.getUserId());
+						putBoxItem.setPodId(billsNew.getPodId());
+						putBoxItem.setPodCode(billsNew.getPodCode());
+						putBoxItem.setPodCname(billsNew.getPodCnName());
+						putBoxItem.setPodEname(billsNew.getPodEnName());
 						PutBox putBox = putBoxList.stream().filter(e -> e.getId().equals(putBoxItem.getPid())).findFirst().orElse(null);
 						if (putBox != null) {
 							ArchivesTrajectory archivesTrajectory = new ArchivesTrajectory();
@@ -1221,12 +1229,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							archivesTrajectory.setHblno(putBoxItem.getHblno());
 							archivesTrajectory.setBoxDynamics("海运出口-拆单");
 							archivesTrajectory.setNewDate(putBoxItem.getPolStationEmptyContainerExitDate());
-							if (ObjectUtils.isNotNull(putBox.getPodId()) && !putBox.getPodId().contains(",")) {
-								archivesTrajectory.setPodId(Long.parseLong(putBox.getPodId()));
-								archivesTrajectory.setPodCode(putBox.getPodCode());
-								archivesTrajectory.setPodCname(putBox.getPodCname());
-								archivesTrajectory.setPodEname(putBox.getPodEname());
-							}
+							archivesTrajectory.setPodId(billsNew.getPodId());
+							archivesTrajectory.setPodCode(billsNew.getPodCode());
+							archivesTrajectory.setPodCname(billsNew.getPodCnName());
+							archivesTrajectory.setPodEname(billsNew.getPodEnName());
 							archivesTrajectory.setStatus("海运出口-拆单");
 							archivesTrajectory.setBillType(putBox.getBoxClass());
 							archivesTrajectory.setCode(putBoxItem.getBoxCode());
@@ -1564,9 +1570,9 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 			if (!putBoxItems.isEmpty()) {
 				putBoxItemsService.saveOrUpdateBatch(putBoxItems);
 				for (PutBoxItems item : putBoxItems) {
-                    putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
-						.ifPresent(tradingBox -> archivesTrajectoryUtils.saveTrajectory(tradingBox, item, itemsListJC, boxDynamicsRecord.getTenantId(), "1",null));
-                }
+					putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
+						.ifPresent(tradingBox -> archivesTrajectoryUtils.saveTrajectory(tradingBox, item, itemsListJC, boxDynamicsRecord.getTenantId(), "1", null));
+				}
 			}
 			if (!archivesArrayList.isEmpty()) {
 				archivesService.saveOrUpdateBatch(archivesArrayList);
@@ -1719,14 +1725,19 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						archives.setUpdateTime(new Date());
 						archives.setUpdateUserName(AuthUtil.getUserName());
 						archives.setUpdateUser(AuthUtil.getUserId());
-						if (ObjectUtils.isNotNull(item.getSrcBoxStatus())) {
-							archives.setStatus(item.getSrcBoxStatus());
-							archives.setBoxDynamics(item.getSrcBoxDynamics());
-							archives.setBoxStatus(item.getSrcBoxGoodBad());
+						if ("TG".equals(type)) {
+							archives.setBoxDynamics("空箱出场");
+							archives.setStatus("使用中");
 						} else {
-							archives.setBoxDynamics("作废");
-							archives.setStatus("作废");
-							archives.setBoxStatus("好箱");
+							if (ObjectUtils.isNotNull(item.getSrcBoxStatus())) {
+								archives.setStatus(item.getSrcBoxStatus());
+								archives.setBoxDynamics(item.getSrcBoxDynamics());
+								archives.setBoxStatus(item.getSrcBoxGoodBad());
+							} else {
+								archives.setBoxDynamics("作废");
+								archives.setStatus("作废");
+								archives.setBoxStatus("好箱");
+							}
 						}
 						archives.setAddressId(item.getSrcPortId());
 						archives.setAddressCode(item.getSrcPortCode());
@@ -1796,14 +1807,19 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							putBoxItem.setActualEta(null);
 							putBoxItem.setPodBoxUseDays(0);
 						}
-						if (ObjectUtils.isNotNull(item.getSrcBoxStatus()) && !"待使用".equals(putBoxItem.getStatus())) {
-							putBoxItem.setStatus(item.getSrcBoxStatus());
-							putBoxItem.setBoxDynamics(item.getSrcBoxDynamics());
-							putBoxItem.setBoxStatus(item.getSrcBoxGoodBad());
+						if ("TG".equals(type)) {
+							putBoxItem.setBoxDynamics("空箱出场");
+							putBoxItem.setStatus("使用中");
 						} else {
-							putBoxItem.setBoxDynamics("作废");
-							putBoxItem.setStatus("作废");
-							putBoxItem.setBoxStatus("好箱");
+							if (ObjectUtils.isNotNull(item.getSrcBoxStatus()) && !"待使用".equals(putBoxItem.getStatus())) {
+								putBoxItem.setStatus(item.getSrcBoxStatus());
+								putBoxItem.setBoxDynamics(item.getSrcBoxDynamics());
+								putBoxItem.setBoxStatus(item.getSrcBoxGoodBad());
+							} else {
+								putBoxItem.setBoxDynamics("作废");
+								putBoxItem.setStatus("作废");
+								putBoxItem.setBoxStatus("好箱");
+							}
 						}
 						putBoxItems.add(putBoxItem);
 					}
@@ -1818,14 +1834,19 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 						tradingBoxItem.setUpdateTime(new Date());
 						tradingBoxItem.setUpdateUserName(AuthUtil.getUserName());
 						tradingBoxItem.setUpdateUser(AuthUtil.getUserId());
-						if (ObjectUtils.isNotNull(item.getSrcBoxStatus()) && !"待使用".equals(tradingBoxItem.getStatus())) {
-							tradingBoxItem.setStatus(item.getSrcBoxStatus());
-							tradingBoxItem.setBoxDynamics(item.getSrcBoxDynamics());
-							tradingBoxItem.setBoxStatus(item.getSrcBoxGoodBad());
+						if ("TG".equals(type)) {
+							tradingBoxItem.setBoxDynamics("空箱出场");
+							tradingBoxItem.setStatus("使用中");
 						} else {
-							tradingBoxItem.setBoxDynamics("作废");
-							tradingBoxItem.setStatus("作废");
-							tradingBoxItem.setBoxStatus("好箱");
+							if (ObjectUtils.isNotNull(item.getSrcBoxStatus()) && !"待使用".equals(tradingBoxItem.getStatus())) {
+								tradingBoxItem.setStatus(item.getSrcBoxStatus());
+								tradingBoxItem.setBoxDynamics(item.getSrcBoxDynamics());
+								tradingBoxItem.setBoxStatus(item.getSrcBoxGoodBad());
+							} else {
+								tradingBoxItem.setBoxDynamics("作废");
+								tradingBoxItem.setStatus("作废");
+								tradingBoxItem.setBoxStatus("好箱");
+							}
 						}
 						if ("CC".contains(type)) {
 							tradingBoxItem.setPodStationId(0L);
@@ -2405,7 +2426,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							PutBox putBox = putBoxNewList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
 							if (putBox != null) {
 								//记录箱轨迹信息
-								archivesTrajectoryUtils.saveTrajectory(putBox, item, itemsListFC, boxDynamicsRecord.getTenantId(), "9",null);
+								archivesTrajectoryUtils.saveTrajectory(putBox, item, itemsListFC, boxDynamicsRecord.getTenantId(), "9", null);
 							}
 						}
 					} else {
@@ -2414,7 +2435,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 								PutBox putBox = putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(null);
 								if (putBox != null) {
 									//记录箱轨迹信息
-									archivesTrajectoryUtils.saveTrajectory(putBox, item, itemsListFC, boxDynamicsRecord.getTenantId(), "5",null);
+									archivesTrajectoryUtils.saveTrajectory(putBox, item, itemsListFC, boxDynamicsRecord.getTenantId(), "5", null);
 								}
 							}
 						}
@@ -2681,9 +2702,9 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				if (!putBoxItems.isEmpty()) {
 					putBoxItemsService.saveOrUpdateBatch(putBoxItems);
 					for (PutBoxItems item : putBoxItems) {
-                        putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
-							.ifPresent(tradingBox -> archivesTrajectoryUtils.saveTrajectory(tradingBox, item, itemsListZJ, boxDynamicsRecord.getTenantId(), "2",null));
-                    }
+						putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
+							.ifPresent(tradingBox -> archivesTrajectoryUtils.saveTrajectory(tradingBox, item, itemsListZJ, boxDynamicsRecord.getTenantId(), "2", null));
+					}
 				}
 				if (!archivesArrayList.isEmpty()) {
 					archivesService.saveOrUpdateBatch(archivesArrayList);
@@ -3020,9 +3041,9 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				if (!putBoxItemsNewList.isEmpty()) {
 					putBoxItemsService.saveOrUpdateBatch(putBoxItemsNewList);
 					for (PutBoxItems item : putBoxItemsNewList) {
-                        putBoxNewList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
-							.ifPresent(putBox -> archivesTrajectoryUtils.saveTrajectory(putBox, item, itemsListWHFK, boxDynamicsRecord.getTenantId(), "6",null));
-                    }
+						putBoxNewList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
+							.ifPresent(putBox -> archivesTrajectoryUtils.saveTrajectory(putBox, item, itemsListWHFK, boxDynamicsRecord.getTenantId(), "6", null));
+					}
 				}
 				if (!tradingBoxItemOldList.isEmpty()) {
 					tradingBoxItemService.updateBatchById(tradingBoxItemOldList);
@@ -3184,9 +3205,9 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				if (!putBoxItemsNewList.isEmpty()) {
 					putBoxItemsService.saveOrUpdateBatch(putBoxItemsNewList);
 					for (PutBoxItems item : putBoxItemsNewList) {
-                        putBoxList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
-							.ifPresent(putBox -> archivesTrajectoryUtils.saveTrajectory(putBox, item, itemsListRC, boxDynamicsRecord.getTenantId(), "8",null));
-                    }
+						putBoxList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
+							.ifPresent(putBox -> archivesTrajectoryUtils.saveTrajectory(putBox, item, itemsListRC, boxDynamicsRecord.getTenantId(), "8", null));
+					}
 				}
 				if (!tradingBoxItemOldList.isEmpty()) {
 					tradingBoxItemService.updateBatchById(tradingBoxItemOldList);
@@ -3431,9 +3452,9 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				if (!putBoxItems.isEmpty()) {
 					putBoxItemsService.saveOrUpdateBatch(putBoxItems);
 					for (PutBoxItems item : putBoxItems) {
-                        putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
-							.ifPresent(tradingBox -> archivesTrajectoryUtils.saveTrajectory(tradingBox, item, itemsListZD, boxDynamicsRecord.getTenantId(), "4",null));
-                    }
+						putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
+							.ifPresent(tradingBox -> archivesTrajectoryUtils.saveTrajectory(tradingBox, item, itemsListZD, boxDynamicsRecord.getTenantId(), "4", null));
+					}
 				}
 				if (!archivesArrayList.isEmpty()) {
 					archivesService.saveOrUpdateBatch(archivesArrayList);
@@ -4055,9 +4076,9 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 					putBoxItemsService.saveOrUpdateBatch(putBoxItems);
 					//记录对应箱号出场箱轨迹
 					for (PutBoxItems item : putBoxItems) {
-                        putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
-							.ifPresent(tradingBox -> archivesTrajectoryUtils.saveTrajectory(tradingBox, item, itemsListCC, boxDynamicsRecord.getTenantId(), "3",null));
-                    }
+						putBoxes.stream().filter(e -> e.getId().equals(item.getPid())).findFirst()
+							.ifPresent(tradingBox -> archivesTrajectoryUtils.saveTrajectory(tradingBox, item, itemsListCC, boxDynamicsRecord.getTenantId(), "3", null));
+					}
 				}
 				//海运单据主表箱号赋值
 				if (!containersListNew.isEmpty()) {

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/box/mapper/PutBoxMapper.xml

@@ -125,7 +125,7 @@
         AND lp.is_deleted = '0'
         AND corp.tenant_id = #{data.tenantId}
         AND corp.is_deleted = '0'
-        AND lpb.remaining_num > 0
+        AND (lpb.storage_num > 0 or lpb.remaining_num > 0)
         AND lpb.whether_deactivate = '0'
         AND lpb.box_class != 'OW(放)'
         <if test='data.containerNumber != null and data.containerNumber != ""'>
@@ -336,7 +336,7 @@
         AND lp.is_deleted = '0'
         AND corp.tenant_id = #{data.tenantId}
         AND corp.is_deleted = '0'
-        AND lpb.remaining_num > 0
+        AND (lpb.storage_num > 0 or lpb.remaining_num > 0)
         AND lpb.whether_deactivate = '0'
         AND lpb.box_class != 'OW(放)'
         <if test='data.containerNumber != null and data.containerNumber != ""'>

+ 12 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java

@@ -179,6 +179,9 @@ public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicatio
 				if (item.getStlPid() != null) {
 					text.append("费用:").append(item.getFeeCnName()).append("金额:").append(item.getAmount()).append("已申请,");
 				}
+				if (ObjectUtils.isNull(item.getBillDate())) {
+					text.append("费用:").append(item.getFeeCnName()).append("财务日期不能为空");
+				}
 			}
 			if (ObjectUtils.isNotNull(text.toString())) {
 				throw new RuntimeException(text.toString());
@@ -414,6 +417,9 @@ public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicatio
 					if (!feeCenters.isEmpty()) {
 						List<FeeCenter> feeCentersNew = new ArrayList<>();
 						for (FeeCenter item : feeCenters) {
+							if (ObjectUtils.isNull(item.getBillDate())) {
+								throw new RuntimeException("费用:" + item.getFeeCnName() + "财务日期不能为空");
+							}
 							item.setUpdateTime(new Date());
 							item.setUpdateUser(AuthUtil.getUserId());
 							item.setUpdateUserName(AuthUtil.getUserName());
@@ -466,6 +472,9 @@ public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicatio
 									throw new RuntimeException("费用" + item.getFeeCnName() + "提单号为空,请先保存");
 								}
 							}
+							if (ObjectUtils.isNull(item.getBillDate())) {
+								throw new RuntimeException("费用:" + item.getFeeCnName() + "财务日期不能为空");
+							}
 							item.setUpdateTime(new Date());
 							item.setUpdateUser(AuthUtil.getUserId());
 							item.setUpdateUserName(AuthUtil.getUserName());
@@ -606,6 +615,9 @@ public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicatio
 				if (1 == item.getAccStatus()) {
 					throw new RuntimeException("费用:" + item.getFeeCnName() + "已生成账单");
 				}
+				if (ObjectUtils.isNull(item.getBillDate())) {
+					throw new RuntimeException("费用:" + item.getFeeCnName() + "财务日期不能为空");
+				}
 				FinAccBills data = new FinAccBills();
 				data.setCurCode(item.getCurCode());
 				data.setTrackingNumber(item.getTrackingNumber());

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

@@ -514,7 +514,6 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 				item.setPid(tradingBox.getId());
 				item.setBillNo(tradingBox.getSysNo());
 				item.setBusinessType(tradingBox.getType());
-				item.setBillDate(tradingBox.getPurchaseDate());
 				item.setBillCorpId(tradingBox.getPurchaseCompanyId());
 				item.setBillCorpCnName(tradingBox.getPurchaseCompanyName());
 				item.setBillCorpEnName(tradingBox.getPurchaseCompanyName());

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

@@ -302,6 +302,7 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 			auditProecessDTO.setBillTime(declare.getCreateTime());
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
 			auditProecessDTO.setCorpId(declare.getCorpId());
+			auditProecessDTO.setCorpsName(declare.getCorpCnName());
 			auditProecessDTO.setSalesCompanyId(Long.parseLong(declare.getBranchId()));
 			auditProecessDTO.setSalesCompanyName(declare.getBranchName());
 			List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()

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

@@ -1138,7 +1138,7 @@ public class BillsController extends BladeController {
 			.ne(Bills::getBillStatus, "3")
 			.like(ObjectUtils.isNotNull(bills.getHblno()), Bills::getHblno, bills.getHblno())
 			.eq(Bills::getPolId, bills.getPolId())
-			.eq(Bills::getPodId, bills.getPodId())
+//			.eq(Bills::getPodId, bills.getPodId())
 			.ne(Bills::getId, bills.getId())
 			.eq(ObjectUtils.isNotNull(bills.getBoxBelongsTo()),Bills::getBoxBelongsTo, bills.getBoxBelongsTo());
 //			.apply("DATE_FORMAT(actual_etd,'%Y-%m-%d') > '" + formatter.format(new Date()) + "'");

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

@@ -0,0 +1,136 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.sea.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.common.annotation.RepeatSubmit;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.los.business.sea.entity.Bills;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.business.sea.entity.SeaFeeday;
+import org.springblade.los.business.sea.vo.SeaFeedayVO;
+import org.springblade.los.business.sea.service.ISeaFeedayService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * pol/pod免箱使天数申请表 控制器
+ *
+ * @author BladeX
+ * @since 2026-04-22
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/seafeeday")
+@Api(value = "pol/pod免箱使天数申请表", tags = "pol/pod免箱使天数申请表接口")
+public class SeaFeedayController extends BladeController {
+
+	private final ISeaFeedayService seaFeedayService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入seaFeeday")
+	public R<SeaFeeday> detail(SeaFeeday seaFeeday) {
+		SeaFeeday detail = seaFeedayService.getOne(Condition.getQueryWrapper(seaFeeday));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 pol/pod免箱使天数申请表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入seaFeeday")
+	public R<IPage<SeaFeeday>> list(SeaFeeday seaFeeday, Query query) {
+		IPage<SeaFeeday> pages = seaFeedayService.page(Condition.getPage(query), Condition.getQueryWrapper(seaFeeday));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 pol/pod免箱使天数申请表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入seaFeeday")
+	public R<IPage<SeaFeedayVO>> page(SeaFeedayVO seaFeeday, Query query) {
+		IPage<SeaFeedayVO> pages = seaFeedayService.selectSeaFeedayPage(Condition.getPage(query), seaFeeday);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 pol/pod免箱使天数申请表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入seaFeeday")
+	public R save(@Valid @RequestBody SeaFeeday seaFeeday) {
+		return R.status(seaFeedayService.save(seaFeeday));
+	}
+
+	/**
+	 * 修改 pol/pod免箱使天数申请表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入seaFeeday")
+	public R update(@Valid @RequestBody SeaFeeday seaFeeday) {
+		return R.status(seaFeedayService.updateById(seaFeeday));
+	}
+
+	/**
+	 * 新增或修改 pol/pod免箱使天数申请表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入seaFeeday")
+	public R submit(@Valid @RequestBody SeaFeeday seaFeeday) {
+		return R.status(seaFeedayService.saveOrUpdate(seaFeeday));
+	}
+
+
+	/**
+	 * 删除 pol/pod免箱使天数申请表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(seaFeedayService.removeByIds(Func.toLongList(ids)));
+	}
+
+	/**
+	 * pol/pod免箱使天数请核
+	 */
+	@PostMapping("/checkSeaFeeday")
+	@RepeatSubmit
+	public R checkSeaFeeday(@RequestBody SeaFeedayVO seaFeeday) {
+		SeaFeeday declare = seaFeedayService.checkSeaFeeday(seaFeeday);
+		return R.data(declare);
+	}
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/SeaFeedayMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.sea.mapper;
+
+import org.springblade.los.business.sea.entity.SeaFeeday;
+import org.springblade.los.business.sea.vo.SeaFeedayVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * pol/pod免箱使天数申请表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2026-04-22
+ */
+public interface SeaFeedayMapper extends BaseMapper<SeaFeeday> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param seaFeeday
+	 * @return
+	 */
+	List<SeaFeedayVO> selectSeaFeedayPage(IPage page, SeaFeedayVO seaFeeday);
+
+}

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

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.los.business.sea.mapper.SeaFeedayMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="seaFeedayResultMap" type="org.springblade.los.business.sea.entity.SeaFeeday">
+        <id column="id" property="id"/>
+        <result column="branch_id" property="branchId"/>
+        <result column="branch_name" property="branchName"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="pid" property="pid"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="short_name" property="shortName"/>
+        <result column="corp_cn_name" property="corpCnName"/>
+        <result column="corp_en_name" property="corpEnName"/>
+        <result column="mblno" property="mblno"/>
+        <result column="hblno" property="hblno"/>
+        <result column="free_box_use_days" property="freeBoxUseDays"/>
+        <result column="apply_days" property="applyDays"/>
+        <result column="apply_amount" property="applyAmount"/>
+        <result column="cur_code" property="curCode"/>
+        <result column="type" property="type"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+        <result column="exrate" property="exrate"/>
+        <result column="etd" property="etd"/>
+        <result column="eta" property="eta"/>
+        <result column="actual_etd" property="actualEtd"/>
+        <result column="actual_eta" property="actualEta"/>
+    </resultMap>
+
+
+    <select id="selectSeaFeedayPage" resultMap="seaFeedayResultMap">
+        select * from los_sea_feeday where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/ISeaFeedayService.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.sea.service;
+
+import org.springblade.los.business.sea.entity.SeaFeeday;
+import org.springblade.los.business.sea.vo.SeaFeedayVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * pol/pod免箱使天数申请表 服务类
+ *
+ * @author BladeX
+ * @since 2026-04-22
+ */
+public interface ISeaFeedayService extends IService<SeaFeeday> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param seaFeeday
+	 * @return
+	 */
+	IPage<SeaFeedayVO> selectSeaFeedayPage(IPage<SeaFeedayVO> page, SeaFeedayVO seaFeeday);
+
+	SeaFeeday checkSeaFeeday(SeaFeedayVO seaFeeday);
+}

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

@@ -54,6 +54,7 @@ import org.springblade.los.business.release.entity.SeaReleaseBillItems;
 import org.springblade.los.business.sea.dto.WaitingBox;
 import org.springblade.los.business.sea.entity.*;
 import org.springblade.los.business.sea.mapper.BillsMapper;
+import org.springblade.los.business.sea.mapper.SeaFeedayMapper;
 import org.springblade.los.business.sea.service.*;
 import org.springblade.los.check.dto.LosAuditProecessDTO;
 import org.springblade.los.check.entity.LosAuditPathsActs;
@@ -161,6 +162,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 
 	private final ArchivesTrajectoryUtils archivesTrajectoryUtils;
 
+	private final SeaFeedayMapper seaFeedayMapper;
+
+	private final UpdateCorpsUtils updateCorpsUtils;
+
 	@Override
 	public IPage<Bills> selectBillsPage(IPage<Bills> page, Bills bills) {
 		return page.setRecords(baseMapper.selectBillsPage(page, bills));
@@ -664,8 +669,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 					item.setPackingUnitId(bills.getPackingUnitId());
 				}
 				item.setMarks(bills.getMarks());
-				if (!"MM".equals(bills.getBillType()) && ObjectUtils.isNotNull(item.getContainerNumber())){
-					if( ObjectUtils.isNull(item.getCntrNo())){
+				if (!"MM".equals(bills.getBillType()) && ObjectUtils.isNotNull(item.getContainerNumber())) {
+					if (ObjectUtils.isNull(item.getCntrNo())) {
 						throw new RuntimeException("放箱号已存在,箱号不能清空");
 					}
 				}
@@ -818,7 +823,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			boolean boxBelongsTo = ObjectUtils.isNotNull(bills.getBoxBelongsTo()) && !bills.getBoxBelongsTo().equals(details.getBoxBelongsTo());
 			if (statusEtd || statusEta || statusAtd || statusAta || statusVessel || statusVoyageNo || statusMblno || statusPolId
 				|| statusPodId || statusCyTrailerTime || statusCyReturnTime || statusLineId || statusForwarding || statusBookingAgentId
-				|| shippingAgencyId || bookingDate || carrierId || foreignAgencyId || issueDate || boxBelongsTo || issueAtId || mblno|| hblno) {
+				|| shippingAgencyId || bookingDate || carrierId || foreignAgencyId || issueDate || boxBelongsTo || issueAtId || mblno || hblno) {
 				String isOccupyNum = sysClient.getParamService("is.occupyNum");
 				if (!"获取数据失败".equals(isOccupyNum)) {
 					boolean status = false;
@@ -837,6 +842,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 						archivesTrajectoryUtils.saveTrajectoryAndContainers(bills);
 					}
 				}
+				if ("SE".equals(bills.getBusinessType()) && statusEtd) {
+					updateCorpsUtils.updateCorps(bills.getCorpId(),bills.getBusinessType(),bills.getEtd());
+				} else if ("SI".equals(bills.getBusinessType()) && statusEta) {
+					updateCorpsUtils.updateCorps(bills.getCorpId(),bills.getBusinessType(),bills.getEta());
+				}
 				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
 					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 					.eq(FeeCenter::getIsDeleted, 0)
@@ -1132,6 +1142,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 								archivesTrajectoryUtils.saveTrajectoryAndContainers(item);
 							}
 						}
+						if ("SE".equals(bills.getBusinessType()) && statusEtd) {
+							updateCorpsUtils.updateCorps(item.getCorpId(),bills.getBusinessType(),bills.getEtd());
+						} else if ("SI".equals(bills.getBusinessType()) && statusEta) {
+							updateCorpsUtils.updateCorps(item.getCorpId(),bills.getBusinessType(),bills.getEta());
+						}
 						item.setMblno(bills.getMblno());
 						item.setActualEta(bills.getActualEta());
 						item.setActualEtd(bills.getActualEtd());
@@ -1393,6 +1408,13 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		detail.setAmountDrLocAmend(amountDrLoc);
 		detail.setAmountCrLocAmend(amountCrLoc);
 		detail.setAmountProfitLocAmend(amountProfitLoc);
+		detail.setSeaFeeday(seaFeedayMapper.selectOne(new LambdaQueryWrapper<SeaFeeday>()
+			.eq(SeaFeeday::getTenantId, AuthUtil.getTenantId())
+			.eq(SeaFeeday::getIsDeleted, 0)
+			.ne(SeaFeeday::getStatus, "审核驳回")
+			.eq(SeaFeeday::getPid, detail.getId())
+			.orderByDesc(SeaFeeday::getCreateTime)
+			.last("LIMIT 1")));
 		return detail;
 	}
 
@@ -1433,6 +1455,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			bills.setMasterBillNo(bills.getBillNo());
 			this.synchronous(bills);
 		}
+		if ("SE".equals(bills.getBusinessType())) {
+			updateCorpsUtils.updateCorps(bills.getCorpId(),bills.getBusinessType(),bills.getEtd());
+		} else if ("SI".equals(bills.getBusinessType())) {
+			updateCorpsUtils.updateCorps(bills.getCorpId(),bills.getBusinessType(),bills.getEta());
+		}
 		List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
 			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 			.eq(FeeCenter::getIsDeleted, 0)
@@ -2984,6 +3011,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 						.eq(FeeCenter::getIsDeleted, 0)
 						.in(FeeCenter::getPid, billIds));
 					for (Bills item : details) {
+						if ("SE".equals(bills.getBusinessType())) {
+							updateCorpsUtils.updateCorps(item.getCorpId(),bills.getBusinessType(),bills.getEtd());
+						} else if ("SI".equals(bills.getBusinessType())) {
+							updateCorpsUtils.updateCorps(item.getCorpId(),bills.getBusinessType(),bills.getEta());
+						}
 						item.setMblno(bills.getMblno());
 						BigDecimal amountDrMH = new BigDecimal("0.00");
 						BigDecimal amountCrMH = new BigDecimal("0.00");
@@ -3172,6 +3204,11 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				item.setPodCode(bills.getPodCode());
 			}
 			finAccBillsService.updateBatchById(finAccBillsList);
+			if ("SE".equals(bills.getBusinessType())) {
+				updateCorpsUtils.updateCorps(bills.getCorpId(),bills.getBusinessType(),bills.getEtd());
+			} else if ("SI".equals(bills.getBusinessType())) {
+				updateCorpsUtils.updateCorps(bills.getCorpId(),bills.getBusinessType(),bills.getEta());
+			}
 		}
 		baseMapper.updateById(bills);
 		return R.data(bills);
@@ -4162,7 +4199,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 					if (ObjectUtils.isNull(item.getHblno())) {
 						texts = texts + "分单号、";
 					}
-					if (!"SI".equals(item.getBusinessType())){
+					if (!"SI".equals(item.getBusinessType())) {
 						if (ObjectUtils.isNull(item.getVesselId())) {
 							texts = texts + "船名、";
 						}
@@ -4245,7 +4282,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			if (ObjectUtils.isNull(declare.getMblno())) {
 				texts = texts + "提单号、";
 			}
-			if (!"SI".equals(declare.getBusinessType())){
+			if (!"SI".equals(declare.getBusinessType())) {
 				if (ObjectUtils.isNull(declare.getVesselId())) {
 					texts = texts + "船名、";
 				}

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

@@ -0,0 +1,174 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.sea.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.business.sea.entity.Bills;
+import org.springblade.los.business.sea.entity.SeaFeeday;
+import org.springblade.los.business.sea.mapper.SeaFeedayMapper;
+import org.springblade.los.business.sea.service.IBillsService;
+import org.springblade.los.business.sea.service.ISeaFeedayService;
+import org.springblade.los.business.sea.vo.SeaFeedayVO;
+import org.springblade.los.check.dto.LosAuditProecessDTO;
+import org.springblade.los.check.entity.LosAuditPathsActs;
+import org.springblade.los.check.entity.LosAuditPathsLevels;
+import org.springblade.los.check.service.IAuditPathsActsService;
+import org.springblade.los.check.service.IAuditPathsLevelsService;
+import org.springblade.los.check.service.IAuditProecessService;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * pol/pod免箱使天数申请表 服务实现类
+ *
+ * @author BladeX
+ * @since 2026-04-22
+ */
+@Service
+@AllArgsConstructor
+public class SeaFeedayServiceImpl extends ServiceImpl<SeaFeedayMapper, SeaFeeday> implements ISeaFeedayService {
+
+	private final IAuditPathsActsService auditPathsActsService;
+
+	private final IAuditPathsLevelsService auditPathsLevelsService;
+
+	private final IAuditProecessService auditProecessService;
+
+	private final IBillsService billsService;
+
+	@Override
+	public IPage<SeaFeedayVO> selectSeaFeedayPage(IPage<SeaFeedayVO> page, SeaFeedayVO seaFeeday) {
+		return page.setRecords(baseMapper.selectSeaFeedayPage(page, seaFeeday));
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public SeaFeeday checkSeaFeeday(SeaFeedayVO seaFeedayVO) {
+		if (ObjectUtils.isNull(seaFeedayVO.getBillId())) {
+			throw new RuntimeException("缺少必要请求参数");
+		}
+		Bills bills = billsService.getById(seaFeedayVO.getBillId());
+		if (bills == null){
+			throw new RuntimeException("未查到海运单据信息");
+		}
+		SeaFeeday seaFeeday = new SeaFeeday();
+		seaFeeday.setCreateTime(new Date());
+		seaFeeday.setCreateUser(AuthUtil.getUserId());
+		seaFeeday.setCreateUserName(AuthUtil.getUserName());
+		seaFeeday.setApplyDays(seaFeedayVO.getApplyDays());
+		seaFeeday.setApplyAmount(seaFeedayVO.getApplyAmount());
+		seaFeeday.setCurCode(seaFeedayVO.getCurCode());
+		seaFeeday.setType(seaFeedayVO.getType());
+		seaFeeday.setExrate(seaFeedayVO.getExrate());
+
+		seaFeeday.setBranchId(bills.getBranchId());
+		seaFeeday.setBranchName(bills.getBranchName());
+		seaFeeday.setPid(bills.getId());
+		seaFeeday.setCorpId(bills.getCorpId());
+		seaFeeday.setShortName(bills.getShortName());
+		seaFeeday.setCorpCnName(bills.getCorpCnName());
+		seaFeeday.setCorpEnName(bills.getCorpEnName());
+		seaFeeday.setMblno(bills.getMblno());
+		seaFeeday.setHblno(bills.getHblno());
+		seaFeeday.setStatus("提交申请");
+		seaFeeday.setEtd(bills.getEtd());
+		seaFeeday.setEta(bills.getEta());
+		seaFeeday.setActualEtd(bills.getActualEtd());
+		seaFeeday.setActualEta(bills.getActualEta());
+		seaFeeday.setFreeBoxUseDays(bills.getPodFreeBoxUseDays());
+		baseMapper.insert(seaFeeday);
+		Integer actId = 1139;
+		String processType = "免箱使天数申请";
+		String checkType = "FEEDAY";
+		//审批数据
+		LosAuditProecessDTO auditProecessDTO = new LosAuditProecessDTO();
+		//获取审批级次
+		List<LosAuditPathsLevels> auditPathsLevels;
+		// 判断是否有审批流,如果审批流已开启就进入审批流,否则直接走申请通过
+		LosAuditPathsActs pathsActs;
+		//是否开启流程
+		LambdaQueryWrapper<LosAuditPathsActs> auditPathsActsLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		auditPathsActsLambdaQueryWrapper
+			.eq(LosAuditPathsActs::getIsEnable, 1)
+			.eq(LosAuditPathsActs::getFidStatus, "status")
+			.eq(LosAuditPathsActs::getTenantId, AuthUtil.getTenantId())
+			.eq(LosAuditPathsActs::getSalesCompanyId, seaFeeday.getBranchId())
+			.eq(LosAuditPathsActs::getActId, actId);
+		pathsActs = auditPathsActsService.getOne(auditPathsActsLambdaQueryWrapper);
+		//获取审批信息
+		LosAuditPathsActs losAuditPathsActs = auditPathsActsService.getOne(new LambdaQueryWrapper<LosAuditPathsActs>()
+			.eq(LosAuditPathsActs::getActId, actId)
+			.eq(LosAuditPathsActs::getFidStatus, "status")
+			.eq(LosAuditPathsActs::getSalesCompanyId, seaFeeday.getBranchId())
+			.eq(LosAuditPathsActs::getTenantId, AuthUtil.getTenantId()));
+		Long pathId = losAuditPathsActs.getPathId();
+		auditPathsLevels = auditPathsLevelsService.list(new LambdaQueryWrapper<LosAuditPathsLevels>()
+			.eq(LosAuditPathsLevels::getTenantId, AuthUtil.getTenantId()).eq(LosAuditPathsLevels::getPathId, pathId));
+		auditProecessDTO.setTimes(1);
+		auditProecessDTO.setProcessType(processType);
+		// 没开启审批流直接走 通过流程
+		if (pathsActs == null || pathsActs.getIsEnable() == 2) {
+			throw new SecurityException("当前租户未查询到审批流配置");
+		} else {
+			if (CollectionUtils.isEmpty(auditPathsLevels)) {
+				throw new SecurityException("开启审批失败:未查询到审批信息");
+			}
+			// 绑定审核类型
+			auditProecessDTO.setCheckType(checkType);
+			// 追加跳转路由url
+			auditProecessDTO.setUrl(seaFeedayVO.getUrl());
+			auditProecessDTO.setPageStatus(seaFeedayVO.getPageStatus());
+			auditProecessDTO.setPageLabel(seaFeedayVO.getPageLabel());
+			auditProecessDTO.setOrderRemark(seaFeeday.getRemarks());
+			auditProecessDTO.setPathsLevelsList(auditPathsLevels);
+			auditProecessDTO.setActId(1);
+			auditProecessDTO.setSrcBillId(seaFeeday.getPid());
+			auditProecessDTO.setBillId(seaFeeday.getId());
+			auditProecessDTO.setBillNo(seaFeeday.getHblno());
+			auditProecessDTO.setSendUserId(AuthUtil.getUserId());
+			auditProecessDTO.setSendName(AuthUtil.getUserName());
+			auditProecessDTO.setSendTime(new Date());
+			auditProecessDTO.setBillTime(seaFeeday.getCreateTime());
+			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
+			auditProecessDTO.setCorpId(seaFeeday.getCorpId());
+			auditProecessDTO.setCorpsName(seaFeeday.getCorpCnName());
+			auditProecessDTO.setReferenceNumber(seaFeeday.getMblno());
+			auditProecessDTO.setMorderNo(seaFeeday.getMblno());
+			auditProecessDTO.setSalesCompanyId(Long.parseLong(seaFeeday.getBranchId()));
+			auditProecessDTO.setSalesCompanyName(seaFeeday.getBranchName());
+			auditProecessDTO.setAmount(seaFeeday.getApplyAmount());
+			auditProecessDTO.setMblno(seaFeeday.getMblno());
+			auditProecessDTO.setHblno(seaFeeday.getHblno());
+			R financeProcess = auditProecessService.createFinanceProcess(auditProecessDTO);
+			if (!financeProcess.isSuccess()) {
+				throw new SecurityException("操作失败,请联系管理员");
+			}
+		}
+		return null;
+	}
+}

+ 1 - 16
blade-service/blade-los/src/main/java/org/springblade/los/check/controller/AuditProecessController.java

@@ -35,7 +35,6 @@ import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
-import org.springblade.los.Util.IDeptUtils;
 import org.springblade.los.basic.corps.entity.BCorps;
 import org.springblade.los.basic.corps.service.IBCorpsService;
 import org.springblade.los.check.dto.LosAuditProecessDTO;
@@ -80,6 +79,7 @@ public class AuditProecessController extends BladeController {
 		lambdaQueryWrapper.eq(StringUtils.isNotBlank(auditProecess.getProcessType()), LosAuditProecess::getProcessType, auditProecess.getProcessType());//业务类型
 		lambdaQueryWrapper.eq(StringUtils.isNotBlank(auditProecess.getAuditStatus()), LosAuditProecess::getAuditStatus, auditProecess.getAuditStatus());//审核状态
 		lambdaQueryWrapper.eq(auditProecess.getCorpId() != null, LosAuditProecess::getCorpId, auditProecess.getCorpId());//往来单位
+		lambdaQueryWrapper.eq(StringUtils.isNotBlank(auditProecess.getCorpsName()), LosAuditProecess::getCorpsName, auditProecess.getCorpsName());//往来单位
 		lambdaQueryWrapper.like(StringUtils.isNotBlank(auditProecess.getBillNo()), LosAuditProecess::getBillNo, auditProecess.getBillNo());//业务编号
 		lambdaQueryWrapper.like(StringUtils.isNotBlank(auditProecess.getMblno()), LosAuditProecess::getMblno, auditProecess.getMblno());//业务编号
 		lambdaQueryWrapper.like(StringUtils.isNotBlank(auditProecess.getHblno()), LosAuditProecess::getHblno, auditProecess.getHblno());//业务编号
@@ -106,15 +106,6 @@ public class AuditProecessController extends BladeController {
 		IPage pages = auditProecessService.page(Condition.getPage(query), lambdaQueryWrapper);
 		List<LosAuditProecess> auditProecessList = pages.getRecords();
 		if (CollectionUtils.isNotEmpty(auditProecessList)) {
-			List<Long> corpIds = auditProecessList.stream().map(LosAuditProecess::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
-			List<BCorps> bCorpsList = null;
-			if (!corpIds.isEmpty()) {
-				bCorpsList = bCorpsService.list(new LambdaQueryWrapper<BCorps>()
-					.eq(BCorps::getTenantId, AuthUtil.getTenantId())
-					.eq(BCorps::getIsDeleted, 0)
-					.in(BCorps::getId, corpIds)
-					.eq(BCorps::getStatus, 0));
-			}
 			List<User> userList = null;
 			StringBuilder sendIds = new StringBuilder();
 			for (LosAuditProecess item : auditProecessList) {
@@ -135,12 +126,6 @@ public class AuditProecessController extends BladeController {
 						auditOrderVO.setSendRealName(user.getRealName());
 					}
 				}
-				if (bCorpsList != null && !bCorpsList.isEmpty() && ObjectUtils.isNotNull(e.getCorpId())) {
-					BCorps bCorps = bCorpsList.stream().filter(i -> i.getId().equals(e.getCorpId())).findFirst().orElse(new BCorps());
-					if (ObjectUtils.isNotNull(bCorps.getCnName())) {
-						auditOrderVO.setCorpsName(bCorps.getCnName());
-					}
-				}
 				auditOrderVOS.add(auditOrderVO);
 			}
 			pages.setRecords(auditOrderVOS);

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

@@ -27,6 +27,7 @@ import org.springblade.client.entity.Message;
 import org.springblade.client.feign.IMessageClient;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.los.Util.CurrencyUtils;
 import org.springblade.los.basic.business.entity.BusinessType;
@@ -52,6 +53,7 @@ import org.springblade.los.business.sea.entity.*;
 import org.springblade.los.business.sea.mapper.BillsMapper;
 import org.springblade.los.business.sea.mapper.DeadlineMapper;
 import org.springblade.los.business.sea.mapper.SeaBillsDetailMapper;
+import org.springblade.los.business.sea.mapper.SeaFeedayMapper;
 import org.springblade.los.business.sea.service.IContainersService;
 import org.springblade.los.business.sea.service.IDeadlineContainersService;
 import org.springblade.los.check.dto.LosAuditProecessDTO;
@@ -66,6 +68,7 @@ import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springblade.los.finance.fee.entity.FeeCenterUpdateRecord;
 import org.springblade.los.finance.fee.entity.FinAccBills;
 import org.springblade.los.finance.fee.mapper.FeeCenterUpdateRecordMapper;
+import org.springblade.los.finance.fee.service.ICostProfitCalculationService;
 import org.springblade.los.finance.fee.service.IFeeCenterService;
 import org.springblade.los.finance.fee.service.IFinAccBillsService;
 import org.springblade.los.finance.invoices.entity.FinInvoices;
@@ -104,6 +107,8 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 
 	private final DeadlineMapper deadlineMapper;
 
+	private final SeaFeedayMapper seaFeedayMapper;
+
 	private final FinStlBillsMapper finStlBillsMapper;
 
 	private final FinInvoicesMapper finInvoicesMapper;
@@ -142,6 +147,8 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 
 	private final IDeadlineContainersService deadlineContainersService;
 
+	private final ICostProfitCalculationService costProfitCalculationService;
+
 
 	@Override
 	public IPage<LosAuditProecessVO> selectAuditProecessPage(IPage<LosAuditProecessVO> page, LosAuditProecessVO auditProecess) {
@@ -182,6 +189,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 			auditProecess.setSrcBillId(auditProecessDTO.getSrcBillId());
 			auditProecess.setPathId(e.getPathId());
 			auditProecess.setCorpId(auditProecessDTO.getCorpId());
+			auditProecess.setCorpsName(auditProecessDTO.getCorpsName());
 			auditProecess.setLevelId(e.getLevelId());
 			auditProecess.setProcessType(auditProecessDTO.getProcessType());
 			auditProecess.setPageLabel(auditProecessDTO.getPageLabel());
@@ -204,6 +212,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 			auditProecess.setSalesCompanyId(auditProecessDTO.getSalesCompanyId());
 			auditProecess.setSalesCompanyName(auditProecessDTO.getSalesCompanyName());
 
+			auditProecess.setAmount(auditProecessDTO.getAmount());
 			auditProecess.setPayAmount(auditProecessDTO.getPayAmount());
 			auditProecess.setReceivableAmount(auditProecessDTO.getReceivableAmount());
 			auditProecess.setGrossProfit(auditProecessDTO.getGrossProfit());
@@ -298,6 +307,10 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 					message.setMessageBody("您有新的提单修改审核待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
 						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
 					);
+				} else if ("免箱使天数申请".equals(auditProecess.getProcessType())) {
+					message.setMessageBody("您有新的免箱使天数申请待确认,业务单号:" + auditProecessDTO.getBillNo() + ",请审核。"
+						+ "提交人:" + auditProecessDTO.getSendName() + "  " + "提交时间" + simpleDateFormat.format(auditProecessDTO.getSendTime())
+					);
 				}
 
 				message.setUrl("/approveDataH/index");
@@ -1845,6 +1858,548 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 			this.checkTradingBox(proecessTemp);
 		} else if ("TDXG".equals(proecessTemp.getCheckType())) {
 			this.checkDeadline(proecessTemp);
+		} else if ("FEEDAY".equals(proecessTemp.getCheckType())) {
+			this.checkSeaFeeday(proecessTemp);
+		}
+	}
+
+	private void checkSeaFeeday(LosAuditProecess proecessTemp) {
+		String messageBody = "";
+		int type = 1;
+		String billsDate = "";
+		//用户操作 1.通过  2.驳回
+		Integer operate = proecessTemp.getOperate();
+		//查看当前审批是否为最后一级
+		String iffinalItem = proecessTemp.getIffinalItem();
+		SeaFeeday seaFeeday = seaFeedayMapper.selectById(proecessTemp.getBillId());
+		//不是最后一级
+		if ("F".equals(iffinalItem)) {
+			//通过
+			if (operate == 1) {
+				//如果是第一级, 则修改状态为审批中
+				if (proecessTemp.getLevelId() == 1) {
+					if (seaFeeday == null) {
+						throw new SecurityException("审批通过失败");
+					}
+					seaFeeday.setStatus("审核中");
+					seaFeeday.setUpdateTime(new Date());
+					seaFeeday.setUpdateUser(AuthUtil.getUserId());
+					seaFeeday.setUpdateUserName(AuthUtil.getUserName());
+					seaFeedayMapper.updateById(seaFeeday);
+				}
+				proecessTemp.setAuditStatus("A");
+				SimpleDateFormat simpleDateFormat = new SimpleDateFormat();
+				//获得订单创建日期
+				if (proecessTemp.getBillId() != null) {
+					if (seaFeeday != null) {
+						billsDate = simpleDateFormat.format(seaFeeday.getCreateTime());
+					}
+				}
+				messageBody = "您有新的免箱使天数申请,业务单号:" + proecessTemp.getBillNo() + ","
+					+ "单据日期:" + billsDate + ",请审核。"
+					+ "提交人:" + proecessTemp.getSendName() + "  " + "提交时间" + simpleDateFormat.format(proecessTemp.getSendTime());
+				type = 2;
+			}
+			//不通过
+			else if (operate == 2) {
+				proecessTemp.setAuditStatus("B");
+				if (seaFeeday == null) {
+					throw new SecurityException("审批通过失败");
+				}
+				seaFeeday.setStatus("审核驳回");
+				seaFeedayMapper.updateById(seaFeeday);
+				messageBody = "您的免箱使天数申请未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + proecessTemp.getAuditMsg();
+			}
+		}
+		//是最后一级
+		else if ("T".equals(iffinalItem)) {
+			//通过
+			if (operate == 1) {
+				proecessTemp.setAuditStatus("A");
+				if (seaFeeday == null) {
+					throw new SecurityException("审批通过失败");
+				}
+				seaFeeday.setStatus("审核通过");
+				seaFeedayMapper.updateById(seaFeeday);
+				Bills bills = billsMapper.selectById(seaFeeday.getPid());
+				if (bills == null) {
+					throw new RuntimeException("未查到对应海运单据信息");
+				}
+				//数据处理
+				this.processSeaFeeday(bills, seaFeeday);
+				messageBody = "您的免箱使天数申请已通过" + ",业务单号:" + proecessTemp.getBillNo();
+			}
+			//不通过
+			else if (operate == 2) {
+				proecessTemp.setAuditStatus("B");
+				if (seaFeeday == null) {
+					throw new SecurityException("审批通过失败");
+				}
+				seaFeeday.setStatus("审核驳回");
+				seaFeedayMapper.updateById(seaFeeday);
+				messageBody = "您的免箱使天数申请未通过" + ",业务单号:" + proecessTemp.getBillNo() + ",驳回原因:" + proecessTemp.getAuditMsg();
+			}
+		} else {
+			throw new SecurityException("审批异常,请联系管理员");
+		}
+		//发送消息
+		this.sendMessage(messageBody, proecessTemp, type, billsDate);
+		cleanMsg(proecessTemp.getAuditUserId(), AuthUtil.getUserId(), proecessTemp.getSrcBillId());
+		baseMapper.updateById(proecessTemp);
+	}
+
+	private void processSeaFeeday(Bills bills, SeaFeeday seaFeeday) {
+		if ("pod".equals(seaFeeday.getType())) {
+			bills.setPodFreeBoxUseDays(bills.getPodFreeBoxUseDays() + seaFeeday.getApplyDays());
+			bills.setUpdateTime(new Date());
+			bills.setUpdateUserName(AuthUtil.getUserName());
+			bills.setUpdateUser(AuthUtil.getUserId());
+			int version = StringUtil.isBlank(bills.getVersion()) ? 1 : Integer.parseInt(bills.getVersion());
+			bills.setVersion(String.valueOf(version + 1));
+			if (new BigDecimal("0.00").compareTo(seaFeeday.getApplyAmount()) != 0){
+				List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0)
+					.eq(FeeCenter::getPid, bills.getId()));
+				List<FeeCenter> feeCenterListMM = new ArrayList<>();
+				Bills billsMM = null;
+				if ("MH".equals(bills.getBillType())) {
+					billsMM = billsMapper.selectById(bills.getMasterId());
+					if (billsMM != null) {
+						feeCenterListMM = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+							.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+							.eq(FeeCenter::getIsDeleted, 0)
+							.eq(FeeCenter::getPid, billsMM.getId()));
+					}
+				}
+				//超期箱使费
+				BFees fees = bFeesService.getOne(new LambdaQueryWrapper<BFees>()
+					.eq(BFees::getTenantId, AuthUtil.getTenantId())
+					.eq(BFees::getIsDeleted, 0)
+					.eq(BFees::getCode, "CQXSF"));
+				if (fees == null) {
+					throw new RuntimeException("请先维护超期箱使费费用基础信息");
+				}
+				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 feeCenter = new FeeCenter();
+				feeCenter.setBillType(bills.getBillType());
+				feeCenter.setCorpType("国内同行及代理");
+				feeCenter.setCorpId(bills.getCorpId());
+				feeCenter.setCorpCnName(bills.getCorpCnName());
+				feeCenter.setCorpEnName(bills.getCorpEnName());
+				feeCenter.setShortName(bills.getShortName());
+				feeCenter.setCreateTime(new Date());
+				feeCenter.setCreateUser(bills.getOperatorId());
+				feeCenter.setCreateUserName(bills.getOperatorName());
+				feeCenter.setPaymode(bills.getMpaymode());
+				feeCenter.setPid(bills.getId());
+				feeCenter.setDc("D");
+				feeCenter.setFeeId(fees.getId());
+				feeCenter.setFeeCode(fees.getCode());
+				feeCenter.setFeeCnName(fees.getCnName());
+				feeCenter.setFeeEnName(fees.getEnName());
+				feeCenter.setCurCode(seaFeeday.getCurCode());
+				feeCenter.setUnitNo("JOB");
+				feeCenter.setExrate(seaFeeday.getExrate());
+				feeCenter.setAmount(seaFeeday.getApplyAmount());
+				feeCenter.setAmountLoc(seaFeeday.getApplyAmount().multiply(feeCenter.getExrate()));
+				feeCenter.setUnsettledAmount(seaFeeday.getApplyAmount());
+				feeCenter.setPrice(seaFeeday.getApplyAmount());
+				feeCenter.setRemarks("超期箱使费-购买天数");
+				feeCenter.setQuantity(new BigDecimal("1"));
+				feeCenter.setBillNo(bills.getBillNo());
+				feeCenter.setBusinessType(bills.getBusinessType());
+				feeCenter.setBillDate(bills.getBillDate());
+				feeCenter.setBillCorpId(bills.getCorpId());
+				feeCenter.setBillCorpCnName(bills.getCorpCnName());
+				feeCenter.setBillCorpEnName(bills.getCorpEnName());
+				feeCenter.setBillShortName(bills.getCorpShortName());
+				feeCenter.setMblno(bills.getMblno());
+				feeCenter.setHblno(bills.getHblno());
+				feeCenter.setPolId(bills.getPolId());
+				feeCenter.setPolCode(bills.getPolCode());
+				feeCenter.setPolCnName(bills.getPolCnName());
+				feeCenter.setPolEnName(bills.getPolEnName());
+				feeCenter.setAutomaticGenerated("1");
+				feeCenter.setBranchId(bills.getBranchId());
+				feeCenter.setBranchName(bills.getBranchName());
+				feeCenter.setBillBranchId(bills.getBranchId());
+				feeCenter.setBillBranchName(bills.getBranchName());
+				feeCenter.setVersion("1");
+				feeCenterService.save(feeCenter);
+				FeeCenter feeCenterC = new FeeCenter();
+				BeanUtil.copyProperties(feeCenter, feeCenterC);
+				feeCenterC.setId(null);
+				feeCenterC.setPid(bills.getId());
+				feeCenterC.setDc("C");
+				feeCenterC.setCorpType("国内直接客户");
+				feeCenterC.setCorpId(bCorps.getId());
+				feeCenterC.setCorpCnName(bCorps.getCnName());
+				feeCenterC.setCorpEnName(bCorps.getEnName());
+				feeCenterC.setShortName(bCorps.getShortName());
+				feeCenterService.save(feeCenterC);
+				BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
+					.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
+					.eq(BusinessType::getIsDeleted, 0)
+					.eq(BusinessType::getStatus, 0)
+					.eq(BusinessType::getCode, "HYZD"));
+				if (businessType == null) {
+					throw new RuntimeException("未找到账单业务编号规则");
+				}
+				List<FeeCenter> feeCenterListAcc = new ArrayList<>();
+				if ("MH".equals(bills.getBillType()) && billsMM != null) {
+					String exrateType = currencyUtils.standardCurrency(billsMM.getBranchId());
+					FeeCenter feeCenterDMM = new FeeCenter();
+					feeCenterDMM.setBookingAgentId(billsMM.getBookingAgentId());
+					feeCenterDMM.setBookingAgentCnName(billsMM.getBookingAgentCnName());
+					feeCenterDMM.setBookingAgentEnName(billsMM.getBookingAgentEnName());
+					feeCenterDMM.setQuantityCntrDescr(billsMM.getQuantityCntrDescr());
+					feeCenterDMM.setBillBranchId(billsMM.getBranchId());
+					feeCenterDMM.setBillBranchName(billsMM.getBranchName());
+					feeCenterDMM.setTeu(billsMM.getTeu());
+					feeCenterDMM.setBranchId(billsMM.getBranchId());
+					feeCenterDMM.setBranchName(billsMM.getBranchName());
+					feeCenterDMM.setPid(billsMM.getId());
+					feeCenterDMM.setCntrNo(billsMM.getQuantityCntrTypesDescr());
+					feeCenterDMM.setBillNo(billsMM.getBillNo());
+					feeCenterDMM.setBusinessType(billsMM.getBusinessType());
+					feeCenterDMM.setBillType(billsMM.getBillType());
+					feeCenterDMM.setBillDate(billsMM.getBillDate());
+					feeCenterDMM.setBillCorpId(billsMM.getCorpId());
+					feeCenterDMM.setBillCorpCnName(billsMM.getCorpCnName());
+					feeCenterDMM.setBillCorpEnName(billsMM.getCorpEnName());
+					feeCenterDMM.setBillShortName(billsMM.getShortName());
+					feeCenterDMM.setLineId(billsMM.getLineId());
+					feeCenterDMM.setLineCnName(billsMM.getLineCnName());
+					feeCenterDMM.setLineEnName(billsMM.getLineEnName());
+					feeCenterDMM.setVesselId(billsMM.getVesselId());
+					feeCenterDMM.setVesselCnName(billsMM.getVesselCnName());
+					feeCenterDMM.setVesselEnName(billsMM.getVesselEnName());
+					feeCenterDMM.setVoyageNo(billsMM.getVoyageNo());
+					feeCenterDMM.setMblno(billsMM.getMblno());
+					feeCenterDMM.setHblno(bills.getHblno());
+					feeCenterDMM.setEtd(billsMM.getEtd());
+					feeCenterDMM.setEta(billsMM.getEta());
+					feeCenterDMM.setPolId(billsMM.getPolId());
+					feeCenterDMM.setPolCode(billsMM.getPolCode());
+					feeCenterDMM.setPolCnName(billsMM.getPolCnName());
+					feeCenterDMM.setPolEnName(billsMM.getPolEnName());
+					feeCenterDMM.setPodId(billsMM.getPodId());
+					feeCenterDMM.setPodCode(billsMM.getPodCode());
+					feeCenterDMM.setPodCnName(billsMM.getPodCnName());
+					feeCenterDMM.setPodEnName(billsMM.getPodEnName());
+					feeCenterDMM.setPaymode(billsMM.getMpaymode());
+					feeCenterDMM.setSort(1);
+					feeCenterDMM.setFeeId(fees.getId());
+					feeCenterDMM.setFeeCode(fees.getCode());
+					feeCenterDMM.setFeeCnName(fees.getCnName());
+					feeCenterDMM.setFeeEnName(fees.getEnName());
+					feeCenterDMM.setUnitNo("JOB");
+					feeCenterDMM.setCurCode(feeCenterC.getCurCode());
+					feeCenterDMM.setExrate(feeCenterC.getExrate());
+					feeCenterDMM.setDc("D");
+					feeCenterDMM.setCorpType("国内直接客户");
+					BCorps corps = bCorpsService.getOne(new LambdaQueryWrapper<BCorps>()
+						.eq(BCorps::getTenantId, AuthUtil.getTenantId())
+						.eq(BCorps::getIsDeleted, 0)
+						.eq(BCorps::getEnName, bills.getBranchName()));
+					if (corps == null) {
+						throw new RuntimeException("基础资料未查到往来单位" + bills.getBranchName());
+					}
+					feeCenterDMM.setCorpId(corps.getId());
+					feeCenterDMM.setCorpCnName(corps.getCnName());
+					feeCenterDMM.setCorpEnName(corps.getEnName());
+					feeCenterDMM.setShortName(corps.getShortName());
+					feeCenterDMM.setGenerationCorpId(corps.getBookingAgentId());
+					feeCenterDMM.setGenerationCorpCnName(corps.getBookingAgentCnName());
+					feeCenterDMM.setGenerationCorpEnName(corps.getBookingAgentEnName());
+					feeCenterDMM.setQuantity(new BigDecimal("1"));
+					feeCenterDMM.setPrice(feeCenterC.getPrice());
+					feeCenterDMM.setAmount(feeCenterC.getAmount());
+					feeCenterDMM.setAmountLoc(feeCenterC.getAmountLoc());
+					feeCenterDMM.setUnsettledAmount(feeCenterC.getAmount());
+					feeCenterDMM.setCreateUser(billsMM.getOperatorId());
+					feeCenterDMM.setCreateUserName(billsMM.getOperatorName());
+					feeCenterDMM.setCreateTime(new Date());
+					BigDecimal amount = feeCenterDMM.getAmount();
+					FinAccBills data = new FinAccBills();
+					data.setCurCode(feeCenterDMM.getCurCode());
+					data.setGenerationCorpId(feeCenterDMM.getGenerationCorpId());
+					data.setGenerationCorpCnName(feeCenterDMM.getGenerationCorpCnName());
+					data.setGenerationCorpEnName(feeCenterDMM.getGenerationCorpEnName());
+					data.setCreateTime(new Date());
+					data.setCreateUser(AuthUtil.getUserId());
+					data.setCreateUserName(AuthUtil.getUserName());
+					data.setCreateDept(feeCenterDMM.getCreateDept());
+					data.setCreateDeptName(feeCenterDMM.getCreateDeptName());
+					data.setBranchId(feeCenterDMM.getBranchId());
+					data.setBranchName(feeCenterDMM.getBranchName());
+					data.setDeptId(Long.parseLong(feeCenterDMM.getBranchId()));
+					data.setDeptName(feeCenterDMM.getBranchName());
+					data.setBookingAgentId(feeCenterDMM.getBookingAgentId());
+					data.setBookingAgentCnName(feeCenterDMM.getBookingAgentCnName());
+					data.setBookingAgentEnName(feeCenterDMM.getBookingAgentEnName());
+					data.setTaxRate(feeCenterDMM.getTaxRate());
+					data.setAmountTax(feeCenterDMM.getAmountTax());
+					data.setBillBranchId(feeCenterDMM.getBillBranchId());
+					data.setBillBranchName(feeCenterDMM.getBillBranchName());
+					BusinessBillNo businessBillNo = new BusinessBillNo();
+					businessBillNo.setBusinessTypeId(businessType.getId());
+					businessBillNo.setCode("HYZD");
+					businessBillNo.setBranchId(feeCenterDMM.getBranchId());
+					R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+					if (!clientBillNo.isSuccess()) {
+						throw new RuntimeException("生成账单编号失败");
+					}
+					data.setBillNo((String) clientBillNo.getData());
+					data.setBillDate(feeCenterDMM.getBillDate());
+					data.setAccountDc(feeCenterDMM.getDc());
+					data.setAccountDate(feeCenterDMM.getBillDate());
+					data.setBillKey(feeCenterDMM.getBillKey());
+					data.setBusinessType(feeCenterDMM.getBusinessType());
+					data.setBillType(feeCenterDMM.getBillType());
+					data.setBusinessBillId(feeCenterDMM.getPid());
+					data.setBusinessBillNo(feeCenterDMM.getBillNo());
+					data.setBusinessDate(feeCenterDMM.getBillDate());
+					data.setSrcId(billsMM.getSrcId());
+					data.setSrcCnName(billsMM.getSrcCnName());
+					data.setSrcEnName(billsMM.getSrcEnName());
+					data.setSrcType(billsMM.getSrcType());
+					data.setOperatorId(billsMM.getOperatorId());
+					data.setOperatorName(billsMM.getOperatorName());
+					data.setQuantityCntrDescr(billsMM.getQuantityCntrDescr());
+					data.setPaymode(feeCenterDMM.getPaymode());
+					data.setCorpId(feeCenterDMM.getCorpId());
+					data.setCorpCnName(feeCenterDMM.getCorpCnName());
+					data.setCorpEnName(feeCenterDMM.getCorpEnName());
+					data.setCorpArgreementNo(billsMM.getCorpArgreementNo());
+					data.setBillCorpId(feeCenterDMM.getBillCorpId());
+					data.setBillCorpCnName(feeCenterDMM.getBillCorpCnName());
+					data.setBillCorpEnName(feeCenterDMM.getBillCorpEnName());
+					data.setVesselId(feeCenterDMM.getVesselId());
+					data.setVesselCnName(feeCenterDMM.getVesselCnName());
+					data.setVesselEnName(feeCenterDMM.getVesselEnName());
+					data.setVoyageNo(feeCenterDMM.getVoyageNo());
+					data.setMblno(feeCenterDMM.getMblno());
+					data.setHblno(feeCenterDMM.getHblno());
+					data.setRefno(billsMM.getRefno());
+					data.setBookingNo(billsMM.getBookingNo());
+					data.setEtd(feeCenterDMM.getEtd());
+					data.setEta(feeCenterDMM.getEta());
+					data.setPolId(feeCenterDMM.getPolId());
+					data.setPolCnName(feeCenterDMM.getPolCnName());
+					data.setPolEnName(feeCenterDMM.getPolEnName());
+					data.setPolNamePrint(billsMM.getPolNamePrint());
+					data.setPodId(feeCenterDMM.getPodId());
+					data.setPodCnName(feeCenterDMM.getPodCnName());
+					data.setPodCode(feeCenterDMM.getPodCode());
+					data.setPodEnName(feeCenterDMM.getPodEnName());
+					data.setPodNamePrint(billsMM.getPodNamePrint());
+					data.setTrackingNumber(feeCenterDMM.getTrackingNumber());
+					data.setAccountType("LOCAL");
+					BigDecimal amountLoc = feeCenterDMM.getAmountLoc();
+					if ("D".equals(feeCenterDMM.getDc())) {
+						if (exrateType.equals(feeCenterDMM.getCurCode())) {
+							data.setAmountDr(amount);
+						} else {
+							data.setAmountDrUsd(amount);
+						}
+						data.setAmountDrLoc(amountLoc);
+					} else {
+						if (exrateType.equals(feeCenterDMM.getCurCode())) {
+							data.setAmountCr(amount);
+						} else {
+							data.setAmountCrUsd(amount);
+						}
+						data.setAmountCrLoc(amountLoc);
+					}
+					data.setExrate(feeCenterDMM.getExrate());
+					finAccBillsService.saveOrUpdate(data);
+					feeCenterDMM.setAccBillId(data.getId());
+					feeCenterDMM.setAccBillNo(data.getBillNo());
+					feeCenterDMM.setAccDate(data.getBillDate());
+					feeCenterDMM.setAccAmount(amountLoc);
+					feeCenterDMM.setAccStatus(1);
+					feeCenterDMM.setAccById(AuthUtil.getUserId());
+					feeCenterDMM.setAccByName(AuthUtil.getUserName());
+					feeCenterDMM.setAuditStatus("4");
+					feeCenterService.save(feeCenterDMM);
+					if (feeCenterListMM.isEmpty()) {
+						feeCenterListMM = new ArrayList<>();
+					}
+					feeCenterListMM.add(feeCenterDMM);
+					Bills billsAmount = costProfitCalculationService.costProfitCalculation(feeCenterListMM, exrateType);
+					if (billsAmount != null) {
+						billsMM.setAccountStatus(billsAmount.getAccountStatus());
+						billsMM.setAmountDr(billsAmount.getAmountDr());
+						billsMM.setOceanFreightDr(billsAmount.getOceanFreightDr());
+						billsMM.setAmountCr(billsAmount.getAmountCr());
+						billsMM.setOceanFreightCr(billsAmount.getOceanFreightCr());
+						billsMM.setAmountProfit(billsAmount.getAmountProfit());
+						billsMM.setOceanFreightProfit(billsAmount.getOceanFreightProfit());
+						billsMM.setAmountDrUsd(billsAmount.getAmountDrUsd());
+						billsMM.setAmountCrUsd(billsAmount.getAmountCrUsd());
+						billsMM.setAmountProfitUsd(billsAmount.getAmountProfitUsd());
+						billsMM.setAmountDrLoc(billsAmount.getAmountDrLoc());
+						billsMM.setAmountCrLoc(billsAmount.getAmountCrLoc());
+						billsMM.setAmountProfitLoc(billsAmount.getAmountProfitLoc());
+						int versionMM = StringUtil.isBlank(billsMM.getVersion()) ? 1 : Integer.parseInt(billsMM.getVersion());
+						billsMM.setVersion(String.valueOf(versionMM + 1));
+						billsMapper.updateById(billsMM);
+					}
+				}
+				feeCenterListAcc.add(feeCenter);
+				feeCenterListAcc.add(feeCenterC);
+				if (feeCenterList.isEmpty()) {
+					feeCenterList = new ArrayList<>();
+				}
+				feeCenterList.add(feeCenter);
+				feeCenterList.add(feeCenterC);
+				String exrateType = currencyUtils.standardCurrency(bills.getBranchId());
+				Bills billsAmount = costProfitCalculationService.costProfitCalculation(feeCenterList, exrateType);
+				if (billsAmount != null) {
+					bills.setAccountStatus(billsAmount.getAccountStatus());
+					bills.setAmountDr(billsAmount.getAmountDr());
+					bills.setOceanFreightDr(billsAmount.getOceanFreightDr());
+					bills.setAmountCr(billsAmount.getAmountCr());
+					bills.setOceanFreightCr(billsAmount.getOceanFreightCr());
+					bills.setAmountProfit(billsAmount.getAmountProfit());
+					bills.setOceanFreightProfit(billsAmount.getOceanFreightProfit());
+					bills.setAmountDrUsd(billsAmount.getAmountDrUsd());
+					bills.setAmountCrUsd(billsAmount.getAmountCrUsd());
+					bills.setAmountProfitUsd(billsAmount.getAmountProfitUsd());
+					bills.setAmountDrLoc(billsAmount.getAmountDrLoc());
+					bills.setAmountCrLoc(billsAmount.getAmountCrLoc());
+					bills.setAmountProfitLoc(billsAmount.getAmountProfitLoc());
+				}
+				for (FeeCenter item : feeCenterListAcc) {
+					BigDecimal amount = item.getAmount();
+					FinAccBills data = new FinAccBills();
+					data.setCurCode(item.getCurCode());
+					data.setGenerationCorpId(item.getGenerationCorpId());
+					data.setGenerationCorpCnName(item.getGenerationCorpCnName());
+					data.setGenerationCorpEnName(item.getGenerationCorpEnName());
+					data.setCreateTime(new Date());
+					data.setCreateUser(AuthUtil.getUserId());
+					data.setCreateUserName(AuthUtil.getUserName());
+					data.setCreateDept(item.getCreateDept());
+					data.setCreateDeptName(item.getCreateDeptName());
+					data.setBranchId(item.getBranchId());
+					data.setBranchName(item.getBranchName());
+					data.setDeptId(Long.parseLong(item.getBranchId()));
+					data.setDeptName(item.getBranchName());
+					data.setBookingAgentId(item.getBookingAgentId());
+					data.setBookingAgentCnName(item.getBookingAgentCnName());
+					data.setBookingAgentEnName(item.getBookingAgentEnName());
+					data.setTaxRate(item.getTaxRate());
+					data.setAmountTax(item.getAmountTax());
+					data.setBillBranchId(item.getBillBranchId());
+					data.setBillBranchName(item.getBillBranchName());
+					BusinessBillNo businessBillNo = new BusinessBillNo();
+					businessBillNo.setBusinessTypeId(businessType.getId());
+					businessBillNo.setCode("HYZD");
+					businessBillNo.setBranchId(item.getBranchId());
+					R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+					if (!clientBillNo.isSuccess()) {
+						throw new RuntimeException("生成账单编号失败");
+					}
+					data.setBillNo((String) clientBillNo.getData());
+					data.setBillDate(item.getBillDate());
+					data.setAccountDc(item.getDc());
+					data.setAccountDate(item.getBillDate());
+					data.setBillKey(item.getBillKey());
+					data.setBusinessType(item.getBusinessType());
+					data.setBillType(item.getBillType());
+					data.setBusinessBillId(item.getPid());
+					data.setBusinessBillNo(item.getBillNo());
+					data.setBusinessDate(item.getBillDate());
+					data.setSrcId(bills.getSrcId());
+					data.setSrcCnName(bills.getSrcCnName());
+					data.setSrcEnName(bills.getSrcEnName());
+					data.setSrcType(bills.getSrcType());
+					data.setOperatorId(bills.getOperatorId());
+					data.setOperatorName(bills.getOperatorName());
+					data.setQuantityCntrDescr(bills.getQuantityCntrDescr());
+					data.setPaymode(item.getPaymode());
+					data.setCorpId(item.getCorpId());
+					data.setCorpCnName(item.getCorpCnName());
+					data.setCorpEnName(item.getCorpEnName());
+					data.setCorpArgreementNo(bills.getCorpArgreementNo());
+					data.setBillCorpId(item.getBillCorpId());
+					data.setBillCorpCnName(item.getBillCorpCnName());
+					data.setBillCorpEnName(item.getBillCorpEnName());
+					data.setVesselId(item.getVesselId());
+					data.setVesselCnName(item.getVesselCnName());
+					data.setVesselEnName(item.getVesselEnName());
+					data.setVoyageNo(item.getVoyageNo());
+					data.setMblno(item.getMblno());
+					data.setHblno(item.getHblno());
+					data.setRefno(bills.getRefno());
+					data.setBookingNo(bills.getBookingNo());
+					data.setEtd(item.getEtd());
+					data.setEta(item.getEta());
+					data.setPolId(item.getPolId());
+					data.setPolCnName(item.getPolCnName());
+					data.setPolEnName(item.getPolEnName());
+					data.setPolNamePrint(bills.getPolNamePrint());
+					data.setPodId(item.getPodId());
+					data.setPodCnName(item.getPodCnName());
+					data.setPodCode(item.getPodCode());
+					data.setPodEnName(item.getPodEnName());
+					data.setPodNamePrint(bills.getPodNamePrint());
+					data.setTrackingNumber(item.getTrackingNumber());
+					data.setAccountType("LOCAL");
+					BigDecimal amountLoc = item.getAmountLoc();
+					if ("D".equals(item.getDc())) {
+						if (exrateType.equals(item.getCurCode())) {
+							data.setAmountDr(amount);
+						} else {
+							data.setAmountDrUsd(amount);
+						}
+						data.setAmountDrLoc(amountLoc);
+					} else {
+						if (exrateType.equals(item.getCurCode())) {
+							data.setAmountCr(amount);
+						} else {
+							data.setAmountCrUsd(amount);
+						}
+						data.setAmountCrLoc(amountLoc);
+					}
+					data.setExrate(item.getExrate());
+					finAccBillsService.saveOrUpdate(data);
+					item.setAccBillId(data.getId());
+					item.setAccBillNo(data.getBillNo());
+					item.setAccDate(data.getBillDate());
+					item.setAccAmount(amountLoc);
+					item.setAccStatus(1);
+					item.setAccById(AuthUtil.getUserId());
+					item.setAccByName(AuthUtil.getUserName());
+					item.setAuditStatus("4");
+				}
+				feeCenterService.saveOrUpdateBatch(feeCenterListAcc);
+			}
+			billsMapper.updateById(bills);
+			if ("已转单".equals(bills.getTransferOrderStatus())){
+				Bills billsJk = billsMapper.selectOne(new LambdaQueryWrapper<Bills>()
+					.eq(Bills::getTenantId,AuthUtil.getTenantId())
+					.eq(Bills::getIsDeleted,0)
+					.eq(Bills::getHblno,bills.getHblno()));
+				if (billsJk != null){
+					billsJk.setPodFreeBoxUseDays(billsJk.getPodFreeBoxUseDays() + seaFeeday.getApplyDays());
+					billsJk.setUpdateTime(new Date());
+					billsJk.setUpdateUserName(AuthUtil.getUserName());
+					billsJk.setUpdateUser(AuthUtil.getUserId());
+					int versionJk = StringUtil.isBlank(billsJk.getVersion()) ? 1 : Integer.parseInt(billsJk.getVersion());
+					billsJk.setVersion(String.valueOf(versionJk + 1));
+					billsMapper.updateById(billsJk);
+				}
+			}
 		}
 	}
 
@@ -2226,6 +2781,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 					finAccBills.setTaxRate(feeCenterUpdateRecord.getTaxRateUpdate());
 					finAccBills.setAmountTax(feeCenterUpdateRecord.getAmountTaxUpdate());
 					finAccBills.setCurCode(feeCenterUpdateRecord.getCurCodeUpdate());
+					finAccBills.setRemarks(feeCenterUpdateRecord.getRemarksUpdate());
 					finAccBillsService.updateById(finAccBills);
 				}
 			}

+ 32 - 2
blade-service/blade-los/src/main/java/org/springblade/los/excel/DeliveryPaperExcel.java

@@ -16,13 +16,12 @@
  */
 package org.springblade.los.excel;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -66,4 +65,35 @@ public class DeliveryPaperExcel implements Serializable {
 	@ExcelProperty(value = "主提单号")
 	private String mblno;
 
+	/**
+	 * 开船日期
+	 */
+	@ExcelIgnore
+	private Date etd;
+	/**
+	 * 航次
+	 */
+	@ExcelIgnore
+	private String voyageNo;
+	/**
+	 * 船主
+	 */
+	@ExcelIgnore
+	private String boxOwner;
+	/**
+	 * 入港箱主
+	 */
+	@ExcelIgnore
+	private String inboundContainerOwner;
+	/**
+	 * 中转港
+	 */
+	@ExcelIgnore
+	private String potEnName;
+	/**
+	 * 货物毛重
+	 */
+	@ExcelIgnore
+	private BigDecimal grossWeight;
+
 }

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

@@ -1258,7 +1258,6 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 				feeCenter.setPid(tradingBox.getId());
 				feeCenter.setBillNo(tradingBox.getSysNo());
 				feeCenter.setBusinessType(tradingBox.getType());
-				feeCenter.setBillDate(tradingBox.getPurchaseDate());
 				feeCenter.setBillCorpId(tradingBox.getPurchaseCompanyId());
 				feeCenter.setBillCorpCnName(tradingBox.getPurchaseCompanyName());
 				feeCenter.setBillCorpEnName(tradingBox.getPurchaseCompanyName());
@@ -1283,9 +1282,6 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						feeCenter.setBillCorpEnName(bCorps1.getShortName());
 					}
 				}
-				if (ObjectUtils.isNull(feeCenter.getBillDate())) {
-					feeCenter.setBillDate(new Date());
-				}
 				if (feeCenter.getId() == null) {
 					feeCenter.setCreateTime(new Date());
 					feeCenter.setCreateUser(AuthUtil.getUserId());

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

@@ -517,7 +517,7 @@ public class FinAccBillsServiceImpl extends ServiceImpl<FinAccBillsMapper, FinAc
 					throw new RuntimeException("费用:" + item.getFeeCnName() + "已生成账单");
 				}
 				if (ObjectUtils.isNull(item.getBillDate())) {
-					throw new RuntimeException("费用:" + item.getFeeCnName() + "缺少业务日期,请重新保存");
+					throw new RuntimeException("费用:" + item.getFeeCnName() + "财务日期不能为空");
 				}
 				FinAccBills data = new FinAccBills();
 				data.setRemarks(item.getRemarks());

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

@@ -1791,6 +1791,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 			auditProecessDTO.setBillTime(detail.getCreateTime());
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
 			auditProecessDTO.setCorpId(detail.getCorpId());
+			auditProecessDTO.setCorpsName(detail.getCorpCnName());
 			auditProecessDTO.setSalesCompanyId(Long.parseLong(detail.getBranchId()));
 			auditProecessDTO.setSalesCompanyName(detail.getBranchName());
 			auditProecessDTO.setPayAmount(detail.getAmountCrLoc());
@@ -3403,6 +3404,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 			auditProecessDTO.setBillTime(detail.getCreateTime());
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
 			auditProecessDTO.setCorpId(detail.getCorpId());
+			auditProecessDTO.setCorpsName(detail.getCorpCnName());
 			auditProecessDTO.setSalesCompanyId(Long.parseLong(detail.getBranchId()));
 			auditProecessDTO.setSalesCompanyName(detail.getBranchName());
 			auditProecessDTO.setPayAmount(detail.getAmountCrLoc());

+ 18 - 9
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -2013,9 +2013,12 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			for (String item : operatorName) {
 				VoteAndLineCount appStatistics = new VoteAndLineCount();
 				appStatistics.setOperatorName(item);
-				appStatistics.setNumber(billsList.stream().filter(e -> ObjectUtils.isNotNull(e.getOperatorName()) &&
-					e.getOperatorName().equals(item)).count());
-				appStatisticsList.add(appStatistics);
+				Long sum = billsList.stream().filter(e -> ObjectUtils.isNotNull(e.getOperatorName()) &&
+					e.getOperatorName().equals(item)).count();
+				if (sum != 0) {
+					appStatistics.setNumber(sum);
+					appStatisticsList.add(appStatistics);
+				}
 			}
 		}
 		return R.data(appStatisticsList);
@@ -2050,12 +2053,15 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 				VoteAndLineCount appStatistics = new VoteAndLineCount();
 				appStatistics.setLineName(item.getCnName());
 				if (!billsList.isEmpty()) {
-					appStatistics.setTeu(billsList.stream().filter(e -> item.getId().equals(e.getLineId()))
-						.map(Bills::getTeu).reduce(0, Integer::sum));
+					Integer sum = billsList.stream().filter(e -> item.getId().equals(e.getLineId()))
+						.map(Bills::getTeu).reduce(0, Integer::sum);
+					if (sum != 0) {
+						appStatistics.setTeu(sum);
+						appStatisticsList.add(appStatistics);
+					}
 				} else {
 					appStatistics.setTeu(0);
 				}
-				appStatisticsList.add(appStatistics);
 			}
 		}
 		return R.data(appStatisticsList);
@@ -2094,9 +2100,12 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			for (String item : salesman) {
 				VoteAndLineCount appStatistics = new VoteAndLineCount();
 				appStatistics.setSalesman(item);
-				appStatistics.setTeu(billsList.stream().filter(e -> ObjectUtils.isNotNull(e.getOperatorName()) &&
-					e.getOperatorName().equals(item)).map(Bills::getTeu).reduce(0, Integer::sum));
-				appStatisticsList.add(appStatistics);
+				Integer teu = billsList.stream().filter(e -> ObjectUtils.isNotNull(e.getSrcCnName()) &&
+					e.getSrcCnName().equals(item)).map(Bills::getTeu).reduce(0, Integer::sum);
+				if (teu != 0) {
+					appStatistics.setTeu(teu);
+					appStatisticsList.add(appStatistics);
+				}
 			}
 		}
 		return R.data(appStatisticsList);

+ 5 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java

@@ -2092,6 +2092,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			auditProecessDTO.setBillTime(declare.getCreateTime());//业务日期
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());//租户id
 			auditProecessDTO.setCorpId(declare.getCustomerId());
+			auditProecessDTO.setCorpsName(declare.getCustomerName());
 			auditProecessDTO.setGrossProfit(declare.getGrossProfit());
 			auditProecessDTO.setSalesCompanyId(Long.parseLong(AuthUtil.getDeptId()));
 			auditProecessDTO.setSalesCompanyName(declare.getSalesCompanyName());
@@ -2206,6 +2207,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			auditProecessDTO.setBillTime(declare.getCreateTime());//业务日期
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());//租户id
 			auditProecessDTO.setCorpId(declare.getCustomerId());
+			auditProecessDTO.setCorpsName(declare.getCustomerName());
 			auditProecessDTO.setSalesCompanyId(Long.parseLong(AuthUtil.getDeptId()));
 			auditProecessDTO.setSalesCompanyName(declare.getSalesCompanyName());
 			auditProecessDTO.setOrderQuantity(declare.getReturnsNumber());
@@ -3352,6 +3354,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			auditProecessDTO.setBillTime(declare.getCreateTime());//业务日期
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());//租户id
 			auditProecessDTO.setCorpId(declare.getCustomerId());
+			auditProecessDTO.setCorpsName(declare.getCustomerName());
 			auditProecessDTO.setGrossProfit(declare.getGrossProfit());
 			auditProecessDTO.setSalesCompanyId(Long.parseLong(AuthUtil.getDeptId()));
 			auditProecessDTO.setSalesCompanyName(declare.getSalesCompanyName());
@@ -6215,6 +6218,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			auditProecessDTO.setBillId(declare.getId());//业务id
 			auditProecessDTO.setBillTime(declare.getCreateTime());//业务日期
 			auditProecessDTO.setCorpId(declare.getCustomerId());
+			auditProecessDTO.setCorpsName(declare.getCustomerName());
 			if ("1".equals(status) && !pjOrderShareList.isEmpty()) {
 				pjOrderListNew.addAll(pjOrderShareList);
 				auditProecessDTO.setOrderQuantity(pjOrderListNew.stream().map(PjOrder::getGoodsTotalNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
@@ -6916,6 +6920,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			auditProecessDTO.setBillTime(declare.getCreateTime());//业务日期
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());//租户id
 			auditProecessDTO.setCorpId(declare.getCustomerId());
+			auditProecessDTO.setCorpsName(declare.getCustomerName());
 			auditProecessDTO.setSalesCompanyId(Long.parseLong(AuthUtil.getDeptId()));
 			auditProecessDTO.setSalesCompanyName(declare.getSalesCompanyName());
 			R financeProcess = auditProecessService.createFinanceProcess(auditProecessDTO);

+ 1 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/service/impl/SettlementServiceImpl.java

@@ -1475,6 +1475,7 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
 			AuditProecessDTO auditProecessDTO = new AuditProecessDTO();
 			//绑定客户
 			auditProecessDTO.setCorpId(selectOne.getCorpId());
+			auditProecessDTO.setCorpsName(selectOne.getCorpName());
 			//绑定审核类型
 			auditProecessDTO.setCheckType(settlement.getCheckType());
 			//追加跳转路由url