Browse Source

业绩目标收款类型或明细为空时查询报错修复

hu 1 year ago
parent
commit
6cba0a6dc1

+ 3 - 0
src/custom/restcontroller/sale/salestarget/enterprise.java

@@ -182,6 +182,9 @@ public class enterprise extends Controller {
                         if(!((JSONArray)jsonObjectResult.get("mx")).isEmpty()){
                             stringBuffer.append(" or subclass in"+ jsonObjectResult.get("mx"));
                         }
+                        if(((JSONArray)jsonObjectResult.get("mx")).isEmpty() && ((JSONArray)jsonObjectResult.get("type")).isEmpty()){
+                            stringBuffer.append(" 1=1 ");
+                        }
                         where1= where1+ " and ("+(stringBuffer.toString()).replaceFirst("or", "")+")";
                         where1 = where1.replace("[", "(").replace("]", ")");
                     }

+ 3 - 0
src/custom/restcontroller/webmanage/sale/salestarget/enterprisetarget.java

@@ -344,6 +344,9 @@ public class enterprisetarget extends Controller {
                         if(!((JSONArray)jsonObjectResult.get("mx")).isEmpty()){
                             stringBuffer.append(" or subclass in"+ jsonObjectResult.get("mx"));
                         }
+                        if(((JSONArray)jsonObjectResult.get("mx")).isEmpty() && ((JSONArray)jsonObjectResult.get("type")).isEmpty()){
+                            stringBuffer.append(" 1=1 ");
+                        }
                         where1= where1+ " and ("+(stringBuffer.toString()).replaceFirst("or", "")+")";
                         where1 = where1.replace("[", "(").replace("]", ")");
                     }

+ 9 - 0
src/custom/restcontroller/webmanage/sale/salestarget/personnelstatistics.java

@@ -314,6 +314,9 @@ public class personnelstatistics extends Controller {
                         if(!((JSONArray)jsonObjectResult.get("mx")).isEmpty()){
                             stringBuffer.append(" or t1.subclass in"+ jsonObjectResult.get("mx"));
                         }
+                        if(((JSONArray)jsonObjectResult.get("mx")).isEmpty() && ((JSONArray)jsonObjectResult.get("type")).isEmpty()){
+                            stringBuffer.append(" 1=1 ");
+                        }
                         where1= where1+ " and ("+(stringBuffer.toString()).replaceFirst("or", "")+")";
                         where1 = where1.replace("[", "(").replace("]", ")");
                     }
@@ -589,6 +592,9 @@ public class personnelstatistics extends Controller {
                         if(!((JSONArray)jsonObjectResult.get("mx")).isEmpty()){
                             stringBuffer.append(" or t1.subclass in"+ jsonObjectResult.get("mx"));
                         }
+                        if(((JSONArray)jsonObjectResult.get("mx")).isEmpty() && ((JSONArray)jsonObjectResult.get("type")).isEmpty()){
+                            stringBuffer.append(" 1=1 ");
+                        }
                         where1= where1+ " and ("+(stringBuffer.toString()).replaceFirst("or", "")+")";
                         where1 = where1.replace("[", "(").replace("]", ")");
                     }
@@ -838,6 +844,9 @@ public class personnelstatistics extends Controller {
                         if(!((JSONArray)jsonObjectResult.get("mx")).isEmpty()){
                             stringBuffer.append(" or t1.subclass in"+ jsonObjectResult.get("mx"));
                         }
+                        if(((JSONArray)jsonObjectResult.get("mx")).isEmpty() && ((JSONArray)jsonObjectResult.get("type")).isEmpty()){
+                            stringBuffer.append(" 1=1 ");
+                        }
                         where1= where1+ " and ("+(stringBuffer.toString()).replaceFirst("or", "")+")";
                         where1 = where1.replace("[", "(").replace("]", ")");
                     }