Procházet zdrojové kódy

调价单查询可添加商品修改

郭齐峰 před 2 roky
rodič
revize
3772ec9acc

+ 1 - 2
src/custom/restcontroller/webmanage/sale/itempriceadjust/ItempriceadjustItemprice.java

@@ -489,7 +489,6 @@ public class ItempriceadjustItemprice extends Controller {
     @API(title = "查询可添加的商品", apiversion = R.ID20221028154004.v1.class)
     public String queryItem() throws YosException {
         Long sa_itempriceadjustid = content.getLong("sa_itempriceadjustid");
-        String[] itemids = dbConnect.runSqlQuery("select itemid from  sa_itempriceadjust_items where siteid='" + siteid + "' and sa_itempriceadjustid=" + sa_itempriceadjustid).toArray("itemid");
         StringBuffer where = new StringBuffer(" 1=1 ");
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
@@ -505,7 +504,7 @@ public class ItempriceadjustItemprice extends Controller {
         SQLFactory sqlFactory = new SQLFactory(this, "查询可添加商品", pageSize, pageNumber, pageSorting);
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter_SQL("where", where);
-        sqlFactory.addParameter_in("itemids", itemids);
+        sqlFactory.addParameter("sa_itempriceadjustid", sa_itempriceadjustid);
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         return getSucReturnObject().setData(rows).toString();
     }

+ 1 - 2
src/custom/restcontroller/webmanage/sale/itempriceadjust/SQL/查询可添加商品.sql

@@ -4,6 +4,5 @@ from plm_item t1
          LEFT JOIN plm_itemclass t3 ON t2.itemclassid = t3.itemclassid AND t2.siteid = t3.siteid
 where t1.siteid = $siteid$
   and $where$
-  and t1.status = '审核'
-  and t1.itemid not in $itemids$
+  and not exists(select 1 from sa_itempriceadjust_items where siteid= $siteid$ and sa_itempriceadjustid=$sa_itempriceadjustid$ and t1.itemid=itemid)
 group by t1.itemid, t1.itemname, t1.itemno, t1.model, t1.spec