Bläddra i källkod

Merge remote-tracking branch 'origin/dev' into dev

liyuan 6 månader sedan
förälder
incheckning
21316a113a

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

@@ -613,5 +613,11 @@ public class BCorps implements Serializable {
 	@ApiModelProperty(value = "船公司约号")
 	private String carrierArgreementNo;
 
+	/**
+	 * 客户唯一id
+	 */
+	@ApiModelProperty(value = "客户唯一id")
+	private String corpOnlyId;
+
 
 }

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

@@ -1889,6 +1889,48 @@ public class Bills implements Serializable {
 	private String corpSource;
 
 	/**
+	 * 船代
+	 */
+	@ApiModelProperty(value = "船代")
+	private Long shippingAgencyId;
+
+	/**
+	 * 船代中文名称
+	 */
+	@ApiModelProperty(value = "船代中文名称")
+	private String shippingAgencyCname;
+
+	/**
+	 * 船代英文名称
+	 */
+	@ApiModelProperty(value = "船代英文名称")
+	private String shippingAgencyEname;
+
+	/**
+	 * 截单(0 否 1是)
+	 */
+	@ApiModelProperty(value = "截单")
+	private Integer isCutOffTheOrder;
+
+	/**
+	 * 舱单(0 否 1是)
+	 */
+	@ApiModelProperty(value = "舱单")
+	private Integer isManifest;
+
+	/**
+	 * vgm(0 否 1是)
+	 */
+	@ApiModelProperty(value = "vgm")
+	private Integer isVgm;
+
+	/**
+	 * 放单(0 否 1是)
+	 */
+	@ApiModelProperty(value = "放单")
+	private Integer isPutOrder;
+
+	/**
 	 * 入库
 	 */
 	@TableField(exist = false)

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

@@ -552,6 +552,4 @@ public class SeaBillsDetail implements Serializable {
 	@ApiModelProperty(value = "MB/L 第二通知人国家名称")
 	@TableField("m_notify2_cnty_name")
 	private String mnotify2CntyName;
-
-
 }

+ 7 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryQ.java

@@ -1,5 +1,6 @@
 package org.springblade.los.statisticAnalysis;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import lombok.Data;
 
@@ -73,4 +74,10 @@ public class FeeSummaryQ {
 
 	private String sortType;
 
+	/**
+	 * 合并amend费用
+	 */
+	@ExcelIgnore
+	private String mergeAmendFee;
+
 }

+ 12 - 5
blade-service/blade-los/src/main/java/org/springblade/los/basic/corps/controller/BCorpsController.java

@@ -114,9 +114,11 @@ public class BCorpsController extends BladeController {
 		lambdaQueryWrapper.eq(BCorps::getTenantId, AuthUtil.getTenantId())
 			.eq(BCorps::getIsDeleted, 0)
 			.like(ObjectUtils.isNotNull(bCorps.getCode()), BCorps::getCode, bCorps.getCode())
+			.like(ObjectUtils.isNotNull(bCorps.getCorpOnlyId()), BCorps::getCorpOnlyId, bCorps.getCorpOnlyId())
 			.eq(ObjectUtils.isNotNull(bCorps.getStatus()), BCorps::getStatus, bCorps.getStatus())
 			.and(ObjectUtils.isNotNull(bCorps.getCnName()), i -> i.like(BCorps::getCnName, bCorps.getCnName()).or()
-				.like(BCorps::getEnName, bCorps.getCnName()).or().like(BCorps::getCode, bCorps.getCnName()))
+				.like(BCorps::getEnName, bCorps.getCnName()).or().like(BCorps::getCode, bCorps.getCnName())
+				.or().like(BCorps::getCorpOnlyId, bCorps.getCorpOnlyId()))
 			.like(ObjectUtils.isNotNull(bCorps.getShortName()), BCorps::getShortName, bCorps.getShortName())
 			.like(ObjectUtils.isNotNull(bCorps.getEnName()), BCorps::getEnName, bCorps.getEnName())
 			.like(ObjectUtils.isNotNull(bCorps.getUscc()), BCorps::getUscc, bCorps.getUscc())
@@ -206,8 +208,9 @@ public class BCorpsController extends BladeController {
 			.in(!corpIds.isEmpty(), BCorps::getId, corpIds)
 			.and(ObjectUtils.isNotNull(bCorps.getCnName()), i -> i.like(BCorps::getCode, bCorps.getCnName()).or()
 				.like(BCorps::getCnName, bCorps.getCnName()).or().like(BCorps::getEnName, bCorps.getCnName())
-				.or().like(BCorps::getShortName, bCorps.getCnName()))
+				.or().like(BCorps::getShortName, bCorps.getCnName()).or().like(BCorps::getCorpOnlyId, bCorps.getCnName()))
 			.like(ObjectUtils.isNotNull(bCorps.getCode()), BCorps::getCode, bCorps.getCode())
+			.like(ObjectUtils.isNotNull(bCorps.getCorpOnlyId()), BCorps::getCorpOnlyId, bCorps.getCorpOnlyId())
 			.eq(ObjectUtils.isNotNull(bCorps.getStatus()), BCorps::getStatus, bCorps.getStatus())
 			.like(ObjectUtils.isNotNull(bCorps.getEnName()), BCorps::getEnName, bCorps.getEnName())
 			.like(ObjectUtils.isNotNull(bCorps.getShortName()), BCorps::getShortName, bCorps.getShortName())
@@ -383,8 +386,10 @@ public class BCorpsController extends BladeController {
 			.eq(BCorps::getIsDeleted, 0)
 			.eq(ObjectUtils.isNotNull(bCorps.getStatus()), BCorps::getStatus, bCorps.getStatus())
 			.and(ObjectUtils.isNotNull(bCorps.getCnName()), i -> i.like(BCorps::getCnName, bCorps.getCnName()).or()
-				.like(BCorps::getEnName, bCorps.getCnName()).or().like(BCorps::getCode, bCorps.getCnName()))
+				.like(BCorps::getEnName, bCorps.getCnName()).or().like(BCorps::getCode, bCorps.getCnName())
+				.or().like(BCorps::getCorpOnlyId, bCorps.getCnName()))
 			.like(ObjectUtils.isNotNull(bCorps.getEnName()), BCorps::getEnName, bCorps.getEnName())
+			.like(ObjectUtils.isNotNull(bCorps.getCorpOnlyId()), BCorps::getCorpOnlyId, bCorps.getCorpOnlyId())
 			.like(ObjectUtils.isNotNull(bCorps.getUscc()), BCorps::getUscc, bCorps.getUscc())
 			.like(ObjectUtils.isNotNull(bCorps.getCnAddr()), BCorps::getCnAddr, bCorps.getCnAddr())
 			.like(ObjectUtils.isNotNull(bCorps.getCnAddr()), BCorps::getCnAddr, bCorps.getCnAddr())
@@ -394,7 +399,7 @@ public class BCorpsController extends BladeController {
 			.like(ObjectUtils.isNotNull(bCorps.getCorpSource()), BCorps::getCorpSource, bCorps.getCorpSource())
 			.and(ObjectUtils.isNotNull(bCorps.getShortName()), i -> i.like(BCorps::getCnName, bCorps.getShortName()).or()
 				.like(BCorps::getEnName, bCorps.getShortName()).or().like(BCorps::getCode, bCorps.getShortName())
-				.or().like(BCorps::getShortName, bCorps.getShortName()))
+				.or().like(BCorps::getShortName, bCorps.getShortName()).or().like(BCorps::getCorpOnlyId, bCorps.getShortName()))
 			.like(ObjectUtils.isNotNull(bCorps.getTel()), BCorps::getTel, bCorps.getTel())
 			.like(ObjectUtils.isNotNull(bCorps.getAdminProfiles()), BCorps::getAdminProfiles, bCorps.getAdminProfiles())
 //			.apply(ObjectUtils.isNotNull(bCorps.getCorpType()), "find_in_set('" + bCorps.getCorpType() + "',corp_type)");
@@ -461,9 +466,11 @@ public class BCorpsController extends BladeController {
 			.eq(BCorps::getIsDeleted, 0)
 			.in(!corpIds.isEmpty(), BCorps::getId, corpIds)
 			.like(ObjectUtils.isNotNull(bCorps.getCode()), BCorps::getCode, bCorps.getCode())
+			.like(ObjectUtils.isNotNull(bCorps.getCorpOnlyId()), BCorps::getCorpOnlyId, bCorps.getCorpOnlyId())
 			.eq(ObjectUtils.isNotNull(bCorps.getStatus()), BCorps::getStatus, bCorps.getStatus())
 			.and(ObjectUtils.isNotNull(bCorps.getCnName()), i -> i.like(BCorps::getCnName, bCorps.getCnName()).or()
-				.like(BCorps::getEnName, bCorps.getCnName()).or().like(BCorps::getCode, bCorps.getCnName()))
+				.like(BCorps::getEnName, bCorps.getCnName()).or().like(BCorps::getCode, bCorps.getCnName())
+				.or().like(BCorps::getCorpOnlyId, bCorps.getCnName()))
 			.like(ObjectUtils.isNotNull(bCorps.getShortName()), BCorps::getShortName, bCorps.getShortName())
 			.like(ObjectUtils.isNotNull(bCorps.getEnName()), BCorps::getEnName, bCorps.getEnName())
 			.like(ObjectUtils.isNotNull(bCorps.getUscc()), BCorps::getUscc, bCorps.getUscc())

+ 20 - 12
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/controller/IndexStatisticsController.java

@@ -5,11 +5,15 @@ package org.springblade.los.statisticAnalysis.controller;
  * @date : 2024/1/25
  */
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
+import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.statisticAnalysis.service.IStatisticAnalysisService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -31,8 +35,6 @@ public class IndexStatisticsController {
 	 * 首页 审批数据
 	 */
 	@GetMapping("/approvalData")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "审批数据")
 	public R<Map<String, Object>> approvalData(@RequestParam("dateStart")String dateStart, @RequestParam("dateEnd")String dateEnd) {
 		return statisticAnalysisService.approvalData(dateStart, dateEnd);
 	}
@@ -42,8 +44,6 @@ public class IndexStatisticsController {
 	 * 首页 实时数据
 	 */
 	@GetMapping("/businessSum")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "实时数据")
 	public R<Map<String, Object>> businessSum(@RequestParam("dateStart") String dateStart, @RequestParam("dateEnd")String dateEnd) {
 		return statisticAnalysisService.businessSum(dateStart, dateEnd);
 	}
@@ -52,8 +52,6 @@ public class IndexStatisticsController {
 	 * 首页 完成率
 	 */
 	@GetMapping("/completionRate")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "完成率")
 	public R<Map<String, Object>> completionRate(@RequestParam("dateStart")String dateStart, @RequestParam("dateEnd")String dateEnd,
 												 @RequestParam("type")String type) {
 		return statisticAnalysisService.completionRate(dateStart, dateEnd,type);
@@ -63,8 +61,6 @@ public class IndexStatisticsController {
 	 * 首页 趋势图
 	 */
 	@GetMapping("/trend")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "完成率")
 	public R<List<Map<String, Object>>> trend(@RequestParam("date")String date, @RequestParam("type")String type) {
 		return statisticAnalysisService.trend(date,type);
 	}
@@ -73,8 +69,6 @@ public class IndexStatisticsController {
 	 * 还箱提醒
 	 */
 	@GetMapping("/boxReturnReminder")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "完成率")
 	public R<List<Map<String, Object>>> boxReturnReminder() {
 		return statisticAnalysisService.boxReturnReminder();
 	}
@@ -83,10 +77,24 @@ public class IndexStatisticsController {
 	 * 退押提醒
 	 */
 	@GetMapping("/withdrawalReminder")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "完成率")
 	public R<List<Map<String, Object>>> withdrawalReminder() {
 		return statisticAnalysisService.withdrawalReminder();
 	}
 
+	/**
+	 * 到港提醒
+	 */
+	@GetMapping("/arrivalReminder")
+	public R<Map<String, Object>> arrivalReminder() {
+		return statisticAnalysisService.arrivalReminder();
+	}
+
+	/**
+	 * 到港提醒明细
+	 */
+	@GetMapping("/arrivalReminderList")
+	public R<IPage<Bills>> arrivalReminderList(Bills bills,Query query) {
+		return statisticAnalysisService.arrivalReminderList(bills,query);
+	}
+
 }

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

@@ -19,6 +19,7 @@ package org.springblade.los.statisticAnalysis.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
+import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.excel.BoxNumberProfitExcel;
 import org.springblade.los.statisticAnalysis.*;
 
@@ -91,4 +92,9 @@ public interface IStatisticAnalysisService {
 	R<IPage<FeeSettlementExcel>> feeSettlementStatistics(FeeSettlementExcel feeSettlementExcel, Query query);
 
 	List<FeeSettlementExcel> feeSettlementList(FeeSettlementExcel feeSettlementExcel);
+
+	R<Map<String, Object>> arrivalReminder();
+
+
+	R<IPage<Bills>> arrivalReminderList(Bills bills, Query query);
 }

+ 245 - 420
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -45,8 +45,6 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.math.MathContext;
 import java.math.RoundingMode;
-import java.text.DateFormat;
-import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -127,16 +125,16 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			}
 		}
 		List<FinanceProfitDtoList> financeProfitList = new ArrayList<>();
