Browse Source

1.撤销请核增加状态判断
2.财务取数增加默认条件只取审核通过
3.提单号,分单号检索条件拼接删除逻辑修改
4.OW拿,放箱号列表增加检索条件
5.OW拿,放箱号列表排序修改
6.决策分析-收付明细,未收付明细,业务利润增加报表打印接口
7.OW拿,放箱号明细删除主表重新合计箱号

纪新园 1 month ago
parent
commit
86649fb05b
15 changed files with 1043 additions and 54 deletions
  1. 138 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/reports/vo/ReportDataStatisticsVO.java
  2. 5 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/PutBox.java
  3. 5 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/TradingBox.java
  4. 85 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FinanceStatisticsReport.java
  5. 5 1
      blade-service/blade-los/src/main/java/org/springblade/los/Util/MagicValues.java
  6. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/IReportsBoxService.java
  7. 629 9
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsBoxServiceImpl.java
  8. 10 3
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/PutBoxController.java
  9. 22 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/PutBoxItemsController.java
  10. 10 3
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxController.java
  11. 29 13
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxItemController.java
  12. 3 0
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/ExpenseApplicationServiceImpl.java
  13. 3 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/controller/FinAccBillsController.java
  14. 43 14
      blade-service/blade-los/src/main/java/org/springblade/los/finance/invoices/service/impl/FinInvoicesServiceImpl.java
  15. 55 10
      blade-service/blade-los/src/main/java/org/springblade/los/finance/stl/service/impl/FinStlBillsServiceImpl.java

+ 138 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/reports/vo/ReportDataStatisticsVO.java

@@ -1,7 +1,11 @@
 package org.springblade.los.basic.reports.vo;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 /**
  * @author :jixinyuan
  * @date : 2026/1/26
@@ -92,4 +96,138 @@ public class ReportDataStatisticsVO {
 	 * 单据类型
 	 */
 	private String billType;
+
+	/**
+	 * 日期
+	 */
+	private String statisticsDate;
+
+	/**
+	 * 往来单位
+	 */
+	private String corpName;
+
+	/**
+	 * 统计日期
+	 */
+	private String statisticsDateStart;
+
+	/**
+	 * 统计日期
+	 */
+	private String statisticsDateEnd;
+
+	/**
+	 * 业务员
+	 */
+	private String salesman;
+
+	/**
+	 * 起运港
+	 */
+	private String pol;
+
+	/**
+	 * 目的港
+	 */
+	private String pod;
+
+	/**
+	 * 中文船名
+	 */
+	private String vesselCnName;
+
+	/**
+	 * 箱属
+	 */
+	private String boxBelongsTo;
+
+	/**
+	 * 航线 id
+	 */
+	private Long lineId;
+
+	/**
+	 * 核算部门
+	 */
+	private String accDeptName;
+
+	/**
+	 * 核算部门
+	 */
+	private Long accDeptId;
+
+	/**
+	 * 航线中文名称
+	 */
+	private String lineCnName;
+
+	/**
+	 * 船公司中文名称
+	 */
+	private String carrierCnName;
+
+	/**
+	 * 船公司
+	 */
+	private Long carrierId;
+
+	/**
+	 * 操作员
+	 */
+	private String operatorName;
+
+	/**
+	 * 主键
+	 */
+	private Long id;
+	/**
+	 * 委托人
+	 */
+	private String client;
+
+	/**
+	 * 单票费用合并
+	 */
+	private String costMerge;
+
+	/**
+	 * 相同业务客户合并
+	 */
+	private String consistentCorpMerge;
+
+	/**
+	 * 不同业务客户合并
+	 */
+	private String inconsistentCorpMerge;
+
+	/**
+	 * 只显示整票审核业务
+	 */
+	private String examine;
+
+	/**
+	 * 合并amend费用
+	 */
+	private String mergeAmendFee;
+
+	/**
+	 * 按审核日期
+	 */
+	private String examineDate;
+
+	/**
+	 * 数据角色
+	 */
+	private String selecType;
+
+	/**
+	 * 数据角色
+	 */
+	private String selecTypeId;
+
+	/**
+	 * 是否存在amend
+	 */
+	private Integer whetherExist;
 }

+ 5 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/PutBox.java

@@ -468,6 +468,11 @@ public class PutBox implements Serializable {
 	 */
 	@TableField(exist = false)
 	private Boolean status;
+	/**
+	 * 是否显示0
+	 */
+	@TableField(exist = false)
+	private String whetherDisplay;
 
 
 }

+ 5 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/entity/TradingBox.java

@@ -887,5 +887,10 @@ public class TradingBox implements Serializable {
 	 */
 	@TableField(exist = false)
 	private String capitalLettersUsd;
+	/**
+	 * 是否显示0
+	 */
+	@TableField(exist = false)
+	private String whetherDisplay;
 
 }

+ 85 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FinanceStatisticsReport.java

@@ -0,0 +1,85 @@
+package org.springblade.los.statisticAnalysis;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author :jixinyuan
+ * @date : 2026/1/27
+ */
+@Data
+public class FinanceStatisticsReport {
+
+	//结算单位
+	private String corpName;
+	//单据编号
+	private String billNo;
+	//船名
+	private String vesselName;
+	//航次
+	private String voyageNo;
+	//开船日期
+	private String etd;
+	//提单号
+	private String hblNo;
+	//起运港
+	private String pol;
+	//目的港
+	private String pod;
+	//汇率
+	private BigDecimal exrate;
+	//箱型箱量
+	private String quantityCntrDescr;
+	//美元
+	private BigDecimal amountUsd;
+	//人民币
+	private BigDecimal amount;
+	//开票USD
+	private BigDecimal amountInvoicingUsd;
+	//开票RMB
+	private BigDecimal amountInvoicing;
+	//未开USD
+	private BigDecimal amountInvoicingUsdNot;
+	//未开RMB
+	private BigDecimal amountInvoicingNot;
+	//业务员
+	private String salesman;
+	//操作员
+	private String operatorName;
+	//应收(CNY)
+	private BigDecimal amountDr;
+	//实际实收(CNY)
+	private BigDecimal realAmountDr;
+	//未收人民币
+	private BigDecimal notReceivedDr;
+	//应收(USD)
+	private BigDecimal amountDrUsd;
+	//实际实收(USD)
+	private BigDecimal realAmountDrUsd;
+	//未收美元
+	private BigDecimal notReceivedDrUsd;
+	//应付(CNY)
+	private BigDecimal amountCr;
+	//实付实收(CNY)
+	private BigDecimal realAmountCr;
+	//未付人民币
+	private BigDecimal notReceivedCr;
+	//应付(USD)
+	private BigDecimal amountCrUsd;
+	//实际实付(USD)
+	private BigDecimal realAmountCrUsd;
+	//未付美元
+	private BigDecimal notReceivedCrUsd;
+	//人民币利润
+	private BigDecimal amountProfit;
+	//人民币利润
+	private BigDecimal amountProfitUsd;
+	//应收海运费
+	private BigDecimal oceanFreightDr;
+	//应付海运费
+	private BigDecimal oceanFreightCr;
+	//海运费利润
+	private BigDecimal oceanFreightProfit;
+
+}

+ 5 - 1
blade-service/blade-los/src/main/java/org/springblade/los/Util/MagicValues.java

