Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
417b0273
Commit
417b0273
authored
Jul 18, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
0bcdec2d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
7 deletions
+44
-7
PowerStationServiceImpl.java
...module/hygf/biz/service/impl/PowerStationServiceImpl.java
+42
-6
SurveyInformationServiceImpl.java
...e/hygf/biz/service/impl/SurveyInformationServiceImpl.java
+2
-1
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PowerStationServiceImpl.java
View file @
417b0273
...
...
@@ -20,6 +20,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.cglib.beans.BeanMap
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
...
...
@@ -28,8 +29,10 @@ import org.springframework.stereotype.Service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
springfox.documentation.service.ApiListing
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 服务实现类
...
...
@@ -73,8 +76,24 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
@Override
@Transactional
public
boolean
savePowerStation
(
PowerStation
powerStation
)
{
try
{
//流程节点code
String
flowTaskIdnext
=
this
.
getTaskNoAuth
(
powerStation
.
getProcessInstanceId
());
WorkDto
workDto
=
this
.
getNodeInfoCode
(
flowTaskIdnext
);
powerStation
.
setNextProcessNode
(
workDto
.
getNextProcessNode
());
powerStation
.
setNodeRole
(
workDto
.
getNodeRole
());
powerStation
.
setNodeRouting
(
workDto
.
getNodeRouting
());
return
this
.
saveOrUpdate
(
powerStation
);
}
catch
(
Exception
e
){
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
}
@Override
...
...
@@ -146,7 +165,8 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
powerStationService
.
savePowerStation
(
powerStation
);
}
}
catch
(
Exception
e
){
log
.
error
(
"工作流执行失败:{}"
,
e
.
getMessage
());
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
return
code
;
}
...
...
@@ -154,37 +174,53 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
public
WorkDto
getNodeInfoCode
(
String
flowTaskId
){
WorkDto
workDto
=
null
;
try
{
FeignClientResult
<
JSONObject
>
jSONObject
=
workflowFeignClient
.
getNodeInfo
(
flowTaskId
);
if
(
IDX_REQUEST_STATE
.
equals
(
String
.
valueOf
(
jSONObject
.
getStatus
()))){
JSONObject
js
=
jSONObject
.
getResult
();
if
(
js
==
null
){
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
JSONObject
taskInfo
=
js
.
get
(
"taskInfo"
)!=
null
?
JSON
.
parseObject
(
js
.
get
(
"taskInfo"
).
toString
()
):
null
;
LinkedHashMap
taskInfo
=
js
.
get
(
"taskInfo"
)!=
null
?(
LinkedHashMap
)
js
.
get
(
"taskInfo"
):
null
;
String
nextProcessNode
=
taskInfo
!=
null
?
taskInfo
.
get
(
"taskDefinitionKey"
).
toString
():
null
;
JSONObject
executor
=
js
.
get
(
"executor"
)!=
null
?
JSON
.
parseObject
(
js
.
get
(
"executor"
).
toString
()):
null
;
String
nodeRole
=
executor
!=
null
?
executor
.
get
(
"groupId"
).
toString
():
null
;
List
<
LinkedHashMap
>
executor
=
js
.
get
(
"executor"
)!=
null
?(
List
<
LinkedHashMap
>)
js
.
get
(
"executor"
):
null
;
String
nodeRole
=
null
;
if
(!
executor
.
isEmpty
()){
List
<
String
>
idList
=
executor
.
stream
().
map
(
e
->
e
.
get
(
"groupId"
).
toString
()).
collect
(
Collectors
.
toList
());
nodeRole
=
StringUtils
.
join
(
idList
,
","
);
}
JSONObject
extensionInfo
=
js
.
get
(
"extensionInfo"
)!=
null
?
JSON
.
parseObject
(
js
.
get
(
"extensionInfo"
).
toString
()
):
null
;
LinkedHashMap
extensionInfo
=
js
.
get
(
"extensionInfo"
)!=
null
?(
LinkedHashMap
)
js
.
get
(
"extensionInfo"
):
null
;
String
nodeRouting
=
extensionInfo
!=
null
?
extensionInfo
.
get
(
"nodeRole"
).
toString
():
null
;
workDto
=
new
WorkDto
(
nodeRouting
,
nodeRole
,
nextProcessNode
);
}
return
workDto
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
}
public
String
getTaskNoAuth
(
String
processInstanceId
){
String
flowTaskId
=
null
;
try
{
JSONObject
jSONObject
=
workflowFeignClient
.
getTaskNoAuth
(
processInstanceId
);
if
(
IDX_REQUEST_STATE
.
equals
(
String
.
valueOf
(
jSONObject
.
get
(
"code"
)))){
JSONObject
jsd
=
jSONObject
.
get
(
"data"
)!=
null
?
JSON
.
parseObject
(
jSONObject
.
get
(
"data"
).
toString
()
):
null
;
LinkedHashMap
jsd
=
jSONObject
.
get
(
"data"
)!=
null
?(
LinkedHashMap
)
jSONObject
.
get
(
"data"
):
null
;
flowTaskId
=
jsd
!=
null
?
jsd
.
get
(
"id"
).
toString
():
null
;
}
if
(
flowTaskId
==
null
){
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
return
flowTaskId
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
}
// 设计信息填充
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/SurveyInformationServiceImpl.java
View file @
417b0273
...
...
@@ -30,6 +30,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -233,7 +234,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
powerStationService
.
savePowerStation
(
powerStation
);
}
}
catch
(
Exception
e
){
e
.
getMessage
(
);
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
}
...
...
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