-		BigDecimal exrateC = bCurrencyService.getCnyExrate(null,"USD", "C", "2");
-		BigDecimal exrateD = bCurrencyService.getCnyExrate(null,"USD", "D", "2");
+		BigDecimal exrateC = bCurrencyService.getCnyExrate(null, "USD", "C", "2");
+		BigDecimal exrateD = bCurrencyService.getCnyExrate(null, "USD", "D", "2");
 		//是否合并amend费用  true 合并  false 不合并
 		if ("1".equals(financeProfit.getMergeAmendFee())) {
 			financeProfitList = financeProfitMapper.financeProfit(financeProfit, page);
-			String billNo = financeProfitList.stream().map(FinanceProfitDtoList::getBillNo).filter(Objects::nonNull).distinct().collect(Collectors.joining(","));
+			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(orig_bill_no,'" + billNo + "')");
+				.apply("find_in_set(mblno,'" + mblno + "')");
 			if (ObjectUtils.isNotNull(financeProfit.getExamine())) {
 				lambdaQueryWrapper.eq(Amends::getStatus, 3);
 			}
@@ -151,147 +149,73 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 						.in(FeeCenter::getPid, pids));
 				}
 			}
-			List<FinanceProfitDtoList> financeProfits = new ArrayList<>();
 			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.getBillNo().equals(item.getBillNo())).collect(Collectors.toList());
