|
@@ -83,12 +83,10 @@ public class TmstrainMeasureCommissionServiceImpl implements ITmstrainMeasureCo
|
|
//发送计量委托,成功返回1,失败返回0
|
|
//发送计量委托,成功返回1,失败返回0
|
|
int i = sendMesToMeasure(measureCommission);
|
|
int i = sendMesToMeasure(measureCommission);
|
|
System.out.println(measureCommission);
|
|
System.out.println(measureCommission);
|
|
- if(i == 1){
|
|
|
|
- //添加计量委托实绩
|
|
|
|
- addMeasureCommission(map);
|
|
|
|
- updateTrainLoadResult(map);
|
|
|
|
- }
|
|
|
|
- return 1;
|
|
|
|
|
|
+ //添加计量委托实绩,不论成败
|
|
|
|
+ addMeasureCommission(map);
|
|
|
|
+ updateTrainLoadResult(map);
|
|
|
|
+ return i;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -175,18 +173,17 @@ public class TmstrainMeasureCommissionServiceImpl implements ITmstrainMeasureCo
|
|
String jsonData = null;
|
|
String jsonData = null;
|
|
try {
|
|
try {
|
|
jsonData = HTTPRequestUtils.send(url, jsonObject, "utf-8");
|
|
jsonData = HTTPRequestUtils.send(url, jsonObject, "utf-8");
|
|
- } catch (IOException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- if(!"null".equals(jsonData)){
|
|
|
|
System.out.println(jsonData);
|
|
System.out.println(jsonData);
|
|
HashMap hashMap = JSON.parseObject(jsonData, HashMap.class);
|
|
HashMap hashMap = JSON.parseObject(jsonData, HashMap.class);
|
|
boolean success = (boolean) hashMap.get("success");
|
|
boolean success = (boolean) hashMap.get("success");
|
|
System.out.println(hashMap.get("msg"));
|
|
System.out.println(hashMap.get("msg"));
|
|
- if(success){
|
|
|
|
- return 1;
|
|
|
|
|
|
+ if(!success){
|
|
|
|
+ System.out.println("委托发送失败!");
|
|
}
|
|
}
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ System.out.println("委托发送异常!");
|
|
|
|
+ e.printStackTrace();
|
|
}
|
|
}
|
|
- return 0;
|
|
|
|
|
|
+ return 1;
|
|
}
|
|
}
|
|
}
|
|
}
|