河北转换提交
This commit is contained in:
@@ -8,4 +8,7 @@ public interface OracleToInfluxDBService {
|
||||
void hourseDataBacthSysc(DataAsynParam dataAsynParam);
|
||||
|
||||
void AsyncData(DataAsynParam dataAsynParam);
|
||||
|
||||
|
||||
void oneMonitorDataTransport(DataAsynParam dataAsynParam);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.njcn.influx.service.PqLineBakService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
@@ -86,7 +87,7 @@ public class OracleEventDetailToMysqlServiceImpl extends ServiceImpl<RmpEventDet
|
||||
LocalDateTime startTime = oracleDetail.getStartTime();
|
||||
LocalDateTime time = startTime.plus(oracleDetail.getMs(), ChronoUnit.MILLIS);
|
||||
po.setStartTime(time);
|
||||
po.setDuration(oracleDetail.getDuration());
|
||||
po.setDuration(oracleDetail.getDuration().divide(BigDecimal.valueOf(1000)));
|
||||
po.setFeatureAmplitude(oracleDetail.getFeatureAmplitude());
|
||||
po.setPhase(oracleDetail.getPhase());
|
||||
po.setEventDescribe(oracleDetail.getEventDescribe());
|
||||
|
||||
@@ -59,6 +59,20 @@ public class OracleToInfluxDBController {
|
||||
return true;// HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, "数据同步");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/oneMonitorDataTransport")
|
||||
@ApiOperation("单个监测点数据同步")
|
||||
@ApiImplicitParam(name = "dataAsynParam", value = "数据同步参数", required = true)
|
||||
@SneakyThrows
|
||||
public Boolean oneMonitorDataTransport(@RequestBody DataAsynParam dataAsynParam){
|
||||
|
||||
oracleToInfluxDBService.oneMonitorDataTransport(dataAsynParam);
|
||||
|
||||
return true;// HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, "数据同步");
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/onlinerateSync")
|
||||
@ApiOperation("onlinerate表数据同步")
|
||||
public Boolean onlinerateSync(@RequestParam("startDateTime") String startDateTime,@RequestParam("endDateTime") String endDateTime) {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class OracleToInfluxDBJob {
|
||||
|
||||
//每小时03分钟时执行上一个小时的数据同步
|
||||
//河北这边比较特殊,
|
||||
@Scheduled(cron="0 3 * * * ?")
|
||||
@Scheduled(cron="0 40 * * * ?")
|
||||
public void executeHours() {
|
||||
DataAsynParam dataAsynParam = new DataAsynParam();
|
||||
// 获取当前时间
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
#文件位置配置
|
||||
business:
|
||||
#分片次数,一定为24的约数,1 2 3 4 6 8 12 24
|
||||
slice: 4
|
||||
server:
|
||||
port: 8090
|
||||
spring:
|
||||
#influxDB内容配置
|
||||
influx:
|
||||
url: http://25.36.232.36:8086
|
||||
user: admin
|
||||
password: admin
|
||||
database: pqsbase_hbcs
|
||||
mapper-location: com.njcn.influx.imapper
|
||||
application:
|
||||
name: oracle-influx
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
dynamic:
|
||||
druid:
|
||||
initial-size: 10
|
||||
# 初始化大小,最小,最大
|
||||
min-idle: 20
|
||||
maxActive: 500
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
testWhileIdle: true
|
||||
testOnBorrow: true
|
||||
validation-query: SELECT 1 from dual
|
||||
testOnReturn: false
|
||||
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||||
poolPreparedStatements: true
|
||||
maxPoolPreparedStatementPerConnectionSize: 20
|
||||
filters: stat,wall
|
||||
filter:
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
none-base-statement-allow: true
|
||||
enabled: true
|
||||
# 配置DruidStatFilter
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
url-pattern: "/*"
|
||||
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
|
||||
# 配置DruidStatViewServlet
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: "/druid/*"
|
||||
# IP白名单(没有配置或者为空,则允许所有访问)
|
||||
allow: #127.0.0.1,192.168.163.1
|
||||
# IP黑名单 (存在共同时,deny优先于allow)
|
||||
deny: #192.168.1.73
|
||||
# 禁用HTML页面上的“Reset All”功能
|
||||
reset-enable: false
|
||||
# 登录名
|
||||
login-username: admin
|
||||
# 登录密码
|
||||
login-password: njcnpqs
|
||||
query-timeout: 36000
|
||||
primary: master
|
||||
strict: false
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:oracle:thin:@10.122.32.73:11521/dwxb
|
||||
username: pqsadmin
|
||||
password: pqsadmin_123
|
||||
driver-class-name: oracle.jdbc.driver.OracleDriver
|
||||
target:
|
||||
url: jdbc:mysql://25.36.232.37:13306/pmsinfo?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: Huawei12#
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#mybatis配置信息
|
||||
mybatis-plus:
|
||||
#别名扫描
|
||||
type-aliases-package: com.njcn.oracle.bo
|
||||
mapper-locations: classpath*:com/njcn/**/mapping/*.xml
|
||||
configuration:
|
||||
#驼峰命名
|
||||
map-underscore-to-camel-case: true
|
||||
#配置sql日志输出
|
||||
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
#关闭日志输出
|
||||
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||
global-config:
|
||||
db-config:
|
||||
#指定主键生成策略
|
||||
id-type: assign_uuid
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
#文件位置配置
|
||||
business:
|
||||
#分片次数,一定为24的约数,1 2 3 4 6 8 12 24
|
||||
slice: 4
|
||||
server:
|
||||
port: 8090
|
||||
spring:
|
||||
#influxDB内容配置
|
||||
influx:
|
||||
url: http://192.168.1.102:8086
|
||||
user: admin
|
||||
password: 123456
|
||||
database: pqsbase_sjzx
|
||||
mapper-location: com.njcn.influx.imapper
|
||||
application:
|
||||
name: oracle-influx
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
dynamic:
|
||||
druid:
|
||||
initial-size: 10
|
||||
# 初始化大小,最小,最大
|
||||
min-idle: 20
|
||||
maxActive: 500
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
testWhileIdle: true
|
||||
testOnBorrow: true
|
||||
validation-query: SELECT 1 from dual
|
||||
testOnReturn: false
|
||||
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||||
poolPreparedStatements: true
|
||||
maxPoolPreparedStatementPerConnectionSize: 20
|
||||
filters: stat,wall
|
||||
filter:
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
none-base-statement-allow: true
|
||||
enabled: true
|
||||
# 配置DruidStatFilter
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
url-pattern: "/*"
|
||||
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
|
||||
# 配置DruidStatViewServlet
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: "/druid/*"
|
||||
# IP白名单(没有配置或者为空,则允许所有访问)
|
||||
allow: #127.0.0.1,192.168.163.1
|
||||
# IP黑名单 (存在共同时,deny优先于allow)
|
||||
deny: #192.168.1.73
|
||||
# 禁用HTML页面上的“Reset All”功能
|
||||
reset-enable: false
|
||||
# 登录名
|
||||
login-username: admin
|
||||
# 登录密码
|
||||
login-password: njcnpqs
|
||||
query-timeout: 36000
|
||||
primary: master
|
||||
strict: false
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:oracle:thin:@192.168.1.101:1521:pqsbase
|
||||
username: pqsadmin
|
||||
password: Pqsadmin123
|
||||
driver-class-name: oracle.jdbc.driver.OracleDriver
|
||||
target:
|
||||
url: jdbc:mysql://192.168.1.102:13306/pqsinfo?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=CTT
|
||||
username: root
|
||||
password: njcnpqs
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#mybatis配置信息
|
||||
mybatis-plus:
|
||||
#别名扫描
|
||||
type-aliases-package: com.njcn.oracle.bo
|
||||
mapper-locations: classpath*:com/njcn/**/mapping/*.xml
|
||||
configuration:
|
||||
#驼峰命名
|
||||
map-underscore-to-camel-case: true
|
||||
#配置sql日志输出
|
||||
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
#关闭日志输出
|
||||
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||
global-config:
|
||||
db-config:
|
||||
#指定主键生成策略
|
||||
id-type: assign_uuid
|
||||
|
||||
@@ -60,10 +60,24 @@
|
||||
<el-option label="未执行" value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="query">查询</el-button>
|
||||
<el-button type="primary" @click="move()">迁移</el-button>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<br>
|
||||
<el-form-item label="监测点id">
|
||||
<el-input v-model="formInline.monitorId" placeholder="请填写需要补招的监测点id" clearable/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="oneMonitorMove()">单监测点数据迁移</el-button>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<el-table :data="tableData" style="width: 100%; height: calc(100vh - 120px)" stripe align="center" v-loading="formInline.loading">
|
||||
<el-table-column prop="tableName" label="指标名"></el-table-column>
|
||||
@@ -166,6 +180,7 @@
|
||||
'DataV',
|
||||
],
|
||||
date: [formatTime(new Date()), formatTime(new Date())],
|
||||
monitorId:'',
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
@@ -221,7 +236,7 @@
|
||||
let obj = {
|
||||
tableNames: formInline.tableNames,
|
||||
startTime: formInline.date[0],
|
||||
endTime: formInline.date[1],
|
||||
endTime: formInline.date[1]
|
||||
}
|
||||
if (row) {
|
||||
obj = {
|
||||
@@ -250,6 +265,41 @@
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const oneMonitorMove = () => {
|
||||
|
||||
if(!formInline.monitorId){
|
||||
ElementPlus.ElMessage.error('请填写监测点id')
|
||||
return
|
||||
}
|
||||
|
||||
let obj = {
|
||||
tableNames: formInline.tableNames,
|
||||
startTime: formInline.date[0],
|
||||
endTime: formInline.date[1],
|
||||
monitorId:formInline.monitorId
|
||||
}
|
||||
|
||||
fetch('/data/oneMonitorDataTransport', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(obj),
|
||||
})
|
||||
.then((res) => {
|
||||
return res.json()
|
||||
})
|
||||
.then((res) => {
|
||||
if (res) {
|
||||
ElementPlus.ElMessage.success('单个监测点数据迁移成功')
|
||||
query()
|
||||
} else {
|
||||
ElementPlus.ElMessage.error('单个监测点数据迁移失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 处理数据精度
|
||||
const formatNumber = (row,column) =>{
|
||||
const duration = row[column];
|
||||
@@ -291,6 +341,9 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return {
|
||||
handleCheckAllChange,
|
||||
message,
|
||||
@@ -300,6 +353,7 @@
|
||||
handleCurrentChange,
|
||||
handleSizeChange,
|
||||
move,
|
||||
oneMonitorMove,
|
||||
jobRemove,
|
||||
formatNumber,
|
||||
}
|
||||
|
||||
@@ -31,4 +31,6 @@ public class DataAsynParam {
|
||||
//执行同步数据类型1:重网页端,2跑批处理
|
||||
private Integer excuteType=1;
|
||||
|
||||
private Integer monitorId;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user