Browse Source

1.供应商,可以对账单取日期
2.字段名

heqinwei 7 years ago
parent
commit
d2b5ebc32a

+ 19 - 4
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.money.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
@@ -91,7 +92,7 @@ public class MoneyReportServiceImpl implements MoneyReportService {
         List list = null;
         Long companyId = BaseContextHolder.getCompanyId();
         String con = req.getFinalCondition();
-        String cons = this.getDate(con);
+        String cons = this.getDate(req.getCondition());
         String calculateFieldsSql = req.getCalculateFieldsSql();
         JSONArray arr = null;
         if (null == con) {
@@ -197,8 +198,22 @@ public class MoneyReportServiceImpl implements MoneyReportService {
     }
 
     public String getDate(String cons){
-        String date = cons.substring(8, 64);
-        System.out.println("date:" + date);
-        return date;
+        JSONArray jsonArray = JSONArray.parseArray(cons);
+        String con = " 1 = 1";
+        if (null != jsonArray && jsonArray.size() > 0) {
+            StringBuffer finalCondition = new StringBuffer();
+            for (int i = 0; i < jsonArray.size(); i++) {
+                JSONObject jsonObject = (JSONObject) jsonArray.get(i);
+                Object type = jsonObject.get("type");
+                if ("date".equals(type)){
+                    String value = (String) jsonObject.get("value");
+                    System.out.println("value" + value);
+                    value = value.replace(",", "' and '");
+                    con =  " a.sl_date between '" + value + "'" ;
+                    System.out.println("con"+con);
+                }
+            }
+        }
+        return con;
     }
 }

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/CustomerCheckViewMapper.xml

@@ -57,7 +57,7 @@
     left join (select sum(sl_amount) as nowamount,sum(sl_preamount) as nowpay,sl_custid,sl_date from subledger where sl_kind !='期初余额'
     group by sl_custid,sl_date) b
     on a.sl_custid=b.sl_custid
-    where a.sl_custid=#{sl_custid} and a.sl_date ${cons} and a.companyid = #{companyId} limit 1
+    where a.sl_custid=#{sl_custid} and ${cons} and a.companyid = #{companyId} limit 1
   </select>
 
     <select id="getId" resultType="java.lang.Integer">

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/VendorAcountViewMapper.xml

@@ -60,7 +60,7 @@
     left join (select sum(sl_amount) as nowamount,sum(sl_preamount) as nowpay,sl_vendid,sl_date from subledger where sl_kind !='期初余额'
     group by sl_vendid,sl_date) b
     on a.sl_vendid=b.sl_vendid
-    where a.sl_vendid=#{sl_vendid} and a.sl_date ${cons} and a.companyid = #{companyId} limit 1
+    where a.sl_vendid=#{sl_vendid} and ${cons} and a.companyid = #{companyId} limit 1
   </select>
 
   <select id="getId" resultType="java.lang.Integer">

+ 3 - 3
frontend/saas-web/app/view/money/report/CustomerCheck.js

@@ -141,19 +141,19 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
         width: 0,
         summaryType: 'cus',
     }, {
-        text: '本期发生',
+        text: '增加应收',
         dataIndex: 'nowamount',
         hidden: true,
         width: 0,
         summaryType: 'cus',
     }, {
-        text: '本期收款',
+        text: '增加预收',
         dataIndex: 'nowpay',
         hidden: true,
         width: 0,
         summaryType: 'cus',
     }, {
-        text: '本期结余',
+        text: '应收余额',
         dataIndex: 'nowbalance',
         hidden: true,
         width: 0,

+ 3 - 3
frontend/saas-web/app/view/money/report/VendorCheck.js

@@ -149,19 +149,19 @@ Ext.define('saas.view.money.report.VendorCheck', {
         width: 0,
         summaryType: 'cus',
     }, {
-        text: '本期发生',
+        text: '增加应付',
         dataIndex: 'nowamount',
         hidden: true,
         width: 0,
         summaryType: 'cus',
     }, {
-        text: '本期付款',
+        text: '增加预付',
         dataIndex: 'nowpay',
         hidden: true,
         width: 0,
         summaryType: 'cus',
     }, {
-        text: '本期结余',
+        text: '应付余额',
         dataIndex: 'nowbalance',
         hidden: true,
         width: 0,