Przeglądaj źródła

订单_出库单接口添加

hu 2 lat temu
rodzic
commit
6845cfb2af

+ 4 - 0
src/custom/restcontroller/R.java

@@ -5225,6 +5225,10 @@ public class R {
         public static class v1 {
         }
     }
+    public static class ID20230815151203 {
+        public static class v1 {
+        }
+    }
 
 
 }

+ 22 - 0
src/custom/restcontroller/webmanage/sale/order/Order.java

@@ -2203,6 +2203,28 @@ public class Order extends Controller {
         return getSucReturnObject().setData(rows).toString();
     }
 
+    @API(title = "查询出库单列表", apiversion = R.ID20230815151203.v1.class)
+    @CACHEING
+    public String stockbillList() throws YosException {
+        Long sa_orderid = content.getLong("sa_orderid");
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t.billno like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+        }
+        SQLFactory sqlFactory = new SQLFactory(this, "订单_出库单列表", pageSize, pageNumber, pageSorting);
+        sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter_SQL("where", where);
+        sqlFactory.addParameter("sa_orderid", sa_orderid);
+        Rows rows = dbConnect.runSqlQuery(sqlFactory);
+
+        return getSucReturnObject().setData(rows).toString();
+    }
+
     @API(title = "查询订单进度", apiversion = R.ID20221229093602.v1.class)
     @CACHEING
     public String getOrderProcess() throws YosException {

+ 3 - 0
src/custom/restcontroller/webmanage/sale/order/SQL/订单_出库单列表.sql

@@ -0,0 +1,3 @@
+select t.* from (select t2.st_stockbillid,t2.billno,t2.status,t2.remarks from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid inner join sa_dispatch_items t3 on t1.sa_dispatch_itemsid=t3.sa_dispatch_itemsid and t1.siteid=t3.siteid inner join sa_orderitems t4 on t4.sa_orderitemsid=t3.sa_orderitemsid and t4.siteid=t3.siteid where t4.sa_orderid=$sa_orderid$ and t2.rb=1
+union all
+select t2.st_stockbillid,t2.billno,t2.status,t2.remarks from st_stockbill_items t1 inner join st_stockbill t2 on t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid inner join sa_aftersalesmag_items t3 on t1.sa_dispatch_itemsid=t3.sa_aftersalesmag_itemsid and t1.siteid=t3.siteid inner join sa_orderitems t4 on t4.sa_orderitemsid=t3.sa_orderitemsid and t4.siteid=t3.siteid where t4.sa_orderid=$sa_orderid$ and t2.rb=0) t where $where$

+ 4 - 2
src/custom/restcontroller/webmanage/sale/stockbill/SQL/出入库单列表查询.sql

@@ -1,8 +1,10 @@
 SELECT t1.*,
        t2.enterprisename,
        t2.abbreviation,
-       t2.phonenumber enterprisephonenumber
+       t2.phonenumber enterprisephonenumber,
+			 t3.agentnum
 FROM st_stockbill t1
          LEFT JOIN sys_enterprise t2 ON t1.sys_enterpriseid = t2.sys_enterpriseid
-    AND t1.siteid = t2.siteid
+         LEFT JOIN sa_agents t3 ON t1.sys_enterpriseid = t3.sys_enterpriseid
+    AND t1.siteid = t3.siteid
       where siteid=$siteid$

+ 3 - 0
src/custom/restcontroller/webmanage/sale/stockbill/stockbill.java

@@ -63,6 +63,9 @@ public class stockbill extends Controller {
             if (whereObject.containsKey("status") && !"".equals(whereObject.getString("status"))) {
                 where.append(" and t1.status ='").append(whereObject.getString("status")).append("' ");
             }
+            if (whereObject.containsKey("rb") && !"".equals(whereObject.getString("rb"))) {
+                where.append(" and t1.rb ='").append(whereObject.getString("rb")).append("' ");
+            }
             if (whereObject.containsKey("begindate") && !"".equals(whereObject.getString("begindate"))) {
                 where.append(" and DATE_FORMAT(t1.billdate, '%Y-%m-%d') >='").append(whereObject.getString("begindate")).append("' ");
             }