+					List<Amends> amends = amendsList.stream().filter(e -> e.getMblno().equals(item.getMblNo())).collect(Collectors.toList());
 					for (Amends i : amends) {
-						//当前业务不属于当期业务,需新插入一条记录
-						FinanceProfitDtoList financeProfit1 = new FinanceProfitDtoList();
-						financeProfit1.setBillType(i.getBusinessType());
-						financeProfit1.setBillNo(i.getBillNo());
-						financeProfit1.setHblNo(i.getHblno());
-						financeProfit1.setMblNo(i.getMblno());
-						financeProfit1.setCorpName(i.getCorpCnName());
-						financeProfit1.setSalesman(i.getOperatorName());
-						financeProfit1.setPod(i.getPodCnName());
-						financeProfit1.setPol(i.getPolCnName());
-						financeProfit1.setVesselCnName(i.getVesselCnName());
-						financeProfit1.setVoyageNo(i.getVoyageNo());
-						financeProfit1.setLineCnName(i.getLineCnName());
-						financeProfit1.setCarrierCnName(i.getCarrierCnName());
-						financeProfit1.setOperatorName(i.getOperatorName());
-						Date statisticsDateStart;
-						Date statisticsDateEnd;
-						DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-						//判断账期时间是否为空
-						if (ObjectUtils.isNotNull(financeProfit.getStatisticsDateStart()) &&
-							ObjectUtils.isNotNull(financeProfit.getStatisticsDateEnd())) {
-							try {
-								statisticsDateStart = dateFormat.parse(financeProfit.getStatisticsDateStart());
-								statisticsDateEnd = dateFormat.parse(financeProfit.getStatisticsDateEnd());
-								//人民币应收金额
-								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);
-								//是否按审核日期
-								if (ObjectUtils.isNotNull(financeProfit.getExamineDate())) {
-									//是否为本期  true 合并  false 不合并
-									if (i.getApprovedDate().compareTo(statisticsDateStart) >= 0 &&
-										i.getApprovedDate().compareTo(statisticsDateEnd) <= 0) {
-										item.setAmountCr(feeCentersCC);
-										item.setRealAmountCr(feeCentersCCReal);
-										item.setAmountCrUsd(feeCentersUC);
-										item.setRealAmountCrUsd(feeCentersUCReal);
-										item.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										item.setAmountDr(feeCentersCD);
-										item.setRealAmountDr(feeCentersCDReal);
-										item.setAmountDrUsd(feeCentersUD);
-										item.setRealAmountDrUsd(feeCentersUDReal);
-										item.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										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 {
-										financeProfit1.setAmountCr(feeCentersCC);
-										financeProfit1.setRealAmountCr(feeCentersCCReal);
-										financeProfit1.setAmountCrUsd(feeCentersUC);
-										financeProfit1.setRealAmountCrUsd(feeCentersUCReal);
-										financeProfit1.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountDr(feeCentersCD);
-										financeProfit1.setRealAmountDr(feeCentersCDReal);
-										financeProfit1.setAmountDrUsd(feeCentersUD);
-										financeProfit1.setRealAmountDrUsd(feeCentersUDReal);
-										financeProfit1.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-									}
-								} else {
-									//是否为本期  true 合并  false 不合并
-									if (i.getBillDate().compareTo(statisticsDateStart) >= 0 &&
-										i.getBillDate().compareTo(statisticsDateEnd) <= 0) {
-										item.setAmountCr(feeCentersCC);
-										item.setRealAmountCr(feeCentersCCReal);
-										item.setAmountCrUsd(feeCentersUC);
-										item.setRealAmountCrUsd(feeCentersUCReal);
-										item.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										item.setAmountDr(feeCentersCD);
-										item.setRealAmountDr(feeCentersCDReal);
-										item.setAmountDrUsd(feeCentersUD);
-										item.setRealAmountDrUsd(feeCentersUDReal);
-										item.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										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 {
-										financeProfit1.setAmountCr(feeCentersCC);
-										financeProfit1.setRealAmountCr(feeCentersCCReal);
-										financeProfit1.setAmountCrUsd(feeCentersUC);
-										financeProfit1.setRealAmountCrUsd(feeCentersUCReal);
-										financeProfit1.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountDr(feeCentersCD);
-										financeProfit1.setRealAmountDr(feeCentersCDReal);
-										financeProfit1.setAmountDrUsd(feeCentersUD);
-										financeProfit1.setRealAmountDrUsd(feeCentersUDReal);
-										financeProfit1.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-									}
-								}
-							} catch (ParseException e) {
-								throw new RuntimeException(e);
-							}
-							financeProfits.add(financeProfit1);
-						}
+						//人民币应收金额
+						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);
+						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(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP)));
+						item.setRealAmountCrLoc(item.getRealAmountCrLoc().add(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP)));
+						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(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP)));
+						item.setRealAmountDrLoc(item.getRealAmountDrLoc().add(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP)));
+						item.setAmountProfitLoc(item.getAmountProfitLoc().add(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP)));
+						item.setRealAmountProfitLoc(item.getRealAmountProfitLoc().add(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP)));
 					}
 				}
 			}
