|
@@ -36,4 +36,23 @@ public class WaterPressureServiceImpl implements WaterPressureService {
|
|
|
log.error("数据推送失败! data ===> {} , result ===> {}",data, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public String command(String data){
|
|
|
+ log.info("WaterPressure-command 接到指令 ==>{}",data);
|
|
|
+ JSONObject object;
|
|
|
+ String res = null;
|
|
|
+ try {
|
|
|
+ object = JSONObject.parseObject(data);
|
|
|
+ res = HttpRequest.post(configService.getKey("commandURL"))
|
|
|
+ .header("Content-Type", "application/json")
|
|
|
+ .body(object.toJSONString())
|
|
|
+ .execute().body();
|
|
|
+ log.info("指令下发成功! data ===> {} , result ===> {}",data, res);
|
|
|
+ return res;
|
|
|
+ }catch(Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ log.error("指令下发失败! data ===> {} , result ===> {}",data, e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|