|
@ -3,15 +3,13 @@ package com.kms.web.synchronous; |
|
|
import cn.hutool.http.HttpRequest; |
|
|
import cn.hutool.http.HttpRequest; |
|
|
import cn.hutool.http.HttpResponse; |
|
|
import cn.hutool.http.HttpResponse; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.kms.yg.dd.domain.AttDiscBase; |
|
|
import com.kms.yg.dd.domain.AttDiscBase; |
|
|
import com.kms.yg.dd.service.AttDiscBaseService; |
|
|
import com.kms.yg.dd.service.AttDiscBaseService; |
|
|
import com.kms.yg.df.domain.BsSgcDfJbxx; |
|
|
import com.kms.yg.df.domain.*; |
|
|
import com.kms.yg.df.domain.BsSgcDfSafeJbxx; |
|
|
|
|
|
import com.kms.yg.df.domain.BsSgcDfSwtz; |
|
|
|
|
|
import com.kms.yg.df.domain.dto.BsSgcDfSwtzDto; |
|
|
import com.kms.yg.df.domain.dto.BsSgcDfSwtzDto; |
|
|
import com.kms.yg.df.service.BsSgcDfJbxxService; |
|
|
import com.kms.yg.df.service.*; |
|
|
import com.kms.yg.df.service.BsSgcDfSafeJbxxService; |
|
|
|
|
|
import com.kms.yg.df.service.BsSgcDfSwtzService; |
|
|
|
|
|
import com.kms.yg.ly.domain.AttBasBase; |
|
|
import com.kms.yg.ly.domain.AttBasBase; |
|
|
import com.kms.yg.ly.service.AttBasBaseService; |
|
|
import com.kms.yg.ly.service.AttBasBaseService; |
|
|
import com.kms.yg.rv.domain.AttRvBase; |
|
|
import com.kms.yg.rv.domain.AttRvBase; |
|
@ -20,10 +18,18 @@ import com.kms.yg.sk.domain.AttResBase; |
|
|
import com.kms.yg.sk.domain.AttResRspp; |
|
|
import com.kms.yg.sk.domain.AttResRspp; |
|
|
import com.kms.yg.sk.service.AttResBaseService; |
|
|
import com.kms.yg.sk.service.AttResBaseService; |
|
|
import com.kms.yg.sk.service.AttResRsppService; |
|
|
import com.kms.yg.sk.service.AttResRsppService; |
|
|
|
|
|
import com.kms.yg.sz.domain.BsSgcSzCxjl; |
|
|
|
|
|
import com.kms.yg.sz.domain.BsSgcSzGcjg; |
|
|
import com.kms.yg.sz.domain.BsSgcSzSafeJbxx; |
|
|
import com.kms.yg.sz.domain.BsSgcSzSafeJbxx; |
|
|
|
|
|
import com.kms.yg.sz.domain.BsSgcSzSwtz; |
|
|
|
|
|
import com.kms.yg.sz.service.BsSgcSzCxjlService; |
|
|
|
|
|
import com.kms.yg.sz.service.BsSgcSzGcjgService; |
|
|
import com.kms.yg.sz.service.BsSgcSzSafeJbxxService; |
|
|
import com.kms.yg.sz.service.BsSgcSzSafeJbxxService; |
|
|
|
|
|
import com.kms.yg.sz.service.BsSgcSzSwtzService; |
|
|
import com.kms.yg.xgxd.domain.AttDpdsBase; |
|
|
import com.kms.yg.xgxd.domain.AttDpdsBase; |
|
|
import com.kms.yg.xgxd.service.AttDpdsBaseService; |
|
|
import com.kms.yg.xgxd.service.AttDpdsBaseService; |
|
|
|
|
|
import com.shuili.common.utils.password.MD5Util; |
|
|
|
|
|
import io.swagger.models.auth.In; |
|
|
import lombok.Data; |
|
|
import lombok.Data; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.context.annotation.Configuration; |
|
|
import org.springframework.context.annotation.Configuration; |
|
@ -31,6 +37,8 @@ import org.springframework.scheduling.annotation.Scheduled; |
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Date; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.concurrent.ExecutionException; |
|
|
import java.util.concurrent.ExecutionException; |
|
@ -90,21 +98,36 @@ public class YgSynchronous { |
|
|
static final String xgxdsj = "http://19.25.35.205:31190/ZHSL_ZY/jck/yggx/dws_att_dpds_base" ; |
|
|
static final String xgxdsj = "http://19.25.35.205:31190/ZHSL_ZY/jck/yggx/dws_att_dpds_base" ; |
|
|
//流域基本数据
|
|
|
//流域基本数据
|
|
|
static final String llsj = "http://19.25.35.205:31190/ZHSL_ZY/jck/ytjgx/dws_att_bas_base" ; |
|
|
static final String llsj = "http://19.25.35.205:31190/ZHSL_ZY/jck/ytjgx/dws_att_bas_base" ; |
|
|
//水闸基础信息
|
|
|
|
|
|
static final String dawb="http://19.25.35.205:31190/ZHSL_ZY/jck/yggx/dws_att_waga_base"; |
|
|
|
|
|
//堤防基础信息
|
|
|
|
|
|
static final String dadb= "http://19.25.35.205:31190/ZHSL_ZY/jck/yggx/dws_att_dike_base"; |
|
|
|
|
|
//水闸行政区划关系数据
|
|
|
//水闸行政区划关系数据
|
|
|
static final String drwa="http://19.25.35.205:31190/ZHSL_ZY/dws_rel_waga_ad"; |
|
|
static final String drwa="http://19.25.35.205:31190/ZHSL_ZY/dws_rel_waga_ad"; |
|
|
//堤防行政区划关系数据
|
|
|
//堤防行政区划关系数据
|
|
|
static final String drda="http://19.25.35.205:31190/ZHSL_ZY/dws_rel_dike_ad"; |
|
|
static final String drda="http://19.25.35.205:31190/ZHSL_ZY/dws_rel_dike_ad"; |
|
|
//堤防水文特征数据
|
|
|
//堤防水文特征数据
|
|
|
static final String dadt="http://19.25.35.205:31190/ZHSL_ZY/jck/ytjgx/dws_att_dike_bsfst"; |
|
|
static final String dadt="http://19.25.35.205:31190/ZHSL_ZY/jck/ytjgx/dws_att_dike_bsfst"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//水闸编码***
|
|
|
|
|
|
static final String dawc = "http://19.25.35.205:31190/ZHSL_ZY/dws_att_waga_code"; |
|
|
|
|
|
//水闸基础信息
|
|
|
|
|
|
static final String dawb= "http://19.25.35.205:31190/ZHSL_ZY/jck/yggx/dws_att_waga_base"; |
|
|
|
|
|
//水闸水文特征***
|
|
|
|
|
|
static final String daws = "http://19.25.35.205:31190/ZHSL_ZY/jck/ytjgx/dws_att_waga_slhypr"; |
|
|
|
|
|
//水闸工程结构***
|
|
|
|
|
|
static final String dawsl= "http://19.25.35.205:31190/ZHSL_ZY/dws_att_waga_sligvl"; |
|
|
|
|
|
//水闸出险记录***
|
|
|
|
|
|
static final String dawst= "http://19.25.35.205:31190/ZHSL_ZY/jck/yggx/dws_att_waga_sldnnt"; |
|
|
|
|
|
//堤防基础信息
|
|
|
|
|
|
static final String dadb= "http://19.25.35.205:31190/ZHSL_ZY/jck/yggx/dws_att_dike_base"; |
|
|
|
|
|
//堤防历史决溢记录***
|
|
|
|
|
|
static final String dadd = "http://19.25.35.205:31190/ZHSL_ZY/jck/ytjgx/dws_att_dike_dkhos"; |
|
|
|
|
|
//堤防主要效益指标***
|
|
|
|
|
|
static final String daddt = "http://19.25.35.205:31190/ZHSL_ZY/jck/ytjgx/dws_att_dike_dbiabt"; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 同步 |
|
|
* 同步 |
|
|
*/ |
|
|
*/ |
|
|
@GetMapping("sktz1") |
|
|
public void synchronous() { |
|
|
public void synchronous() throws ExecutionException, InterruptedException { |
|
|
|
|
|
int pageNum = 1; |
|
|
int pageNum = 1; |
|
|
int pageSize = 1000; |
|
|
int pageSize = 1000; |
|
|
Boolean f = true; |
|
|
Boolean f = true; |
|
@ -357,10 +380,139 @@ public class YgSynchronous { |
|
|
List<AttBasBase> attRvBases = JSONObject.parseArray(data, AttBasBase.class); |
|
|
List<AttBasBase> attRvBases = JSONObject.parseArray(data, AttBasBase.class); |
|
|
attRvBases.forEach(attResRspp -> { |
|
|
attRvBases.forEach(attResRspp -> { |
|
|
attResRspp.preInsert(); |
|
|
attResRspp.preInsert(); |
|
|
// attResRspp.setId(attResRspp.getBasCode());
|
|
|
attResRspp.setId(attResRspp.getBasCode()); |
|
|
attBasBaseService.saveOrUpdate(attResRspp); |
|
|
attBasBaseService.saveOrUpdate(attResRspp); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 水闸编码 |
|
|
|
|
|
*/ |
|
|
|
|
|
@GetMapping("dawc") |
|
|
|
|
|
@Scheduled(cron = "0 0 0 * * ?") |
|
|
|
|
|
public void dawc(){ |
|
|
|
|
|
int pageNum = 1; |
|
|
|
|
|
int pageSize = 99999; |
|
|
|
|
|
String s = sendRequest( dawc+ "?pageNum=" + pageNum + "&pageSize=" + pageSize); |
|
|
|
|
|
String data = JSONObject.parseObject(s).getString("data"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
BsSgcSzSwtzService bsSgcSzSwtzService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
BsSgcSzGcjgService bsSgcSzGcjgService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
BsSgcSzCxjlService bsSgcSzCxjlService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
BsSgcDfJyjlService bsSgcDfJyjlService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
BsSgcDfGcxyService bsSgcDfGcxyService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 水闸水文特征 |
|
|
|
|
|
*/ |
|
|
|
|
|
@GetMapping("水闸水文特征") |
|
|
|
|
|
@Scheduled(initialDelay = 0, fixedRate = Long.MAX_VALUE) |
|
|
|
|
|
public void daws(){ |
|
|
|
|
|
int pageNum = 1; |
|
|
|
|
|
int pageSize = 9999999; |
|
|
|
|
|
String s = sendRequest( daws+ "?pageNum=" + pageNum + "&pageSize=" + pageSize); |
|
|
|
|
|
String data = JSONObject.parseObject(s).getString("data"); |
|
|
|
|
|
List<BsSgcSzSwtz> bsSgcSzSwtzs = JSONObject.parseArray(data, BsSgcSzSwtz.class); |
|
|
|
|
|
for (BsSgcSzSwtz bsSgcSzSwtz : bsSgcSzSwtzs) { |
|
|
|
|
|
bsSgcSzSwtz.preInsert(); |
|
|
|
|
|
bsSgcSzSwtz.setId(bsSgcSzSwtz.getWagaCode()); |
|
|
|
|
|
bsSgcSzSwtzService.saveOrUpdate(bsSgcSzSwtz); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 水闸工程结构 |
|
|
|
|
|
*/ |
|
|
|
|
|
@GetMapping("dawsl") |
|
|
|
|
|
@Scheduled(initialDelay = 0, fixedRate = Long.MAX_VALUE) |
|
|
|
|
|
public void dawsl(){ |
|
|
|
|
|
int pageNum = 1; |
|
|
|
|
|
int pageSize = 9999999; |
|
|
|
|
|
String s = sendRequest( dawsl+ "?pageNum=" + pageNum + "&pageSize=" + pageSize); |
|
|
|
|
|
String data = JSONObject.parseObject(s).getString("data"); |
|
|
|
|
|
List<BsSgcSzGcjg> bsSgcSzGcjgs = JSONObject.parseArray(data, BsSgcSzGcjg.class); |
|
|
|
|
|
for (BsSgcSzGcjg bsSgcSzGcjg : bsSgcSzGcjgs) { |
|
|
|
|
|
bsSgcSzGcjg.preInsert(); |
|
|
|
|
|
bsSgcSzGcjg.setId(bsSgcSzGcjg.getWagaCode()); |
|
|
|
|
|
bsSgcSzGcjgService.saveOrUpdate(bsSgcSzGcjg); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 水闸出险记录 |
|
|
|
|
|
*/ |
|
|
|
|
|
@GetMapping("dawst") |
|
|
|
|
|
@Scheduled(initialDelay = 0, fixedRate = Long.MAX_VALUE) |
|
|
|
|
|
public void dawst(){ |
|
|
|
|
|
System.out.println("执行了00000000000"); |
|
|
|
|
|
int pageNum = 1; |
|
|
|
|
|
int pageSize = 9999999; |
|
|
|
|
|
String s = sendRequest( dawst+ "?pageNum=" + pageNum + "&pageSize=" + pageSize); |
|
|
|
|
|
String data = JSONObject.parseObject(s).getString("data"); |
|
|
|
|
|
List<BsSgcSzCxjl> bsSgcSzCxjls = JSONObject.parseArray(data, BsSgcSzCxjl.class); |
|
|
|
|
|
for (BsSgcSzCxjl bsSgcSzCxjl : bsSgcSzCxjls) { |
|
|
|
|
|
bsSgcSzCxjl.preInsert(); |
|
|
|
|
|
Date fntm = bsSgcSzCxjl.getDNTM(); |
|
|
|
|
|
String u = bsSgcSzCxjl.getWagaCode()+fntm.getTime(); |
|
|
|
|
|
String id = MD5Util.MD5Encode(u, "utf-8"); |
|
|
|
|
|
bsSgcSzCxjl.setId(id); |
|
|
|
|
|
bsSgcSzCxjlService.saveOrUpdate(bsSgcSzCxjl); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 堤防历史决溢记录 |
|
|
|
|
|
*/ |
|
|
|
|
|
@GetMapping("dadd") |
|
|
|
|
|
@Scheduled(initialDelay = 0, fixedRate = Long.MAX_VALUE) |
|
|
|
|
|
public void dadd(){ |
|
|
|
|
|
int pageNum = 1; |
|
|
|
|
|
int pageSize = 9999999; |
|
|
|
|
|
String s = sendRequest( dadd+ "?pageNum=" + pageNum + "&pageSize=" + pageSize); |
|
|
|
|
|
String data = JSONObject.parseObject(s).getString("data"); |
|
|
|
|
|
List<BsSgcDfJyjl> bsSgcSzCxjls = JSONObject.parseArray(data, BsSgcDfJyjl.class); |
|
|
|
|
|
for (BsSgcDfJyjl bsSgcSzCxjl : bsSgcSzCxjls) { |
|
|
|
|
|
bsSgcSzCxjl.preInsert(); |
|
|
|
|
|
Date brspTime = bsSgcSzCxjl.getBrspDateTime(); |
|
|
|
|
|
String dikeCode = bsSgcSzCxjl.getDikeCode(); |
|
|
|
|
|
String u = brspTime.getTime() + dikeCode; |
|
|
|
|
|
String id = MD5Util.MD5Encode(u, "utf-8"); |
|
|
|
|
|
bsSgcSzCxjl.setId(id); |
|
|
|
|
|
bsSgcDfJyjlService.saveOrUpdate(bsSgcSzCxjl); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 堤防历史决溢记录 |
|
|
|
|
|
*/ |
|
|
|
|
|
@GetMapping("daddt") |
|
|
|
|
|
@Scheduled(initialDelay = 0, fixedRate = Long.MAX_VALUE) |
|
|
|
|
|
public void daddt(){ |
|
|
|
|
|
int pageNum = 1; |
|
|
|
|
|
int pageSize = 9999999; |
|
|
|
|
|
String s = sendRequest( daddt+ "?pageNum=" + pageNum + "&pageSize=" + pageSize); |
|
|
|
|
|
String data = JSONObject.parseObject(s).getString("data"); |
|
|
|
|
|
List<BsSgcDfGcxy> bsSgcDfGcxies = JSONObject.parseArray(data, BsSgcDfGcxy.class); |
|
|
|
|
|
bsSgcDfGcxyService.remove(new QueryWrapper<>()); |
|
|
|
|
|
for (BsSgcDfGcxy bsSgcDfGcxy : bsSgcDfGcxies) { |
|
|
|
|
|
bsSgcDfGcxy.preInsert(); |
|
|
|
|
|
bsSgcDfGcxyService.saveOrUpdate(bsSgcDfGcxy); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|