-			financeProfitList.addAll(financeProfits);
 		} else {
 			if (ObjectUtils.isNotNull(financeProfit.getBillType())) {
 				financeProfit.setBillType(financeProfit.getBillType() + ",SEA,SIA,AEA,AIA");
@@ -358,9 +282,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
 			}
-		}else if ("2".equals(jurisdiction)) {
+		} else if ("2".equals(jurisdiction)) {
 			//动态权限不做任何处理
-		}  else {
+		} else {
 			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
 				lambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
 			}
@@ -525,9 +449,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 				}
 				lambdaQueryWrapper.eq(Bills::getBranchId, deptUtils.getDeptPid());
 			}
-		}else if ("2".equals(jurisdiction)) {
+		} else if ("2".equals(jurisdiction)) {
 			//动态权限不做任何处理
-		}  else {
+		} else {
 			if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("财务")) {
 				lambdaQueryWrapper.apply("find_in_set(team_id,'" + AuthUtil.getPostId() + "')");
 			}
@@ -1080,16 +1004,16 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			}
 		}
 		List<FinanceProfitDtoList> financeProfitList = new ArrayList<>();
-		BigDecimal exrateC = bCurrencyService.getCnyExrate(null,"USD", "C", "2");
-		BigDecimal exrateD = bCurrencyService.getCnyExrate(null,"USD", "D", "2");
+		BigDecimal exrateC = bCurrencyService.getCnyExrate(null, "USD", "C", "2");
+		BigDecimal exrateD = bCurrencyService.getCnyExrate(null, "USD", "D", "2");
 		//是否合并amend费用  true 合并  false 不合并
 		if ("1".equals(financeProfit.getMergeAmendFee())) {
 			financeProfitList = financeProfitMapper.financeProfitSum(financeProfit);
-			String billNo = financeProfitList.stream().map(FinanceProfitDtoList::getBillNo).filter(Objects::nonNull).distinct().collect(Collectors.joining(","));
+			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(orig_bill_no,'" + billNo + "')");
+				.apply("find_in_set(mblno,'" + mblno + "')");
 			if (ObjectUtils.isNotNull(financeProfit.getExamine())) {
 				lambdaQueryWrapper.eq(Amends::getStatus, 3);
 			}
@@ -1104,147 +1028,73 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 						.in(FeeCenter::getPid, pids));
 				}
 			}
