浏览代码

【订单管理】和【订货订单】中的物流单关联显示和跳转及万中物流对接

hu 7 月之前
父节点
当前提交
9f79cbe659

+ 4 - 0
src/custom/restcontroller/R.java

@@ -5648,6 +5648,10 @@ public class R {
         public static class v1 {
         }
     }
+    public static class ID20241019150603 {
+        public static class v1 {
+        }
+    }
 
 }
 

+ 17 - 5
src/custom/restcontroller/webmanage/sale/logistics/LSALogistics.java

@@ -269,15 +269,18 @@ public class LSALogistics extends Controller {
         //对接万中物流
 //        if(siteid.equalsIgnoreCase("lsa")){
             WzwlDocking wzwlDocking =new WzwlDocking();
-            if(row.getBigDecimal("logisticsamount1").compareTo(BigDecimal.ZERO)<=0){
-                JSONObject jsonObject = wzwlDocking.queryWzwlOrderAmount(row.getString("billno"));
+            if(!row.getString("logisticsstatus").equals("签收")){
+
+                JSONObject jsonObject = wzwlDocking.queryWzwlOrderAmountExtendList(row.getString("billno"));
                 if(jsonObject.getString("success").equals("true")){
                     JSONArray data = jsonObject.getJSONArray("data");
-                    dbConnect.runSqlUpdate("update sa_logistics set logisticsamount="+((JSONObject)data.get(0)).getBigDecimalValue("transportFee")+" where sa_logisticsid="+sa_logisticsid);
+                    dbConnect.runSqlUpdate("update sa_logistics set logisticsamount="+((JSONObject)data.get(0)).getBigDecimalValue("transportFee")+",volume='"+((JSONObject)data.get(0)).getBigDecimalValue("volume")+"',weight='"+((JSONObject)data.get(0)).getBigDecimalValue("weight")+"',packageqty='"+((JSONObject)data.get(0)).getIntValue("quantity")+"' where sa_logisticsid="+sa_logisticsid);
                     row.put("logisticsamount",((JSONObject)data.get(0)).getBigDecimalValue("transportFee"));
+                    row.put("volume",((JSONObject)data.get(0)).getBigDecimalValue("volume"));
+                    row.put("weight",((JSONObject)data.get(0)).getBigDecimalValue("weight"));
+                    row.put("packageqty",((JSONObject)data.get(0)).getBigDecimalValue("quantity"));
                 }
-            }
-            if(!row.getString("logisticsstatus").equals("签收")){
+
                 JSONObject wzwlOrder = wzwlDocking.queryWzwlOrder(row.getString("billno"));
                 if(wzwlOrder.getString("success").equals("true")){
                     JSONArray data = wzwlOrder.getJSONArray("data");
@@ -571,6 +574,15 @@ public class LSALogistics extends Controller {
         return getSucReturnObject().setData(jsonObject).toString();
     }
 
+    @API(title = "物流费用查询", apiversion = R.ID20241019150603.v1.class)
+    public String queryWzwlOrderAmountExtendList() throws YosException, NoSuchAlgorithmException, UnsupportedEncodingException {
+
+        WzwlDocking wzwlDocking =new WzwlDocking();
+        String billno = content.getString("billno");
+        JSONObject jsonObject = wzwlDocking.queryWzwlOrderAmountExtendList(billno);
+        return getSucReturnObject().setData(jsonObject).toString();
+    }
+
 
 
     public void sendMsg(String content, Long sa_orderid, Long sys_enterpriseid) throws YosException {

+ 2 - 2
src/custom/restcontroller/webmanage/sale/order/Order.java

@@ -2877,8 +2877,8 @@ public class Order extends Controller {
             JSONObject whereObject = content.getJSONObject("where");
             if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
                 where.append(" and(");
-                where.append("t3.name like'%").append(whereObject.getString("condition")).append("%' ");
-                where.append("or t3.phonenumber like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("t9.address like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t9.remarks like'%").append(whereObject.getString("condition")).append("%' ");
                 where.append(")");
             }
         }

+ 23 - 14
src/custom/restcontroller/webmanage/sale/order/SQL/订单_物流单列表.sql

@@ -1,14 +1,23 @@
-SELECT t1.sa_logistics_itemsid,
-       t1.sa_dispatchid,
-       t2.sa_orderid,
-       t3.*,
-       t4.`name`      contactname,
-       t4.phonenumber contactphonenumber
-from sa_logistics_items t1
-         INNER JOIN sa_dispatch t2 ON t1.sa_dispatchid = t2.sa_dispatchid and t1.siteid = t2.siteid
-         INNER JOIN sa_logistics t3 ON t3.sa_logisticsid = t1.sa_logisticsid and t1.siteid = t3.siteid and t3.`status` != '新建'
-         LEFT JOIN sys_enterprise_contacts t4
-ON t3.rec_contactsid = t4.contactsid and t3.siteid = t4.siteid
-WHERE t2.sa_orderid = $sa_orderid$
-  and t1.siteid = $siteid$
-  and $where$
+SELECT DISTINCT
+    t7.sa_orderid,
+    t9.billno,
+    t9.billdate,
+    t9.logisticsstatus,
+    t9.packageqty,
+    t9.logisticsamount,
+    t9.address,
+    t9.remarks
+FROM
+    sa_logistics_items AS t1
+        LEFT JOIN st_stockbill_items AS t2 ON t2.st_stockbill_itemsid = t1.st_stockbill_itemsid
+        AND t2.siteid = t1.siteid
+        LEFT JOIN sa_dispatch_items AS t6 ON t6.sa_dispatch_itemsid = t2.sa_dispatch_itemsid
+        AND t6.siteid = t2.siteid
+        LEFT JOIN sa_orderitems AS t7 ON t6.sa_orderitemsid = t7.sa_orderitemsid
+        AND t6.siteid = t7.siteid
+        INNER JOIN sa_logistics t9 ON t9.sa_logisticsid = t1.sa_logisticsid
+        AND t9.siteid = t1.siteid
+        AND t9.`status` != '新建'
+WHERE t7.sa_orderid = $sa_orderid$
+  and t9.siteid = $siteid$
+  and $where$

+ 19 - 0
src/custom/utility/WzwlDocking.java

@@ -193,6 +193,25 @@ public class WzwlDocking extends BaseClass {
     }
 
 
+    public JSONObject queryWzwlOrderAmountExtendList(String orderNo) throws YosException, NoSuchAlgorithmException, UnsupportedEncodingException {
+        JSONObject request = new JSONObject();
+        JSONObject data = new JSONObject();
+
+        data.put("companyCode", companyCode);
+        data.put("orderNo", orderNo);
+        String datastr =data.toString().replace("\"", "'");
+        request.put("data", data.toString().replace("\"", "'"));
+        request.put("appKey", appKey);
+        request.put("digest", digest_MD5_Base64(datastr, secretKey));
+        HashMap<String, String> map = new HashMap<>();
+        map.put("content-Type", "application/json");
+        String result = new WebRequest().doPost(request.toString(), url + "OrderAmountExtendList", map);
+        JSONObject resultobject = JSONObject.parseObject(result);
+
+        return  resultobject;
+    }
+
+
     //生成digest (data 中的内容,使用data+secretKey 进行 MD5,再进行 Base64 转换后生成的摘要内容)
     public static String digest_MD5_Base64(String data, String secretKey) throws NoSuchAlgorithmException, UnsupportedEncodingException {
         String str = data+secretKey;