Browse Source

1.收付,未收付明细统计列表,导入接口增加分组条件
2.amend报表打印接口获取数据bug修改

纪新园 7 months ago
parent
commit
d0d077354d

+ 3 - 1
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FeeSummaryQ.java

@@ -15,7 +15,7 @@ public class FeeSummaryQ {
 	 */
 	private String dc;
 	/**
-	 * 查询方式  1=结算单位 2 委托人  3 业务来源
+	 * 查询方式  1=结算单位 2 委托人  3 提单号
 	 */
 	private String type;
 	/**
@@ -71,4 +71,6 @@ public class FeeSummaryQ {
 	private String billNo;
 	private String mblNo;
 
+	private String sortType;
+
 }

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

@@ -3675,6 +3675,8 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 					}
 				}
 				map.put(MagicValues.DATA, list);
+			}else {
+				map.put(MagicValues.DATA, null);
 			}
 		} else {
 			// 默认取单据数据,包括主表、预配箱、配箱、费用
@@ -6036,16 +6038,27 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 									amountDr = amountDr.add(feeCenterReports1.getAmountD());
 									amountDrUsd = amountDrUsd.add(feeCenterReports1.getAmountUsdD());
 								}
-								FeeCenterReports feeCenterC = feeCenterReportsC.stream().filter(e -> e.getFeeCnName().equals(fee.getFeeCnName())
-									&&  !"1".equals(e.getMark())).distinct().findFirst().orElse(null);
-								if (feeCenterC != null) {
+								List<FeeCenterReports> feeCenterC = feeCenterReportsC.stream().filter(e -> e.getFeeCnName().equals(fee.getFeeCnName())
+										&&  !"1".equals(e.getMark())).collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+										Comparator.comparing(f -> f.getFeeCnName() + f.getBillCorpCnName()))), ArrayList::new));
+								if (!feeCenterC.isEmpty()){
+									for (FeeCenterReports itemC : feeCenterC){
+										itemC.setMark("1");
+										countC++;
+									}
+									feeCenterReports1.setCorpCnName(feeCenterC.get(0).getCorpCnName());
+									feeCenterReports1.setAmountC(feeCenterC.stream().map(FeeCenterReports::getAmountC).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+									feeCenterReports1.setAmountLocC(feeCenterC.stream().map(FeeCenterReports::getAmountLocC).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+									feeCenterReports1.setAmountUsdC(feeCenterC.stream().map(FeeCenterReports::getAmountUsdC).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add));
+								}
+								/*if (feeCenterC != null) {
 									feeCenterC.setMark("1");
 									feeCenterReports1.setCorpCnName(StringUtils.hasText(feeCenterC.getCorpCnName())? feeCenterC.getCorpCnName() : "");
 									feeCenterReports1.setAmountC(feeCenterC.getAmountC() == null ? BigDecimal.ZERO : feeCenterC.getAmountC());
 									feeCenterReports1.setAmountLocC(feeCenterC.getAmountLocC() == null ? BigDecimal.ZERO : feeCenterC.getAmountLocC());
 									feeCenterReports1.setAmountUsdC(feeCenterC.getAmountUsdC() == null ? BigDecimal.ZERO : feeCenterC.getAmountUsdC());
 									countC++;
-								}
+								}*/
 								feeCenterReports.add(feeCenterReports1);
 							}
 							if (!feeCenterReportsNewC.isEmpty()){
@@ -6089,26 +6102,28 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								feeCenterReports1.setReportType(fee.getReportType());
 								feeCenterReports1.setDc(fee.getDc());
 								if (feeReports != null) {
-									if ((ObjectUtils.isNotNull(feeReports.getAmountD()) && feeReports.getAmountD().compareTo(new BigDecimal("0.00")) != 0)
-										|| (ObjectUtils.isNotNull(feeReports.getAmountUsdD()) && feeReports.getAmountUsdD().compareTo(new BigDecimal("0.00")) != 0)
-									) {
-										feeCenterReports1.setBillCorpCnName(feeReports.getBillCorpCnName());
-										feeCenterReports1.setAmountD(feeReports.getAmountD());
-										feeCenterReports1.setAmountLocD(feeReports.getAmountLocD());
-										feeCenterReports1.setAmountUsdD(feeReports.getAmountUsdD());
-										amountDr = amountDr.add(ObjectUtils.isNotNull(feeReports.getAmountD()) ? feeReports.getAmountD() : new BigDecimal("0.00"));
-										amountDrUsd = amountDrUsd.add(ObjectUtils.isNotNull(feeReports.getAmountUsdD()) ? feeReports.getAmountUsdD() : new BigDecimal("0.00"));
-									}
-
-									if ((ObjectUtils.isNotNull(feeReports.getAmountC()) && feeReports.getAmountC().compareTo(new BigDecimal("0.00")) != 0)
-										|| (ObjectUtils.isNotNull(feeReports.getAmountUsdC()) && feeReports.getAmountUsdC().compareTo(new BigDecimal("0.00")) != 0)
-									) {
-										feeCenterReports1.setCorpCnName(feeReports.getCorpCnName());
-										feeCenterReports1.setAmountC(feeReports.getAmountC());
-										feeCenterReports1.setAmountLocC(feeReports.getAmountLocC());
-										feeCenterReports1.setAmountUsdC(feeReports.getAmountUsdC());
-										amountCr = amountCr.add(ObjectUtils.isNotNull(feeReports.getAmountC()) ? feeReports.getAmountC() : new BigDecimal("0.00"));
-										amountCrUsd = amountCrUsd.add(ObjectUtils.isNotNull(feeReports.getAmountUsdC()) ? feeReports.getAmountUsdC() : new BigDecimal("0.00"));
+									if("D".equals(feeReports.getDc())){
+										if ((ObjectUtils.isNotNull(feeReports.getAmountD()) && feeReports.getAmountD().compareTo(new BigDecimal("0.00")) != 0)
+											|| (ObjectUtils.isNotNull(feeReports.getAmountUsdD()) && feeReports.getAmountUsdD().compareTo(new BigDecimal("0.00")) != 0)
+										) {
+											feeCenterReports1.setBillCorpCnName(feeReports.getBillCorpCnName());
+											feeCenterReports1.setAmountD(feeReports.getAmountD());
+											feeCenterReports1.setAmountLocD(feeReports.getAmountLocD());
+											feeCenterReports1.setAmountUsdD(feeReports.getAmountUsdD());
+											amountDr = amountDr.add(ObjectUtils.isNotNull(feeReports.getAmountD()) ? feeReports.getAmountD() : new BigDecimal("0.00"));
+											amountDrUsd = amountDrUsd.add(ObjectUtils.isNotNull(feeReports.getAmountUsdD()) ? feeReports.getAmountUsdD() : new BigDecimal("0.00"));
+										}
+									}else{
+										if ((ObjectUtils.isNotNull(feeReports.getAmountC()) && feeReports.getAmountC().compareTo(new BigDecimal("0.00")) != 0)
+											|| (ObjectUtils.isNotNull(feeReports.getAmountUsdC()) && feeReports.getAmountUsdC().compareTo(new BigDecimal("0.00")) != 0)
+										) {
+											feeCenterReports1.setCorpCnName(feeReports.getCorpCnName());
+											feeCenterReports1.setAmountC(feeReports.getAmountC());
+											feeCenterReports1.setAmountLocC(feeReports.getAmountLocC());
+											feeCenterReports1.setAmountUsdC(feeReports.getAmountUsdC());
+											amountCr = amountCr.add(ObjectUtils.isNotNull(feeReports.getAmountC()) ? feeReports.getAmountC() : new BigDecimal("0.00"));
+											amountCrUsd = amountCrUsd.add(ObjectUtils.isNotNull(feeReports.getAmountUsdC()) ? feeReports.getAmountUsdC() : new BigDecimal("0.00"));
+										}
 									}
 								}
 								feeCenterReports.add(feeCenterReports1);

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

@@ -421,19 +421,15 @@
                 and acc.approved_date &lt;= #{fee.etdEnd}
             </if>
         </if>
-     <!--   <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+        <if test='fee.sortType != null and fee.sortType != "" and fee.sortType == "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 test='fee.sortType != null and fee.sortType != "" and fee.sortType == "3"'>
+            GROUP BY acc.mblno
         </if>
-        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
-            GROUP BY acc.src_id
+        <if test='fee.sortType == null or fee.sortType == ""'>
+            GROUP BY acc.mblno
         </if>
-        <if test='fee.type == null or fee.type == ""'>
-            GROUP BY acc.id
-        </if>-->
-        GROUP BY acc.id
         ORDER BY acc.corp_id
     </select>
     <select id="feeSummaryDetailExport" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailRD">
@@ -523,19 +519,15 @@
                 and acc.approved_date &lt;= #{fee.etdEnd}
             </if>
         </if>
-       <!-- <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+        <if test='fee.sortType != null and fee.sortType != "" and fee.sortType == "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 test='fee.sortType != null and fee.sortType != "" and fee.sortType == "3"'>
+            GROUP BY acc.mblno
         </if>
-        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
-            GROUP BY acc.src_id
+        <if test='fee.sortType == null or fee.sortType == ""'>
+            GROUP BY acc.mblno
         </if>
-        <if test='fee.type == null or fee.type == ""'>
-            GROUP BY acc.id
-        </if>-->
-        GROUP BY acc.id
         ORDER BY acc.corp_id
     </select>
     <select id="feeSummaryDetailNot" resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailNotRD">
@@ -625,19 +617,15 @@
                 and acc.approved_date &lt;= #{fee.etdEnd}
             </if>
         </if>
-      <!--  <if test='fee.type != null and fee.type != "" and fee.type == "1"'>
+        <if test='fee.sortType != null and fee.sortType != "" and fee.sortType == "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 test='fee.sortType != null and fee.sortType != "" and fee.sortType == "3"'>
+            GROUP BY acc.mblno
         </if>
-        <if test='fee.type != null and fee.type != "" and fee.type == "3"'>
-            GROUP BY acc.src_id
+        <if test='fee.sortType == null or fee.sortType == ""'>
+            GROUP BY acc.mblno
         </if>
-        <if test='fee.type == null or fee.type == ""'>
-            GROUP BY acc.id
-        </if>-->
-        GROUP BY acc.id
         ORDER BY acc.corp_id
     </select>
     <select id="feeSummaryDetailExportNot"
@@ -728,19 +716,15 @@
                 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>
-          <if test='fee.type == null or fee.type == ""'>
-              GROUP BY acc.id
-          </if>-->
-        GROUP BY acc.id
+        <if test='fee.sortType != null and fee.sortType != "" and fee.sortType == "1"'>
+            GROUP BY acc.corp_id
+        </if>
+        <if test='fee.sortType != null and fee.sortType != "" and fee.sortType == "3"'>
+            GROUP BY acc.mblno
+        </if>
+        <if test='fee.sortType == null or fee.sortType == ""'>
+            GROUP BY acc.mblno
+        </if>
         ORDER BY acc.corp_id
     </select>
     <select id="agingAnalysis" resultType="org.springblade.los.statisticAnalysis.AgingAnalysisRD">

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FinAccBillsServiceImpl.java

@@ -151,8 +151,8 @@ public class FinAccBillsServiceImpl extends ServiceImpl<FinAccBillsMapper, FinAc
 			}
 			if ("1".equals(status)) {
 				if (ObjectUtils.isNotNull(item.getPid()) && ObjectUtils.isNotNull(item.getCorpId()) &&
-					ObjectUtils.isNotNull(item.getDc()) && ObjectUtils.isNotNull(item.getFeeId()) && ObjectUtils.isNotNull(item.getCurCode())) {
-					item.setBillKey(item.getPid() + "-" + item.getCorpId() + "-" + item.getDc() + "-" + item.getFeeCode() + "-" + item.getCurCode() + "-" + amountStatus);
+					ObjectUtils.isNotNull(item.getDc()) && ObjectUtils.isNotNull(item.getElementsId()) && ObjectUtils.isNotNull(item.getCurCode())) {
+					item.setBillKey(item.getPid() + "-" + item.getCorpId() + "-" + item.getDc() + "-" + item.getElementsCode() + "-" + item.getCurCode() + "-" + amountStatus);
 				} else {
 					throw new RuntimeException("单据号、单位、费用类型、核算要素不能为空");
 				}