纪新园 2 лет назад
Родитель
Сommit
ee1315e77b
34 измененных файлов с 1171 добавлено и 113 удалено
  1. 1 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FinanceProfitDtoList.java
  2. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/dto/FinanceProfitDTO.java
  3. 111 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/entity/FinanceProfit.java
  4. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/vo/FinanceProfitVO.java
  5. 7 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/cur/service/IBCurrencyService.java
  6. 54 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/cur/service/impl/BCurrencyServiceImpl.java
  7. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java
  8. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/mapper/AeaBillsMapper.java
  9. 14 4
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/mapper/AeaBillsMapper.xml
  10. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/mapper/AmendsMapper.java
  11. 5 1
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/mapper/AmendsMapper.xml
  12. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/business/customsDeclaration/mapper/CustomsDeclarationMapper.java
  13. 12 5
      blade-service/blade-los/src/main/java/org/springblade/los/business/customsDeclaration/mapper/CustomsDeclarationMapper.xml
  14. 2 2
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.java
  15. 12 3
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml
  16. 0 1
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/ContainersBillsMapper.java
  17. 9 1
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/controller/FinanceStatisticsController.java
  18. 4 1
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/IStatisticAnalysisService.java
  19. 259 48
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java
  20. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/view/controller/FinanceProfitController.java
  21. 47 0
      blade-service/blade-los/src/main/java/org/springblade/los/view/mapper/FinanceProfitMapper.java
  22. 251 0
      blade-service/blade-los/src/main/java/org/springblade/los/view/mapper/FinanceProfitMapper.xml
  23. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/view/service/IFinanceProfitService.java
  24. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/view/service/impl/FinanceProfitServiceImpl.java
  25. 5 1
      blade-service/blade-pay/src/main/java/org/springblade/pay/tonglianPayment/utils/SybPayService.java
  26. 12 1
      blade-service/blade-project/src/main/java/org/springblade/project/handler/TaskCompleteJobHandler.java
  27. 5 0
      blade-service/blade-sales-part/pom.xml
  28. 3 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/mapper/CorpsTypeMapper.java
  29. 1 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/mapper/CorpsTypeMapper.xml
  30. 2 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsDescServiceImpl.java
  31. 1 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsTypeServiceImpl.java
  32. 27 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/handler/SynchronizeDataJobHandler.java
  33. 1 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderItemsMapper.java
  34. 41 32
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderItemsMapper.xml

+ 1 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FinanceProfit.java → blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FinanceProfitDtoList.java

@@ -9,7 +9,7 @@ import java.math.BigDecimal;
  * @date : 2024/1/26
  */
 @Data
-public class FinanceProfit {
+public class FinanceProfitDtoList {
 
 
 	/**

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/dto/FinanceProfitDTO.java

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

+ 111 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/entity/FinanceProfit.java

@@ -0,0 +1,111 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * VIEW实体类
+ *
+ * @author BladeX
+ * @since 2024-03-13
+ */
+@Data
+@TableName("los_finance_profit")
+@ApiModel(value = "FinanceProfit对象", description = "VIEW")
+public class FinanceProfit implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private String businessType;
+	private String billNo;
+	private String hblno;
+	private String mblno;
+	private String corpCnName;
+	private Long corpId;
+	private Date approvedDate;
+	private Date billDate;
+	private String srcCnName;
+	private String podCnName;
+	private String polCnName;
+	private Long vesselId;
+	private String vesselCnName;
+	private String voyageNo;
+	private Long accDept;
+	private String accDeptName;
+	private Long lineId;
+	private String lineCnName;
+	private Long carrierId;
+	private String carrierCnName;
+	private String operatorName;
+	private String isDeleted;
+	private String srcType;
+	private Long srcId;
+	@TableField("STATUS")
+	private Integer status;
+	private Date createTime;
+	private BigDecimal amountDrUsd;
+	private BigDecimal realAmountDrUsd;
+	private BigDecimal amountDr;
+	private BigDecimal realAmountDr;
+	/**
+	 * 合计应收
+	 */
+	@TableField(exist = false)
+	private BigDecimal amountDrLoc;
+
+	/**
+	 * 实际合计应收
+	 */
+	@TableField(exist = false)
+	private BigDecimal realAmountDrLoc;
+	private BigDecimal amountCrUsd;
+	private BigDecimal realAmountCrUsd;
+	private BigDecimal amountCr;
+	private BigDecimal realAmountCr;
+	/**
+	 * 合计应付
+	 */
+	@TableField(exist = false)
+	private BigDecimal amountCrLoc;
+
+	/**
+	 * 实际合计应付
+	 */
+	@TableField(exist = false)
+	private BigDecimal realAmountCrLoc;
+
+	private BigDecimal amountProfitLoc;
+
+	/**
+	 * 实际单票利润
+	 */
+	@TableField(exist = false)
+	private BigDecimal realAmountProfitLoc;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/view/vo/FinanceProfitVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.vo;
+
+import org.springblade.los.view.entity.FinanceProfit;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * VIEW视图实体类
+ *
+ * @author BladeX
+ * @since 2024-03-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "FinanceProfitVO对象", description = "VIEW")
+public class FinanceProfitVO extends FinanceProfit {
+	private static final long serialVersionUID = 1L;
+
+}

+ 7 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/cur/service/IBCurrencyService.java

@@ -80,5 +80,12 @@ public interface IBCurrencyService extends IService<BCurrency> {
 	 */
 	BigDecimal converterCny(String curCode, BigDecimal amount,String dc);
 
+	/**
+	 * 非本币金额汇率
+	 * @param curCode 币别
+	 * @return 结果
+	 */
+	BigDecimal getCnyExrate(String curCode, String dc);
+
 	List<BCurrency> getExrate(BCurrency bCurrency);
 }

+ 54 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/cur/service/impl/BCurrencyServiceImpl.java

@@ -322,6 +322,60 @@ public class BCurrencyServiceImpl extends ServiceImpl<CurrencyMapper, BCurrency>
 	}
 
 	@Override
