|
|
@@ -75,6 +75,51 @@ public class stockbillitems extends Controller {
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
+ @API(title = "商品档案添加商品", apiversion = R.ID2025101713485003.v1.class)
|
|
|
+ public String queryItemList() throws YosException {
|
|
|
+ /*
|
|
|
+ * 过滤条件设置
|
|
|
+ */
|
|
|
+ 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("t1.itemname like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t1.itemno like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t1.unit like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t3.sonum like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t3.typemx like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append(")");
|
|
|
+ }
|
|
|
+ if (whereObject.containsKey("sa_orderid") && !"".equals(whereObject.getString("sa_orderid"))) {
|
|
|
+ Long sa_orderid = whereObject.getLongValue("sa_orderid");
|
|
|
+ if (sa_orderid > 0) {
|
|
|
+ where.append(" and t1.sa_orderid ='").append(sa_orderid).append("' ");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (whereObject.containsKey("begindate") && !"".equals(whereObject.getString("begindate"))) {
|
|
|
+ where.append(" and DATE_FORMAT(t3.checkdate, '%Y-%m-%d') >='").append(whereObject.getString("begindate")).append("' ");
|
|
|
+ }
|
|
|
+ if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
|
|
|
+ where.append(" and DATE_FORMAT(t3.checkdate, '%Y-%m-%d') <='").append(whereObject.getString("enddate")).append("' ");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "plm_item",
|
|
|
+ "itemid","itemno","itemname","model","spec","batchcontrol");
|
|
|
+ querySQL.setTableAlias("t1");
|
|
|
+ querySQL.setSiteid(siteid);
|
|
|
+ querySQL.setWhere("t1.STATUS = '审核' and t1.isused=1");
|
|
|
+ querySQL.setWhere("t1.itemid not in (select itemid from st_stockbill_items where st_stockbillid='"+content.getLongValue("st_stockbillid")+"')");
|
|
|
+ //querySQL.setWhere("t1.sa_orderitemsid not in(select t1.sa_orderitemsid from (select t1.sa_orderitemsid,t1.siteid,SUM(t1.qty) qty from sa_dispatch_items t1 inner join sa_dispatch t2 on t1.sa_dispatchid=t2.sa_dispatchid and t1.siteid=t2.siteid where t2.status in('新建','提交') group by t1.sa_orderitemsid,t1.siteid) t1 inner join sa_orderitems t3 on t1.sa_orderitemsid=t3.sa_orderitemsid and t1.siteid=t3.siteid where t3.undeliqty=t1.qty)");
|
|
|
+ querySQL.setWhere(where.toString());
|
|
|
+ querySQL.setPage(pageSize, pageNumber);
|
|
|
+ Rows rows = querySQL.query();
|
|
|
+
|
|
|
+ return getSucReturnObject().setData(rows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@API(title = "出入库单明细新增更新", apiversion = R.ID2025050614284803.v1.class)
|
|
|
@CACHEING_CLEAN(apiClass = {stockbill.class, stockbillitems.class})
|
|
|
public String insertormodify_stcokbillItems() throws YosException {
|