@@ -23,8 +23,12 @@ public class MagicValues {
 	public static final String KHTS = "KHTS";
 	public static final String DOCUMENT = "单证";
 	public static final String COST = "费用";
+	public static final String DECISION_ANALYSIS = "决策分析";
+	public static final String STATISTICS = "统计";
+	public static final String PAYMENT_DETAILS = "收付明细";
+	public static final String NOT_PAYMENT_DETAILS = "未收付明细";
+	public static final String OPERATING_PROFIT = "业务利润";
 	public static final String PAID_APPLICATION = "付费申请";
-
 	public static final String PAID_APPLICATION_V1 = "付费申请*";
 	public static final String RECONCILIATION_CENTER = "对账中心";
 	public static final String INVOICE_APPLICATION = "发票申请";

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/IReportsBoxService.java

@@ -35,5 +35,5 @@ public interface IReportsBoxService {
 	R getReportData(String billId, String reportCode, String groupCode, String corpIds,
 					String itemIds, String type, String curCode,String date) throws ParseException;
 
-	R getReportDataStatistics(ReportDataStatisticsVO reportDataStatisticsVO);
+	R getReportDataStatistics(ReportDataStatisticsVO reportDataStatisticsVO)throws ParseException;
 }

+ 629 - 9
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsBoxServiceImpl.java

@@ -21,12 +21,11 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.los.Util.BigDecimalUtils;
 import org.springblade.los.Util.CurrencyUtils;
 import org.springblade.los.Util.MagicValues;
 import org.springblade.los.basic.corps.entity.BCorps;
-import org.springblade.los.basic.corps.entity.BCorpsBank;
-import org.springblade.los.basic.corps.service.IBCorpsBankService;
 import org.springblade.los.basic.corps.service.IBCorpsService;
 import org.springblade.los.basic.cur.entity.BCurExrate;
 import org.springblade.los.basic.reports.service.IReportsBoxService;
@@ -36,6 +35,7 @@ import org.springblade.los.box.entity.TradingBox;
 import org.springblade.los.box.service.IExpenseApplicationService;
 import org.springblade.los.box.service.ITradingBoxService;
 import org.springblade.los.business.amends.entity.Amends;
+import org.springblade.los.business.amends.mapper.AmendsMapper;
 import org.springblade.los.business.mktSlot.entity.MktSlot;
 import org.springblade.los.business.mktSlot.entity.MktSlotItem;
 import org.springblade.los.business.mktSlot.entity.MktSlotQuotation;
@@ -45,7 +45,6 @@ import org.springblade.los.business.mktSlot.service.IMktSlotService;
 import org.springblade.los.business.receipt.entity.Receipt;
 import org.springblade.los.business.receipt.service.IReceiptService;
 import org.springblade.los.business.sea.entity.Bills;
-import org.springblade.los.business.sea.entity.Containers;
 import org.springblade.los.business.sea.entity.SeaBillsDetail;
 import org.springblade.los.business.sea.service.IBillsService;
 import org.springblade.los.business.sea.service.ISeaBillsDetailService;
@@ -53,12 +52,16 @@ import org.springblade.los.finance.fee.dto.ExpenseApplicationFeeReports;
 import org.springblade.los.finance.fee.dto.FeeCenterReports;
 import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springblade.los.finance.fee.entity.FeeCenterItems;
+import org.springblade.los.finance.fee.mapper.FinAccBillsMapper;
 import org.springblade.los.finance.fee.service.IFeeCenterItemsService;
 import org.springblade.los.finance.fee.service.IFeeCenterService;
 import org.springblade.los.finance.operatingExpenses.entity.OperatingExpenses;
 import org.springblade.los.finance.operatingExpenses.entity.OperatingExpensesItem;
 import org.springblade.los.finance.operatingExpenses.service.IOperatingExpensesItemService;
 import org.springblade.los.finance.operatingExpenses.service.IOperatingExpensesService;
+import org.springblade.los.statisticAnalysis.*;
+import org.springblade.los.view.entity.FinanceProfit;
+import org.springblade.los.view.mapper.FinanceProfitMapper;
 import org.springblade.system.entity.Dept;
 import org.springblade.system.entity.DictBiz;
 import org.springblade.system.feign.IDictBizClient;
@@ -118,7 +121,11 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 
 	private final IReceiptService receiptService;
 
-	private final IBCorpsBankService bankService;
+	private final FinAccBillsMapper finAccBillsMapper;
+
+	private final FinanceProfitMapper financeProfitMapper;
+
+	private final AmendsMapper amendsMapper;
 
 
 	@Override
@@ -525,7 +532,7 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 			}
 		} else if (MagicValues.COST.equals(reportCode) &&
 			(MagicValues.RECEIVABLE_BILL.equals(groupCode) || MagicValues.RECEIVABLE.equals(groupCode)) &&
-			MagicValues.XGFY.equals(type) ) {
+			MagicValues.XGFY.equals(type)) {
 			TradingBox bills = tradingBoxService.getById(billId);
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(AuthUtil.getDeptId());
@@ -558,7 +565,7 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 			}
 		} else if (MagicValues.COST.equals(reportCode) &&
 			(MagicValues.MEET.equals(groupCode) || MagicValues.MEET_BILL.equals(groupCode)) &&
-			MagicValues.XGFY.equals(type) ) {
+			MagicValues.XGFY.equals(type)) {
 			TradingBox bills = tradingBoxService.getById(billId);
 			if (bills != null) {
 				String exrateType = currencyUtils.standardCurrency(AuthUtil.getDeptId());
@@ -588,15 +595,458 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		}else {
+		} else {
 			map.put(MagicValues.DATA, null);
 		}
 		return R.data(map);
 	}
 
 	@Override
