Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jz-dmp-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
jz-dmp-service
Commits
4e06208d
Commit
4e06208d
authored
Feb 02, 2021
by
mcb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dmp_dev' of
http://gitlab.ioubuy.cn/yaobenzhang/jz-dmp-service
into dmp_dev
parents
02687f62
a5a95b04
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
5 deletions
+68
-5
StatuConstant.java
src/main/java/com/jz/common/constant/StatuConstant.java
+2
-1
FlowParseTool.java
src/main/java/com/jz/common/utils/FlowParseTool.java
+66
-4
No files found.
src/main/java/com/jz/common/constant/StatuConstant.java
View file @
4e06208d
...
@@ -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"
;
...
...
src/main/java/com/jz/common/utils/FlowParseTool.java
View file @
4e06208d
...
@@ -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 flowNode
q
* @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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment