|
@@ -3231,6 +3231,22 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
input.put("unCancel",true);
|
|
input.put("unCancel",true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //发送给计量
|
|
|
|
+ if(input.get("cancel")!=null || input.get("unCancel")!=null){
|
|
|
|
+ Map<String, Object> cancelOrderMap = new HashMap<>();
|
|
|
|
+ cancelOrderMap.put("carNo",map.get("oldCapacityNumber"));
|
|
|
|
+ if(input.get("cancel")!=null){
|
|
|
|
+ cancelOrderMap.put("cancel",input.get("cancel"));
|
|
|
|
+ System.out.println("联动计量取消:" + map.get("oldCapacityNumber"));
|
|
|
|
+ }else if(input.get("unCancel")!=null){
|
|
|
|
+ cancelOrderMap.put("unCancel",input.get("unCancel"));
|
|
|
|
+ System.out.println("联动计量撤销取消:" + map.get("oldCapacityNumber"));
|
|
|
|
+ }
|
|
|
|
+ String url = "http://172.16.33.122:44325/api/logistics/CancleOrdersBill";
|
|
|
|
+ JSONObject cancelOrderJson = new JSONObject(cancelOrderMap);
|
|
|
|
+ String sendUrl = url ;
|
|
|
|
+ String jsonData = HTTPRequestUtils.send(sendUrl, cancelOrderJson,"utf-8");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
@@ -3254,38 +3270,6 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
}
|
|
}
|
|
if (s == null || s.size() == 0) {
|
|
if (s == null || s.size() == 0) {
|
|
throw new Exception("登录金蝶失败!请重试派车!");
|
|
throw new Exception("登录金蝶失败!请重试派车!");
|
|
- }else{
|
|
|
|
- try{
|
|
|
|
- JSONObject result = new JSONObject(s);
|
|
|
|
- //如果status不为1,抛出异常
|
|
|
|
- if(!result.getJSONObject("res").getString("status").equals("1")){
|
|
|
|
- throw new Exception("上传金蝶失败!请重试派车:"+result.getJSONObject("requestException").getString("message"));
|
|
|
|
- }else {
|
|
|
|
- if(map.get("oldCapacityNumber") != null && DataChange.dataToBigDecimal(map.get("capacityId")).compareTo(new BigDecimal(35128)) == 0) {
|
|
|
|
- System.out.println("联动计量取消:" + map.get("oldCapacityNumber"));
|
|
|
|
- String url = "http://172.16.33.122:44325/api/logistics/CancleOrdersBill";
|
|
|
|
- Map<String, Object> cancelOrderMap = new HashMap<>();
|
|
|
|
- cancelOrderMap.put("carNo",map.get("oldCapacityNumber"));
|
|
|
|
- JSONObject cancelOrderJson = new JSONObject(cancelOrderMap);
|
|
|
|
- String sendUrl = url ;
|
|
|
|
- String jsonData = null;
|
|
|
|
- try {
|
|
|
|
- jsonData = HTTPRequestUtils.send(sendUrl, cancelOrderJson,"utf-8");
|
|
|
|
- } catch (org.apache.http.ParseException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }catch (Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- //只抛出自定义异常
|
|
|
|
- if(e.getMessage().contains("Exception")){
|
|
|
|
- throw new Exception("上传金蝶失败!请重试派车!");
|
|
|
|
- }else{
|
|
|
|
- throw new Exception(e.getMessage());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|