Browse Source

2024年2月20日17:37:02

纪新园 1 year ago
parent
commit
f0a368f48f
24 changed files with 803 additions and 182 deletions
  1. 6 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/business/entity/BusinessType.java
  2. 7 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/aea/entity/AeaBills.java
  3. 7 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/amends/entity/Amends.java
  4. 7 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/customsDeclaration/entity/CustomsDeclaration.java
  5. 6 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  6. 6 1
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FinanceProfit.java
  7. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/basic/business/controller/BusinessTypeController.java
  8. 124 132
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java
  9. 20 8
      blade-service/blade-los/src/main/java/org/springblade/los/billno/controller/BusinessBillNoController.java
  10. 7 3
      blade-service/blade-los/src/main/java/org/springblade/los/billno/service/impl/BusinessBillNoServiceImpl.java
  11. 4 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/mapper/AeaBillsMapper.java
  12. 90 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/mapper/AeaBillsMapper.xml
  13. 35 11
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/impl/AeaBillsServiceImpl.java
  14. 4 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/mapper/AmendsMapper.java
  15. 88 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/mapper/AmendsMapper.xml
  16. 20 6
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java
  17. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.java
  18. 66 13
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml
  19. 4 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/ContainersBillsMapper.java
  20. 77 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/ContainersBillsMapper.xml
  21. 6 2
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  22. 4 0
      blade-service/blade-los/src/main/java/org/springblade/los/check/service/impl/AuditProecessServiceImpl.java
  23. 208 4
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java
  24. 5 1
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java

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

@@ -135,5 +135,11 @@ public class BusinessType implements Serializable {
 	@ApiModelProperty(value = "租户")
 	private String tenantId;
 
+	/**
+	 * 是否启用费用模版
+	 */
+	@ApiModelProperty(value = "是否启用费用模版")
+	private String enableFee;
+
 
 }

+ 7 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/aea/entity/AeaBills.java

@@ -1278,5 +1278,12 @@ public class AeaBills implements Serializable {
 	@TableField(exist = false)
 	private Dept dept;
 
+	/**
+	 * type
+	 */
+	@TableField(exist = false)
+	private String type;
+
+
 
 }

+ 7 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/amends/entity/Amends.java

@@ -521,5 +521,12 @@ public class Amends implements Serializable {
 	@ApiModelProperty(value = "默认团队名")
 	private String teamName;
 
+	/**
+	 * 审核日期
+	 */
+	@ApiModelProperty(value = "审核日期")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date approvedDate;
+
 
 }

+ 7 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/customsDeclaration/entity/CustomsDeclaration.java

@@ -763,5 +763,12 @@ public class CustomsDeclaration implements Serializable {
 	@TableField(exist = false)
 	private Dept dept;
 
+	/**
+	 * 审核日期
+	 */
+	@ApiModelProperty(value = "审核日期")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date approvedDate;
+
 
 }

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