-			List<FinanceProfitDtoList> financeProfits = new ArrayList<>();
 			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.getBillNo().equals(item.getBillNo())).collect(Collectors.toList());
+					List<Amends> amends = amendsList.stream().filter(e -> e.getMblno().equals(item.getMblNo())).collect(Collectors.toList());
 					for (Amends i : amends) {
-						//当前业务不属于当期业务,需新插入一条记录
-						FinanceProfitDtoList financeProfit1 = new FinanceProfitDtoList();
-						financeProfit1.setBillType(i.getBusinessType());
-						financeProfit1.setBillNo(i.getBillNo());
-						financeProfit1.setHblNo(i.getHblno());
-						financeProfit1.setMblNo(i.getMblno());
-						financeProfit1.setCorpName(i.getCorpCnName());
-						financeProfit1.setSalesman(i.getOperatorName());
-						financeProfit1.setPod(i.getPodCnName());
-						financeProfit1.setPol(i.getPolCnName());
-						financeProfit1.setVesselCnName(i.getVesselCnName());
-						financeProfit1.setVoyageNo(i.getVoyageNo());
-						financeProfit1.setLineCnName(i.getLineCnName());
-						financeProfit1.setCarrierCnName(i.getCarrierCnName());
-						financeProfit1.setOperatorName(i.getOperatorName());
-						Date statisticsDateStart;
-						Date statisticsDateEnd;
-						DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-						//判断账期时间是否为空
-						if (ObjectUtils.isNotNull(financeProfit.getStatisticsDateStart()) &&
-							ObjectUtils.isNotNull(financeProfit.getStatisticsDateEnd())) {
-							try {
-								statisticsDateStart = dateFormat.parse(financeProfit.getStatisticsDateStart());
-								statisticsDateEnd = dateFormat.parse(financeProfit.getStatisticsDateEnd());
-								//人民币应收金额
-								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);
-								//是否按审核日期
-								if (ObjectUtils.isNotNull(financeProfit.getExamineDate())) {
-									//是否为本期  true 合并  false 不合并
-									if (i.getApprovedDate().compareTo(statisticsDateStart) >= 0 &&
-										i.getApprovedDate().compareTo(statisticsDateEnd) <= 0) {
-										item.setAmountCr(feeCentersCC);
-										item.setRealAmountCr(feeCentersCCReal);
-										item.setAmountCrUsd(feeCentersUC);
-										item.setRealAmountCrUsd(feeCentersUCReal);
-										item.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										item.setAmountDr(feeCentersCD);
-										item.setRealAmountDr(feeCentersCDReal);
-										item.setAmountDrUsd(feeCentersUD);
-										item.setRealAmountDrUsd(feeCentersUDReal);
-										item.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										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 {
-										financeProfit1.setAmountCr(feeCentersCC);
-										financeProfit1.setRealAmountCr(feeCentersCCReal);
-										financeProfit1.setAmountCrUsd(feeCentersUC);
-										financeProfit1.setRealAmountCrUsd(feeCentersUCReal);
-										financeProfit1.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountDr(feeCentersCD);
-										financeProfit1.setRealAmountDr(feeCentersCDReal);
-										financeProfit1.setAmountDrUsd(feeCentersUD);
-										financeProfit1.setRealAmountDrUsd(feeCentersUDReal);
-										financeProfit1.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-									}
-								} else {
-									//是否为本期  true 合并  false 不合并
-									if (i.getBillDate().compareTo(statisticsDateStart) >= 0 &&
-										i.getBillDate().compareTo(statisticsDateEnd) <= 0) {
-										item.setAmountCr(feeCentersCC);
-										item.setRealAmountCr(feeCentersCCReal);
-										item.setAmountCrUsd(feeCentersUC);
-										item.setRealAmountCrUsd(feeCentersUCReal);
-										item.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										item.setAmountDr(feeCentersCD);
-										item.setRealAmountDr(feeCentersCDReal);
-										item.setAmountDrUsd(feeCentersUD);
-										item.setRealAmountDrUsd(feeCentersUDReal);
-										item.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										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 {
-										financeProfit1.setAmountCr(feeCentersCC);
-										financeProfit1.setRealAmountCr(feeCentersCCReal);
-										financeProfit1.setAmountCrUsd(feeCentersUC);
-										financeProfit1.setRealAmountCrUsd(feeCentersUCReal);
-										financeProfit1.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountDr(feeCentersCD);
-										financeProfit1.setRealAmountDr(feeCentersCDReal);
-										financeProfit1.setAmountDrUsd(feeCentersUD);
-										financeProfit1.setRealAmountDrUsd(feeCentersUDReal);
-										financeProfit1.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-									}
-								}
-							} catch (ParseException e) {
-								throw new RuntimeException(e);
-							}
-							financeProfits.add(financeProfit1);
-						}
+						//人民币应收金额
+						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);
+						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(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP)));
+						item.setRealAmountCrLoc(item.getRealAmountCrLoc().add(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP)));
+						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(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP)));
+						item.setRealAmountDrLoc(item.getRealAmountDrLoc().add(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP)));
+						item.setAmountProfitLoc(item.getAmountProfitLoc().add(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP)));
+						item.setRealAmountProfitLoc(item.getRealAmountProfitLoc().add(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP)));
 					}
 				}
 			}
