Quellcode durchsuchen

添加查询条件

hu vor 3 Jahren
Ursprung
Commit
5cd4d55664

+ 11 - 0
src/custom/restcontroller/webmanage/sale/promotion/promotionItems.java

@@ -41,6 +41,17 @@ public class promotionItems extends Controller {
                         + whereObject.getString("condition") + "%'" + ")";
             }
 
+            if (whereObject.containsKey("tradefield") && !whereObject.getJSONArray("tradefield").isEmpty()) {
+                String where2 =" 1=1 ";
+                if ( whereObject.getJSONArray("tradefield").size() > 0) {
+                    for (Object object:whereObject.getJSONArray("tradefield")) {
+                        String str = String.valueOf(object);
+                        where2=where2 +" or tradefield ='"+str+"' ";
+                    }
+                }
+                where=where+("and t1.itemid in (SELECT itemid from plm_item_tradefield WHERE ("+where2+") and siteid = '"+siteid+"')");
+            }
+
         }
         JSONArray itemclassids = content.getJSONArray("itemclassids");
         if (itemclassids.size() > 0) {

+ 21 - 21
src/custom/utility/ERPDocking.java

@@ -20,32 +20,32 @@ public class ERPDocking {
     public static boolean loginstatus = false;
 
     public ERPDocking() {
-        try {
-            login();
-        } catch (YosException e) {
-            System.err.println(e.getMessage());
-        }
+//        try {
+//            login();
+//        } catch (YosException e) {
+//            System.err.println(e.getMessage());
+//        }
     }
 
     /*
     crm登陆
      */
-    private void login() throws YosException {
-        if (!loginstatus) {
-            /*
-            自动保存cookie
-             */
-            CookieManager manager = new CookieManager();
-            CookieHandler.setDefault(manager);
-            String s = new WebRequest().doPost("username=yosAdmin&password=yosAdmin123", "http://crm.meida.com/dmsService/ext/partner/login");
-            JSONObject object = JSONObject.parseObject(s);
-            if (object.getIntValue("code") == 1) {
-                loginstatus = true;
-            } else {
-                loginstatus = false;
-            }
-        }
-    }
+//    private void login() throws YosException {
+//        if (!loginstatus) {
+//            /*
+//            自动保存cookie
+//             */
+//            CookieManager manager = new CookieManager();
+//            CookieHandler.setDefault(manager);
+//            String s = new WebRequest().doPost("username=yosAdmin&password=yosAdmin123", "http://crm.meida.com/dmsService/ext/partner/login");
+//            JSONObject object = JSONObject.parseObject(s);
+//            if (object.getIntValue("code") == 1) {
+//                loginstatus = true;
+//            } else {
+//                loginstatus = false;
+//            }
+//        }
+//    }
 
     /**
      * crm账号批量查询