diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java index ed9f445..340408e 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java @@ -44,7 +44,7 @@ HttpRequest request = loginAction.getPostAuthRequest(ziGuangConfig.getBz().getListUrl()); request.body(JSONObject.toJSONString(baseListPramMap)); HttpResponse response = request.execute(); -// log.info("泵站基础信息list:{}", response.body());//{"msg":"此账号可能已在别处登录","code":500} + log.info("泵站基础信息list:{}", response.body());//{"msg":"此账号可能已在别处登录","code":500} List list = JSONObject.parseArray(response.body(), BzDto.class); list.forEach(i -> { realTimeData(i.getSTCD()); diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java index ed9f445..340408e 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java @@ -44,7 +44,7 @@ HttpRequest request = loginAction.getPostAuthRequest(ziGuangConfig.getBz().getListUrl()); request.body(JSONObject.toJSONString(baseListPramMap)); HttpResponse response = request.execute(); -// log.info("泵站基础信息list:{}", response.body());//{"msg":"此账号可能已在别处登录","code":500} + log.info("泵站基础信息list:{}", response.body());//{"msg":"此账号可能已在别处登录","code":500} List list = JSONObject.parseArray(response.body(), BzDto.class); list.forEach(i -> { realTimeData(i.getSTCD()); diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java index 2eb13f5..595d298 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java @@ -33,7 +33,7 @@ gqAction.list(); hdAction.list(); hpAction.list(); -// ylAction.list(); + ylAction.list(); // zsAction.list(); } } diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java index ed9f445..340408e 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java @@ -44,7 +44,7 @@ HttpRequest request = loginAction.getPostAuthRequest(ziGuangConfig.getBz().getListUrl()); request.body(JSONObject.toJSONString(baseListPramMap)); HttpResponse response = request.execute(); -// log.info("泵站基础信息list:{}", response.body());//{"msg":"此账号可能已在别处登录","code":500} + log.info("泵站基础信息list:{}", response.body());//{"msg":"此账号可能已在别处登录","code":500} List list = JSONObject.parseArray(response.body(), BzDto.class); list.forEach(i -> { realTimeData(i.getSTCD()); diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java index 2eb13f5..595d298 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java @@ -33,7 +33,7 @@ gqAction.list(); hdAction.list(); hpAction.list(); -// ylAction.list(); + ylAction.list(); // zsAction.list(); } } diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java index 5f689c8..3f2d25f 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java @@ -81,8 +81,9 @@ if ((flag && (dto = bladeRedis.get("yl:" + stcd)) != null && dto.getTM().before(list.get(0).getTM())) || !flag) { log.info("雨量redis的数据:{},请求到的最新数据:{}", JSONObject.toJSONString(dto), JSONObject.toJSONString(list.get(0).getTM())); + log.info("conver:{}",JSONObject.toJSONString(YlDto.convert(list.get(0)))); // rabbitTemplate.convertAndSend(JSONObject.toJSONString(YlDto.convert(list.get(0)))); - bladeRedis.set("yl:" + stcd, list.get(0)); +// bladeRedis.set("yl:" + stcd, list.get(0)); return; } } diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java index ed9f445..340408e 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java @@ -44,7 +44,7 @@ HttpRequest request = loginAction.getPostAuthRequest(ziGuangConfig.getBz().getListUrl()); request.body(JSONObject.toJSONString(baseListPramMap)); HttpResponse response = request.execute(); -// log.info("泵站基础信息list:{}", response.body());//{"msg":"此账号可能已在别处登录","code":500} + log.info("泵站基础信息list:{}", response.body());//{"msg":"此账号可能已在别处登录","code":500} List list = JSONObject.parseArray(response.body(), BzDto.class); list.forEach(i -> { realTimeData(i.getSTCD()); diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java index 2eb13f5..595d298 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java @@ -33,7 +33,7 @@ gqAction.list(); hdAction.list(); hpAction.list(); -// ylAction.list(); + ylAction.list(); // zsAction.list(); } } diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java index 5f689c8..3f2d25f 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java @@ -81,8 +81,9 @@ if ((flag && (dto = bladeRedis.get("yl:" + stcd)) != null && dto.getTM().before(list.get(0).getTM())) || !flag) { log.info("雨量redis的数据:{},请求到的最新数据:{}", JSONObject.toJSONString(dto), JSONObject.toJSONString(list.get(0).getTM())); + log.info("conver:{}",JSONObject.toJSONString(YlDto.convert(list.get(0)))); // rabbitTemplate.convertAndSend(JSONObject.toJSONString(YlDto.convert(list.get(0)))); - bladeRedis.set("yl:" + stcd, list.get(0)); +// bladeRedis.set("yl:" + stcd, list.get(0)); return; } } diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/dto/YlDto.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/dto/YlDto.java index c03b76c..d8d4575 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/dto/YlDto.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/dto/YlDto.java @@ -1,8 +1,13 @@ package org.springnewfiber.dataadapter.ziguang.yl.dto; +import com.google.common.collect.Maps; import lombok.Data; +import org.springnewfiber.dataadapter.entity.MqNodeData; +import org.springnewfiber.dataadapter.entity.PtReceiveBaseModel; +import org.springnewfiber.dataadapter.ziguang.hp.dto.HpDto; import java.util.Date; +import java.util.Map; /** * @program: newfiber-data-adapter @@ -28,4 +33,20 @@ private Float LGTD; // 纬度 private Float LTTD; + + public static PtReceiveBaseModel convert(YlDto dto){ + PtReceiveBaseModel model=new PtReceiveBaseModel(); + model.setSt(dto.getSTCD()); + model.setTt(dto.getTM()); + model.setUt(new Date()); + model.setSn(""); + Map dataMap= Maps.newHashMap(); + MqNodeData data= new MqNodeData(); + data.setKey("drp"); + data.setValue(dto.getDRP()); + data.setSn("drp"); + dataMap.put("drp",data); + model.setDataMap(dataMap); + return model; + } } diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java index ed9f445..340408e 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/bz/action/BzAction.java @@ -44,7 +44,7 @@ HttpRequest request = loginAction.getPostAuthRequest(ziGuangConfig.getBz().getListUrl()); request.body(JSONObject.toJSONString(baseListPramMap)); HttpResponse response = request.execute(); -// log.info("泵站基础信息list:{}", response.body());//{"msg":"此账号可能已在别处登录","code":500} + log.info("泵站基础信息list:{}", response.body());//{"msg":"此账号可能已在别处登录","code":500} List list = JSONObject.parseArray(response.body(), BzDto.class); list.forEach(i -> { realTimeData(i.getSTCD()); diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java index 2eb13f5..595d298 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/core/ZiGuangDataJob.java @@ -33,7 +33,7 @@ gqAction.list(); hdAction.list(); hpAction.list(); -// ylAction.list(); + ylAction.list(); // zsAction.list(); } } diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java index 5f689c8..3f2d25f 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/action/YlAction.java @@ -81,8 +81,9 @@ if ((flag && (dto = bladeRedis.get("yl:" + stcd)) != null && dto.getTM().before(list.get(0).getTM())) || !flag) { log.info("雨量redis的数据:{},请求到的最新数据:{}", JSONObject.toJSONString(dto), JSONObject.toJSONString(list.get(0).getTM())); + log.info("conver:{}",JSONObject.toJSONString(YlDto.convert(list.get(0)))); // rabbitTemplate.convertAndSend(JSONObject.toJSONString(YlDto.convert(list.get(0)))); - bladeRedis.set("yl:" + stcd, list.get(0)); +// bladeRedis.set("yl:" + stcd, list.get(0)); return; } } diff --git a/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/dto/YlDto.java b/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/dto/YlDto.java index c03b76c..d8d4575 100644 --- a/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/dto/YlDto.java +++ b/src/main/java/org/springnewfiber/dataadapter/ziguang/yl/dto/YlDto.java @@ -1,8 +1,13 @@ package org.springnewfiber.dataadapter.ziguang.yl.dto; +import com.google.common.collect.Maps; import lombok.Data; +import org.springnewfiber.dataadapter.entity.MqNodeData; +import org.springnewfiber.dataadapter.entity.PtReceiveBaseModel; +import org.springnewfiber.dataadapter.ziguang.hp.dto.HpDto; import java.util.Date; +import java.util.Map; /** * @program: newfiber-data-adapter @@ -28,4 +33,20 @@ private Float LGTD; // 纬度 private Float LTTD; + + public static PtReceiveBaseModel convert(YlDto dto){ + PtReceiveBaseModel model=new PtReceiveBaseModel(); + model.setSt(dto.getSTCD()); + model.setTt(dto.getTM()); + model.setUt(new Date()); + model.setSn(""); + Map dataMap= Maps.newHashMap(); + MqNodeData data= new MqNodeData(); + data.setKey("drp"); + data.setValue(dto.getDRP()); + data.setSn("drp"); + dataMap.put("drp",data); + model.setDataMap(dataMap); + return model; + } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 025e772..3b4af46 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -10,8 +10,9 @@ database: 0 ssl: false rabbitmq: - # virtual-host: pt_mq - host: 139.155.49.237 + virtual-host: pt_mq +# host: 139.155.49.237 + host: 192.168.16.220 port: 5672 username: pt_mq password: pt_mq @@ -48,8 +49,9 @@ realurl: http://58.49.51.33:8081/iwp/dynamic/zs/zs_daylist/list #雨量站 yl: - listurl: http://58.49.51.33:8081/iwp/dynamic/yl/map_yllive/list - realurl: http://58.49.51.33:8081/iwp/dynamic/yl/yl_live/list + listurl: http://58.49.51.33:8081/iwp/dynamic/yl/yl_live/list + realurl: http://58.49.51.33:8081/iwp/dynamic/yl/yl_daylistmi/list + #暂时未使用 3hoururl: http://58.49.51.33:8081/iwp/dynamic/yl/yl_3hour/list 6hoururl: http://58.49.51.33:8081/iwp/dynamic/yl/yl_6hour/list 24hoururl: http://58.49.51.33:8081/iwp/dynamic/yl/yl_24hour/list