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
7ff2de81
Commit
7ff2de81
authored
Mar 12, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.使用登记增加限制
parent
48b901aa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
365 additions
and
77 deletions
+365
-77
ApplicationRunnerImpl.java
...va/com/yeejoin/amos/fas/config/ApplicationRunnerImpl.java
+1
-3
InstanceRuntimeData.java
...join/amos/boot/module/jg/api/dto/InstanceRuntimeData.java
+34
-0
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+2
-0
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+11
-2
RedissonManager.java
...ejoin/amos/boot/module/jg/biz/config/RedissonManager.java
+68
-0
JgChangeRegistrationNameController.java
...jg/biz/controller/JgChangeRegistrationNameController.java
+1
-1
JgUseRegistrationController.java
...module/jg/biz/controller/JgUseRegistrationController.java
+3
-2
ApplicationRunnerImpl.java
...n/amos/boot/module/jg/biz/init/ApplicationRunnerImpl.java
+34
-0
ICommonService.java
...ejoin/amos/boot/module/jg/biz/service/ICommonService.java
+23
-0
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+126
-44
JgChangeRegistrationNameServiceImpl.java
...biz/service/impl/JgChangeRegistrationNameServiceImpl.java
+62
-25
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+0
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/config/ApplicationRunnerImpl.java
View file @
7ff2de81
...
@@ -19,9 +19,7 @@ import org.springframework.stereotype.Component;
...
@@ -19,9 +19,7 @@ import org.springframework.stereotype.Component;
public
class
ApplicationRunnerImpl
implements
ApplicationRunner
{
public
class
ApplicationRunnerImpl
implements
ApplicationRunner
{
@Autowired
@Autowired
private
IEquipmentHandlerService
equipmentHandlerService
;
IC
@Autowired
private
IContingencyPlanService
contingencyPlanService
;
@Override
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/InstanceRuntimeData.java
0 → 100644
View file @
7ff2de81
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
/**
* @author Administrator
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
InstanceRuntimeData
implements
Serializable
{
/**
* 下一个执行节点id
*/
private
String
nextTaskId
;
/**
* 最近流程执行人
*/
private
String
promoter
;
/**
* 下一节点执行人
*/
private
String
nextExecuteUserIds
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
View file @
7ff2de81
...
@@ -29,6 +29,8 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
...
@@ -29,6 +29,8 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
String
selectBusinessData
(
String
tableName
,
String
instanceId
);
String
selectBusinessData
(
String
tableName
,
String
instanceId
);
String
selectPromoterData
(
String
tableName
,
String
instanceId
);
void
updateBusinessData
(
String
tableName
,
String
assignee
,
String
transferToUserIds
,
String
instanceId
,
String
nextTaskId
);
void
updateBusinessData
(
String
tableName
,
String
assignee
,
String
transferToUserIds
,
String
instanceId
,
String
nextTaskId
);
Map
<
String
,
Object
>
getUserPhone
(
String
name
,
String
companyCode
);
Map
<
String
,
Object
>
getUserPhone
(
String
name
,
String
companyCode
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
7ff2de81
...
@@ -69,10 +69,11 @@
...
@@ -69,10 +69,11 @@
</select>
</select>
<select
id=
"selectBusinessData"
resultType=
"java.lang.String"
>
<select
id=
"selectBusinessData"
resultType=
"java.lang.String"
>
select transfer_to_user_ids
select
transfer_to_user_ids
from ${tableName}
from ${tableName}
where instance_id = #{instanceId}
where instance_id = #{instanceId}
</select>
</select>
<update
id=
"updateBusinessData"
>
<update
id=
"updateBusinessData"
>
update ${tableName}
update ${tableName}
...
@@ -89,5 +90,13 @@
...
@@ -89,5 +90,13 @@
and name = #{name}
and name = #{name}
AND is_delete = 0
AND is_delete = 0
</select>
</select>
<select
id=
"selectPromoterData"
resultType=
"java.lang.String"
>
select
promoter
from
${tableName}
where
instance_id = #{instanceId}
</select>
</mapper>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/config/RedissonManager.java
0 → 100644
View file @
7ff2de81
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.Redisson
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.config.Config
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@Slf4j
public
class
RedissonManager
{
/**
* 集群环境使用-节点信息
*/
@Value
(
"${spring.redis.cluster.nodes:default}"
)
private
String
clusterNodes
;
/**
* 公共-密码
*/
@Value
(
"${spring.redis.password}"
)
private
String
password
;
/**
* 单机环境使用
*/
@Value
(
"${spring.redis.host:default}"
)
private
String
host
;
/**
* 单机环境使用
*/
@Value
(
"${spring.redis.port:default}"
)
private
String
port
;
/**
* 单机环境使用
*/
@Value
(
"${spring.redis.database:0}"
)
private
int
database
;
@Bean
@ConditionalOnProperty
(
name
=
"spring.redis.mode"
,
havingValue
=
"cluster"
)
public
RedissonClient
redissonClient
()
{
// 集群环境使用
Config
config
=
new
Config
();
config
.
useClusterServers
()
.
addNodeAddress
(
clusterNodes
.
split
(
","
))
.
setPassword
(
password
);
return
Redisson
.
create
(
config
);
}
@Bean
@ConditionalOnProperty
(
name
=
"spring.redis.mode"
,
havingValue
=
"singleton"
,
matchIfMissing
=
true
)
public
RedissonClient
redissonSingletonClient
()
{
// 单机环境使用
Config
config
=
new
Config
();
config
.
useSingleServer
().
setAddress
(
host
+
":"
+
port
).
setPassword
(
password
).
setDatabase
(
database
);
return
Redisson
.
create
(
config
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeRegistrationNameController.java
View file @
7ff2de81
...
@@ -87,7 +87,7 @@ public class JgChangeRegistrationNameController extends BaseController {
...
@@ -87,7 +87,7 @@ public class JgChangeRegistrationNameController extends BaseController {
@PostMapping
(
value
=
"/withdraw"
)
@PostMapping
(
value
=
"/withdraw"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"撤回"
,
notes
=
"撤回"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"撤回"
,
notes
=
"撤回"
)
public
ResponseModel
<
Object
>
revocation
(
@RequestBody
JSONObject
map
)
{
public
ResponseModel
<
Object
>
revocation
(
@RequestBody
JSONObject
map
)
{
jgChangeRegistrationNameService
.
revocation
(
String
.
valueOf
(
map
.
get
(
"instanceId"
)));
jgChangeRegistrationNameService
.
revocation
(
String
.
valueOf
(
map
.
get
(
"instanceId"
))
,
String
.
valueOf
(
map
.
get
(
"nextTaskId"
))
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgUseRegistrationController.java
View file @
7ff2de81
...
@@ -53,7 +53,8 @@ public class JgUseRegistrationController extends BaseController {
...
@@ -53,7 +53,8 @@ public class JgUseRegistrationController extends BaseController {
String
.
valueOf
(
map
.
get
(
"instanceId"
)),
String
.
valueOf
(
map
.
get
(
"instanceId"
)),
String
.
valueOf
(
map
.
get
(
"operate"
)),
String
.
valueOf
(
map
.
get
(
"operate"
)),
String
.
valueOf
(
map
.
get
(
"comment"
)),
String
.
valueOf
(
map
.
get
(
"comment"
)),
String
.
valueOf
(
map
.
getOrDefault
(
"carNumber"
,
""
)));
String
.
valueOf
(
map
.
getOrDefault
(
"carNumber"
,
""
)),
String
.
valueOf
(
map
.
get
(
"nextTaskId"
)));
return
ResponseHelper
.
buildResponse
(
"ok"
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
...
@@ -62,7 +63,7 @@ public class JgUseRegistrationController extends BaseController {
...
@@ -62,7 +63,7 @@ public class JgUseRegistrationController extends BaseController {
@PostMapping
(
value
=
"/withdraw"
)
@PostMapping
(
value
=
"/withdraw"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"撤回"
,
notes
=
"撤回"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"撤回"
,
notes
=
"撤回"
)
public
ResponseModel
<
Object
>
withdraw
(
@RequestBody
JSONObject
map
)
{
public
ResponseModel
<
Object
>
withdraw
(
@RequestBody
JSONObject
map
)
{
jgUseRegistrationServiceImpl
.
withdraw
(
String
.
valueOf
(
map
.
get
(
"instanceId"
)));
jgUseRegistrationServiceImpl
.
withdraw
(
String
.
valueOf
(
map
.
get
(
"instanceId"
))
,
String
.
valueOf
(
map
.
get
(
"nextTaskId"
))
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/init/ApplicationRunnerImpl.java
0 → 100644
View file @
7ff2de81
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
init
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Component
public
class
ApplicationRunnerImpl
implements
ApplicationRunner
{
private
JgUseRegistrationServiceImpl
useRegistrationService
;
private
CommonServiceImpl
commonService
;
public
ApplicationRunnerImpl
(
JgUseRegistrationServiceImpl
useRegistrationService
,
CommonServiceImpl
commonService
)
{
this
.
commonService
=
commonService
;
this
.
useRegistrationService
=
useRegistrationService
;
}
@Override
public
void
run
(
ApplicationArguments
args
)
{
// TODO 增加删除启动时, 完成时
List
<
JgUseRegistration
>
jgUseRegistrations
=
useRegistrationService
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
ne
(
JgUseRegistration:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
jgUseRegistrations
.
forEach
(
jgUseRegistration
->
{
commonService
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
useRegistrationService
.
buildInstanceRuntimeData
(
jgUseRegistration
));
});
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/ICommonService.java
View file @
7ff2de81
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.dto.InstanceRuntimeData
;
import
com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory
;
...
@@ -80,4 +81,26 @@ public interface ICommonService {
...
@@ -80,4 +81,26 @@ public interface ICommonService {
void
useFlagGenerate
(
UseFlagParamDto
useFlagParamDto
,
HttpServletResponse
response
);
void
useFlagGenerate
(
UseFlagParamDto
useFlagParamDto
,
HttpServletResponse
response
);
Map
<
String
,
Object
>
getUserPhone
(
String
name
);
Map
<
String
,
Object
>
getUserPhone
(
String
name
);
/**
* 执行流程时前置校验
* @param taskId 任务id
* @param instanceId 实例id
*/
void
checkForExecuteFlow
(
String
taskId
,
String
instanceId
);
/**
* 最新流程数据缓存
* @param instanceId 实例id
* @param instanceData 流程数据
*/
void
saveExecuteFlowData2Redis
(
String
instanceId
,
InstanceRuntimeData
instanceData
);
/**
* 撤回时校验
* @param taskId 任务id
* @param instanceId 实例id
*/
void
checkForRevocationFlow
(
String
taskId
,
String
instanceId
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
7ff2de81
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgChangeRegistrationNameServiceImpl.java
View file @
7ff2de81
...
@@ -11,10 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -11,10 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationNameDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.dto.TaskMessageDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.TaskModelDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.WorkflowResultDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum
;
...
@@ -37,6 +34,8 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
...
@@ -37,6 +34,8 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
...
@@ -48,6 +47,7 @@ import org.springframework.util.StringUtils;
...
@@ -48,6 +47,7 @@ import org.springframework.util.StringUtils;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
import
java.util.*
;
...
@@ -107,6 +107,9 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -107,6 +107,9 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
@Autowired
@Autowired
ICmWorkflowService
cmWorkflowService
;
ICmWorkflowService
cmWorkflowService
;
@Autowired
private
RedissonClient
redissonClient
;
private
static
String
template
=
"来自企业(%s)的业务办理,【申请单号:%s】"
;
private
static
String
template
=
"来自企业(%s)的业务办理,【申请单号:%s】"
;
...
@@ -446,7 +449,15 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -446,7 +449,15 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
}
}
public
void
revocation
(
String
instanceId
)
{
public
void
revocation
(
String
instanceId
,
String
taskId
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
boolean
isLocked
=
lock
.
tryLock
();
// 解决并发问题:多个人同时操作一个流程(并发执行通过、驳回)
if
(!
isLocked
){
throw
new
BadRequest
(
"当前流程已经被执行!"
);
}
commonService
.
checkForRevocationFlow
(
taskId
,
instanceId
);
// 执行流程
// 执行流程
String
taskCode
=
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
String
taskCode
=
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
JgChangeRegistrationName
jgChangeRegistrationName
=
new
JgChangeRegistrationName
();
JgChangeRegistrationName
jgChangeRegistrationName
=
new
JgChangeRegistrationName
();
...
@@ -498,29 +509,45 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -498,29 +509,45 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
public
void
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
)
{
public
void
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
JgChangeRegistrationName
jgChangeRegistrationName
=
this
.
getBaseMapper
().
selectById
(
id
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
String
taskId
=
jgChangeRegistrationName
.
getNextTaskId
();
boolean
isLocked
=
lock
.
tryLock
();
//组装信息
try
{
TaskResultDTO
dto
=
new
TaskResultDTO
();
// 解决并发问题:多个人同时操作一个流程(并发执行通过、驳回)
dto
.
setResultCode
(
"approvalStatus"
);
if
(!
isLocked
){
dto
.
setTaskId
(
taskId
);
throw
new
BadRequest
(
"当前流程已经被执行!"
);
dto
.
setComment
(
comment
);
}
dto
.
setNextExecuteUserCompanyCode
(
this
.
getNextUserOrgCode
(
operate
,
jgChangeRegistrationName
));
JgChangeRegistrationName
jgChangeRegistrationName
=
this
.
getBaseMapper
().
selectById
(
id
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
String
taskId
=
jgChangeRegistrationName
.
getNextTaskId
();
map
.
put
(
"approvalStatus"
,
operate
);
// 流程执行时,状态及权限校验
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationName
.
getInstanceStatus
())
&&
commonService
.
checkForExecuteFlow
(
taskId
,
instanceId
);
(
jgChangeRegistrationName
.
getAuditStatus
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getReject
())
||
// 组装信息
jgChangeRegistrationName
.
getAuditStatus
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getRollBack
())))
{
TaskResultDTO
dto
=
new
TaskResultDTO
();
map
.
put
(
"approvalStatus"
,
"提交"
);
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setTaskId
(
taskId
);
dto
.
setComment
(
comment
);
dto
.
setNextExecuteUserCompanyCode
(
this
.
getNextUserOrgCode
(
operate
,
jgChangeRegistrationName
));
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
operate
);
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationName
.
getInstanceStatus
())
&&
(
jgChangeRegistrationName
.
getAuditStatus
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getReject
())
||
jgChangeRegistrationName
.
getAuditStatus
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getRollBack
())))
{
map
.
put
(
"approvalStatus"
,
"提交"
);
}
dto
.
setVariable
(
map
);
//执行流程
ProcessTaskDTO
processTaskDTO
=
cmWorkflowService
.
completeOrReject
(
taskId
,
dto
,
operate
);
// 更新下一步执行人、创建待办
updateExecuteIds
(
instanceId
,
id
,
operate
,
processTaskDTO
);
}
finally
{
if
(
isLocked
){
lock
.
unlock
();
}
}
}
dto
.
setVariable
(
map
);
//执行流程
ProcessTaskDTO
processTaskDTO
=
cmWorkflowService
.
completeOrReject
(
taskId
,
dto
,
operate
);
// 更新下一步执行人、创建待办
updateExecuteIds
(
instanceId
,
id
,
operate
,
processTaskDTO
);
}
}
private
String
getNextUserOrgCode
(
String
operate
,
JgChangeRegistrationName
jgChangeRegistrationName
)
{
private
String
getNextUserOrgCode
(
String
operate
,
JgChangeRegistrationName
jgChangeRegistrationName
)
{
if
(
"0"
.
equals
(
operate
))
{
if
(
"0"
.
equals
(
operate
))
{
// 执行通过节点,单位code为接收机构单位信息
// 执行通过节点,单位code为接收机构单位信息
...
@@ -583,9 +610,19 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -583,9 +610,19 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
// 更新代办
// 更新代办
updateTaskModel
(
jgChangeRegistrationName
,
operate
);
updateTaskModel
(
jgChangeRegistrationName
,
operate
);
}
}
// 保存redis最新流程数据
commonService
.
saveExecuteFlowData2Redis
(
jgChangeRegistrationName
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgChangeRegistrationName
));
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationName
);
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationName
);
}
}
private
InstanceRuntimeData
buildInstanceRuntimeData
(
JgChangeRegistrationName
jgChangeRegistrationName
)
{
return
InstanceRuntimeData
.
builder
()
.
nextExecuteUserIds
(
jgChangeRegistrationName
.
getNextExecuteUserIds
())
.
promoter
(
jgChangeRegistrationName
.
getPromoter
())
.
nextTaskId
(
jgChangeRegistrationName
.
getNextTaskId
())
.
build
();
}
private
TaskV2Model
updateTaskModel
(
JgChangeRegistrationName
jgChangeRegistrationName
,
String
operate
)
{
private
TaskV2Model
updateTaskModel
(
JgChangeRegistrationName
jgChangeRegistrationName
,
String
operate
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
FlowStatusEnum
flowStatusEnum
=
this
.
getTaskStatus
(
operate
);
FlowStatusEnum
flowStatusEnum
=
this
.
getTaskStatus
(
operate
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
View file @
7ff2de81
This diff is collapsed.
Click to expand it.
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