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