+	public BigDecimal getCnyExrate(String curCode, String dc) {
+		BigDecimal CNY = new BigDecimal("0.00");
+		// 创建 Calendar 对象并设置为当前时间
+		Calendar calendar = Calendar.getInstance();
+		int year = calendar.get(Calendar.YEAR); // 获取年份
+		int month = calendar.get(Calendar.MONTH) + 1; // 获取月份(注意需加上1,因为月份从0开始计数)
+		BCurrency bCurrency = baseMapper.selectOne(new LambdaQueryWrapper<BCurrency>()
+			.eq(BCurrency::getTenantId, AuthUtil.getTenantId())
+			.eq(BCurrency::getIsDeleted, 0)
+			.eq(BCurrency::getCode, curCode));
+		if (ObjectUtils.isNotNull(bCurrency) && ObjectUtils.isNotNull(bCurrency.getExrate()) &&
+			new BigDecimal("0.00").compareTo(bCurrency.getExrate()) != 0) {
+			LambdaQueryWrapper<BCurExrate> lambdaQueryWrapper = new LambdaQueryWrapper<BCurExrate>()
+				.eq(BCurExrate::getCode, curCode)
+				.eq(BCurExrate::getTenantId, AuthUtil.getTenantId())
+				.eq(BCurExrate::getIsDeleted, 0)
+				.eq(BCurExrate::getExrateYear, year)
+				.eq(BCurExrate::getType, bCurrency.getParitiesType())
+				;
+			if ("月汇率".equals(bCurrency.getParitiesType())) {
+				lambdaQueryWrapper.eq(BCurExrate::getExrateMonth, month);
+			}
+			BCurExrate bCurExrate = bCurExrateService.getOne(lambdaQueryWrapper);
+			if ("D".equals(dc)) {
+				if (ObjectUtils.isNull(bCurExrate)) {
+					throw new RuntimeException("未找到" + year + "年" + month + "月,币别为USD汇率信息");
+				}
+				if (ObjectUtils.isNull(bCurExrate.getExrateReceipts()) &&
+					new BigDecimal("0.00").compareTo(bCurExrate.getExrateReceipts()) == 0) {
+					throw new RuntimeException("未找到" + year + "年" + month + "月,币别为" + curCode + "实收汇率信息");
+				} else {
+					CNY = bCurExrate.getExrateReceipts();
+				}
+			} else if ("C".equals(dc)) {
+				if (ObjectUtils.isNull(bCurExrate)) {
+					throw new RuntimeException("未找到" + year + "年" + month + "月,币别为USD汇率信息");
+				}
+				if (ObjectUtils.isNull(bCurExrate.getExratePayment()) &&
+					new BigDecimal("0.00").compareTo(bCurExrate.getExratePayment()) == 0) {
+					throw new RuntimeException("未找到" + year + "年" + month + "月,币别为" + curCode + "实付汇率信息");
+				} else {
+					CNY = bCurExrate.getExratePayment();
+				}
+			} else {
+				CNY = bCurrency.getExrate();
+			}
+
+		} else {
+			throw new RuntimeException("未找到币别汇率信息");
+		}
+		return CNY;
+	}
+
+	@Override
 	public List<BCurrency> getExrate(BCurrency bCurrency) {
 		// 创建 Calendar 对象并设置为当前时间
 		Calendar calendar = Calendar.getInstance();

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

@@ -142,6 +142,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			reports.setCreateTime(new Date());
 			reports.setCreateUser(AuthUtil.getUserId());
 			reports.setCreateUserName(AuthUtil.getUserName());
+			reports.setBranchId(deptUtils.getDeptPid()+"");
 			//获取部门ids对应中文名
 			if (ObjectUtils.isNotNull(deptUtils.getDeptPid())) {
 				reports.setCreateDept(deptUtils.getDeptPid() + "");

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/mapper/AeaBillsMapper.java

@@ -21,7 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
 import org.springblade.los.business.aea.entity.AeaBills;
 import org.springblade.los.business.aea.vo.AeaBillsVO;
-import org.springblade.los.statisticAnalysis.FinanceProfit;
+import org.springblade.los.statisticAnalysis.FinanceProfitDtoList;
 
 import java.util.List;
 import java.util.Map;
@@ -43,7 +43,7 @@ public interface AeaBillsMapper extends BaseMapper<AeaBills> {
 	 */
 	List<AeaBillsVO> selectAeaBillsPage(IPage page, AeaBillsVO aeaBills);
 
-	List<FinanceProfit> financeProfit(@Param("data") FinanceProfit financeProfit);
+	List<FinanceProfitDtoList> financeProfit(@Param("data") FinanceProfitDtoList financeProfit);
 
 	List<Map<String, Object>> trend(@Param("tenantId") String tenantId, @Param("deptPid") Long deptPid, @Param("postId") String postId,
 									@Param("date") String dateStart);

+ 14 - 4
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/mapper/AeaBillsMapper.xml

@@ -207,16 +207,22 @@
     <select id="selectAeaBillsPage" resultMap="aeaBillsResultMap">
         select * from los_aea_bills where is_deleted = 0
     </select>
-    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfit">
+    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfitDtoList">
         SELECT
-        seb.bill_type AS billType,
+        seb.business_type AS billType,
         seb.bill_no AS billNo,
         seb.hblno AS hBlNo,
         seb.mblno AS mBlNo,
         seb.corp_cn_name AS corpName,
-        seb.bill_type AS statisticsDate,
+        <if test="data.examineDate != null and data.examineDate != ''">
+            seb.approved_date AS statisticsDate,
+        </if>
+        <if test="data.examineDate == null or data.examineDate == ''">
+            seb.bill_date AS statisticsDate,
+        </if>
         seb.src_cn_name AS salesman,
         seb.voyage_no AS voyageNo,
+        seb.acc_dept_name AS accDeptName,
         seb.carrier_cn_name AS carrierCnName,
         seb.operator_name AS operatorName,
         SUM(IF(feeDU.amount,feeDU.amount,0.00)) AS amountDrUsd,
@@ -229,7 +235,7 @@
         SUM(IF(feeCC.stl_ttl_amount,feeCC.stl_ttl_amount,0.00)) AS realAmountCr,
         seb.amount_profit_loc AS amountProfitLoc
         FROM
-        los_sea_bills seb
+        los_aea_bills seb
         LEFT JOIN los_fee_center feeCC ON seb.id = feeCC.pid
         AND feeCC.dc = 'C' and feeCC.cur_code = 'CNY' AND feeCC.is_deleted = '0'
         LEFT JOIN los_fee_center feeCU ON seb.id = feeCU.pid
@@ -297,6 +303,10 @@
             GROUP BY
             seb.bill_no
         </if>
+        <if test="data.consistentCorpMerge != null and data.consistentCorpMerge != ''">
+            GROUP BY
+            seb.corp_id
+        </if>
         ORDER BY
         seb.create_time
     </select>

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/business/amends/mapper/AmendsMapper.java

@@ -21,7 +21,7 @@ import org.springblade.los.business.amends.entity.Amends;
 import org.springblade.los.business.amends.vo.AmendsVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.los.statisticAnalysis.FinanceProfit;
+import org.springblade.los.statisticAnalysis.FinanceProfitDtoList;
 
 import java.util.List;
 
@@ -42,5 +42,5 @@ public interface AmendsMapper extends BaseMapper<Amends> {
 	 */
 	List<AmendsVO> selectAmendsPage(IPage page, AmendsVO amends);
 
-    List<FinanceProfit> financeProfit(@Param("data")FinanceProfit financeProfit);
+    List<FinanceProfitDtoList> financeProfit(@Param("data") FinanceProfitDtoList financeProfit);
 }

+ 5 - 1
blade-service/blade-los/src/main/java/org/springblade/los/business/amends/mapper/AmendsMapper.xml

@@ -82,7 +82,7 @@
     <select id="selectAmendsPage" resultMap="amendsResultMap">
         select * from los_amends where is_deleted = 0
     </select>
-    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfit">
+    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfitDtoList">
         SELECT
         seb.business_type AS billType,
         seb.bill_no AS billNo,
@@ -167,6 +167,10 @@
             GROUP BY
             seb.bill_no
         </if>
+        <if test="data.consistentCorpMerge != null and data.consistentCorpMerge != ''">
+            GROUP BY
+            seb.corp_id
+        </if>
         ORDER BY
         seb.create_time
     </select>

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/business/customsDeclaration/mapper/CustomsDeclarationMapper.java

@@ -21,7 +21,7 @@ import org.springblade.los.business.customsDeclaration.entity.CustomsDeclaration
 import org.springblade.los.business.customsDeclaration.vo.CustomsDeclarationVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.los.statisticAnalysis.FinanceProfit;
+import org.springblade.los.statisticAnalysis.FinanceProfitDtoList;
 
 import java.util.List;
 
@@ -42,5 +42,5 @@ public interface CustomsDeclarationMapper extends BaseMapper<CustomsDeclaration>
 	 */
 	List<CustomsDeclarationVO> selectCustomsDeclarationPage(IPage page, CustomsDeclarationVO customsDeclaration);
 
-	List<FinanceProfit> financeProfit(@Param("data")FinanceProfit financeProfit);
+	List<FinanceProfitDtoList> financeProfit(@Param("data") FinanceProfitDtoList financeProfit);
 }

+ 12 - 5
blade-service/blade-los/src/main/java/org/springblade/los/business/customsDeclaration/mapper/CustomsDeclarationMapper.xml

@@ -120,14 +120,20 @@
     <select id="selectCustomsDeclarationPage" resultMap="customsDeclarationResultMap">
         select * from los_customs_declaration where is_deleted = 0
     </select>
-    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfit">
+    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfitDtoList">
         SELECT
         seb.business_type AS billType,
         seb.bill_no AS billNo,
         seb.mblno AS mBlNo,
         seb.corp_cn_name AS corpName,
-        seb.bill_date AS statisticsDate,
+        <if test="data.examineDate != null and data.examineDate != ''">
+            seb.approved_date AS statisticsDate,
+        </if>
+        <if test="data.examineDate == null or data.examineDate == ''">
+            seb.bill_date AS statisticsDate,
+        </if>
         seb.src_cn_name AS salesman,
+        seb.acc_dept_name AS accDeptName,
         seb.vessel_cn_name AS vesselCnName,
         SUM(IF(feeDU.amount,feeDU.amount,0.00)) AS amountDrUsd,
         SUM(IF(feeDU.stl_ttl_amount,feeDU.stl_ttl_amount,0.00)) AS realAmountDrUsd,
@@ -165,9 +171,6 @@
         <if test='data.accDeptId != null'>
             and seb.acc_dept = #{data.accDeptId}
         </if>
-        <if test="data.voyageNo != null and data.voyageNo != ''">
-            and seb.voyage_no = #{data.voyageNo}
-        </if>
         <if test="data.srcType != null and data.srcType != ''">
             and seb.src_type = #{data.srcType}
         </if>
@@ -197,6 +200,10 @@
             GROUP BY
             seb.bill_no
         </if>
+        <if test="data.consistentCorpMerge != null and data.consistentCorpMerge != ''">
+            GROUP BY
+            seb.corp_id
+        </if>
         ORDER BY
         seb.create_time
     </select>

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

@@ -24,7 +24,7 @@ import org.springblade.los.business.sea.vo.BillsVO;
 import org.springblade.los.finance.fee.entity.ListAccBillVO;
 import org.springblade.los.finance.fee.vo.FinAccBillsVO;
 import org.springblade.los.statisticAnalysis.DecisionAnalysis;
-import org.springblade.los.statisticAnalysis.FinanceProfit;
+import org.springblade.los.statisticAnalysis.FinanceProfitDtoList;
 
 import java.util.List;
 import java.util.Map;
@@ -56,7 +56,7 @@ public interface BillsMapper extends BaseMapper<Bills> {
 
 	FinAccBillsVO listByAccBillId(@Param("acc") ListAccBillVO finAccBills);
 
-	List<FinanceProfit> financeProfit(@Param("data") FinanceProfit financeProfit);
+	List<FinanceProfitDtoList> financeProfit(@Param("data") FinanceProfitDtoList financeProfit);
 
 	List<Map<String, Object>> trend(@Param("tenantId") String tenantId, @Param("deptPid") Long deptPid, @Param("postId") String postId,
 									@Param("date") String date);

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

@@ -754,14 +754,19 @@
         ORDER BY
             m.id
     </select>
-    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfit">
+    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfitDtoList">
         SELECT
-        seb.bill_type AS billType,
+        seb.business_type AS billType,
         seb.bill_no AS billNo,
         seb.hblno AS hBlNo,
         seb.mblno AS mBlNo,
         seb.corp_cn_name AS corpName,
-        seb.bill_type AS statisticsDate,
+        <if test="data.examineDate != null and data.examineDate != ''">
+            seb.approved_date AS statisticsDate,
+        </if>
+        <if test="data.examineDate == null or data.examineDate == ''">
+            seb.bill_date AS statisticsDate,
+        </if>
         seb.src_cn_name AS salesman,
         seb.pod_cn_name AS pod,
         seb.pol_cn_name AS pol,
@@ -851,6 +856,10 @@
             GROUP BY
             seb.bill_no
         </if>
+        <if test="data.consistentCorpMerge != null and data.consistentCorpMerge != ''">
+            GROUP BY
+            seb.corp_id
+        </if>
         ORDER BY
         seb.create_time
     </select>

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

@@ -21,7 +21,6 @@ import org.springblade.los.business.sea.entity.ContainersBills;
 import org.springblade.los.business.sea.vo.ContainersBillsVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.los.statisticAnalysis.FinanceProfit;
 
 import java.util.List;
 

+ 9 - 1
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/controller/FinanceStatisticsController.java

@@ -43,11 +43,19 @@ public class FinanceStatisticsController {
 	@GetMapping("/financeProfit")
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页", notes = "传入decisionAnalysis")
-	public R<IPage<FinanceProfit>> financeProfit(FinanceProfit financeProfit, Query query) {
+	public R<IPage<FinanceProfitDtoList>> financeProfit(FinanceProfitDtoList financeProfit, Query query) {
 		return statisticAnalysisService.financeProfit(financeProfit, Condition.getPage(query));
 	}
 
 	/**
+	 * 分页 决策分析列表合计
+	 */
+	@GetMapping("/financeProfitSum")
+	public R financeProfitSum(FinanceProfitDtoList financeProfit) {
+		return statisticAnalysisService.financeProfitSum(financeProfit);
+	}
+
+	/**
 	 * 分页 应收(付)实收(付)汇总
 	 */
 	@GetMapping("/feeSummary")

+ 4 - 1
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.tool.api.R;
 import org.springblade.los.statisticAnalysis.*;
+import org.springblade.los.view.entity.FinanceProfit;
 
 import java.util.List;
 import java.util.Map;
@@ -44,7 +45,7 @@ public interface IStatisticAnalysisService {
 
 	R<List<Map<String, Object>>> decisionAnalysisByYWY();
 
-    R<IPage<FinanceProfit>> financeProfit(FinanceProfit financeProfit, IPage<FinanceProfit> page);
+    R<IPage<FinanceProfitDtoList>> financeProfit(FinanceProfitDtoList financeProfit, IPage<FinanceProfitDtoList> page);
 
 	R<Map<String, Object>> businessSum(String dateStart, String dateEnd);
 
@@ -69,4 +70,6 @@ public interface IStatisticAnalysisService {
 	R<IPage<AgingAnalysisRD>> agingAnalysis(FeeSummaryQ feeSummaryQ, IPage<AgingAnalysisRD> page);
 
 	List<AgingAnalysisRD> agingAnalysisExport(FeeSummaryQ feeSummaryQ);
+
+	R financeProfitSum(FinanceProfitDtoList financeProfit);
 }

+ 259 - 48
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -25,6 +25,7 @@ import org.springblade.los.finance.stl.entity.FinStlBills;
 import org.springblade.los.finance.stl.mapper.FinStlBillsMapper;
 import org.springblade.los.statisticAnalysis.*;
 import org.springblade.los.statisticAnalysis.service.IStatisticAnalysisService;
+import org.springblade.los.view.mapper.FinanceProfitMapper;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
@@ -53,6 +54,7 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 	private final FinStlBillsMapper finStlBillsMapper;
 	private final FinInvoicesMapper finInvoicesMapper;
 	private final FinAccBillsMapper finAccBillsMapper;
+	private final FinanceProfitMapper financeProfitMapper;
 
 	private final IDeptUtils deptUtils;
 
@@ -74,28 +76,31 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 	}
 
 	@Override
-	public R<IPage<FinanceProfit>> financeProfit(FinanceProfit financeProfit, IPage<FinanceProfit> page) {
-		List<FinanceProfit> financeProfitList = new ArrayList<>();
-		if (financeProfit.getBillType().contains("SE") || financeProfit.getBillType().contains("AE")) {
-			List<FinanceProfit> financeProfitListHy = billsMapper.financeProfit(financeProfit);
+	public R<IPage<FinanceProfitDtoList>> financeProfit(FinanceProfitDtoList financeProfit, IPage<FinanceProfitDtoList> page) {
+		/*if (financeProfit.getBillType().contains("SE") || financeProfit.getBillType().contains("AE")) {
+			List<FinanceProfitDtoList> financeProfitListHy = billsMapper.financeProfit(financeProfit);
 			if (!financeProfitListHy.isEmpty()) {
 				financeProfitList.addAll(financeProfitListHy);
 			}
 		} else if (financeProfit.getBillType().contains("SI") || financeProfit.getBillType().contains("AI")) {
-			List<FinanceProfit> financeProfitListKy = aeaBillsMapper.financeProfit(financeProfit);
+			List<FinanceProfitDtoList> financeProfitListKy = aeaBillsMapper.financeProfit(financeProfit);
 			if (!financeProfitListKy.isEmpty()) {
 				financeProfitList.addAll(financeProfitListKy);
 			}
 		} else if (financeProfit.getBillType().contains("BGSE") || financeProfit.getBillType().contains("BGSI")
 			|| financeProfit.getBillType().contains("BGAE") || financeProfit.getBillType().contains("BGAI")) {
-			List<FinanceProfit> financeProfitListBg = customsDeclarationMapper.financeProfit(financeProfit);
+			List<FinanceProfitDtoList> financeProfitListBg = customsDeclarationMapper.financeProfit(financeProfit);
 			if (!financeProfitListBg.isEmpty()) {
 				financeProfitList.addAll(financeProfitListBg);
 			}
-		}
+		}*/
+		List<FinanceProfitDtoList> financeProfitList = new ArrayList<>();
+		BigDecimal exrateC = bCurrencyService.getCnyExrate("USD", "C");
+		BigDecimal exrateD = bCurrencyService.getCnyExrate("USD", "D");
 		//是否合并amend费用  true 合并  false 不合并
 		if (ObjectUtils.isNotNull(financeProfit.getMergeAmendFee())) {
-			String billNo = financeProfitList.stream().map(FinanceProfit::getBillNo).filter(Objects::nonNull).distinct().collect(Collectors.joining(","));
+			financeProfitList = financeProfitMapper.financeProfit(financeProfit, page);
+			String billNo = financeProfitList.stream().map(FinanceProfitDtoList::getBillNo).filter(Objects::nonNull).distinct().collect(Collectors.joining(","));
 			LambdaQueryWrapper<Amends> lambdaQueryWrapper = new LambdaQueryWrapper<Amends>()
 				.eq(Amends::getTenantId, AuthUtil.getTenantId())
 				.eq(Amends::getIsDeleted, 0)
@@ -114,14 +119,14 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 						.in(FeeCenter::getPid, pids));
 				}
 			}
-			List<FinanceProfit> financeProfits = new ArrayList<>();
-			for (FinanceProfit item : financeProfitList) {
+			List<FinanceProfitDtoList> financeProfits = new ArrayList<>();
+			for (FinanceProfitDtoList item : financeProfitList) {
 				if (!amendsList.isEmpty() && !feeCenterList.isEmpty()) {
 					//获取当前业务类型所有amend
 					List<Amends> amends = amendsList.stream().filter(e -> e.getBillNo().equals(item.getBillNo())).collect(Collectors.toList());
 					for (Amends i : amends) {
 						//当前业务不属于当期业务,需新插入一条记录
-						FinanceProfit financeProfit1 = new FinanceProfit();
+						FinanceProfitDtoList financeProfit1 = new FinanceProfitDtoList();
 						financeProfit1.setBillType(i.getBusinessType());
 						financeProfit1.setBillNo(i.getBillNo());
 						financeProfit1.setHBlNo(i.getHblno());
@@ -147,35 +152,35 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 								//人民币应收金额
 								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);
+									.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);
+									.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);
+									.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);
+									.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);
+									.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);
+									.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);
+									.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);
+									.map(FeeCenter::getStlTtlAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
 								//是否按审核日期
 								if (ObjectUtils.isNotNull(financeProfit.getExamineDate())) {
 									//是否为本期  true 合并  false 不合并
@@ -185,31 +190,31 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 										item.setRealAmountCr(feeCentersCCReal);
 										item.setAmountCrUsd(feeCentersUC);
 										item.setRealAmountCrUsd(feeCentersUCReal);
-										item.setAmountCrLoc(feeCentersCC.add(bCurrencyService.converterCny("USD", feeCentersUC, "C")));
-										item.setRealAmountCrLoc(feeCentersCCReal.add(bCurrencyService.converterCny("USD", feeCentersUCReal, "C")));
+										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(feeCentersCD.add(bCurrencyService.converterCny("USD", feeCentersUD, "C")));
-										item.setRealAmountDrLoc(feeCentersCDReal.add(bCurrencyService.converterCny("USD", feeCentersUDReal, "C")));
-										item.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()));
-										item.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()));
+										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(feeCentersCC.add(bCurrencyService.converterCny("USD", feeCentersUC, "C")));
-										financeProfit1.setRealAmountCrLoc(feeCentersCCReal.add(bCurrencyService.converterCny("USD", feeCentersUCReal, "C")));
+										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(feeCentersCD.add(bCurrencyService.converterCny("USD", feeCentersUD, "C")));
-										financeProfit1.setRealAmountDrLoc(feeCentersCDReal.add(bCurrencyService.converterCny("USD", feeCentersUDReal, "C")));
-										financeProfit1.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()));
-										financeProfit1.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()));
+										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 不合并
@@ -219,31 +224,31 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 										item.setRealAmountCr(feeCentersCCReal);
 										item.setAmountCrUsd(feeCentersUC);
 										item.setRealAmountCrUsd(feeCentersUCReal);
