|
|
@@ -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;
|
|
|
}
|
|
|
}
|