-			financeProfitList.addAll(financeProfits);
 		} else {
 			if (ObjectUtils.isNotNull(financeProfit.getBillType())) {
 				financeProfit.setBillType(financeProfit.getBillType() + ",SEA,SIA,AEA,AIA");
@@ -1309,16 +1159,16 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			}
 		}
 		List<FinanceProfitDtoList> financeProfitList = new ArrayList<>();
-		BigDecimal exrateC = bCurrencyService.getCnyExrate(null,"USD", "C", "2");
-		BigDecimal exrateD = bCurrencyService.getCnyExrate(null,"USD", "D", "2");
+		BigDecimal exrateC = bCurrencyService.getCnyExrate(null, "USD", "C", "2");
+		BigDecimal exrateD = bCurrencyService.getCnyExrate(null, "USD", "D", "2");
 		//是否合并amend费用  true 合并  false 不合并
 		if (ObjectUtils.isNotNull(financeProfit.getMergeAmendFee())) {
 			financeProfitList = financeProfitMapper.financeProfitSum(financeProfit);
-			String billNo = financeProfitList.stream().map(FinanceProfitDtoList::getBillNo).filter(Objects::nonNull).distinct().collect(Collectors.joining(","));
+			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(orig_bill_no,'" + billNo + "')");
+				.apply("find_in_set(mblno,'" + mblno + "')");
 			if (ObjectUtils.isNotNull(financeProfit.getExamine())) {
 				lambdaQueryWrapper.eq(Amends::getStatus, 3);
 			}
@@ -1333,147 +1183,73 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 						.in(FeeCenter::getPid, pids));
 				}
 			}
