|
|
@@ -8,6 +8,7 @@ import common.annotation.Param;
|
|
|
import common.data.QuerySQL;
|
|
|
import common.data.Rows;
|
|
|
import common.data.SQLFactory;
|
|
|
+import common.data.SQLFile;
|
|
|
import restcontroller.R;
|
|
|
|
|
|
@API(title = "美大CRM_经销商_库存")
|
|
|
@@ -30,24 +31,30 @@ public class invbal extends Controller {
|
|
|
|
|
|
@API(title = "美大CRM_经销商_总仓库存查询", type = API.Type.PageQuery, apiversion = R.ID2026031715111701.v1.class)
|
|
|
public String sys_enterprise_invbal_total_querylist() throws YosException {
|
|
|
- SQLFactory sqlFactory = new SQLFactory(this, "总仓库存查询");
|
|
|
- sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
+ SQLFile sqlFile = SQLFactory.getSQLFile(this, "总仓库存查询");
|
|
|
+ sqlFile.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_enterprise_item", "itemid", "itemno", "itemname", "model", "safeqty", "spec").setTableAlias("t10");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "plm_item", "t11", "t10.itemid=t11.itemid", "topclassnum");
|
|
|
- querySQL.addJoinTable(JOINTYPE.inner, sqlFactory, "t12", "t10.sys_enterprise_itemid=t2.sys_enterprise_itemid", "icqty", "undeliqty", "unreceiveqty", "willoutqty");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.inner, sqlFile, "t12", "t10.sys_enterprise_itemid=t2.sys_enterprise_itemid", "icqty", "undeliqty", "unreceiveqty", "willoutqty");
|
|
|
querySQL.setWhere("t10.sys_enterpriseid", sys_enterpriseid);
|
|
|
Rows icrows = querySQL.query();
|
|
|
return getSucReturnObject().setData(icrows).toString();
|
|
|
}
|
|
|
|
|
|
@API(title = "美大CRM_经销商_总仓库存序列号查询", type = API.Type.PageQuery, apiversion = R.ID2026033015555101.v1.class, params = {
|
|
|
- @Param(paramname = "itemid", fieldtype = FieldType.BigInt, remarks = "商品ID", isrequired = true)})
|
|
|
+ @Param(paramname = "itemid", fieldtype = FieldType.BigInt, remarks = "商品ID", isrequired = true),
|
|
|
+ @Param(paramname = "sys_enterprise_stockid", fieldtype = FieldType.BigInt, remarks = "仓库ID,可不传", isrequired = false),
|
|
|
+ })
|
|
|
public String sa_itemsku_querylist() throws YosException {
|
|
|
long itemid = content.getLong("itemid");
|
|
|
- QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_itemsku", "sku").setTableAlias("t1");
|
|
|
+ long sys_enterprise_stockid = content.getLongValue("sys_enterprise_stockid");
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_itemsku").setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.inner, "st_stock", "t2", "t1.stockid=t2.stockid and t2.stockno='00'");
|
|
|
querySQL.setWhere("t1.itemid", itemid);
|
|
|
querySQL.setWhere("t1.sys_enterpriseid", sys_enterpriseid);
|
|
|
+ if (sys_enterprise_stockid > 0) {
|
|
|
+ querySQL.setWhere("t1.sys_enterprise_stockid", sys_enterprise_stockid);
|
|
|
+ }
|
|
|
querySQL.setSiteid(siteid);
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
Rows rows = querySQL.query();
|