Browse Source

账号修改及指令下发逻辑优化

hu 4 days ago
parent
commit
49351f059a

+ 1 - 35
src/custom/restcontroller/webmanage/sale/wmssend/wmssend.java

@@ -90,41 +90,7 @@ public class wmssend extends Controller {
     public String wmssendout() throws YosException {
         JSONArray st_stockbill_itemsids = content.getJSONArray("st_stockbill_itemsids");
         ArrayList<Long> stockbill_itemsids= (ArrayList<Long>) st_stockbill_itemsids.toJavaList(Long.class);
-        stockbill_itemsids.add(0l);
-        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "st_stockbill_items", "*");
-        querySQL.setTableAlias("t1");
-        querySQL.addJoinTable(JOINTYPE.left, "st_stockbill", "t2", "t1.siteid = t2.siteid and t1.st_stockbillid = t2.st_stockbillid","outplace","billno","billdate");
-        querySQL.addJoinTable(JOINTYPE.left, "plm_item", "t3", "t1.siteid=t3.siteid and t1.itemid=t3.itemid","itemno");
-        querySQL.addJoinTable(JOINTYPE.left, "sa_agents", "t4", "t2.siteid=t4.siteid and t2.sys_enterpriseid=t4.sys_enterpriseid","agentnum");
-        querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t5", "t2.siteid=t5.siteid and t2.sys_enterpriseid=t5.sys_enterpriseid","enterprisename","abbreviation");
-        querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise_contacts", "t6", "t2.siteid=t6.siteid and t2.rec_contactsid=t6.contactsid","name","phonenumber","address");
-
-        querySQL.setSiteid(siteid);
-        querySQL.setWhere("st_stockbill_itemsid",stockbill_itemsids);
-        Rows rows = querySQL.query();
-        JSONArray outplaceList = rows.toJsonArray("outplace",true);
-        for(Object o :outplaceList){
-            String outplace=(String)o;
-            if(StringUtils.isBlank(outplace)){
-                return getErrReturnObject().setErrMsg("发货地不可为空").toString();
-            }
-        }
-        if(outplaceList.size()>1){
-            return getErrReturnObject().setErrMsg("不可同时选择两个发货地").toString();
-        }
-        for(Row row :rows){
-            if(row.getLong("wmsuploadflag")==2){
-                return getErrReturnObject().setErrMsg("存在已下发的记录,请检查").toString();
-            }
-        }
-        if (rows.get(0).getString("outplace").equals("谈桥")) {
-            Wms wms = new Wms();
-            wms.uploadOutStockbilldetail(rows,username);
-        } else if (rows.get(0).getString("outplace").equals("马桥")) {
-            MqWms wms = new MqWms();
-            wms.uploadOutStockbilldetail(rows);
-        }
-
+        beans.wms.Wms.sendOutOrder(this,stockbill_itemsids);
         return getSucReturnObject().toString();
     }
 

+ 1 - 1
src/custom/restcontroller/webmanage/users/users.java

@@ -255,7 +255,7 @@ public class users extends Controller {
             }
 //            SQLFactory deleterole = new SQLFactory("sql:delete from sys_userrole where siteid='" + siteid + "' and userid='" + changeuserid + "' and roleid not in $roleid$");
 //            deleterole.addParameter_in("roleid", roleidslist);
-            sqllist.add("sql:delete from sys_userrole where siteid='" + siteid + "' and userid='" + changeuserid + "' and roleid not in "+roleidslist.toString().replace("[", "(").replace("]", ")"));
+            sqllist.add("delete from sys_userrole where siteid='" + siteid + "' and userid='" + changeuserid + "' and roleid not in "+roleidslist.toString().replace("[", "(").replace("]", ")"));
         }
         String[] oldroleids = dbConnect.runSqlQuery("select roleid from sys_userrole where siteid='" + siteid + "' and userid='" + changeuserid + "' order by roleid").toArray("roleid");