Commit b4d12061 authored by mcb's avatar mcb

no message

parent d4b3076f
......@@ -4,4 +4,5 @@ alter table dmp_develop_task add SOURCE_TABLE_NAME varchar(64) default NULL COMM
alter table dmp_develop_task add TARGET_DB_NAME varchar(64) default NULL COMMENT'目标数据库名称';
alter table dmp_develop_task add TARGET_TABLE_NAME varchar(64) default NULL COMMENT'目标数据表名称';
alter table dmp_syncing_datasource_type add DB_ATTRS json default null comment '数据库属性';
alter table dmp_syncing_datasource add NETWORK_CONNECTION_TYPE varchar(64) default null comment '网络连接类型';
\ No newline at end of file
alter table dmp_syncing_datasource add NETWORK_CONNECTION_TYPE varchar(64) default null comment '网络连接类型';
alter table dmp_syncing_datasource add TEST_CONNECT_STATUS char(2) default '01' comment '测试连通状态:01未测试,02连通性正常,03连通性异常';
\ No newline at end of file
package com.jz.common.enums;
/**
* 测试连通状态
*
* @author Bellamy
* @since 2021-01-04 14:30:23
*/
public enum TestConnectStatusEnum {
/**
* 测试
*/
WCS("WCS", "01"),
/**
* 连通性正常
*/
CSZC("CSZC", "02"),
/**
* 连通性异常
*/
CSYC("CSYC", "03"),
;
private String code;
private String value;
private TestConnectStatusEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static TestConnectStatusEnum get(String code) {
if (code == null) {
return null;
}
for (TestConnectStatusEnum status : values()) {
if (status.getCode().equalsIgnoreCase(code)) {
return status;
}
}
return null;
}
}
......@@ -86,6 +86,12 @@ public class DataSourceListDto {
@ApiModelProperty(value = "项目id")
private String projectId;
/**
* 测试连通状态:01未测试,02连通性正常,03连通性异常
*/
@ApiModelProperty(value = "测试连通状态:01未测试,02连通性正常,03连通性异常")
private String testConnectStatus;
public Long getId() {
return id;
}
......@@ -181,4 +187,12 @@ public class DataSourceListDto {
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getTestConnectStatus() {
return testConnectStatus;
}
public void setTestConnectStatus(String testConnectStatus) {
this.testConnectStatus = testConnectStatus;
}
}
......@@ -57,6 +57,13 @@ public class DmpSyncingDatasourceReq implements Serializable {
@NotEmpty(message = "账号不能为空")
@ApiModelProperty(value = "账号")
private String userName;
/**
* 测试连通状态:01未测试,02连通性正常,03连通性异常
*/
@ApiModelProperty(value = "测试连通状态:01未测试,02连通性正常,03连通性异常")
private String testConnectStatus;
/**
* 密码
*/
......@@ -290,4 +297,12 @@ public class DmpSyncingDatasourceReq implements Serializable {
public void setNetworkConnectionType(String networkConnectionType) {
this.networkConnectionType = networkConnectionType;
}
public String getTestConnectStatus() {
return testConnectStatus;
}
public void setTestConnectStatus(String testConnectStatus) {
this.testConnectStatus = testConnectStatus;
}
}
\ No newline at end of file
......@@ -142,6 +142,12 @@ public class DmpSyncingDatasource implements Serializable {
@ApiModelProperty(value = "网络连接类型")
private String networkConnectionType;
/**
* 测试连通状态:01未测试,02连通性正常,03连通性异常
*/
@ApiModelProperty(value = "测试连通状态:01未测试,02连通性正常,03连通性异常")
private String testConnectStatus;
public Integer getId() {
return id;
}
......@@ -365,4 +371,12 @@ public class DmpSyncingDatasource implements Serializable {
public void setNetworkConnectionType(String networkConnectionType) {
this.networkConnectionType = networkConnectionType;
}
public String getTestConnectStatus() {
return testConnectStatus;
}
public void setTestConnectStatus(String testConnectStatus) {
this.testConnectStatus = testConnectStatus;
}
}
\ No newline at end of file
......@@ -122,6 +122,7 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
long treeId = body.getTreeId();
//通过树节点id 查询任务信息
DmpDevelopTask task = dmpDevelopTaskDao.selectTaskInfoByParam(treeId);
Map<String, Object> map = (Map<String, Object>) JsonMapper.fromJsonString(task.getScript(), Map.class);
Map<String, Object> scriptMap = (Map<String, Object>) map.get("scripts");
......
......@@ -7,6 +7,7 @@ import com.github.pagehelper.PageInfo;
import com.jz.agent.service.DmpDsAgentService;
import com.jz.common.constant.JsonResult;
import com.jz.common.constant.ResultCode;
import com.jz.common.enums.TestConnectStatusEnum;
import com.jz.common.page.PageInfoResponse;
import com.jz.common.utils.JsonMapper;
import com.jz.dmp.agent.DmpAgentResult;
......@@ -204,6 +205,7 @@ public class DmpSyncingDatasourceServiceImpl implements DmpSyncingDatasourceServ
dsd.setDatasourceType(Integer.valueOf(saveBody.getDatasourceType())); //数据源类型ID
dsd.setProjectId(Integer.valueOf(saveBody.getProjectId()));
dsd.setDataStatus("1");
dsd.setTestConnectStatus(TestConnectStatusEnum.WCS.getValue());
dmpSyncingDatasourceDao.insert(dsd);
return new JsonResult(dsd);
}
......@@ -220,6 +222,7 @@ public class DmpSyncingDatasourceServiceImpl implements DmpSyncingDatasourceServ
if (!rst.getCode().val().equals("200")) {
return new JsonResult(rst.getCode(), rst.getMessage());
} else {
//连接测试成功
rst.setResult(JsonMapper.fromJsonString(rst.getMessage(), Boolean.class));
return new JsonResult(ResultCode.SUCCESS, rst);
}
......
......@@ -127,9 +127,9 @@
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into dmp_syncing_datasource(DATASOURCE_TYPE, DATASOURCE_NAME, DATASOURCE_DESC, JDBC_URL, DB_NAME, USER_NAME, PASSWORD, ENDPOINT, BUCKET, ACCESS_ID
, ACCESS_KEY, PROTOCOL, HOST, PORT, DEFAULT_FS, TABLE_SCHEMA, DATA_STATUS, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, PROJECT_ID, NETWORK_CONNECTION_TYPE)
, ACCESS_KEY, PROTOCOL, HOST, PORT, DEFAULT_FS, TABLE_SCHEMA, DATA_STATUS, CREATE_USER_ID, CREATE_TIME, UPDATE_USER_ID, UPDATE_TIME, PROJECT_ID, NETWORK_CONNECTION_TYPE ,TEST_CONNECT_STATUS)
values (#{datasourceType}, #{datasourceName}, #{datasourceDesc}, #{jdbcUrl}, #{dbName}, #{userName}, #{password}, #{endpoint}, #{bucket}, #{accessId}, #{accessKey}
, #{protocol}, #{host}, #{port}, #{defaultFs}, #{tableSchema}, #{dataStatus}, #{createUserId}, #{createTime}, #{updateUserId}, #{updateTime}, #{projectId}, #{networkConnectionType})
, #{protocol}, #{host}, #{port}, #{defaultFs}, #{tableSchema}, #{dataStatus}, #{createUserId}, #{createTime}, #{updateUserId}, #{updateTime}, #{projectId}, #{networkConnectionType} ,#{testConnectStatus})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
......@@ -265,7 +265,8 @@
a.user_name as userName,
date_format(a.CREATE_TIME,'%Y-%m-%d %H:%i:%s') as createTime,
date_format(a.update_time,'%Y-%m-%d %H:%i:%s') as updateTime,
a.project_id as projectId
a.project_id as projectId,
(case when a.test_connect_status='01' then '未测试' when a.test_connect_status='02' then '正常' when a.test_connect_status='03' then '异常' end) testConnectStatus
from dmp_syncing_datasource a
inner join dmp_syncing_datasource_type b on a.datasource_type = b.id
where a.data_status = '1'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment