修复判空、增加配置文件
parent
8c650231e9
commit
5445eefe09
|
|
@ -144,6 +144,7 @@ public class DataTask {
|
|||
ObjectMapper om = new ObjectMapper();
|
||||
Map map = om.readValue(respStr, Map.class);
|
||||
List<LinkedHashMap> list = (List<LinkedHashMap>)map.get("data");
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
for (Map map1 : list) {
|
||||
StPptnRReal stPptnRReal = new ObjectMapper().convertValue(map1, StPptnRReal.class);
|
||||
if(ObjectUtils.isEmpty(stPptnRReal.getChtm())){
|
||||
|
|
@ -154,6 +155,7 @@ public class DataTask {
|
|||
stPptnRRealService.saveOrUpdate(stPptnRReal, updateWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.error("雨情实时定时任务错误:", e.getMessage());
|
||||
|
|
@ -176,6 +178,7 @@ public class DataTask {
|
|||
List<StPptnR> stcdLast = stPptnRService.getStcdLastPptnData();
|
||||
OkHttpClient client = OkHttpUtil.build();
|
||||
try {
|
||||
if(CollectionUtils.isNotEmpty(stcdLast)){
|
||||
for(StPptnR stPptnR : stcdLast){
|
||||
Date stm = stPptnR.getStm();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
|
@ -205,6 +208,7 @@ public class DataTask {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.error("雨情历史定时任务错误:", e.getMessage());
|
||||
|
|
@ -227,6 +231,7 @@ public class DataTask {
|
|||
List<StPptnRD> stcdLast = stPptnRDService.getStcdLastPptnDayData();
|
||||
OkHttpClient client = OkHttpUtil.build();
|
||||
try {
|
||||
if(CollectionUtils.isNotEmpty(stcdLast)){
|
||||
for(StPptnRD stPptnRD : stcdLast){
|
||||
String stcd = stPptnRD.getStcd();
|
||||
Date stm = stPptnRD.getStm();
|
||||
|
|
@ -268,6 +273,7 @@ public class DataTask {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.error("雨情按天定时任务错误:", e.getMessage());
|
||||
|
|
@ -298,6 +304,7 @@ public class DataTask {
|
|||
ObjectMapper om = new ObjectMapper();
|
||||
Map map = om.readValue(respStr, Map.class);
|
||||
List<LinkedHashMap> list = (List<LinkedHashMap>)map.get("data");
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
for (Map map1 : list) {
|
||||
StRsvrRReal stRsvrRReal = new ObjectMapper().convertValue(map1, StRsvrRReal.class);
|
||||
if(ObjectUtils.isEmpty(stRsvrRReal.getChtm())){
|
||||
|
|
@ -308,6 +315,7 @@ public class DataTask {
|
|||
stRsvrRRealService.saveOrUpdate(stRsvrRReal, updateWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.error("水情实时定时任务错误:", e.getMessage());
|
||||
|
|
@ -330,6 +338,7 @@ public class DataTask {
|
|||
List<StRsvrR> stcdLast = stRsvrRService.getStcdLastRsvrData();
|
||||
OkHttpClient client = OkHttpUtil.build();
|
||||
try {
|
||||
if(CollectionUtils.isNotEmpty(stcdLast)){
|
||||
for(StRsvrR stRsvrR : stcdLast){
|
||||
Date stm = stRsvrR.getStm();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
|
@ -359,6 +368,7 @@ public class DataTask {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.error("水情历史定时任务错误:", e.getMessage());
|
||||
|
|
@ -388,6 +398,7 @@ public class DataTask {
|
|||
ObjectMapper om = new ObjectMapper();
|
||||
Map map = om.readValue(respStr, Map.class);
|
||||
List<LinkedHashMap> list = (List<LinkedHashMap>)map.get("data");
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
for (Map map1 : list) {
|
||||
StImgRReal stImgRReal = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false).setDateFormat(sdf).convertValue(map1, StImgRReal.class);
|
||||
if(ObjectUtils.isEmpty(stImgRReal.getChtm())){
|
||||
|
|
@ -404,6 +415,7 @@ public class DataTask {
|
|||
stImgRRealService.saveOrUpdate(stImgRReal, updateWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.error("图像实时定时任务错误:", e.getMessage());
|
||||
|
|
@ -426,6 +438,7 @@ public class DataTask {
|
|||
List<StImgR> stcdLast = stImgRService.getStcdLastImgData();
|
||||
OkHttpClient client = OkHttpUtil.build();
|
||||
try {
|
||||
if(CollectionUtils.isNotEmpty(stcdLast)){
|
||||
for (StImgR stImgR : stcdLast) {
|
||||
Date stm = stImgR.getStm();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
|
@ -468,6 +481,7 @@ public class DataTask {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.error("图像历史定时任务错误:", e.getMessage());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
spring:
|
||||
config:
|
||||
import:
|
||||
- config-common.yml
|
||||
- config-prod.yml
|
||||
|
|
@ -16,7 +16,7 @@ spring:
|
|||
driver-class-name: org.postgresql.Driver
|
||||
data:
|
||||
redis:
|
||||
host: 36.133.116.124
|
||||
host: 10.0.41.112
|
||||
port: 6379
|
||||
password: 1234567a
|
||||
database: 4
|
||||
|
|
|
|||
Loading…
Reference in New Issue