-			List<FinanceProfitDtoList> financeProfits = new ArrayList<>();
 			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.getBillNo().equals(item.getBillNo())).collect(Collectors.toList());
+					List<Amends> amends = amendsList.stream().filter(e -> e.getMblno().equals(item.getMblNo())).collect(Collectors.toList());
 					for (Amends i : amends) {
-						//当前业务不属于当期业务,需新插入一条记录
-						FinanceProfitDtoList financeProfit1 = new FinanceProfitDtoList();
-						financeProfit1.setBillType(i.getBusinessType());
-						financeProfit1.setBillNo(i.getBillNo());
-						financeProfit1.setHblNo(i.getHblno());
-						financeProfit1.setMblNo(i.getMblno());
-						financeProfit1.setCorpName(i.getCorpCnName());
-						financeProfit1.setSalesman(i.getOperatorName());
-						financeProfit1.setPod(i.getPodCnName());
-						financeProfit1.setPol(i.getPolCnName());
-						financeProfit1.setVesselCnName(i.getVesselCnName());
-						financeProfit1.setVoyageNo(i.getVoyageNo());
-						financeProfit1.setLineCnName(i.getLineCnName());
-						financeProfit1.setCarrierCnName(i.getCarrierCnName());
-						financeProfit1.setOperatorName(i.getOperatorName());
-						Date statisticsDateStart;
-						Date statisticsDateEnd;
-						DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-						//判断账期时间是否为空
-						if (ObjectUtils.isNotNull(financeProfit.getStatisticsDateStart()) &&
-							ObjectUtils.isNotNull(financeProfit.getStatisticsDateEnd())) {
-							try {
-								statisticsDateStart = dateFormat.parse(financeProfit.getStatisticsDateStart());
-								statisticsDateEnd = dateFormat.parse(financeProfit.getStatisticsDateEnd());
-								//人民币应收金额
-								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);
-								//是否按审核日期
-								if (ObjectUtils.isNotNull(financeProfit.getExamineDate())) {
-									//是否为本期  true 合并  false 不合并
-									if (i.getApprovedDate().compareTo(statisticsDateStart) >= 0 &&
-										i.getApprovedDate().compareTo(statisticsDateEnd) <= 0) {
-										item.setAmountCr(feeCentersCC);
-										item.setRealAmountCr(feeCentersCCReal);
-										item.setAmountCrUsd(feeCentersUC);
-										item.setRealAmountCrUsd(feeCentersUCReal);
-										item.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										item.setAmountDr(feeCentersCD);
-										item.setRealAmountDr(feeCentersCDReal);
-										item.setAmountDrUsd(feeCentersUD);
-										item.setRealAmountDrUsd(feeCentersUDReal);
-										item.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										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 {
-										financeProfit1.setAmountCr(feeCentersCC);
-										financeProfit1.setRealAmountCr(feeCentersCCReal);
-										financeProfit1.setAmountCrUsd(feeCentersUC);
-										financeProfit1.setRealAmountCrUsd(feeCentersUCReal);
-										financeProfit1.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountDr(feeCentersCD);
-										financeProfit1.setRealAmountDr(feeCentersCDReal);
-										financeProfit1.setAmountDrUsd(feeCentersUD);
-										financeProfit1.setRealAmountDrUsd(feeCentersUDReal);
-										financeProfit1.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-									}
-								} else {
-									//是否为本期  true 合并  false 不合并
-									if (i.getBillDate().compareTo(statisticsDateStart) >= 0 &&
-										i.getBillDate().compareTo(statisticsDateEnd) <= 0) {
-										item.setAmountCr(feeCentersCC);
-										item.setRealAmountCr(feeCentersCCReal);
-										item.setAmountCrUsd(feeCentersUC);
-										item.setRealAmountCrUsd(feeCentersUCReal);
-										item.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										item.setAmountDr(feeCentersCD);
-										item.setRealAmountDr(feeCentersCDReal);
-										item.setAmountDrUsd(feeCentersUD);
-										item.setRealAmountDrUsd(feeCentersUDReal);
-										item.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										item.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										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 {
-										financeProfit1.setAmountCr(feeCentersCC);
-										financeProfit1.setRealAmountCr(feeCentersCCReal);
-										financeProfit1.setAmountCrUsd(feeCentersUC);
-										financeProfit1.setRealAmountCrUsd(feeCentersUCReal);
-										financeProfit1.setAmountCrLoc(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountCrLoc(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountDr(feeCentersCD);
-										financeProfit1.setRealAmountDr(feeCentersCDReal);
-										financeProfit1.setAmountDrUsd(feeCentersUD);
-										financeProfit1.setRealAmountDrUsd(feeCentersUDReal);
-										financeProfit1.setAmountDrLoc(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountDrLoc(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-										financeProfit1.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
-									}
-								}
-							} catch (ParseException e) {
-								throw new RuntimeException(e);
-							}
-							financeProfits.add(financeProfit1);
-						}
+						//人民币应收金额
+						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);
+						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(feeCentersUC.multiply(exrateC).add(feeCentersCC).setScale(2, RoundingMode.HALF_UP)));
+						item.setRealAmountCrLoc(item.getRealAmountCrLoc().add(feeCentersUCReal.multiply(exrateC).add(feeCentersCCReal).setScale(2, RoundingMode.HALF_UP)));
+						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(feeCentersUD.multiply(exrateD).add(feeCentersCD).setScale(2, RoundingMode.HALF_UP)));
+						item.setRealAmountDrLoc(item.getRealAmountDrLoc().add(feeCentersUDReal.multiply(exrateD).add(feeCentersCDReal).setScale(2, RoundingMode.HALF_UP)));
+						item.setAmountProfitLoc(item.getAmountProfitLoc().add(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP)));
+						item.setRealAmountProfitLoc(item.getRealAmountProfitLoc().add(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP)));
 					}
 				}
 			}
