Browse Source

2024年3月6日17:32:36

纪新园 1 year ago
parent
commit
2693514a27
19 changed files with 800 additions and 138 deletions
  1. 21 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/entity/FinAccBills.java
  2. 50 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryDetailRC.java
  3. 50 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryDetailRD.java
  4. 70 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryQ.java
  5. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryRC.java
  6. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryRD.java
  7. 12 10
      blade-service/blade-los/src/main/java/org/springblade/los/Util/RegularUtils.java
  8. 19 2
      blade-service/blade-los/src/main/java/org/springblade/los/basic/corps/controller/BCorpsController.java
  9. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/business/aea/service/impl/AeaBillsServiceImpl.java
  10. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java
  11. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/business/customsDeclaration/service/impl/CustomsDeclarationServiceImpl.java
  12. 4 4
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/PreContainersServiceImpl.java
  13. 11 0
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.java
  14. 332 20
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.xml
  15. 74 90
      blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FeeCenterServiceImpl.java
  16. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/finance/stl/service/impl/FinStlBillsServiceImpl.java
  17. 48 3
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/controller/FinanceStatisticsController.java
  18. 9 2
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/IStatisticAnalysisService.java
  19. 24 3
      blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

+ 21 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/finance/fee/entity/FinAccBills.java

@@ -729,5 +729,26 @@ public class FinAccBills implements Serializable {
 	@TableField(exist = false)
 	private Date outboundDateEnd;
 
+	/**
+	 * 业务来源
+	 */
+	@ApiModelProperty(value = "业务来源")
+	private String srcType;
+	/**
+	 * 来源 id
+	 */
+	@ApiModelProperty(value = "来源 id")
+	private Long srcId;
+	/**
+	 * 来源中文
+	 */
+	@ApiModelProperty(value = "来源中文")
+	private String srcCnName;
+	/**
+	 * 来源英文
+	 */
+	@ApiModelProperty(value = "来源英文")
+	private String srcEnName;
+
 
 }

+ 50 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryDetailRC.java

@@ -0,0 +1,50 @@
+package org.springblade.los.statisticAnalysis;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/3/6
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class FeeSummaryDetailRC {
+
+	@ExcelProperty(value = "统计对象")
+	private String corpName;
+	@ExcelProperty(value = "BILLNO")
+	private String billNo;
+	@ExcelProperty(value = "MBLNO")
+	private String mblNo;
+	@ExcelProperty(value = "ETD")
+	private String etdDate;
+	@ExcelProperty(value = "应付美金")
+	private BigDecimal amountUsd;
+	@ExcelProperty(value = "应付人民币")
+	private BigDecimal amount;
+	@ExcelProperty(value = "已付美金")
+	private BigDecimal amountUsdAlready;
+	@ExcelProperty(value = "已付人民币")
+	private BigDecimal amountAlready;
+	@ExcelProperty(value = "未付美金")
+	private BigDecimal amountUsdNot;
+	@ExcelProperty(value = "未付人民币")
+	private BigDecimal amountNot;
+	@ExcelProperty(value = "开票美金")
+	private BigDecimal amountInvoicingUsd;
+	@ExcelProperty(value = "开票人民币")
+	private BigDecimal amountInvoicing;
+	@ExcelProperty(value = "未开美金")
+	private BigDecimal amountInvoicingUsdNot;
+	@ExcelProperty(value = "未开人民币")
+	private BigDecimal amountInvoicingNot;
+
+}

+ 50 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryDetailRD.java

@@ -0,0 +1,50 @@
+package org.springblade.los.statisticAnalysis;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/3/6
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class FeeSummaryDetailRD {
+
+	@ExcelProperty(value = "统计对象")
+	private String corpName;
+	@ExcelProperty(value = "BILLNO")
+	private String billNo;
+	@ExcelProperty(value = "MBLNO")
+	private String mblNo;
+	@ExcelProperty(value = "ETD")
+	private String etdDate;
+	@ExcelProperty(value = "应收美金")
+	private BigDecimal amountUsd;
+	@ExcelProperty(value = "应收人民币")
+	private BigDecimal amount;
+	@ExcelProperty(value = "已收美金")
+	private BigDecimal amountUsdAlready;
+	@ExcelProperty(value = "已收人民币")
+	private BigDecimal amountAlready;
+	@ExcelProperty(value = "未收美金")
+	private BigDecimal amountUsdNot;
+	@ExcelProperty(value = "未收人民币")
+	private BigDecimal amountNot;
+	@ExcelProperty(value = "开票美金")
+	private BigDecimal amountInvoicingUsd;
+	@ExcelProperty(value = "开票人民币")
+	private BigDecimal amountInvoicing;
+	@ExcelProperty(value = "未开美金")
+	private BigDecimal amountInvoicingUsdNot;
+	@ExcelProperty(value = "未开人民币")
+	private BigDecimal amountInvoicingNot;
+
+}

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

