Browse Source

1.主分单amend报表打印接口逻辑修改
2.模版导入,批量导入接口结算单位取简称
3.超期箱使费模块表结构创建
4.超期箱使费模块相关基础接口编写
5.海运进出口增加判断分单合计teu是否大于主单teu接口

纪新园 9 months ago
parent
commit
30721bf654
25 changed files with 1711 additions and 49 deletions
  1. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/dto/StorageFeesDTO.java
  2. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/dto/StorageFeesItemsDTO.java
  3. 107 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/entity/StorageFees.java
  4. 122 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/entity/StorageFeesItems.java
  5. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/vo/StorageFeesItemsVO.java
  6. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/vo/StorageFeesVO.java
  7. 6 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  8. 176 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java
  9. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/controller/StorageFeesController.java
  10. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/controller/StorageFeesItemsController.java
  11. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/mapper/StorageFeesItemsMapper.java
  12. 29 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/mapper/StorageFeesItemsMapper.xml
  13. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/mapper/StorageFeesMapper.java
  14. 25 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/mapper/StorageFeesMapper.xml
  15. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/service/IStorageFeesItemsService.java
  16. 45 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/service/IStorageFeesService.java
  17. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/service/impl/StorageFeesItemsServiceImpl.java
  18. 130 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/service/impl/StorageFeesServiceImpl.java
  19. 16 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxController.java
  20. 4 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/ITradingBoxService.java
  21. 328 21
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java
  22. 11 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java
  23. 2 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IBillsService.java
  24. 51 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  25. 101 28
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/dto/StorageFeesDTO.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.basic.storage.dto;
+
+import org.springblade.los.basic.storage.entity.StorageFees;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 仓储费表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class StorageFeesDTO extends StorageFees {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/dto/StorageFeesItemsDTO.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.basic.storage.dto;
+
+import org.springblade.los.basic.storage.entity.StorageFeesItems;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 仓储费明细表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class StorageFeesItemsDTO extends StorageFeesItems {
+	private static final long serialVersionUID = 1L;
+
+}

+ 107 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/entity/StorageFees.java

@@ -0,0 +1,107 @@
+/*
+ *      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.basic.storage.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.time.LocalDateTime;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 仓储费表实体类
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+@Data
+@TableName("los_storage_fees")
+@ApiModel(value = "StorageFees对象", description = "仓储费表")
+public class StorageFees implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+	/**
+	 * 状态
+	 */
+	@ApiModelProperty(value = "状态")
+	private String status;
+	/**
+	 * 类型
+	 */
+	@ApiModelProperty(value = "类型")
+	private String type;
+	/**
+	 * 分公司
+	 */
+	@ApiModelProperty(value = "分公司")
+	private String branchName;
+	/**
+	 * 分公司 Id
+	 */
+	@ApiModelProperty(value = "分公司 Id")
+	private String branchId;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+
+	/**
+	 * 明细
+	 */
+
+	private List<StorageFeesItems> storageFeesItemsList;
+
+
+}

+ 122 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/entity/StorageFeesItems.java

@@ -0,0 +1,122 @@
+/*
+ *      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.basic.storage.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.util.Date;
+
+/**
+ * 仓储费明细表实体类
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+@Data
+@TableName("los_storage_fees_items")
+@ApiModel(value = "StorageFeesItems对象", description = "仓储费明细表")
+public class StorageFeesItems implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	private Long pid;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+	/**
+	 * 起始天数
+	 */
+	@ApiModelProperty(value = "起始天数")
+	private Integer startDay;
+	/**
+	 * 结束天数
+	 */
+	@ApiModelProperty(value = "结束天数")
+	private Integer endDay;
+	/**
+	 * 单价  20GP
+	 */
+	@ApiModelProperty(value = "单价 20GP")
+	private BigDecimal price20gp;
+	/**
+	 * 分公司
+	 */
+	@ApiModelProperty(value = "分公司")
+	private String branchName;
+	/**
+	 * 分公司 Id
+	 */
+	@ApiModelProperty(value = "分公司 Id")
+	private String branchId;
+	/**
+	 * 单价 40GP
+	 */
+	@ApiModelProperty(value = "单价 40GP")
+	private BigDecimal price40gp;
+	/**
+	 * 单价 40HC
+	 */
+	@ApiModelProperty(value = "单价 40HC")
+	private BigDecimal price40hc;
+
+	/**
+	 * 租户
+	 */
+	@ApiModelProperty(value = "租户")
+	private String tenantId;
+
+	/**
+	 * 币别
+	 */
+	@ApiModelProperty(value = "币别")
+	private String curCode;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/vo/StorageFeesItemsVO.java

@@ -0,0 +1,36 @@
+/*
+ *      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.basic.storage.vo;
+
+import org.springblade.los.basic.storage.entity.StorageFeesItems;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 仓储费明细表视图实体类
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "StorageFeesItemsVO对象", description = "仓储费明细表")
+public class StorageFeesItemsVO extends StorageFeesItems {
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/storage/vo/StorageFeesVO.java

@@ -0,0 +1,36 @@
+/*
+ *      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.basic.storage.vo;
+
+import org.springblade.los.basic.storage.entity.StorageFees;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 仓储费表视图实体类
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "StorageFeesVO对象", description = "仓储费表")
+public class StorageFeesVO extends StorageFees {
+	private static final long serialVersionUID = 1L;
+
+}

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

@@ -1155,6 +1155,12 @@ public class Bills implements Serializable {
 	 */
 	@ApiModelProperty(value = "teu箱数")
 	private Integer teu;
+
+	/**
+	 * TEU分单合计
+	 */
+	@ApiModelProperty(value = "TEU分单合计")
+	private Integer teuTotal;
 	/**
 	 * 其他集装箱箱数
 	 */

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

@@ -2602,6 +2602,182 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									item.setFeeCenterList(feeCenterReportList);
 									list.add(item);
 								}
