瀏覽代碼

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

hu 5 月之前
父節點
當前提交
5e0017e28a
共有 1 個文件被更改,包括 12 次插入1 次删除
  1. 12 1
      src/custom/restcontroller/webmanage/sale/stockbill/stockbill.java

+ 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("' ");