-			financeProfitList.addAll(financeProfits);
 		} else {
 			financeProfit.setBillType(financeProfit.getBillType() + ",SEA,SIA,AEA,AIA");
 			financeProfitList = financeProfitMapper.financeProfitSum(financeProfit);
@@ -2206,4 +1982,53 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 		}
 		return feeSettlementExcelList;
 	}
+
+	@Override
+	public R<Map<String, Object>> arrivalReminder() {
+		Map<String, Object> map = new HashMap<>();
+		int day = 5;
+		Date date = new Date();
+		String arrivalReminderDay = sysClient.getParamService("arrival.reminder");
+		if (ObjectUtils.isNotNull(arrivalReminderDay)) {
+			day = Integer.parseInt(arrivalReminderDay);
+		}
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(date);
+		calendar.add(Calendar.DAY_OF_MONTH, -day);
+		Date date1 = calendar.getTime();
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		LambdaQueryWrapper<Bills> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0)
+			.eq(Bills::getBranchId, AuthUtil.getDeptId())
+			.apply("DATE_FORMAT(eta,'%Y-%m-%d') > '" + sdf.format(date1) + "' and DATE_FORMAT(eta,'%Y-%m-%d') <= '" + sdf.format(date)+"'");
+		map.put("arrivalReminder", billsMapper.selectCount(lambdaQueryWrapper));
+		return R.data(map);
+	}
+
+	@Override
+	public R<IPage<Bills>> arrivalReminderList(Bills bills, Query query) {
+		int day = 5;
+		Date date = new Date();
+		String arrivalReminderDay = sysClient.getParamService("arrival.reminder");
+		if (ObjectUtils.isNotNull(arrivalReminderDay)) {
+			day = Integer.parseInt(arrivalReminderDay);
+		}
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(date);
+		calendar.add(Calendar.DAY_OF_MONTH, -day);
+		Date date1 = calendar.getTime();
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		LambdaQueryWrapper<Bills> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0)
+			.eq(Bills::getBranchId, AuthUtil.getDeptId())
+			.like(ObjectUtils.isNotNull(bills.getBillNo()), Bills::getBillNo, bills.getBillNo())
+			.and(ObjectUtils.isNotNull(bills.getCorpCnName()), i -> i.like(Bills::getCorpCnName, bills.getCorpCnName()).or()
+				.like(Bills::getCorpEnName, bills.getCorpCnName()))
+			.like(ObjectUtils.isNotNull(bills.getBillNo()), Bills::getBillNo, bills.getBillNo())
+			.apply("DATE_FORMAT(eta,'%Y-%m-%d') > '" + sdf.format(date1) + "' and DATE_FORMAT(eta,'%Y-%m-%d') <= '" + sdf.format(date)+"'");
+		IPage<Bills> billsIPage = billsMapper.selectPage(Condition.getPage(query), lambdaQueryWrapper);
+		return R.data(billsIPage);
+	}
 }