Przeglądaj źródła

调拨单及出入库单序列号明细表查询

hu 10 miesięcy temu
rodzic
commit
8f32f25c30

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

@@ -5912,6 +5912,16 @@ public class R {
         public static class v1 {
         }
     }
+
+    public static class ID2025062411152303 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID2025062411234603 {
+        public static class v1 {
+        }
+    }
 }
 
 

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

@@ -157,7 +157,10 @@ public class dbstockbilldetail extends Controller {
         querySQL.addQueryFields("instockno", "t2.stockno");
         querySQL.addQueryFields("instockname", "t2.stockname");
         querySQL.setWhere("t1.siteid", siteid);
+        querySQL.setWhere(where);
         querySQL.setWhere("t1.st_dbstockbillid",st_dbstockbillid);
+        querySQL.setPage(pageSize, pageNumber);
+        querySQL.setOrderBy(pageSorting);
         Rows rows = querySQL.query();
 
 

+ 36 - 4
src/custom/restcontroller/webmanage/sale/dbstockbill/dbstockbilldetailsku.java

@@ -6,10 +6,8 @@ import com.alibaba.fastjson.JSONObject;
 import common.Controller;
 import common.YosException;
 import common.annotation.API;
-import common.data.InsertSQL;
-import common.data.Rows;
-import common.data.RowsMap;
-import common.data.SQLFactory;
+import common.annotation.CACHEING;
+import common.data.*;
 import org.apache.poi.hssf.record.DVALRecord;
 import restcontroller.R;
 
@@ -19,6 +17,40 @@ public class dbstockbilldetailsku extends Controller {
     public dbstockbilldetailsku(JSONObject content) throws YosException {
         super(content);
     }
+
+    @API(title = "调拨单明细序列号列表", apiversion = R.ID2025062411234603.v1.class)
+    @CACHEING
+    public String querydbstockbilldetailsku() throws YosException {
+        long st_dbstockbilldetailid=content.getLong("st_dbstockbilldetailid");
+        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(" t4.itemname like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t4.model like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t4.spec like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.sku like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+        }
+
+
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "st_dbstockbilldetailsku",  "*");
+        querySQL.setTableAlias("t1");
+        querySQL.addJoinTable(JOINTYPE.left, "sa_itemsku", "t2", "t1.sku=t2.sku and t1.siteid = t2.siteid");
+        querySQL.addJoinTable(JOINTYPE.left, "st_stock", "t3", "t1.outstockid = t3.stockid AND t1.siteid = t3.siteid","stockname");
+        querySQL.addJoinTable(JOINTYPE.left, "plm_item", "t4", "t2.itemid=t4.itemid and t2.siteid = t4.siteid", "itemno","itemname","spec","model");
+        querySQL.setSiteid(siteid);
+        querySQL.setWhere("st_dbstockbilldetailid",st_dbstockbilldetailid);
+        querySQL.setWhere(where);
+        querySQL.setPage(pageSize, pageNumber);
+        querySQL.setOrderBy(pageSorting);
+        Rows rows = querySQL.query();
+
+        return getSucReturnObject().setData(rows).toString();
+    }
+
     @API(title = "判断序列号是否符合条件", apiversion = R.ID2025061915095203.v1.class)
     public String judgesku() throws YosException {
         long st_dbstockbillid = content.getLong("st_dbstockbillid");

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

@@ -0,0 +1,61 @@
+package restcontroller.webmanage.sale.stockbill;
+
+import beans.data.BatchDeleteErr;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import common.Controller;
+import common.YosException;
+import common.annotation.API;
+import common.annotation.CACHEING;
+import common.annotation.CACHEING_CLEAN;
+import common.data.*;
+import restcontroller.R;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+
+public class stockbillitemssku extends Controller {
+    public stockbillitemssku(JSONObject content) throws YosException {
+        super(content);
+    }
+
+
+
+    @API(title = "出入库单明细序列号列表", apiversion = R.ID2025062411152303.v1.class)
+    @CACHEING
+    public String querstockbillitemsskuList() throws YosException {
+        /*
+         * 过滤条件设置
+         */
+        long st_stockbill_itemsid=content.getLong("st_stockbill_itemsid");
+        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(" t2.itemname like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t2.model like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t2.spec like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.sku like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+        }
+
+
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "st_stockbill_items_sku",  "*");
+        querySQL.setTableAlias("t1");
+        querySQL.addJoinTable(JOINTYPE.left, "plm_item", "t2", "t1.itemid=t2.itemid and t1.siteid = t2.siteid","itemno","itemname"
+                ,"spec","model");
+        querySQL.addJoinTable(JOINTYPE.left, "st_stock", "t3", "t1.stockid = t3.stockid AND t1.siteid = t3.siteid","stockname");
+        querySQL.setSiteid(siteid);
+        querySQL.setWhere("st_stockbill_itemsid",st_stockbill_itemsid);
+        querySQL.setWhere(where);
+        querySQL.setPage(pageSize, pageNumber);
+        querySQL.setOrderBy(pageSorting);
+        Rows rows = querySQL.query();
+
+        return getSucReturnObject().setData(rows).toString();
+    }
+
+
+}