Commit 7bfc4873 authored by sml's avatar sml

Merge branch 'dmp_dev' of

http://gitlab.ioubuy.cn/yaobenzhang/jz-dmp-service.git into dmp_dev

Conflicts:
	src/main/java/com/jz/dmp/modules/service/impl/OfflineSynchServiceImpl.java
parents 7de99fa2 dcdc961e
......@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
* @Description:离线同步
......@@ -66,11 +67,11 @@ public class OfflineSynchController {
@ApiOperation(value = "获取源数据库名称-下拉框", notes = "获取源数据库名称")
@GetMapping(value = "/sourceDbList")
@ApiImplicitParams({@ApiImplicitParam(name = "projectId", value = "项目id", required = true)
,@ApiImplicitParam(name = "datasourceTypeId", value = "数据源类型id")
,@ApiImplicitParam(name = "type", value = "01:来源,02目标")
, @ApiImplicitParam(name = "datasourceTypeId", value = "数据源类型id")
, @ApiImplicitParam(name = "type", value = "01:来源,02目标")
})
public JsonResult<List<SourceDbNameListDto>> getSourceDbList(@RequestParam Integer projectId,@RequestParam(required = false) String type, @RequestParam String datasourceTypeId) throws Exception {
JsonResult<List<SourceDbNameListDto>> jsonResult = offlineSynchService.querygSourceDbList(projectId,datasourceTypeId);
public JsonResult<List<SourceDbNameListDto>> getSourceDbList(@RequestParam Integer projectId, @RequestParam(required = false) String type, @RequestParam String datasourceTypeId) throws Exception {
JsonResult<List<SourceDbNameListDto>> jsonResult = offlineSynchService.querygSourceDbList(projectId, datasourceTypeId);
return jsonResult;
}
......@@ -78,8 +79,8 @@ public class OfflineSynchController {
* 获取数据源——下拉框
*
* @return
* @since 2021-01-21
* @author Bellamy
* @since 2021-01-21
*/
@ApiOperation(value = "获取数据源—下拉框", notes = "获取数据源—下拉框")
@GetMapping(value = "/datasourceList")
......@@ -202,10 +203,10 @@ public class OfflineSynchController {
*/
@ApiOperation(value = "获取数据源表字段", notes = "获取数据源表字段")
@PostMapping(value = "/getSoureAndTargetColumns")
public JsonResult getSoureAndTargetColumns(@RequestBody @Validated SoureTableColumnsReq soureAndTargetColumnsReq) throws Exception {
public JsonResult getSoureAndTargetColumns(@RequestBody @Validated Map<String, List<SynchTableColumnsReq>> req) throws Exception {
JsonResult jsonResult = new JsonResult();
try {
jsonResult = offlineSynchService.querySoureTableColumns(soureAndTargetColumnsReq);
jsonResult = offlineSynchService.querySoureTableColumns(req);
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
......
package com.jz.dmp.modules.controller.DataIntegration.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: SynchTableColumnsReq
* @Description: 获取表字段-请求对象
* @Author:Bellamy
* @Date 2020/12/21
* @Version 1.0
*/
@ApiModel(value = "获取表字段-请求对象", description = "获取表字段-请求对象")
public class SynchTableColumnsReq implements Serializable {
private static final long serialVersionUID = -2235510265678437967L;
/*
* 源数据库ID
* */
@NotNull(message = "源数据库ID不能为空")
@ApiModelProperty(value = "源数据库ID")
private Long sourceDbId;
@ApiModelProperty(value = "目标表名称")
private String targetTableName;
public Long getSourceDbId() {
return sourceDbId;
}
public String getTargetTableName() {
return targetTableName;
}
public void setTargetTableName(String targetTableName) {
this.targetTableName = targetTableName;
}
public void setSourceDbId(Long sourceDbId) {
this.sourceDbId = sourceDbId;
}
}
......@@ -252,7 +252,7 @@ public class DmpApiServiceMangeController {
* @author Bellamy
* @since 2021-01-21
*/
@ApiOperation(value = "获取数据源表字段", notes = "获取数据源表字段")
/* @ApiOperation(value = "获取数据源表字段", notes = "获取数据源表字段")
@PostMapping(value = "/getTableColumns")
public JsonResult getTableColumns(@RequestBody @Validated SoureTableColumnsReq req) throws Exception {
JsonResult jsonResult = new JsonResult();
......@@ -264,6 +264,6 @@ public class DmpApiServiceMangeController {
e.printStackTrace();
}
return jsonResult;
}
}*/
}
\ No newline at end of file
......@@ -32,7 +32,7 @@ public interface OfflineSynchService {
* @return
* @author Bellamy
*/
JsonResult querygSourceDbList(Integer projectId,String databaseTypeName) throws Exception;
JsonResult querygSourceDbList(Integer projectId, String databaseTypeName) throws Exception;
/**
* 根据源数据库id,获取源数据表——下拉框
......@@ -101,7 +101,7 @@ public interface OfflineSynchService {
* @author Bellamy
* @since 2021-01-21
*/
JsonResult querySoureTableColumns(SoureTableColumnsReq req) throws Exception;
JsonResult querySoureTableColumns(Map<String, List<SynchTableColumnsReq>> req) throws Exception;
/**
* 任务停止运行
......
......@@ -8,13 +8,12 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
......@@ -48,10 +47,10 @@ import com.jz.dmp.modules.controller.DataIntegration.bean.NewSynchTaskReq;
import com.jz.dmp.modules.controller.DataIntegration.bean.SourceDbNameListDto;
import com.jz.dmp.modules.controller.DataIntegration.bean.SoureAndTargetColumnsReq;
import com.jz.dmp.modules.controller.DataIntegration.bean.SyncDmpTaskAddReq;
import com.jz.dmp.modules.controller.DataIntegration.bean.SynchTableColumnsReq;
import com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageDto;
import com.jz.dmp.modules.controller.DataIntegration.bean.TaskListPageReq;
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.DmpDevelopTaskDao;
import com.jz.dmp.modules.dao.DmpNavigationTreeDao;
import com.jz.dmp.modules.dao.DmpProjectDao;
......@@ -69,7 +68,6 @@ import com.jz.dmp.modules.model.DmpTableColumn;
import com.jz.dmp.modules.model.DmpTableFieldSchema;
import com.jz.dmp.modules.model.DvRuleT;
import com.jz.dmp.modules.model.DvTaskRuleT;
import com.jz.dmp.modules.model.SSOUserInfo;
import com.jz.dmp.modules.service.DmpDevelopTaskService;
import com.jz.dmp.modules.service.DvTaskRuleTService;
import com.jz.dmp.modules.service.OfflineSynchService;
......@@ -794,7 +792,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
}
String azkabanMonitorUrl = map.get("azkabanMonitorUrl").toString();
Long projectId = Long.valueOf(map.get("projectId").toString());
AzkabanApiUtils2 azkabanApiUtils = new AzkabanApiUtils2(azkabanMonitorUrl);
AzkabanApiUtils2 azkabanApiUtils = new AzkabanApiUtils2(azkabanMonitorUrl, redisTemplate);
String execId = azkabanApiUtils.stopFlow("jz_localflow_" + projectId, map.get("treeName").toString());
return JsonResult.ok();
}
......
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