-										item.setAmountCrLoc(feeCentersCC.add(bCurrencyService.converterCny("USD", feeCentersUC, "C")));
-										item.setRealAmountCrLoc(feeCentersCCReal.add(bCurrencyService.converterCny("USD", feeCentersUCReal, "C")));
+										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(feeCentersCD.add(bCurrencyService.converterCny("USD", feeCentersUD, "C")));
-										item.setRealAmountDrLoc(feeCentersCDReal.add(bCurrencyService.converterCny("USD", feeCentersUDReal, "C")));
-										item.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()));
-										item.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()));
+										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(feeCentersCC.add(bCurrencyService.converterCny("USD", feeCentersUC, "C")));
-										financeProfit1.setRealAmountCrLoc(feeCentersCCReal.add(bCurrencyService.converterCny("USD", feeCentersUCReal, "C")));
+										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(feeCentersCD.add(bCurrencyService.converterCny("USD", feeCentersUD, "C")));
-										financeProfit1.setRealAmountDrLoc(feeCentersCDReal.add(bCurrencyService.converterCny("USD", feeCentersUDReal, "C")));
-										financeProfit1.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()));
-										financeProfit1.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()));
+										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) {
@@ -256,15 +261,21 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			}
 			financeProfitList.addAll(financeProfits);
 		} else {
-			List<FinanceProfit> financeProfitListBg = amendsMapper.financeProfit(financeProfit);
+			financeProfit.setBillType(financeProfit.getBillType() + ",SEA,SIA,AEA,AIA");
+			financeProfitList = financeProfitMapper.financeProfit(financeProfit, page);
+			/*List<FinanceProfitDtoList> financeProfitListBg = amendsMapper.financeProfit(financeProfit);
 			if (!financeProfitListBg.isEmpty()) {
 				financeProfitList.addAll(financeProfitListBg);
-			}
+			}*/
 		}