@@ -0,0 +1,70 @@
+package org.springblade.los.statisticAnalysis;
+
+import lombok.Data;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/3/6
+ */
+@Data
+public class FeeSummaryQ {
+
+	/**
+	 * 应收/应付
+	 */
+	private String dc;
+	/**
+	 * 查询方式  1=结算单位 2 委托人  3 业务来源
+	 */
+	private String type;
+	/**
+	 * 业务类型
+	 */
+	private String businessType;
+	/**
+	 * 委托人
+	 */
+	private Long clientId;
+	/**
+	 * 结算单位
+	 */
+	private Long corpId;
+	/**
+	 * 业务来源
+	 */
+	private String srcType;
+	/**
+	 * 业务员
+	 */
+	private Long srcId;
+	/**
+	 * 查询时间开始
+	 */
+	private String etdStart;
+	/**
+	 * 查询时间结束
+	 */
+	private String etdEnd;
+	/**
+	 * 是否按业务日期 0否1是
+	 */
+	private String isBusinessDate;
+	/**
+	 * 是否按审核日期 0否1是
+	 */
+	private String isToExamineDate;
+
+	/**
+	 * 租户
+	 */
+	private String tenantId;
+	/**
+	 * 分公司 Id
+	 */
+	private String branchId;
+	/**
+	 * 团队id
+	 */
+	private String teamId;
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryRC.java

@@ -0,0 +1,36 @@
+package org.springblade.los.statisticAnalysis;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/3/6
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class FeeSummaryRC {
+
+	@ExcelProperty(value = "统计对象")
+	private String corpName;
+	@ExcelProperty(value = "应付美金")
+	private BigDecimal amountUsd;
+	@ExcelProperty(value = "应付人民币")
+	private BigDecimal amount;
+	@ExcelProperty(value = "已付美金")
+	private BigDecimal amountUsdAlready;
+	@ExcelProperty(value = "已付人民币")
+	private BigDecimal amountAlready;
+	@ExcelProperty(value = "未付美金")
+	private BigDecimal amountUsdNot;
+	@ExcelProperty(value = "未付人民币")
+	private BigDecimal amountNot;
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryRD.java

@@ -0,0 +1,36 @@
+package org.springblade.los.statisticAnalysis;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/3/6
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class FeeSummaryRD {
+
+	@ExcelProperty(value = "统计对象")
+	private String corpName;
+	@ExcelProperty(value = "应收美金")
+	private BigDecimal amountUsd;
+	@ExcelProperty(value = "应收人民币")
+	private BigDecimal amount;
+	@ExcelProperty(value = "已收美金")
+	private BigDecimal amountUsdAlready;
+	@ExcelProperty(value = "已收人民币")
+	private BigDecimal amountAlready;
+	@ExcelProperty(value = "未收美金")
+	private BigDecimal amountUsdNot;
+	@ExcelProperty(value = "未收人民币")
+	private BigDecimal amountNot;
+
+}

+ 12 - 10
blade-service/blade-los/src/main/java/org/springblade/los/Util/RegularUtils.java

@@ -243,7 +243,7 @@ public class RegularUtils {
 		if (ObjectUtils.isNotNull(inttraSoDto.getPackagesNumber())) {
 			if (regularLength(inttraSoDto.getPackagesNumber().toString(), 18)) {
 				textLength += "包装件数,";
-			}else{
+			} else {
 				inttraSoDto.setPackagesNumber(inttraSoDto.getPackagesNumber().setScale(0, RoundingMode.HALF_UP).abs());
 			}
 		}
@@ -251,7 +251,7 @@ public class RegularUtils {
 		if (ObjectUtils.isNotNull(inttraSoDto.getVolumeOfGoods())) {
 			if (regularLength(inttraSoDto.getVolumeOfGoods().toString(), 18)) {
 				textLength += "货物体积,";
-			}else{
+			} else {
 				inttraSoDto.setVolumeOfGoods(inttraSoDto.getVolumeOfGoods().setScale(0, RoundingMode.HALF_UP).abs());
 			}
 		}
@@ -1022,7 +1022,7 @@ public class RegularUtils {
 		} else {
 			if (regularLength(inttraSoDto.getPackagesNumbers().toString(), 8)) {
 				textLength += "包装件数,";
-			}else{
+			} else {
 				inttraSoDto.setPackagesNumbers(inttraSoDto.getPackagesNumbers().setScale(0, RoundingMode.HALF_UP).abs());
 			}
 		}
@@ -1474,7 +1474,7 @@ public class RegularUtils {
 		if (ObjectUtils.isNotNull(inttraSoDto.getPackagesNumber())) {
 			if (regularLength(inttraSoDto.getPackagesNumber().toString(), 18)) {
 				textLength += "包装件数,";
-			}else{
+			} else {
 				inttraSoDto.setPackagesNumber(inttraSoDto.getPackagesNumber().setScale(0, RoundingMode.HALF_UP).abs());
 			}
 		}
@@ -2053,7 +2053,7 @@ public class RegularUtils {
 		} else {
 			if (regularLength(inttraSoDto.getPackagesNumbers().toString(), 8)) {
 				textLength += "包装件数,";
-			}else{
+			} else {
 				inttraSoDto.setPackagesNumbers(inttraSoDto.getPackagesNumbers().setScale(0, RoundingMode.HALF_UP).abs());
 			}
 		}
@@ -2993,11 +2993,13 @@ public class RegularUtils {
 	public static String getEdiCode(String type, String data) {
 //[{"name": "INTTRA", "value": "22G0"}, {"name": "API", "value": "22G1"}]
 		String ediCode = "";
-		List<ExtendedData> jsonArray = JSONArray.parseArray(data).toJavaList(ExtendedData.class);
-		for (ExtendedData item : jsonArray) {
-			if (ObjectUtils.isNotNull(item.getName()) && item.getName().equals(type)) {
-				ediCode = ObjectUtils.isNotNull(item.getValue()) ? item.getValue() : null;
-				break;
+		if (ObjectUtils.isNotNull(data)) {
+			List<ExtendedData> jsonArray = JSONArray.parseArray(data).toJavaList(ExtendedData.class);
+			for (ExtendedData item : jsonArray) {
+				if (ObjectUtils.isNotNull(item.getName()) && item.getName().equals(type)) {
+					ediCode = ObjectUtils.isNotNull(item.getValue()) ? item.getValue() : null;
+					break;
+				}
 			}
 		}
 		return ediCode;

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

@@ -37,8 +37,10 @@ import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.los.Util.IDeptUtils;
 import org.springblade.los.basic.corps.entity.BCorps;
+import org.springblade.los.basic.corps.entity.BCorpsTypeDefine;
 import org.springblade.los.basic.corps.entity.BCorpsTypes;
 import org.springblade.los.basic.corps.service.IBCorpsService;
+import org.springblade.los.basic.corps.service.IBCorpsTypeDefineService;
 import org.springblade.los.basic.corps.service.IBCorpsTypesService;
 import org.springblade.los.basic.corps.vo.BCorpsVO;
 import org.springblade.los.basic.utils.ExtendedData;
@@ -70,6 +72,8 @@ public class BCorpsController extends BladeController {
 
 	private final IBCorpsTypesService bCorpsTypesService;
 
+	private final IBCorpsTypeDefineService bCorpsTypeDefineService;
+
 	private final IDeptUtils deptUtils;
 
 	private final IUserClient iUserClient;
@@ -118,7 +122,8 @@ public class BCorpsController extends BladeController {
 			.like(ObjectUtils.isNotNull(bCorps.getCntyName()), BCorps::getCntyName, bCorps.getCntyName())
 			.like(ObjectUtils.isNotNull(bCorps.getTel()), BCorps::getTel, bCorps.getTel())
 			.like(ObjectUtils.isNotNull(bCorps.getAdminProfiles()), BCorps::getAdminProfiles, bCorps.getAdminProfiles())
-			.apply(ObjectUtils.isNotNull(bCorps.getCorpType()), "find_in_set('" + bCorps.getCorpType() + "',corp_type)");
+			.apply(ObjectUtils.isNotNull(bCorps.getCorpType()), "find_in_set('" + bCorps.getCorpType() + "',corp_type)")
+		;
 		if (AuthUtil.getUserRole().contains("admin") || AuthUtil.getUserRole().contains("secondaryAdmin")) {
 			//管理员、次级管理员查看全部数据
 		} else {
@@ -148,11 +153,23 @@ public class BCorpsController extends BladeController {
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页", notes = "传入bCorps")
 	public R<IPage<BCorps>> listByType(BCorps bCorps, Query query) {
+		LambdaQueryWrapper<BCorpsTypeDefine> lambdaQueryWrapperTypes = new LambdaQueryWrapper<>();
+		lambdaQueryWrapperTypes.eq(BCorpsTypeDefine::getTenantId, AuthUtil.getTenantId())
+			.eq(BCorpsTypeDefine::getIsDeleted, 0)
+			.apply(ObjectUtils.isNotNull(bCorps.getCorpTypeName()), "find_in_set(cn_name,'" + bCorps.getCorpTypeName() + "')")
+		;
+		List<BCorpsTypeDefine> bCorpsTypeList = bCorpsTypeDefineService.list(lambdaQueryWrapperTypes);
+		List<Long> typeIds = new ArrayList<>();
+		if (!bCorpsTypeList.isEmpty()) {
+			typeIds = bCorpsTypeList.stream().map(BCorpsTypeDefine::getId).distinct().collect(Collectors.toList());
+		}
 		LambdaQueryWrapper<BCorpsTypes> lambdaQueryWrapperType = new LambdaQueryWrapper<>();
 		lambdaQueryWrapperType.eq(BCorpsTypes::getTenantId, AuthUtil.getTenantId())
 			.eq(BCorpsTypes::getIsDeleted, 0)
-			.apply(ObjectUtils.isNotNull(bCorps.getCorpType()), "find_in_set(corp_type_id,'" + bCorps.getCorpType() + "')");
+			.in(!typeIds.isEmpty(), BCorpsTypes::getCorpTypeId, typeIds)
+		;
 		List<BCorpsTypes> bCorpsTypesList = bCorpsTypesService.list(lambdaQueryWrapperType);
+
 		List<Long> corpIds = new ArrayList<>();
 		if (!bCorpsTypesList.isEmpty()) {
 			corpIds = bCorpsTypesList.stream().map(BCorpsTypes::getCorpId).distinct().collect(Collectors.toList());

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

@@ -822,7 +822,7 @@ public class AeaBillsServiceImpl extends ServiceImpl<AeaBillsMapper, AeaBills> i
 			auditProecessDTO.setBillTime(declare.getCreateTime());
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
 			auditProecessDTO.setCorpId(declare.getCorpId());
-			auditProecessDTO.setSalesCompanyId(Long.parseLong(declare.getCreateDept()));
+			auditProecessDTO.setSalesCompanyId(deptUtils.getDeptPid());
 			auditProecessDTO.setSalesCompanyName(declare.getCreateDeptName());
 			auditProecessDTO.setPayAmount(declare.getAmountCrLoc());
 			auditProecessDTO.setReceivableAmount(declare.getAmountDrLoc());

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

@@ -264,7 +264,7 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 			auditProecessDTO.setBillTime(declare.getCreateTime());
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
 			auditProecessDTO.setCorpId(declare.getCorpId());
-			auditProecessDTO.setSalesCompanyId(Long.parseLong(declare.getCreateDept()));
+			auditProecessDTO.setSalesCompanyId(deptUtils.getDeptPid());
 			auditProecessDTO.setSalesCompanyName(declare.getCreateDeptName());
 			List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
 				.eq(FeeCenter::getIsDeleted, 0)

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/business/customsDeclaration/service/impl/CustomsDeclarationServiceImpl.java

@@ -376,7 +376,7 @@ public class CustomsDeclarationServiceImpl extends ServiceImpl<CustomsDeclaratio
 			auditProecessDTO.setBillTime(declare.getCreateTime());
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
 			auditProecessDTO.setCorpId(declare.getCorpId());
-			auditProecessDTO.setSalesCompanyId(Long.parseLong(declare.getCreateDept()));
+			auditProecessDTO.setSalesCompanyId(deptUtils.getDeptPid());
 			auditProecessDTO.setSalesCompanyName(declare.getCreateDeptName());
 			auditProecessDTO.setPayAmount(declare.getAmountCrLoc());
 			auditProecessDTO.setReceivableAmount(declare.getAmountDrLoc());

+ 4 - 4
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/PreContainersServiceImpl.java

@@ -175,9 +175,9 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 		if (bCntrTypes != null) {
 			ediCode = RegularUtils.getEdiCode(bills.getCyCode(), bCntrTypes.getExtendedData());
 		}
-		if (ObjectUtils.isNull(ediCode)) {
+		/*if (ObjectUtils.isNull(ediCode)) {
 			throw new RuntimeException("请先配置场站对应箱型代码");
-		}
+		}*/
 		//生成海运进出口配箱-箱号装箱
 		List<Containers> containersList = new ArrayList<>();
 		for (int i = 0; i < preContainers.getQuantity(); i++) {
@@ -325,9 +325,9 @@ public class PreContainersServiceImpl extends ServiceImpl<PreContainersMapper, P
 			if (bCntrTypes != null && bills != null) {
 				ediCode = RegularUtils.getEdiCode(bills.getCyCode(), bCntrTypes.getExtendedData());
 			}
-			if (ObjectUtils.isNull(ediCode)) {
+			/*if (ObjectUtils.isNull(ediCode)) {
 				throw new RuntimeException("请先配置场站对应箱型代码");
-			}
+			}*/
 			//生成海运进出口配箱-箱号装箱
 			for (int i = 0; i < preContainers.getQuantity(); i++) {
 				Containers containers = new Containers();

+ 11 - 0
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.java

@@ -22,6 +22,9 @@ import org.apache.ibatis.annotations.Param;
 import org.springblade.los.excel.FeeCountByCorpExcel;
 import org.springblade.los.finance.fee.entity.FinAccBills;
 import org.springblade.los.finance.fee.vo.FinAccBillsVO;
+import org.springblade.los.statisticAnalysis.FeeSummaryDetailRD;
+import org.springblade.los.statisticAnalysis.FeeSummaryQ;
+import org.springblade.los.statisticAnalysis.FeeSummaryRD;
 
 import java.util.List;
 import java.util.Map;
@@ -50,4 +53,12 @@ public interface FinAccBillsMapper extends BaseMapper<FinAccBills> {
 	List<FeeCountByCorpExcel> listFeeCountByCorpExport(@Param("dc") String dc, @Param("tenantId") String tenantId,
 													   @Param("deptPid") Long deptPid, @Param("postId") String postId
 		, @Param("corpId") Long corpId);
+
+	List<FeeSummaryRD> feeSummary(IPage<FeeSummaryRD> page, @Param("fee") FeeSummaryQ feeSummaryQ);
+
+	List<FeeSummaryRD> feeSummaryExport(@Param("fee") FeeSummaryQ feeSummaryQ);
+
+	List<FeeSummaryDetailRD> feeSummaryDetail(IPage<FeeSummaryDetailRD> page, @Param("fee")FeeSummaryQ feeSummaryQ);
+
+	List<FeeSummaryDetailRD> feeSummaryDetailExport(@Param("fee")FeeSummaryQ feeSummaryQ);
 }

+ 332 - 20
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.xml

@@ -94,28 +94,30 @@
 
 
     <select id="selectFinAccBillsPage" resultMap="finAccBillsResultMap">
-        select * from los_fin_acc_bills where is_deleted = 0
+        select *
+        from los_fin_acc_bills
+        where is_deleted = 0
     </select>
     <select id="listFeeCountByCorp" resultType="java.util.Map">
         SELECT
-            corp_cn_name as corpCnName,
-            mblno as mblno,
-            SUM( amount_dr ) as amountDr,
-            SUM( amount_cr ) as amountCr,
-            SUM( amount_dr_usd ) as amountDrUsd,
-            SUM( amount_cr_usd ) as amountCrUsd,
-            SUM( amount_dr_loc ) as amountDrLoc,
-            SUM( amount_cr_loc ) as amountCrLoc,
-            SUM( stl_amount_dr ) as stlAmountDr,
-            SUM( stl_amount_cr ) as stlAmountCr,
-            SUM( stl_amount_dr_usd ) as stlAmountDrUsd,
-            SUM( stl_amount_cr_usd ) as stlAmountCrUsd,
-            SUM( stl_amount_cr_loc ) as stlAmountCrLoc,
-            SUM( stl_amount_dr_loc ) as stlAmountDrLoc
+        corp_cn_name as corpCnName,
+        mblno as mblno,
+        SUM( amount_dr ) as amountDr,
+        SUM( amount_cr ) as amountCr,
+        SUM( amount_dr_usd ) as amountDrUsd,
+        SUM( amount_cr_usd ) as amountCrUsd,
+        SUM( amount_dr_loc ) as amountDrLoc,
+        SUM( amount_cr_loc ) as amountCrLoc,
+        SUM( stl_amount_dr ) as stlAmountDr,
+        SUM( stl_amount_cr ) as stlAmountCr,
+        SUM( stl_amount_dr_usd ) as stlAmountDrUsd,
+        SUM( stl_amount_cr_usd ) as stlAmountCrUsd,
+        SUM( stl_amount_cr_loc ) as stlAmountCrLoc,
+        SUM( stl_amount_dr_loc ) as stlAmountDrLoc
         FROM
-            `los_fin_acc_bills`
+        `los_fin_acc_bills`
         WHERE
-            is_deleted = '0'
+        is_deleted = '0'
         <if test='tenantId != null and tenantId != ""'>
             and tenant_id = #{tenantId}
         </if>
@@ -125,14 +127,14 @@
         <if test='deptPid != null'>
             and branch_id = #{deptPid}
         </if>
-          <if test='postId != null and postId != ""'>
+        <if test='postId != null and postId != ""'>
             and team_id = #{postId}
         </if>
-          <if test='corpId != null'>
+        <if test='corpId != null'>
             and corp_id = #{corpId}
         </if>
         GROUP BY
-            mblno
+        mblno
     </select>
     <select id="listFeeCountByCorpExport" resultType="org.springblade.los.excel.FeeCountByCorpExcel">
         SELECT
@@ -172,5 +174,315 @@
         GROUP BY
         mblno
     </select>
+    <select id="feeSummary" resultType="org.springblade.los.statisticAnalysis.FeeSummaryRD">
+        SELECT
+        <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+            acc.corp_cn_name corpName,
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
+            acc.bill_corp_cn_name corpName,
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
+            acc.src_cn_name corpName,
+        </if>
+            SUM(( CASE acc.account_dc WHEN 'D' THEN acc.amount_dr WHEN 'C' THEN acc.amount_cr ELSE 0 END ) ) AS amount,
+            SUM(( CASE acc.account_dc WHEN 'D' THEN acc.amount_dr_usd WHEN 'C' THEN acc.amount_cr_usd ELSE 0 END ) ) AS amountUsd,
+            SUM(( CASE acc.account_dc WHEN 'D' THEN acc.stl_amount_dr_usd WHEN 'C' THEN acc.stl_amount_cr_usd ELSE 0 END ) ) AS amountUsdAlready,
+            SUM(( CASE acc.account_dc WHEN 'D' THEN acc.stl_amount_dr WHEN 'C' THEN acc.stl_amount_cr ELSE 0 END ) ) AS amountAlready,
+            SUM(( CASE acc.account_dc WHEN 'D' THEN (acc.amount_dr_usd-stl_amount_dr_usd) WHEN 'C' THEN (acc.amount_cr_usd-stl_amount_cr_usd) ELSE 0 END ) ) AS amountUsdNot,
+            SUM(( CASE acc.account_dc WHEN 'D' THEN (acc.amount_dr-acc.stl_amount_dr) WHEN 'C' THEN (acc.amount_cr-acc.stl_amount_cr) ELSE 0 END ) ) AS amountNot
+        FROM
+            los_fin_acc_bills acc
+        WHERE
+            acc.is_deleted = '0'
+        <if test='fee.tenantId != null and fee.tenantId != ""'>
+            and acc.tenant_id = #{fee.tenantId}
+        </if>
+        <if test='fee.branchId != null and fee.branchId != ""'>
+            and acc.branch_id = #{fee.branchId}
+        </if>
+        <if test='fee.teamId != null and fee.teamId != ""'>
+            and acc.team_id = #{fee.teamId}
+        </if>
+        <if test='fee.dc != null and fee.dc != ""'>
+            and acc.account_dc = #{fee.dc}
+        </if>
+        <if test='fee.businessType != null and fee.businessType != ""'>
+            and acc.business_type = #{fee.businessType}
+        </if>
+        <if test='fee.clientId != null'>
+            and acc.bill_corp_id = #{fee.clientId}
+        </if>
+        <if test='fee.corpId != null'>
+            and acc.corp_id = #{fee.corpId}
+        </if>
+        <if test='fee.srcType != null and fee.srcType != ""'>
+            and acc.src_type = #{fee.srcType}
+        </if>
+        <if test='fee.srcId != null'>
+            and acc.src_id = #{fee.srcId}
+        </if>
+        <if test='fee.isBusinessDate != null and fee.isBusinessDate != "" and fee.isBusinessDate == "1"'>
+            <if test='fee.etdStart != null and fee.etdStart != ""'>
+                and acc.bill_date &gt;= #{fee.etdStart}
+            </if>
+            <if test='fee.etdEnd != null and fee.etdEnd != ""'>
+                and acc.bill_date &lt;= #{fee.etdEnd}
+            </if>
+        </if>
+        <if test='fee.isToExamineDate != null and fee.isToExamineDate != "" and fee.isToExamineDate == "1"'>
+            <if test='fee.etdStart != null and fee.etdStart != ""'>
+                and acc.approved_date &gt;= #{fee.etdStart}
+            </if>
+            <if test='fee.etdEnd != null and fee.etdEnd != ""'>
+                and acc.approved_date &lt;= #{fee.etdEnd}
+            </if>
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+            GROUP BY acc.corp_id
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
+            GROUP BY acc.bill_corp_id
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
+            GROUP BY acc.src_id
+        </if>
+    </select>
+    <select id="feeSummaryExport" resultType="org.springblade.los.statisticAnalysis.FeeSummaryRD">
+        SELECT
+        <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+            acc.corp_cn_name corpName,
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
+            acc.bill_corp_cn_name corpName,
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
+            acc.src_cn_name corpName,
+        </if>
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.amount_dr WHEN 'C' THEN acc.amount_cr ELSE 0 END ) ) AS amount,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.amount_dr_usd WHEN 'C' THEN acc.amount_cr_usd ELSE 0 END ) ) AS amountUsd,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.stl_amount_dr_usd WHEN 'C' THEN acc.stl_amount_cr_usd ELSE 0 END ) ) AS amountUsdAlready,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.stl_amount_dr WHEN 'C' THEN acc.stl_amount_cr ELSE 0 END ) ) AS amountAlready,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN (acc.amount_dr_usd-stl_amount_dr_usd) WHEN 'C' THEN (acc.amount_cr_usd-stl_amount_cr_usd) ELSE 0 END ) ) AS amountUsdNot,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN (acc.amount_dr-acc.stl_amount_dr) WHEN 'C' THEN (acc.amount_cr-acc.stl_amount_cr) ELSE 0 END ) ) AS amountNot
+        FROM
+        los_fin_acc_bills acc
+        WHERE
+        acc.is_deleted = '0'
+        <if test='fee.tenantId != null and fee.tenantId != ""'>
+            and acc.tenant_id = #{fee.tenantId}
+        </if>
+        <if test='fee.branchId != null and fee.branchId != ""'>
+            and acc.branch_id = #{fee.branchId}
+        </if>
+        <if test='fee.teamId != null and fee.teamId != ""'>
+            and acc.team_id = #{fee.teamId}
+        </if>
+        <if test='fee.dc != null and fee.dc != ""'>
+            and acc.account_dc = #{fee.dc}
+        </if>
+        <if test='fee.businessType != null and fee.businessType != ""'>
+            and acc.business_type = #{fee.businessType}
+        </if>
+        <if test='fee.clientId != null'>
+            and acc.bill_corp_id = #{fee.clientId}
+        </if>
+        <if test='fee.corpId != null'>
+            and acc.corp_id = #{fee.corpId}
+        </if>
+        <if test='fee.srcType != null and fee.srcType != ""'>
+            and acc.src_type = #{fee.srcType}
+        </if>
+        <if test='fee.srcId != null'>
+            and acc.src_id = #{fee.srcId}
+        </if>
+        <if test='fee.isBusinessDate != null and fee.isBusinessDate != "" and fee.isBusinessDate == "1"'>
+            <if test='fee.etdStart != null and fee.etdStart != ""'>
+                and acc.bill_date &gt;= #{fee.etdStart}
+            </if>
+            <if test='fee.etdEnd != null and fee.etdEnd != ""'>
+                and acc.bill_date &lt;= #{fee.etdEnd}
+            </if>
+        </if>
+        <if test='fee.isToExamineDate != null and fee.isToExamineDate != "" and fee.isToExamineDate == "1"'>
+            <if test='fee.etdStart != null and fee.etdStart != ""'>
+                and acc.approved_date &gt;= #{fee.etdStart}
+            </if>
+            <if test='fee.etdEnd != null and fee.etdEnd != ""'>
+                and acc.approved_date &lt;= #{fee.etdEnd}
+            </if>
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+            GROUP BY acc.corp_id
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
+            GROUP BY acc.bill_corp_id
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
+            GROUP BY acc.src_id
+        </if>
+    </select>
+    <select id="feeSummaryDetail" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailRD">
+        SELECT
+        <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+            acc.corp_cn_name corpName,
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
+            acc.bill_corp_cn_name corpName,
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
+            acc.src_cn_name corpName,
+        </if>
+        acc.bill_no billNo,
+        acc.mblno mblNo,
+        acc.etd etdDate,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.amount_dr WHEN 'C' THEN acc.amount_cr ELSE 0 END ) ) AS amount,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.amount_dr_usd WHEN 'C' THEN acc.amount_cr_usd ELSE 0 END ) ) AS amountUsd,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.stl_amount_dr_usd WHEN 'C' THEN acc.stl_amount_cr_usd ELSE 0 END ) ) AS amountUsdAlready,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.stl_amount_dr WHEN 'C' THEN acc.stl_amount_cr ELSE 0 END ) ) AS amountAlready,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN (acc.amount_dr_usd-stl_amount_dr_usd) WHEN 'C' THEN (acc.amount_cr_usd-stl_amount_cr_usd) ELSE 0 END ) ) AS amountUsdNot,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN (acc.amount_dr-acc.stl_amount_dr) WHEN 'C' THEN (acc.amount_cr-acc.stl_amount_cr) ELSE 0 END ) ) AS amountNot,
+        SUM(IF(uninvoiced_amount,uninvoiced_amount,0)) AS amountInvoicing,
+        SUM(IF(uninvoiced_amount_usd,uninvoiced_amount_usd,0)) AS amountInvoicingUsd,
+        SUM(acc.amount_dr-IF(uninvoiced_amount,uninvoiced_amount,0)) AS amountInvoicingNot,
+        SUM(acc.amount_dr_usd-IF(uninvoiced_amount_usd,uninvoiced_amount_usd,0)) AS amountInvoicingUsdNot
+        FROM
+        los_fin_acc_bills acc
+        WHERE
+        acc.is_deleted = '0'
+        <if test='fee.tenantId != null and fee.tenantId != ""'>
+            and acc.tenant_id = #{fee.tenantId}
+        </if>
+        <if test='fee.branchId != null and fee.branchId != ""'>
+            and acc.branch_id = #{fee.branchId}
+        </if>
+        <if test='fee.teamId != null and fee.teamId != ""'>
+            and acc.team_id = #{fee.teamId}
+        </if>
+        <if test='fee.dc != null and fee.dc != ""'>
+            and acc.account_dc = #{fee.dc}
+        </if>
+        <if test='fee.businessType != null and fee.businessType != ""'>
+            and acc.business_type = #{fee.businessType}
+        </if>
+        <if test='fee.clientId != null'>
+            and acc.bill_corp_id = #{fee.clientId}
+        </if>
+        <if test='fee.corpId != null'>
+            and acc.corp_id = #{fee.corpId}
+        </if>
+        <if test='fee.srcType != null and fee.srcType != ""'>
+            and acc.src_type = #{fee.srcType}
+        </if>
+        <if test='fee.srcId != null'>
+            and acc.src_id = #{fee.srcId}
+        </if>
+        <if test='fee.isBusinessDate != null and fee.isBusinessDate != "" and fee.isBusinessDate == "1"'>
+            <if test='fee.etdStart != null and fee.etdStart != ""'>
+                and acc.bill_date &gt;= #{fee.etdStart}
+            </if>
+            <if test='fee.etdEnd != null and fee.etdEnd != ""'>
+                and acc.bill_date &lt;= #{fee.etdEnd}
+            </if>
+        </if>
+        <if test='fee.isToExamineDate != null and fee.isToExamineDate != "" and fee.isToExamineDate == "1"'>
+            <if test='fee.etdStart != null and fee.etdStart != ""'>
+                and acc.approved_date &gt;= #{fee.etdStart}
+            </if>
+            <if test='fee.etdEnd != null and fee.etdEnd != ""'>
+                and acc.approved_date &lt;= #{fee.etdEnd}
+            </if>
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+            GROUP BY acc.corp_id
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
+            GROUP BY acc.bill_corp_id
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
+            GROUP BY acc.src_id
+        </if>
+    </select>
+    <select id="feeSummaryDetailExport" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailRD">
+        SELECT
+        <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+            acc.corp_cn_name corpName,
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
+            acc.bill_corp_cn_name corpName,
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
+            acc.src_cn_name corpName,
+        </if>
+        acc.bill_no billNo,
+        acc.mblno mblNo,
+        acc.etd etdDate,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.amount_dr WHEN 'C' THEN acc.amount_cr ELSE 0 END ) ) AS amount,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.amount_dr_usd WHEN 'C' THEN acc.amount_cr_usd ELSE 0 END ) ) AS amountUsd,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.stl_amount_dr_usd WHEN 'C' THEN acc.stl_amount_cr_usd ELSE 0 END ) ) AS amountUsdAlready,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN acc.stl_amount_dr WHEN 'C' THEN acc.stl_amount_cr ELSE 0 END ) ) AS amountAlready,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN (acc.amount_dr_usd-stl_amount_dr_usd) WHEN 'C' THEN (acc.amount_cr_usd-stl_amount_cr_usd) ELSE 0 END ) ) AS amountUsdNot,
+        SUM(( CASE acc.account_dc WHEN 'D' THEN (acc.amount_dr-acc.stl_amount_dr) WHEN 'C' THEN (acc.amount_cr-acc.stl_amount_cr) ELSE 0 END ) ) AS amountNot,
+        SUM(IF(uninvoiced_amount,uninvoiced_amount,0)) AS amountInvoicing,
+        SUM(IF(uninvoiced_amount_usd,uninvoiced_amount_usd,0)) AS amountInvoicingUsd,
+        SUM(acc.amount_dr-IF(uninvoiced_amount,uninvoiced_amount,0)) AS amountInvoicingNot,
+        SUM(acc.amount_dr_usd-IF(uninvoiced_amount_usd,uninvoiced_amount_usd,0)) AS amountInvoicingUsdNot
+        FROM
+        los_fin_acc_bills acc
+        WHERE
+        acc.is_deleted = '0'
+        <if test='fee.tenantId != null and fee.tenantId != ""'>
+            and acc.tenant_id = #{fee.tenantId}
+        </if>
+        <if test='fee.branchId != null and fee.branchId != ""'>
+            and acc.branch_id = #{fee.branchId}
+        </if>
+        <if test='fee.teamId != null and fee.teamId != ""'>
+            and acc.team_id = #{fee.teamId}
+        </if>
+        <if test='fee.dc != null and fee.dc != ""'>
+            and acc.account_dc = #{fee.dc}
+        </if>
+        <if test='fee.businessType != null and fee.businessType != ""'>
+            and acc.business_type = #{fee.businessType}
+        </if>
+        <if test='fee.clientId != null'>
+            and acc.bill_corp_id = #{fee.clientId}
+        </if>
+        <if test='fee.corpId != null'>
+            and acc.corp_id = #{fee.corpId}
+        </if>
+        <if test='fee.srcType != null and fee.srcType != ""'>
+            and acc.src_type = #{fee.srcType}
+        </if>
+        <if test='fee.srcId != null'>
+            and acc.src_id = #{fee.srcId}
+        </if>
+        <if test='fee.isBusinessDate != null and fee.isBusinessDate != "" and fee.isBusinessDate == "1"'>
+            <if test='fee.etdStart != null and fee.etdStart != ""'>
+                and acc.bill_date &gt;= #{fee.etdStart}
+            </if>
+            <if test='fee.etdEnd != null and fee.etdEnd != ""'>
+                and acc.bill_date &lt;= #{fee.etdEnd}
+            </if>
+        </if>
+        <if test='fee.isToExamineDate != null and fee.isToExamineDate != "" and fee.isToExamineDate == "1"'>
+            <if test='fee.etdStart != null and fee.etdStart != ""'>
+                and acc.approved_date &gt;= #{fee.etdStart}
+            </if>
+            <if test='fee.etdEnd != null and fee.etdEnd != ""'>
+                and acc.approved_date &lt;= #{fee.etdEnd}
+            </if>
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+            GROUP BY acc.corp_id
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "2"'>
+            GROUP BY acc.bill_corp_id
+        </if>
+        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
+            GROUP BY acc.src_id
+        </if>
+    </select>
 
 </mapper>

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

