Просмотр исходного кода

商品管理,商品详情页显示库存值及特殊订单按上下架查询

hu 3 лет назад
Родитель
Сommit
78cef66658

+ 21 - 0
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -5,6 +5,7 @@ import beans.datacontrllog.DataContrlLog;
 import beans.invbal.Invbal;
 import beans.itemclass.ItemClass;
 import beans.itemgroup.Itemgroup;
+import beans.parameter.Parameter;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import common.Controller;
@@ -19,6 +20,7 @@ import org.apache.poi.ss.usermodel.DataFormat;
 import org.apache.poi.xssf.usermodel.*;
 import restcontroller.R;
 import restcontroller.webmanage.sale.itemgroup.itemgroup;
+import utility.ERPDocking;
 
 
 import java.util.ArrayList;
@@ -280,6 +282,25 @@ public class Item extends Controller {
         // 商品领域
         RowsMap tradefieldRowsMap = beans.Item.Item.getTradefieldRowsMap(this, itemids);
 
+        ERPDocking erpDocking = new ERPDocking();
+        JSONArray jsonArray =new JSONArray();
+        if (Parameter.get("system.ccerp_dockswitch").equalsIgnoreCase("true")) {
+            if(!rows.toJsonArray("itemno").isEmpty()){
+                jsonArray=erpDocking.getErpIcinvbalRows(200000, 1,rows.toJsonArray("itemno"));
+            }
+        }
+        if(!jsonArray.isEmpty()){
+            for (Object object:jsonArray) {
+                JSONObject jsonObject =(JSONObject)object;
+                if(!rows.isEmpty()){
+                    if(rows.get(0).getString("itemno").equals(jsonObject.getString("fitemno"))){
+                        rows.get(0).put("invbal_qty", jsonObject.getBigDecimalValue("fqty"));
+                                               }
+                }
+
+            }
+        }
+
         for (Row row : rows) {
             if (attRowsMap.getOrDefault(row.getString("itemid"), new Rows()).isEmpty()) {
                 row.put("attinfos", defaultImageRows);

+ 4 - 0
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -465,6 +465,10 @@ public class OrderItems extends Controller {
                 where.append("or t3.erpitemno like'%").append(whereObject.getString("condition")).append("%' ");
                 where.append(")");
             }
+            if (whereObject.containsKey("isonsale") && !"".equals(whereObject.getString("isonsale"))) {
+                where.append(" and t1.isonsale ='").append(whereObject.getString("isonsale")).append("' ");
+            }
+
         }
         Long sa_orderid = content.getLong("sa_orderid");
 

+ 2 - 1
src/custom/restcontroller/webmanage/sale/order/SQL/查询可添加商品列表_特殊订单.sql

@@ -18,7 +18,8 @@ SELECT t1.itemid,
        t3.erpitemname,
        t3.specalnote,
        t3.prodline,
-       t3.device
+       t3.device,
+       t1.isonsale
 from plm_item t1
          LEFT JOIN plm_unitgroup t2 ON t2.unitgroupid = t1.unitgroupid and t2.siteid = t1.siteid
          left join plm_itemextend t3 on t3.itemid = t1.itemid and t3.siteid = t1.siteid