|
|
@ -106,6 +106,42 @@ public class ShiBeiCityGridApiImpl implements ShiBeiCityGridApi { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public SendEventResultDto sendEventManual(String data) { |
|
|
|
data = "content="+ data; |
|
|
|
LOGGER.info("发送参数:" + data); |
|
|
|
LOGGER.info("发送地址:"+ApiConstants.sendEventUrl); |
|
|
|
HttpResponse response = null; |
|
|
|
try { |
|
|
|
response = HttpRequest.post(ApiConstants.sendEventUrl).body(data) |
|
|
|
.header("lan", "zh") |
|
|
|
.header("Content-type", "application/x-www-form-urlencoded;charset=UTF-8").execute(); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
LOGGER.error("事件上报信息异常:" + e.getMessage()); |
|
|
|
} |
|
|
|
LOGGER.info("事件上报返回数据:" + response.body()); |
|
|
|
JSONObject res = JSONObject.parseObject(response.body()); |
|
|
|
SendEventResultDto result = null; |
|
|
|
if(0 == Integer.parseInt(res.get("code").toString())){ |
|
|
|
try { |
|
|
|
result = (SendEventResultDto) JSONObject.toJavaObject((JSONObject) res.get("data"), SendEventResultDto.class); |
|
|
|
result.setCode("0"); |
|
|
|
}catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
LOGGER.error("事件上报返回结果处理错误:" + e.getMessage()); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
try { |
|
|
|
result = (SendEventResultDto) JSONObject.toJavaObject(res, SendEventResultDto.class); |
|
|
|
}catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
LOGGER.error("事件上报返回结果处理错误:" + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public GridDto sendWenXinEvaluateInfo(SendWenXinEvaluateInfoFormDto sendWenXinEvaluateInfoFormDto) { |
|
|
|
Map<String, Object> map = Maps.newHashMap(); |
|
|
|