|
|
|
@ -118,7 +118,6 @@ public class FdpQuestionServiceImpl implements IFdpQuestionService {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean submitDeviceAnswer(SubmitAnswerReq submitAnswerReq) { |
|
|
|
|
logger.info("hzims:equipment:submitDeviceAnswer",JSON.toJSONString(submitAnswerReq)); |
|
|
|
|
String submitAnswerUrl = ""; |
|
|
|
|
switch(submitAnswerReq.getDeviceType()) { |
|
|
|
|
case FdpConstant.COMMON_DEVICE_TYPE: |
|
|
|
@ -139,6 +138,50 @@ public class FdpQuestionServiceImpl implements IFdpQuestionService {
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean generateGraphInstance(Integer stationType, String stationId) { |
|
|
|
|
Integer type = this.getStationType(stationType); |
|
|
|
|
if(Func.isNotEmpty(type)) { |
|
|
|
|
HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getGenerateGraphInstance()).body(JSON.toJSONString( |
|
|
|
|
new HashMap<String,Object>(){{ |
|
|
|
|
put("type",type); |
|
|
|
|
put("stationId",stationId); |
|
|
|
|
}} |
|
|
|
|
)).execute(); |
|
|
|
|
return httpResponse.getStatus() == HttpServletResponse.SC_OK && |
|
|
|
|
"1".equals(JSONObject.parseObject(httpResponse.body()).getString("success")); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean deleteInstanceAnswer(String instanceId) { |
|
|
|
|
HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getDeleteInstanceAnswer()).body(JSON.toJSONString( |
|
|
|
|
new HashMap<String, String>(1) {{ |
|
|
|
|
put("instanceId", instanceId); |
|
|
|
|
}} |
|
|
|
|
)).execute(); |
|
|
|
|
return httpResponse.getStatus() == HttpServletResponse.SC_OK && |
|
|
|
|
"1".equals(JSONObject.parseObject(httpResponse.body()).getString("success")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<JSONObject> getInstanceAnswer(String instanceId) { |
|
|
|
|
HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getGetInstanceAnswer()).body( |
|
|
|
|
JSON.toJSONString( |
|
|
|
|
new HashMap<String,String>(1){{ |
|
|
|
|
put("instanceId",instanceId); |
|
|
|
|
}} |
|
|
|
|
) |
|
|
|
|
).execute(); |
|
|
|
|
JSONObject responseObject = JSONObject.parseObject(httpResponse.body()); |
|
|
|
|
if(httpResponse.getStatus() == HttpServletResponse.SC_OK && |
|
|
|
|
"1".equals(responseObject.getString("success"))) { |
|
|
|
|
return JSONArray.parseArray(JSON.toJSONString(responseObject),JSONObject.class); |
|
|
|
|
} |
|
|
|
|
return Lists.newArrayList(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据站点类型获取Fdp的站点类型 |
|
|
|
|
* @param stationType 站点管理站点类型 |
|
|
|
|