Commit 8f8b338e authored by sml's avatar sml

Merge branch 'dmp_dev' of http://gitlab.ioubuy.cn/yaobenzhang/jz-dmp-service.git into dmp_dev

parents c0840cb8 c7aa4403
......@@ -102,4 +102,15 @@ public class CommonUtils {
return t;
}
/**
* @Title: getAzkabanName
* @Description: TODO(拼接azkaban用名称)
* @param @return 参数
* @return String 返回类型
* @throws
*/
public static String getAzkabanName(String id) {
return "jz_dmp_"+ id;
}
}
......@@ -93,6 +93,10 @@ public class DataDevTaskListDto {
@ApiModelProperty(value = "sla状态:Y 已配置,N未配置")
private String slaStatus;
@ApiModelProperty(value = "azkabanJobId")
private String azkabanJobId;
public String getStatus() {
return status;
}
......@@ -204,4 +208,12 @@ public class DataDevTaskListDto {
public void setSlaStatus(String slaStatus) {
this.slaStatus = slaStatus;
}
public String getAzkabanJobId() {
return azkabanJobId;
}
public void setAzkabanJobId(String azkabanJobId) {
this.azkabanJobId = azkabanJobId;
}
}
......@@ -1461,7 +1461,7 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
//先发布任务
Integer execId = publishAndExecute(developTask);
if (execId!=null) {
if (execId != null) {
baseBeanResponse.setCode(StatuConstant.SUCCESS_CODE);
baseBeanResponse.setMessage("立即运行成功");
baseBeanResponse.setData(execId);
......@@ -1698,7 +1698,7 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
if (result.containsKey("data")) {
return JsonResult.ok(result);
}
return JsonResult.error(ResultCode.OPERATION_DATA_NO_EXIST,String.valueOf(result.get("error")));
return JsonResult.error(ResultCode.OPERATION_DATA_NO_EXIST, String.valueOf(result.get("error")));
}
/**
......
......@@ -208,7 +208,9 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
String azkabanLocalTaskFilePath = map.get("azkabanLocalTaskFilePath").toString(); //文件路径
String azkabanMonitorUrl = map.get("azkabanMonitorUrl").toString();//AZKABAN WEB服务地址
String azkabanJobCommand = FlowParseTool.generateExecutorToolCommand(Integer.valueOf(taskId), treeName, true);
DmpDevelopTask dmpDevelopTask = new DmpDevelopTask();
String azkabanJobName = dmpDevelopTask.getAzkabanName(taskId);
String azkabanJobCommand = FlowParseTool.generateExecutorToolCommand(Integer.valueOf(taskId), azkabanJobName, true);
//String azkabanJobCommand = "command=" + azkabanExectorXmlExec + " " + projectId + " ${azkaban.flow.flowid} ${azkaban.job.id} ${azkaban.flow.execid} " + treeName;
......@@ -264,17 +266,17 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
contents.add(azkabanJobCommand);
// 生成job文件
String jobFileAbsolutePath = localTaskSourcePath + treeName + ".job";
String jobFileAbsolutePath = localTaskSourcePath + azkabanJobName + ".job";
FileUtils.write(jobFileAbsolutePath, contents);
String localZipTargetFileName = treeName + ".zip";
String localZipTargetFileName = azkabanJobName + ".zip";
ZipUtils.zip(localTaskSourcePath, localTaskZipPath, localZipTargetFileName);
//上传到azkaban todo
//上次zip包到azkaban
String localTaskZipAbsolutePath = localTaskZipPath + "/" + localZipTargetFileName;
AzkabanApiUtils2 azkabanApiUtils = new AzkabanApiUtils2(azkabanMonitorUrl, redisTemplate);
return azkabanApiUtils.loginCreateProjectuploadZipAndExecute("jz_workflow_new_" + projectId, "local_" + taskAlias + "_project", localTaskZipAbsolutePath, treeName);
return azkabanApiUtils.loginCreateProjectuploadZipAndExecute("jz_workflow_new_" + projectId, "local_" + taskAlias + "_project", localTaskZipAbsolutePath, azkabanJobName);
//return azkabanApiUtils.loginCreateProjectuploadZipAndExecute("jz_localflow_" + projectId, "local_sync_project", localTaskZipAbsolutePath, treeName);
}
......
......@@ -310,13 +310,15 @@
<select id="queryTaskFlowId" resultType="java.util.Map">
SELECT
id,
name
t1.id,
t1.name,
t2.id as taskId
FROM
dmp_navigation_tree
dmp_navigation_tree t1
inner join dmp_develop_task t2 on t1.id=t2.tree_id and t2.data_status='1'
WHERE
1 = 1 AND DATA_STATUS = '1' AND IS_LEVEL = '1' AND type != '02'
and project_id = #{projectId}
1 = 1 AND t1.DATA_STATUS = '1' AND t1.IS_LEVEL = '1' AND t1.type != '02'
and t1.project_id = #{projectId}
</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