-		for (FinanceProfit item : financeProfitList) {
+		for (FinanceProfitDtoList item : financeProfitList) {
 			if (null != item) {
-				item.setRealAmountProfitLoc((ObjectUtils.isNotNull(item.getRealAmountDrLoc()) ? item.getRealAmountDrLoc() : new BigDecimal("0"))
-					.subtract((ObjectUtils.isNotNull(item.getRealAmountCrLoc()) ? item.getRealAmountCrLoc() : new BigDecimal("0"))));
+				item.setAmountCrLoc(item.getAmountCrUsd().multiply(exrateC).add(item.getAmountCr()).setScale(2, RoundingMode.HALF_UP));
+				item.setRealAmountCrLoc(item.getRealAmountCrUsd().multiply(exrateC).add(item.getRealAmountCr()).setScale(2, RoundingMode.HALF_UP));
+				item.setAmountDrLoc(item.getAmountDrUsd().multiply(exrateC).add(item.getAmountDr()).setScale(2, RoundingMode.HALF_UP));
+				item.setRealAmountDrLoc(item.getRealAmountDrUsd().multiply(exrateC).add(item.getRealAmountDr()).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));
 			}
 		}
 		return R.data(page.setRecords(financeProfitList));
@@ -683,4 +694,204 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 	public List<AgingAnalysisRD> agingAnalysisExport(FeeSummaryQ feeSummaryQ) {
 		return finAccBillsMapper.agingAnalysisExport(feeSummaryQ);
 	}