-	public R getReportDataStatistics(ReportDataStatisticsVO reportDataStatisticsVO) {
-		return null;
+	public R getReportDataStatistics(ReportDataStatisticsVO reportDataStatisticsVO) throws ParseException {
+		Map<String, Object> map = new HashMap<>();
+		Map<String, Object> mapData = new HashMap<>();
+		mapData.put("etdStart", reportDataStatisticsVO.getEtdStart());
+		mapData.put("etdEnd", reportDataStatisticsVO.getEtdEnd());
+		mapData.put("user", AuthUtil.getUserName());
+		R<Dept> res = sysClient.getDept(Long.parseLong(AuthUtil.getDeptId()));
+		Dept dept;
+		if (res.isSuccess() && res.getData() != null) {
+			dept = res.getData();
+			String status = sysClient.getParamService("is.update.default");
+			if ("1".equals(status)) {
+				R<User> resUser = userClient.userInfoById(AuthUtil.getUserId());
+				if (resUser.isSuccess() && resUser.getData() != null) {
+					dept.setEmail(resUser.getData().getEmail());
+					dept.setTel(resUser.getData().getPhone());
+					dept.setContacts(resUser.getData().getRealName());
+				}
+			}
+		} else {
+			throw new RuntimeException("获取报表表头数据失败");
+		}
+		mapData.put("dept", dept);
+		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+		List<FinanceStatisticsReport> financeStatisticsReportList = new ArrayList<>();
+		if (MagicValues.PAYMENT_DETAILS.equals(reportDataStatisticsVO.getReportCode()) &&
+			MagicValues.STATISTICS.equals(reportDataStatisticsVO.getGroupCode()) &&
+			MagicValues.DECISION_ANALYSIS.equals(reportDataStatisticsVO.getReportType())) {
+			FeeSummaryQ feeSummaryQ = new FeeSummaryQ();
+			BeanUtil.copyProperties(reportDataStatisticsVO, feeSummaryQ);
+			feeSummaryQ.setTenantId(AuthUtil.getTenantId());
+			if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+				feeSummaryQ.setBranchId(AuthUtil.getDeptId());
+				feeSummaryQ.setBillType("MH,DD");
+			}
+			List<FeeSummaryDetailRD> feeSummaryDetailList = finAccBillsMapper.feeSummaryDetailExportList(feeSummaryQ);
+			List<Bills> billsList = new ArrayList<>();
+			if (!feeSummaryDetailList.isEmpty()) {
+				List<String> mblnoList = feeSummaryDetailList.stream().filter(e -> ObjectUtils.isNotNull(e.getMblNo()) &&
+						ObjectUtils.isNull(e.getHblNo()) && "SE,SI,SEA,SIA".contains(e.getBusinessType())).map(FeeSummaryDetailRD::getMblNo)
+					.distinct().collect(Collectors.toList());
+				if (!mblnoList.isEmpty()) {
+					List<Bills> mblnoBillsList = billsService.list(new LambdaQueryWrapper<Bills>()
+						.eq(Bills::getIsDeleted, 0)
+						.eq(Bills::getTenantId, AuthUtil.getTenantId())
+						.in(Bills::getMblno, mblnoList));
+					if (!mblnoBillsList.isEmpty()) {
+						billsList.addAll(mblnoBillsList);
+					}
+				}
+				List<String> hblnoList = feeSummaryDetailList.stream().filter(e -> ObjectUtils.isNotNull(e.getMblNo()) &&
+						ObjectUtils.isNotNull(e.getHblNo()) && "SE,SI,SEA,SIA".contains(e.getBusinessType())).map(FeeSummaryDetailRD::getHblNo)
+					.distinct().collect(Collectors.toList());
+				if (!mblnoList.isEmpty()) {
+					List<Bills> hblnoBillsList = billsService.list(new LambdaQueryWrapper<Bills>()
+						.eq(Bills::getIsDeleted, 0)
+						.eq(Bills::getTenantId, AuthUtil.getTenantId())
+						.in(Bills::getHblno, hblnoList));
+					if (!hblnoBillsList.isEmpty()) {
+						billsList.addAll(hblnoBillsList);
+					}
+				}
+			}
+			for (FeeSummaryDetailRD item : feeSummaryDetailList) {
+				FinanceStatisticsReport report = new FinanceStatisticsReport();
+				report.setCorpName(item.getCorpName());
+				report.setBillNo(item.getBillNo());
+				if (!billsList.isEmpty()) {
+					Bills bills;
+					if (ObjectUtils.isNotNull(item.getMblNo()) &&
+						ObjectUtils.isNull(item.getHblNo()) && "SE,SI,SEA,SIA".contains(item.getBusinessType())) {
+						bills = billsList.stream().filter(e -> e.getMblno().equals(item.getMblNo())
+								&& ObjectUtils.isNull(item.getHblNo()) && "SE,SI,SEA,SIA".contains(item.getBusinessType()))
+							.findFirst().orElse(null);
+					} else if (ObjectUtils.isNotNull(item.getMblNo()) &&
+						ObjectUtils.isNotNull(item.getHblNo()) && "SE,SI,SEA,SIA".contains(item.getBusinessType())) {
+						bills = billsList.stream().filter(e -> e.getHblno().equals(item.getHblNo()) && "SE,SI,SEA,SIA".contains(item.getBusinessType()))
+							.findFirst().orElse(null);
+					} else {
+						bills = null;
+					}
+					if (bills != null) {
+						report.setVesselName(bills.getVesselCnName());
+						report.setVoyageNo(bills.getVoyageNo());
+						BigDecimal exrate = new BigDecimal("1");
+						if ("SE".equals(bills.getBusinessType()) || "SEA".equals(bills.getBusinessType())) {
+							if (ObjectUtils.isNotNull(bills.getActualEtd())) {
+								List<BCurExrate> curExrateList = currencyUtils.obtainRate(bills.getActualEtd(), "1", bills.getBranchId());
+								exrate = currencyUtils.obtainExrate(reportDataStatisticsVO.getDc(), curExrateList, "USD", "1");
+								report.setEtd(formatter.format(bills.getActualEtd()));
+							}
+						} else if ("SI".equals(bills.getBusinessType()) || "SIA".equals(bills.getBusinessType())) {
+							if (ObjectUtils.isNotNull(bills.getActualEta())) {
+								List<BCurExrate> curExrateList = currencyUtils.obtainRate(bills.getActualEta(), "1", bills.getBranchId());
+								exrate = currencyUtils.obtainExrate(reportDataStatisticsVO.getDc(), curExrateList, "USD", "1");
+								report.setEtd(formatter.format(bills.getActualEta()));
+							}
+						}
+						report.setHblNo(bills.getHblno());
+						report.setPol(bills.getPolCnName());
+						report.setPod(bills.getPodCnName());
+						report.setExrate(exrate);
+						report.setQuantityCntrDescr(bills.getQuantityCntrDescr());
+						report.setSalesman(bills.getSrcCnName());
+						report.setOperatorName(bills.getOperatorName());
+					}
+				}
+				report.setAmountUsd(item.getAmountUsd());
+				report.setAmount(item.getAmount());
+				report.setAmountInvoicingUsd(item.getAmountInvoicingUsd());
+				report.setAmountInvoicing(item.getAmountInvoicing());
+				report.setAmountInvoicingUsdNot(item.getAmountInvoicingUsdNot());
+				report.setAmountInvoicingNot(item.getAmountInvoicingNot());
+				financeStatisticsReportList.add(report);
+			}
+			if (!financeStatisticsReportList.isEmpty()) {
+				mapData.put(MagicValues.DATA, financeStatisticsReportList);
+			} else {
+				mapData.put(MagicValues.DATA, new ArrayList<>());
+			}
+		} else if (MagicValues.NOT_PAYMENT_DETAILS.equals(reportDataStatisticsVO.getReportCode()) &&
+			MagicValues.STATISTICS.equals(reportDataStatisticsVO.getGroupCode()) &&
+			MagicValues.DECISION_ANALYSIS.equals(reportDataStatisticsVO.getReportType())) {
+			FeeSummaryQ feeSummaryQ = new FeeSummaryQ();
+			BeanUtil.copyProperties(reportDataStatisticsVO, feeSummaryQ);
+			feeSummaryQ.setTenantId(AuthUtil.getTenantId());
+			if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+				if (AuthUtil.getUserRole().contains("secondaryAdmin")) {
+					feeSummaryQ.setBillBranchId(AuthUtil.getDeptId());
+					feeSummaryQ.setBranchId(null);
+				} else {
+					feeSummaryQ.setBranchId(AuthUtil.getDeptId());
+				}
+				feeSummaryQ.setBillType("MH,DD");
+			}
+			List<FeeSummaryDetailNotRD> feeSummaryDetailExportNotList = finAccBillsMapper.feeSummaryDetailExportNotList(feeSummaryQ);
+			for (FeeSummaryDetailNotRD item : feeSummaryDetailExportNotList) {
+				item.setAmountnvoicingOther(item.getAmountnvoicingHKD().add(item.getAmountnvoicingSGD()).add(item.getAmountnvoicingVND()));
+				item.setAmountnvoicingOtherNot(item.getAmountnvoicingHKDNot().add(item.getAmountnvoicingSGDNot()).add(item.getAmountnvoicingVNDNot()));
+				item.setAmountOtherNot(item.getAmountHKDNot().add(item.getAmountSGDNot()).add(item.getAmountVNDNot()));
+			}
+			List<Bills> billsList = new ArrayList<>();
+			if (!feeSummaryDetailExportNotList.isEmpty()) {
+				List<String> mblnoList = feeSummaryDetailExportNotList.stream().filter(e -> ObjectUtils.isNotNull(e.getMblNo()) &&
+						ObjectUtils.isNull(e.getHblNo()) && "SE,SI,SEA,SIA".contains(e.getBusinessType())).map(FeeSummaryDetailNotRD::getMblNo)
+					.distinct().collect(Collectors.toList());
+				if (!mblnoList.isEmpty()) {
+					List<Bills> mblnoBillsList = billsService.list(new LambdaQueryWrapper<Bills>()
+						.eq(Bills::getIsDeleted, 0)
+						.eq(Bills::getTenantId, AuthUtil.getTenantId())
+						.in(Bills::getMblno, mblnoList));
+					if (!mblnoBillsList.isEmpty()) {
+						billsList.addAll(mblnoBillsList);
+					}
+				}
+				List<String> hblnoList = feeSummaryDetailExportNotList.stream().filter(e -> ObjectUtils.isNotNull(e.getMblNo()) &&
+						ObjectUtils.isNotNull(e.getHblNo()) && "SE,SI,SEA,SIA".contains(e.getBusinessType())).map(FeeSummaryDetailNotRD::getHblNo)
+					.distinct().collect(Collectors.toList());
+				if (!mblnoList.isEmpty()) {
+					List<Bills> hblnoBillsList = billsService.list(new LambdaQueryWrapper<Bills>()
+						.eq(Bills::getIsDeleted, 0)
+						.eq(Bills::getTenantId, AuthUtil.getTenantId())
+						.in(Bills::getHblno, hblnoList));
+					if (!hblnoBillsList.isEmpty()) {
+						billsList.addAll(hblnoBillsList);
+					}
+				}
+			}
+			for (FeeSummaryDetailNotRD item : feeSummaryDetailExportNotList) {
+				FinanceStatisticsReport report = new FinanceStatisticsReport();
+				report.setCorpName(item.getCorpName());
+				report.setBillNo(item.getBillNo());
+				if (!billsList.isEmpty()) {
+					Bills bills;
+					if (ObjectUtils.isNotNull(item.getMblNo()) &&
+						ObjectUtils.isNull(item.getHblNo()) && "SE,SI,SEA,SIA".contains(item.getBusinessType())) {
+						bills = billsList.stream().filter(e -> e.getMblno().equals(item.getMblNo())
+								&& ObjectUtils.isNull(item.getHblNo()) && "SE,SI,SEA,SIA".contains(item.getBusinessType()))
+							.findFirst().orElse(null);
+					} else if (ObjectUtils.isNotNull(item.getMblNo()) &&
+						ObjectUtils.isNotNull(item.getHblNo()) && "SE,SI,SEA,SIA".contains(item.getBusinessType())) {
+						bills = billsList.stream().filter(e -> e.getHblno().equals(item.getHblNo()) && "SE,SI,SEA,SIA".contains(item.getBusinessType()))
+							.findFirst().orElse(null);
+					} else {
+						bills = null;
+					}
+					if (bills != null) {
+						report.setVesselName(bills.getVesselCnName());
+						report.setVoyageNo(bills.getVoyageNo());
+						BigDecimal exrate = new BigDecimal("1");
+						if ("SE".equals(bills.getBusinessType()) || "SEA".equals(bills.getBusinessType())) {
+							if (ObjectUtils.isNotNull(bills.getActualEtd())) {
+								List<BCurExrate> curExrateList = currencyUtils.obtainRate(bills.getActualEtd(), "1", bills.getBranchId());
+								exrate = currencyUtils.obtainExrate(reportDataStatisticsVO.getDc(), curExrateList, "USD", "1");
+								report.setEtd(formatter.format(bills.getActualEtd()));
+							}
+						} else if ("SI".equals(bills.getBusinessType()) || "SIA".equals(bills.getBusinessType())) {
+							if (ObjectUtils.isNotNull(bills.getActualEta())) {
+								List<BCurExrate> curExrateList = currencyUtils.obtainRate(bills.getActualEta(), "1", bills.getBranchId());
+								exrate = currencyUtils.obtainExrate(reportDataStatisticsVO.getDc(), curExrateList, "USD", "1");
+								report.setEtd(formatter.format(bills.getActualEta()));
+							}
+						}
+						report.setHblNo(bills.getHblno());
+						report.setPol(bills.getPolCnName());
+						report.setPod(bills.getPodCnName());
+						report.setExrate(exrate);
+						report.setQuantityCntrDescr(bills.getQuantityCntrDescr());
+						report.setSalesman(bills.getSrcCnName());
+						report.setOperatorName(bills.getOperatorName());
+					}
+				}
+				report.setAmountUsd(item.getAmountUsdNot());
+				report.setAmount(item.getAmountNot());
+				report.setAmountInvoicingUsd(item.getAmountInvoicingUsd());
+				report.setAmountInvoicing(item.getAmountInvoicing());
+				report.setAmountInvoicingUsdNot(item.getAmountInvoicingUsdNot());
+				report.setAmountInvoicingNot(item.getAmountInvoicingNot());
+				financeStatisticsReportList.add(report);
+			}
+			if (!financeStatisticsReportList.isEmpty()) {
+				mapData.put(MagicValues.DATA, financeStatisticsReportList);
+			} else {
+				mapData.put(MagicValues.DATA, new ArrayList<>());
+			}
+		} else if (MagicValues.OPERATING_PROFIT.equals(reportDataStatisticsVO.getReportCode()) &&
+			MagicValues.STATISTICS.equals(reportDataStatisticsVO.getGroupCode()) &&
+			MagicValues.DECISION_ANALYSIS.equals(reportDataStatisticsVO.getReportType())) {
+			FinanceProfitDtoList financeProfit = new FinanceProfitDtoList();
+			BeanUtil.copyProperties(reportDataStatisticsVO, financeProfit);
+			financeProfit.setTenantId(AuthUtil.getTenantId());
+			if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+				financeProfit.setBranchId(AuthUtil.getDeptId());
+				financeProfit.setBillType("MH,DD");
+			}
+			if (ObjectUtils.isNotNull(financeProfit.getExamineDate()) && "0".equals(financeProfit.getExamineDate())) {
+				financeProfit.setExamineDate(null);
+			}
+			if (ObjectUtils.isNotNull(financeProfit.getExamine()) && "0".equals(financeProfit.getExamine())) {
+				financeProfit.setExamine(null);
+			}
+			List<FinanceProfitDtoList> financeProfitList;
+			//是否合并amend费用  true 合并  false 不合并
+			if (ObjectUtils.isNotNull(financeProfit.getMergeAmendFee())) {
+				financeProfitList = financeProfitMapper.financeProfitListSum(financeProfit);
+				String mblno = financeProfitList.stream().map(FinanceProfitDtoList::getMblNo).filter(Objects::nonNull).distinct().collect(Collectors.joining(","));
+				LambdaQueryWrapper<Amends> lambdaQueryWrapper = new LambdaQueryWrapper<Amends>()
+					.eq(Amends::getTenantId, AuthUtil.getTenantId())
+					.eq(Amends::getIsDeleted, 0)
+					.apply("find_in_set(mblno,'" + mblno + "')");
+				if (ObjectUtils.isNotNull(financeProfit.getExamine())) {
+					lambdaQueryWrapper.eq(Amends::getStatus, 3);
+				}
+				List<Amends> amendsList = amendsMapper.selectList(lambdaQueryWrapper);
+				List<FeeCenter> feeCenterList = new ArrayList<>();
+				if (!amendsList.isEmpty()) {
+					List<Long> pids = amendsList.stream().map(Amends::getId).collect(Collectors.toList());
+					if (!pids.isEmpty()) {
+						feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+							.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+							.eq(FeeCenter::getIsDeleted, 0)
+							.in(FeeCenter::getPid, pids));
+					}
+				}
+				for (FinanceProfitDtoList item : financeProfitList) {
+					item.setRealAmountCr(item.getRealAmountCr() == null ? new BigDecimal("0.00") : item.getRealAmountCr());
+					item.setAmountCrUsd(item.getAmountCrUsd() == null ? new BigDecimal("0.00") : item.getAmountCrUsd());
+					item.setRealAmountCrUsd(item.getRealAmountCrUsd() == null ? new BigDecimal("0.00") : item.getRealAmountCrUsd());
+					item.setAmountCrLoc(item.getAmountCrLoc() == null ? new BigDecimal("0.00") : item.getAmountCrLoc());
+					item.setRealAmountCrLoc(item.getRealAmountCrLoc() == null ? new BigDecimal("0.00") : item.getRealAmountCrLoc());
+					item.setAmountDr(item.getAmountDr() == null ? new BigDecimal("0.00") : item.getAmountDr());
+					item.setRealAmountDr(item.getRealAmountDr() == null ? new BigDecimal("0.00") : item.getRealAmountDr());
+					item.setAmountDrUsd(item.getAmountDrUsd() == null ? new BigDecimal("0.00") : item.getAmountDrUsd());
+					item.setRealAmountDrUsd(item.getRealAmountDrUsd() == null ? new BigDecimal("0.00") : item.getRealAmountDrUsd());
+					item.setAmountDrLoc(item.getAmountDrLoc() == null ? new BigDecimal("0.00") : item.getAmountDrLoc());
+					item.setRealAmountDrLoc(item.getRealAmountDrLoc() == null ? new BigDecimal("0.00") : item.getRealAmountDrLoc());
+					item.setAmountProfitLoc(item.getAmountProfitLoc() == null ? new BigDecimal("0.00") : item.getAmountProfitLoc());
+					item.setRealAmountProfitLoc(item.getRealAmountProfitLoc() == null ? new BigDecimal("0.00") : item.getRealAmountProfitLoc());
+					if (!amendsList.isEmpty() && !feeCenterList.isEmpty()) {
+						//获取当前业务类型所有amend
+						List<Amends> amends = amendsList.stream().filter(e -> e.getMblno().equals(item.getMblNo())).collect(Collectors.toList());
+						for (Amends i : amends) {
+							//人民币应收金额
+							BigDecimal feeCentersCD = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "CNY".equals(e.getCurCode()) && "D".equals(e.getDc()))
+								.map(FeeCenter::getAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							//人民币实收金额
+							BigDecimal feeCentersCDReal = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "CNY".equals(e.getCurCode()) && "D".equals(e.getDc()))
+								.map(FeeCenter::getStlTtlAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							//人民币应付金额
+							BigDecimal feeCentersCC = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "CNY".equals(e.getCurCode()) && "C".equals(e.getDc()))
+								.map(FeeCenter::getAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							//人民币实付金额
+							BigDecimal feeCentersCCReal = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "CNY".equals(e.getCurCode()) && "C".equals(e.getDc()))
+								.map(FeeCenter::getStlTtlAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							//美金应收金额
+							BigDecimal feeCentersUD = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "USD".equals(e.getCurCode()) && "D".equals(e.getDc()))
+								.map(FeeCenter::getAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							//美金实收金额
+							BigDecimal feeCentersUDReal = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "USD".equals(e.getCurCode()) && "D".equals(e.getDc()))
+								.map(FeeCenter::getStlTtlAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							//美金应付金额
+							BigDecimal feeCentersUC = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "USD".equals(e.getCurCode()) && "C".equals(e.getDc()))
+								.map(FeeCenter::getAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							//美金实付金额
+							BigDecimal feeCentersUCReal = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "USD".equals(e.getCurCode()) && "C".equals(e.getDc()))
+								.map(FeeCenter::getStlTtlAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							//应收合计金额
+							BigDecimal feeCentersUDLoc = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "D".equals(e.getDc()))
+								.map(FeeCenter::getAmountLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							//实收合计金额
+							BigDecimal feeCentersUDRealLoc = feeCenterList.stream().filter(e -> i.getId().equals(e.getPid()) && "D".equals(e.getDc()))
+								.reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getStlTtlAmount().multiply(y.getExrate())), BigDecimal::add)
+								.setScale(2, RoundingMode.HALF_UP);
+							//应付合计金额
+							BigDecimal feeCentersUCLoc = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "C".equals(e.getDc()))
+								.map(FeeCenter::getAmountLoc).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							//实付合计金额
+							BigDecimal feeCentersUCRealLoc = feeCenterList.stream().filter(e -> i.getId().equals(e.getPid()) && "C".equals(e.getDc()))
+								.reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getStlTtlAmount().multiply(y.getExrate())), BigDecimal::add)
+								.setScale(2, RoundingMode.HALF_UP);
+							BigDecimal oceanFreightDr = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "HYF".equals(e.getFeeCode()) && "D".equals(e.getDc()))
+								.map(FeeCenter::getAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							BigDecimal oceanFreightCr = feeCenterList.stream()
+								.filter(e -> i.getId().equals(e.getPid()) && "HYF".equals(e.getFeeCode()) && "C".equals(e.getDc()))
+								.map(FeeCenter::getAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
+							BigDecimal oceanFreightProfit = oceanFreightDr.subtract(oceanFreightCr);
+							item.setOceanFreightCr(item.getOceanFreightCr().add(oceanFreightCr));
+							item.setOceanFreightDr(item.getOceanFreightDr().add(oceanFreightDr));
+							item.setOceanFreightProfit(item.getOceanFreightProfit().add(oceanFreightProfit));
+							item.setAmountCr(item.getAmountCr().add(feeCentersCC));
+							item.setRealAmountCr(item.getRealAmountCr().add(feeCentersCCReal));
+							item.setAmountCrUsd(item.getAmountCrUsd().add(feeCentersUC));
+							item.setRealAmountCrUsd(item.getRealAmountCrUsd().add(feeCentersUCReal));
+							item.setAmountCrLoc(item.getAmountCrLoc().add(feeCentersUCLoc));
+							item.setRealAmountCrLoc(item.getRealAmountCrLoc().add(feeCentersUCRealLoc));
+							item.setAmountDr(item.getAmountDr().add(feeCentersCD));
+							item.setRealAmountDr(item.getRealAmountDr().add(feeCentersCDReal));
+							item.setAmountDrUsd(item.getAmountDrUsd().add(feeCentersUD));
+							item.setRealAmountDrUsd(item.getRealAmountDrUsd().add(feeCentersUDReal));
+							item.setAmountDrLoc(item.getAmountDrLoc().add(feeCentersUDLoc));
+							item.setRealAmountDrLoc(item.getRealAmountDrLoc().add(feeCentersUDRealLoc));
+							item.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
+							item.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
+						}
+					} else {
+						item.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
+					}
+				}
+			} else {
+				if (ObjectUtils.isNotNull(financeProfit.getBusinessType()) &&
+					(financeProfit.getBusinessType().contains("SE") || financeProfit.getBusinessType().contains("SI"))) {
+					financeProfit.setBusinessType(financeProfit.getBusinessType() + ",SEA,SIA,AEA,AIA");
+				}
+				financeProfitList = financeProfitMapper.financeProfitListSum(financeProfit);
+			}
+			List<FinanceProfit> financeProfitDataList = new ArrayList<>();
+			List<FeeCenter> feeCenterList = new ArrayList<>();
+			if (!financeProfitList.isEmpty()) {
+				String mblNo = financeProfitList.stream().map(FinanceProfitDtoList::getMblNo).distinct().collect(Collectors.joining(","));
+				financeProfitDataList = financeProfitMapper.selectList(new LambdaQueryWrapper<FinanceProfit>()
+					.apply("find_in_set(mblno,'" + mblNo + "')")
+					.apply("find_in_set(business_type,'SE,SI,AE,AI')")
+				);
+				List<Long> idList = financeProfitList.stream().map(FinanceProfitDtoList::getId).distinct().collect(Collectors.toList());
+				if (!financeProfitDataList.isEmpty()) {
+					idList.addAll(financeProfitDataList.stream().map(FinanceProfit::getId).distinct().collect(Collectors.toList()));
+				}
+				feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0)
+					.in(FeeCenter::getPid, idList));
+			}
+			for (FinanceProfitDtoList item : financeProfitList) {
+				if (("SEA".equals(item.getBusinessType()) || "SIA".equals(item.getBusinessType())
+					|| "AEA".equals(item.getBusinessType()) || "AIA".equals(item.getBusinessType()))
+					&& !financeProfitDataList.isEmpty()) {
+					FinanceProfit profit = financeProfitDataList.stream().filter(e -> e.getMblno().equals(item.getMblNo())).findFirst().orElse(null);
+					if (profit != null) {
+						item.setSalesman(profit.getSrcCnName());
+						item.setAccDeptName(profit.getAccDeptName());
+						item.setLineCnName(profit.getLineCnName());
+					}
+				}
+				if (!feeCenterList.isEmpty()) {
+					List<FeeCenter> feeCenters = feeCenterList.stream().filter(e -> e.getPid().equals(item.getId())).collect(Collectors.toList());
+					if (!feeCenters.isEmpty()) {
+						assignment(feeCenters, item);
+					}
+				}
+				FinanceStatisticsReport report = new FinanceStatisticsReport();
+				report.setCorpName(item.getCorpName());
+				report.setBillNo(item.getBillNo());
+				report.setVesselName(item.getVesselCnName());
+				report.setVoyageNo(item.getVoyageNo());
+				BigDecimal exrate = new BigDecimal("1");
+				if (ObjectUtils.isNotNull(item.getStatisticsDate())) {
+					/*List<BCurExrate> curExrateList = currencyUtils.obtainRate(formatter.parse(item.getStatisticsDate()), "1", item.getBranchId());
+					exrate = currencyUtils.obtainExrate(reportDataStatisticsVO.getDc(), curExrateList, "USD", "1");
+					report.setEtd(formatter.format(formatter.parse(item.getStatisticsDate())));*/
+				}
+				report.setHblNo(item.getHblNo());
+				report.setPol(item.getPol());
+				report.setPod(item.getPod());
+				report.setExrate(exrate);
+				report.setQuantityCntrDescr(item.getQuantityCntrDescr());
+				report.setSalesman(item.getSalesman());
+				report.setOperatorName(item.getOperatorName());
+				report.setAmountDr(item.getAmountDr());
+				report.setRealAmountDr(item.getRealAmountDr());
+				report.setNotReceivedDr(item.getNotReceivedDr());
+				report.setAmountDrUsd(item.getAmountDrUsd());
+				report.setRealAmountDrUsd(item.getRealAmountDrUsd());
+				report.setNotReceivedDrUsd(item.getNotReceivedDrUsd());
+				report.setAmountCr(item.getAmountCr());
+				report.setRealAmountCr(item.getRealAmountCr());
+				report.setNotReceivedCr(item.getNotReceivedCr());
+				report.setAmountCrUsd(item.getAmountCrUsd());
+				report.setRealAmountCrUsd(item.getRealAmountCrUsd());
+				report.setNotReceivedCrUsd(item.getNotReceivedCrUsd());
+				report.setAmountProfit(item.getAmountProfit());
+				report.setAmountProfitUsd(item.getAmountProfitUsd());
+				report.setOceanFreightDr(item.getOceanFreightDr());
+				report.setOceanFreightCr(item.getOceanFreightCr());
+				report.setOceanFreightProfit(item.getOceanFreightProfit());
+				financeStatisticsReportList.add(report);
+			}
+			if (!financeStatisticsReportList.isEmpty()) {
+				mapData.put(MagicValues.DATA, financeStatisticsReportList);
+			} else {
+				mapData.put(MagicValues.DATA, new ArrayList<>());
+			}
+		}
+		map.put(MagicValues.DATA, mapData);
+		return R.data(map);
 	}
 
 	private TradingBox assignmentDc(TradingBox bills, List<FeeCenter> feeCenterList, String curCode, String exrateType, List<BCurExrate> curExrateList) {
@@ -792,4 +1242,174 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 		}
 		return bills;
 	}
