沈静伟 2 лет назад
Родитель
Сommit
aa9bfb90eb

+ 3 - 3
src/custom/restcontroller/webmanage/lsak3/aftersalesmag/aftersalesmag.java

@@ -28,12 +28,12 @@ public class aftersalesmag extends Controller {
      */
     @API(title = "获取DRP返退单", apiversion = R.ID20230715093903.v1.class,accesstoken = false)
     public String getAftersalesmag() throws YosException{
-        Rows rows = dbConnect.runSqlQuery("select t2.k3outcode fk3outcode,t1.updatek3flag fupdatek3flag,t1.sa_aftersalesmagid salereturnbillid,t1.billno fbillnum,t1.createby,ifnull(t1.billdate,CURRENT_DATE) fdate,t2.agentnum fagentnum,t1.reason fnotes from sa_aftersalesmag t1 inner join sa_agents t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t1.siteid=t2.siteid where (t1.updatek3flag='0' or t1.updatek3flag='2') and t1.createby !='LSA总0001' and t1.siteid='lsa1986'");
+        Rows rows = dbConnect.runSqlQuery("select t2.k3outcode fk3outcode,t1.updatek3flag fupdatek3flag,t1.sa_aftersalesmagid salereturnbillid,t1.billno fbillnum,t1.createby,ifnull(t1.billdate,CURRENT_DATE) fdate,t2.agentnum fagentnum,t1.reason fnotes from sa_aftersalesmag t1 inner join sa_agents t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t1.siteid=t2.siteid where (t1.updatek3flag='0' or t1.updatek3flag='2') and t1.createby !='LSA总0001' and t1.siteid='lsa'");
         if(rows.isEmpty()) {
             JSONArray array = new JSONArray();
             return array.toString();
         }else{
-            Rows detailRows = dbConnect.runSqlQuery("select t1.sa_aftersalesmagid,t2.k3outcode fk3outcode,t1.sa_aftersalesmag_itemsid salereturnbilldeid,t2.itemno fitemno,t1.qty fqty,t1.price fprice,t1.reason fnotes,t4.billno fsaleissuebillno, t3.rowno fsaleissuebillentryid from sa_aftersalesmag_items t1 inner join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid left join st_stockbill_items t3 on t1.st_stockbill_itemsid=t3.st_stockbill_itemsid and t1.siteid=t3.siteid left join st_stockbill t4 on t3.st_stockbillid=t4.st_stockbillid and t3.siteid=t4.siteid where t1.sa_aftersalesmagid in" + rows.toJsonArray("salereturnbillid").toJSONString().replace("[", "(").replace("]", ")")  + " and t1.siteid='lsa1986'");
+            Rows detailRows = dbConnect.runSqlQuery("select t1.sa_aftersalesmagid,t2.k3outcode fk3outcode,t1.sa_aftersalesmag_itemsid salereturnbilldeid,t2.itemno fitemno,t1.qty fqty,t1.price fprice,t1.reason fnotes,t4.billno fsaleissuebillno, t3.rowno fsaleissuebillentryid from sa_aftersalesmag_items t1 inner join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid left join st_stockbill_items t3 on t1.st_stockbill_itemsid=t3.st_stockbill_itemsid and t1.siteid=t3.siteid left join st_stockbill t4 on t3.st_stockbillid=t4.st_stockbillid and t3.siteid=t4.siteid where t1.sa_aftersalesmagid in" + rows.toJsonArray("salereturnbillid").toJSONString().replace("[", "(").replace("]", ")")  + " and t1.siteid='lsa'");
             RowsMap rowsMap =detailRows.toRowsMap("sa_aftersalesmagid");
             for (Row row : rows) {
                 String salereturnbillid = row.getString("salereturnbillid");
@@ -61,7 +61,7 @@ public class aftersalesmag extends Controller {
         ArrayList<String> sqllist = new ArrayList<>();
         for (Object object:idsarray) {
             String id = (String) object;
-            sqllist.add("update sa_aftersalesmag set updatek3flag='1' where siteid='lsa1986' and  sa_aftersalesmagid=" + id);
+            sqllist.add("update sa_aftersalesmag set updatek3flag='1' where siteid='lsa' and  sa_aftersalesmagid=" + id);
         }
 
         int count =dbConnect.runSqlUpdate(sqllist);

+ 5 - 5
src/custom/restcontroller/webmanage/lsak3/agents/agents.java

@@ -82,13 +82,13 @@ public class agents extends Controller {
             String changedate = content.getString("changedate");
 
 
-            Rows agentsRows = dbConnect.runSqlQuery("select * from sa_agents where siteid='lsa1986' and agentnum ='"+fagentnum+"'");
+            Rows agentsRows = dbConnect.runSqlQuery("select * from sa_agents where siteid='lsa' and agentnum ='"+fagentnum+"'");
             SQLFactory sqlFactory;
             if(agentsRows.isEmpty()){
                 SQLFactory sqlFactory1 = new SQLFactory(this, "企业新增");
                  long sys_enterpriseid=createTableID("sys_enterprise");
                 sqlFactory1.addParameter("sys_enterpriseid",sys_enterpriseid);
-                sqlFactory1.addParameter("siteid","lsa1986");
+                sqlFactory1.addParameter("siteid","lsa");
                 sqlFactory1.addParameter("enterprisename",fagentname);
                 sqlFactory1.addParameter("abbreviation",fagentshortname);
                 sqlFactory1.addParameter("username", createby);
@@ -117,7 +117,7 @@ public class agents extends Controller {
 
                 SQLFactory sqlFactory2 = new SQLFactory(this, "联系人信息新增");
                 long contactsid =createTableID("sys_enterprise_contacts");
-                sqlFactory2.addParameter("siteid", "lsa1986");
+                sqlFactory2.addParameter("siteid", "lsa");
                 sqlFactory2.addParameter("contactsid", contactsid);
                 sqlFactory2.addParameter("sys_enterpriseid", sys_enterpriseid);
                 sqlFactory2.addParameter("name", fcontact);
@@ -146,7 +146,7 @@ public class agents extends Controller {
             }else {
                 SQLFactory sqlFactory1 = new SQLFactory(this, "企业修改");
                 sqlFactory1.addParameter("sys_enterpriseid",agentsRows.get(0).getLong("sys_enterpriseid"));
-                sqlFactory1.addParameter("siteid","lsa1986");
+                sqlFactory1.addParameter("siteid","lsa");
                 sqlFactory1.addParameter("enterprisename",fagentname);
                 sqlFactory1.addParameter("abbreviation",fagentshortname);
                 sqlFactory1.addParameter("username", changeby);
@@ -176,7 +176,7 @@ public class agents extends Controller {
                 sqlFactory.addParameter("sys_enterpriseid", agentsRows.get(0).getLong("sys_enterpriseid"));
                 sqlFactory.addParameter("sa_agentsid",agentsRows.get(0).getLong("sa_agentsid"));
             }
-            sqlFactory.addParameter("siteid","lsa1986");
+            sqlFactory.addParameter("siteid","lsa");
             sqlFactory.addParameter("agentnum",fagentnum);
             sqlFactory.addParameter("createby",createby);
             sqlFactory.addParameter("username",changeby);

+ 28 - 28
src/custom/restcontroller/webmanage/lsak3/cashbill/cashbill.java

@@ -49,8 +49,8 @@ public class cashbill extends Controller {
             // 经销商编号
             String agentnum = content.getString("fagentnum");
             long sys_enterpriseid=0;
-            if(dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa1986' and  agentnum='"+agentnum+"'").isNotEmpty()){
-                sys_enterpriseid=dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa1986' and  agentnum='"+agentnum+"'").get(0).getLong("sys_enterpriseid");
+            if(dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa' and  agentnum='"+agentnum+"'").isNotEmpty()){
+                sys_enterpriseid=dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa' and  agentnum='"+agentnum+"'").get(0).getLong("sys_enterpriseid");
             }else{
                 msg ="yos中不存在【"+agentnum+"】经销商";
                 return  getErrReturnObject().setErrMsg(msg).toString();
@@ -62,8 +62,8 @@ public class cashbill extends Controller {
             // 账户编号
             long sa_accountclassid=0;
             String faccclsnum = content.getString("faccclsnum");
-            if(dbConnect.runSqlQuery("select sa_accountclassid from sa_accountclass where siteid='lsa1986' and  accountno='"+faccclsnum+"'").isNotEmpty()){
-                sa_accountclassid=dbConnect.runSqlQuery("select sa_accountclassid from sa_accountclass where siteid='lsa1986' and  accountno='"+faccclsnum+"'").get(0).getLong("sa_accountclassid");
+            if(dbConnect.runSqlQuery("select sa_accountclassid from sa_accountclass where siteid='lsa' and  accountno='"+faccclsnum+"'").isNotEmpty()){
+                sa_accountclassid=dbConnect.runSqlQuery("select sa_accountclassid from sa_accountclass where siteid='lsa' and  accountno='"+faccclsnum+"'").get(0).getLong("sa_accountclassid");
             }else{
                 msg ="yos中不存在【"+faccclsnum+"】的账户";
                 return  getErrReturnObject().setErrMsg(msg).toString();
@@ -99,7 +99,7 @@ public class cashbill extends Controller {
                     sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
                     sqlFactory.addParameter("sa_accountclassid", sa_accountclassid);
                     sqlFactory.addParameter("type", 1);
-                    sqlFactory.addParameter("siteid", "lsa1986");
+                    sqlFactory.addParameter("siteid", "lsa");
                     sqlFactory.addParameter("remarks", "k3费用"+remarks);
                     sqlFactory.addParameter("amount", amount);
                     sqlFactory.addParameter("subclass", typemx);
@@ -127,14 +127,14 @@ public class cashbill extends Controller {
                     BigDecimal balance = BigDecimal.ZERO;  //当前账户余额
                     Rows rowsaccountbalance = dbConnect.runSqlQuery(
                             "select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='"
-                                    + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                                    + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
 
                     if (rowsaccountbalance.isEmpty()) {
                         SQLFactory accountbalanceaddSqlFactory = new SQLFactory(new Accountbalance(), "营销账户余额新增");
                         accountbalanceaddSqlFactory.addParameter("sa_accountbalanceid", createTableID("sa_accountbalance"));
                         accountbalanceaddSqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
                         accountbalanceaddSqlFactory.addParameter("sa_accountclassid", sa_accountclassid);
-                        accountbalanceaddSqlFactory.addParameter("siteid", "lsa1986");
+                        accountbalanceaddSqlFactory.addParameter("siteid", "lsa");
                         accountbalanceaddSqlFactory.addParameter("balance", amount);
                         accountbalanceaddSqlFactory.addParameter("userid", 1);
                         accountbalanceaddSqlFactory.addParameter("username", "admin");
@@ -144,7 +144,7 @@ public class cashbill extends Controller {
                         BigDecimal newbalance = amount.add(rowsaccountbalance.get(0).getBigDecimal("balance"));
                         sqlList.add("update sa_accountbalance set balance='" + newbalance
                                 + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid
-                                + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                                + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                         balance = newbalance;
                     }
                     sqlFactory.addParameter("balance", balance);
@@ -156,21 +156,21 @@ public class cashbill extends Controller {
                      * DRP存在收入凭证,且中间表状态为审核且不在删除状态时,DRP中需将当前收入凭证先反审核,修改内容后再进行审核
                      */
                     long sa_cashbillid= cashbillRows.get(0).getLong("sa_cashbillid");
-                    Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and  siteid='lsa1986'");
+                    Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and  siteid='lsa'");
 
                     BigDecimal balance = BigDecimal.ZERO;  //当前账户余额
                     if (!rows.isEmpty()) {
                          sys_enterpriseid = rows.get(0).getLong("sys_enterpriseid");
                          sa_accountclassid = rows.get(0).getLong("sa_accountclassid");
-                        Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                        Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                         BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(rows.get(0).getBigDecimal("amount"));
                         balance = newbalance;
-                        sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                        sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                         sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "反审核", "收入凭证反审核成功").getSQL());
                     }
 
                     SQLFactory sqlFactoryupdate = new SQLFactory(this, "收支凭证反审核");
-                    sqlFactoryupdate.addParameter("siteid", "lsa1986");
+                    sqlFactoryupdate.addParameter("siteid", "lsa");
                     sqlFactoryupdate.addParameter("sa_cashbillid", sa_cashbillid);
                     sqlFactoryupdate.addParameter("balance", balance);
                     sqlFactoryupdate.addParameter("updatek3flag", 2);
@@ -185,21 +185,21 @@ public class cashbill extends Controller {
                      * DRP存在收入凭证,且中间表状态为新建或在删除状态时,DRP中需将当前收入凭证先反审核
                      */
                     long sa_cashbillid= cashbillRows.get(0).getLong("sa_cashbillid");
-                    Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and  siteid='lsa1986'");
+                    Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and  siteid='lsa'");
 
                     BigDecimal balance = BigDecimal.ZERO;  //当前账户余额
                     if (!rows.isEmpty()) {
                         sys_enterpriseid = rows.get(0).getLong("sys_enterpriseid");
                         sa_accountclassid = rows.get(0).getLong("sa_accountclassid");
-                        Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                        Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                         BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(rows.get(0).getBigDecimal("amount"));
                         balance = newbalance;
-                        sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                        sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                         sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "反审核", "收入凭证反审核成功").getSQL());
                     }
 
                     SQLFactory sqlFactoryupdate = new SQLFactory(this, "收支凭证反审核");
-                    sqlFactoryupdate.addParameter("siteid", "lsa1986");
+                    sqlFactoryupdate.addParameter("siteid", "lsa");
                     sqlFactoryupdate.addParameter("sa_cashbillid", sa_cashbillid);
                     sqlFactoryupdate.addParameter("balance", balance);
                     sqlFactoryupdate.addParameter("updatek3flag", 2);
@@ -220,7 +220,7 @@ public class cashbill extends Controller {
                     sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
                     sqlFactory.addParameter("sa_accountclassid", sa_accountclassid);
                     sqlFactory.addParameter("type", 0);
-                    sqlFactory.addParameter("siteid", "lsa1986");
+                    sqlFactory.addParameter("siteid", "lsa");
                     sqlFactory.addParameter("remarks", "k3费用"+remarks);
                     sqlFactory.addParameter("amount", amount);
                     sqlFactory.addParameter("subclass", typemx);
@@ -246,7 +246,7 @@ public class cashbill extends Controller {
                     BigDecimal balance = BigDecimal.ZERO;  //当前账户余额
                     Rows rowsaccountbalance = dbConnect.runSqlQuery(
                             "select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='"
-                                    + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                                    + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                     if(rowsaccountbalance.isEmpty()){
                         JSONObject returnObject=new JSONObject();
                         returnObject.put("msg", "账户不存在,支出凭证无法审核");
@@ -254,7 +254,7 @@ public class cashbill extends Controller {
                         return returnObject.toString();
                     }
                     BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(amount);
-                    sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                    sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                     balance = newbalance;
                     sqlFactory.addParameter("balance", balance);
                     sqlFactory.addParameter("updatek3flag", "");
@@ -265,21 +265,21 @@ public class cashbill extends Controller {
                      * DRP存在收入凭证,且中间表状态为审核且不在删除状态时,DRP中需将当前收入凭证先反审核,修改内容后再进行审核
                      */
                     long sa_cashbillid= cashbillRows.get(0).getLong("sa_cashbillid");
-                    Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and  siteid='lsa1986'");
+                    Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and  siteid='lsa'");
 
                     BigDecimal balance = BigDecimal.ZERO;  //当前账户余额
                     if (!rows.isEmpty()) {
                         sys_enterpriseid = rows.get(0).getLong("sys_enterpriseid");
                         sa_accountclassid = rows.get(0).getLong("sa_accountclassid");
-                        Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                        Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                         BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").add(rows.get(0).getBigDecimal("amount"));
                         balance = newbalance;
-                        sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                        sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                         sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "反审核", "支出凭证反审核成功").getSQL());
                     }
 
                     SQLFactory sqlFactoryupdate = new SQLFactory(this, "收支凭证反审核");
-                    sqlFactoryupdate.addParameter("siteid", "lsa1986");
+                    sqlFactoryupdate.addParameter("siteid", "lsa");
                     sqlFactoryupdate.addParameter("sa_cashbillid", sa_cashbillid);
                     sqlFactoryupdate.addParameter("balance", balance);
                     sqlFactoryupdate.addParameter("updatek3flag", 2);
@@ -293,21 +293,21 @@ public class cashbill extends Controller {
                      * DRP存在收入凭证,且中间表状态为新建或在删除状态时,DRP中需将当前收入凭证先反审核
                      */
                     long sa_cashbillid= cashbillRows.get(0).getLong("sa_cashbillid");
-                    Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and  siteid='lsa1986'");
+                    Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and  siteid='lsa'");
 
                     BigDecimal balance = BigDecimal.ZERO;  //当前账户余额
                     if (!rows.isEmpty()) {
                         sys_enterpriseid = rows.get(0).getLong("sys_enterpriseid");
                         sa_accountclassid = rows.get(0).getLong("sa_accountclassid");
-                        Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                        Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                         BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").add(rows.get(0).getBigDecimal("amount"));
                         balance = newbalance;
-                        sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
+                        sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and  sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
                         sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "反审核", "支出凭证反审核成功").getSQL());
                     }
 
                     SQLFactory sqlFactoryupdate = new SQLFactory(this, "收支凭证反审核");
-                    sqlFactoryupdate.addParameter("siteid", "lsa1986");
+                    sqlFactoryupdate.addParameter("siteid", "lsa");
                     sqlFactoryupdate.addParameter("sa_cashbillid", sa_cashbillid);
                     sqlFactoryupdate.addParameter("balance", balance);
                     sqlFactoryupdate.addParameter("updatek3flag", 2);
@@ -338,7 +338,7 @@ public class cashbill extends Controller {
     @API(title = "k3获取收入凭证", apiversion = R.ID20230714164903.v1.class,accesstoken = false)
     public String getcashbill() throws YosException{
 
-        Rows rows = dbConnect.runSqlQuery("select t2.k3outcode fk3outcode,t1.billno fbillnum,t1.sa_cashbillid ficashbillid,t1.createby,ifnull(t1.billdate,CURRENT_DATE) fdate,t3.accountno faccclsnum,t2.agentnum fagentnum,t1.amount famount,t1.remarks fnotes,t1.updatek3flag fupdatek3flag from sa_cashbill t1 inner join sa_agents t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t2.siteid=t2.siteid left join sa_accountclass t3 on t1.sa_accountclassid=t3.sa_accountclassid and t1.siteid=t3.siteid where t3.accountno!='03' and (updatek3flag='0' or updatek3flag='2') and t1.type=1 and ifnull(t1.amount,0)!=0  and t1.status='审核' and ifnull(t1.description,'')!='K3' and t1.siteid='lsa1986' and t1.createby !='LSA总0001'");
+        Rows rows = dbConnect.runSqlQuery("select t2.k3outcode fk3outcode,t1.billno fbillnum,t1.sa_cashbillid ficashbillid,t1.createby,ifnull(t1.billdate,CURRENT_DATE) fdate,t3.accountno faccclsnum,t2.agentnum fagentnum,t1.amount famount,t1.remarks fnotes,t1.updatek3flag fupdatek3flag from sa_cashbill t1 inner join sa_agents t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t2.siteid=t2.siteid left join sa_accountclass t3 on t1.sa_accountclassid=t3.sa_accountclassid and t1.siteid=t3.siteid where t3.accountno!='03' and (updatek3flag='0' or updatek3flag='2') and t1.type=1 and ifnull(t1.amount,0)!=0  and t1.status='审核' and ifnull(t1.description,'')!='K3' and t1.siteid='lsa' and t1.createby !='LSA总0001'");
         if (rows.isEmpty()) {
             JSONArray array = new JSONArray();
             return array.toString();

+ 3 - 3
src/custom/restcontroller/webmanage/lsak3/dispatch/dispatch.java

@@ -28,12 +28,12 @@ public class dispatch extends Controller {
      */
     @API(title = "获取DRP发货单", apiversion = R.ID20230715091603.v1.class,accesstoken = false)
     public String getDispatch() throws YosException{
-        Rows rows = dbConnect.runSqlQuery("select t3.sonum fsonum,t2.k3outcode fk3outcode,t1.updatek3flag fupdatek3flag,t1.billno finvonum,t1.sa_dispatchid sainvoiceid,t1.createby,t1.trantype ftrantype,ifnull(t1.billdate,CURRENT_DATE) fdate,t2.agentnum fagentnum,t1.remarks fnotes from sa_dispatch t1 inner join sa_agents t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t1.siteid=t2.siteid left join sa_order t3 on  t3.sa_orderid=t1.sa_orderid and t3.siteid=t1.siteid  where (t1.updatek3flag='0' or t1.updatek3flag='2') and t1.createby !='LSA总0001'  and t1.siteid='lsa1986'");
+        Rows rows = dbConnect.runSqlQuery("select t3.sonum fsonum,t2.k3outcode fk3outcode,t1.updatek3flag fupdatek3flag,t1.billno finvonum,t1.sa_dispatchid sainvoiceid,t1.createby,t1.trantype ftrantype,ifnull(t1.billdate,CURRENT_DATE) fdate,t2.agentnum fagentnum,t1.remarks fnotes from sa_dispatch t1 inner join sa_agents t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t1.siteid=t2.siteid left join sa_order t3 on  t3.sa_orderid=t1.sa_orderid and t3.siteid=t1.siteid  where (t1.updatek3flag='0' or t1.updatek3flag='2') and t1.createby !='LSA总0001'  and t1.siteid='lsa'");
         if(rows.isEmpty()) {
             JSONArray array = new JSONArray();
             return array.toString();
         }else{
-            Rows detailRows = dbConnect.runSqlQuery("select t1.sa_dispatchid ,t1.sa_dispatch_itemsid sainvoicedetailid,t2.itemno fitemno,t2.k3outcode fk3outcode,t3.qty fqty,t3.price fprice,t1.remarks fnotes,t3.customproperties,t2.spec flong from sa_dispatch_items t1 inner join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid inner join sa_orderitems t3 on t1.sa_orderitemsid=t3.sa_orderitemsid and t1.siteid=t3.siteid where t1.sa_dispatchid in" + rows.toJsonArray("sainvoiceid").toJSONString().replace("[", "(").replace("]", ")") + "  and t1.siteid='lsa1986'");
+            Rows detailRows = dbConnect.runSqlQuery("select t1.sa_dispatchid ,t1.sa_dispatch_itemsid sainvoicedetailid,t2.itemno fitemno,t2.k3outcode fk3outcode,t3.qty fqty,t3.price fprice,t1.remarks fnotes,t3.customproperties,t2.spec flong from sa_dispatch_items t1 inner join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid inner join sa_orderitems t3 on t1.sa_orderitemsid=t3.sa_orderitemsid and t1.siteid=t3.siteid where t1.sa_dispatchid in" + rows.toJsonArray("sainvoiceid").toJSONString().replace("[", "(").replace("]", ")") + "  and t1.siteid='lsa'");
             RowsMap rowsMap =detailRows.toRowsMap("sa_dispatchid");
             for (Row row : rows) {
                 String sainvoiceid = row.getString("sainvoiceid");
@@ -59,7 +59,7 @@ public class dispatch extends Controller {
         ArrayList<String> sqllist = new ArrayList<>();
         for (Object object:idsarray) {
             String id = (String) object;
-            sqllist.add("update sa_dispatch set updatek3flag='1' where siteid='lsa1986' and  sa_dispatchid=" + id);
+            sqllist.add("update sa_dispatch set updatek3flag='1' where siteid='lsa' and  sa_dispatchid=" + id);
         }
 
         int count =dbConnect.runSqlUpdate(sqllist);

+ 7 - 7
src/custom/restcontroller/webmanage/lsak3/item/item.java

@@ -32,7 +32,7 @@ public class item extends Controller {
         int code = 1;
         ArrayList<String> sqllist = new ArrayList<>();
         //单位
-        Rows unitRows = dbConnect.runSqlQuery("SELECT unitid,unitname from  plm_unit WHERE siteid = 'lsa1986'");
+        Rows unitRows = dbConnect.runSqlQuery("SELECT unitid,unitname from  plm_unit WHERE siteid = 'lsa'");
         RowsMap unitRowsMap = unitRows.toRowsMap("unitname");
         try {
             // 商品编号
@@ -107,7 +107,7 @@ public class item extends Controller {
             //功率
             String fgl = content.getString("fgl");
 
-            Rows itemRows = dbConnect.runSqlQuery("select * from plm_item where siteid='lsa1986' and itemno='"+fitemno+"'");
+            Rows itemRows = dbConnect.runSqlQuery("select * from plm_item where siteid='lsa' and itemno='"+fitemno+"'");
             SQLFactory sqlFactory;
             if(itemRows.isEmpty()){
                 long itemid = createTableID("plm_item");
@@ -115,7 +115,7 @@ public class item extends Controller {
                 sqlFactory.addParameter("itemid",itemid);
                 // 货品档案扩展属性字段表
                 SQLFactory sqlFactory1 = new SQLFactory(this, "货品档案-扩展新增");
-                sqlFactory1.addParameter("siteid", "lsa1986");
+                sqlFactory1.addParameter("siteid", "lsa");
                 sqlFactory1.addParameter("userid", 1);
                 sqlFactory1.addParameter("username", createby);
                 sqlFactory1.addParameter("plm_itemextendid", createTableID("plm_itemextend"));
@@ -137,7 +137,7 @@ public class item extends Controller {
                 sqlFactory1.addParameter("device", "");
 
                 SQLFactory sqlFactorytradefield = new SQLFactory(this,"货品档案领域新增");
-                sqlFactorytradefield.addParameter("siteid", "lsa1986");
+                sqlFactorytradefield.addParameter("siteid", "lsa");
                 sqlFactorytradefield.addParameter("plm_item_tradefieldid", createTableID("plm_item_tradefield"));
                 sqlFactorytradefield.addParameter("userid", 1);
                 sqlFactorytradefield.addParameter("itemid", itemid);
@@ -149,7 +149,7 @@ public class item extends Controller {
                 long itemid = itemRows.get(0).getLong("itemid");
                 sqlFactory = new SQLFactory(this,"货品档案更新");
                 sqlFactory.addParameter("itemid",itemid);
-                Rows itemextendRows= dbConnect.runSqlQuery("select * from plm_itemextend where siteid='lsa1986' and itemid="+itemid);
+                Rows itemextendRows= dbConnect.runSqlQuery("select * from plm_itemextend where siteid='lsa' and itemid="+itemid);
                 SQLFactory sqlFactory1;
                 if(itemextendRows.isEmpty()){
                     sqlFactory1 = new SQLFactory(this, "货品档案-扩展新增");
@@ -158,7 +158,7 @@ public class item extends Controller {
                     sqlFactory1 = new SQLFactory(this, "货品档案-扩展更新");
                     sqlFactory1.addParameter("plm_itemextendid",itemextendRows.get(0).getLong("plm_itemextendid"));
                 }
-                sqlFactory1.addParameter("siteid", "lsa1986");
+                sqlFactory1.addParameter("siteid", "lsa");
                 sqlFactory1.addParameter("userid", 1);
                 sqlFactory1.addParameter("username", createby);
                 sqlFactory1.addParameter("itemid", itemid);
@@ -180,7 +180,7 @@ public class item extends Controller {
                 sqllist.add(sqlFactory1.getSQL());
 
             }
-            sqlFactory.addParameter("siteid", "lsa1986");
+            sqlFactory.addParameter("siteid", "lsa");
             sqlFactory.addParameter("username",checkby);
             sqlFactory.addParameter("userid", 1);
             sqlFactory.addParameter("itemno", fitemno);

+ 3 - 3
src/custom/restcontroller/webmanage/lsak3/itemPrice/itemPrice.java

@@ -40,12 +40,12 @@ public class itemPrice extends Controller {
             String fprice = content.getString("fprice");
 
 
-            Rows itemRows = dbConnect.runSqlQuery("select * from plm_item where siteid='lsa1986' and itemno='"+fitemno+"'");
+            Rows itemRows = dbConnect.runSqlQuery("select * from plm_item where siteid='lsa' and itemno='"+fitemno+"'");
             if(itemRows.isEmpty()){
                 code=0;
                 msg="商品不存在,无法新增商品价格";
             }else{
-                Rows itempriceRows = dbConnect.runSqlQuery("select * from sa_itemprice where siteid='lsa1986' and pricegrade='" + fpricegrade + "' and itemid="+itemRows.get(0).getLong("itemid"));
+                Rows itempriceRows = dbConnect.runSqlQuery("select * from sa_itemprice where siteid='lsa' and pricegrade='" + fpricegrade + "' and itemid="+itemRows.get(0).getLong("itemid"));
                 SQLFactory sqlFactory;
                 if(itempriceRows.isEmpty()){
                     sqlFactory = new SQLFactory(this,"商品价格新增");
@@ -55,7 +55,7 @@ public class itemPrice extends Controller {
                     sqlFactory.addParameter("sa_itempriceid", itempriceRows.get(0).getLong("sa_itempriceid"));
                 }
                 sqlFactory.addParameter("itemno",fitemno);
-                sqlFactory.addParameter("siteid", "lsa1986");
+                sqlFactory.addParameter("siteid", "lsa");
                 sqlFactory.addParameter("itemid", itemRows.get(0).getLong("itemid"));
                 sqlFactory.addParameter("userid", 1);
                 sqlFactory.addParameter("pricegrade", fpricegrade);

+ 3 - 3
src/custom/restcontroller/webmanage/lsak3/order/order.java

@@ -29,10 +29,10 @@ public class order extends Controller {
     @API(title = "k3获取销售订单", apiversion = R.ID20230715090203.v1.class,accesstoken = false)
     public String getSaorder() throws  YosException{
 
-        Rows rows = dbConnect.runSqlQuery("select t2.k3outcode fk3outcode,t1.updatek3flag fupdatek3flag,t1.sonum fsonum,t1.sa_orderid saorderid,t1.createby,t1.billdate fdate,t2.agentnum fagentnum,t1.remarks fnotes from sa_order t1 inner join sa_agents t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t1.siteid=t2.siteid  where (t1.updatek3flag='0' or t1.updatek3flag='2') and t1.createby !='LSA总0001' and t1.siteid='lsa1986'");
+        Rows rows = dbConnect.runSqlQuery("select t2.k3outcode fk3outcode,t1.updatek3flag fupdatek3flag,t1.sonum fsonum,t1.sa_orderid saorderid,t1.createby,t1.billdate fdate,t2.agentnum fagentnum,t1.remarks fnotes from sa_order t1 inner join sa_agents t2 on t1.sys_enterpriseid=t2.sys_enterpriseid and t1.siteid=t2.siteid  where (t1.updatek3flag='0' or t1.updatek3flag='2') and t1.createby !='LSA总0001' and t1.siteid='lsa'");
         for (Row row : rows) {
             String sa_orderid = row.getString("sa_orderid");
-            Rows detailRows = dbConnect.runSqlQuery("select t2.k3outcode fk3outcode,t1.sa_orderitemsid saorderdetailid,convert(t1.defaultamount,char) as ftaxamount,t2.itemno fitemno,t1.qty fqty,t1.price frateprice,t1.defaultprice fprice,t1.amount famount,t1.remarks fnotes,t1.customproperties,t2.spec flong from sa_orderitems t1 inner join plm_item t2 on t1.itemid=t2.itemid where sa_orderid='" + sa_orderid + "'  and t1.siteid='lsa1986'");
+            Rows detailRows = dbConnect.runSqlQuery("select t2.k3outcode fk3outcode,t1.sa_orderitemsid saorderdetailid,convert(t1.defaultamount,char) as ftaxamount,t2.itemno fitemno,t1.qty fqty,t1.price frateprice,t1.defaultprice fprice,t1.amount famount,t1.remarks fnotes,t1.customproperties,t2.spec flong from sa_orderitems t1 inner join plm_item t2 on t1.itemid=t2.itemid where sa_orderid='" + sa_orderid + "'  and t1.siteid='lsa'");
             row.put("saorderdetail", detailRows.toJsonArray());
         }
         if(rows.isEmpty()) {
@@ -53,7 +53,7 @@ public class order extends Controller {
         ArrayList<String> sqllist = new ArrayList<>();
         for (Object object:idsarray) {
             String id = (String) object;
-            sqllist.add("update sa_order set updatek3flag='1' where siteid='lsa1986' and  sa_orderid=" + id);
+            sqllist.add("update sa_order set updatek3flag='1' where siteid='lsa' and  sa_orderid=" + id);
         }
 
 

+ 37 - 37
src/custom/restcontroller/webmanage/lsak3/stockbill/stockbill.java

@@ -52,8 +52,8 @@ public class stockbill extends Controller {
             // 经销商编号
             String fagentnum = content.getString("fagentnum");
             long sys_enterpriseid=0;
-            if(dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa1986' and  agentnum='"+fagentnum+"'").isNotEmpty()){
-                sys_enterpriseid=dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa1986' and  agentnum='"+fagentnum+"'").get(0).getLong("sys_enterpriseid");
+            if(dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa' and  agentnum='"+fagentnum+"'").isNotEmpty()){
+                sys_enterpriseid=dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa' and  agentnum='"+fagentnum+"'").get(0).getLong("sys_enterpriseid");
             }else{
                 msg ="yos中不存在【"+fagentnum+"】经销商";
                 return  getErrReturnObject().setErrMsg(msg).toString();
@@ -83,17 +83,17 @@ public class stockbill extends Controller {
             // 是否删除
             String isdelete = content.getString("isdelete");
 
-            siteid="lsa1986";
+            siteid="lsa";
 
 
-            Rows stockbillRows = dbConnect.runSqlQuery("select * from st_stockbill where siteid='lsa1986' and status='审核' and billno='"+fbillnum+"'");
+            Rows stockbillRows = dbConnect.runSqlQuery("select * from st_stockbill where siteid='lsa' and status='审核' and billno='"+fbillnum+"'");
             if(stockbillRows.isEmpty()  && "0".equals(isdelete) && "审核".equals(fstatus)){
                 /**
                  * DRP不存在销售出库单,且中间表状态为审核且不在删除状态时,DRP中需新增该销售出库单
                  */
                 SQLFactory sqlFactory =new SQLFactory(this,"销售出库单新增");
                 long st_stockbillid=createTableID("st_stockbill");
-                sqlFactory.addParameter("siteid","lsa1986");
+                sqlFactory.addParameter("siteid","lsa");
                 sqlFactory.addParameter("st_stockbillid",st_stockbillid);
                 sqlFactory.addParameter("sys_enterpriseid",sys_enterpriseid);
                 sqlFactory.addParameter("billno",fbillnum);
@@ -125,15 +125,15 @@ public class stockbill extends Controller {
                 }
                 Rows rows;
                 if (!str.toString().equals("")) {
-                     rows = dbConnect.runSqlQuery("select * from plm_item  where siteid='lsa1986' and itemno in "+"(" + str.toString() + ")");
+                     rows = dbConnect.runSqlQuery("select * from plm_item  where siteid='lsa' and itemno in "+"(" + str.toString() + ")");
                 } else {
-                     rows = dbConnect.runSqlQuery("select * from plm_item  where siteid='lsa1986' and itemno in('')");
+                     rows = dbConnect.runSqlQuery("select * from plm_item  where siteid='lsa' and itemno in('')");
                 }
                 RowsMap itemRowsMap =rows.toRowsMap("itemno");
-                Rows distiptchRows = dbConnect.runSqlQuery("select t2.price,t1.sa_dispatch_itemsid,t1.sa_orderitemsid,t2.sa_orderid,t3.sys_enterpriseid,t4.sonum,t5.itemno,t5.itemname from sa_dispatch_items t1 inner join sa_orderitems t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid inner join sa_dispatch t3 on t1.sa_dispatchid=t3.sa_dispatchid and t1.siteid=t3.siteid left join sa_order t4 on t2.sa_orderid=t4.sa_orderid and t2.siteid=t4.siteid left join plm_item t5 on t1.itemid=t5.itemid and t1.siteid=t5.siteid where t3.status in('审核','复核','关闭') and  t1.siteid='lsa1986' and  t1.sa_dispatch_itemsid in "+sa_dispatch_itemsids.toString().replace("[", "(").replace("]", ")"));
+                Rows distiptchRows = dbConnect.runSqlQuery("select t2.price,t1.sa_dispatch_itemsid,t1.sa_orderitemsid,t2.sa_orderid,t3.sys_enterpriseid,t4.sonum,t5.itemno,t5.itemname from sa_dispatch_items t1 inner join sa_orderitems t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid inner join sa_dispatch t3 on t1.sa_dispatchid=t3.sa_dispatchid and t1.siteid=t3.siteid left join sa_order t4 on t2.sa_orderid=t4.sa_orderid and t2.siteid=t4.siteid left join plm_item t5 on t1.itemid=t5.itemid and t1.siteid=t5.siteid where t3.status in('审核','复核','关闭') and  t1.siteid='lsa' and  t1.sa_dispatch_itemsid in "+sa_dispatch_itemsids.toString().replace("[", "(").replace("]", ")"));
                 RowsMap distiptchRowsMap =distiptchRows.toRowsMap("sa_dispatch_itemsid");
 
-                Rows aftersalesmagRows = dbConnect.runSqlQuery("select t1.price,t1.sa_aftersalesmag_itemsid,t1.sa_orderitemsid,t2.sa_orderid from sa_aftersalesmag_items t1 inner join sa_orderitems t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid  where  t1.siteid='lsa1986' and  t1.sa_aftersalesmag_itemsid in "+sa_dispatch_itemsids.toString().replace("[", "(").replace("]", ")"));
+                Rows aftersalesmagRows = dbConnect.runSqlQuery("select t1.price,t1.sa_aftersalesmag_itemsid,t1.sa_orderitemsid,t2.sa_orderid from sa_aftersalesmag_items t1 inner join sa_orderitems t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid  where  t1.siteid='lsa' and  t1.sa_aftersalesmag_itemsid in "+sa_dispatch_itemsids.toString().replace("[", "(").replace("]", ")"));
                 RowsMap aftersalesmagRowsMap =aftersalesmagRows.toRowsMap("sa_aftersalesmag_itemsid");
                 BigDecimal amountTotal=BigDecimal.ZERO;
                 for (Object object:detailarray) {
@@ -148,7 +148,7 @@ public class stockbill extends Controller {
                     //String fbatchno = jsonObject.getString("fbatchno");
                     String fdetailnotes = jsonObject.getString("fnotes");
                     SQLFactory sqlFactorydetail =new SQLFactory(this,"销售出库单明细新增");
-                    sqlFactorydetail.addParameter("siteid","lsa1986");
+                    sqlFactorydetail.addParameter("siteid","lsa");
                     sqlFactorydetail.addParameter("st_stockbill_itemsid", createTableID("st_stockbill_items"));
                     sqlFactorydetail.addParameter("st_stockbillid", st_stockbillid);
                     sqlFactorydetail.addParameter("rowno", frownum);
@@ -183,7 +183,7 @@ public class stockbill extends Controller {
                         /**
                          * 更新发货单数量
                          */
-                        sqlList.add("update sa_dispatch_items set outwarehousedate=CURRENT_TIME,outwarehouseqty=outwarehouseqty+"+fqty+" where siteid='lsa1986' and sa_dispatch_itemsid="+sainvoicedetailid);
+                        sqlList.add("update sa_dispatch_items set outwarehousedate=CURRENT_TIME,outwarehouseqty=outwarehouseqty+"+fqty+" where siteid='lsa' and sa_dispatch_itemsid="+sainvoicedetailid);
                     }else{
                         if(aftersalesmagRowsMap.containsKey(String.valueOf(sainvoicedetailid)) && aftersalesmagRowsMap.get(sainvoicedetailid).isNotEmpty()){
                             logger.info(aftersalesmagRowsMap.get(sainvoicedetailid).get(0).toJsonObject().toString());
@@ -225,7 +225,7 @@ public class stockbill extends Controller {
 
                 }
 
-                sqlList.add("update st_stockbill set status='审核',checkby='"+checkby+"',checkdate=CURRENT_TIMESTAMP where st_stockbillid = "+st_stockbillid+" and siteid='lsa1986'");
+                sqlList.add("update st_stockbill set status='审核',checkby='"+checkby+"',checkdate=CURRENT_TIMESTAMP where st_stockbillid = "+st_stockbillid+" and siteid='lsa'");
 
             }else if (!stockbillRows.isEmpty() && "0".equals(isdelete) && "审核".equals(fstatus)) {
                 /**
@@ -258,14 +258,14 @@ public class stockbill extends Controller {
                     /**
                      * 更新发货单数量
                      */
-                    Rows stockbilldetailrows =dbConnect.runSqlQuery("select t1.sa_dispatch_itemsid,sum(t1.qty) qty,t2.sa_dispatchid from st_stockbill_items t1 inner join  sa_dispatch_items t2 on t1.sa_dispatch_itemsid=t2.sa_dispatch_itemsid and t1.siteid=t2.siteid where t1.st_stockbillid = "+stockbillRows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa1986' group by t1.sa_dispatch_itemsid");
+                    Rows stockbilldetailrows =dbConnect.runSqlQuery("select t1.sa_dispatch_itemsid,sum(t1.qty) qty,t2.sa_dispatchid from st_stockbill_items t1 inner join  sa_dispatch_items t2 on t1.sa_dispatch_itemsid=t2.sa_dispatch_itemsid and t1.siteid=t2.siteid where t1.st_stockbillid = "+stockbillRows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa' group by t1.sa_dispatch_itemsid");
                     for (Row row :stockbilldetailrows) {
-                        sqlList.add("update sa_dispatch_items set outwarehousedate=CURRENT_TIME,outwarehouseqty=outwarehouseqty-"+row.getBigDecimal("qty")+" where siteid='lsa1986' and sa_dispatch_itemsid="+row.getLong("sa_dispatch_itemsid"));
-                        sqlList.add("update sa_dispatch set closedate=null,closeby='',status='复核' where siteid='lsa1986' and sa_dispatchid="+row.getLong("sa_dispatchid"));
+                        sqlList.add("update sa_dispatch_items set outwarehousedate=CURRENT_TIME,outwarehouseqty=outwarehouseqty-"+row.getBigDecimal("qty")+" where siteid='lsa' and sa_dispatch_itemsid="+row.getLong("sa_dispatch_itemsid"));
+                        sqlList.add("update sa_dispatch set closedate=null,closeby='',status='复核' where siteid='lsa' and sa_dispatchid="+row.getLong("sa_dispatchid"));
                     }
                 }
 
-                sqlList.add("update st_stockbill set status='新建',checkby='',checkdate=null where st_stockbillid = "+stockbillRows.get(0).getLong("st_stockbillid")+" and siteid='lsa1986'");
+                sqlList.add("update st_stockbill set status='新建',checkby='',checkdate=null where st_stockbillid = "+stockbillRows.get(0).getLong("st_stockbillid")+" and siteid='lsa'");
 
                 msg = "DRP单据状态为审核,现已反审核,下次同步时进行审核操作";
                 code = 0;
@@ -299,29 +299,29 @@ public class stockbill extends Controller {
                     /**
                      * 更新发货单数量
                      */
-                    Rows stockbilldetailrows =dbConnect.runSqlQuery("select t1.sa_dispatch_itemsid,sum(t1.qty) qty,t2.sa_dispatchid from st_stockbill_items t1 inner join  sa_dispatch_items t2 on t1.sa_dispatch_itemsid=t2.sa_dispatch_itemsid and t1.siteid=t2.siteid where t1.st_stockbillid = "+stockbillRows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa1986' group by t1.sa_dispatch_itemsid");
+                    Rows stockbilldetailrows =dbConnect.runSqlQuery("select t1.sa_dispatch_itemsid,sum(t1.qty) qty,t2.sa_dispatchid from st_stockbill_items t1 inner join  sa_dispatch_items t2 on t1.sa_dispatch_itemsid=t2.sa_dispatch_itemsid and t1.siteid=t2.siteid where t1.st_stockbillid = "+stockbillRows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa' group by t1.sa_dispatch_itemsid");
                     for (Row row :stockbilldetailrows) {
-                        sqlList.add("update sa_dispatch_items set outwarehousedate=CURRENT_TIME,outwarehouseqty=outwarehouseqty-"+row.getBigDecimal("qty")+" where siteid='lsa1986' and sa_dispatch_itemsid="+row.getLong("sa_dispatch_itemsid"));
-                        sqlList.add("update sa_dispatch set closedate=null,closeby='',status='复核' where siteid='lsa1986' and sa_dispatchid="+row.getLong("sa_dispatchid"));
+                        sqlList.add("update sa_dispatch_items set outwarehousedate=CURRENT_TIME,outwarehouseqty=outwarehouseqty-"+row.getBigDecimal("qty")+" where siteid='lsa' and sa_dispatch_itemsid="+row.getLong("sa_dispatch_itemsid"));
+                        sqlList.add("update sa_dispatch set closedate=null,closeby='',status='复核' where siteid='lsa' and sa_dispatchid="+row.getLong("sa_dispatchid"));
                     }
 
 
                 }
 
-                sqlList.add("update st_stockbill set status='新建',checkby='',checkdate=null where st_stockbillid = "+stockbillRows.get(0).getLong("st_stockbillid")+" and siteid='lsa1986'");
+                sqlList.add("update st_stockbill set status='新建',checkby='',checkdate=null where st_stockbillid = "+stockbillRows.get(0).getLong("st_stockbillid")+" and siteid='lsa'");
 
             }
 
             dbConnect.runSqlUpdate(sqlList);
 
-            Rows stockbillrows =dbConnect.runSqlQuery("select st_stockbillid,status,rb from st_stockbill where billno='"+fbillnum+"' and siteid='lsa1986'");
+            Rows stockbillrows =dbConnect.runSqlQuery("select st_stockbillid,status,rb from st_stockbill where billno='"+fbillnum+"' and siteid='lsa'");
             if(frb.equals("蓝")){
                 //查询可关闭的发货单
-                Rows dispatchrows =dbConnect.runSqlQuery("select t.sa_dispatchid from (select sa_dispatchid,sum(qty) sumqty,sum(outwarehouseqty) sumoutwarehouseqty from sa_dispatch_items where sa_dispatchid in(select sa_dispatchid from sa_dispatch_items where sa_dispatch_itemsid in(select t1.sa_dispatch_itemsid from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid where t1.st_stockbillid ="+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa1986')) group by sa_dispatchid)t where t.sumqty=t.sumoutwarehouseqty");
-                Rows undispatchrows =dbConnect.runSqlQuery("select t.sa_dispatchid from (select sa_dispatchid,sum(qty) sumqty,sum(outwarehouseqty) sumoutwarehouseqty from sa_dispatch_items where sa_dispatchid in(select sa_dispatchid from sa_dispatch_items where sa_dispatch_itemsid in(select t1.sa_dispatch_itemsid from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid where t1.st_stockbillid ="+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa1986')) group by sa_dispatchid)t where t.sumqty!=t.sumoutwarehouseqty");
+                Rows dispatchrows =dbConnect.runSqlQuery("select t.sa_dispatchid from (select sa_dispatchid,sum(qty) sumqty,sum(outwarehouseqty) sumoutwarehouseqty from sa_dispatch_items where sa_dispatchid in(select sa_dispatchid from sa_dispatch_items where sa_dispatch_itemsid in(select t1.sa_dispatch_itemsid from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid where t1.st_stockbillid ="+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa')) group by sa_dispatchid)t where t.sumqty=t.sumoutwarehouseqty");
+                Rows undispatchrows =dbConnect.runSqlQuery("select t.sa_dispatchid from (select sa_dispatchid,sum(qty) sumqty,sum(outwarehouseqty) sumoutwarehouseqty from sa_dispatch_items where sa_dispatchid in(select sa_dispatchid from sa_dispatch_items where sa_dispatch_itemsid in(select t1.sa_dispatch_itemsid from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid where t1.st_stockbillid ="+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa')) group by sa_dispatchid)t where t.sumqty!=t.sumoutwarehouseqty");
                 ArrayList<String>  sqldispatch =new ArrayList<>();
                 for (Row row:dispatchrows) {
-                    sqldispatch.add("update sa_dispatch set status='关闭',closedate=current_time,closeby='admin' where sa_dispatchid='" + row.getLong("sa_dispatchid") + "' and siteid='lsa1986'");
+                    sqldispatch.add("update sa_dispatch set status='关闭',closedate=current_time,closeby='admin' where sa_dispatchid='" + row.getLong("sa_dispatchid") + "' and siteid='lsa'");
                     SQLFactory sqlFactory = new SQLFactory(this, "数据操作日志新增");
                     sqlFactory.addParameter("sys_contrllogid", createTableID("sys_contrllog"));
                     sqlFactory.addParameter("ownertable", "sa_dispatch");
@@ -330,21 +330,21 @@ public class stockbill extends Controller {
                     sqlFactory.addParameter("remarks", "发货单自动关闭成功");
                     sqlFactory.addParameter("actionuserid", "1");
                     sqlFactory.addParameter("actionby", "admin");
-                    sqlFactory.addParameter("siteid", "lsa1986");
+                    sqlFactory.addParameter("siteid", "lsa");
                     sqldispatch.add(sqlFactory.getSQL());
                 }
                 for (Row row:undispatchrows) {
-                    sqldispatch.add("update sa_dispatch set status='复核',closedate=null,closeby='' where sa_dispatchid='" + row.getLong("sa_dispatchid") + "' and siteid='lsa1986'");
-                    sqldispatch.add("delete from sys_contrllog where ownertable='sa_dispatch' and action='自动关闭' and ownerid='" + row.getLong("sa_dispatchid") + "' and siteid='lsa1986'");
+                    sqldispatch.add("update sa_dispatch set status='复核',closedate=null,closeby='' where sa_dispatchid='" + row.getLong("sa_dispatchid") + "' and siteid='lsa'");
+                    sqldispatch.add("delete from sys_contrllog where ownertable='sa_dispatch' and action='自动关闭' and ownerid='" + row.getLong("sa_dispatchid") + "' and siteid='lsa'");
                 }
 
                 dbConnect.runSqlUpdate(sqldispatch);
 
                 //查询可关闭的订单
                 //订单出库总数量
-                Rows orderinstockrows =dbConnect.runSqlQuery( "select t1.sa_orderid,t1.siteid,sum(ifnull(t2.outwarehouseqty,0)) sumoutwarehouseqty from sa_orderitems t1 left join sa_dispatch_items t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid where  t1.sa_orderid in(select t3.sa_orderid from st_stockbill_items t1 inner join  sa_dispatch_items t2 on t1.sa_dispatch_itemsid=t2.sa_dispatch_itemsid and t1.siteid=t2.siteid inner join sa_orderitems t3 on t2.sa_orderitemsid=t3.sa_orderitemsid and t2.siteid=t3.siteid  where t1.st_stockbillid ="+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa1986')   group by t1.sa_orderid,t1.siteid");
+                Rows orderinstockrows =dbConnect.runSqlQuery( "select t1.sa_orderid,t1.siteid,sum(ifnull(t2.outwarehouseqty,0)) sumoutwarehouseqty from sa_orderitems t1 left join sa_dispatch_items t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid where  t1.sa_orderid in(select t3.sa_orderid from st_stockbill_items t1 inner join  sa_dispatch_items t2 on t1.sa_dispatch_itemsid=t2.sa_dispatch_itemsid and t1.siteid=t2.siteid inner join sa_orderitems t3 on t2.sa_orderitemsid=t3.sa_orderitemsid and t2.siteid=t3.siteid  where t1.st_stockbillid ="+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa')   group by t1.sa_orderid,t1.siteid");
                 //订单总数量
-                Rows ordersumrows =dbConnect.runSqlQuery( "select t1.sa_orderid,t1.siteid,sum(qty) sumqty from sa_orderitems t1  where  t1.sa_orderid in(select t3.sa_orderid from st_stockbill_items t1 inner join  sa_dispatch_items t2 on t1.sa_dispatch_itemsid=t2.sa_dispatch_itemsid and t1.siteid=t2.siteid inner join sa_orderitems t3 on t2.sa_orderitemsid=t3.sa_orderitemsid and t2.siteid=t3.siteid  where t1.st_stockbillid ="+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa1986')   group by t1.sa_orderid,t1.siteid");
+                Rows ordersumrows =dbConnect.runSqlQuery( "select t1.sa_orderid,t1.siteid,sum(qty) sumqty from sa_orderitems t1  where  t1.sa_orderid in(select t3.sa_orderid from st_stockbill_items t1 inner join  sa_dispatch_items t2 on t1.sa_dispatch_itemsid=t2.sa_dispatch_itemsid and t1.siteid=t2.siteid inner join sa_orderitems t3 on t2.sa_orderitemsid=t3.sa_orderitemsid and t2.siteid=t3.siteid  where t1.st_stockbillid ="+stockbillrows.get(0).getLong("st_stockbillid")+" and t1.siteid='lsa')   group by t1.sa_orderid,t1.siteid");
                 RowsMap orderinstockRowsMap = orderinstockrows.toRowsMap("sa_orderid");
 
 
@@ -352,7 +352,7 @@ public class stockbill extends Controller {
                 for (Row row:ordersumrows) {
                     if(orderinstockRowsMap.containsKey(row.getString("sa_orderid"))){
                         if(orderinstockRowsMap.get(row.getString("sa_orderid")).get(0).getBigDecimal("sumoutwarehouseqty").compareTo(row.getBigDecimal("sumqty"))==0){
-                            sqlorder.add("update sa_order set status='关闭',closedate=current_time,closeby='admin' where sa_orderid='" + row.getLong("sa_orderid") + "' and siteid='lsa1986'");
+                            sqlorder.add("update sa_order set status='关闭',closedate=current_time,closeby='admin' where sa_orderid='" + row.getLong("sa_orderid") + "' and siteid='lsa'");
                             SQLFactory sqlFactory = new SQLFactory(this, "数据操作日志新增");
                             sqlFactory.addParameter("sys_contrllogid", createTableID("sys_contrllog"));
                             sqlFactory.addParameter("ownertable", "sa_order");
@@ -361,15 +361,15 @@ public class stockbill extends Controller {
                             sqlFactory.addParameter("remarks", "订单自动关闭成功");
                             sqlFactory.addParameter("actionuserid", "1");
                             sqlFactory.addParameter("actionby", "admin");
-                            sqlFactory.addParameter("siteid", "lsa1986");
+                            sqlFactory.addParameter("siteid", "lsa");
                             sqlorder.add(sqlFactory.getSQL());
                         }else {
-                            sqlorder.add("update sa_order set status='审核',closedate=null,closeby='' where sa_orderid='" + row.getLong("sa_orderid") + "' and siteid='lsa1986'");
-                            sqlorder.add("delete from sys_contrllog  where ownertable='sa_order' and action='自动关闭'  and  ownerid='" + row.getLong("sa_orderid") + "' and siteid='lsa1986'");
+                            sqlorder.add("update sa_order set status='审核',closedate=null,closeby='' where sa_orderid='" + row.getLong("sa_orderid") + "' and siteid='lsa'");
+                            sqlorder.add("delete from sys_contrllog  where ownertable='sa_order' and action='自动关闭'  and  ownerid='" + row.getLong("sa_orderid") + "' and siteid='lsa'");
                         }
                     }else {
-                        sqlorder.add("update sa_order set status='审核',closedate=null,closeby='' where sa_orderid='" + row.getLong("sa_orderid") + "' and siteid='lsa1986'");
-                        sqlorder.add("delete from sys_contrllog  where ownertable='sa_order' and action='自动关闭'  and  ownerid='" + row.getLong("sa_orderid") + "' and siteid='lsa1986'");
+                        sqlorder.add("update sa_order set status='审核',closedate=null,closeby='' where sa_orderid='" + row.getLong("sa_orderid") + "' and siteid='lsa'");
+                        sqlorder.add("delete from sys_contrllog  where ownertable='sa_order' and action='自动关闭'  and  ownerid='" + row.getLong("sa_orderid") + "' and siteid='lsa'");
                     }
 
                 }
@@ -389,8 +389,8 @@ public class stockbill extends Controller {
                 msg = "";
             }
             code = 0;
-            dbConnect.runSqlUpdate("delete from st_stockbill_items where  st_stockbillid in(select st_stockbillid from st_stockbill where siteid='lsa1986' and billno='"+fbillnum+"')");
-            dbConnect.runSqlUpdate("delete from st_stockbill where  billno='"+fbillnum+"' and siteid='lsa1986'");
+            dbConnect.runSqlUpdate("delete from st_stockbill_items where  st_stockbillid in(select st_stockbillid from st_stockbill where siteid='lsa' and billno='"+fbillnum+"')");
+            dbConnect.runSqlUpdate("delete from st_stockbill where  billno='"+fbillnum+"' and siteid='lsa'");
 
         }
         JSONObject returnObject =new JSONObject();

+ 5 - 5
src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

@@ -512,7 +512,7 @@ public class dispatch extends Controller {
 
         WebRequest request = new WebRequest();
         String result = request.doPost(object.toString(),
-                "http://60.190.151.198:8092/BYESB/jaxrs/webclientrest");
+                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
         JSONArray jsonArray = new JSONArray();
         if(isJSONArray(result)){
             jsonArray = JSONArray.parseArray(result);
@@ -534,7 +534,7 @@ public class dispatch extends Controller {
         object1.put("content", content1);
 
         String canCloseSainvoiceByHand = request.doPost(object1.toString(),
-                "http://60.190.151.198:8092/BYESB/jaxrs/webclientrest");
+                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
 
         if (!canCloseSainvoiceByHand.equals("true")) {
             return getErrReturnObject().setErrMsg("中间表状态不为1,无法手工关闭")
@@ -599,7 +599,7 @@ public class dispatch extends Controller {
         objectfeek.put("content", contentfeek);
 
         request.doPost(objectfeek.toString(),
-                "http://60.190.151.198:8092/BYESB/jaxrs/webclientrest");
+                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
 
         return getSucReturnObject().toString();
     }
@@ -752,7 +752,7 @@ public class dispatch extends Controller {
 
         WebRequest request = new WebRequest();
         String result = request.doPost(object.toString(),
-                "http://60.190.151.198:8092/BYESB/jaxrs/webclientrest");
+                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
         JSONArray jsonArray =new JSONArray();
         if(isJSONArray(result)){
             jsonArray = JSONArray.parseArray(result);
@@ -874,7 +874,7 @@ public class dispatch extends Controller {
 
         WebRequest request = new WebRequest();
         String result = request.doPost(object.toString(),
-                "http://60.190.151.198:8092/BYESB/jaxrs/webclientrest");
+                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
         if (result.equals("true")) {
             return getErrReturnObject().setErrMsg("K3发货单为非删除状态,无法反复核")
                     .toString();

+ 1 - 1
src/custom/restcontroller/webmanage/sale/dispatch/dispatchItems.java

@@ -245,7 +245,7 @@ public class dispatchItems extends Controller {
         WebRequest request = new WebRequest();
          System.out.println(object.toString());
         String result = request.doPost(object.toString(),
-                "http://60.190.151.198:8092/BYESB/jaxrs/webclientrest");
+                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
         if(isJSONArray(result)){
             jsonArray = JSONArray.parseArray(result);
         }

+ 1 - 1
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -323,7 +323,7 @@ public class Item extends Controller {
 
          WebRequest request = new WebRequest();
         String result = request.doPost(object.toString(),
-                "http://60.190.151.198:8092/BYESB/jaxrs/webclientrest");
+                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
         for (Row row : rows) {
             JSONArray jsonArrayResult = new JSONArray();
             if(isJSONArray(result)){

+ 1 - 1
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -578,7 +578,7 @@ public class OrderItems extends Controller {
 
         WebRequest request = new WebRequest();
         String result = request.doPost(object.toString(),
-                "http://60.190.151.198:8092/BYESB/jaxrs/webclientrest");
+                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
         if (isJSONArray(result)) {
             jsonArray = JSONArray.parseArray(result);
         }