Commit 4e06208d authored by mcb's avatar mcb

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

parents 02687f62 a5a95b04
...@@ -8,7 +8,8 @@ public class StatuConstant { ...@@ -8,7 +8,8 @@ public class StatuConstant {
/***************************************************************************/ /***************************************************************************/
/*操作码**/ /*操作码**/
public final static String SUCCESS_CODE = "000"; //public final static String SUCCESS_CODE = "000";
public final static String SUCCESS_CODE = "200";
public final static String SUCCESS_CODE_MSG = "操作成功"; public final static String SUCCESS_CODE_MSG = "操作成功";
public final static String FAILURE_CODE = "001"; public final static String FAILURE_CODE = "001";
......
...@@ -12,11 +12,13 @@ import org.apache.commons.lang3.StringUtils; ...@@ -12,11 +12,13 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jz.common.enums.NodeChangeTypeEnum; import com.jz.common.enums.NodeChangeTypeEnum;
import com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowNode; import com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowNode;
import com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowNodeChangeInfo; import com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowNodeChangeInfo;
import com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowPro; import com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowPro;
import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoDto; import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoDto;
import com.jz.dmp.modules.model.DmpDevelopTask;
import com.jz.dmp.modules.model.DmpNavigationTree; import com.jz.dmp.modules.model.DmpNavigationTree;
import com.jz.dmp.modules.model.DmpProject; import com.jz.dmp.modules.model.DmpProject;
import com.jz.dmp.modules.model.DmpProjectSystemInfo; import com.jz.dmp.modules.model.DmpProjectSystemInfo;
...@@ -424,7 +426,65 @@ public class FlowParseTool { ...@@ -424,7 +426,65 @@ public class FlowParseTool {
//子流程 //子流程
azkabanJobType = "flow"; azkabanJobType = "flow";
azkabanJobCommand = generateSubprocessFile(flowNode); azkabanJobCommand = generateSubprocessFile(flowNode);
} } else if ("ftp".equalsIgnoreCase(nodeType)) {
//ftp
//azkabanJobType = "command";
//azkabanJobCommand = "";
//上传ftp下载相关参数
JSONObject scriptJsonObject = JSONObject.parseObject(flowNode.getScript());
//FTP链接
contents.add("ftpUrl=" + scriptJsonObject.getString("ftpUrl"));
//FTP用户名
contents.add("ftpUsername=" + scriptJsonObject.getString("ftpUsername"));
//FTP密码
contents.add("ftpPassword=" + scriptJsonObject.getString("ftpPassword"));
//FTP文件目录
contents.add("ftpSourceFileDir=" + scriptJsonObject.getString("ftpSourceFileDir"));
//保存目录
contents.add("ftpSaveDestDir=" + scriptJsonObject.getString("ftpSaveDestDir"));
}else if ("unzipFile".equalsIgnoreCase(nodeType)) {
//unzipFile
//azkabanJobType = "command";
//azkabanJobCommand = "";
//上传解压文件相关参数
JSONObject scriptJsonObject = JSONObject.parseObject(flowNode.getScript());
//输出目录
contents.add("zipOutputDir=" + scriptJsonObject.getString("zipOutputDir"));
//压缩文件目录
contents.add("compressedFileDir=" + scriptJsonObject.getString("compressedFileDir"));
//解压格式
contents.add("decompressFormat=" + scriptJsonObject.getString("decompressFormat"));
}else if ("docTrans".equalsIgnoreCase(nodeType)) {
//docTrans
//azkabanJobType = "command";
//azkabanJobCommand = "";
//上传文件转码相关参数
JSONObject scriptJsonObject = JSONObject.parseObject(flowNode.getScript());
//文件编码
contents.add("documentCode=" + scriptJsonObject.getString("documentCode"));
//输出地址(目录)
contents.add("outpuAddressUrl=" + scriptJsonObject.getString("outpuAddressUrl"));
//输出编码
contents.add("fileCharsetEncode=" + scriptJsonObject.getString("fileCharsetEncode"));
//文件地址(目录)
contents.add("fileAddressUrl=" + scriptJsonObject.getString("fileAddressUrl"));
}else if ("hdfs".equalsIgnoreCase(nodeType)) {
//docTrans
//azkabanJobType = "command";
//azkabanJobCommand = "";
//上传HDFS相关相关参数
JSONObject scriptJsonObject = JSONObject.parseObject(flowNode.getScript());
//文件地址
contents.add("localUploadFileDir=" + scriptJsonObject.getString("localUploadFileDir"));
//文件过滤
contents.add("hdfsUploadFileFilter=" + scriptJsonObject.getString("hdfsUploadFileFilter"));
//HDFS目录
contents.add("hdfsUploadSaveDir=" + scriptJsonObject.getString("hdfsUploadSaveDir"));
}
//子流程类型 //子流程类型
contents.add("type=" + azkabanJobType); contents.add("type=" + azkabanJobType);
...@@ -529,7 +589,7 @@ public class FlowParseTool { ...@@ -529,7 +589,7 @@ public class FlowParseTool {
/** /**
* 生成同步任务文件 * 生成同步任务文件
* *
* @param flowNode * @param flowNodeq
* @return * @return
*/ */
private String generateSyncFile(FlowNode flowNode)throws Exception { private String generateSyncFile(FlowNode flowNode)throws Exception {
...@@ -557,8 +617,10 @@ public class FlowParseTool { ...@@ -557,8 +617,10 @@ public class FlowParseTool {
//暂时不上传 //暂时不上传
//dmpDevelopTaskService.newPublishSyncing(syncTaskTreeId, publishedToProjectId); //dmpDevelopTaskService.newPublishSyncing(syncTaskTreeId, publishedToProjectId);
//获取最新版本的同步任务 //获取最新版本的同步任务
String execXmlFileNameAndVersion = getPublishSyncTaskFileNameAndLatestVersion(taskName, syncTaskTreeId); //String execXmlFileNameAndVersion = getPublishSyncTaskFileNameAndLatestVersion(taskName, syncTaskTreeId);
String execXmlFileName = execXmlFileNameAndVersion.split("@")[1]; //String execXmlFileName = execXmlFileNameAndVersion.split("@")[1];
//DmpDevelopTask task = dmpDevelopTaskService.
String execXmlFileName = "";
//xml 执行xml的命令写到job文件中 //xml 执行xml的命令写到job文件中
String command = "command=" + dmpProjectConfigInfoDto.getDmpPublicConfigInfoDto().getAzkabanExectorXmlExec() + " " + publishedToProjectId + " ${azkaban.flow.flowid} ${azkaban.job.id} " + execXmlFileName; String command = "command=" + dmpProjectConfigInfoDto.getDmpPublicConfigInfoDto().getAzkabanExectorXmlExec() + " " + publishedToProjectId + " ${azkaban.flow.flowid} ${azkaban.job.id} " + execXmlFileName;
return command; return command;
......
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