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
0596a358
Commit
0596a358
authored
Mar 07, 2023
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增流程关系表公用方法save和update
parent
76de4841
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
0 deletions
+69
-0
ProcessTypeEnum.java
...eejoin/amos/boot/module/ugp/api/Enum/ProcessTypeEnum.java
+11
-0
IProcessRelationService.java
.../boot/module/ugp/api/service/IProcessRelationService.java
+16
-0
ProcessRelationServiceImpl.java
...dule/ugp/biz/service/impl/ProcessRelationServiceImpl.java
+42
-0
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ProcessTypeEnum.java
View file @
0596a358
...
@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.ugp.api.Enum;
...
@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.ugp.api.Enum;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
@Getter
@Getter
@AllArgsConstructor
@AllArgsConstructor
public
enum
ProcessTypeEnum
{
public
enum
ProcessTypeEnum
{
...
@@ -14,4 +17,12 @@ public enum ProcessTypeEnum {
...
@@ -14,4 +17,12 @@ public enum ProcessTypeEnum {
String
type
;
String
type
;
String
name
;
String
name
;
String
tableName
;
String
tableName
;
public
static
Map
<
String
,
String
>
getCodeByName
=
new
HashMap
<
String
,
String
>();
static
{
for
(
ProcessTypeEnum
processTypeEnum:
ProcessTypeEnum
.
values
()){
getCodeByName
.
put
(
processTypeEnum
.
name
,
processTypeEnum
.
type
);
}
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IProcessRelationService.java
View file @
0596a358
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
public
interface
IProcessRelationService
{
public
interface
IProcessRelationService
{
/**
* 保存资源流程关系信息
*
* @param instanceId 流程实例id
* @param sourceId 资源id
* @param processName 流程名称(文字)
*/
void
savePR
(
String
instanceId
,
Long
sourceId
,
String
processName
);
/**
* 更新资源流程关系信息 state字段
*
* @param instanceId 流程实例id
*/
void
updateState
(
String
instanceId
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProcessRelationServiceImpl.java
View file @
0596a358
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProcessTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProcessRelationDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProcessRelationDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProcessRelation
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProcessRelation
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProcessRelationMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProcessRelationMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProcessRelationService
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProcessRelationService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
@Service
@Service
public
class
ProcessRelationServiceImpl
extends
BaseService
<
ProcessRelationDto
,
ProcessRelation
,
ProcessRelationMapper
>
implements
IProcessRelationService
{
public
class
ProcessRelationServiceImpl
extends
BaseService
<
ProcessRelationDto
,
ProcessRelation
,
ProcessRelationMapper
>
implements
IProcessRelationService
{
@Autowired
ProjectInitiationServiceImpl
projectInitiationService
;
/**
* 保存资源流程关系信息
*
* @param instanceId 流程实例id
* @param sourceId 资源id
* @param processName 流程名称(文字)
*/
@Override
public
void
savePR
(
String
instanceId
,
Long
sourceId
,
String
processName
){
//此处不给state赋值,待流程执行更新state字段
ProcessRelation
processRelation
=
new
ProcessRelation
();
processRelation
.
setInstanceId
(
instanceId
);
processRelation
.
setSourceId
(
sourceId
);
processRelation
.
setDefName
(
processName
);
processRelation
.
setDefCode
(
ProcessTypeEnum
.
getCodeByName
.
get
(
processName
));
this
.
save
(
processRelation
);
}
/**
* 更新资源流程关系信息 state字段
*
* @param instanceId 流程实例id
*/
@Override
public
void
updateState
(
String
instanceId
){
LambdaQueryWrapper
<
ProcessRelation
>
wrapper
=
new
LambdaQueryWrapper
();
wrapper
.
eq
(
ProcessRelation:
:
getInstanceId
,
instanceId
);
// .eq(ProcessRelation::getSourceId,sourceId).eq(ProcessRelation::getDefName,processName);
ProcessRelation
processRelation
=
this
.
getOne
(
wrapper
);
String
taskName
=
projectInitiationService
.
getFlowTaskName
(
instanceId
);
processRelation
.
setStatus
(
taskName
);
this
.
updateById
(
processRelation
);
}
}
}
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