Selaa lähdekoodia

回款对账单:接口改为销售出库单和收款单数据。

ht 1 kuukausi sitten
vanhempi
commit
c9d2a551ee

+ 1 - 3
mjava-jinlun/src/main/java/com/malk/jinlun/service/impl/JinlunTaskServiceImpl.java

@@ -1089,7 +1089,7 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
             startRow += limit;
         }while (result.size() == limit);
 
-        System.out.println("1111");
+        System.out.println("查询数据长度:"+list.toArray().length);
 
         for (Map map : list) {
             Map body = new HashMap();
@@ -1192,8 +1192,6 @@ public class JinlunTaskServiceImpl implements JinlunTaskService {
                 //云枢新增销售出库单
                 Map result3 = cpClient.createCpBo(schemaCode, body,null);
             }
-
-            //核销后更新应收单已核销金额,累加
         }
 
 

+ 81 - 21
mjava-jinlun/src/main/resources/mapper/JinlunMapper.xml

@@ -4,30 +4,90 @@
 <mapper namespace="com.malk.jinlun.mapper.JinlunMapper">
 
 
+<!--    <select id="getCustomerDzmx" resultType="java.util.Map">-->
+<!--        SELECT-->
+<!--            客户, 单据编号, 业务日期, 性能, 规格, 数量, 重量, 计价单价, 税率, 价税合计, 回款金额, NULL AS "往期欠款", 备注-->
+<!--        FROM (-->
+<!--                 &#45;&#45; 暂估应收数据-->
+<!--                 SELECT-->
+<!--                     t1.ShortText1760602119316 AS "客户",-->
+<!--                     t1.ShortText1760602123650 AS "单据编号",-->
+<!--                     t1.Date1760602205733 AS "业务日期",-->
+<!--                     t2.Text1760602314150 AS "性能",-->
+<!--                     t2.Text1760602292846 AS "规格",-->
+<!--                     t2.Number1762915279108 AS "数量",-->
+<!--                     t2.Number1762915289424 AS "重量",-->
+<!--                     t2.Number1760602330651 AS "计价单价",-->
+<!--                     t2.Number1760602343876 AS "税率",-->
+<!--                     t2.Number1760602359012 AS "价税合计",-->
+<!--                     NULL AS "回款金额",-->
+<!--                     t2.Text1760602391849 AS "备注"-->
+<!--                 FROM i940k_ysd t1-->
+<!--                          LEFT JOIN i940k_sheet1760602277185 t2 ON t1.id = t2.parentId-->
+<!--                 WHERE t1.ShortText1760602147441 = '暂估应收'-->
+<!--                   AND t1.ShortText1760602123650 NOT LIKE '%-%'-->
+<!--                   AND t1.Date1760602205733 between #{start_date} and #{end_date}-->
+<!--                   AND t1.ShortText1760602119316 = #{customer}-->
+
+<!--                 UNION ALL-->
+
+<!--                 &#45;&#45; 回款数据-->
+<!--                 SELECT-->
+<!--                     t1.ShortText1760585132200 AS "客户",-->
+<!--                     t1.ShortText1760585125989 AS "单据编号",-->
+<!--                     t1.Date1760585187315 AS "业务日期",-->
+<!--                     NULL AS "性能",-->
+<!--                     NULL AS "规格",-->
+<!--                     NULL AS "数量",-->
+<!--                     NULL AS "重量",-->
+<!--                     NULL AS "计价单价",-->
+<!--                     NULL AS "税率",-->
+<!--                     NULL AS "价税合计",-->
+<!--                     t2.Number1760585242849 AS "回款金额",-->
+<!--                     t2.ShortText1760585258640 AS "备注"-->
+<!--                 FROM i940k_skd t1-->
+<!--                          LEFT JOIN i940k_sheet1760585205663 t2 ON t1.id = t2.parentId-->
+<!--                 WHERE t1.Date1760585187315 between #{start_date} and #{end_date}-->
+<!--                   AND t1.ShortText1760585132200 = #{customer}-->
+<!--                 &#45;&#45; 多个客户时用:AND FIND_IN_SET(t1.ShortText1760585132200, @target_customers) > 0-->
+<!--             ) data-->
+<!--        ORDER BY 业务日期,单据编号,性能  &#45;&#45; 同一天内应收行在前,回款行在后-->
+<!--    </select>-->
     <select id="getCustomerDzmx" resultType="java.util.Map">
         SELECT
