This commit is contained in:
linfso 2025-04-16 16:24:52 +08:00
parent e18e439939
commit 1b353c4683

View File

@ -11,64 +11,6 @@ public class TraceUtils {
/**
* 查询轨迹信息
* @return
*/
public static AjaxResult queryTraceInfoByZtd(String mailno, String tail4){
AjaxResult ar = new AjaxResult();
String allResult = "";
try {
// 保存数据
String postUrl = "http://gzh.tanex56.com/HMWXServer/msg/getScanByCode?code="+mailno;
allResult= HTTPHelperV3.get(postUrl);
if (allResult.contains("code")) {
JSONObject jObjRst = JSONObject.parseObject(allResult);
String code=jObjRst.getString("code");
String message=jObjRst.getString("message");
if("200".equals(code) ) {
JSONArray jArraySteps = new JSONArray();
JSONArray jsonArraySteps=jObjRst.getJSONObject("data").getJSONArray("scanData");;
// System.out.println(jsonArraySteps.toString());
if(jsonArraySteps.size()>0) {
for (Object object : jsonArraySteps) {
JSONObject tmpObj = (JSONObject) object;
String opCode = tmpObj.getString("scanType");
JSONObject jsonObjStep = new JSONObject();
jsonObjStep.put("content", cvtOpCodeToContent(tmpObj));
jsonObjStep.put("time", tmpObj.getString("scanDate"));
jsonObjStep.put("status", cvtOpCodeToStatusWord(opCode));
jArraySteps.add(jsonObjStep);
}
return AjaxResult.success("查询成功",jArraySteps);
}
else{
JSONArray jArSteps = new JSONArray();
return AjaxResult.error("查询成功,无路由信息",jArSteps);
}
}else{
AjaxResult.error("查询失败");
}
}else{
AjaxResult.error("查询失败E004");
}
}catch (Exception ex){
ex.printStackTrace();
AjaxResult.error("查询失败E003");
}
return ar;
}
private static String cvtOpCodeToContent(JSONObject jsonObjStep) {
String scanMan = jsonObjStep.getString("scanMan");
String opCode = jsonObjStep.getString("scanType");
@ -200,7 +142,7 @@ public class TraceUtils {
String qParams="appId=xdadan20240614&mainNo="+mailno+"&lang=&sign=123&tail4="+tail4;
String postUrl = "http://api.emis.tanex56.com/api/bizsvr/emis/common/queryTraceInfo?"+qParams;
String postUrl = "http://api-emis.jtrs56.com/api/bizsvr/emis/common/queryTraceInfo?"+qParams;
allResult=HTTPHelperV3.get(postUrl);
if (allResult.contains("code")) {
@ -255,10 +197,10 @@ public class TraceUtils {
return queryTraceInfoByEmis(mailno,tail4);
}else{
AjaxResult arZtd=queryTraceInfoByZtd(mailno,tail4);
if("200".equals(arZtd.get("code").toString())){
return arZtd;
}
// AjaxResult arZtd=queryTraceInfoByZtd(mailno,tail4);
// if("200".equals(arZtd.get("code").toString())){
// return arZtd;
// }
return queryTraceInfoByEmis(mailno,tail4);
}