Forráskód Böngészése

出入库单可通过类型多选查询

hu 5 hónapja
szülő
commit
5e0017e28a

+ 12 - 1
src/custom/restcontroller/webmanage/sale/stockbill/stockbill.java

@@ -192,7 +192,18 @@ public class stockbill extends Controller {
                 where.append(")");
             }
             if (whereObject.containsKey("type") && !"".equals(whereObject.getString("type"))) {
-                where.append(" and t1.type ='").append(whereObject.getString("type")).append("' ");
+                JSONArray jsonArray =whereObject.getJSONArray("type");
+                if(!jsonArray.isEmpty()){
+                    StringBuffer str=new StringBuffer("(");
+                    for(Object o :jsonArray){
+                        str.append("'"+(String)o+"',");
+                    }
+                    String result = str.substring(0, str.length() - 1);
+                    result=result+")";
+                    where.append(" and(");
+                    where.append("t1.type in"+result);
+                    where.append(")");
+                }
             }
             if (whereObject.containsKey("typemx") && !"".equals(whereObject.getString("typemx"))) {
                 where.append(" and t1.typemx ='").append(whereObject.getString("typemx")).append("' ");