Commit 73273066 authored by mcb's avatar mcb

no message

parent b8dc5470
......@@ -124,6 +124,9 @@ public class DataSourceController {
@ApiOperation(value = "测试连通性", notes = "测试连通性")
@PostMapping(value = "/testConnection")
public JsonResult testConnection(@RequestBody @Validated DmpSyncingDatasourceReq saveBody, HttpServletRequest httpRequest) throws Exception {
if (StringUtils.isEmpty(saveBody.getDatasourceType())) {
return new JsonResult(ResultCode.PARAMS_ERROR,"数据源类型ID不能为空");
}
JsonResult result = dmpSyncingDatasourceService.testConnection(saveBody);
return result;
}
......
......@@ -34,7 +34,7 @@ public class OfflineSynchController {
private OfflineSynchService offlineSynchService;
/**
* 任务列表分页查询
* 离线同步任务列表分页查询
*
* @return
* @author Bellamy
......
......@@ -32,6 +32,12 @@ public class TaskListPageReq extends BasePageBean {
@ApiModelProperty(value = "创建人")
private String createUserId;
/*
* 任务名称
* */
@ApiModelProperty(value = "任务名称")
private String treeName;
// /*
// * 父类ID
// * */
......@@ -83,4 +89,12 @@ public class TaskListPageReq extends BasePageBean {
public void setCreateUserId(String createUserId) {
this.createUserId = createUserId;
}
public String getTreeName() {
return treeName;
}
public void setTreeName(String treeName) {
this.treeName = treeName;
}
}
......@@ -21,6 +21,12 @@ public class DataDevTaskListDto {
@ApiModelProperty(value = "任务ID")
private String taskId;
/*
* treeId
* */
@ApiModelProperty(value = "treeId")
private String treeId;
/*
* 任务名称
* */
......@@ -168,4 +174,12 @@ public class DataDevTaskListDto {
public void setType(String type) {
this.type = type;
}
public String getTreeId() {
return treeId;
}
public void setTreeId(String treeId) {
this.treeId = treeId;
}
}
......@@ -27,16 +27,16 @@ public class DataDevTaskListReq extends BasePageBean {
private String projectId;
/*
* 节点名称或id
* 任务名称或id
* */
@ApiModelProperty(value = "节点名称或id")
@ApiModelProperty(value = "任务名称或id")
private String treeIdOrName;
/*
* 节点id
* 任务id
* */
@ApiModelProperty(value = "节点id")
private String treeId;
@ApiModelProperty(value = "任务id")
private String taskId;
/*
* 任务类型
......@@ -60,12 +60,12 @@ public class DataDevTaskListReq extends BasePageBean {
this.treeIdOrName = treeIdOrName;
}
public String getTreeId() {
return treeId;
public String getTaskId() {
return taskId;
}
public void setTreeId(String treeId) {
this.treeId = treeId;
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getTaskType() {
......
package com.jz.dmp.modules.controller.dataService;
import com.jz.dmp.modules.service.DmpOrgMangeService;
import com.jz.dmp.modules.service.DvRuleTService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 数据服务组织管理
*
* @author Bellamy
* @since 2020-12-24 10:56:18
*/
@RestController
@RequestMapping("/orgMange")
@Api(tags = "数据服务-组织管理")
public class DmpOrgMangeController {
/**
* 服务对象
*/
@Autowired
private DmpOrgMangeService dmpOrgMangeService;
}
\ No newline at end of file
......@@ -29,5 +29,11 @@ public interface OfflineSynchDao {
List<CheckJyRlueStatusDto> selectCheckJyStatusInfo(@Param("executionId") String executionId) throws Exception;
/**
* 离线同步任务列表分页查询
*
* @return
* @author Bellamy
*/
List<TaskListPageDto> selectOfflineTaskInfo(TaskListPageReq taskListPageReq) throws Exception;
}
\ No newline at end of file
package com.jz.dmp.modules.service;
/**
* @ClassName: DmpOrgMangeService
* @Description: 数据服务组织管理
* @Author: Bellamy
* @Date 2021/1/15
* @Version 1.0
*/
public interface DmpOrgMangeService {
}
......@@ -17,7 +17,12 @@ import java.util.Map;
* @Version 1.0
*/
public interface OfflineSynchService {
/**
* 离线同步任务列表分页查询
*
* @return
* @author Bellamy
*/
PageInfoResponse<TaskListPageDto> queryTaskListPage(TaskListPageReq taskListPageReq) throws Exception;
JsonResult querygSourceDbList(Integer projectId) throws Exception;
......
......@@ -765,7 +765,7 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
//判断是否为整数 是整数返回true,否则返回false
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
if (pattern.matcher(req.getTreeIdOrName().trim()).matches()) {
req.setTreeId(req.getTreeIdOrName()); //id
req.setTaskId(req.getTreeIdOrName()); //id
req.setTreeIdOrName(null);
} else {
req.setTreeIdOrName(req.getTreeIdOrName().trim());//节点名称
......
package com.jz.dmp.modules.service.impl;
import com.jz.dmp.modules.service.DmpOrgMangeService;
import org.springframework.stereotype.Service;
/**
* @ClassName: DmpOrgMangeServiceImpl
* @Description: 数据服务组织管理
* @Author: Bellamy
* @Date 2021/1/15
* @Version 1.0
*/
@Service("dmpOrgMangeService")
public class DmpOrgMangeServiceImpl implements DmpOrgMangeService {
}
......@@ -7,6 +7,7 @@ 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.exception.ServiceException;
import com.jz.common.page.PageInfoResponse;
import com.jz.common.persistence.BaseService;
import com.jz.common.utils.JsonMapper;
......@@ -303,11 +304,12 @@ public class DmpSyncingDatasourceServiceImpl implements DmpSyncingDatasourceServ
DmpAgentDatasourceInfo ds = this.dsInfoDTO(saveBody); //查询数据源 对应的 数据库信息
DmpAgentResult rst = dmpDsAgentServiceImp.testConnect(ds); //连接测试
if (!rst.getCode().val().equals("200")) {
return new JsonResult(rst.getCode(), rst.getMessage());
return new JsonResult(ResultCode.INTERNAL_SERVER_ERROR,"连接测试失败!");
} else {
//连接测试成功
rst.setResult(JsonMapper.fromJsonString(rst.getMessage(), Boolean.class));
return new JsonResult(ResultCode.SUCCESS, rst);
Object flag = JsonMapper.fromJsonString(rst.getMessage(), Boolean.class);
//rst.setResult(JsonMapper.fromJsonString(rst.getMessage(), Boolean.class));
return new JsonResult(ResultCode.SUCCESS, "连接测试成功!");
}
}
......@@ -423,6 +425,10 @@ public class DmpSyncingDatasourceServiceImpl implements DmpSyncingDatasourceServ
ds.setDefaultFs(body.getDefaultFs());
DmpProjectSystemInfo info = dmpProjectDao.queryProjectSystemInfo(Long.valueOf(body.getProjectId()));
if(info == null){
//throw new RuntimeException("未查询到对应的项目系统配置信息");
throw new ServiceException("未查询到对应的项目系统配置信息");
}
ds.setKerberosIsenable(info.getKerberosIsenable());
ds.setKerberosJaasConf(info.getKerberosJaasConf());
ds.setKerberosKrb5Conf(info.getKerberosKrb5Conf());
......
......@@ -87,6 +87,12 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
@Autowired
private DvTaskRuleTService dvTaskRuleTService;
/**
* 离线同步任务列表分页查询
*
* @return
* @author Bellamy
*/
@Override
public PageInfoResponse<TaskListPageDto> queryTaskListPage(TaskListPageReq taskListPageReq) throws Exception {
PageInfoResponse<TaskListPageDto> pageInfoResponse = new PageInfoResponse<>();
......
......@@ -149,7 +149,8 @@
<select id="queryDevTaskListPage" resultType="com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto"
parameterType="com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq">
select
t1.id as taskId,
t1.id as treeId,
t2.id as taskId,
t1.name as taskName,
t1.type,
t1.create_user_id as createUserId,
......@@ -162,7 +163,7 @@
left join dmp_member t3 on t1.create_user_id=t3.user_id
where 1=1 and t1.type='01'
and t1.project_id = #{projectId}
<if test="treeId != null and treeId != ''"> and t1.id =#{treeId} </if>
<if test="taskId != null and taskId != ''"> and t2.id =#{taskId} </if>
<if test="treeIdOrName != null and treeIdOrName != ''"> and t1.name like concat('%',#{treeIdOrName},'%') </if>
<if test="taskType != null and taskType!= ''"> and t1.type=#{taskType} </if>
</select>
......
......@@ -171,23 +171,23 @@
</if>
</select>
<!--离线同步列表-->
<select id="selectOfflineTaskInfo" resultType="com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageDto"
parameterType="com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageReq">
SELECT
ddt.id AS taskId,
ddt.tree_id AS treeId,
dnt.NAME AS treeName,
dnt.CREATE_USER_ID as createUserId,
t3.real_name as createUserId,
DATE_FORMAT( ddt.create_time, '%Y-%m-%d %H:%i:%s' ) AS createTime,
DATE_FORMAT( ddt.update_time, '%Y-%m-%d %H:%i:%s' ) AS updateTime
FROM dmp_develop_task AS ddt
INNER JOIN dmp_navigation_tree AS dnt ON ddt.TREE_ID = dnt.ID
LEFT JOIN dmp_syncing_datasource AS dsd ON instr(script,concat('"targetDbConnection":"',dsd.datasource_name,'"'))>0
WHERE ddt.data_status ='1' AND ddt.TYPE='3' AND ddt.TASK_TYPE ='2'
AND dnt.CATEGORY='2' AND dnt.TYPE ='3'
AND dnt.IS_LEVEL ='1'
AND dnt.PROJECT_ID =31
AND dsd.PROJECT_ID=31
FROM dmp_develop_task ddt
INNER join dmp_navigation_tree dnt ON ddt.TREE_ID = dnt.ID
left join dmp_member t3 on ddt.create_user_id=t3.user_id
left join dmp_syncing_datasource dsd ON instr(script,concat('"targetDbConnection":"',dsd.datasource_name,'"'))>0
WHERE ddt.data_status ='1' and dnt.TYPE ='01' and dnt.IS_LEVEL ='1'
and dnt.PROJECT_ID =#{projectId}
<if test="treeName != null and treeName != ''">dnt.NAME like concat('%',#{treeName},'%') </if>
ORDER BY ddt.create_time DESC
</select>
</mapper>
\ No newline at end of file
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