소스 검색

代码整理

郭齐峰 3 년 전
부모
커밋
6f2d08baae

+ 7 - 3
src/custom/restcontroller/webmanage/sale/itempriceadjust/ItempriceadjustItemprice.java

@@ -161,7 +161,12 @@ public class ItempriceadjustItemprice extends Controller {
         sqlList.add("update sa_itempriceadjust_items set marketprice=" + marketprice + " where siteid='" + siteid + "' and sa_itempriceadjust_itemsid=" + sa_itempriceadjust_itemsid);
         for (Object object : sa_itempriceadjust_itemprice) {
             JSONObject jsonObject = (JSONObject) object;
-            BigDecimal price = jsonObject.getBigDecimal("price");
+            BigDecimal price;
+            try {
+                price = jsonObject.getBigDecimal("price");
+            } catch (NumberFormatException e) {
+                return getErrReturnObject().setErrMsg("价格填写格式异常").toString();
+            }
             if (price.compareTo(new BigDecimal("0")) == -1) {
                 price = new BigDecimal("0");
             }
@@ -484,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");
@@ -500,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

+ 3 - 2
src/custom/restcontroller/webmanage/sale/paybill/Paybill.java

@@ -54,6 +54,9 @@ public class Paybill extends Controller {
                 where.append(")");
             }
         }
+        if (usertype == 21 || usertype == 22) {
+            where.append(" and t1.sys_enterpriseid=").append(sys_enterpriseid);
+        }
         SQLFactory sqlFactory = new SQLFactory(this, "打款凭证列表", pageSize, pageNumber, pageSorting);
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter_SQL("where", where);
@@ -225,7 +228,6 @@ public class Paybill extends Controller {
     @API(title = "查询营销账户类型", apiversion = R.ID20221228085004.v1.class)
     public String queryAccountclass() throws YosException {
         Long sa_paybillid = content.getLong("sa_paybillid");
-        String[] sa_accountclassids = dbConnect.runSqlQuery("select sa_accountclassid from sa_accountclass where siteid='" + siteid + "' and isused=1").toArray("sa_accountclassid");
         StringBuffer where = new StringBuffer(" 1=1 ");
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
@@ -237,7 +239,6 @@ public class Paybill extends Controller {
         SQLFactory sqlFactory = new SQLFactory(this, "营销账户类型列表查询");
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter_SQL("where", where);
-        sqlFactory.addParameter_in("sa_accountclassids", sa_accountclassids);
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         return getSucReturnObject().setData(rows).toString();
     }

+ 1 - 2
src/custom/restcontroller/webmanage/sale/paybill/SQL/营销账户类型列表查询.sql

@@ -5,5 +5,4 @@ select sa_accountclassid,
 from sa_accountclass
 where $where$
   and siteid = $siteid$
-  and isused = 1
-  and sa_accountclassid  in $sa_accountclassids$
+  and isused = 1