+
+	private FinanceProfitDtoList assignment(List<FeeCenter> feeCenters, FinanceProfitDtoList item) {
+		//应收人民币
+		BigDecimal amountDr = feeCenters.stream().filter(e -> "CNY".equals(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountDr(amountDr.setScale(2, RoundingMode.HALF_UP));
+		//实收人民币
+		BigDecimal realAmountDr = feeCenters.stream().filter(e -> "CNY".equals(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountDr(realAmountDr.setScale(2, RoundingMode.HALF_UP));
+		//未收人民币
+		item.setNotReceivedDr(amountDr.subtract(realAmountDr));
+		//应收美元
+		BigDecimal amountDrUsd = feeCenters.stream().filter(e -> "USD".equals(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountDrUsd(amountDrUsd.setScale(2, RoundingMode.HALF_UP));
+		//实收美元
+		BigDecimal realAmountDrUsd = feeCenters.stream().filter(e -> "USD".equals(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountDrUsd(realAmountDrUsd.setScale(2, RoundingMode.HALF_UP));
+		//未收美元
+		item.setNotReceivedDrUsd(amountDrUsd.subtract(realAmountDrUsd));
+		//应收HKD
+		BigDecimal amountDrHkd = feeCenters.stream().filter(e -> "HKD".equals(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountDrHkd(amountDrHkd.setScale(2, RoundingMode.HALF_UP));
+		//实收HKD
+		BigDecimal realAmountDrHkd = feeCenters.stream().filter(e -> "HKD".equals(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountDrHkd(realAmountDrHkd.setScale(2, RoundingMode.HALF_UP));
+		//未收HKD
+		item.setNotReceivedDrHkd(amountDrHkd.subtract(amountDrHkd));
+		//应收VND
+		BigDecimal amountDrVnd = feeCenters.stream().filter(e -> "VND".equals(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountDrVnd(amountDrVnd.setScale(2, RoundingMode.HALF_UP));
+		//实收VND
+		BigDecimal realAmountDrVnd = feeCenters.stream().filter(e -> "VND".equals(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountDrVnd(realAmountDrVnd.setScale(2, RoundingMode.HALF_UP));
+		//未收VND
+		item.setNotReceivedDrVnd(amountDrVnd.subtract(realAmountDrVnd));
+		//应收SGD
+		BigDecimal amountDrSgd = feeCenters.stream().filter(e -> "SGD".equals(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountDrSgd(amountDrSgd.setScale(2, RoundingMode.HALF_UP));
+		//实收SGD
+		BigDecimal realAmountDrSgd = feeCenters.stream().filter(e -> "SGD".equals(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountDrSgd(realAmountDrSgd.setScale(2, RoundingMode.HALF_UP));
+		//未收SGD
+		item.setNotReceivedDrSgd(amountDrSgd.subtract(realAmountDrSgd));
+		//应收其他
+		BigDecimal amountDrOther = feeCenters.stream().filter(e -> !"CNY,USD".contains(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountDrOther(amountDrOther.setScale(2, RoundingMode.HALF_UP));
+		//实收其他
+		BigDecimal realAmountDrOther = feeCenters.stream().filter(e -> !"CNY,USD".contains(e.getCurCode()) && "D".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountDrOther(realAmountDrOther.setScale(2, RoundingMode.HALF_UP));
+		//未收其他
+		item.setNotReceivedDrOther(amountDrOther.subtract(realAmountDrOther));
+		//合计应收
+		BigDecimal amountDrLoc = feeCenters.stream().filter(e -> "D".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountDrLoc(amountDrLoc.setScale(2, RoundingMode.HALF_UP));
+		//实际合计应收
+		BigDecimal realAmountDrLoc = feeCenters.stream().filter(e -> "D".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountDrLoc(realAmountDrLoc.setScale(2, RoundingMode.HALF_UP));
+		//未收合计
+		item.setNotReceivedLoc(amountDrLoc.subtract(realAmountDrLoc));
+		//应付人民币
+		BigDecimal amountCr = feeCenters.stream().filter(e -> "CNY".equals(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountCr(amountCr.setScale(2, RoundingMode.HALF_UP));
+		//实付人民币
+		BigDecimal realAmountCr = feeCenters.stream().filter(e -> "CNY".equals(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountCr(realAmountCr.setScale(2, RoundingMode.HALF_UP));
+		//未付人民币
+		item.setNotReceivedCr(amountCr.subtract(realAmountCr));
+		//应付美元
+		BigDecimal amountCrUsd = feeCenters.stream().filter(e -> "USD".equals(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountCrUsd(amountCrUsd.setScale(2, RoundingMode.HALF_UP));
+		//实付美元
+		BigDecimal realAmountCrUsd = feeCenters.stream().filter(e -> "USD".equals(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountCrUsd(realAmountCrUsd.setScale(2, RoundingMode.HALF_UP));
+		//未付美元
+		item.setNotReceivedCrUsd(amountCrUsd.subtract(realAmountCrUsd));
+		//应付HKD
+		BigDecimal amountCrHkd = feeCenters.stream().filter(e -> "HKD".equals(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountCrHkd(amountCrHkd.setScale(2, RoundingMode.HALF_UP));
+		//实付HKD
+		BigDecimal realAmountCrHkd = feeCenters.stream().filter(e -> "HKD".equals(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountCrHkd(realAmountCrHkd.setScale(2, RoundingMode.HALF_UP));
+		//未付HKD
+		item.setNotReceivedCrHkd(amountCrHkd.subtract(realAmountCrHkd));
+		//应付VND
+		BigDecimal amountCrVnd = feeCenters.stream().filter(e -> "VND".equals(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountCrVnd(amountCrVnd.setScale(2, RoundingMode.HALF_UP));
+		//实付VND
+		BigDecimal realAmountCrVnd = feeCenters.stream().filter(e -> "VND".equals(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountCrVnd(realAmountCrVnd.setScale(2, RoundingMode.HALF_UP));
+		//未付VND
+		item.setNotReceivedCrVnd(amountCrVnd.subtract(realAmountCrVnd));
+		//应付SGD
+		BigDecimal amountCrSgd = feeCenters.stream().filter(e -> "SGD".equals(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountCrSgd(amountCrSgd.setScale(2, RoundingMode.HALF_UP));
+		//实付SGD
+		BigDecimal realAmountCrSgd = feeCenters.stream().filter(e -> "SGD".equals(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountCrSgd(realAmountCrSgd.setScale(2, RoundingMode.HALF_UP));
+		//未付SGD
+		item.setNotReceivedCrSgd(amountCrSgd.subtract(realAmountCrSgd));
+		//应付其他
+		BigDecimal amountCrOther = feeCenters.stream().filter(e -> !"CNY,USD".contains(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountCrOther(amountCrOther.setScale(2, RoundingMode.HALF_UP));
+		//实付其他
+		BigDecimal realAmountCrOther = feeCenters.stream().filter(e -> !"CNY,USD".contains(e.getCurCode()) && "C".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountCrOther(realAmountCrOther.setScale(2, RoundingMode.HALF_UP));
+		//未付其他
+		item.setNotReceivedCrOther(amountCrOther.subtract(realAmountCrOther));
+		//合计应付
+		BigDecimal amountCrLoc = feeCenters.stream().filter(e -> "C".equals(e.getDc()))
+			.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setAmountCrLoc(amountCrLoc.setScale(2, RoundingMode.HALF_UP));
+		//实际合计应付
+		BigDecimal realAmountCrLoc = feeCenters.stream().filter(e -> "C".equals(e.getDc()))
+			.map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setRealAmountCrLoc(realAmountCrLoc.setScale(2, RoundingMode.HALF_UP));
+		//未付合计
+		item.setNotReceivedCrLoc(amountCrLoc.subtract(realAmountCrLoc));
+		//合计利润
+		item.setAmountProfitLoc(amountDrLoc.subtract(amountCrLoc));
+		//实际单票利润
+		item.setRealAmountProfitLoc(realAmountDrLoc.subtract(realAmountCrLoc));
+		//人民币利润
+		item.setAmountProfit(amountDr.subtract(amountCr));
+		//美元利润
+		item.setAmountProfitUsd(amountDrUsd.subtract(amountCrUsd));
+		//HKD利润
+		item.setAmountProfitHkd(amountDrHkd.subtract(amountCrHkd));
+		//VND利润
+		item.setAmountProfitVnd(amountDrVnd.subtract(amountCrVnd));
+		//SGD利润
+		item.setAmountProfitSgd(amountDrSgd.subtract(amountCrSgd));
+		//其他利润
+		item.setAmountProfitOther(amountDrOther.subtract(amountDrOther));
+		//应收海运费
+		BigDecimal oceanFreightDr = feeCenters.stream().filter(e -> "USD".equals(e.getCurCode()) && "D".equals(e.getDc())
+			&& "HYF".equals(e.getFeeCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setOceanFreightDr(oceanFreightDr.setScale(2, RoundingMode.HALF_UP));
+		//应付海运费
+		BigDecimal oceanFreightCr = feeCenters.stream().filter(e -> "USD".equals(e.getCurCode()) && "C".equals(e.getDc())
+			&& "HYF".equals(e.getFeeCode())).map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+		item.setOceanFreightCr(oceanFreightCr.setScale(2, RoundingMode.HALF_UP));
+		//海运费利润
+		item.setOceanFreightProfit(oceanFreightDr.subtract(oceanFreightCr));
+		return item;
+	}
 }

+ 10 - 3
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/PutBoxController.java

@@ -99,9 +99,16 @@ public class PutBoxController extends BladeController {
 			.like(ObjectUtils.isNotNull(putBox.getSrcNo()), PutBox::getSrcNo, putBox.getSrcNo())
 			.like(ObjectUtils.isNotNull(putBox.getCode()), PutBox::getCode, putBox.getCode())
 			.eq(ObjectUtils.isNotNull(putBox.getPriorityLevel()), PutBox::getPriorityLevel, putBox.getPriorityLevel());
-		lambdaQueryWrapper.orderByDesc(PutBox::getPolCname);
-		lambdaQueryWrapper.orderByDesc(PutBox::getPodCname);
-		lambdaQueryWrapper.orderByDesc(PutBox::getPriorityLevel);
+		lambdaQueryWrapper.orderByDesc(PutBox::getEffectiveEndDate);
+		lambdaQueryWrapper.orderByAsc(PutBox::getCreateTime);
+		lambdaQueryWrapper.orderByAsc(PutBox::getPolCname);
+		lambdaQueryWrapper.orderByAsc(PutBox::getPodCname);
+		lambdaQueryWrapper.orderByAsc(PutBox::getPriorityLevel);
+		if ("1".equals(putBox.getWhetherDisplay())){
+			lambdaQueryWrapper.eq(PutBox::getRemainingNum,0);
+		}else{
+			lambdaQueryWrapper.ne(PutBox::getRemainingNum,0);
+		}
 		if (ObjectUtils.isNotNull(putBox.getEffectiveStartDate()) && ObjectUtils.isNotNull(putBox.getEffectiveEndDate())) {
 			SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
 			lambdaQueryWrapper.apply(ObjectUtils.isNotNull(putBox.getEffectiveStartDate()), "DATE_FORMAT(effective_start_date,'%Y-%m-%d') >= '" + formatter.format(putBox.getEffectiveStartDate()) + "'")

+ 22 - 0
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/PutBoxItemsController.java

@@ -34,6 +34,8 @@ import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.los.box.entity.PutBox;
 import org.springblade.los.box.entity.PutBoxItems;
+import org.springblade.los.box.entity.TradingBox;
+import org.springblade.los.box.entity.TradingBoxItem;
 import org.springblade.los.box.excel.PutBoxItemExcel;
 import org.springblade.los.box.mapper.PutBoxMapper;
 import org.springblade.los.box.service.IPutBoxItemsService;
@@ -41,7 +43,9 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -128,6 +132,24 @@ public class PutBoxItemsController extends BladeController {
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		List<Long> idList = Func.toLongList(ids);
+		List<PutBoxItems> putBoxItemsList = putBoxItemsService.list(new LambdaQueryWrapper<PutBoxItems>()
+			.eq(PutBoxItems::getTenantId, AuthUtil.getTenantId())
+			.eq(PutBoxItems::getIsDeleted, 0)
+			.in(PutBoxItems::getId, idList));
+		if (!putBoxItemsList.isEmpty()) {
+			PutBox putBox = putBoxMapper.selectById(putBoxItemsList.get(0).getPid());
+			if (putBox != null && ObjectUtils.isNotNull(putBox.getCode())) {
+				for (PutBoxItems item : putBoxItemsList) {
+					putBox.setCode(putBox.getCode().replaceAll(item.getBoxCode(), "#"));
+				}
+				List<String> codeList = Arrays.asList(putBox.getCode().split(","));
+				if (!codeList.isEmpty()) {
+					putBox.setCode(codeList.stream().filter(Objects::nonNull).filter(e-> !"#".equals(e)).distinct().collect(Collectors.joining(",")));
+				}
+				putBoxMapper.updateById(putBox);
+			}
+		}
 		return R.status(putBoxItemsService.removeByIds(Func.toLongList(ids)));
 	}
 

+ 10 - 3
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxController.java

@@ -121,9 +121,16 @@ public class TradingBoxController extends BladeController {
 			lambdaQueryWrapper.ge(TradingBox::getPurchaseDate, tradingBox.getPurchaseDateList().get(0));
 			lambdaQueryWrapper.le(TradingBox::getPurchaseDate, tradingBox.getPurchaseDateList().get(1));
 		}
-		lambdaQueryWrapper.orderByDesc(TradingBox::getPolCname);
-		lambdaQueryWrapper.orderByDesc(TradingBox::getPodCname);
-		lambdaQueryWrapper.orderByDesc(TradingBox::getPriorityLevel);
+		if ("1".equals(tradingBox.getWhetherDisplay())){
+			lambdaQueryWrapper.eq(TradingBox::getNotSuitcaseNum,0);
+		}else{
+			lambdaQueryWrapper.ne(TradingBox::getNotSuitcaseNum,0);
+		}
+		lambdaQueryWrapper.orderByDesc(TradingBox::getExpiryDate);
+		lambdaQueryWrapper.orderByAsc(TradingBox::getCreateTime);
+		lambdaQueryWrapper.orderByAsc(TradingBox::getPolCname);
+		lambdaQueryWrapper.orderByAsc(TradingBox::getPodCname);
+		lambdaQueryWrapper.orderByAsc(TradingBox::getPriorityLevel);
 		IPage<TradingBox> pages = tradingBoxService.page(Condition.getPage(query), lambdaQueryWrapper);
 		if (!pages.getRecords().isEmpty()) {
 			List<Long> ids = pages.getRecords().stream().map(TradingBox::getId).collect(Collectors.toList());

+ 29 - 13
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxItemController.java

@@ -44,9 +44,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -137,7 +135,7 @@ public class TradingBoxItemController extends BladeController {
 			throw new RuntimeException("本单据明细存在重复箱号,操作失败!");
 		}
 		for (TradingBoxItem item : tradingBoxItemList) {
-			if (ObjectUtils.isNotNull(item.getCode())){
+			if (ObjectUtils.isNotNull(item.getCode())) {
 				item.setCode(item.getCode().trim());
 				item.setCode(item.getCode().toUpperCase());
 			}
@@ -214,7 +212,7 @@ public class TradingBoxItemController extends BladeController {
 				throw new RuntimeException("本单据明细存在重复箱号,操作失败!");
 			}
 			for (TradingBoxItem item : tradingBoxItem) {
-				if (ObjectUtils.isNotNull(item.getCode())){
+				if (ObjectUtils.isNotNull(item.getCode())) {
 					item.setCode(item.getCode().trim());
 					item.setCode(item.getCode().toUpperCase());
 				}
@@ -280,7 +278,25 @@ public class TradingBoxItemController extends BladeController {
 	@ApiOperation(value = "删除", notes = "传入ids")
 	@RepeatSubmit
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(tradingBoxItemService.removeByIds(Func.toLongList(ids)));
+		List<Long> idList = Func.toLongList(ids);
+		List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(new LambdaQueryWrapper<TradingBoxItem>()
+			.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
+			.eq(TradingBoxItem::getIsDeleted, 0)
+			.in(TradingBoxItem::getId, idList));
+		if (!tradingBoxItemList.isEmpty()) {
+			TradingBox tradingBox = tradingBoxService.getById(tradingBoxItemList.get(0).getPid());
+			if (tradingBox != null && ObjectUtils.isNotNull(tradingBox.getCode())) {
+				for (TradingBoxItem item : tradingBoxItemList) {
+					tradingBox.setCode(tradingBox.getCode().replaceAll(item.getCode(), "#"));
+				}
+				List<String> codeList = Arrays.asList(tradingBox.getCode().split(","));
+				if (!codeList.isEmpty()) {
+					tradingBox.setCode(codeList.stream().filter(Objects::nonNull).filter(e-> !"#".equals(e)).distinct().collect(Collectors.joining(",")));
+				}
+				tradingBoxService.updateById(tradingBox);
+			}
+		}
+		return R.status(tradingBoxItemService.removeByIds(idList));
 	}
 
 	/**
@@ -290,27 +306,27 @@ public class TradingBoxItemController extends BladeController {
 	@RepeatSubmit
 	public R importBoxItem(@RequestParam("file") MultipartFile file, @RequestParam("id") Long id,
 						   @RequestParam("type") String type) throws ParseException {
-		return tradingBoxItemService.importBoxItem(file, id,type);
+		return tradingBoxItemService.importBoxItem(file, id, type);
 	}
 
 	/**
 	 * 导入箱明细模板-买箱
 	 */
 	@GetMapping("/boxItemTemplate")
-	public void boxItemTemplate(HttpServletResponse response,String type) {
-		if ("1".equals(type)){
+	public void boxItemTemplate(HttpServletResponse response, String type) {
+		if ("1".equals(type)) {
 			List<TradingBoxItemExcel> list = new ArrayList<>();
 			ExcelUtil.export(response, "导入箱明细模板-买箱", "箱明细", list, TradingBoxItemExcel.class);
-		}else if ("3".equals(type)){
+		} else if ("3".equals(type)) {
 			List<AgentBoxItemExcel> list = new ArrayList<>();
 			ExcelUtil.export(response, "导入箱明细模板-代理箱", "箱明细", list, AgentBoxItemExcel.class);
-		}else if ("2".equals(type)){
+		} else if ("2".equals(type)) {
 			List<RentalBoxItemExcel> list = new ArrayList<>();
 			ExcelUtil.export(response, "导入箱明细模板-租箱", "箱明细", list, RentalBoxItemExcel.class);
-		}else if ("4".equals(type)){
+		} else if ("4".equals(type)) {
 			List<BoxFeeItemExcel> list = new ArrayList<>();
 			ExcelUtil.export(response, "导入箱明细模板-箱管费用", "箱明细", list, BoxFeeItemExcel.class);
-		}else if ("5".equals(type)){
+		} else if ("5".equals(type)) {
 			List<TransferBoxExcel> list = new ArrayList<>();
 			ExcelUtil.export(response, "导入箱明细模板-箱管调箱", "箱明细", list, TransferBoxExcel.class);
 		}

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

@@ -973,6 +973,9 @@ public class ExpenseApplicationServiceImpl extends ServiceImpl<ExpenseApplicatio
 				.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 				.in(FeeCenter::getId, idList));
 			for (FeeCenter item : expenseApplication.getFeeCenterList()) {
+				if (!"4".equals(item.getAuditStatus())){
+					throw new RuntimeException("状态不是审核通过,撤销失败");
+				}
 				if (!feeCenterListOld.isEmpty()) {
 					FeeCenter feeCenter1 = feeCenterListOld.stream().filter(e -> e.getId().equals(item.getId())).findFirst().orElse(null);
 					if (feeCenter1 != null) {

+ 3 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/controller/FinAccBillsController.java

@@ -443,6 +443,9 @@ public class FinAccBillsController extends BladeController {
 		if (ObjectUtils.isNotNull(listAccBillVO.getCheckBillNo()) && listAccBillVO.getCheckBillNo().contains(",")) {
 			listAccBillVO.setVagueCh("1");
 		}
+		if (ObjectUtils.isNull(listAccBillVO.getAuditStatus())){
+			listAccBillVO.setAuditStatus("4");
+		}
 		List<FinAccBillsVO> finAccBillsVOPage = new ArrayList<>();
 		List<FinAccBillsVO> list = finAccBillsService.listAccBillV2(listAccBillVO);
 		List<FinAccBillsVO> listAll = finAccBillsService.listAccBill(listAccBillVO);

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

@@ -65,10 +65,7 @@ import java.math.MathContext;
 import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.ZoneId;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -1414,15 +1411,13 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 				finAccBillsService.saveOrUpdateBatch(finAccBillsList);
 				FinInvoices invoicesUpdate = this.countFeeItems(invoicesApply, finInvoicesItemsList, exrateType);
 				invoicesUpdate.setBusinessTypes(finInvoicesItemsList.get(0).getBusinessType());
-				if ("SE,SI,SEA,SIA".contains(invoicesUpdate.getBusinessTypes())){
+				if ("SE,SI,SEA,SIA".contains(invoicesUpdate.getBusinessTypes())) {
 					invoicesUpdate.setBusinessTypes("海运");
-				}else if("OW-N,OW-F".contains(invoicesUpdate.getBusinessTypes())){
+				} else if ("OW-N,OW-F".contains(invoicesUpdate.getBusinessTypes())) {
 					invoicesUpdate.setBusinessTypes("OW");
-				}else{
+				} else {
 					invoicesUpdate.setBusinessTypes("箱管");
 				}
-				invoicesUpdate.setMblnos(finInvoicesItemsList.stream().map(FinInvoicesItems::getMblno).distinct().collect(Collectors.joining(",")));
-				invoicesUpdate.setHblnos(finInvoicesItemsList.stream().map(FinInvoicesItems::getHblno).distinct().collect(Collectors.joining(",")));
 				baseMapper.updateById(invoicesUpdate);
 			}
 		} else if ("5".equals(finInvoices.getCostType())) {
@@ -1551,15 +1546,13 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 				finAccBillsService.saveOrUpdateBatch(finAccBillsList);
 				FinInvoices invoicesUpdate = this.countFeeItems(invoices, finInvoicesItemsList, exrateType);
 				invoicesUpdate.setBusinessTypes(finInvoicesItemsList.get(0).getBusinessType());
-				if ("SE,SI,SEA,SIA".contains(invoicesUpdate.getBusinessTypes())){
+				if ("SE,SI,SEA,SIA".contains(invoicesUpdate.getBusinessTypes())) {
 					invoicesUpdate.setBusinessTypes("海运");
-				}else if("OW-N,OW-F".contains(invoicesUpdate.getBusinessTypes())){
+				} else if ("OW-N,OW-F".contains(invoicesUpdate.getBusinessTypes())) {
 					invoicesUpdate.setBusinessTypes("OW");
-				}else{
+				} else {
 					invoicesUpdate.setBusinessTypes("箱管");
 				}
-				invoicesUpdate.setMblnos(finInvoicesItemsList.stream().map(FinInvoicesItems::getMblno).distinct().collect(Collectors.joining(",")));
-				invoicesUpdate.setHblnos(finInvoicesItemsList.stream().map(FinInvoicesItems::getHblno).distinct().collect(Collectors.joining(",")));
 				baseMapper.updateById(invoicesUpdate);
 			}
 		} else {
@@ -1747,6 +1740,30 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 		finAccBillsService.updateBatchById(finAccBillsList);
 		finInvoicesItemsService.removeByIds(idsList);
 		this.revokeFeeItems(invoices, finInvoicesItemsList, exrateType);
+		List<FinInvoicesItems> finInvoicesItems = finInvoicesItemsService.list(new LambdaQueryWrapper<FinInvoicesItems>()
+			.notIn(FinInvoicesItems::getId, idsList)
+			.eq(FinInvoicesItems::getPid, invoices.getId())
+			.eq(FinInvoicesItems::getTenantId, AuthUtil.getTenantId())
+			.eq(FinInvoicesItems::getIsDeleted, 0));
+		if (finInvoicesItems.isEmpty()) {
+			invoices.setMblnos("");
+			invoices.setHblnos("");
+		} else {
+			StringBuilder mblno = new StringBuilder();
+			StringBuilder hblno = new StringBuilder();
+			for (FinInvoicesItems item : finInvoicesItems) {
+				hblno.append(item.getHblno()).append(",");
+				mblno.append(item.getMblno()).append(",");
+			}
+			if (ObjectUtils.isNotNull(mblno.toString())) {
+				List<String> mblnoList = Arrays.asList(mblno.toString().split(","));
+				invoices.setMblnos(mblnoList.stream().filter(Objects::nonNull).distinct().collect(Collectors.joining(",")));
+			}
+			if (ObjectUtils.isNotNull(hblno.toString())) {
+				List<String> hblnoList = Arrays.asList(hblno.toString().split(","));
+				invoices.setHblnos(hblnoList.stream().filter(Objects::nonNull).distinct().collect(Collectors.joining(",")));
+			}
+		}
 		baseMapper.updateById(invoices);
 		return R.data(finInvoices);
 	}
@@ -2870,7 +2887,11 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 		BigDecimal amountUsdD = new BigDecimal("0.00");
 		BigDecimal amountCnyC = new BigDecimal("0.00");
 		BigDecimal amountUsdC = new BigDecimal("0.00");
+		String mblno = ObjectUtils.isNull(reconciliation.getMblnos())?"":reconciliation.getMblnos();
+		String hblno = ObjectUtils.isNull(reconciliation.getHblnos())?"":reconciliation.getHblnos();
 		for (FinInvoicesItems item : finStlBillsItemsList) {
+			hblno = hblno + "," + item.getHblno() + ",";
+			mblno = mblno + "," + item.getMblno() + ",";
 			//计算字段null值处理
 			item.setCurrentAmount(ObjectUtils.isNotNull(item.getCurrentAmount()) ? item.getCurrentAmount() : new BigDecimal("0.00"));
 			item.setAmount(ObjectUtils.isNotNull(item.getAmount()) ? item.getAmount() : new BigDecimal("0.00"));
@@ -2898,6 +2919,14 @@ public class FinInvoicesServiceImpl extends ServiceImpl<FinInvoicesMapper, FinIn
 				}
 			}
 		}
+		if (ObjectUtils.isNotNull(mblno)) {
+			List<String> mblnoList = Arrays.asList(mblno.split(","));
+			reconciliation.setMblnos(mblnoList.stream().filter(Objects::nonNull).distinct().collect(Collectors.joining(",")));
+		}
+		if (ObjectUtils.isNotNull(hblno)) {
+			List<String> hblnoList = Arrays.asList(hblno.split(","));
+			reconciliation.setHblnos(hblnoList.stream().filter(Objects::nonNull).distinct().collect(Collectors.joining(",")));
+		}
 		reconciliation.setAmountCny(reconciliation.getAmountCny().add(amountCnyD.subtract(amountCnyC)));
 		reconciliation.setAmountUsd(reconciliation.getAmountUsd().add(amountUsdD.subtract(amountUsdC)));
 		reconciliation.setAmountSub(reconciliation.getAmountSub().add(amountCnyD.subtract(amountCnyC)));

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

@@ -72,10 +72,7 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.ZoneId;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -2417,8 +2414,6 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 				}
 				feeCenterService.updateBatchById(feeCenterList);
 				finAccBillsService.updateBatchById(finAccBillsList);
-				stlBills.setMblnos(finStlBillsItemsList.stream().map(FinStlBillsItems::getMblno).distinct().collect(Collectors.joining(",")));
-				stlBills.setHblnos(finStlBillsItemsList.stream().map(FinStlBillsItems::getHblno).distinct().collect(Collectors.joining(",")));
 			}
 		} else if ("2".equals(finStlBills.getType())) {
 			for (FinAccBillsVO item : finStlBills.getFinAccBillsVOList()) {
@@ -2529,8 +2524,6 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 				}else{
 					stlBills.setBusinessTypes("箱管");
 				}
-				stlBills.setMblnos(finStlBillsItemsList.stream().map(FinStlBillsItems::getMblno).distinct().collect(Collectors.joining(",")));
-				stlBills.setHblnos(finStlBillsItemsList.stream().map(FinStlBillsItems::getHblno).distinct().collect(Collectors.joining(",")));
 			}
 		} else if ("3".equals(finStlBills.getType())) {
 			for (FinAccBillsVO item : finStlBills.getFinAccBillsVOList()) {
@@ -2687,8 +2680,6 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 				}
 				feeCenterService.saveOrUpdateBatch(feeCenterList);
 				finAccBillsService.saveOrUpdateBatch(finAccBillsList);
-				stlBills.setMblnos(finStlBillsItemsList.stream().map(FinStlBillsItems::getMblno).distinct().collect(Collectors.joining(",")));
-				stlBills.setHblnos(finStlBillsItemsList.stream().map(FinStlBillsItems::getHblno).distinct().collect(Collectors.joining(",")));
 			}
 		} else {
 			throw new RuntimeException("类型错误");
@@ -2705,8 +2696,12 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 		BigDecimal amountCrUSD = new BigDecimal("0.00");
 		BigDecimal amountDrLoc = new BigDecimal("0.00");
 		BigDecimal amountCrLoc = new BigDecimal("0.00");
+		StringBuilder mblno = new StringBuilder(ObjectUtils.isNull(reconciliation.getMblnos())?"":reconciliation.getMblnos());
+		StringBuilder hblno = new StringBuilder(ObjectUtils.isNull(reconciliation.getHblnos())?"":reconciliation.getHblnos());
 		//对账明细状态修改  已对账
 		for (FinStlBillsItems item : finStlBillsItemsList) {
+			hblno.append(",").append(item.getHblno()).append(",");
+			mblno.append(",").append(item.getMblno()).append(",");
 			//判断是否是本位币
 			if (exrateType.equals(item.getCurrentStlCurCode())) {
 				item.setCurrentStlAmountLoc(item.getCurrentStlAmount());
@@ -2734,6 +2729,14 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 				}
 			}
 		}
+		if (ObjectUtils.isNotNull(mblno.toString())){
+			List<String> mblnoList = Arrays.asList(mblno.toString().split(","));
+			reconciliation.setMblnos(mblnoList.stream().filter(Objects::nonNull).distinct().collect(Collectors.joining(",")));
+		}
+		if (ObjectUtils.isNotNull(hblno.toString())){
+			List<String> hblnoList = Arrays.asList(hblno.toString().split(","));
+			reconciliation.setHblnos(hblnoList.stream().filter(Objects::nonNull).distinct().collect(Collectors.joining(",")));
+		}
 		reconciliation.setAmountDr(reconciliation.getAmountDr().add(amountDrCNY));
 		reconciliation.setAmountCr(reconciliation.getAmountCr().add(amountCrCNY));
 		reconciliation.setAmountDrUsd(reconciliation.getAmountDrUsd().add(amountDrUSD));
@@ -2764,8 +2767,16 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 		BigDecimal amountCrUSD = new BigDecimal("0.00");
 		BigDecimal amountDrLoc = new BigDecimal("0.00");
 		BigDecimal amountCrLoc = new BigDecimal("0.00");
+		List<String> mblnoList = Arrays.asList(reconciliation.getMblnos().split(","));
+		List<String> hblnoList = Arrays.asList(reconciliation.getHblnos().split(","));
 		//对账明细状态修改  已对账
 		for (FinStlBillsItems item : finStlBillsItemsList) {
+			if (ObjectUtils.isNotNull(item.getMblno()) && !mblnoList.isEmpty()) {
+				mblnoList.removeIf(element -> item.getMblno().equals(element));
+			}
+			if (ObjectUtils.isNotNull(item.getHblno()) && !hblnoList.isEmpty()) {
+				hblnoList.removeIf(element -> item.getHblno().equals(element));
+			}
 			//判断是否是本位币
 			if (exrateType.equals(item.getCurrentStlCurCode())) {
 				item.setCurrentStlAmountLoc(item.getCurrentStlAmount());
@@ -2793,6 +2804,16 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 				}
 			}
 		}
+		if (!mblnoList.isEmpty()) {
+			reconciliation.setMblnos(mblnoList.stream().distinct().collect(Collectors.joining(",")));
+		} else {
+			reconciliation.setMblnos("");
+		}
+		if (!mblnoList.isEmpty()) {
+			reconciliation.setHblnos(hblnoList.stream().distinct().collect(Collectors.joining(",")));
+		} else {
+			reconciliation.setHblnos("");
+		}
 		reconciliation.setAmountDr(reconciliation.getAmountDr().subtract(amountDrCNY));
 		reconciliation.setAmountCr(reconciliation.getAmountCr().subtract(amountCrCNY));
 		reconciliation.setAmountDrUsd(reconciliation.getAmountDrUsd().subtract(amountDrUSD));
@@ -3206,6 +3227,30 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 			finAccBillsService.saveOrUpdateBatch(finAccBillsList);
 			finStlBillsItemsService.removeByIds(idsList);
 			this.revokeFeeItems(stlBills, finStlBillsItemsList, exrateType);
+			List<FinStlBillsItems> finStlBillsItems = finStlBillsItemsService.list(new LambdaQueryWrapper<FinStlBillsItems>()
+				.in(FinStlBillsItems::getId, idsList)
+				.eq(FinStlBillsItems::getPid, stlBills.getId())
+				.eq(FinStlBillsItems::getTenantId, AuthUtil.getTenantId())
+				.eq(FinStlBillsItems::getIsDeleted, 0));
+			if (finStlBillsItems.isEmpty()) {
+				stlBills.setMblnos("");
+				stlBills.setHblnos("");
+			} else {
+				StringBuilder mblno = new StringBuilder();
+				StringBuilder hblno = new StringBuilder();
+				for (FinStlBillsItems item : finStlBillsItems) {
+					hblno.append(item.getHblno()).append(",");
+					mblno.append(item.getMblno()).append(",");
+				}
+				if (ObjectUtils.isNotNull(mblno.toString())) {
+					List<String> mblnoList = Arrays.asList(mblno.toString().split(","));
+					stlBills.setMblnos(mblnoList.stream().filter(Objects::nonNull).distinct().collect(Collectors.joining(",")));
+				}
+				if (ObjectUtils.isNotNull(hblno.toString())) {
+					List<String> hblnoList = Arrays.asList(hblno.toString().split(","));
+					stlBills.setHblnos(hblnoList.stream().filter(Objects::nonNull).distinct().collect(Collectors.joining(",")));
+				}
+			}
 			baseMapper.updateById(stlBills);
 		} else {
 			throw new RuntimeException("类型错误");