Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
workflow
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
2
议题
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄夏豪
workflow
Commits
de7de381
提交
de7de381
authored
3月 31, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[工作流模块] 新增了文件上传接口
上级
1e9eb789
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
14 行增加
和
41 行删除
+14
-41
FlowsInfoController.java
...wcore/workflow_editer/controller/FlowsInfoController.java
+7
-0
WorkFlowService.java
...workflowcore/workflow_editer/service/WorkFlowService.java
+1
-1
WorkFlowServiceImpl.java
...ore/workflow_editer/service/impl/WorkFlowServiceImpl.java
+2
-40
WorkflowCoreApplicationTests_workflow.java
...j/workflowcore/WorkflowCoreApplicationTests_workflow.java
+4
-0
没有找到文件。
src/main/java/com/tykj/workflowcore/workflow_editer/controller/FlowsInfoController.java
浏览文件 @
de7de381
...
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.xml.stream.XMLStreamException
;
import
javax.xml.stream.XMLStreamException
;
import
java.io.FileNotFoundException
;
import
java.io.FileNotFoundException
;
...
@@ -52,6 +53,12 @@ public class FlowsInfoController {
...
@@ -52,6 +53,12 @@ public class FlowsInfoController {
return
ResultUtil
.
success
(
flowsInfoList
,
"查询成功"
);
return
ResultUtil
.
success
(
flowsInfoList
,
"查询成功"
);
}
}
@PostMapping
(
"/upLoadFile"
)
@ApiOperation
(
value
=
"上传文件"
)
public
String
upLoadFile
(
@RequestParam
(
"file"
)
MultipartFile
file
){
return
workFlowService
.
upLoadFile
(
file
);
}
@GetMapping
(
"editFlow"
)
@GetMapping
(
"editFlow"
)
@ApiOperation
(
value
=
"编辑流程"
)
@ApiOperation
(
value
=
"编辑流程"
)
public
ResponseEntity
editFlow
(
Integer
id
){
public
ResponseEntity
editFlow
(
Integer
id
){
...
...
src/main/java/com/tykj/workflowcore/workflow_editer/service/WorkFlowService.java
浏览文件 @
de7de381
...
@@ -30,7 +30,7 @@ public interface WorkFlowService {
...
@@ -30,7 +30,7 @@ public interface WorkFlowService {
* @param file file文件
* @param file file文件
* @return 路径名称
* @return 路径名称
*/
*/
String
saveXml
(
@RequestParam
(
"file"
)
MultipartFile
file
);
String
upLoadFile
(
@RequestParam
(
"file"
)
MultipartFile
file
);
/**
/**
* 接收前端的流程文件
* 接收前端的流程文件
...
...
src/main/java/com/tykj/workflowcore/workflow_editer/service/impl/WorkFlowServiceImpl.java
浏览文件 @
de7de381
...
@@ -96,7 +96,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
...
@@ -96,7 +96,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
}
}
@Override
@Override
public
String
saveXml
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
String
upLoadFile
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
String
realPath
=
null
;
String
realPath
=
null
;
if
(!
file
.
isEmpty
())
{
if
(!
file
.
isEmpty
())
{
//获取文件名
//获取文件名
...
@@ -115,44 +115,6 @@ public class WorkFlowServiceImpl implements WorkFlowService {
...
@@ -115,44 +115,6 @@ public class WorkFlowServiceImpl implements WorkFlowService {
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
//解析xml
//1.创建Reader对象
SAXReader
reader
=
new
SAXReader
();
//2.加载xml
Document
document
=
null
;
try
{
document
=
reader
.
read
(
fileNew
);
}
catch
(
DocumentException
e
)
{
e
.
printStackTrace
();
}
//3.获取根节点
Element
rootElement
=
document
.
getRootElement
();
Iterator
iterator
=
rootElement
.
elementIterator
();
String
processId
=
null
;
String
processName
=
null
;
Element
stu
=
(
Element
)
iterator
.
next
();
List
<
Attribute
>
attributes
=
stu
.
attributes
();
System
.
out
.
println
(
"======获取属性值======"
);
for
(
Attribute
attribute
:
attributes
)
{
if
(
"id"
.
equals
(
attribute
.
getName
()))
{
processId
=
attribute
.
getValue
();
System
.
out
.
println
(
"processId的值是:"
+
processId
);
}
if
(
"name"
.
equals
(
attribute
.
getName
()))
{
processName
=
attribute
.
getValue
();
System
.
out
.
println
(
"processName的值是:"
+
processName
);
}
}
//保存processId和processName 到数据库里面
FlowsInfo
flowsInfo
=
new
FlowsInfo
();
flowsInfo
.
setFlowKey
(
processId
);
flowsInfo
.
setFlowName
(
processName
);
flowsInfo
.
setResourceName
(
file
.
getOriginalFilename
());
//状态为未部署
flowsInfo
.
setState
(
1
);
flowsInfo
.
setFilePath
(
realPath
);
flowsInfoMapper
.
save
(
flowsInfo
);
}
}
return
realPath
;
return
realPath
;
}
}
...
@@ -330,7 +292,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
...
@@ -330,7 +292,7 @@ public class WorkFlowServiceImpl implements WorkFlowService {
if
(
taskVo
.
getComments
()
!=
null
)
{
if
(
taskVo
.
getComments
()
!=
null
)
{
taskService
.
addComment
(
task
.
getId
(),
processInstanceId
,
taskVo
.
getComments
());
taskService
.
addComment
(
task
.
getId
(),
processInstanceId
,
taskVo
.
getComments
());
}
}
//先判断
是
//先判断
if
(
taskVo
.
getHandlingOpinion
()
!=
null
){
if
(
taskVo
.
getHandlingOpinion
()
!=
null
){
taskVo
.
getMap
().
put
(
"handlingOpinion"
,
taskVo
.
getHandlingOpinion
());
taskVo
.
getMap
().
put
(
"handlingOpinion"
,
taskVo
.
getHandlingOpinion
());
}
}
...
...
src/main/test/java/com/tykj/workflowcore/WorkflowCoreApplicationTests_workflow.java
浏览文件 @
de7de381
...
@@ -495,4 +495,8 @@ class WorkflowCoreApplicationTests_workflow {
...
@@ -495,4 +495,8 @@ class WorkflowCoreApplicationTests_workflow {
.
andDo
(
print
());
//打印输出结果
.
andDo
(
print
());
//打印输出结果
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论