@@ -257,95 +257,33 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 						if (preContainers.isEmpty()) {
 							continue;
 						}
-						if ("20GP".equals(items.getUnitNo())) {
-							Integer quantity = preContainers.stream().filter(e -> "20GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
-							if (quantity == 0) {
-								continue;
-							}
-							feeCenter.setQuantity(new BigDecimal(quantity + ""));
-							feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-						} else if ("40GP".equals(items.getUnitNo())) {
-							Integer quantity = preContainers.stream().filter(e -> "40GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
-							if (quantity == 0) {
-								continue;
-							}
-							feeCenter.setQuantity(new BigDecimal(quantity + ""));
-							feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-						} else if ("40HC".equals(items.getUnitNo())) {
-							Integer quantity = preContainers.stream().filter(e -> "40HC".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
-							if (quantity == 0) {
-								continue;
-							}
-							feeCenter.setQuantity(new BigDecimal(quantity + ""));
-							feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-						} else if ("45GP".equals(items.getUnitNo())) {
-							Integer quantity = preContainers.stream().filter(e -> "45GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
-							if (quantity == 0) {
-								continue;
-							}
-							feeCenter.setQuantity(new BigDecimal(quantity + ""));
-							feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-						} else if ("48GP".equals(items.getUnitNo())) {
-							Integer quantity = preContainers.stream().filter(e -> "48GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
-							if (quantity == 0) {
-								continue;
-							}
-							feeCenter.setQuantity(new BigDecimal(quantity + ""));
-							feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-						}
-					} else if ("2".equals(items.getQuantityRule())) {
-						if ("JOB".equals(items.getUnitNo())) {
-							feeCenter.setQuantity(new BigDecimal("1"));
-							feeCenter.setAmount(items.getPrice().multiply(new BigDecimal("1")));
-						} else {
+						Integer quantity = preContainers.stream().filter(e -> items.getUnitNo().equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).reduce(0, Integer::sum);
+						if (quantity == 0) {
 							continue;
 						}
+						feeCenter.setQuantity(new BigDecimal(quantity + ""));
+						feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
+					} else if ("2".equals(items.getQuantityRule())) {
+						feeCenter.setQuantity(new BigDecimal("1"));
+						feeCenter.setAmount(items.getPrice().multiply(new BigDecimal("1")));
 					} else if ("3".equals(items.getQuantityRule())) {
-						if ("KGS".equals(items.getUnitNo())) {
-							feeCenter.setQuantity(bills.getGrossWeight());
-							feeCenter.setAmount(items.getPrice().multiply(bills.getGrossWeight()));
-						} else {
-							continue;
-						}
+						feeCenter.setQuantity(bills.getGrossWeight());
+						feeCenter.setAmount(items.getPrice().multiply(bills.getGrossWeight()));
 					} else if ("4".equals(items.getQuantityRule())) {
-						if (preContainers.size() == 0) {
+						if (preContainers.isEmpty()) {
 							continue;
 						}
-						if ("TEU".equals(items.getUnitNo())) {
-							BigDecimal quantity20GPTeu = preContainers.stream().filter(e -> "20GP".equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
-							Integer quantity20GP = preContainers.stream().filter(e -> "20GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).mapToInt(Integer::intValue).sum();
-							BigDecimal quantity20GPSum = quantity20GPTeu.multiply(new BigDecimal(quantity20GP + ""));
-
-							BigDecimal quantity40GPTeu = preContainers.stream().filter(e -> "40GP".equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
-							Integer quantity40GP = preContainers.stream().filter(e -> "40GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).mapToInt(Integer::intValue).sum();
-							BigDecimal quantity40GPSum = quantity40GPTeu.multiply(new BigDecimal(quantity40GP + ""));
-
-							BigDecimal quantity40HCTeu = preContainers.stream().filter(e -> "40HC".equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
-							Integer quantity40HC = preContainers.stream().filter(e -> "40HC".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).mapToInt(Integer::intValue).sum();
-							BigDecimal quantity40HCSum = quantity40HCTeu.multiply(new BigDecimal(quantity40HC + ""));
-
-							BigDecimal quantity45GPTeu = preContainers.stream().filter(e -> "45GP".equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
-							Integer quantity45GP = preContainers.stream().filter(e -> "45GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).mapToInt(Integer::intValue).sum();
-							BigDecimal quantity45GPSum = quantity45GPTeu.multiply(new BigDecimal(quantity45GP + ""));
-
-							BigDecimal quantity48GPTeu = preContainers.stream().filter(e -> "48GP".equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
-							Integer quantity48GP = preContainers.stream().filter(e -> "48GP".equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).mapToInt(Integer::intValue).sum();
-							BigDecimal quantity48GPSum = quantity48GPTeu.multiply(new BigDecimal(quantity48GP + ""));
-
-							BigDecimal quantity = quantity20GPSum.add(quantity40GPSum).add(quantity40HCSum).add(quantity45GPSum).add(quantity48GPSum);
-							if (quantity.compareTo(new BigDecimal("0")) == 0) {
-								continue;
-							}
-							feeCenter.setQuantity(new BigDecimal(quantity + ""));
-							feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
-						}
-					} else if ("5".equals(items.getQuantityRule())) {
-						if ("CBM".equals(items.getUnitNo())) {
-							feeCenter.setQuantity(bills.getMeasurement());
-							feeCenter.setAmount(items.getPrice().multiply(bills.getMeasurement()));
-						} else {
+						BigDecimal quantityTeu = preContainers.stream().filter(e -> items.getUnitNo().equals(e.getCntrTypeCode())).map(PreContainers::getTeu).reduce(BigDecimal.ZERO, BigDecimal::add);
+						Integer quantityGP = preContainers.stream().filter(e -> items.getUnitNo().equals(e.getCntrTypeCode())).map(PreContainers::getQuantity).mapToInt(Integer::intValue).sum();
+						BigDecimal quantity = quantityTeu.multiply(new BigDecimal(quantityGP + ""));
+						if (quantity.compareTo(new BigDecimal("0")) == 0) {
 							continue;
 						}
+						feeCenter.setQuantity(new BigDecimal(quantity + ""));
+						feeCenter.setAmount(items.getPrice().multiply(feeCenter.getQuantity()));
+					} else if ("5".equals(items.getQuantityRule())) {
+						feeCenter.setQuantity(bills.getMeasurement());
+						feeCenter.setAmount(items.getPrice().multiply(bills.getMeasurement()));
 					} else {
 						feeCenter.setQuantity(new BigDecimal("1"));
 						feeCenter.setAmount(items.getPrice().multiply(new BigDecimal("1")));
@@ -880,7 +818,7 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 	@Override
 	public List<BCorps> getFeeCenterCorpIds(Long billId, String dc, String type) {
 		List<Long> corpIds = new ArrayList<>();
-		if ("HYCK".equals(type)) {
+		if ("HYCK".equals(type) || "HYJK".equals(type)) {
 			Bills bills = billsMapper.selectById(billId);
 			if (bills != null) {
 				if ("MM".equals(bills.getBillType())) {
@@ -907,15 +845,61 @@ public class FeeCenterServiceImpl extends ServiceImpl<FeeCenterMapper, FeeCenter
 							corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
 						}
 					}
-				} else {
-					List<FeeCenter> feeCenterList = baseMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
-						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
-						.eq(FeeCenter::getIsDeleted, 0)
-						.eq(FeeCenter::getDc, dc)
-						.eq(FeeCenter::getPid, billId));
-					if (!feeCenterList.isEmpty()) {
-						corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+				}List<FeeCenter> feeCenterList = baseMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0)
+					.eq(FeeCenter::getDc, dc)
+					.eq(FeeCenter::getPid, billId));
+				if (!feeCenterList.isEmpty()) {
+					corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+				}
+			}
+		} else if ("KYCK".equals(type) || "KYJK".equals(type)) {
+			AeaBills bills = aeaBillsMapper.selectById(billId);
+			if (bills != null) {
+				if ("MM".equals(bills.getBillType())) {
+					List<AeaBills> billsList = aeaBillsMapper.selectList(new LambdaQueryWrapper<AeaBills>()
+						.eq(AeaBills::getTenantId, AuthUtil.getTenantId())
+						.eq(AeaBills::getIsDeleted, 0)
+						.eq(AeaBills::getMasterId, bills.getId())
+						.eq(AeaBills::getMasterBillNo, bills.getBillNo()));
+					if (!billsList.isEmpty()) {
+						List<Long> billIds;
+						billIds = billsList.stream().map(AeaBills::getId).collect(Collectors.toList());
+						if (!billIds.isEmpty()) {
+							billIds.add(billId);
+						} else {
+							billIds = new ArrayList<>();
+							billIds.add(billId);
+						}
+						List<FeeCenter> feeCenterList = baseMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
+							.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+							.eq(FeeCenter::getIsDeleted, 0)
+							.eq(FeeCenter::getDc, dc)
+							.in(FeeCenter::getPid, billIds));
+						if (!feeCenterList.isEmpty()) {
+							corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+						}
 					}
+				} List<FeeCenter> feeCenterList = baseMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0)
+					.eq(FeeCenter::getDc, dc)
+					.eq(FeeCenter::getPid, billId));
+				if (!feeCenterList.isEmpty()) {
+					corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+				}
+			}
+		} else if ("BGSE".equals(type) || "BGSI".equals(type) || "BGAI".equals(type) || "BGAE".equals(type)) {
+			CustomsDeclaration bills = customsDeclarationMapper.selectById(billId);
+			if (bills != null) {
+				List<FeeCenter> feeCenterList = baseMapper.selectList(new LambdaQueryWrapper<FeeCenter>()
+					.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
+					.eq(FeeCenter::getIsDeleted, 0)
+					.eq(FeeCenter::getDc, dc)
+					.eq(FeeCenter::getPid, billId));
+				if (!feeCenterList.isEmpty()) {
+					corpIds = feeCenterList.stream().map(FeeCenter::getCorpId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
 				}
 			}
 		} else if ("AMEND".equals(type)) {

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

@@ -1392,7 +1392,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 			auditProecessDTO.setBillTime(detail.getCreateTime());
 			auditProecessDTO.setTenantId(AuthUtil.getTenantId());
 			auditProecessDTO.setCorpId(detail.getCorpId());
-			auditProecessDTO.setSalesCompanyId(Long.parseLong(detail.getCreateDept()));
+			auditProecessDTO.setSalesCompanyId(deptUtils.getDeptPid());
 			auditProecessDTO.setSalesCompanyName(detail.getCreateDeptName());
 			auditProecessDTO.setPayAmount(detail.getAmountCrLoc());
 			auditProecessDTO.setReceivableAmount(detail.getAmountDrLoc());

+ 48 - 3
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/controller/FinanceStatisticsController.java

@@ -10,16 +10,20 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
-import org.springblade.los.statisticAnalysis.DecisionAnalysis;
-import org.springblade.los.statisticAnalysis.FinanceProfit;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.los.statisticAnalysis.*;
 import org.springblade.los.statisticAnalysis.service.IStatisticAnalysisService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
 /**
  * @author :jixinyuan
  * @date : 2023/11/29
@@ -33,7 +37,6 @@ public class FinanceStatisticsController {
 	private final IStatisticAnalysisService statisticAnalysisService;
 
 
-
 	/**
 	 * 分页 决策分析列表
 	 */
@@ -44,4 +47,46 @@ public class FinanceStatisticsController {
 		return statisticAnalysisService.financeProfit(financeProfit, Condition.getPage(query));
 	}
 
+	/**
+	 * 分页 应收(付)实收(付)汇总
+	 */
+	@GetMapping("/feeSummary")
+	public R<IPage<FeeSummaryRD>> feeSummary(FeeSummaryQ feeSummaryQ, Query query) {
+		return statisticAnalysisService.feeSummary(feeSummaryQ, Condition.getPage(query));
+	}
+
+	/**
+	 *  应收(付)实收(付)汇总
+	 */
+	@GetMapping("/feeSummaryExport")
+	public void feeSummaryExport(FeeSummaryQ feeSummaryQ, HttpServletResponse response) {
+		List<FeeSummaryRD> list = statisticAnalysisService.feeSummaryExport(feeSummaryQ);
+		if ("D".equals(feeSummaryQ.getDc())) {
+			ExcelUtil.export(response, "应收实收汇总表", "应收实收汇总表", list, FeeSummaryRD.class);
+		} else {
+			ExcelUtil.export(response, "应付实付汇总表", "应付实付汇总表", BeanUtil.copy(list, FeeSummaryRC.class), FeeSummaryRC.class);
+		}
+	}
+
+	/**
+	 * 分页 应收(付)实收(付)汇总
+	 */
+	@GetMapping("/feeSummaryDetail")
+	public R<IPage<FeeSummaryDetailRD>> feeSummaryDetail(FeeSummaryQ feeSummaryQ, Query query) {
+		return statisticAnalysisService.feeSummaryDetail(feeSummaryQ, Condition.getPage(query));
+	}
+
+	/**
+	 *  应收(付)实收(付)汇总
+	 */
+	@GetMapping("/feeSummaryDetailExport")
+	public void feeSummaryDetailExport(FeeSummaryQ feeSummaryQ, HttpServletResponse response) {
+		List<FeeSummaryDetailRD> list = statisticAnalysisService.feeSummaryDetailExport(feeSummaryQ);
+		if ("D".equals(feeSummaryQ.getDc())) {
+			ExcelUtil.export(response, "应收实收明细表", "应收实收明细表", list, FeeSummaryDetailRD.class);
+		} else {
+			ExcelUtil.export(response, "应付实付明细表", "应付实付明细表", BeanUtil.copy(list, FeeSummaryDetailRC.class), FeeSummaryDetailRC.class);
+		}
+	}
+
 }

+ 9 - 2
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/IStatisticAnalysisService.java

@@ -18,8 +18,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.DecisionAnalysis;
-import org.springblade.los.statisticAnalysis.FinanceProfit;
+import org.springblade.los.statisticAnalysis.*;
 
 import java.util.List;
 import java.util.Map;
@@ -54,4 +53,12 @@ public interface IStatisticAnalysisService {
 	R<Map<String, Object>> completionRate(String dateStart, String dateEnd);
 
 	R<List<Map<String, Object>>> trend(String date, String type);
+
+	R<IPage<FeeSummaryRD>> feeSummary(FeeSummaryQ feeSummaryQ, IPage<FeeSummaryRD> page);
+
+	List<FeeSummaryRD> feeSummaryExport(FeeSummaryQ feeSummaryQ);
+
+	R<IPage<FeeSummaryDetailRD>> feeSummaryDetail(FeeSummaryQ feeSummaryQ, IPage<FeeSummaryDetailRD> page);
+
+	List<FeeSummaryDetailRD> feeSummaryDetailExport(FeeSummaryQ feeSummaryQ);
 }

+ 24 - 3
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -17,13 +17,14 @@ import org.springblade.los.business.customsDeclaration.mapper.CustomsDeclaration
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.mapper.BillsMapper;
 import org.springblade.los.finance.fee.entity.FeeCenter;
+import org.springblade.los.finance.fee.entity.FinAccBills;
 import org.springblade.los.finance.fee.mapper.FeeCenterMapper;
+import org.springblade.los.finance.fee.mapper.FinAccBillsMapper;
 import org.springblade.los.finance.invoices.entity.FinInvoices;
 import org.springblade.los.finance.invoices.mapper.FinInvoicesMapper;
 import org.springblade.los.finance.stl.entity.FinStlBills;
 import org.springblade.los.finance.stl.mapper.FinStlBillsMapper;
-import org.springblade.los.statisticAnalysis.DecisionAnalysis;
-import org.springblade.los.statisticAnalysis.FinanceProfit;
+import org.springblade.los.statisticAnalysis.*;
 import org.springblade.los.statisticAnalysis.service.IStatisticAnalysisService;
 import org.springframework.stereotype.Service;
 
@@ -31,7 +32,6 @@ import java.math.BigDecimal;
 import java.math.MathContext;
 import java.math.RoundingMode;
 import java.text.DateFormat;
-import java.text.NumberFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -53,6 +53,7 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 	private final IBCurrencyService bCurrencyService;
 	private final FinStlBillsMapper finStlBillsMapper;
 	private final FinInvoicesMapper finInvoicesMapper;
+	private final FinAccBillsMapper finAccBillsMapper;
 
 	private final IDeptUtils deptUtils;
 
@@ -637,4 +638,24 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			return R.fail("参数错误");
 		}
 	}
+
+	@Override
+	public R<IPage<FeeSummaryRD>> feeSummary(FeeSummaryQ feeSummaryQ, IPage<FeeSummaryRD> page) {
+		return R.data(page.setRecords(finAccBillsMapper.feeSummary(page,feeSummaryQ)));
+	}
+
+	@Override
+	public List<FeeSummaryRD> feeSummaryExport(FeeSummaryQ feeSummaryQ) {
+		return finAccBillsMapper.feeSummaryExport(feeSummaryQ);
+	}
+
+	@Override
+	public R<IPage<FeeSummaryDetailRD>> feeSummaryDetail(FeeSummaryQ feeSummaryQ, IPage<FeeSummaryDetailRD> page) {
+		return R.data(page.setRecords(finAccBillsMapper.feeSummaryDetail(page,feeSummaryQ)));
+	}
+
+	@Override
+	public List<FeeSummaryDetailRD> feeSummaryDetailExport(FeeSummaryQ feeSummaryQ) {
+		return finAccBillsMapper.feeSummaryDetailExport(feeSummaryQ);
+	}
 }