+
+	@Override
+	public R financeProfitSum(FinanceProfitDtoList financeProfit) {
+		List<FinanceProfitDtoList> financeProfitList = new ArrayList<>();
+		BigDecimal exrateC = bCurrencyService.getCnyExrate("USD", "C");
+		BigDecimal exrateD = bCurrencyService.getCnyExrate("USD", "D");
+		//是否合并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(","));
+			LambdaQueryWrapper<Amends> lambdaQueryWrapper = new LambdaQueryWrapper<Amends>()
+				.eq(Amends::getTenantId, AuthUtil.getTenantId())
+				.eq(Amends::getIsDeleted, 0)
+				.apply("find_in_set(orig_bill_no,'" + billNo + "')");
+			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 = feeCenterMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
+						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+						.eq(FeeCenter::getIsDeleted, 0)
+						.in(FeeCenter::getPid, pids));
+				}
+			}
+			List<FinanceProfitDtoList> financeProfits = new ArrayList<>();
+			for (FinanceProfitDtoList item : financeProfitList) {
+				if (!amendsList.isEmpty() && !feeCenterList.isEmpty()) {
+					//获取当前业务类型所有amend
+					List<Amends> amends = amendsList.stream().filter(e -> e.getBillNo().equals(item.getBillNo())).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);
+						}
+					}
+				}
+			}
+			financeProfitList.addAll(financeProfits);
+		} else {
+			financeProfit.setBillType(financeProfit.getBillType() + ",SEA,SIA,AEA,AIA");
+			financeProfitList = financeProfitMapper.financeProfitSum(financeProfit);
+		}
+		for (FinanceProfitDtoList item : financeProfitList) {
+			if (null != item) {
+				item.setAmountCrLoc(item.getAmountCrUsd().multiply(exrateC).add(item.getAmountCr()).setScale(2, RoundingMode.HALF_UP));
+				item.setRealAmountCrLoc(item.getRealAmountCrUsd().multiply(exrateC).add(item.getRealAmountCr()).setScale(2, RoundingMode.HALF_UP));
+				item.setAmountDrLoc(item.getAmountDrUsd().multiply(exrateC).add(item.getAmountDr()).setScale(2, RoundingMode.HALF_UP));
+				item.setRealAmountDrLoc(item.getRealAmountDrUsd().multiply(exrateC).add(item.getRealAmountDr()).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));
+			}
+		}
+		Map<String, BigDecimal> map = new HashMap<>();
+		map.put("amountDrUsd", financeProfitList.stream().map(FinanceProfitDtoList::getAmountDrUsd).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("realAmountDrUsd", financeProfitList.stream().map(FinanceProfitDtoList::getRealAmountDrUsd).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("amountDr", financeProfitList.stream().map(FinanceProfitDtoList::getAmountDr).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("realAmountDr", financeProfitList.stream().map(FinanceProfitDtoList::getRealAmountDr).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("amountDrLoc", financeProfitList.stream().map(FinanceProfitDtoList::getAmountDrLoc).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("realAmountDrLoc", financeProfitList.stream().map(FinanceProfitDtoList::getRealAmountDrLoc).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("amountCrUsd", financeProfitList.stream().map(FinanceProfitDtoList::getAmountCrUsd).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("realAmountCrUsd", financeProfitList.stream().map(FinanceProfitDtoList::getRealAmountCrUsd).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("amountCr", financeProfitList.stream().map(FinanceProfitDtoList::getAmountCr).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("realAmountCr", financeProfitList.stream().map(FinanceProfitDtoList::getRealAmountCr).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("amountCrLoc", financeProfitList.stream().map(FinanceProfitDtoList::getAmountCrLoc).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("realAmountCrLoc", financeProfitList.stream().map(FinanceProfitDtoList::getRealAmountCrLoc).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("amountProfitLoc", financeProfitList.stream().map(FinanceProfitDtoList::getAmountProfitLoc).reduce(BigDecimal.ZERO, BigDecimal::add));
+		map.put("realAmountProfitLoc", financeProfitList.stream().map(FinanceProfitDtoList::getRealAmountProfitLoc).reduce(BigDecimal.ZERO, BigDecimal::add));
+		return R.data(map);
+	}
 }

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/view/controller/FinanceProfitController.java

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

+ 47 - 0
blade-service/blade-los/src/main/java/org/springblade/los/view/mapper/FinanceProfitMapper.java

@@ -0,0 +1,47 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.los.statisticAnalysis.FinanceProfitDtoList;
+import org.springblade.los.view.entity.FinanceProfit;
+import org.springblade.los.view.vo.FinanceProfitVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * VIEW Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-03-13
+ */
+public interface FinanceProfitMapper extends BaseMapper<FinanceProfit> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param financeProfit
+	 * @return
+	 */
+	List<FinanceProfitVO> selectFinanceProfitPage(IPage page, FinanceProfitVO financeProfit);
+
+	List<FinanceProfitDtoList> financeProfit(@Param("data")FinanceProfitDtoList financeProfit, IPage<FinanceProfitDtoList> page);
+
+	List<FinanceProfitDtoList> financeProfitSum(@Param("data")FinanceProfitDtoList financeProfit);
+}

+ 251 - 0
blade-service/blade-los/src/main/java/org/springblade/los/view/mapper/FinanceProfitMapper.xml

@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.los.view.mapper.FinanceProfitMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="financeProfitResultMap" type="org.springblade.los.view.entity.FinanceProfit">
+        <result column="business_type" property="businessType"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="hblno" property="hblno"/>
+        <result column="mblno" property="mblno"/>
+        <result column="corp_cn_name" property="corpCnName"/>
+        <result column="corp_id" property="corpId"/>
+        <result column="approved_date" property="approvedDate"/>
+        <result column="bill_date" property="billDate"/>
+        <result column="src_cn_name" property="srcCnName"/>
+        <result column="pod_cn_name" property="podCnName"/>
+        <result column="pol_cn_name" property="polCnName"/>
+        <result column="vessel_id" property="vesselId"/>
+        <result column="vessel_cn_name" property="vesselCnName"/>
+        <result column="voyage_no" property="voyageNo"/>
+        <result column="acc_dept" property="accDept"/>
+        <result column="acc_dept_name" property="accDeptName"/>
+        <result column="line_id" property="lineId"/>
+        <result column="line_cn_name" property="lineCnName"/>
+        <result column="carrier_id" property="carrierId"/>
+        <result column="carrier_cn_name" property="carrierCnName"/>
+        <result column="operator_name" property="operatorName"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="src_type" property="srcType"/>
+        <result column="src_id" property="srcId"/>
+        <result column="STATUS" property="status"/>
+        <result column="create_time" property="createTime"/>
+        <result column="amount_dr_usd" property="amountDrUsd"/>
+        <result column="realAmount_dr_usd" property="realAmountDrUsd"/>
+        <result column="amount_dr" property="amountDr"/>
+        <result column="realamount_dr" property="realAmountDr"/>
+        <result column="amount_cr_usd" property="amountCrUsd"/>
+        <result column="realAmount_cr_usd" property="realAmountCrUsd"/>
+        <result column="amount_cr" property="amountCr"/>
+        <result column="realamount_cr" property="realAmountCr"/>
+        <result column="amount_profit_loc" property="amountProfitLoc"/>
+    </resultMap>
+
+
+    <select id="selectFinanceProfitPage" resultMap="financeProfitResultMap">
+        select * from los_finance_profit where is_deleted = 0
+    </select>
+    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfitDtoList">
+    select
+        seb.business_type AS billType,
+        seb.bill_no AS billNo,
+        seb.hblno AS hBlNo,
+        seb.mblno AS mBlNo,
+        seb.corp_cn_name AS corpName,
+        <if test="data.examineDate != null and data.examineDate != ''">
+            seb.approved_date AS statisticsDate,
+        </if>
+        <if test="data.examineDate == null or data.examineDate == ''">
+            seb.bill_date AS statisticsDate,
+        </if>
+        seb.src_cn_name AS salesman,
+        seb.pod_cn_name AS pod,
+        seb.pol_cn_name AS pol,
+        seb.vessel_cn_name AS vesselCnName,
+        seb.voyage_no AS voyageNo,
+        seb.acc_dept_name AS accDeptName,
+        seb.line_cn_name AS lineCnName,
+        seb.carrier_cn_name AS carrierCnName,
+        seb.operator_name AS operatorName,
+        seb.amount_dr_usd AS amountDrUsd,
+        seb.real_amount_dr_usd AS realAmountDrUsd,
+        seb.amount_dr AS amountDr,
+        seb.real_amount_dr AS realAmountDr,
+        seb.amount_cr_usd AS amountCrUsd,
+        seb.real_amount_cr_usd AS realAmountCrUsd,
+        seb.amount_cr AS amountCr,
+        seb.real_amount_cr AS realAmountCr,
+        seb.amount_profit_loc AS amountProfitLoc
+        FROM
+        los_finance_profit seb
+        WHERE
+        seb.is_deleted = '0'
+        <if test="data.billType != null and data.billType != ''">
+            and find_in_set(seb.business_type,#{data.billType})
+        </if>
+        <if test="data.billNo != null and data.billNo != ''">
+            and seb.bill_no like concat('%', #{data.billNo}, '%')
+        </if>
+        <if test="data.hBlNo != null and data.hBlNo != ''">
+            and seb.hblNo like concat('%', #{data.hBlNo}, '%')
+        </if>
+        <if test="data.mBlNo != null and data.mBlNo != ''">
+            and seb.mblNo like concat('%', #{data.mBlNo}, '%')
+        </if>
+        <if test='data.corpId != null'>
+            and seb.corp_id = #{data.corpId}
+        </if>
+        <if test='data.vesselId != null'>
+            and seb.vessel_id = #{data.vesselId}
+        </if>
+        <if test="data.voyageNo != null and data.voyageNo != ''">
+            and seb.voyage_no = #{data.voyageNo}
+        </if>
+        <if test='data.accDeptId != null'>
+            and seb.acc_dept = #{data.accDeptId}
+        </if>
+        <if test='data.lineId != null'>
+            and seb.line_id = #{data.lineId}
+        </if>
+        <if test='data.carrierId != null'>
+            and seb.carrier_id = #{data.carrierId}
+        </if>
+        <if test="data.srcType != null and data.srcType != ''">
+            and seb.src_type = #{data.srcType}
+        </if>
+        <if test='data.srcId != null'>
+            and seb.src_id = #{data.srcId}
+        </if>
+        <if test="data.examine != null and data.examine != ''">
+            and seb.status = 3
+        </if>
+        <if test="data.examineDate != null and data.examineDate != ''">
+            <if test='data.statisticsDateStart != null and data.statisticsDateStart != null'>
+                and seb.approved_date &gt;= #{data.statisticsDateStart}
+            </if>
+            <if test='data.statisticsDateEnd != null and data.statisticsDateEnd != null'>
+                and seb.approved_date &lt;= #{data.statisticsDateEnd}
+            </if>
+        </if>
+        <if test="data.examineDate == null or data.examineDate == ''">
+            <if test='data.statisticsDateStart != null and data.statisticsDateStart != null'>
+                and seb.bill_date &gt;= #{data.statisticsDateStart}
+            </if>
+            <if test='data.statisticsDateEnd != null and data.statisticsDateEnd != null'>
+                and seb.bill_date &lt;= #{data.statisticsDateEnd}
+            </if>
+        </if>
+        <if test="data.costMerge != null and data.costMerge != ''">
+            GROUP BY
+            seb.bill_no
+        </if>
+        <if test="data.consistentCorpMerge != null and data.consistentCorpMerge != ''">
+            GROUP BY
+            seb.corp_id
+        </if>
+        ORDER BY
+        seb.create_time
+    </select>
+    <select id="financeProfitSum" resultType="org.springblade.los.statisticAnalysis.FinanceProfitDtoList">
+        select
+        seb.business_type AS billType,
+        seb.bill_no AS billNo,
+        seb.hblno AS hBlNo,
+        seb.mblno AS mBlNo,
+        seb.corp_cn_name AS corpName,
+        <if test="data.examineDate != null and data.examineDate != ''">
+            seb.approved_date AS statisticsDate,
+        </if>
+        <if test="data.examineDate == null or data.examineDate == ''">
+            seb.bill_date AS statisticsDate,
+        </if>
+        seb.src_cn_name AS salesman,
+        seb.pod_cn_name AS pod,
+        seb.pol_cn_name AS pol,
+        seb.vessel_cn_name AS vesselCnName,
+        seb.voyage_no AS voyageNo,
+        seb.acc_dept_name AS accDeptName,
+        seb.line_cn_name AS lineCnName,
+        seb.carrier_cn_name AS carrierCnName,
+        seb.operator_name AS operatorName,
+        seb.amount_dr_usd AS amountDrUsd,
+        seb.real_amount_dr_usd AS realAmountDrUsd,
+        seb.amount_dr AS amountDr,
+        seb.real_amount_dr AS realAmountDr,
+        seb.amount_cr_usd AS amountCrUsd,
+        seb.real_amount_cr_usd AS realAmountCrUsd,
+        seb.amount_cr AS amountCr,
+        seb.real_amount_cr AS realAmountCr,
+        seb.amount_profit_loc AS amountProfitLoc
+        FROM
+        los_finance_profit seb
+        WHERE
+        seb.is_deleted = '0'
+        <if test="data.billType != null and data.billType != ''">
+            and find_in_set(seb.business_type,#{data.billType})
+        </if>
+        <if test="data.billNo != null and data.billNo != ''">
+            and seb.bill_no like concat('%', #{data.billNo}, '%')
+        </if>
+        <if test="data.hBlNo != null and data.hBlNo != ''">
+            and seb.hblNo like concat('%', #{data.hBlNo}, '%')
+        </if>
+        <if test="data.mBlNo != null and data.mBlNo != ''">
+            and seb.mblNo like concat('%', #{data.mBlNo}, '%')
+        </if>
+        <if test='data.corpId != null'>
+            and seb.corp_id = #{data.corpId}
+        </if>
+        <if test='data.vesselId != null'>
+            and seb.vessel_id = #{data.vesselId}
+        </if>
+        <if test="data.voyageNo != null and data.voyageNo != ''">
+            and seb.voyage_no = #{data.voyageNo}
+        </if>
+        <if test='data.accDeptId != null'>
+            and seb.acc_dept = #{data.accDeptId}
+        </if>
+        <if test='data.lineId != null'>
+            and seb.line_id = #{data.lineId}
+        </if>
+        <if test='data.carrierId != null'>
+            and seb.carrier_id = #{data.carrierId}
+        </if>
+        <if test="data.srcType != null and data.srcType != ''">
+            and seb.src_type = #{data.srcType}
+        </if>
+        <if test='data.srcId != null'>
+            and seb.src_id = #{data.srcId}
+        </if>
+        <if test="data.examine != null and data.examine != ''">
+            and seb.status = 3
+        </if>
+        <if test="data.examineDate != null and data.examineDate != ''">
+            <if test='data.statisticsDateStart != null and data.statisticsDateStart != null'>
+                and seb.approved_date &gt;= #{data.statisticsDateStart}
+            </if>
+            <if test='data.statisticsDateEnd != null and data.statisticsDateEnd != null'>
+                and seb.approved_date &lt;= #{data.statisticsDateEnd}
+            </if>
+        </if>
+        <if test="data.examineDate == null or data.examineDate == ''">
+            <if test='data.statisticsDateStart != null and data.statisticsDateStart != null'>
+                and seb.bill_date &gt;= #{data.statisticsDateStart}
+            </if>
+            <if test='data.statisticsDateEnd != null and data.statisticsDateEnd != null'>
+                and seb.bill_date &lt;= #{data.statisticsDateEnd}
+            </if>
+        </if>
+        <if test="data.costMerge != null and data.costMerge != ''">
+            GROUP BY
+            seb.bill_no
+        </if>
+        <if test="data.consistentCorpMerge != null and data.consistentCorpMerge != ''">
+            GROUP BY
+            seb.corp_id
+        </if>
+        ORDER BY
+        seb.create_time
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/view/service/IFinanceProfitService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.service;
+
+import org.springblade.los.view.entity.FinanceProfit;
+import org.springblade.los.view.vo.FinanceProfitVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * VIEW 服务类
+ *
+ * @author BladeX
+ * @since 2024-03-13
+ */
+public interface IFinanceProfitService extends IService<FinanceProfit> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param financeProfit
+	 * @return
+	 */
+	IPage<FinanceProfitVO> selectFinanceProfitPage(IPage<FinanceProfitVO> page, FinanceProfitVO financeProfit);
+
+}

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/view/service/impl/FinanceProfitServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.view.service.impl;
+
+import org.springblade.los.view.entity.FinanceProfit;
+import org.springblade.los.view.vo.FinanceProfitVO;
+import org.springblade.los.view.mapper.FinanceProfitMapper;
+import org.springblade.los.view.service.IFinanceProfitService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * VIEW 服务实现类
+ *
+ * @author BladeX
+ * @since 2024-03-13
+ */
+@Service
+public class FinanceProfitServiceImpl extends ServiceImpl<FinanceProfitMapper, FinanceProfit> implements IFinanceProfitService {
+
+	@Override
+	public IPage<FinanceProfitVO> selectFinanceProfitPage(IPage<FinanceProfitVO> page, FinanceProfitVO financeProfit) {
+		return page.setRecords(baseMapper.selectFinanceProfitPage(page, financeProfit));
+	}
+
+}

+ 5 - 1
blade-service/blade-pay/src/main/java/org/springblade/pay/tonglianPayment/utils/SybPayService.java

@@ -133,7 +133,11 @@ public class SybPayService {
 		params.put("reqsn", reqsn);
 		params.put("notify_url", notify_url);
 		if (ObjectUtils.isNotNull(body)) {
-			params.put("body", body.substring(0, 20));
+			if (body.length() > 20) {
+				params.put("body", body.substring(0, 20));
+			} else {
+				params.put("body", body);
+			}
 		} else {
 			params.put("body", body);
 		}

+ 12 - 1
blade-service/blade-project/src/main/java/org/springblade/project/handler/TaskCompleteJobHandler.java

@@ -13,7 +13,7 @@ import org.springblade.client.feign.IMessageClient;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.project.entity.ServiceProjectItem;
 import org.springblade.project.service.ServiceProjectItemService;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Component;
 
 import java.text.SimpleDateFormat;
@@ -29,6 +29,8 @@ public class TaskCompleteJobHandler {
 
 	private final IMessageClient iMessageClient;
 
+	private final ISysClient sysClient;
+
 	@XxlJob("taskCompleteJobHandler")
 	public ReturnT<String> taskCompleteJobHandler(String param) throws Exception {
 		// 创建线程池
@@ -81,4 +83,13 @@ public class TaskCompleteJobHandler {
 		}
 	}
 
+	/**
+	 * @throws Exception
+	 */
+	@XxlJob("SynchronizeDataJobHandler")
+	public ReturnT<String> synchronizeData() throws Exception {
+		System.out.println("==========================请求成功================================");
+		return ReturnT.SUCCESS;
+	}
+
 }

+ 5 - 0
blade-service/blade-sales-part/pom.xml

@@ -13,6 +13,11 @@
 
 
     <dependencies>
+        <!--Job-->
+        <dependency>
+            <groupId>com.xuxueli</groupId>
+            <artifactId>xxl-job-core</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.github.binarywang</groupId>
             <artifactId>weixin-java-mp</artifactId>

+ 3 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/mapper/CorpsTypeMapper.java

@@ -62,6 +62,8 @@ public interface CorpsTypeMapper extends BaseMapper<PjCorpsType> {
 	 * @return
 	 */
 	PjCorpsType selectCorpsTypeCname(@Param("cname") String cname,
-                                     @Param("tenantId") String tenantId);
+                                     @Param("tenantId") String tenantId,
+                                     @Param("salesCompanyId") String salesCompanyId
+									 );
 
 }

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/mapper/CorpsTypeMapper.xml

@@ -176,7 +176,7 @@
         ORDER BY dept.sort
     </select>
     <select id="selectCorpsTypeCname" resultMap="corpsTypeResultMap">
-        select id,cname from pjpf_corps_type where is_deleted = 0 and cname =#{cname} and tenant_id = #{tenantId}
+        select id,cname from pjpf_corps_type where is_deleted = 0 and cname =#{cname} and tenant_id = #{tenantId} and sales_company_id = #{salesCompanyId}
     </select>
 
 </mapper>

+ 2 - 2
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsDescServiceImpl.java

@@ -235,7 +235,7 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 
 			data.forEach(e -> {
 				String type = e.getType();
-				PjCorpsType corpsType = corpsTypeMapper.selectCorpsTypeCname(type, AuthUtil.getTenantId());
+				PjCorpsType corpsType = corpsTypeMapper.selectCorpsTypeCname(type, AuthUtil.getTenantId(),AuthUtil.getDeptId());
 				if (corpsType != null) {
 					countList.add(true);
 					PjCorpsDesc corpsDesc = new PjCorpsDesc();
@@ -343,7 +343,7 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 
 			data.forEach(e -> {
 				String type = e.getType();
-				PjCorpsType corpsType = corpsTypeMapper.selectCorpsTypeCname(type, AuthUtil.getTenantId());
+				PjCorpsType corpsType = corpsTypeMapper.selectCorpsTypeCname(type, AuthUtil.getTenantId(),AuthUtil.getDeptId());
 				if (corpsType != null) {
 					countList.add(true);
 					PjCorpsDesc corpsDesc = new PjCorpsDesc();

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsTypeServiceImpl.java

@@ -145,7 +145,7 @@ public class CorpsTypeServiceImpl extends ServiceImpl<CorpsTypeMapper, PjCorpsTy
 
 	@Override
 	public String selectCorpsTypeCname(PjCorpsType corpsType) {
-		PjCorpsType typeCname = baseMapper.selectCorpsTypeCname(corpsType.getCname(), corpsType.getTenantId());
+		PjCorpsType typeCname = baseMapper.selectCorpsTypeCname(corpsType.getCname(), corpsType.getTenantId(),AuthUtil.getDeptId());
 		if (typeCname != null && corpsType.getId() == null) {
 			return "NotUNIQUE";
 		} else if (typeCname != null && !corpsType.getId().equals(typeCname.getId())) {

+ 27 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/handler/SynchronizeDataJobHandler.java

@@ -0,0 +1,27 @@
+package org.springblade.salesPart.handler;
+
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.AllArgsConstructor;
+import org.springblade.salesPart.michelinApi.service.IMichelinService;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.stereotype.Component;
+
+@Component
+@AllArgsConstructor
+public class SynchronizeDataJobHandler {
+
+	private final IMichelinService michelinService;
+
+	private final ISysClient sysClient;
+
+
+	/**
+	 * @throws Exception
+	 */
+	@XxlJob("SynchronizeDataJobHandler")
+	public void synchronizeData() throws Exception {
+		System.out.println("==========================请求成功================================");
+		michelinService.getSalesOrder(sysClient.getParamService(""));
+	}
+
+}

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderItemsMapper.java

@@ -45,5 +45,5 @@ public interface OrderItemsMapper extends BaseMapper<PjOrderItems> {
 
 	List<SaleDetailDto> saleDetailPage(@Param("page")IPage<SaleDetailDto> page, @Param("saleDetailDto") SaleDetail saleDetailDto);
 
-	List<SaleDetailDto> saleDetailList(@Param("saleDetailDto")SaleDetail saleDetailDto);
+	List<SaleDetailDto> saleDetailList(SaleDetail saleDetail);
 }

+ 41 - 32
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderItemsMapper.xml

@@ -41,7 +41,7 @@
     <select id="selectOrderItemsPage" resultMap="orderItemsResultMap">
         select * from pjpf_order_items where is_deleted = 0
     </select>
-    <select id="saleDetailPage" resultType="org.springblade.salesPart.dto.SaleDetail">
+    <select id="saleDetailPage" resultType="org.springblade.salesPart.dto.SaleDetailDto">
         SELECT
         po.customer_name AS customerName,
         po.saler_name AS salerName,
@@ -63,10 +63,14 @@
         poi.goods_name AS goodsName,
         poi.property_name AS propertyName,
         poi.pattern AS pattern,
-        poi.goods_num AS goodsNum,
-        poi.price AS price,
-        poi.sub_total_money AS subTotalMoney,
-        poi.costprie AS costprie,
+        IF
+        ( poi.goods_num, poi.goods_num, 0 )AS goodsNum,
+        IF
+        ( poi.price, poi.price, 0 ) AS price,
+        IF
+        ( poi.sub_total_money, poi.sub_total_money, 0 ) AS subTotalMoney,
+        IF
+        ( poi.costprie, poi.costprie, 0 ) AS costprie,
         IF
         ( poi.sub_total_money, poi.sub_total_money, 0 )-
         IF
@@ -103,15 +107,15 @@
             and DATE_FORMAT(po.busines_date,'%Y-%m-%d') &lt;= #{saleDetailDto.businesDateEnd}
         </if>
         <if test="saleDetailDto.isContain !=null and saleDetailDto.isContain !=''">
-              and FIND_IN_SET(po.`status`,'待确认,待发货,已发货,退款请核')
+            and FIND_IN_SET(po.`status`,'待确认,待发货,已发货,退款请核,已取消,已退款,售后中,已收货')
         </if>
         <if test="saleDetailDto.isContain ==null or saleDetailDto.isContain ==''">
-            and FIND_IN_SET(po.`status`,'已发货,退款请核')
+            and FIND_IN_SET(po.`status`,'已发货,退款请核,已取消,已退款,售后中,已收货')
         </if>
         ORDER BY
         po.busines_date
     </select>
-    <select id="saleDetailList" resultType="org.springblade.salesPart.dto.SaleDetail">
+    <select id="saleDetailList" resultType="org.springblade.salesPart.dto.SaleDetailDto">
         SELECT
         po.customer_name AS customerName,
         po.saler_name AS salerName,
@@ -133,10 +137,14 @@
         poi.goods_name AS goodsName,
         poi.property_name AS propertyName,
         poi.pattern AS pattern,
-        poi.goods_num AS goodsNum,
-        poi.price AS price,
-        poi.sub_total_money AS subTotalMoney,
-        poi.costprie AS costprie,
+        IF
+        ( poi.goods_num, poi.goods_num, 0 )AS goodsNum,
+        IF
+        ( poi.price, poi.price, 0 ) AS price,
+        IF
+        ( poi.sub_total_money, poi.sub_total_money, 0 ) AS subTotalMoney,
+        IF
+        ( poi.costprie, poi.costprie, 0 ) AS costprie,
         IF
         ( poi.sub_total_money, poi.sub_total_money, 0 )-
         IF
@@ -149,37 +157,38 @@
         poi.is_deleted = '0'
         AND po.is_deleted = '0'
         AND po.bs_type = 'XS'
-        AND poi.tenant_id = #{saleDetailDto.tenantId}
-        AND po.tenant_id = #{saleDetailDto.tenantId}
-        <if test="saleDetailDto.customerName !=null and saleDetailDto.customerName != ''">
-            and po.customer_name like concat('%', #{saleDetailDto.customerName}, '%')
+        AND poi.tenant_id = #{tenantId}
+        AND po.tenant_id = #{tenantId}
+        <if test="customerName !=null and customerName != ''">
+            and po.customer_name like concat('%', #{customerName}, '%')
         </if>
-        <if test="saleDetailDto.salerName !=null and saleDetailDto.salerName != ''">
-            and po.saler_name like concat('%', #{saleDetailDto.salerName}, '%')
+        <if test="salerName !=null and salerName != ''">
+            and po.saler_name like concat('%', #{salerName}, '%')
         </if>
-        <if test="saleDetailDto.ordNo !=null and saleDetailDto.ordNo != ''">
-            and po.ord_no like concat('%', #{saleDetailDto.ordNo}, '%')
+        <if test="ordNo !=null and ordNo != ''">
+            and po.ord_no like concat('%', #{ordNo}, '%')
         </if>
-        <if test="saleDetailDto.goodsName !=null and saleDetailDto.goodsName != ''">
-            and poi.goods_name like concat('%', #{saleDetailDto.goodsName}, '%')
+        <if test="goodsName !=null and goodsName != ''">
+            and poi.goods_name like concat('%', #{goodsName}, '%')
         </if>
-        <if test="saleDetailDto.actualPaymentStatus !=null and saleDetailDto.actualPaymentStatus != ''">
-            and po.actual_payment_status =#{saleDetailDto.actualPaymentStatus}
+        <if test="actualPaymentStatus !=null and actualPaymentStatus != ''">
+            and po.actual_payment_status =#{actualPaymentStatus}
         </if>
-        <if test="saleDetailDto.businesDateStart !=null and saleDetailDto.businesDateStart !=''">
-            and DATE_FORMAT(po.busines_date,'%Y-%m-%d') &gt;= #{saleDetailDto.businesDateStart}
+        <if test="businesDateStart !=null and businesDateStart !=''">
+            and DATE_FORMAT(po.busines_date,'%Y-%m-%d') &gt;= #{businesDateStart}
         </if>
-        <if test="saleDetailDto.businesDateEnd !=null and saleDetailDto.businesDateEnd !=''">
-            and DATE_FORMAT(po.busines_date,'%Y-%m-%d') &lt;= #{saleDetailDto.businesDateEnd}
+        <if test="businesDateEnd !=null and businesDateEnd !=''">
+            and DATE_FORMAT(po.busines_date,'%Y-%m-%d') &lt;= #{businesDateEnd}
         </if>
-        <if test="saleDetailDto.isContain !=null and saleDetailDto.isContain !=''">
-            and FIND_IN_SET(po.`status`,'待确认,待发货,已发货,退款请核,已取消')
+        <if test="isContain !=null and isContain !=''">
+            and FIND_IN_SET(po.`status`,'待确认,待发货,已发货,退款请核,已取消,已退款,售后中,已收货')
         </if>
-        <if test="saleDetailDto.isContain ==null or saleDetailDto.isContain ==''">
-            and FIND_IN_SET(po.`status`,'已发货,退款请核,已取消')
+        <if test="isContain ==null or isContain ==''">
+            and FIND_IN_SET(po.`status`,'已发货,退款请核,已取消,已退款,售后中,已收货')
         </if>
         ORDER BY
         po.busines_date
     </select>
 
+
 </mapper>