luobang преди 2 години
родител
ревизия
8c69f1e8de

+ 4 - 0
src/main/java/com/steerinfo/dil/feign/JoinFeign.java

@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import java.math.BigDecimal;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -21,4 +22,7 @@ public interface JoinFeign {
     // 查询车牌号和金蝶分录
     @PostMapping("/api/v1/join/amssaleorder/selectSaleSteelOrder")
     Map<String,Object> selectSaleSteelOrder(@RequestBody Map<String,Object> map);
+
+    @PostMapping("/api/v1/join/tmstruckweightresult/receiveTmsTruckWeightResultByDaGang")
+    Map<String,Object> receiveTmsTruckWeightResultByDaGang(@RequestBody List<Map<String,Object>> mapList);
 }

+ 37 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckMeasureCommissionServiceImpl.java

@@ -2,6 +2,8 @@ package com.steerinfo.dil.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.google.common.cache.Weigher;
+import com.steerinfo.dil.feign.JoinFeign;
 import com.steerinfo.dil.mapper.*;
 import com.steerinfo.dil.model.MeasureJsonData;
 import com.steerinfo.dil.model.TmstruckMeasureCommission;
@@ -56,6 +58,10 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
     @Autowired
     private TmstruckTareReturnResultMapper tmstruckTareReturnResultMapper;
 
+
+    @Autowired
+    private JoinFeign joinFeign;
+
     private static final  String daGangUrl = "http://172.16.33.122:44325/api/logistics/TareApplyFor";
 
     private static final  String dagangUrlForLoad = "http://172.16.33.122:44325/api/logistics/modifyLoadPlace";
@@ -263,6 +269,7 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
                 measureCommission.put("IsAssembly", true);
             }
         }
+        measureCommission.put("orderType",1);
         System.out.println(measureCommission);
         return sendMesToMeasure(measureCommission);
     }
@@ -649,6 +656,36 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
             System.out.println(hashMap.get("msg"));
             if(success){
                 return 1;
+            }else{
+                try {
+                    if(map.get("orderType") != null && DataChange.dataToBigDecimal(map.get("orderType")).intValue() == 1) {
+                        Object weight = hashMap.get("weight");
+                        Object weightDateTime = hashMap.get("weightDateTime");
+                        if(weight != null && weightDateTime != null){
+                            List<Map<String,Object>> mapListWeight = new ArrayList<>();
+                            Map<String, Object> weightMap = new HashMap<>();
+                            weightMap.put("orderNumber",map.get("transportNum"));
+                            weightMap.put("resultTareCalculateNumber","一号汽车衡");
+                            weightMap.put("resultTareWeight",weight);
+                            weightMap.put("resultTareWeightTime",weightDateTime);
+                            weightMap.put("carNo",map.get("carNum"));
+                            weightMap.put("flag","GCXS");
+                            weightMap.put("needCheckToKD",1);
+                            weightMap.put("resultCrossCalculateNumber","");
+                            weightMap.put("resultCrossWeight","");
+                            weightMap.put("resultNetWeight","");
+                            weightMap.put("resultCrossWeightTime","");
+                            weightMap.put("resultNetWeightTime","");
+                            weightMap.put("resultPoundNo","");
+                            weightMap.put("materialId","");
+                            weightMap.put("wuliuRemark","委托带出皮重");
+                            mapListWeight.add(weightMap);
+                            joinFeign.receiveTmsTruckWeightResultByDaGang(mapListWeight);
+                        }
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
             }
         }else{
             System.out.println("委托发送失败:" + jsonData);