-            客户, 单据编号, 业务日期, 性能, 规格, 数量, 重量, 计价单价, 税率, 价税合计, 回款金额, NULL AS "往期欠款", 备注
+            客户,
+            单据编号,
+            业务日期,
+            性能,
+            规格,
+            数量,
+            重量,
+            计价单价,
+            税率,
+            价税合计,
+            回款金额,
+            NULL AS "往期欠款",
+            备注
         FROM (
-                 -- 暂估应收数据
+                 -- 销售出库单数据
                  SELECT
-                     t1.ShortText1760602119316 AS "客户",
-                     t1.ShortText1760602123650 AS "单据编号",
-                     t1.Date1760602205733 AS "业务日期",
-                     t2.Text1760602314150 AS "性能",
-                     t2.Text1760602292846 AS "规格",
-                     t2.Number1762915279108 AS "数量",
-                     t2.Number1762915289424 AS "重量",
-                     t2.Number1760602330651 AS "计价单价",
-                     t2.Number1760602343876 AS "税率",
-                     t2.Number1760602359012 AS "价税合计",
+                     t1.ShortText1760153707273 AS "客户",
+                     t1.ShortText1760153678207 AS "单据编号",
+                     t1.Date1760153694040 AS "业务日期",
+                     t2.Text1762245901183 AS "性能",
+                     <!--t2.Text1760153786986 AS "规格",-->
+                     t2.Text1760153778635 AS "规格",
+                     t2.Number1762509492431 AS "数量",
+                     t2.Number1762509515885 AS "重量",
+                     t2.Number1760154006703 AS "计价单价",
+                     t2.Number1762225120251 AS "税率",
+                     t2.Number1760154039959 AS "价税合计",
                      NULL AS "回款金额",
-                     t2.Text1760602391849 AS "备注"
-                 FROM i940k_ysd t1
-                          LEFT JOIN i940k_sheet1760602277185 t2 ON t1.id = t2.parentId
-                 WHERE t1.ShortText1760602147441 = '暂估应收'
-                   AND t1.ShortText1760602123650 NOT LIKE '%-%'
-                   AND t1.Date1760602205733 between #{start_date} and #{end_date}
-                   AND t1.ShortText1760602119316 = #{customer}
+                     t2.ShortText1760154066042 AS "备注"
+                 FROM i940k_xsckd t1
+                          LEFT JOIN i940k_sheet1760153734916 t2 ON t1.id = t2.parentId
+                 WHERE t1.Date1760153694040 between #{start_date} and #{end_date}
+                   AND t1.ShortText1760153707273 = #{customer}
 
                  UNION ALL
 
@@ -49,10 +109,10 @@
                           LEFT JOIN i940k_sheet1760585205663 t2 ON t1.id = t2.parentId
                  WHERE t1.Date1760585187315 between #{start_date} and #{end_date}
                    AND t1.ShortText1760585132200 = #{customer}
-                 -- 多个客户时用:AND FIND_IN_SET(t1.ShortText1760585132200, @target_customers) > 0
              ) data
-        ORDER BY 业务日期,单据编号,性能  -- 同一天内应收行在前,回款行在后
+        ORDER BY 业务日期, 单据编号, 性能
     </select>
+
     <select id="getCustomerWqqk" resultType="java.util.Map">
         SELECT
         COALESCE(receivable.amount, 0) AS '往期应付',