修改脑图订票信息查询接口

parent d84d9955
...@@ -694,29 +694,52 @@ public class DataController { ...@@ -694,29 +694,52 @@ public class DataController {
@RequestMapping(value = "/queryRelationsBySfzh") @RequestMapping(value = "/queryRelationsBySfzh")
@ResponseBody @ResponseBody
public JSONObject queryRelationsBySfzh(String sfzh,String type){ public JSONObject queryRelationsBySfzh(String sfzh,String caseId,String caseName){
JSONObject resultObj = new JSONObject(); List<String> dpTypes = Arrays.asList("5754","6332","4340");//5754:订票编号;6332:订单号 ;4340:订座编号
JSONObject jsonObejct = new JSONObject();
JSONObject jsonObj = new JSONObject();
List<Relation> relationList = new ArrayList<>();
try { try {
String dpResult = pushWaDataService.pushRelations(caseId,caseName,"",sfzh);
if(null != dpResult &&dpResult.startsWith("{")){
jsonObj = JSONObject.parseObject(dpResult);
}
if(jsonObj != null){
String dataList = jsonObj.getString("data");
JSONArray childrens = JSONObject.parseArray(dataList);
if(childrens != null && childrens.size() > 0){
for (int i = 0; i < childrens.size();i++){
JSONObject children = childrens.getJSONObject(i);
if (dpTypes.contains(children.getString("objectToType"))){
Relation relation = new Relation(); Relation relation = new Relation();
relation.setObjectfromtype("1"); relation.setObjecttotype(children.getString("objectToType"));
relation.setObjectfromvalue(sfzh); relation.setObjecttotypename(children.getString("objectToTypeName"));
relation.setObjecttotype(type); relation.setObjecttovalue(children.getString("objectToValue"));
List<Relation> resultList = dataService.queryRelationList(relation); relation.setObjectfromtype(children.getString("objectFromType"));
if(!resultList.isEmpty() && resultList != null){ relation.setObjectfromvalue(children.getString("objectFromValue"));
resultObj.put("code", ResultEnum.SUCCESS.getCode()); relation.setObjectfromtypename(children.getString("objectFromTypeName"));
resultObj.put("message",ResultEnum.SUCCESS.getMessage()); relation.setRelativetype(children.getString("relativeType"));
relation.setRelativetypename(children.getString("relativeTypeName"));
relation.setSourcename(children.getString("sourceName"));
relationList.add(relation);
}
}
}
}
if(!relationList.isEmpty() && relationList != null){
jsonObejct.put("code", ResultEnum.SUCCESS.getCode());
jsonObejct.put("message",ResultEnum.SUCCESS.getMessage());
}else { }else {
resultObj.put("code", ResultEnum.SUCCESS.getCode()); jsonObejct.put("code", ResultEnum.SUCCESS.getCode());
resultObj.put("message","无数据"); jsonObejct.put("message","无数据");
} }
resultObj.put("dataList",resultList); jsonObejct.put("dataList",relationList);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
resultObj.put("code", ResultEnum.RESULT_ERROR.getCode()); jsonObejct.put("code", ResultEnum.RESULT_ERROR.getCode());
resultObj.put("message",ResultEnum.RESULT_ERROR.getMessage()); jsonObejct.put("message",ResultEnum.RESULT_ERROR.getMessage());
} }
return resultObj; return jsonObejct;
} }
@RequestMapping(value = "/queryJdAndThxxBySfzh") @RequestMapping(value = "/queryJdAndThxxBySfzh")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment