Commit 69976e70 authored by mcb's avatar mcb

no message

parent 40eb0b54
...@@ -6,10 +6,13 @@ import com.jz.dmp.modules.model.DmpAgentDatasourceInfo; ...@@ -6,10 +6,13 @@ import com.jz.dmp.modules.model.DmpAgentDatasourceInfo;
public interface DmpDsAgentService { public interface DmpDsAgentService {
//jdbc连接
public DmpAgentResult testConnect(DmpAgentDatasourceInfo ds); public DmpAgentResult testConnect(DmpAgentDatasourceInfo ds);
//获取数据源表库名称
public DmpAgentResult getTableNameList(DmpAgentDatasourceInfo ds); public DmpAgentResult getTableNameList(DmpAgentDatasourceInfo ds);
//获取数据源表字段
public DmpAgentResult getTableColumnList(DmpAgentDatasourceInfo ds, String tableName); public DmpAgentResult getTableColumnList(DmpAgentDatasourceInfo ds, String tableName);
public DmpAgentResult previewData(DmpAgentDatasourceInfo ds, String tableName); public DmpAgentResult previewData(DmpAgentDatasourceInfo ds, String tableName);
......
...@@ -61,7 +61,7 @@ public class OfflineSynchController { ...@@ -61,7 +61,7 @@ public class OfflineSynchController {
*/ */
@ApiOperation(value = "获取源数据库名称-下拉框", notes = "获取源数据库名称") @ApiOperation(value = "获取源数据库名称-下拉框", notes = "获取源数据库名称")
@GetMapping(value = "/sourceDbList") @GetMapping(value = "/sourceDbList")
@ApiImplicitParam(name = "projectId", value = "项目id",required = true) @ApiImplicitParam(name = "projectId", value = "项目id", required = true)
public JsonResult<List<SourceDbNameListDto>> getSourceDbList(@RequestParam Integer projectId) throws Exception { public JsonResult<List<SourceDbNameListDto>> getSourceDbList(@RequestParam Integer projectId) throws Exception {
JsonResult<List<SourceDbNameListDto>> jsonResult = offlineSynchService.querygSourceDbList(projectId); JsonResult<List<SourceDbNameListDto>> jsonResult = offlineSynchService.querygSourceDbList(projectId);
return jsonResult; return jsonResult;
...@@ -75,7 +75,7 @@ public class OfflineSynchController { ...@@ -75,7 +75,7 @@ public class OfflineSynchController {
*/ */
@ApiOperation(value = "根据源数据库id,获取源数据表-下拉框", notes = "根据源数据库id,获取源数据表") @ApiOperation(value = "根据源数据库id,获取源数据表-下拉框", notes = "根据源数据库id,获取源数据表")
@GetMapping(value = "/sourceTableList") @GetMapping(value = "/sourceTableList")
@ApiImplicitParam(name = "sourceDbId", value = "源数据库id") @ApiImplicitParam(name = "sourceDbId", value = "源数据库id", required = true)
public JsonResult getSourceTableList(@RequestParam Long sourceDbId, @RequestParam(value = "targetName", required = false) String targetName) throws Exception { public JsonResult getSourceTableList(@RequestParam Long sourceDbId, @RequestParam(value = "targetName", required = false) String targetName) throws Exception {
JsonResult list = offlineSynchService.querygSourceTableList(sourceDbId, targetName); JsonResult list = offlineSynchService.querygSourceTableList(sourceDbId, targetName);
return list; return list;
......
...@@ -3,9 +3,11 @@ package com.jz.dmp.modules.controller.dataService; ...@@ -3,9 +3,11 @@ package com.jz.dmp.modules.controller.dataService;
import com.jz.common.constant.JsonResult; import com.jz.common.constant.JsonResult;
import com.jz.common.constant.ResultCode; import com.jz.common.constant.ResultCode;
import com.jz.dmp.modules.controller.DataIntegration.bean.SourceDbNameListDto; import com.jz.dmp.modules.controller.DataIntegration.bean.SourceDbNameListDto;
import com.jz.dmp.modules.controller.DataIntegration.bean.SoureAndTargetColumnsReq;
import com.jz.dmp.modules.controller.dataService.bean.*; import com.jz.dmp.modules.controller.dataService.bean.*;
import com.jz.dmp.modules.service.DmpApiMangeService; import com.jz.dmp.modules.service.DmpApiMangeService;
import com.jz.dmp.modules.service.DmpApiServiceMangeService; import com.jz.dmp.modules.service.DmpApiServiceMangeService;
import com.jz.dmp.modules.service.OfflineSynchService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -14,6 +16,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -14,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -42,6 +45,9 @@ public class DmpApiServiceMangeController { ...@@ -42,6 +45,9 @@ public class DmpApiServiceMangeController {
@Autowired @Autowired
private DmpApiMangeService dmpApiMangeService; private DmpApiMangeService dmpApiMangeService;
@Autowired
private OfflineSynchService offlineSynchService;
/** /**
* 保存API(第三方)基本信息 * 保存API(第三方)基本信息
* *
...@@ -164,18 +170,19 @@ public class DmpApiServiceMangeController { ...@@ -164,18 +170,19 @@ public class DmpApiServiceMangeController {
} }
/** /**
* 获取数据源配置——下拉框 * 获取数据源——下拉框
* *
* @return * @return
* @author Bellamy * @author Bellamy
*/ */
@ApiOperation(value = "获取数据源配置-下拉框", notes = "获取数据源配置") @ApiOperation(value = "获取数据源库-下拉框", notes = "获取数据源库")
@GetMapping(value = "/sourceDbList") @GetMapping(value = "/sourceDbList")
@ApiImplicitParam(name = "projectId", value = "项目id", required = true) @ApiImplicitParams({@ApiImplicitParam(name = "projectId", value = "项目id", required = true),
public JsonResult<List<SourceDbNameListDto>> getSourceDbList(@RequestParam Integer projectId) { @ApiImplicitParam(name = "dbName", value = "数据源类型名称", required = true)})
public JsonResult<List<SourceDbNameListDto>> getSourceDbList(@RequestParam Integer projectId,@RequestParam String dbName) {
JsonResult jsonResult = new JsonResult(); JsonResult jsonResult = new JsonResult();
try { try {
jsonResult = dmpApiServiceMangeService.querygSourceDbList(projectId); jsonResult = dmpApiServiceMangeService.querygSourceDbList(projectId,dbName);
} catch (Exception e) { } catch (Exception e) {
jsonResult.setMessage("查询失败"); jsonResult.setMessage("查询失败");
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR); jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
...@@ -184,4 +191,52 @@ public class DmpApiServiceMangeController { ...@@ -184,4 +191,52 @@ public class DmpApiServiceMangeController {
return jsonResult; return jsonResult;
} }
/**
* 配置数据源——下拉框
*
* @return
* @author Bellamy
* @since 2021-01-21
*/
@ApiOperation(value = "配置数据源-下拉框", notes = "配置数据源")
@GetMapping(value = "/sourceSetting")
public JsonResult getSourceSetting() throws Exception {
return dmpApiServiceMangeService.getSourceSetting();
}
/**
* 根据数据源库id,获取数据源表——下拉框
*
* @return
* @author Bellamy
*/
@ApiOperation(value = "根据数据源库id,获取数据源表-下拉框", notes = "根据数据源库id,获取数据源表")
@GetMapping(value = "/sourceTableList")
@ApiImplicitParam(name = "sourceDbId", value = "数据源库id", required = true)
public JsonResult getSourceTableList(@RequestParam Long sourceDbId, @RequestParam(value = "targetName", required = false) String targetName) throws Exception {
JsonResult jsonResult = new JsonResult();
try {
jsonResult = offlineSynchService.querygSourceTableList(sourceDbId, targetName);
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return jsonResult;
}
/**
* 获取数据源表字段
*
* @return
* @author Bellamy
* @since 2021-01-21
*/
@ApiOperation(value = "获取数据源表字段", notes = "获取数据源表字段")
@PostMapping(value = "/getTableColumns")
public JsonResult getTableColumns(@RequestBody @Validated SoureTableColumnsReq req) throws Exception {
JsonResult list = offlineSynchService.querySoureTableColumns(req);
return list;
}
} }
\ No newline at end of file
...@@ -19,53 +19,53 @@ import java.io.Serializable; ...@@ -19,53 +19,53 @@ import java.io.Serializable;
public class ApiInterfaceReq implements Serializable { public class ApiInterfaceReq implements Serializable {
@ApiModelProperty(value = "接口描述",required = false) @ApiModelProperty(value = "接口描述", required = false)
public String apiDesc; public String apiDesc;
@ApiModelProperty(value = "传输方式:http https",required = true) @ApiModelProperty(value = "传输方式:http https", required = true)
@NotNull(message = "传输方式不能为空") @NotNull(message = "传输方式不能为空")
public String transMode; public String transMode;
@ApiModelProperty(value = "加密方式0 无,1:MD5 2:RSA",required = true) @ApiModelProperty(value = "加密方式0 无,1:MD5 2:RSA", required = true)
@NotNull(message = "加密方式不能为空") @NotNull(message = "加密方式不能为空")
public String signType; public String signType;
@ApiModelProperty(value = "接入类型:对应字典表key",required = true) @ApiModelProperty(value = "接入类型:对应字典表key", required = true)
@NotNull(message = "接入类型不能为空") @NotNull(message = "接入类型不能为空")
public String joinType; public String joinType;
@ApiModelProperty(value = "目标地址",required = true) @ApiModelProperty(value = "目标地址", required = true)
@NotNull(message="目标地址不能为空") @NotNull(message = "目标地址不能为空")
public String targetUrl; public String targetUrl;
@ApiModelProperty(value = "超时时间",required = true) @ApiModelProperty(value = "超时时间", required = true)
@NotNull(message="超时时间不能为空") @NotNull(message = "超时时间不能为空")
public String timeout; public String timeout;
@ApiModelProperty(value = "限流类型:DAY 按天,MONTH 按月, YEAR 按年",required = true) @ApiModelProperty(value = "限流类型:DAY 按天,MONTH 按月, YEAR 按年", required = true)
@NotNull(message = "限流类型不能为空") @NotNull(message = "限流类型不能为空")
public String reqType; public String reqType;
@ApiModelProperty(value = "限制次数",required = false) @ApiModelProperty(value = "限制次数", required = false)
public Long reqFrequency; public Long reqFrequency;
@ApiModelProperty(value = "api描述",required = false) @ApiModelProperty(value = "api描述", required = false)
public String apiFunction; public String apiFunction;
@ApiModelProperty(value = "父类文件id,一级文件夹传入0",required = false) @ApiModelProperty(value = "父类文件id,一级文件夹传入0", required = false)
public Long parentId; public Long parentId;
@ApiModelProperty(value = "文件id",required = false) @ApiModelProperty(value = "文件id", required = false)
public Long fileId; public Long fileId;
@ApiModelProperty(value = "项目id",required = true) @ApiModelProperty(value = "项目id", required = true)
@NotNull(message="项目id不能为空") @NotNull(message = "项目id不能为空")
public Long projectId; public Long projectId;
@ApiModelProperty(value = "状态",required = false) @ApiModelProperty(value = "状态", required = false)
public String status; public String status;
@ApiModelProperty(value = "更新时传入api自增id",required = false) @ApiModelProperty(value = "更新时传入api自增id", required = false)
public Long id; public Long id;
@ApiModelProperty(value = "创建用户") @ApiModelProperty(value = "创建用户")
...@@ -73,7 +73,10 @@ public class ApiInterfaceReq implements Serializable { ...@@ -73,7 +73,10 @@ public class ApiInterfaceReq implements Serializable {
@ApiModelProperty(value = "api类型:1.数据银行制作大数据表 " + @ApiModelProperty(value = "api类型:1.数据银行制作大数据表 " +
"2 数据银行制作数据包,3,数据银行制作自定义API " + "2 数据银行制作数据包,3,数据银行制作自定义API " +
"4 API实时接入 6 标签查询 9自定义",hidden = true) "4 API实时接入 6 标签查询 9自定义", hidden = true)
public String apiType; public String apiType;
@ApiModelProperty(value = "请求方式")
public String reqMethod;
} }
...@@ -29,4 +29,10 @@ public class AuthListInfoReq extends BasePageBean implements Serializable { ...@@ -29,4 +29,10 @@ public class AuthListInfoReq extends BasePageBean implements Serializable {
@ApiModelProperty(value = "API名称", required = false) @ApiModelProperty(value = "API名称", required = false)
private String apiName; private String apiName;
@ApiModelProperty(value = "项目id")
private String projectId;
@ApiModelProperty(value = "文件id")
private String fileId;
} }
package com.jz.dmp.modules.controller.dataService.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName: SoureTableColumnsReq
* @Description: 获取数据源表字段
* @Author:Bellamy
* @Date 2020/12/21
* @Version 1.0
*/
@ApiModel(value = "获取数据源表字段-请求参数对象", description = "获取数据源表字段-请求参数对象")
public class SoureTableColumnsReq implements Serializable {
private static final long serialVersionUID = -3931329194480499602L;
/*
* 源数据库ID
* */
@NotNull(message = "源数据库ID不能为空")
@ApiModelProperty(value = "源数据库ID")
private Long sourceDbId;
@NotNull(message = "表名称不能为空")
@NotEmpty(message = "表名称不能为空")
@ApiModelProperty(value = "表名称")
private String targetTableName;
private String fileType;
private String csvDelimiter;
private String csvIsHaveHeader;
public Long getSourceDbId() {
return sourceDbId;
}
public void setSourceDbId(Long sourceDbId) {
this.sourceDbId = sourceDbId;
}
public String getTargetTableName() {
return targetTableName;
}
public void setTargetTableName(String targetTableName) {
this.targetTableName = targetTableName;
}
public String getFileType() {
return fileType;
}
public void setFileType(String fileType) {
this.fileType = fileType;
}
public String getCsvDelimiter() {
return csvDelimiter;
}
public void setCsvDelimiter(String csvDelimiter) {
this.csvDelimiter = csvDelimiter;
}
public String getCsvIsHaveHeader() {
return csvIsHaveHeader;
}
public void setCsvIsHaveHeader(String csvIsHaveHeader) {
this.csvIsHaveHeader = csvIsHaveHeader;
}
}
...@@ -56,10 +56,19 @@ public interface DmpApiServiceMangeService { ...@@ -56,10 +56,19 @@ public interface DmpApiServiceMangeService {
JsonResult getCountAPiCallStat() throws Exception; JsonResult getCountAPiCallStat() throws Exception;
/** /**
* 获取数据源配置——下拉框 * 获取数据源——下拉框
* *
* @return * @return
* @author Bellamy * @author Bellamy
*/ */
JsonResult querygSourceDbList(Integer projectId) throws Exception; JsonResult querygSourceDbList(Integer projectId,String dbName) throws Exception;
/**
* 配置数据源——下拉框
*
* @return
* @author Bellamy
* @since 2021-01-21
*/
JsonResult getSourceSetting() throws Exception;
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import com.jz.common.constant.JsonResult; ...@@ -4,6 +4,7 @@ import com.jz.common.constant.JsonResult;
import com.jz.common.page.BasePageBean; import com.jz.common.page.BasePageBean;
import com.jz.common.page.PageInfoResponse; import com.jz.common.page.PageInfoResponse;
import com.jz.dmp.modules.controller.DataIntegration.bean.*; import com.jz.dmp.modules.controller.DataIntegration.bean.*;
import com.jz.dmp.modules.controller.dataService.bean.SoureTableColumnsReq;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
...@@ -92,4 +93,13 @@ public interface OfflineSynchService { ...@@ -92,4 +93,13 @@ public interface OfflineSynchService {
* @author Bellamy * @author Bellamy
*/ */
JsonResult updateSyncTask(SyncDmpTaskAddReq syncDmpTaskAddReq) throws Exception; JsonResult updateSyncTask(SyncDmpTaskAddReq syncDmpTaskAddReq) throws Exception;
/**
* 获取数据源表字段
*
* @return
* @author Bellamy
* @since 2021-01-21
*/
JsonResult querySoureTableColumns(SoureTableColumnsReq req) throws Exception;
} }
...@@ -22,10 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -22,10 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @ClassName: DmpApiServiceMangeServiceImpl * @ClassName: DmpApiServiceMangeServiceImpl
...@@ -59,6 +56,7 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService ...@@ -59,6 +56,7 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
@Autowired @Autowired
private OfflineSynchDao offlineSynchDao; private OfflineSynchDao offlineSynchDao;
/** /**
* 保存API(第三方)基本信息 * 保存API(第三方)基本信息
* *
...@@ -239,17 +237,31 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService ...@@ -239,17 +237,31 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
} }
/** /**
* 获取数据源配置——下拉框 * 获取数据源——下拉框
* *
* @return * @return
* @author Bellamy * @author Bellamy
*/ */
@Override @Override
public JsonResult querygSourceDbList(Integer projectId) throws Exception { public JsonResult querygSourceDbList(Integer projectId,String dbName) throws Exception {
Map map = new HashMap(); Map map = new HashMap();
map.put("projectId", projectId); //项目id map.put("projectId", projectId); //项目id
map.put("datasource", apiBigSetting.split(",")); map.put("dbName", dbName);
List<SourceDbNameListDto> list = offlineSynchDao.querygSourceDbList(map); List<SourceDbNameListDto> list = offlineSynchDao.querygSourceDbList(map);
return JsonResult.ok(list); return JsonResult.ok(list);
} }
/**
* 配置数据源——下拉框
*
* @return
* @author Bellamy
* @since 2021-01-21
*/
@Override
public JsonResult getSourceSetting() throws Exception {
String[] arr = apiBigSetting.split(",");
List<String> list = Arrays.asList(arr);
return JsonResult.ok(list);
}
} }
\ No newline at end of file
package com.jz.dmp.modules.service.impl; package com.jz.dmp.modules.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.jz.agent.service.DmpDsAgentService; import com.jz.agent.service.DmpDsAgentService;
...@@ -18,6 +19,7 @@ import com.jz.common.utils.web.XmlUtils; ...@@ -18,6 +19,7 @@ import com.jz.common.utils.web.XmlUtils;
import com.jz.dmp.agent.DmpAgentResult; import com.jz.dmp.agent.DmpAgentResult;
import com.jz.dmp.modules.controller.DataIntegration.bean.*; import com.jz.dmp.modules.controller.DataIntegration.bean.*;
import com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowExecution; import com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowExecution;
import com.jz.dmp.modules.controller.dataService.bean.SoureTableColumnsReq;
import com.jz.dmp.modules.dao.*; import com.jz.dmp.modules.dao.*;
import com.jz.dmp.modules.model.*; import com.jz.dmp.modules.model.*;
import com.jz.dmp.modules.service.DmpDevelopTaskService; import com.jz.dmp.modules.service.DmpDevelopTaskService;
...@@ -128,6 +130,9 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -128,6 +130,9 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
public JsonResult querygSourceTableList(Long sourceDbId, String targetName) throws Exception { public JsonResult querygSourceTableList(Long sourceDbId, String targetName) throws Exception {
//通过源数据库id ,查询数据源配置 //通过源数据库id ,查询数据源配置
DmpAgentDatasourceInfo dsInfo = offlineSynchDao.querySourceDbInfoBySourceId(sourceDbId); DmpAgentDatasourceInfo dsInfo = offlineSynchDao.querySourceDbInfoBySourceId(sourceDbId);
if (dsInfo == null) {
throw new RuntimeException("数据源配置信息不存在!");
}
//解码源数据库密码 //解码源数据库密码
if (StringUtils.isNotBlank(dsInfo.getPassword())) { if (StringUtils.isNotBlank(dsInfo.getPassword())) {
dsInfo.setPassword(new BaseService().decode(dsInfo.getPassword(), publicKey)); dsInfo.setPassword(new BaseService().decode(dsInfo.getPassword(), publicKey));
...@@ -141,8 +146,8 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -141,8 +146,8 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
return new JsonResult(rst.getCode(), rst.getMessage()); return new JsonResult(rst.getCode(), rst.getMessage());
} else { } else {
//成功 //成功
rst.setResult(JsonMapper.fromJsonString(rst.getMessage(), List.class)); //rst.setResult(JsonMapper.fromJsonString(rst.getMessage(), List.class));
return new JsonResult(ResultCode.SUCCESS, rst); return new JsonResult(ResultCode.SUCCESS, JsonMapper.fromJsonString(rst.getMessage(), List.class));
} }
} }
...@@ -690,4 +695,43 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -690,4 +695,43 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
//批量新增任务与规则关系表 //批量新增任务与规则关系表
dvTaskRuleTService.saveRule(list); dvTaskRuleTService.saveRule(list);
} }
/**
* 获取数据源表字段
*
* @return
* @author Bellamy
* @since 2021-01-21
*/
@Override
public JsonResult querySoureTableColumns(SoureTableColumnsReq req) throws Exception {
//通过源数据库id ,查询数据源配置
DmpAgentDatasourceInfo dsInfo = offlineSynchDao.querySourceDbInfoBySourceId(req.getSourceDbId());
if (dsInfo == null) {
throw new RuntimeException("数据源配置信息不存在!");
}
dsInfo.setFileType(req.getFileType());
dsInfo.setDelimiter(req.getCsvDelimiter());
dsInfo.setIsHaveHeader(req.getCsvIsHaveHeader());
//解码源数据库密码
if (StringUtils.isNotBlank(dsInfo.getPassword())) {
dsInfo.setPassword(new BaseService().decode(dsInfo.getPassword(), publicKey));
}
//创建jdbc,获取数据源表字段
DmpAgentResult rst = dmpDsAgentServiceImp.getTableColumnList(dsInfo, req.getTargetTableName());
if (!rst.getCode().val().equals("200")) {
return new JsonResult(rst.getCode(), rst.getMessage());
} else {
//成功
List<Map> returnList = (List<Map>) JsonMapper.fromJsonString(rst.getMessage(), List.class);
if (returnList != null && returnList.size() > 0) {
for (int i = 0; i < returnList.size(); i++) {
Map map = returnList.get(i);
map.put("id", i + 1);
}
}
return JsonResult.ok(returnList);
}
}
} }
...@@ -52,12 +52,7 @@ ...@@ -52,12 +52,7 @@
<if test = 'isEnableSource != null and isEnableSource == "1"'> and dsdt.is_enable_source = '1' </if> <if test = 'isEnableSource != null and isEnableSource == "1"'> and dsdt.is_enable_source = '1' </if>
<if test = "isEnableTarget != null and isEnableTarget=='1'.toString()"> and dsdt.is_enable_target = '1' </if> <if test = "isEnableTarget != null and isEnableTarget=='1'.toString()"> and dsdt.is_enable_target = '1' </if>
where ds.data_status = '1' and ds.project_id = #{projectId} where ds.data_status = '1' and ds.project_id = #{projectId}
<if test="datasource != null and datasource !='' "> <if test="dbName != null and dbName !='' "> and dsdt.datasource = #{dbName} </if>
and dsdt.datasource in
<foreach collection="datasource" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test = 'datasourceType != null and datasourceType > 0 '> and ds.DATASOURCE_TYPE = #{datasourceType} </if> <if test = 'datasourceType != null and datasourceType > 0 '> and ds.DATASOURCE_TYPE = #{datasourceType} </if>
</select> </select>
......
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