Commit c0840cb8 authored by sml's avatar sml

冲突解决

parent 23fae18b
......@@ -3,6 +3,7 @@ package com.jz.dmp.modules.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.jz.common.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -180,6 +181,11 @@ public class DmpDevelopTask implements Serializable {
@ApiModelProperty(value = "任务名称")
private String name;
/**
* createUserName
*/
@ApiModelProperty(value = "createUserName")
private String createUserName;
public Integer getId() {
return id;
......@@ -437,6 +443,14 @@ public class DmpDevelopTask implements Serializable {
this.name = name;
}
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName;
}
/**
* @Title: getAzkabanName
* @Description: TODO(拼接azkaban用名称)
......@@ -448,4 +462,17 @@ public class DmpDevelopTask implements Serializable {
return "jz_dmp_"+this.id;
}
/**
* @Title: getAzkabanName
* @Description: TODO(拼接azkaban用名称)
* @param @return 参数
* @return String 返回类型
* @throws
*/
public String getAzkabanName(String id) {
if(StringUtils.isNotBlank(id)){
return "jz_dmp_"+ id;
}
return getAzkabanName();
}
}
\ No newline at end of file
......@@ -843,7 +843,7 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
if (flowList.size() > 0 && flowList != null) {
for (DataDevTaskListDto str : listObj) { //业务流程任务
for (Map strFlow : flowList) { //最后实例状态
if (str.getTaskName().equals(strFlow.get("taskName"))) {
if (CommonUtils.getAzkabanName(str.getTaskId()).equals(strFlow.get("taskName"))) {
str.setStatus(String.valueOf(strFlow.get("status"))); //实例执行最后状态
if (null != strFlow.get("cronExpression")) { //调度周期
str.setSchedulinCycle(String.valueOf(strFlow.get("cronExpression")));
......@@ -1110,7 +1110,10 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
if (treeList.size() > 0 && treeList != null) {
for (DataDevTaskListDto treeDto : treeList) {
if (StringUtils.isNotBlank(treeDto.getTaskName())) {
taskName += "," + treeDto.getTaskName();
//taskName += "," + treeDto.getTaskName();
String azkabanJobId = CommonUtils.getAzkabanName(treeDto.getTaskId());
taskName += "," + azkabanJobId;
treeDto.setAzkabanJobId(azkabanJobId);
}
}
//通过任务名称,去查询开发实例
......@@ -1140,9 +1143,10 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
if (list.size() > 0) {
for (DataDevTaskListDto treeDto : treeList) {
for (DataDevExamplesListDto dto : list) {
if (treeDto.getTaskName().equals(dto.getTaskName())) {
if (treeDto.getAzkabanJobId().equals(dto.getTaskName())) {
dto.setTaskType(treeDto.getType());
dto.setRunTime(dto.getRunTime() + "s");
BigDecimal cost = new BigDecimal(dto.getRunTime()).divide(new BigDecimal(1000), 2, BigDecimal.ROUND_HALF_UP);
dto.setRunTime(cost + "s");
//JsonMapper.fromJsonString(dto.getFlowData(), Map.class);
}
}
......@@ -1475,7 +1479,7 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
private Integer publishAndExecute(DmpDevelopTask dmpDevelopTask) throws Exception {
Integer taskId = dmpDevelopTask.getId(); //任务id
Integer projectId = dmpDevelopTask.getProjectId(); //项目id
String treeName = dmpDevelopTask.getName(); //任务流程名称
String azkabanName = dmpDevelopTask.getAzkabanName(); //任务流程名称
//获取项目配置信息
Map<String, Object> param = new HashMap<String, Object>();
......@@ -1505,7 +1509,7 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
String azkabanLocalTaskFilePath = dmpProjectConfigInfoDto.getDmpPublicConfigInfoDto().getAzkabanLocalTaskFilePath(); //文件路径
String azkabanMonitorUrl = dmpProjectConfigInfoDto.getDmpPublicConfigInfoDto().getAzkabanMonitorUrl();//AZKABAN WEB服务地址
String azkabanJobCommand = FlowParseTool.generateExecutorToolCommand(taskId, treeName, true);
String azkabanJobCommand = FlowParseTool.generateExecutorToolCommand(taskId, azkabanName, true);
/**
* 当前任务生成文件存放根路径
......@@ -1545,10 +1549,10 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
contents.add(azkabanJobCommand);
// 生成job文件
String jobFileAbsolutePath = localTaskSourcePath + treeName + ".job";
String jobFileAbsolutePath = localTaskSourcePath + azkabanName + ".job";
FileUtils.write(jobFileAbsolutePath, contents);
String localZipTargetFileName = treeName + ".zip";
String localZipTargetFileName = azkabanName + ".zip";
ZipUtils.zip(localTaskSourcePath, localTaskZipPath, localZipTargetFileName);
//上传到azkaban todo
......@@ -1556,7 +1560,7 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
String localTaskZipAbsolutePath = localTaskZipPath + "/" + localZipTargetFileName;
AzkabanApiUtils2 azkabanApiUtils = new AzkabanApiUtils2(azkabanMonitorUrl, redisTemplate);
//return azkabanApiUtils.loginCreateProjectuploadZipAndExecute("jz_localflow_" + taskAlias + "_" + projectId, "local_" + taskAlias + "_project", localTaskZipAbsolutePath, treeName);
return azkabanApiUtils.loginCreateProjectuploadZipAndExecute("jz_workflow_new_" + projectId, "local_" + taskAlias + "_project", localTaskZipAbsolutePath, treeName);
return azkabanApiUtils.loginCreateProjectuploadZipAndExecute("jz_workflow_new_" + projectId, "local_" + taskAlias + "_project", localTaskZipAbsolutePath, azkabanName);
}
/**
......@@ -1723,7 +1727,8 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
String taskName = "";
if (list.size() > 0 && list != null) {
for (DataDevTaskListDto str : list) {
taskName += "," + str.getTaskName();
//taskName += "," + str.getTaskName();
taskName += "," + CommonUtils.getAzkabanName(str.getTaskId());
}
}
......@@ -1896,6 +1901,11 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
@Override
public JsonResult getTaskFlowId(String projectId) throws Exception {
List<Map> list = dmpNavigationTreeDao.queryTaskFlowId(projectId);
if (list.size() > 0 && list != null) {
for(Map map :list){
map.put("name",CommonUtils.getAzkabanName(String.valueOf(map.get("taskId"))));
}
}
return JsonResult.ok(list);
}
......
......@@ -25,6 +25,7 @@
<result column="is_gziped" property="isGziped" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="project_id" property="projectId" jdbcType="VARCHAR" />
<result column="create_user_name" property="createUserName" jdbcType="VARCHAR" />
<!-- <result column="chk_result" property="chkResult" javaType="VARCHAR"/> -->
<!-- <result column="sync_result" property="syncResult" javaType="VARCHAR"/> -->
</resultMap>
......@@ -204,7 +205,8 @@
SELECT
task.id,task.task_type,task.type,task.schedule_type,task.is_submit,task.task_desc,task.script,task.data_status,task.create_user_id,task.create_time,
task.update_user_id,task.update_time,task.tree_id,task.flow_header,
task.flow_json, task.version, task.publish_version, task.is_gziped, tree.name
task.flow_json, task.version, task.publish_version, task.is_gziped, tree.name,
user.user_name AS create_user_name
FROM dmp_develop_task task left join dmp_navigation_tree tree ON task.tree_id=tree.id
LEFT JOIN dmp_member user ON task.CREATE_USER_ID=user.user_id
WHERE 1=1 AND tree.data_status = '1'
......@@ -231,6 +233,7 @@
select
t1.id as treeId,
t1.name as taskName,
t2.id as taskId,
(case when t1.type='01' then '离线同步' when t1.type='02' then '实时同步' when t1.type='03' then '数据开发' end) as type
from
dmp_navigation_tree t1
......
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