Commit 6cce39b2 authored by mcb's avatar mcb

no message

parent 69976e70
...@@ -17,3 +17,5 @@ add jaas_address varchar(128) DEFAULT NULL COMMENT 'jaas地址(Kafka)', ...@@ -17,3 +17,5 @@ add jaas_address varchar(128) DEFAULT NULL COMMENT 'jaas地址(Kafka)',
add krb5_address varchar(128) DEFAULT NULL COMMENT 'krb5地址(Kafka)', add krb5_address varchar(128) DEFAULT NULL COMMENT 'krb5地址(Kafka)',
add kudu_master varchar(128) DEFAULT NULL COMMENT 'kkudu_master(Kudu)', add kudu_master varchar(128) DEFAULT NULL COMMENT 'kkudu_master(Kudu)',
add impala_master_fqdn varchar(128) DEFAULT NULL COMMENT 'impala_master_fqdn(Kudu)'; add impala_master_fqdn varchar(128) DEFAULT NULL COMMENT 'impala_master_fqdn(Kudu)';
alter table dmp_realtime_sync_info add online_status char(1) default 'N' comment '上下线状态:Y 上线,N 下线';
...@@ -302,4 +302,31 @@ public class RealTimeSyncController { ...@@ -302,4 +302,31 @@ public class RealTimeSyncController {
JsonResult<RealTimeEditDataEchoDto> jsonResult = dmpRealtimeSyncInfoService.selectRealtimeTaskById(taskId); JsonResult<RealTimeEditDataEchoDto> jsonResult = dmpRealtimeSyncInfoService.selectRealtimeTaskById(taskId);
return jsonResult; return jsonResult;
} }
/**
* 批量上下线
*
* @return
* @author Bellamy
* @since 2021-01-05
*/
@ApiOperation(value = "批量上下线", notes = "批量上下线")
@GetMapping(value = "/batchUptOnlineStatus")
@ApiImplicitParams({@ApiImplicitParam(name = "realTaskId", value = "任务id",required = true),
@ApiImplicitParam(name = "onlineStatus", value = "上下线状态:Y 上线,N 下线",required = true)})
public JsonResult batchUptOnlineStatus(@RequestParam String realTaskId,@RequestParam String onlineStatus) throws Exception {
logger.info("###################请求参数{}taskId=" + realTaskId + "###################");
if (StringUtils.isEmpty(realTaskId)) {
return new JsonResult(ResultCode.PARAMS_ERROR, "任务id不能为空!");
}
if (StringUtils.isEmpty(onlineStatus)) {
return new JsonResult(ResultCode.PARAMS_ERROR, "状态不能为空!");
}
boolean jsonResult = dmpRealtimeSyncInfoService.batchUptOnlineStatus(realTaskId,onlineStatus);
if (jsonResult) {
return JsonResult.ok();
} else {
return JsonResult.error("删除失败!");
}
}
} }
\ No newline at end of file
...@@ -80,6 +80,9 @@ public class RealTimeSyncListDto { ...@@ -80,6 +80,9 @@ public class RealTimeSyncListDto {
@ApiModelProperty(value = "去向数据源类型") @ApiModelProperty(value = "去向数据源类型")
private String targetDatabaseType; private String targetDatabaseType;
@ApiModelProperty(value = "上下线状态:Y 上线,N 下线")
private String onlineStatus;
public String getId() { public String getId() {
return id; return id;
} }
...@@ -167,4 +170,12 @@ public class RealTimeSyncListDto { ...@@ -167,4 +170,12 @@ public class RealTimeSyncListDto {
public void setTargetDatabaseType(String targetDatabaseType) { public void setTargetDatabaseType(String targetDatabaseType) {
this.targetDatabaseType = targetDatabaseType; this.targetDatabaseType = targetDatabaseType;
} }
public String getOnlineStatus() {
return onlineStatus;
}
public void setOnlineStatus(String onlineStatus) {
this.onlineStatus = onlineStatus;
}
} }
...@@ -235,8 +235,15 @@ public class DmpApiServiceMangeController { ...@@ -235,8 +235,15 @@ public class DmpApiServiceMangeController {
@ApiOperation(value = "获取数据源表字段", notes = "获取数据源表字段") @ApiOperation(value = "获取数据源表字段", notes = "获取数据源表字段")
@PostMapping(value = "/getTableColumns") @PostMapping(value = "/getTableColumns")
public JsonResult getTableColumns(@RequestBody @Validated SoureTableColumnsReq req) throws Exception { public JsonResult getTableColumns(@RequestBody @Validated SoureTableColumnsReq req) throws Exception {
JsonResult list = offlineSynchService.querySoureTableColumns(req); JsonResult jsonResult = new JsonResult();
return list; try {
jsonResult = offlineSynchService.querySoureTableColumns(req);
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return jsonResult;
} }
} }
\ No newline at end of file
...@@ -135,4 +135,13 @@ public interface DmpRealtimeSyncInfoService { ...@@ -135,4 +135,13 @@ public interface DmpRealtimeSyncInfoService {
* @author Bellamy * @author Bellamy
*/ */
boolean deleteByrealTaskId(String realTaskId) throws Exception; boolean deleteByrealTaskId(String realTaskId) throws Exception;
/**
* 批量上下线
*
* @return
* @author Bellamy
* @since 2021-01-05
*/
boolean batchUptOnlineStatus(String realTaskId, String onlineStatus) throws Exception;
} }
\ No newline at end of file
...@@ -838,4 +838,20 @@ public class DmpRealtimeSyncInfoServiceImpl implements DmpRealtimeSyncInfoServic ...@@ -838,4 +838,20 @@ public class DmpRealtimeSyncInfoServiceImpl implements DmpRealtimeSyncInfoServic
map.put("dataStatus", DelFlagEnum.YES.getValue()); map.put("dataStatus", DelFlagEnum.YES.getValue());
return dmpRealtimeSyncInfoDao.deleteByrealTaskId(map) > 0; return dmpRealtimeSyncInfoDao.deleteByrealTaskId(map) > 0;
} }
/**
* 批量上下线
*
* @return
* @author Bellamy
* @since 2021-01-05
*/
@Override
public boolean batchUptOnlineStatus(String realTaskId, String onlineStatus) throws Exception {
Map map = new HashMap();
String[] ids = realTaskId.split(",");
map.put("ids", ids);
map.put("onlineStatus", onlineStatus);
return dmpRealtimeSyncInfoDao.deleteByrealTaskId(map) > 0;
}
} }
\ No newline at end of file
...@@ -321,7 +321,8 @@ ...@@ -321,7 +321,8 @@
t1.src_database_type as srcDatabaseType, t1.src_database_type as srcDatabaseType,
t1.target_datasource_id as targetDatasourceId, t1.target_datasource_id as targetDatasourceId,
t1.target_datasource_name as targetDatasourceName, t1.target_datasource_name as targetDatasourceName,
t1.target_database_type as targetDatabaseType t1.target_database_type as targetDatabaseType,
t1.online_status as onlineStatus
FROM dmp_realtime_sync_info t1 FROM dmp_realtime_sync_info t1
inner join dmp_navigation_tree t2 on t1.tree_id=t2.id inner join dmp_navigation_tree t2 on t1.tree_id=t2.id
left join dmp_syncing_datasource t3 ON t1.src_datasource_id = t3.ID left join dmp_syncing_datasource t3 ON t1.src_datasource_id = t3.ID
...@@ -516,13 +517,16 @@ ...@@ -516,13 +517,16 @@
1 = 1 and t1.data_status='1' and id = #{taskId} 1 = 1 and t1.data_status='1' and id = #{taskId}
</select> </select>
<!--批量删除--> <!--批量删除 或 批量上下线-->
<update id="deleteByrealTaskId" parameterType="java.util.Map"> <update id="deleteByrealTaskId" parameterType="java.util.Map">
update dmp_realtime_sync_info update dmp_realtime_sync_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="dataStatus != null"> <if test="dataStatus != null">
data_status = #{dataStatus}, data_status = #{dataStatus},
</if> </if>
<if test="onlineStatus != null and onlineStatus != ''">
online_status = #{onlineStatus},
</if>
</trim> </trim>
where id in where id in
<foreach collection="ids" item="item" open="(" separator="," close=")"> <foreach collection="ids" item="item" open="(" separator="," close=")">
......
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