@@ -1661,6 +1661,12 @@ public class Bills implements Serializable {
 	 */
 	@ApiModelProperty(value = "teu箱数")
 	private Integer teu;
+	/**
+	 * 审核日期
+	 */
+	@ApiModelProperty(value = "审核日期")
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Date approvedDate;
 
 	/**
 	 * 报表表头信息

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

@@ -45,7 +45,12 @@ public class FinanceProfit {
 	/**
 	 * 统计日期
 	 */
-	private String statisticsDate;
+	private String statisticsDateStart;
+
+	/**
+	 * 统计日期
+	 */
+	private String statisticsDateEnd;
 
 	/**
 	 * 业务员

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/basic/business/controller/BusinessTypeController.java

@@ -86,6 +86,7 @@ public class BusinessTypeController extends BladeController {
 			.like(ObjectUtils.isNotNull(businessType.getCnName()), BusinessType::getCnName, businessType.getCnName())
 			.like(ObjectUtils.isNotNull(businessType.getEnName()), BusinessType::getEnName, businessType.getEnName())
 			.like(ObjectUtils.isNotNull(businessType.getStatus()), BusinessType::getStatus, businessType.getStatus())
+			.eq(ObjectUtils.isNotNull(businessType.getEnableFee()), BusinessType::getEnableFee, businessType.getEnableFee())
 			.orderByDesc(BusinessType::getCreateTime);
 		IPage<BusinessType> pages = bBusinessTypeService.page(Condition.getPage(query), lambdaQueryWrapper);
 		return R.data(pages);

File diff suppressed because it is too large
+ 124 - 132
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java


+ 20 - 8
blade-service/blade-los/src/main/java/org/springblade/los/billno/controller/BusinessBillNoController.java

@@ -16,23 +16,27 @@
  */
 package org.springblade.los.billno.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 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.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
 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.Util.IDeptUtils;
 import org.springblade.los.billno.entity.BusinessBillNo;
-import org.springblade.los.billno.vo.BusinessBillNoVO;
 import org.springblade.los.billno.service.IBusinessBillNoService;
-import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.los.billno.vo.BusinessBillNoVO;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
 
 /**
  * 基础资料-业务类型编号格式 控制器
@@ -48,6 +52,8 @@ public class BusinessBillNoController extends BladeController {
 
 	private final IBusinessBillNoService businessBillNoService;
 
+	private final IDeptUtils deptUtils;
+
 	/**
 	 * 详情
 	 */
@@ -66,7 +72,13 @@ public class BusinessBillNoController extends BladeController {
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页", notes = "传入businessBillNo")
 	public R<IPage<BusinessBillNo>> list(BusinessBillNo businessBillNo, Query query) {
-		IPage<BusinessBillNo> pages = businessBillNoService.page(Condition.getPage(query), Condition.getQueryWrapper(businessBillNo));
+		LambdaQueryWrapper<BusinessBillNo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(BusinessBillNo::getTenantId, AuthUtil.getTenantId())
+			.eq(BusinessBillNo::getIsDeleted, 0)
+			.eq(ObjectUtils.isNotNull(businessBillNo.getBusinessTypeId()), BusinessBillNo::getBusinessTypeId, businessBillNo.getBusinessTypeId())
+			.eq(BusinessBillNo::getBranchId, deptUtils.getDeptPid())
+			.orderByDesc(BusinessBillNo::getCreateTime);
+		IPage<BusinessBillNo> pages = businessBillNoService.page(Condition.getPage(query), lambdaQueryWrapper);
 		return R.data(pages);
 	}
 

+ 7 - 3
blade-service/blade-los/src/main/java/org/springblade/los/billno/service/impl/BusinessBillNoServiceImpl.java

@@ -76,6 +76,7 @@ public class BusinessBillNoServiceImpl extends ServiceImpl<BusinessBillNoMapper,
 			.eq(BusinessBillNo::getIsDeleted, 0)
 			.eq(BusinessBillNo::getBusinessTypeId, businessBillNo.getBusinessTypeId())
 			.eq(BusinessBillNo::getCode, businessBillNo.getCode())
+			.eq(BusinessBillNo::getBranchId, branchId)
 			.eq(BusinessBillNo::getStatus, 0));
 		if (detail == null) {
 			throw new RuntimeException("未找到可用生成编码规则");
@@ -114,9 +115,10 @@ public class BusinessBillNoServiceImpl extends ServiceImpl<BusinessBillNoMapper,
 			.eq(BillNoCenter::getPid, detail.getId())
 			.eq(BillNoCenter::getResetRule, detail.getResetRule())
 			.eq(BillNoCenter::getResetValue, billNo)
+			.eq(BillNoCenter::getBranchId, branchId)
 			.orderByDesc(BillNoCenter::getCreateTime)
 		);
-		if (billNoCenterList.size() > 0) {
+		if (!billNoCenterList.isEmpty()) {
 			return R.data(billNoCenterList.get(0).getBillNo());
 		} else {
 			BillNoSerial billNoSerial1 = new BillNoSerialVO();
@@ -127,6 +129,7 @@ public class BusinessBillNoServiceImpl extends ServiceImpl<BusinessBillNoMapper,
 				.eq(BillNoSerial::getBusinessTypeId, detail.getBusinessTypeId())
 				.eq(BillNoSerial::getPid, detail.getId())
 				.eq(BillNoSerial::getResetRule, detail.getResetRule())
+				.eq(BillNoSerial::getBranchId, branchId)
 				.eq(BillNoSerial::getResetValue, billNo)
 			);
 			if (billNoSerial == null) {
@@ -142,7 +145,7 @@ public class BusinessBillNoServiceImpl extends ServiceImpl<BusinessBillNoMapper,
 				billNoSerial1.setCreateUserName(AuthUtil.getUserName());
 				billNoSerial1.setTenantId(AuthUtil.getTenantId());
 				//生成序列号  循环赋0  最后一位赋1
-				if (tail.length() > 0) {
+				if (!tail.isEmpty()) {
 					StringBuilder number = new StringBuilder();
 					for (int i = 0; i <= tail.length(); i++) {
 						if (i == tail.length()) {
@@ -159,8 +162,9 @@ public class BusinessBillNoServiceImpl extends ServiceImpl<BusinessBillNoMapper,
 				billNoSerial1.setUpdateTime(new Date());
 				billNoSerial1.setUpdateUser(AuthUtil.getUserId());
 				billNoSerial1.setUpdateUserName(AuthUtil.getUserName());
+				billNoSerial1.setBranchId(branchId);
 				String count = billNoSerial1.getSerialNo() + "";
-				if (tail.length() > 0) {
+				if (!tail.isEmpty()) {
 					//判断最大序列号长度与序列号规则长度是否相等  相等不赋0
 					if (tail.length() == count.length()) {
 						billNo = billNo + count;

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

@@ -16,10 +16,13 @@
  */
 package org.springblade.los.business.aea.mapper;
 
+import org.apache.ibatis.annotations.Param;
 import org.springblade.los.business.aea.entity.AeaBills;
 import org.springblade.los.business.aea.vo.AeaBillsVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.statisticAnalysis.FinanceProfit;
+
 import java.util.List;
 
 /**
@@ -39,4 +42,5 @@ public interface AeaBillsMapper extends BaseMapper<AeaBills> {
 	 */
 	List<AeaBillsVO> selectAeaBillsPage(IPage page, AeaBillsVO aeaBills);
 
+    List<FinanceProfit> financeProfit(@Param("data")FinanceProfit financeProfit);
 }

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

@@ -207,5 +207,95 @@
     <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
+        seb.bill_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,
+        seb.src_cn_name AS salesman,
+        seb.voyage_no AS voyageNo,
+        seb.carrier_cn_name AS carrierCnName,
+        seb.operator_name AS operatorName,
+        SUM(IF(feeDU.amount,feeDU.amount,0.00)) AS amountDrUsd,
+        SUM(IF(feeDU.stl_ttl_amount,feeDU.stl_ttl_amount,0.00)) AS realAmountDrUsd,
+        SUM(IF(feeDC.amount,feeDC.amount,0.00)) AS amountDr,
+        SUM(IF(feeDC.stl_ttl_amount,feeDC.stl_ttl_amount,0.00)) AS realAmountDr,
+        SUM(IF(feeCU.amount,feeCU.amount,0.00)) AS amountCrUsd,
+        SUM(IF(feeCU.stl_ttl_amount,feeCU.stl_ttl_amount,0.00)) AS realAmountCrUsd,
+        SUM(IF(feeCC.amount,feeCC.amount,0.00)) AS amountCr,
+        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
+        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
+        AND feeCU.dc = 'C' and feeCU.cur_code = 'USD' AND feeCU.is_deleted = '0'
+        LEFT JOIN los_fee_center feeDC ON seb.id = feeDC.pid
+        AND feeDC.dc = 'D' and feeDC.cur_code = 'CNY'  AND feeDC.is_deleted = '0'
+        LEFT JOIN los_fee_center feeDU ON seb.id = feeDU.pid
+        AND feeDU.dc = 'D' and feeDU.cur_code = 'USD'  AND feeDU.is_deleted = '0'
+        WHERE
+        seb.is_deleted = '0'
+        AND feeCC.is_deleted = '0'
+        AND feeCU.is_deleted = '0'
+        AND feeDC.is_deleted = '0'
+        AND feeDU.is_deleted = '0'
+        <if test="data.billType != null and data.billType != ''">
+            and find_in_set(seb.bill_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.voyageNo != null and data.voyageNo != ''">
+            and seb.voyage_no = #{data.voyageNo}
+        </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.statisticsDateStart}
+            </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.statisticsDateStart}
+            </if>
+        </if>
+        <if test="data.costMerge != null and data.costMerge != ''">
+            GROUP BY
+            seb.bill_no
+        </if>
+        ORDER BY
+        seb.create_time
+    </select>
 
 </mapper>

+ 35 - 11
blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/impl/AeaBillsServiceImpl.java

@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.seata.spring.annotation.GlobalTransactional;
 import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
@@ -53,6 +54,7 @@ import org.springblade.los.finance.fee.service.IFinAccBillsService;
 import org.springblade.system.entity.Dept;
 import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import java.math.BigDecimal;
@@ -104,6 +106,8 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R submit(AeaBills aeaBills) {
 		String deptId = "";
 		String deptName = "";
@@ -515,13 +519,15 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R increaseReinsurancePolicy(String ids, String id) {
 		if (ObjectUtils.isNull(ids) || ObjectUtils.isNull(id)) {
 			throw new RuntimeException("缺少必要参数");
 		}
 		AeaBills bills = baseMapper.selectById(id);
 		List<Long> idArr = Func.toLongList(ids);
-		if (idArr.size() > 0 && bills != null) {
+		if (!idArr.isEmpty() && bills != null) {
 			if (ObjectUtils.isNull(bills.getMblno())) {
 				throw new RuntimeException("主单提单号不能为空,操作失败");
 			}
@@ -570,7 +576,7 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 			BigDecimal quantity = bills.getQuantity();
 			BigDecimal grossWeight = bills.getGrossWeight();
 			BigDecimal measurement = bills.getMeasurement();
-			if (billsList.size() > 0) {
+			if (!billsList.isEmpty()) {
 				amountDr = amountDr.add(billsList.stream().map(AeaBills::getAmountDr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCr = amountCr.add(billsList.stream().map(AeaBills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountProfit = amountProfit.add(billsList.stream().map(AeaBills::getAmountProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
@@ -602,13 +608,15 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R revokeReinsurancePolicy(String ids, String id) {
 		if (ObjectUtils.isNull(ids) || ObjectUtils.isNull(id)) {
 			throw new RuntimeException("缺少必要参数");
 		}
 		AeaBills bills = baseMapper.selectById(id);
 		List<Long> idArr = Func.toLongList(ids);
-		if (idArr.size() > 0 && bills != null) {
+		if (!idArr.isEmpty() && bills != null) {
 			List<AeaBills> billsList = baseMapper.selectList(new LambdaQueryWrapper<AeaBills>()
 				.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
 				.eq(AeaBills::getIsDeleted, 0)
@@ -633,7 +641,7 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 			BigDecimal quantity = bills.getQuantity();
 			BigDecimal grossWeight = bills.getGrossWeight();
 			BigDecimal measurement = bills.getMeasurement();
-			if (billsList.size() > 0) {
+			if (!billsList.isEmpty()) {
 				amountDr = amountDr.subtract(billsList.stream().map(AeaBills::getAmountDr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountCr = amountCr.subtract(billsList.stream().map(AeaBills::getAmountCr).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 				amountProfit = amountProfit.subtract(billsList.stream().map(AeaBills::getAmountProfit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
@@ -685,6 +693,8 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public AeaBills checkBills(AeaBills bills) {
 		AeaBills declare = baseMapper.selectById(bills.getId());
 		Integer actId = null;
@@ -733,7 +743,8 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 			throw new RuntimeException("请维护费用信息");
 		}
 		List<FeeCenter> feeCenterListPS = feeCenterList.stream().filter(e -> e.getFeeCnName().equals("PS")).collect(Collectors.toList());
-		if (!feeCenterListPS.isEmpty()) {
+		List<FeeCenter> feeCenterListKY = feeCenterList.stream().filter(e -> e.getFeeCnName().equals("空运费")).collect(Collectors.toList());
+		if (!feeCenterListPS.isEmpty()&& !feeCenterListKY.isEmpty()) {
 			BigDecimal amountHYD = feeCenterList.stream()
 				.filter(e -> e.getFeeCnName().equals("空运费") && "USD".equals(e.getCurCode()) && "D".equals(e.getDc()))
 				.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -766,6 +777,10 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 			} else {
 				throw new RuntimeException("只有预付、直单和主单,或分单和到付才可以输入PS");
 			}
+		}else if (feeCenterListPS.isEmpty() && !feeCenterListKY.isEmpty()) {
+			throw new RuntimeException("PS费与海运费需同时存在,当前缺少PS费用信息");
+		} else if (!feeCenterListPS.isEmpty()) {
+			throw new RuntimeException("PS费与海运费需同时存在,当前缺少海运费用信息");
 		}
 		// 没开启审批流直接走 通过流程
 		if (pathsActs == null || pathsActs.getIsEnable() == 2) {
@@ -810,6 +825,8 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public AeaBills revokeCheckOrder(AeaBills bills) {
 		AeaBills declare = baseMapper.selectById(bills.getId());
 		if (3 == declare.getStatus()) {
@@ -825,6 +842,8 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R passCheck(Long id) {
 		AeaBills bills = baseMapper.selectById(id);
 		if (bills == null) {
@@ -845,9 +864,9 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 				.eq(AeaBills::getIsDeleted, 0)
 				.eq(AeaBills::getMasterId, bills.getId())
 				.eq(AeaBills::getMasterBillNo, bills.getMasterBillNo()));
-			if (billsList.size() > 0) {
+			if (!billsList.isEmpty()) {
 				List<Long> ids = billsList.stream().map(AeaBills::getId).filter(Objects::nonNull).collect(Collectors.toList());
-				if (ids.size() > 0) {
+				if (!ids.isEmpty()) {
 					List<FeeCenter> feeCenters = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 						.eq(FeeCenter::getIsDeleted, 0)
@@ -863,7 +882,7 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 			item.setApproveTime(new Date());
 		}
 		feeCenterService.saveOrUpdateBatch(feeCenterList);
-		if (feeCenterList.size() != 0) {
+		if (!feeCenterList.isEmpty()) {
 			FinAccBills finAccBills = new FinAccBills();
 			finAccBills.setFeeCenterList(feeCenterList);
 			finAccBills.setBusinessTypeCode("HYZD");
@@ -1132,17 +1151,19 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 		copyBills.setAccountStatus(0);
 		copyBills.setFeeCenterListC(feeCenterListC);
 		copyBills.setFeeCenterListD(feeCenterListD);
-		copyBills.setQuantity(new BigDecimal("0.00"));
+		/*copyBills.setQuantity(new BigDecimal("0.00"));
 		copyBills.setGrossWeight(new BigDecimal("0.00"));
 		copyBills.setMeasurement(new BigDecimal("0.00"));
 		copyBills.setLength(new BigDecimal("0.00"));
 		copyBills.setWidth(new BigDecimal("0.00"));
-		copyBills.setHeight(new BigDecimal("0.00"));
+		copyBills.setHeight(new BigDecimal("0.00"));*/
 		copyBills.setFilesList(filesList);
 		return copyBills;
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R disembarking(String ids) {
 		List<AeaBills> billsList = baseMapper.selectList(new LambdaQueryWrapper<AeaBills>()
 			.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
@@ -1162,6 +1183,8 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R revokeDisembarking(String ids) {
 		List<AeaBills> billsList = baseMapper.selectList(new LambdaQueryWrapper<AeaBills>()
 			.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
@@ -1193,6 +1216,7 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 			.like(ObjectUtils.isNotNull(bills.getMblno()), AeaBills::getMblno, bills.getMblno())
 			.like(ObjectUtils.isNotNull(bills.getHblno()), AeaBills::getHblno, bills.getHblno())
 			.like(ObjectUtils.isNotNull(bills.getRefno()), AeaBills::getRefno, bills.getRefno())
+			.eq(ObjectUtils.isNotNull(bills.getType()), AeaBills::getBusinessType, bills.getType())
 			.eq(AeaBills::getIsDeleted, 0)
 			.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
 			.eq(AeaBills::getStatus, 3);
@@ -1203,7 +1227,7 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 			lambdaQueryWrapper.eq(AeaBills::getBranchId, deptUtils.getDeptPid());
 		}
 		List<AeaBills> billsList = baseMapper.selectList(lambdaQueryWrapper);
-		if (billsList.size() == 0) {
+		if (billsList.isEmpty()) {
 			throw new RuntimeException("未查到单据信息");
 		}
 		for (AeaBills detail : billsList) {

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

@@ -16,10 +16,13 @@
  */
 package org.springblade.los.business.amends.mapper;
 
+import org.apache.ibatis.annotations.Param;
 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 java.util.List;
 
 /**
@@ -39,4 +42,5 @@ public interface AmendsMapper extends BaseMapper<Amends> {
 	 */
 	List<AmendsVO> selectAmendsPage(IPage page, AmendsVO amends);
 
+    List<FinanceProfit> financeProfit(@Param("data")FinanceProfit financeProfit);
 }

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

@@ -82,5 +82,93 @@
     <select id="selectAmendsPage" resultMap="amendsResultMap">
         select * from los_amends where is_deleted = 0
     </select>
+    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfit">
+        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,
+        seb.bill_date AS statisticsDate,
+        seb.pod_cn_name AS pod,
+        seb.pol_cn_name AS pol,
+        seb.vessel_cn_name AS vesselCnName,
+        seb.voyage_no AS voyageNo,
+        seb.line_cn_name AS lineCnName,
+        seb.carrier_cn_name AS carrierCnName,
+        seb.operator_name AS operatorName,
+        SUM(IF(feeDU.amount,feeDU.amount,0.00)) AS amountDrUsd,
+        SUM(IF(feeDU.stl_ttl_amount,feeDU.stl_ttl_amount,0.00)) AS realAmountDrUsd,
+        SUM(IF(feeDC.amount,feeDC.amount,0.00)) AS amountDr,
+        SUM(IF(feeDC.stl_ttl_amount,feeDC.stl_ttl_amount,0.00)) AS realAmountDr,
+        SUM(IF(feeCU.amount,feeCU.amount,0.00)) AS amountCrUsd,
+        SUM(IF(feeCU.stl_ttl_amount,feeCU.stl_ttl_amount,0.00)) AS realAmountCrUsd,
+        SUM(IF(feeCC.amount,feeCC.amount,0.00)) AS amountCr,
+        SUM(IF(feeCC.stl_ttl_amount,feeCC.stl_ttl_amount,0.00)) AS realAmountCr
+        FROM
+        los_amends 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
+        AND feeCU.dc = 'C' and feeCU.cur_code = 'USD' AND feeCU.is_deleted = '0'
+        LEFT JOIN los_fee_center feeDC ON seb.id = feeDC.pid
+        AND feeDC.dc = 'D' and feeDC.cur_code = 'CNY'  AND feeDC.is_deleted = '0'
+        LEFT JOIN los_fee_center feeDU ON seb.id = feeDU.pid
+        AND feeDU.dc = 'D' and feeDU.cur_code = 'USD'  AND feeDU.is_deleted = '0'
+        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.lineId != null'>
+            and seb.line_id = #{data.lineId}
+        </if>
+        <if test='data.carrierId != null'>
+            and seb.carrier_id = #{data.carrierId}
+        </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.statisticsDateStart}
+            </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.statisticsDateStart}
+            </if>
+        </if>
+        <if test="data.costMerge != null and data.costMerge != ''">
+            GROUP BY
+            seb.bill_no
+        </if>
+        ORDER BY
+        seb.create_time
+    </select>
 
 </mapper>

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

@@ -50,7 +50,6 @@ import org.springblade.los.finance.fee.entity.FeeCenter;
 import org.springblade.los.finance.fee.entity.FinAccBills;
 import org.springblade.los.finance.fee.service.IFeeCenterService;
 import org.springblade.los.finance.fee.service.IFinAccBillsService;
-import org.springblade.system.entity.Dept;
 import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -109,7 +108,7 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 	public R submit(Amends amends) {
 		String deptId = "";
 		String deptName = "";
-		String branchId = deptUtils.getDeptPid()+"";
+		String branchId = deptUtils.getDeptPid() + "";
 		//获取部门ids对应中文名
 		if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
 			deptId = AuthUtil.getDeptId();
@@ -153,6 +152,8 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 		this.saveOrUpdate(amends);
 		if (ObjectUtils.isNotNull(amends.getFeeCenterList())) {
 			for (FeeCenter item : amends.getFeeCenterList()) {
+				item.setBillNo(amends.getBillNo());
+				item.setBillDate(amends.getBillDate());
 				item.setPid(amends.getId());
 			}
 			feeCenterService.submitList(amends.getFeeCenterList());
@@ -284,8 +285,17 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 				.eq(FeeCenter::getIsDeleted, 0)
 				.eq(FeeCenter::getPid, declare.getOrigId()));
 			feeCenterList.addAll(feeCenterBills);
+			String type;
+			if ("SEA".equals(declare.getBusinessType()) || "SIA".equals(declare.getBusinessType())) {
+				type = "海运费";
+			} else if ("AEA".equals(declare.getBusinessType()) || "AIA".equals(declare.getBusinessType())) {
+				type = "空运费";
+			} else {
+				type = "";
+			}
 			List<FeeCenter> feeCenterListPS = feeCenterList.stream().filter(e -> e.getFeeCnName().equals("PS")).collect(Collectors.toList());
-			if (!feeCenterListPS.isEmpty()) {
+			List<FeeCenter> feeCenterListKH = feeCenterList.stream().filter(e -> e.getFeeCnName().equals(type)).collect(Collectors.toList());
+			if (!feeCenterListPS.isEmpty() && !feeCenterListKH.isEmpty()) {
 				BigDecimal amountHYD = feeCenterList.stream()
 					.filter(e -> e.getFeeCnName().equals("海运费") && "USD".equals(e.getCurCode()) && "D".equals(e.getDc()))
 					.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -300,15 +310,15 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 					.map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
 				String mpaymode = "";
 				String billType = "";
-				if ("SEA".equals(declare.getBusinessType()) ||"SIA".equals(declare.getBusinessType())) {
+				if ("SEA".equals(declare.getBusinessType()) || "SIA".equals(declare.getBusinessType())) {
 					Bills bills = billsMapper.selectById(declare.getOrigId());
-					if (bills != null){
+					if (bills != null) {
 						mpaymode = bills.getMpaymode();
 						billType = bills.getBillType();
 					}
 				} else if ("AEA".equals(declare.getBusinessType()) || "AIA".equals(declare.getBusinessType())) {
 					AeaBills aeaBills = aeaBillsMapper.selectById(declare.getOrigId());
-					if (aeaBills != null){
+					if (aeaBills != null) {
 						mpaymode = aeaBills.getHPaymode();
 						billType = aeaBills.getBillType();
 					}
@@ -333,6 +343,10 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 				} else {
 					throw new RuntimeException("只有预付、直单和主单,或分单和到付才可以输入PS");
 				}
+			} else if (feeCenterListPS.isEmpty() && !feeCenterListKH.isEmpty()) {
+				throw new RuntimeException("PS费与" + type + "需同时存在,当前缺少PS费用信息");
+			} else if (!feeCenterListPS.isEmpty()) {
+				throw new RuntimeException("PS费与" + type + "需同时存在,当前缺少海运费用信息");
 			}
 			R financeProcess = auditProecessService.createFinanceProcess(auditProecessDTO);
 			if (!financeProcess.isSuccess()) {

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

@@ -56,5 +56,5 @@ public interface BillsMapper extends BaseMapper<Bills> {
 
 	FinAccBillsVO listByAccBillId(@Param("acc") ListAccBillVO finAccBills);
 
-	List<FinanceProfit> financeProfit(@Param("data")FinanceProfit financeProfit, IPage<FinanceProfit> page);
+	List<FinanceProfit> financeProfit(@Param("data")FinanceProfit financeProfit);
 }

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

@@ -719,22 +719,75 @@
             seb.amount_profit_loc AS amountProfitLoc
         FROM
             los_sea_bills seb
-                LEFT JOIN los_fee_center feeCC ON seb.id = feeCC.pid
-                AND feeCC.dc = 'C' and feeCC.cur_code = 'CNY'
-                LEFT JOIN los_fee_center feeCU ON seb.id = feeCU.pid
-                AND feeCU.dc = 'C' and feeCU.cur_code = 'USD'
-                LEFT JOIN los_fee_center feeDC ON seb.id = feeDC.pid
-                AND feeDC.dc = 'D' and feeDC.cur_code = 'CNY'
-                LEFT JOIN los_fee_center feeDU ON seb.id = feeDU.pid
-                AND feeDU.dc = 'D' and feeDU.cur_code = 'USD'
+        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
+        AND feeCU.dc = 'C' and feeCU.cur_code = 'USD' AND feeCU.is_deleted = '0'
+        LEFT JOIN los_fee_center feeDC ON seb.id = feeDC.pid
+        AND feeDC.dc = 'D' and feeDC.cur_code = 'CNY'  AND feeDC.is_deleted = '0'
+        LEFT JOIN los_fee_center feeDU ON seb.id = feeDU.pid
+        AND feeDU.dc = 'D' and feeDU.cur_code = 'USD'  AND feeDU.is_deleted = '0'
         WHERE
             seb.is_deleted = '0'
-          AND feeCC.is_deleted = '0'
-          AND feeCU.is_deleted = '0'
-          AND feeDC.is_deleted = '0'
-          AND feeDU.is_deleted = '0'
-        GROUP BY
+        <if test="data.billType != null and data.billType != ''">
+            and find_in_set(seb.bill_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_id = #{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.statisticsDateStart}
+            </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.statisticsDateStart}
+            </if>
+        </if>
+        <if test="data.costMerge != null and data.costMerge != ''">
+            GROUP BY
             seb.bill_no
+        </if>
         ORDER BY
             seb.create_time
     </select>

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

@@ -21,6 +21,8 @@ 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;
 
 /**
@@ -41,4 +43,6 @@ public interface ContainersBillsMapper extends BaseMapper<ContainersBills> {
 	List<ContainersBillsVO> selectContainersBillsPage(IPage page, ContainersBillsVO containersBills);
 
 	void removeByPid(@Param("ids")List<Long> ids);
+
+    List<FinanceProfit> financeProfit(@Param("data")FinanceProfit financeProfit);
 }

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

@@ -62,5 +62,82 @@
     <select id="selectContainersBillsPage" resultMap="containersBillsResultMap">
         select * from los_sea_containers_bills where is_deleted = 0
     </select>
+    <select id="financeProfit" resultType="org.springblade.los.statisticAnalysis.FinanceProfit">
+        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,
+        seb.src_cn_name AS salesman,
+        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,
+        SUM(IF(feeDC.amount,feeDC.amount,0.00)) AS amountDr,
+        SUM(IF(feeDC.stl_ttl_amount,feeDC.stl_ttl_amount,0.00)) AS realAmountDr,
+        SUM(IF(feeCU.amount,feeCU.amount,0.00)) AS amountCrUsd,
+        SUM(IF(feeCU.stl_ttl_amount,feeCU.stl_ttl_amount,0.00)) AS realAmountCrUsd,
+        SUM(IF(feeCC.amount,feeCC.amount,0.00)) AS amountCr,
+        SUM(IF(feeCC.stl_ttl_amount,feeCC.stl_ttl_amount,0.00)) AS realAmountCr,
+        seb.amount_profit_loc AS amountProfitLoc
+        FROM
+        los_customs_declaration 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
+        AND feeCU.dc = 'C' and feeCU.cur_code = 'USD' AND feeCU.is_deleted = '0'
+        LEFT JOIN los_fee_center feeDC ON seb.id = feeDC.pid
+        AND feeDC.dc = 'D' and feeDC.cur_code = 'CNY'  AND feeDC.is_deleted = '0'
+        LEFT JOIN los_fee_center feeDU ON seb.id = feeDU.pid
+        AND feeDU.dc = 'D' and feeDU.cur_code = 'USD'  AND feeDU.is_deleted = '0'
+        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.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.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>
+        <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.statisticsDateStart}
+            </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.statisticsDateStart}
+            </if>
+        </if>
+        <if test="data.costMerge != null and data.costMerge != ''">
+            GROUP BY
+            seb.bill_no
+        </if>
+        ORDER BY
+        seb.create_time
+    </select>
 
 </mapper>

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

@@ -1135,6 +1135,10 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			} else {
 				throw new RuntimeException("只有预付、直单和主单,或分单和到付才可以输入PS");
 			}
+		} else if (feeCenterListPS.isEmpty() && !feeCenterListHY.isEmpty()) {
+			throw new RuntimeException("PS费与海运费需同时存在,当前缺少PS费用信息");
+		} else if (!feeCenterListPS.isEmpty()) {
+			throw new RuntimeException("PS费与海运费需同时存在,当前缺少海运费用信息");
 		}
 
 		// 没开启审批流直接走 通过流程
@@ -1539,9 +1543,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		copyBills.setFeeCenterListC(feeCenterListC);
 		copyBills.setFeeCenterListD(feeCenterListD);
 		copyBills.setPreContainersList(preContainersList);
-		copyBills.setQuantity(new BigDecimal("0.00"));
+		/*copyBills.setQuantity(new BigDecimal("0.00"));
 		copyBills.setGrossWeight(new BigDecimal("0.00"));
-		copyBills.setMeasurement(new BigDecimal("0.00"));
+		copyBills.setMeasurement(new BigDecimal("0.00"));*/
 		copyBills.setCfsQuantity(new BigDecimal("0.00"));
 		copyBills.setCfsGrossWeight(new BigDecimal("0.00"));
 		copyBills.setCfsMeasurement(new BigDecimal("0.00"));

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

@@ -425,6 +425,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 				}
 				detail.setStatus(3);
 				detail.setBillStatus(3);
+				detail.setApprovedDate(new Date());
 				int count = billsMapper.updateById(detail);
 				if (count == 0) {
 					throw new SecurityException("修改订单数据失败");
@@ -1068,6 +1069,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 				if (bills == null) {
 					throw new SecurityException("审批通过失败");
 				}
+				detail.setApprovedDate(new Date());
 				detail.setStatus(3);
 				int count = amendsMapper.updateById(detail);
 				if (count == 0) {
@@ -1328,6 +1330,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 				if (bills == null) {
 					throw new SecurityException("审批通过失败");
 				}
+				detail.setApprovedDate(new Date());
 				detail.setStatus(3);
 				detail.setBillStatus(3);
 				int count = aeaBillsMapper.updateById(detail);
@@ -1616,6 +1619,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 				if (customsDeclaration == null) {
 					throw new SecurityException("审批通过失败");
 				}
+				detail.setApprovedDate(new Date());
 				detail.setStatus(3);
 				detail.setBillStatus(3);
 				int count = customsDeclarationMapper.updateById(detail);

+ 208 - 4
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -1,16 +1,30 @@
 package org.springblade.los.statisticAnalysis.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
-import org.springblade.los.statisticAnalysis.DecisionAnalysis;
+import org.springblade.los.basic.cur.service.IBCurrencyService;
+import org.springblade.los.business.aea.mapper.AeaBillsMapper;
+import org.springblade.los.business.amends.entity.Amends;
+import org.springblade.los.business.amends.mapper.AmendsMapper;
 import org.springblade.los.business.sea.mapper.BillsMapper;
+import org.springblade.los.business.sea.mapper.ContainersBillsMapper;
+import org.springblade.los.finance.fee.entity.FeeCenter;
+import org.springblade.los.finance.fee.mapper.FeeCenterMapper;
+import org.springblade.los.statisticAnalysis.DecisionAnalysis;
 import org.springblade.los.statisticAnalysis.FinanceProfit;
 import org.springblade.los.statisticAnalysis.service.IStatisticAnalysisService;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-import java.util.Map;
+import java.math.BigDecimal;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @author :jixinyuan
@@ -21,6 +35,11 @@ import java.util.Map;
 public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 
 	private final BillsMapper billsMapper;
+	private final AeaBillsMapper aeaBillsMapper;
+	private final ContainersBillsMapper containersBillsMapper;
+	private final AmendsMapper amendsMapper;
+	private final FeeCenterMapper feeCenterMapper;
+	private final IBCurrencyService bCurrencyService;
 
 	@Override
 	public R<IPage<DecisionAnalysis>> decisionAnalysis(DecisionAnalysis decisionAnalysis, IPage<DecisionAnalysis> page) {
@@ -41,7 +60,192 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 
 	@Override
 	public R<IPage<FinanceProfit>> financeProfit(FinanceProfit financeProfit, IPage<FinanceProfit> page) {
-		List<FinanceProfit> financeProfitList = billsMapper.financeProfit(financeProfit, page);
+		List<FinanceProfit> financeProfitList = new ArrayList<>();
+		if (financeProfit.getBillType().contains("HYCK") || financeProfit.getBillType().contains("HYJK")) {
+			List<FinanceProfit> financeProfitListHy = billsMapper.financeProfit(financeProfit);
+			if (!financeProfitListHy.isEmpty()) {
+				financeProfitList.addAll(financeProfitListHy);
+			}
+		} else if (financeProfit.getBillType().contains("KYCK") || financeProfit.getBillType().contains("KYJK")) {
+			List<FinanceProfit> 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 = containersBillsMapper.financeProfit(financeProfit);
+			if (!financeProfitListBg.isEmpty()) {
+				financeProfitList.addAll(financeProfitListBg);
+			}
+		}
+		//是否合并amend费用  true 合并  false 不合并
+		if (ObjectUtils.isNotNull(financeProfit.getMergeAmendFee())) {
+			String billNo = financeProfitList.stream().map(FinanceProfit::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<FinanceProfit> financeProfits = new ArrayList<>();
+			for (FinanceProfit 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();
+						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);
+								//人民币实收金额
+								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);
+								//人民币应付金额
+								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);
+								//人民币实付金额
+								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);
+								//美金应收金额
+								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);
+								//美金实收金额
+								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);
+								//美金应付金额
+								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);
+								//美金实付金额
+								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);
+								//是否按审核日期
+								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(feeCentersCC.add(bCurrencyService.converterCny("USD", feeCentersUC, "C")));
+										item.setRealAmountCrLoc(feeCentersCCReal.add(bCurrencyService.converterCny("USD", feeCentersUCReal, "C")));
+										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()));
+									} 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.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()));
+									}
+								} 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(feeCentersCC.add(bCurrencyService.converterCny("USD", feeCentersUC, "C")));
+										item.setRealAmountCrLoc(feeCentersCCReal.add(bCurrencyService.converterCny("USD", feeCentersUCReal, "C")));
+										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()));
+									} 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.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()));
+									}
+								}
+							} catch (ParseException e) {
+								throw new RuntimeException(e);
+							}
+							financeProfits.add(financeProfit1);
+						}
+					}
+				}
+			}
+			financeProfitList.addAll(financeProfits);
+		} else {
+			List<FinanceProfit> financeProfitListBg = amendsMapper.financeProfit(financeProfit);
+			if (!financeProfitListBg.isEmpty()) {
+				financeProfitList.addAll(financeProfitListBg);
+			}
+		}
 		return R.data(page.setRecords(financeProfitList));
 	}
 }

+ 5 - 1
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java

@@ -6114,7 +6114,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 			}
 		}
 		baseMapper.updateById(detail);
-		String[] arrs = detail.getSrcIds().split(",");
+		String[] arrs = new String[0];
+		if(ObjectUtils.isNotNull(detail.getSrcIds())){
+			arrs = detail.getSrcIds().split(",");
+
+		}
 		for (String arr : arrs) {
 			Order selectOrder = baseMapper.selectById(Long.parseLong(arr));
 			if (ObjectUtils.isNotNull(selectOrder)) {

Some files were not shown because too many files changed in this diff