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

parent d84d9955
......@@ -694,29 +694,52 @@ public class DataController {
@RequestMapping(value = "/queryRelationsBySfzh")
@ResponseBody
public JSONObject queryRelationsBySfzh(String sfzh,String type){
JSONObject resultObj = new JSONObject();
public JSONObject queryRelationsBySfzh(String sfzh,String caseId,String caseName){
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 {
Relation relation = new Relation();
relation.setObjectfromtype("1");
relation.setObjectfromvalue(sfzh);
relation.setObjecttotype(type);
List<Relation> resultList = dataService.queryRelationList(relation);
if(!resultList.isEmpty() && resultList != null){
resultObj.put("code", ResultEnum.SUCCESS.getCode());
resultObj.put("message",ResultEnum.SUCCESS.getMessage());
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.setObjecttotype(children.getString("objectToType"));
relation.setObjecttotypename(children.getString("objectToTypeName"));
relation.setObjecttovalue(children.getString("objectToValue"));
relation.setObjectfromtype(children.getString("objectFromType"));
relation.setObjectfromvalue(children.getString("objectFromValue"));
relation.setObjectfromtypename(children.getString("objectFromTypeName"));
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 {
resultObj.put("code", ResultEnum.SUCCESS.getCode());
resultObj.put("message","无数据");
jsonObejct.put("code", ResultEnum.SUCCESS.getCode());
jsonObejct.put("message","无数据");
}
resultObj.put("dataList",resultList);
jsonObejct.put("dataList",relationList);
}catch (Exception e){
e.printStackTrace();
resultObj.put("code", ResultEnum.RESULT_ERROR.getCode());
resultObj.put("message",ResultEnum.RESULT_ERROR.getMessage());
jsonObejct.put("code", ResultEnum.RESULT_ERROR.getCode());
jsonObejct.put("message",ResultEnum.RESULT_ERROR.getMessage());
}
return resultObj;
return jsonObejct;
}
@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