|
|
@@ -114,8 +114,9 @@ public class invbal extends Controller {
|
|
|
|
|
|
@API(title = "查询Erp库存列表", apiversion = R.ID20230408091703.v1.class)
|
|
|
public String queryErpInvbalList() throws YosException {
|
|
|
- String itemno = content.getString("itemno");
|
|
|
- String itemname = content.getString("itemname");
|
|
|
+ String itemno = content.getStringValue("itemno");
|
|
|
+ String itemname = content.getStringValue("itemname");
|
|
|
+ String agentinfo = content.getStringValue("agentinfo");
|
|
|
boolean all = content.getBooleanValue("all");
|
|
|
JSONArray itemclassids = content.getJSONArray("itemclassids");
|
|
|
String where ="1=2";
|
|
|
@@ -128,7 +129,6 @@ public class invbal extends Controller {
|
|
|
sqlFactory=new SQLFactory(this,"商品列表", pageSize, pageNumber, pageSorting);
|
|
|
where=where+" or t2.itemname like '%"+itemname+"%' ";
|
|
|
}
|
|
|
-
|
|
|
if (itemclassids.size() > 0) {
|
|
|
sqlFactory=new SQLFactory(this,"商品列表", pageSize, pageNumber, pageSorting);
|
|
|
ArrayList<Long> itemclassList = new ArrayList<Long>();
|
|
|
@@ -146,10 +146,14 @@ public class invbal extends Controller {
|
|
|
if(all){
|
|
|
where=where+" or 1=1 ";
|
|
|
}
|
|
|
-
|
|
|
+ if(!StringUtils.isBlank(agentinfo)){
|
|
|
+ sqlFactory =new SQLFactory(this,"订单明细未发商品列表", pageSize, pageNumber, pageSorting);
|
|
|
+ where ="1=2";
|
|
|
+ where=where+" or t6.agentnum like '%"+agentinfo+"%' or t5.enterprisename like '%"+agentinfo+"%' ";
|
|
|
+ }
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
-
|
|
|
+ System.out.println(sqlFactory.getSQL());
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
Rows rowsitemclass = dbConnect.runSqlQuery(" select t7.itemclassname,t6.itemid,t8.brandname from sa_itemsaleclass t6 LEFT JOIN plm_itemclass t7 ON t7.itemclassid = t6.itemclassid AND t7.siteid = t6.siteid LEFT JOIN sa_brand t8 ON t8.sa_brandid = t7.sa_brandid AND t8.siteid = t7.siteid where t6.siteid='" + siteid + "'");
|
|
|
RowsMap itemclassRowsMap = rowsitemclass.toRowsMap("itemid");
|
|
|
@@ -188,7 +192,6 @@ public class invbal extends Controller {
|
|
|
}
|
|
|
for (Row row:rows) {
|
|
|
String itemclass=itemclassRowsMap.get(row.getString("itemid")).toJsonArray("itemclassname").toString().substring(1,itemclassRowsMap.get(row.getString("itemid")).toJsonArray("itemclassname").toString().length()-1);
|
|
|
- System.out.println(itemclass.replaceAll("\"", ""));
|
|
|
row.put("itemclass", itemclass.replaceAll("\"", ""));
|
|
|
if(sumQtyRowsMap.get(row.getString("itemno")).isNotEmpty()){
|
|
|
row.put("unsoldqty", sumQtyRowsMap.get(row.getString("itemno")).get(0).getBigDecimal("qty"));
|