+								List<Amends> amendsListMh = amendsService.list(new LambdaQueryWrapper<Amends>()
+									.in(Amends::getOrigId, ids)
+									.eq(Amends::getStatus, 3)
+									.eq(Amends::getIsDeleted, 0)
+									.eq(Amends::getTenantId, AuthUtil.getTenantId()));
+								if (!amendsListMh.isEmpty()){
+									LambdaQueryWrapper<FeeCenter> amendsFeeCenterLambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()
+										.in(FeeCenter::getPid, ids)
+										.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+										.eq(FeeCenter::getIsDeleted, 0);
+									if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+										if (AuthUtil.getUserRole().contains("应付查看")) {
+											amendsFeeCenterLambdaQueryWrapper.eq(FeeCenter::getDc, "C");
+										} else if (AuthUtil.getUserRole().contains("应收查看")) {
+											amendsFeeCenterLambdaQueryWrapper.eq(FeeCenter::getDc, "D");
+										}
+									}
+									List<FeeCenter> amendsFeeCenterListMh = feeCenterService.list(amendsFeeCenterLambdaQueryWrapper);
+									amendsFeeCenterListMh.stream().filter(e -> ObjectUtils.isNull(e.getReportType())).forEach(e -> e.setReportType("0"));
+									for (Bills item : billsList) {
+										List<Amends> amends1 = amendsListMh.stream().filter(e-> e.getOrigId().equals(item.getId())).collect(Collectors.toList());
+										if (!amends1.isEmpty()){
+											List<Long> amendIdList = amends1.stream().map(Amends::getId).collect(Collectors.toList());
+											List<FeeCenter> amendsFeeCenterListMhs = amendsFeeCenterListMh.stream().filter(e-> amendIdList.contains(e.getPid()))
+												.collect(Collectors.toList());
+											if (!amendsFeeCenterListMhs.isEmpty()){
+												for (FeeCenter items : amendsFeeCenterListMhs) {
+													if (ObjectUtils.isNotNull(items.getShortName())) {
+														items.setCorpCnName(items.getShortName());
+													} else {
+														items.setCorpCnName("无");
+													}
+													if (ObjectUtils.isNotNull(items.getBillShortName())) {
+														items.setBillCorpCnName(items.getBillShortName());
+													} else {
+														items.setBillCorpCnName("无");
+													}
+												}
+												List<FeeCenter> feeCenterList = amendsFeeCenterListMhs.stream()
+													.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+														Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode() + f.getReportType()))), ArrayList::new));
+												List<FeeCenterReports> feeCenterReportList = new ArrayList<>();
+												for (FeeCenter fee : feeCenterList) {
+													FeeCenterReports feeCenterReports = new FeeCenterReports();
+													feeCenterReports.setRemarks(fee.getRemarks());
+													feeCenterReports.setPid(item.getId());
+													feeCenterReports.setFeeCnName(fee.getFeeCnName());
+													feeCenterReports.setDc(fee.getDc());
+													List<FeeCenter> feeCenterListD;
+													List<FeeCenter> feeCenterListUsdD;
+													List<FeeCenter> feeCenterListC;
+													List<FeeCenter> feeCenterListUsdC;
+													if (MagicValues.ONE.equals(fee.getReportType())) {
+														feeCenterListD = amendsFeeCenterListMhs.stream()
+															.filter(e -> MagicValues.D.equals(e.getDc()) && e.getPid().equals(amends.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+														feeCenterListUsdD = amendsFeeCenterListMhs.stream()
+															.filter(e -> MagicValues.D.equals(e.getDc()) && e.getPid().equals(amends.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && !exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+														feeCenterListC = amendsFeeCenterListMhs.stream()
+															.filter(e -> MagicValues.C.equals(e.getDc()) && e.getPid().equals(amends.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+														feeCenterListUsdC = amendsFeeCenterListMhs.stream()
+															.filter(e -> MagicValues.C.equals(e.getDc()) && e.getPid().equals(amends.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && !exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+													} else if (MagicValues.TWO.equals(fee.getReportType())) {
+														feeCenterListD = feeCenterList.stream()
+															.filter(e -> MagicValues.D.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(item.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+														feeCenterListUsdD = feeCenterList.stream()
+															.filter(e -> MagicValues.D.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(item.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && !exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+														feeCenterListC = feeCenterList.stream()
+															.filter(e -> MagicValues.C.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(item.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+														feeCenterListUsdC = feeCenterList.stream()
+															.filter(e -> MagicValues.C.equals(e.getDc()) && !e.getPid().equals(amends.getId()) && !e.getPid().equals(item.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && !exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+													} else {
+														feeCenterListD = amendsFeeCenterListMhs.stream()
+															.filter(e -> MagicValues.D.equals(e.getDc()) && e.getPid().equals(item.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+														feeCenterListUsdD = amendsFeeCenterListMhs.stream()
+															.filter(e -> MagicValues.D.equals(e.getDc()) && e.getPid().equals(item.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && !exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+														feeCenterListC = amendsFeeCenterListMhs.stream()
+															.filter(e -> MagicValues.C.equals(e.getDc()) && e.getPid().equals(item.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+														feeCenterListUsdC = amendsFeeCenterListMhs.stream()
+															.filter(e -> MagicValues.C.equals(e.getDc()) && e.getPid().equals(item.getId()) &&
+																e.getFeeId().equals(fee.getFeeId()) && !exrateType.equals(e.getCurCode()) && fee.getCurCode().equals(e.getCurCode()) &&
+																e.getCorpId().equals(fee.getCorpId()) && e.getReportType().equals(fee.getReportType()))
+															.collect(Collectors.toList());
+													}
+
+													if (!feeCenterListD.isEmpty()) {
+														BCorps bCorps = bCorpsList.stream().filter(e -> e.getId().equals(fee.getCorpId())).findFirst().orElse(null);
+														if (bCorps != null && ObjectUtils.isNotNull(bCorps.getShortName())) {
+															feeCenterReports.setBillCorpCnName(bCorps.getShortName());
+														} else {
+															feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
+														}
+														feeCenterReports.setAmountD(feeCenterListD.stream().map(FeeCenter::getAmount)
+															.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+														feeCenterReports.setAmountLocD(feeCenterListD.stream().map(FeeCenter::getAmountLoc)
+															.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+													}
+
+													if (!feeCenterListUsdD.isEmpty()) {
+														BCorps bCorps = bCorpsList.stream().filter(e -> e.getId().equals(fee.getCorpId())).findFirst().orElse(null);
+														if (bCorps != null && ObjectUtils.isNotNull(bCorps.getShortName())) {
+															feeCenterReports.setBillCorpCnName(bCorps.getShortName());
+														} else {
+															feeCenterReports.setBillCorpCnName(fee.getCorpCnName());
+														}
+														feeCenterReports.setAmountUsdD(feeCenterListUsdD.stream().map(FeeCenter::getAmount)
+															.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+														feeCenterReports.setAmountLocD(feeCenterListUsdD.stream().map(FeeCenter::getAmountLoc)
+															.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+													}
+
+													if (!feeCenterListC.isEmpty()) {
+														BCorps bCorps = bCorpsList.stream().filter(e -> e.getId().equals(fee.getCorpId())).findFirst().orElse(null);
+														if (bCorps != null && ObjectUtils.isNotNull(bCorps.getShortName())) {
+															feeCenterReports.setCorpCnName(bCorps.getShortName());
+														} else {
+															feeCenterReports.setCorpCnName(fee.getCorpCnName());
+														}
+														feeCenterReports.setAmountC(feeCenterListC.stream().map(FeeCenter::getAmount)
+															.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+														feeCenterReports.setAmountLocC(feeCenterListC.stream().map(FeeCenter::getAmountLoc)
+															.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+													}
+
+													if (!feeCenterListUsdC.isEmpty()) {
+														BCorps bCorps = bCorpsList.stream().filter(e -> e.getId().equals(fee.getCorpId())).findFirst().orElse(null);
+														if (bCorps != null && ObjectUtils.isNotNull(bCorps.getShortName())) {
+															feeCenterReports.setCorpCnName(bCorps.getShortName());
+														} else {
+															feeCenterReports.setCorpCnName(fee.getCorpCnName());
+														}
+														feeCenterReports.setAmountUsdC(feeCenterListUsdC.stream().map(FeeCenter::getAmount)
+															.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+														feeCenterReports.setAmountLocC(feeCenterListUsdC.stream().map(FeeCenter::getAmountLoc)
+															.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+													}
+													feeCenterReportList.add(feeCenterReports);
+												}
+												item.setFeeCenterList(feeCenterReportList);
+											}
+										}
+										list.add(item);
+									}
+								}
 							}
 						}
 						LambdaQueryWrapper<FeeCenter> feeCenterLambdaQueryWrapper = new LambdaQueryWrapper<FeeCenter>()

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/controller/StorageFeesController.java

@@ -0,0 +1,126 @@
+/*
+ *      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.basic.storage.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.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.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.basic.storage.entity.StorageFees;
+import org.springblade.los.basic.storage.vo.StorageFeesVO;
+import org.springblade.los.basic.storage.service.IStorageFeesService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 仓储费表 控制器
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/storagefees")
+@Api(value = "仓储费表", tags = "仓储费表接口")
+public class StorageFeesController extends BladeController {
+
+	private final IStorageFeesService storageFeesService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入storageFees")
+	public R<StorageFees> detail(StorageFees storageFees) {
+		StorageFees detail = storageFeesService.detail(storageFees);
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 仓储费表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入storageFees")
+	public R<IPage<StorageFees>> list(StorageFees storageFees, Query query) {
+		IPage<StorageFees> pages = storageFeesService.page(Condition.getPage(query), Condition.getQueryWrapper(storageFees));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 仓储费表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入storageFees")
+	public R<IPage<StorageFeesVO>> page(StorageFeesVO storageFees, Query query) {
+		IPage<StorageFeesVO> pages = storageFeesService.selectStorageFeesPage(Condition.getPage(query), storageFees);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 仓储费表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入storageFees")
+	public R save(@Valid @RequestBody StorageFees storageFees) {
+		return R.status(storageFeesService.save(storageFees));
+	}
+
+	/**
+	 * 修改 仓储费表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入storageFees")
+	public R update(@Valid @RequestBody StorageFees storageFees) {
+		return R.status(storageFeesService.updateById(storageFees));
+	}
+
+	/**
+	 * 新增或修改 仓储费表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入storageFees")
+	public R submit(@Valid @RequestBody StorageFees storageFees) {
+		return storageFeesService.submit(storageFees);
+	}
+
+
+	/**
+	 * 删除 仓储费表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(storageFeesService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/controller/StorageFeesItemsController.java

@@ -0,0 +1,126 @@
+/*
+ *      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.basic.storage.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.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.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.basic.storage.entity.StorageFeesItems;
+import org.springblade.los.basic.storage.vo.StorageFeesItemsVO;
+import org.springblade.los.basic.storage.service.IStorageFeesItemsService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 仓储费明细表 控制器
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/storagefeesitems")
+@Api(value = "仓储费明细表", tags = "仓储费明细表接口")
+public class StorageFeesItemsController extends BladeController {
+
+	private final IStorageFeesItemsService storageFeesItemsService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入storageFeesItems")
+	public R<StorageFeesItems> detail(StorageFeesItems storageFeesItems) {
+		StorageFeesItems detail = storageFeesItemsService.getOne(Condition.getQueryWrapper(storageFeesItems));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 仓储费明细表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入storageFeesItems")
+	public R<IPage<StorageFeesItems>> list(StorageFeesItems storageFeesItems, Query query) {
+		IPage<StorageFeesItems> pages = storageFeesItemsService.page(Condition.getPage(query), Condition.getQueryWrapper(storageFeesItems));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 仓储费明细表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入storageFeesItems")
+	public R<IPage<StorageFeesItemsVO>> page(StorageFeesItemsVO storageFeesItems, Query query) {
+		IPage<StorageFeesItemsVO> pages = storageFeesItemsService.selectStorageFeesItemsPage(Condition.getPage(query), storageFeesItems);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 仓储费明细表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入storageFeesItems")
+	public R save(@Valid @RequestBody StorageFeesItems storageFeesItems) {
+		return R.status(storageFeesItemsService.save(storageFeesItems));
+	}
+
+	/**
+	 * 修改 仓储费明细表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入storageFeesItems")
+	public R update(@Valid @RequestBody StorageFeesItems storageFeesItems) {
+		return R.status(storageFeesItemsService.updateById(storageFeesItems));
+	}
+
+	/**
+	 * 新增或修改 仓储费明细表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入storageFeesItems")
+	public R submit(@Valid @RequestBody StorageFeesItems storageFeesItems) {
+		return R.status(storageFeesItemsService.saveOrUpdate(storageFeesItems));
+	}
+
+	
+	/**
+	 * 删除 仓储费明细表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(storageFeesItemsService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/mapper/StorageFeesItemsMapper.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.basic.storage.mapper;
+
+import org.springblade.los.basic.storage.entity.StorageFeesItems;
+import org.springblade.los.basic.storage.vo.StorageFeesItemsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 仓储费明细表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+public interface StorageFeesItemsMapper extends BaseMapper<StorageFeesItems> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param storageFeesItems
+	 * @return
+	 */
+	List<StorageFeesItemsVO> selectStorageFeesItemsPage(IPage page, StorageFeesItemsVO storageFeesItems);
+
+}

+ 29 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/mapper/StorageFeesItemsMapper.xml

@@ -0,0 +1,29 @@
+<?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.basic.storage.mapper.StorageFeesItemsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="storageFeesItemsResultMap" type="org.springblade.los.basic.storage.entity.StorageFeesItems">
+        <id column="id" property="id"/>
+        <result column="pid" property="pid"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+        <result column="start_day" property="startDay"/>
+        <result column="end_day" property="endDay"/>
+        <result column="price_20gp" property="price20gp"/>
+        <result column="branch_name" property="branchName"/>
+        <result column="branch_id" property="branchId"/>
+        <result column="price_40gp" property="price40gp"/>
+        <result column="price_40hc" property="price40hc"/>
+    </resultMap>
+
+
+    <select id="selectStorageFeesItemsPage" resultMap="storageFeesItemsResultMap">
+        select * from los_storage_fees_items where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/mapper/StorageFeesMapper.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.basic.storage.mapper;
+
+import org.springblade.los.basic.storage.entity.StorageFees;
+import org.springblade.los.basic.storage.vo.StorageFeesVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 仓储费表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+public interface StorageFeesMapper extends BaseMapper<StorageFees> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param storageFees
+	 * @return
+	 */
+	List<StorageFeesVO> selectStorageFeesPage(IPage page, StorageFeesVO storageFees);
+
+}

+ 25 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/mapper/StorageFeesMapper.xml

@@ -0,0 +1,25 @@
+<?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.basic.storage.mapper.StorageFeesMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="storageFeesResultMap" type="org.springblade.los.basic.storage.entity.StorageFees">
+        <id column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+        <result column="status" property="status"/>
+        <result column="type" property="type"/>
+        <result column="branch_name" property="branchName"/>
+        <result column="branch_id" property="branchId"/>
+    </resultMap>
+
+
+    <select id="selectStorageFeesPage" resultMap="storageFeesResultMap">
+        select * from los_storage_fees where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/service/IStorageFeesItemsService.java

@@ -0,0 +1,41 @@
+/*
+ *      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.basic.storage.service;
+
+import org.springblade.los.basic.storage.entity.StorageFeesItems;
+import org.springblade.los.basic.storage.vo.StorageFeesItemsVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 仓储费明细表 服务类
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+public interface IStorageFeesItemsService extends IService<StorageFeesItems> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param storageFeesItems
+	 * @return
+	 */
+	IPage<StorageFeesItemsVO> selectStorageFeesItemsPage(IPage<StorageFeesItemsVO> page, StorageFeesItemsVO storageFeesItems);
+
+}

+ 45 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/service/IStorageFeesService.java

@@ -0,0 +1,45 @@
+/*
+ *      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.basic.storage.service;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.los.basic.storage.entity.StorageFees;
+import org.springblade.los.basic.storage.vo.StorageFeesVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 仓储费表 服务类
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+public interface IStorageFeesService extends IService<StorageFees> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param storageFees
+	 * @return
+	 */
+	IPage<StorageFeesVO> selectStorageFeesPage(IPage<StorageFeesVO> page, StorageFeesVO storageFees);
+
+    R submit(StorageFees storageFees);
+
+	StorageFees detail(StorageFees storageFees);
+}

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/service/impl/StorageFeesItemsServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      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.basic.storage.service.impl;
+
+import org.springblade.los.basic.storage.entity.StorageFeesItems;
+import org.springblade.los.basic.storage.vo.StorageFeesItemsVO;
+import org.springblade.los.basic.storage.mapper.StorageFeesItemsMapper;
+import org.springblade.los.basic.storage.service.IStorageFeesItemsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 仓储费明细表 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+@Service
+public class StorageFeesItemsServiceImpl extends ServiceImpl<StorageFeesItemsMapper, StorageFeesItems> implements IStorageFeesItemsService {
+
+	@Override
+	public IPage<StorageFeesItemsVO> selectStorageFeesItemsPage(IPage<StorageFeesItemsVO> page, StorageFeesItemsVO storageFeesItems) {
+		return page.setRecords(baseMapper.selectStorageFeesItemsPage(page, storageFeesItems));
+	}
+
+}

+ 130 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/storage/service/impl/StorageFeesServiceImpl.java

@@ -0,0 +1,130 @@
+/*
+ *      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.basic.storage.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.los.basic.storage.entity.StorageFees;
+import org.springblade.los.basic.storage.entity.StorageFeesItems;
+import org.springblade.los.basic.storage.mapper.StorageFeesMapper;
+import org.springblade.los.basic.storage.service.IStorageFeesItemsService;
+import org.springblade.los.basic.storage.service.IStorageFeesService;
+import org.springblade.los.basic.storage.vo.StorageFeesVO;
+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;
+import java.util.stream.Collectors;
+
+/**
+ * 仓储费表 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-06-03
+ */
+@Service
+@AllArgsConstructor
+public class StorageFeesServiceImpl extends ServiceImpl<StorageFeesMapper, StorageFees> implements IStorageFeesService {
+
+	private final IStorageFeesItemsService storageFeesItemsService;
+
+	private final ISysClient sysClient;
+
+	@Override
+	public IPage<StorageFeesVO> selectStorageFeesPage(IPage<StorageFeesVO> page, StorageFeesVO storageFees) {
+		return page.setRecords(baseMapper.selectStorageFeesPage(page, storageFees));
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R submit(StorageFees storageFees) {
+		String deptId;
+		String deptName = "";
+		String branchId = null;
+		if (ObjectUtils.isNotNull(storageFees.getBranchId())) {
+			deptId = storageFees.getBranchId();
+			branchId = storageFees.getBranchId();
+			deptName = storageFees.getBranchName();
+		} else {
+			deptId = AuthUtil.getDeptId();
+		}
+		//获取部门ids对应中文名
+		R<List<String>> res = sysClient.getDeptNames(deptId);
+		if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+			deptName = String.join(",", res.getData());
+		}
+		List<StorageFees> cname = baseMapper.selectList(new LambdaQueryWrapper<StorageFees>()
+			.eq(StorageFees::getType, storageFees.getType())
+			.eq(StorageFees::getTenantId, AuthUtil.getTenantId())
+			.eq(StorageFees::getIsDeleted, 0));
+		if (storageFees.getId() == null) {
+			if (!cname.isEmpty()) {
+				throw new RuntimeException("类型不允许重复");
+			}
+			storageFees.setCreateTime(new Date());
+			storageFees.setCreateUser(AuthUtil.getUserId());
+			storageFees.setBranchId(branchId);
+			storageFees.setBranchName(deptName);
+		} else {
+			List<Long> ids = cname.stream().map(StorageFees::getId).distinct().collect(Collectors.toList());
+			if (!cname.isEmpty() && !ids.contains(storageFees.getId())) {
+				throw new RuntimeException("类型不允许重复");
+			}
+			storageFees.setUpdateUser(AuthUtil.getUserId());
+			storageFees.setUpdateTime(new Date());
+		}
+		this.saveOrUpdate(storageFees);
+		//客户银行
+		if (ObjectUtils.isNotNull(storageFees.getStorageFeesItemsList())) {
+			for (StorageFeesItems item : storageFees.getStorageFeesItemsList()) {
+				if (item.getId() == null) {
+					item.setPid(storageFees.getId());
+					item.setCreateTime(new Date());
+					item.setCreateUser(AuthUtil.getUserId());
+					item.setBranchId(branchId);
+				} else {
+					item.setUpdateUser(AuthUtil.getUserId());
+					item.setUpdateTime(new Date());
+				}
+			}
+			storageFeesItemsService.saveOrUpdateBatch(storageFees.getStorageFeesItemsList());
+		}
+		return R.data(storageFees);
+	}
+
+	@Override
+	public StorageFees detail(StorageFees storageFees) {
+		if (storageFees.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		StorageFees detail = baseMapper.selectById(storageFees.getId());
+		detail.setStorageFeesItemsList(storageFeesItemsService.list(new LambdaQueryWrapper<StorageFeesItems>()
+			.eq(StorageFeesItems::getIsDeleted, 0)
+			.eq(StorageFeesItems::getTenantId, AuthUtil.getTenantId())
+			.eq(StorageFeesItems::getPid, storageFees.getId())
+		));
+		return detail;
+	}
+
+}

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

@@ -350,4 +350,20 @@ public class TradingBoxController extends BladeController {
 		return R.data(tradingBox);
 	}
 
+	/**
+	 * OW计算超期箱使费
+	 */
+	@GetMapping("/countOverdueFee")
+	public R countOverdueFee(TradingBox tradingBox) {
+		return tradingBoxService.countOverdueFee(tradingBox);
+	}
+
+	/**
+	 * OW撤销计算超期箱使费
+	 */
+	@GetMapping("/revokeCountOverdueFee")
+	public R revokeCountOverdueFee(TradingBox tradingBox) {
+		return tradingBoxService.revokeCountOverdueFee(tradingBox);
+	}
+
 }

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

@@ -65,4 +65,8 @@ public interface ITradingBoxService extends IService<TradingBox> {
 	R revokeCountRent(TradingBox tradingBox);
 
 	List<Map<String, Object>> trend(String tenantId, String type, String date);
+
+	R countOverdueFee(TradingBox tradingBox);
+
+	R revokeCountOverdueFee(TradingBox tradingBox);
 }

+ 328 - 21
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxServiceImpl.java

@@ -27,7 +27,6 @@ import org.springblade.los.Util.CurrencyUtils;
 import org.springblade.los.basic.business.entity.BusinessType;
 import org.springblade.los.basic.business.service.IBusinessTypeService;
 import org.springblade.los.basic.cur.entity.BCurExrate;
-import org.springblade.los.basic.cur.service.IBCurrencyService;
 import org.springblade.los.basic.fees.entity.BFees;
 import org.springblade.los.basic.fees.service.IBFeesService;
 import org.springblade.los.billno.entity.BusinessBillNo;
@@ -36,6 +35,12 @@ import org.springblade.los.box.dto.ExportTradingBoxItemOut;
 import org.springblade.los.box.entity.*;
 import org.springblade.los.box.mapper.TradingBoxMapper;
 import org.springblade.los.box.service.*;
+import org.springblade.los.business.sea.entity.Bills;
+import org.springblade.los.business.sea.entity.Containers;
+import org.springblade.los.business.sea.entity.SeaContainerNumberItem;
+import org.springblade.los.business.sea.service.IBillsService;
+import org.springblade.los.business.sea.service.IContainersService;
+import org.springblade.los.business.sea.service.ISeaContainerNumberItemService;
 import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springblade.los.finance.fee.service.IFeeCenterService;
 import org.springframework.stereotype.Service;
@@ -88,6 +93,12 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 
 	private final CurrencyUtils currencyUtils;
 
+	private final ISeaContainerNumberItemService seaContainerNumberItemService;
+
+	private final IBillsService billsService;
+
+	private final IContainersService containersService;
+
 	@Override
 	public TradingBox getDetail(TradingBox tradingBox) {
 		if (tradingBox.getId() == null) {
@@ -277,7 +288,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			date = new Date();
 		}
 		String exrateType = currencyUtils.standardCurrency(AuthUtil.getDeptId());
-		List<BCurExrate> curExrateList = currencyUtils.obtainRate(date, "1",AuthUtil.getDeptId());
+		List<BCurExrate> curExrateList = currencyUtils.obtainRate(date, "1", AuthUtil.getDeptId());
 		//明细数据
 		if (ObjectUtils.isNotNull(tradingBox.getTradingBoxItemsList()) && !tradingBox.getTradingBoxItemsList().isEmpty()) {
 			BigDecimal amount = tradingBox.getTradingBoxItemsList().stream().filter(e -> exrateType.equals(e.getCurrency()))
@@ -566,7 +577,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			throw new RuntimeException("未查到单据");
 		}
 		String exrateType = currencyUtils.standardCurrency(AuthUtil.getDeptId());
-		List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1",AuthUtil.getDeptId());
+		List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", AuthUtil.getDeptId());
 		if ("1".equals(tradingBox.getRentType())) {
 			detail.setBuxStaus("已启租");
 			detail.setRentEndDate(tradingBox.getRentDate());
@@ -695,7 +706,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 					feeCenter.setExrate(new BigDecimal("1.00"));
 				} else {
 					feeCenter.setAmountLoc(feeCenter.getPrice().multiply(feeCenter.getQuantity()));
-					feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList,  feeCenter.getCurCode(), "1"));
+					feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList, feeCenter.getCurCode(), "1"));
 				}
 				feeCenter.setBillNo(tradingBox.getSysNo());
 				feeCenter.setBusinessType(tradingBox.getType());
@@ -764,7 +775,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 						} else {
 							feeCenter.setAmountLoc(feeCenter.getPrice().multiply(feeCenter.getQuantity())
 								.multiply(new BigDecimal(feeCenter.getDays() + "")));
-							feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList,  feeCenter.getCurCode(), "1"));
+							feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList, feeCenter.getCurCode(), "1"));
 							feeCenter.setRemarks("租金" + feeCenter.getAmountLoc() + "=" + feeCenter.getPrice() + "箱/天*箱数" + feeCenter.getQuantity() + "*天数" + feeCenter.getDays());
 						}
 					}
@@ -887,7 +898,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		List<FeeCenter> feeCenterList = new ArrayList<>();
 		List<TradingBoxItem> itemList = new ArrayList<>();
 		String exrateType = currencyUtils.standardCurrency(AuthUtil.getDeptId());
-		List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1",AuthUtil.getDeptId());
+		List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", AuthUtil.getDeptId());
 		for (TradingBoxType item : tradingBoxTypeList) {
 			List<TradingBoxItem> tradingBoxItems = tradingBoxItemList.stream().filter(e -> e.getBoxType().equals(item.getBoxType()))
 				.collect(Collectors.toList());
@@ -933,7 +944,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 					if (exrateType.equals(feeCenter.getCurCode())) {
 						feeCenter.setExrate(new BigDecimal("1.00"));
 					} else {
-						feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList,  feeCenter.getCurCode(), "1"));
+						feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList, feeCenter.getCurCode(), "1"));
 					}
 					feeCenter.setRemarks("租金" + feeCenter.getAmount() + "=" + feeCenter.getPrice() + "箱/天*箱数" + feeCenter.getQuantity() + "*天数" + feeCenter.getDays());
 
@@ -981,13 +992,6 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		if (tradingBoxItemList.isEmpty()) {
 			throw new RuntimeException("明细不能为空");
 		}
-		BFees fees = bFeesService.getOne(new LambdaQueryWrapper<BFees>()
-			.eq(BFees::getTenantId, AuthUtil.getTenantId())
-			.eq(BFees::getIsDeleted, 0)
-			.eq(BFees::getCode, "BOX-ZJ"));
-		if (fees == null) {
-			throw new RuntimeException("请先维护费用基础信息");
-		}
 		List<TradingBoxType> tradingBoxTypeList = tradingBoxTypeService.list(new LambdaQueryWrapper<TradingBoxType>()
 			.eq(TradingBoxType::getTenantId, AuthUtil.getTenantId())
 			.eq(TradingBoxType::getIsDeleted, 0)
@@ -1001,7 +1005,8 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			.eq(FeeCenter::getPid, tradingBox.getId())
 			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 			.in(FeeCenter::getUnitNo, tradingBoxTypeList.stream().map(TradingBoxType::getBoxType).collect(Collectors.toList()))
-			.eq(FeeCenter::getFeeCode, fees.getCode())
+			.eq(FeeCenter::getFeeCode, "BOX-ZJ")
+			.eq(FeeCenter::getAutomaticGenerated, "1")
 			.orderByDesc(FeeCenter::getCreateTime);
 		List<FeeCenter> feeCenters = feeCenterService.list(tradingBoxFeesLambdaQueryWrapper);
 		if (feeCenters.isEmpty()) {
@@ -2104,7 +2109,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		List<FeeCenter> feeCenterList = new ArrayList<>();
 		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
 		String exrateType = currencyUtils.standardCurrency(AuthUtil.getDeptId());
-		List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1",AuthUtil.getDeptId());
+		List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", AuthUtil.getDeptId());
 		for (TradingBoxItem item : putBoxItemsList) {
 			FeeCenter feeCenter = new FeeCenter();
 			feeCenter.setBillType("箱东");
@@ -2188,7 +2193,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 			if (exrateType.equals(feeCenter.getCurCode())) {
 				feeCenter.setExrate(new BigDecimal("1.00"));
 			} else {
-				feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList,  feeCenter.getCurCode(), "1"));
+				feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList, feeCenter.getCurCode(), "1"));
 			}
 			feeCenter.setAmount(amount);
 			feeCenter.setPrice(amount);
@@ -2278,12 +2283,14 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		tradingBoxFeesLambdaQueryWrapper.eq(FeeCenter::getIsDeleted, 0)
 			.eq(FeeCenter::getPid, tradingBox.getId())
 			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+			.eq(FeeCenter::getFeeCode, "BOX-ZJ")
+			.eq(FeeCenter::getAutomaticGenerated, "1")
 			.orderByDesc(FeeCenter::getCreateTime);
 		List<FeeCenter> feeCentersList = feeCenterService.list(tradingBoxFeesLambdaQueryWrapper);
 		if (feeCentersList.isEmpty()) {
 			throw new RuntimeException("未查到费用明细");
 		}
-		List<FeeCenter> feeCenters = feeCentersList.stream().filter(e-> e.getFeeCode().equals("BOX-ZJ")).collect(Collectors.toList());
+		List<FeeCenter> feeCenters = feeCentersList.stream().filter(e -> e.getFeeCode().equals("BOX-ZJ")).collect(Collectors.toList());
 		if (feeCenters.isEmpty()) {
 			throw new RuntimeException("未计算过租金,撤销失败");
 		}
@@ -2316,10 +2323,10 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		if (!itemList.isEmpty()) {
 			tradingBoxItemService.updateBatchById(itemList);
 		}
-		if (!feeId.isEmpty()){
+		if (!feeId.isEmpty()) {
 			String exrateType = currencyUtils.standardCurrency(AuthUtil.getDeptId());
-			List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1",AuthUtil.getDeptId());
-			List<FeeCenter> feeCenterList = feeCentersList.stream().filter(e-> !feeId.contains(e.getId())).collect(Collectors.toList());
+			List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", AuthUtil.getDeptId());
+			List<FeeCenter> feeCenterList = feeCentersList.stream().filter(e -> !feeId.contains(e.getId())).collect(Collectors.toList());
 			//费用数据
 			BigDecimal amountD = new BigDecimal("0.00");
 			BigDecimal amountC = new BigDecimal("0.00");
@@ -2366,4 +2373,304 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 		return baseMapper.trend(AuthUtil.getTenantId(), type, date);
 	}
 
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R countOverdueFee(TradingBox tradingBox) {
+		if (tradingBox.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		TradingBox detail = baseMapper.selectById(tradingBox.getId());
+		if (detail == null) {
+			throw new RuntimeException("未查到单据信息");
+		}
+		PutBox putBox = putBoxService.getOne(new LambdaQueryWrapper<PutBox>()
+			.eq(PutBox::getTenantId, AuthUtil.getTenantId())
+			.eq(PutBox::getIsDeleted, 0)
+			.eq(PutBox::getContainerNumber, detail.getContainerNumber())
+			.eq(PutBox::getPolId, detail.getPolId())
+			.eq(PutBox::getPolStationId, detail.getPolStationId())
+			.apply("find_in_set(bus_type,'OW(拿),OW(放)')")
+		);
+		if (putBox == null) {
+			throw new RuntimeException("未查到放箱号信息");
+		}
+		List<SeaContainerNumberItem> seaContainerNumberItemList = seaContainerNumberItemService.list(new LambdaQueryWrapper<SeaContainerNumberItem>()
+			.eq(SeaContainerNumberItem::getIsDeleted, 0)
+			.eq(SeaContainerNumberItem::getTenantId, AuthUtil.getTenantId())
+			.eq(SeaContainerNumberItem::getSrcId, putBox.getId()));
+		if (seaContainerNumberItemList.isEmpty()) {
+			throw new RuntimeException("放箱号" + detail.getContainerNumber() + "未使用");
+		}
+		List<Bills> billsList = billsService.list(new LambdaQueryWrapper<Bills>()
+			.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0)
+			.in(Bills::getId, seaContainerNumberItemList.stream().map(SeaContainerNumberItem::getPid).collect(Collectors.toList())));
+		if (billsList.isEmpty()) {
+			throw new RuntimeException("放箱号" + detail.getContainerNumber() + "未查到单据信息");
+		}
+		List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+			.eq(Containers::getIsDeleted, 0)
+			.eq(Containers::getTenantId, AuthUtil.getTenantId())
+			.in(Containers::getPid, billsList.stream().map(Bills::getId).collect(Collectors.toList())));
+		if (containersList.isEmpty()) {
+			throw new RuntimeException("放箱号" + detail.getContainerNumber() + "未查到单据配箱信息");
+		}
+		List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
+			.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
+			.eq(TradingBoxItem::getIsDeleted, 0)
+			.eq(TradingBoxItem::getPid, detail.getId()));
+		if (tradingBoxItemList.isEmpty()) {
+			throw new RuntimeException("未查到单据箱信息");
+		}
+		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("请先维护费用基础信息");
+		}
+		List<FeeCenter> feeCenterList = new ArrayList<>();
+		for (TradingBoxItem item : tradingBoxItemList) {
+			Containers containers = containersList.stream().filter(e -> e.getCntrNo().equals(item.getCode())
+				&& e.getCntrTypeCode().equals(item.getBoxType())).findFirst().orElse(null);
+			if (containers == null) {
+				continue;
+			}
+			Bills bills = billsList.stream().filter(e -> e.getId().equals(containers.getPid())).findFirst().orElse(null);
+			if (bills == null) {
+				continue;
+			}
+			int pol = 0;
+			int pod = 0;
+			if (ObjectUtils.isNotNull(item.getPolPickUpDate()) && ObjectUtils.isNotNull(item.getEtd())) {
+				int polFreeBoxUseDays = ObjectUtils.isNull(bills.getPolFreeBoxUseDays()) ? 0 : bills.getPolFreeBoxUseDays();
+				Instant instant1 = item.getEtd().toInstant();
+				Instant instant2 = item.getPolPickUpDate().toInstant();
+				LocalDate date1 = instant1.atZone(ZoneId.systemDefault()).toLocalDate();
+				LocalDate date2 = instant2.atZone(ZoneId.systemDefault()).toLocalDate();
+				Duration duration = Duration.between(date1.atStartOfDay(), date2.atStartOfDay());
+				pol = Integer.parseInt(duration.toDays() + "") - polFreeBoxUseDays;
+			}
+			if (ObjectUtils.isNotNull(item.getPodReturnDate()) && ObjectUtils.isNotNull(item.getEta())) {
+				int podFreeBoxUseDays = ObjectUtils.isNull(bills.getPodFreeBoxUseDays()) ? 0 : bills.getPodFreeBoxUseDays();
+				Instant instant1 = item.getPodReturnDate().toInstant();
+				Instant instant2 = item.getEta().toInstant();
+				LocalDate date1 = instant1.atZone(ZoneId.systemDefault()).toLocalDate();
+				LocalDate date2 = instant2.atZone(ZoneId.systemDefault()).toLocalDate();
+				Duration duration = Duration.between(date1.atStartOfDay(), date2.atStartOfDay());
+				pod = Integer.parseInt(duration.toDays() + "") - podFreeBoxUseDays;
+			}
+			if (pol > 0) {
+
+			}
+			if (pod > 0) {
+
+			}
+			FeeCenter feeCenter = new FeeCenter();
+			feeCenter.setBillType("箱东");
+			feeCenter.setCorpId(detail.getPurchaseCompanyId());
+			feeCenter.setCorpCnName(detail.getPurchaseCompanyName());
+			feeCenter.setCorpEnName(detail.getPurchaseCompanyName());
+			feeCenter.setCreateTime(new Date());
+			feeCenter.setCreateUser(AuthUtil.getUserId());
+			feeCenter.setCreateUserName(AuthUtil.getUserName());
+			feeCenter.setPid(item.getPid());
+			if ("OW(拿)".equals(detail.getType())) {
+				feeCenter.setDc("C");
+			} else {
+				feeCenter.setDc("D");
+			}
+			feeCenter.setFeeId(fees.getId());
+			feeCenter.setFeeCode(fees.getCode());
+			feeCenter.setFeeCnName(fees.getCnName());
+			feeCenter.setFeeEnName(fees.getEnName());
+			feeCenter.setCurCode(fees.getCurNo());
+			feeCenter.setCntrNo(item.getCode());
+			feeCenter.setUnitNo(item.getBoxType());
+			if (ObjectUtils.isNotNull(item.getPodEmptyContainerReturnDate())
+				&& tradingBox.getRentDate().compareTo(item.getPodEmptyContainerReturnDate()) > 0) {
+				throw new RuntimeException("箱号:" + item.getCode() + "租金计算截止时间大于pod还箱日期");
+			}
+			Instant instant1 = item.getRentEndDate().toInstant();
+			Instant instant2 = tradingBox.getRentDate().toInstant();
+			LocalDate date1 = instant1.atZone(ZoneId.systemDefault()).toLocalDate();
+			LocalDate date2 = instant2.atZone(ZoneId.systemDefault()).toLocalDate();
+			Duration duration = Duration.between(date1.atStartOfDay(), date2.atStartOfDay());
+			Calendar calendar = Calendar.getInstance();
+			calendar.setTime(item.getRentEndDate());
+			calendar.add(Calendar.DAY_OF_MONTH, 1);
+			feeCenter.setDays(Integer.parseInt(duration.toDays() + ""));
+
+			Integer days = feeCenter.getDays();
+			int earlySumDays = 0;
+			if (item.getRentEndDate().compareTo(item.getPolPickUpDate()) != 0) {
+				Instant instant3 = item.getRentEndDate().toInstant();
+				Instant instant4 = item.getPolPickUpDate().toInstant();
+				LocalDate date3 = instant3.atZone(ZoneId.systemDefault()).toLocalDate();
+				LocalDate date4 = instant4.atZone(ZoneId.systemDefault()).toLocalDate();
+				Duration duratio1 = Duration.between(date4.atStartOfDay(), date3.atStartOfDay());
+				earlySumDays = Integer.parseInt(duratio1.toDays() + "") + 1;
+			}
+			String text = "";
+			int dayLength;
+			BigDecimal amount = new BigDecimal("0.00");
+			/*for (RentTerm term : rentTermList) {
+				dayLength = term.getStopDays() - term.getRiseDays() + 1;
+				if (earlySumDays >= dayLength) {
+					earlySumDays -= dayLength;
+					continue;
+				}
+				if (earlySumDays + days > dayLength) {
+					Integer tempDays = dayLength - earlySumDays;
+					earlySumDays = 0;
+					days -= tempDays;
+					BigDecimal calculate = term.getRate().multiply(new BigDecimal(tempDays + ""));
+					amount = amount.add(calculate);
+					text = text + tempDays + "天*" + term.getRate() + "元=" + calculate + "元,";
+				} else {
+					BigDecimal calculate = term.getRate().multiply(new BigDecimal(days + ""));
+					amount = amount.add(calculate);
+					text = text + days + "天*" + term.getRate() + "元=" + calculate + "元";
+					days = 0;
+					break;
+				}
+			}
+			if (days != 0) {
+				BigDecimal calculate = rentTermList.get(rentTermList.size() - 1).getRate().multiply(new BigDecimal(days + ""));
+				amount = amount.add(calculate);
+				text = text + "超出费用:" + days + "天*" + rentTermList.get(rentTermList.size() - 1).getRate() + "元=" + calculate + "元,";
+			}
+			if (exrateType.equals(feeCenter.getCurCode())) {
+				feeCenter.setExrate(new BigDecimal("1.00"));
+			} else {
+				feeCenter.setExrate(currencyUtils.obtainExrate("C", curExrateList, feeCenter.getCurCode(), "1"));
+			}*/
+			feeCenter.setAmount(amount);
+			feeCenter.setPrice(amount);
+			feeCenter.setRemarks(text);
+			feeCenter.setQuantity(new BigDecimal("1"));
+			feeCenter.setOutboundDate(tradingBox.getRentDate());
+			feeCenter.setBillNo(detail.getSysNo());
+			feeCenter.setBusinessType(detail.getType());
+			feeCenter.setBillDate(detail.getPurchaseDate());
+			feeCenter.setBillCorpId(detail.getPurchaseCompanyId());
+			feeCenter.setBillCorpCnName(detail.getPurchaseCompanyName());
+			feeCenter.setBillCorpEnName(detail.getPurchaseCompanyName());
+			feeCenter.setBillShortName(detail.getPurchaseCompanyName());
+			feeCenter.setMblno(detail.getContainerNumber());
+			feeCenter.setPolId(detail.getPolId());
+			feeCenter.setPolCode(detail.getPolCode());
+			feeCenter.setPolCnName(detail.getPolCname());
+			feeCenter.setPolEnName(detail.getPolEname());
+			feeCenter.setAutomaticGenerated("1");
+			feeCenterList.add(feeCenter);
+		}
+		return null;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R revokeCountOverdueFee(TradingBox tradingBox) {
+		if (tradingBox.getId() == null) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		TradingBox detail = baseMapper.selectById(tradingBox.getId());
+		List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
+			.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
+			.eq(TradingBoxItem::getIsDeleted, 0)
+			.eq(TradingBoxItem::getPid, detail.getId())
+		);
+		if (tradingBoxItemList.isEmpty()) {
+			throw new RuntimeException("未查到明细");
+		}
+		//获取订单费用信息
+		LambdaQueryWrapper<FeeCenter> tradingBoxFeesLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		tradingBoxFeesLambdaQueryWrapper.eq(FeeCenter::getIsDeleted, 0)
+			.eq(FeeCenter::getPid, tradingBox.getId())
+			.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+			.eq(FeeCenter::getFeeCode, "CQXSF")
+			.eq(FeeCenter::getAutomaticGenerated, "1")
+			.orderByDesc(FeeCenter::getCreateTime);
+		List<FeeCenter> feeCentersList = feeCenterService.list(tradingBoxFeesLambdaQueryWrapper);
+		if (feeCentersList.isEmpty()) {
+			throw new RuntimeException("未查到费用明细");
+		}
+		List<FeeCenter> feeCenters = feeCentersList.stream().filter(e -> e.getFeeCode().equals("BOX-ZJ")).collect(Collectors.toList());
+		if (feeCenters.isEmpty()) {
+			throw new RuntimeException("未计算过租金,撤销失败");
+		}
+		List<TradingBoxItem> itemList = new ArrayList<>();
+		List<Long> feeId = new ArrayList<>();
+		for (TradingBoxItem item : tradingBoxItemList) {
+			List<FeeCenter> feeCenterList = feeCenters.stream().filter(e -> e.getCntrNo().equals(item.getCode())).collect(Collectors.toList());
+			if (!feeCenterList.isEmpty()) {
+				FeeCenter feeCenter = feeCenterList.get(0);
+				if (1 == feeCenter.getAccStatus()) {
+					throw new RuntimeException("箱型:" + item.getBoxType() + "费用已生成账单,撤销失败");
+				}
+				feeCenterService.removeById(feeCenter.getId());
+				feeId.add(feeCenter.getId());
+				item.setUpdateTime(new Date());
+				item.setUpdateUser(AuthUtil.getUserId());
+				item.setUpdateUserName(AuthUtil.getUserName());
+				item.setCount(item.getCount() - 1);
+				if (feeCenterList.size() == 1) {
+					item.setRentEndDate(item.getPolPickUpDate());
+				} else {
+					Calendar calendar = Calendar.getInstance();
+					calendar.setTime(feeCenter.getStorageDate());
+					calendar.add(Calendar.DAY_OF_MONTH, -1);
+					item.setRentEndDate(calendar.getTime());
+				}
+				itemList.add(item);
+			}
+		}
+		if (!itemList.isEmpty()) {
+			tradingBoxItemService.updateBatchById(itemList);
+		}
+		if (!feeId.isEmpty()) {
+			String exrateType = currencyUtils.standardCurrency(AuthUtil.getDeptId());
+			List<BCurExrate> curExrateList = currencyUtils.obtainRate(new Date(), "1", AuthUtil.getDeptId());
+			List<FeeCenter> feeCenterList = feeCentersList.stream().filter(e -> !feeId.contains(e.getId())).collect(Collectors.toList());
+			//费用数据
+			BigDecimal amountD = new BigDecimal("0.00");
+			BigDecimal amountC = new BigDecimal("0.00");
+			BigDecimal amountDUsd = new BigDecimal("0.00");
+			BigDecimal amountCUsd = new BigDecimal("0.00");
+			BigDecimal amountDrLoc = new BigDecimal("0.00");
+			BigDecimal amountCrLoc = new BigDecimal("0.00");
+			for (FeeCenter item : feeCenterList) {
+				if (exrateType.equals(item.getCurCode())) {
+					if ("D".equals(item.getDc())) {
+						amountD = amountD.add(item.getAmount());
+						amountDrLoc = amountDrLoc.add(item.getAmount());
+					} else {
+						amountC = amountC.add(item.getAmount());
+						amountCrLoc = amountCrLoc.add(item.getAmount());
+					}
+				} else {
+					if ("D".equals(item.getDc())) {
+						amountDUsd = amountDUsd.add(item.getAmountLoc());
+						amountDrLoc = amountDrLoc.add(currencyUtils.converter(item.getDc(), curExrateList, item.getAmount(), item.getCurCode(), "1"));
+					} else {
+						amountCUsd = amountCUsd.add(item.getAmountLoc());
+						amountCrLoc = amountCrLoc.add(currencyUtils.converter(item.getDc(), curExrateList, item.getAmount(), item.getCurCode(), "1"));
+					}
+				}
+			}
+			tradingBox.setAmountD(amountD);
+			tradingBox.setAmountDUsd(amountDUsd);
+			tradingBox.setTotalAmountD(amountDrLoc);
+			tradingBox.setAmountC(amountC);
+			tradingBox.setAmountCUsd(amountCUsd);
+			tradingBox.setTotalAmountC(amountCrLoc);
+			tradingBox.setProfit(tradingBox.getAmountD().subtract(tradingBox.getAmountC()));
+			tradingBox.setProfitUsd(tradingBox.getAmountDUsd().subtract(tradingBox.getAmountCUsd()));
+			tradingBox.setTotalProfit(tradingBox.getTotalAmountD().subtract(tradingBox.getTotalAmountC()));
+			baseMapper.updateById(tradingBox);
+		}
+		tradingBox.setTradingBoxItemsList(tradingBoxItemList);
+		return R.data(tradingBox);
+	}
+
 }

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

@@ -423,6 +423,17 @@ public class BillsController extends BladeController {
 	/**
 	 * 分单添加到主单
 	 */
+	@PostMapping("/increaseReinsurancePolicyTeu")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "分单添加到主单", notes = "传入ids")
+	@RepeatSubmit
+	public R increaseReinsurancePolicyTeu(@RequestParam String ids, @RequestParam String id) {
+		return billsService.increaseReinsurancePolicyTeu(ids, id);
+	}
+
+	/**
+	 * 分单添加到主单
+	 */
 	@PostMapping("/increaseReinsurancePolicy")
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "分单添加到主单", notes = "传入ids")

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

@@ -171,4 +171,6 @@ public interface IBillsService extends IService<Bills> {
 	R revokeReturningSecurityMoney(Bills bills);
 
 	R checkBillsBatch(String billsIds, String url, String pageStatus, String pageLabel);
+
+	R increaseReinsurancePolicyTeu(String ids, String id);
 }

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

@@ -1211,6 +1211,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			BigDecimal amountDrLoc = bills.getAmountDrLoc();
 			BigDecimal amountCrLoc = bills.getAmountCrLoc();
 			BigDecimal amountProfitLoc = bills.getAmountProfitLoc();
+			Integer teuTotal = bills.getTeuTotal();
 			if (!billsList.isEmpty()) {
 				amountDr = amountDr.add(billsList.stream().map(Bills::getAmountDr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCr = amountCr.add(billsList.stream().map(Bills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
@@ -1221,7 +1222,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				amountDrLoc = amountDrLoc.add(billsList.stream().map(Bills::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCrLoc = amountCrLoc.add(billsList.stream().map(Bills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountProfitLoc = amountProfitLoc.add(billsList.stream().map(Bills::getAmountProfitLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				teuTotal = teuTotal + billsList.stream().map(Bills::getTeu).filter(Objects::nonNull).reduce(0, Integer::sum);
 			}
+			bills.setTeuTotal(teuTotal);
 			bills.setAmountDr(amountDr);
 			bills.setAmountCr(amountCr);
 			bills.setAmountProfit(amountProfit);
@@ -1267,6 +1270,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			BigDecimal amountDrLoc = bills.getAmountDrLoc();
 			BigDecimal amountCrLoc = bills.getAmountCrLoc();
 			BigDecimal amountProfitLoc = bills.getAmountProfitLoc();
+			Integer teuTotal = bills.getTeuTotal();
 			if (!billsList.isEmpty()) {
 				amountDr = amountDr.subtract(billsList.stream().map(Bills::getAmountDr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCr = amountCr.subtract(billsList.stream().map(Bills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
@@ -1277,7 +1281,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				amountDrLoc = amountDrLoc.subtract(billsList.stream().map(Bills::getAmountDrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCrLoc = amountCrLoc.subtract(billsList.stream().map(Bills::getAmountCrLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountProfitLoc = amountProfitLoc.subtract(billsList.stream().map(Bills::getAmountProfitLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				amountProfitLoc = amountProfitLoc.subtract(billsList.stream().map(Bills::getAmountProfitLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+				teuTotal = teuTotal - billsList.stream().map(Bills::getTeu).filter(Objects::nonNull).reduce(0, Integer::sum);
 			}
+			bills.setTeuTotal(teuTotal);
 			bills.setAmountDr(amountDr);
 			bills.setAmountCr(amountCr);
 			bills.setAmountProfit(amountProfit);
@@ -3270,6 +3277,50 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		return R.success("操作成功");
 	}
 
+	@Override
+	public R increaseReinsurancePolicyTeu(String ids, String id) {
+		if (ObjectUtils.isNull(ids) || ObjectUtils.isNull(id)) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		Bills bills = baseMapper.selectById(id);
+		List<Long> idArr = Func.toLongList(ids);
+		if (!idArr.isEmpty() && bills != null) {
+			if (3 == bills.getBillStatus()) {
+				throw new RuntimeException("主单已完成,操作失败");
+			}
+			if (1 == bills.getBillStatus()) {
+				throw new RuntimeException("主单已退舱,操作失败");
+			}
+			if (bills.getStatus() > 0 && bills.getStatus() < 3) {
+				throw new RuntimeException("主单提交请核,操作失败");
+			}
+			if (ObjectUtils.isNull(bills.getMblno())) {
+				throw new RuntimeException("主单提单号不能为空,操作失败");
+			}
+			if (ObjectUtils.isNull(bills.getPodId())) {
+				throw new RuntimeException("卸货港不能为空,操作失败");
+			}
+			if (ObjectUtils.isNull(bills.getPolId())) {
+				throw new RuntimeException("装货港不能为空,操作失败");
+			}
+			List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+				.eq(Bills::getTenantId, AuthUtil.getTenantId())
+				.eq(Bills::getIsDeleted, 0)
+				.in(Bills::getId, idArr));
+			for (Bills item : billsList) {
+				if (ObjectUtils.isNotNull(item.getMasterId()) && item.getMasterId() != 0) {
+					throw new RuntimeException("分单号:" + item.getBillNo() + "已添加主单,请勿重复添加");
+				}
+			}
+			Integer teu = bills.getTeu();
+			Integer teus = billsList.stream().map(Bills::getTeu).filter(Objects::nonNull).reduce(0, Integer::sum);
+			if (teu < teus+bills.getTeuTotal()) {
+				return R.data("分单订舱TEU大于主单订舱TEU");
+			}
+		}
+		return R.data("操作成功");
+	}
+
 	/**
 	 * 删除海运进出口明细表
 	 *

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

@@ -26,6 +26,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.los.Util.CurrencyUtils;
 import org.springblade.los.basic.corps.entity.BCorps;
+import org.springblade.los.basic.corps.mapper.CorpsMapper;
 import org.springblade.los.basic.corps.service.IBCorpsService;
 import org.springblade.los.basic.cur.entity.BCurExrate;
 import org.springblade.los.basic.fees.entity.BFees;
@@ -74,6 +75,8 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 
 	private final BillsMapper billsMapper;
 
+	private final CorpsMapper corpsMapper;
+
 	private final AmendsMapper amendsMapper;
 
 	private final IBCorpsService bCorpsService;
@@ -194,6 +197,21 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 			.eq(PreContainers::getIsDeleted, 0)
 			.eq(PreContainers::getPid, bills.getId()));
 		if (!losBFeesTemplate.getFeesTemplateItemsList().isEmpty()) {
+			List<Long> idList = new ArrayList<>();
+			idList.add(bills.getCorpId());
+			idList.add(bills.getCyId());
+			idList.add(bills.getCarrierId());
+			idList.add(bills.getBookingAgentId());
+			idList.add(bills.getMconsigneeId());
+			idList.add(bills.getMnotifyId());
+			idList.addAll(losBFeesTemplate.getFeesTemplateItemsList().stream().map(FeesTemplateItems::getCorpId).filter(Objects::nonNull).collect(Collectors.toList()));
+			List<BCorps> corpsList = new ArrayList<>();
+			if (!idList.isEmpty()) {
+				corpsList = corpsMapper.selectList(new LambdaQueryWrapper<BCorps>()
+					.eq(BCorps::getTenantId, AuthUtil.getTenantId())
+					.eq(BCorps::getIsDeleted, 0)
+					.in(BCorps::getId, idList));
+			}
 			int count = 1;
 			for (FeesTemplateItems items : losBFeesTemplate.getFeesTemplateItemsList()) {
 				FeeCenter feeCenter = new FeeCenter();
@@ -232,39 +250,59 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 				count++;
 				if ("客户".equals(items.getCorpType())) {
 					feeCenter.setCorpId(bills.getCorpId());
-					feeCenter.setCorpCnName(bills.getCorpCnName());
+					feeCenter.setCorpCnName(bills.getShortName());
 					feeCenter.setCorpEnName(bills.getCorpEnName());
 					feeCenter.setShortName(bills.getShortName());
 				} else if ("船公司".equals(items.getCorpType())) {
 					feeCenter.setCorpId(bills.getCarrierId());
-					feeCenter.setCorpCnName(bills.getCarrierCnName());
+					feeCenter.setCorpCnName(bills.getCarrierShortName());
 					feeCenter.setCorpEnName(bills.getCarrierEnName());
-					feeCenter.setShortName(bills.getCarrierCnName());
+					feeCenter.setShortName(bills.getCarrierShortName());
 				} else if ("场站".equals(items.getCorpType())) {
+					BCorps bCorps = null;
+					if (!corpsList.isEmpty()) {
+						bCorps = corpsList.stream().filter(e -> e.getId().equals(bills.getCyId())).findFirst().orElse(null);
+					}
 					feeCenter.setCorpId(bills.getCyId());
-					feeCenter.setCorpCnName(bills.getCyCnName());
+					feeCenter.setCorpCnName(bCorps == null ? bills.getCyCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(bills.getCyEnName());
-					feeCenter.setShortName(bills.getCyCnName());
+					feeCenter.setShortName(bCorps == null ? bills.getCyCnName() : bCorps.getShortName());
 				} else if ("订舱代理".equals(items.getCorpType())) {
+					BCorps bCorps = null;
+					if (!corpsList.isEmpty()) {
+						bCorps = corpsList.stream().filter(e -> e.getId().equals(bills.getBookingAgentId())).findFirst().orElse(null);
+					}
 					feeCenter.setCorpId(bills.getBookingAgentId());
-					feeCenter.setCorpCnName(bills.getBookingAgentCnName());
+					feeCenter.setCorpCnName(bCorps == null ? bills.getBookingAgentCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(bills.getBookingAgentEnName());
-					feeCenter.setShortName(bills.getBookingAgentCnName());
+					feeCenter.setShortName(bCorps == null ? bills.getBookingAgentCnName() : bCorps.getShortName());
 				} else if ("收货代理".equals(items.getCorpType())) {
+					BCorps bCorps = null;
+					if (!corpsList.isEmpty()) {
+						bCorps = corpsList.stream().filter(e -> e.getId().equals(bills.getMconsigneeId())).findFirst().orElse(null);
+					}
 					feeCenter.setCorpId(bills.getMconsigneeId());
-					feeCenter.setCorpCnName(bills.getMconsigneeCnName());
+					feeCenter.setCorpCnName(bCorps == null ? bills.getMconsigneeCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(bills.getMconsigneeEnName());
-					feeCenter.setShortName(bills.getMconsigneeCnName());
+					feeCenter.setShortName(bCorps == null ? bills.getMconsigneeCnName() : bCorps.getShortName());
 				} else if ("MBL通知人".equals(items.getCorpType())) {
+					BCorps bCorps = null;
+					if (!corpsList.isEmpty()) {
+						bCorps = corpsList.stream().filter(e -> e.getId().equals(bills.getMnotifyId())).findFirst().orElse(null);
+					}
 					feeCenter.setCorpId(bills.getMnotifyId());
-					feeCenter.setCorpCnName(bills.getMnotifyCnName());
+					feeCenter.setCorpCnName(bCorps == null ? bills.getMnotifyCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(bills.getMnotifyEnName());
-					feeCenter.setShortName(bills.getMnotifyCnName());
+					feeCenter.setShortName(bCorps == null ? bills.getMnotifyCnName() : bCorps.getShortName());
 				} else {
+					BCorps bCorps = null;
+					if (!corpsList.isEmpty()) {
+						bCorps = corpsList.stream().filter(e -> e.getId().equals(items.getCorpId())).findFirst().orElse(null);
+					}
 					feeCenter.setCorpId(items.getCorpId());
-					feeCenter.setCorpCnName(items.getCorpCnName());
+					feeCenter.setCorpCnName(bCorps == null ? items.getCorpCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(items.getCorpEnName());
-					feeCenter.setShortName(items.getCorpCnName());
+					feeCenter.setShortName(bCorps == null ? items.getCorpCnName() : bCorps.getShortName());
 				}
 				feeCenter.setFeeId(items.getFeeId());
 				feeCenter.setFeeCode(items.getFeeCode());
@@ -882,6 +920,21 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 		if (billsList.isEmpty()) {
 			throw new RuntimeException("未查到单据信息");
 		}
+		List<Long> idList = new ArrayList<>();
+		idList.addAll(billsList.stream().map(Bills::getCorpId).filter(Objects::nonNull).collect(Collectors.toList()));
+		idList.addAll(billsList.stream().map(Bills::getCyId).filter(Objects::nonNull).collect(Collectors.toList()));
+		idList.addAll(billsList.stream().map(Bills::getCarrierId).filter(Objects::nonNull).collect(Collectors.toList()));
+		idList.addAll(billsList.stream().map(Bills::getBookingAgentId).filter(Objects::nonNull).collect(Collectors.toList()));
+		idList.addAll(billsList.stream().map(Bills::getMconsigneeId).filter(Objects::nonNull).collect(Collectors.toList()));
+		idList.addAll(billsList.stream().map(Bills::getMnotifyId).filter(Objects::nonNull).collect(Collectors.toList()));
+		idList.addAll(sonItemsList.stream().map(FeesTemplateSonItems::getCorpId).filter(Objects::nonNull).collect(Collectors.toList()));
+		List<BCorps> corpsList = new ArrayList<>();
+		if (!idList.isEmpty()) {
+			corpsList = corpsMapper.selectList(new LambdaQueryWrapper<BCorps>()
+				.eq(BCorps::getTenantId, AuthUtil.getTenantId())
+				.eq(BCorps::getIsDeleted, 0)
+				.in(BCorps::getId, idList));
+		}
 		List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
 			.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
 			.eq(PreContainers::getIsDeleted, 0)
@@ -980,39 +1033,59 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 				count++;
 				if ("客户".equals(templateItems.getCorpType())) {
 					feeCenter.setCorpId(bills.getCorpId());
-					feeCenter.setCorpCnName(bills.getCorpCnName());
+					feeCenter.setCorpCnName(bills.getShortName());
 					feeCenter.setCorpEnName(bills.getCorpEnName());
 					feeCenter.setShortName(bills.getShortName());
 				} else if ("船公司".equals(templateItems.getCorpType())) {
 					feeCenter.setCorpId(bills.getCarrierId());
-					feeCenter.setCorpCnName(bills.getCarrierCnName());
+					feeCenter.setCorpCnName(bills.getCarrierShortName());
 					feeCenter.setCorpEnName(bills.getCarrierEnName());
-					feeCenter.setShortName(bills.getCarrierCnName());
+					feeCenter.setShortName(bills.getCarrierShortName());
 				} else if ("场站".equals(templateItems.getCorpType())) {
+					BCorps bCorps = null;
+					if (!corpsList.isEmpty()) {
+						bCorps = corpsList.stream().filter(e -> e.getId().equals(bills.getCyId())).findFirst().orElse(null);
+					}
 					feeCenter.setCorpId(bills.getCyId());
-					feeCenter.setCorpCnName(bills.getCyCnName());
+					feeCenter.setCorpCnName(bCorps == null ? bills.getCyCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(bills.getCyEnName());
-					feeCenter.setShortName(bills.getCyCnName());
+					feeCenter.setShortName(bCorps == null ? bills.getCyCnName() : bCorps.getShortName());
 				} else if ("订舱代理".equals(templateItems.getCorpType())) {
+					BCorps bCorps = null;
+					if (!corpsList.isEmpty()) {
+						bCorps = corpsList.stream().filter(e -> e.getId().equals(bills.getBookingAgentId())).findFirst().orElse(null);
+					}
 					feeCenter.setCorpId(bills.getBookingAgentId());
-					feeCenter.setCorpCnName(bills.getBookingAgentCnName());
+					feeCenter.setCorpCnName(bCorps == null ? bills.getBookingAgentCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(bills.getBookingAgentEnName());
-					feeCenter.setShortName(bills.getBookingAgentCnName());
+					feeCenter.setShortName(bCorps == null ? bills.getBookingAgentCnName() : bCorps.getShortName());
 				} else if ("收货代理".equals(templateItems.getCorpType())) {
+					BCorps bCorps = null;
+					if (!corpsList.isEmpty()) {
+						bCorps = corpsList.stream().filter(e -> e.getId().equals(bills.getMconsigneeId())).findFirst().orElse(null);
+					}
 					feeCenter.setCorpId(bills.getMconsigneeId());
-					feeCenter.setCorpCnName(bills.getMconsigneeCnName());
+					feeCenter.setCorpCnName(bCorps == null ? bills.getMconsigneeCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(bills.getMconsigneeEnName());
-					feeCenter.setShortName(bills.getMconsigneeCnName());
+					feeCenter.setShortName(bCorps == null ? bills.getMconsigneeCnName() : bCorps.getShortName());
 				} else if ("MBL通知人".equals(templateItems.getCorpType())) {
+					BCorps bCorps = null;
+					if (!corpsList.isEmpty()) {
+						bCorps = corpsList.stream().filter(e -> e.getId().equals(bills.getMnotifyId())).findFirst().orElse(null);
+					}
 					feeCenter.setCorpId(bills.getMnotifyId());
-					feeCenter.setCorpCnName(bills.getMnotifyCnName());
+					feeCenter.setCorpCnName(bCorps == null ? bills.getMnotifyCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(bills.getMnotifyEnName());
-					feeCenter.setShortName(bills.getMnotifyCnName());
+					feeCenter.setShortName(bCorps == null ? bills.getMnotifyCnName() : bCorps.getShortName());
 				} else {
+					BCorps bCorps = null;
+					if (!corpsList.isEmpty()) {
+						bCorps = corpsList.stream().filter(e -> e.getId().equals(templateItems.getCorpId())).findFirst().orElse(null);
+					}
 					feeCenter.setCorpId(templateItems.getCorpId());
-					feeCenter.setCorpCnName(templateItems.getCorpCnName());
+					feeCenter.setCorpCnName(bCorps == null ? templateItems.getCorpCnName() : bCorps.getShortName());
 					feeCenter.setCorpEnName(templateItems.getCorpEnName());
-					feeCenter.setShortName(templateItems.getCorpCnName());
+					feeCenter.setShortName(bCorps == null ? templateItems.getCorpCnName() : bCorps.getShortName());
 				}
 				feeCenter.setFeeId(items.getFeeId());
 				feeCenter.setCorpType(items.getType());
@@ -1206,9 +1279,9 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 				feeCenter.setSort(count);
 				count++;
 				feeCenter.setCorpId(bills.getCarrierId());
-				feeCenter.setCorpCnName(bills.getCarrierCnName());
+				feeCenter.setCorpCnName(bills.getCarrierShortName());
 				feeCenter.setCorpEnName(bills.getCarrierEnName());
-				feeCenter.setShortName(bills.getCarrierCnName());
+				feeCenter.setShortName(bills.getCarrierShortName());
 				feeCenter.setFeeId(fees.getId());
 				feeCenter.setCorpType("船公司");
 				feeCenter.setFeeCode(fees.getCode());