瀏覽代碼

bug修复

hu 1 年之前
父節點
當前提交
462cd7ca9e

+ 25 - 10
src/custom/restcontroller/sale/salestarget/enterprise.java

@@ -121,8 +121,11 @@ public class enterprise extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -139,8 +142,11 @@ public class enterprise extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -152,8 +158,11 @@ public class enterprise extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -165,15 +174,21 @@ public class enterprise extends Controller {
             if(StringUtils.isNotBlank(statisticaldimension)){
                 if(isJSONArray(statisticaldimension)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(statisticaldimension);
-                    where1=where1+" and (class in"+jsonArrayResult+" or subclass in"+jsonArrayResult+")";
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+" and (class in"+jsonArrayResult+" or subclass in"+jsonArrayResult+")";
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);

+ 10 - 4
src/custom/restcontroller/webmanage/sale/salestarget/enterprisetarget.java

@@ -267,15 +267,21 @@ public class enterprisetarget extends Controller {
             if(StringUtils.isNotBlank(statisticaldimension)){
                 if(isJSONArray(statisticaldimension)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(statisticaldimension);
-                    where1=where1+" and (class in"+jsonArrayResult+" or subclass in"+jsonArrayResult+")";
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+" and (class in"+jsonArrayResult+" or subclass in"+jsonArrayResult+")";
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);

+ 74 - 30
src/custom/restcontroller/webmanage/sale/salestarget/personnelstatistics.java

@@ -212,8 +212,11 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -236,8 +239,11 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -254,8 +260,11 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -272,15 +281,21 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(statisticaldimension)){
                 if(isJSONArray(statisticaldimension)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(statisticaldimension);
-                     where1= where1+ " and (t1.class in"+jsonArrayResult+" or t1.subclass in"+jsonArrayResult+")";
-                     where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1= where1+ " and (t1.class in"+jsonArrayResult+" or t1.subclass in"+jsonArrayResult+")";
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t1.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t1.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -447,8 +462,11 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -471,8 +489,11 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -489,8 +510,11 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -507,15 +531,21 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(statisticaldimension)){
                 if(isJSONArray(statisticaldimension)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(statisticaldimension);
-                    where1= where1+ " and (t1.class in"+jsonArrayResult+" or t1.subclass in"+jsonArrayResult+")";
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1= where1+ " and (t1.class in"+jsonArrayResult+" or t1.subclass in"+jsonArrayResult+")";
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t1.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t1.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -674,8 +704,11 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -698,8 +731,11 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -716,8 +752,10 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);
@@ -734,15 +772,21 @@ public class personnelstatistics extends Controller {
             if(StringUtils.isNotBlank(statisticaldimension)){
                 if(isJSONArray(statisticaldimension)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(statisticaldimension);
-                    where1= where1+ " and (t1.class in"+jsonArrayResult+" or t1.subclass in"+jsonArrayResult+")";
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1= where1+ " and (t1.class in"+jsonArrayResult+" or t1.subclass in"+jsonArrayResult+")";
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             if(StringUtils.isNotBlank(sa_accountclassids)){
                 if(isJSONArray(sa_accountclassids)){
                     JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
-                    where1=where1+ " and t1.sa_accountclassid in"+jsonArrayResult;
-                    where1 = where1.replace("[", "(").replace("]", ")");
+                    if(!jsonArrayResult.isEmpty()){
+                        where1=where1+ " and t1.sa_accountclassid in"+jsonArrayResult;
+                        where1 = where1.replace("[", "(").replace("]", ")");
+                    }
+
                 }
             }
             sqlFactory.addParameter_SQL("where1",where1);