|
@@ -366,6 +366,60 @@ public class databoard extends Controller {
|
|
|
jsonArray.add(jsonObject);
|
|
|
|
|
|
//回款
|
|
|
+ Rows siteparameterrows = dbConnect.runSqlQuery("select statisticsrule_account,statisticsrule_type,statisticsrule_typemx from sys_site_parameter where siteid='"+siteid+"'");
|
|
|
+ JSONArray statisticsrule_account=new JSONArray();
|
|
|
+ JSONArray statisticsrule_type=new JSONArray();
|
|
|
+ JSONArray statisticsrule_typemx=new JSONArray();
|
|
|
+ if(siteparameterrows.isNotEmpty()){
|
|
|
+ statisticsrule_account=siteparameterrows.get(0).getJSONArray("statisticsrule_account");
|
|
|
+ statisticsrule_type=siteparameterrows.get(0).getJSONArray("statisticsrule_type");
|
|
|
+ statisticsrule_typemx=siteparameterrows.get(0).getJSONArray("statisticsrule_typemx");
|
|
|
+ }
|
|
|
+ if(!statisticsrule_account.isEmpty()){
|
|
|
+ StringBuffer str=new StringBuffer("(");
|
|
|
+ for(Object o :statisticsrule_account){
|
|
|
+ str.append("'"+(String)o+"',");
|
|
|
+ }
|
|
|
+ String result = str.substring(0, str.length() - 1);
|
|
|
+ result=result+")";
|
|
|
+ where.append(" and(");
|
|
|
+ where.append("t2.accountname in"+result);
|
|
|
+ where.append(")");
|
|
|
+
|
|
|
+ whereLastYear.append(" and(");
|
|
|
+ whereLastYear.append("t2.accountname in"+result);
|
|
|
+ whereLastYear.append(")");
|
|
|
+ }
|
|
|
+ if(!statisticsrule_type.isEmpty()){
|
|
|
+ StringBuffer str=new StringBuffer("(");
|
|
|
+ for(Object o :statisticsrule_type){
|
|
|
+ str.append("'"+(String)o+"',");
|
|
|
+ }
|
|
|
+ String result = str.substring(0, str.length() - 1);
|
|
|
+ result=result+")";
|
|
|
+ where.append(" and(");
|
|
|
+ where.append("t1.class in"+result);
|
|
|
+ where.append(")");
|
|
|
+
|
|
|
+ whereLastYear.append(" and(");
|
|
|
+ whereLastYear.append("t1.class in"+result);
|
|
|
+ whereLastYear.append(")");
|
|
|
+ }
|
|
|
+ if(!statisticsrule_typemx.isEmpty()){
|
|
|
+ StringBuffer str=new StringBuffer("(");
|
|
|
+ for(Object o :statisticsrule_typemx){
|
|
|
+ str.append("'"+(String)o+"',");
|
|
|
+ }
|
|
|
+ String result = str.substring(0, str.length() - 1);
|
|
|
+ result=result+")";
|
|
|
+ where.append(" and(");
|
|
|
+ where.append("t1.subclass in"+result);
|
|
|
+ where.append(")");
|
|
|
+
|
|
|
+ whereLastYear.append(" and(");
|
|
|
+ whereLastYear.append("t1.subclass in"+result);
|
|
|
+ whereLastYear.append(")");
|
|
|
+ }
|
|
|
jsonObject = new JSONObject();
|
|
|
factory = new SQLFactory(this, "回款统计查询");
|
|
|
factory.addParameter("siteid", siteid);
|
|
@@ -407,6 +461,9 @@ public class databoard extends Controller {
|
|
|
} else {
|
|
|
jsonObject.put("rate", (rows.get(0).getBigDecimal("typestatistics")).divide(sumAmount.multiply(new BigDecimal(100)), 4, BigDecimal.ROUND_HALF_UP));
|
|
|
}
|
|
|
+ jsonObject.put("statisticsrule_account", statisticsrule_account);
|
|
|
+ jsonObject.put("statisticsrule_type", statisticsrule_type);
|
|
|
+ jsonObject.put("statisticsrule_typemx", statisticsrule_typemx);
|
|
|
jsonArray.add(jsonObject);
|
|
|
|
|
|
return getSucReturnObject().setData(jsonArray).toString();
|