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
56f59fc1
Commit
56f59fc1
authored
May 30, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.转办bug修改
parent
1208720d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
13 deletions
+100
-13
JyjcBaseMapper.java
...join/amos/boot/module/jyjc/api/mapper/JyjcBaseMapper.java
+4
-2
JyjcBaseMapper.xml
...ule-jyjc-api/src/main/resources/mapper/JyjcBaseMapper.xml
+9
-0
CommonController.java
...mos/boot/module/jyjc/biz/controller/CommonController.java
+10
-10
TaskModelServiceImpl.java
...os/boot/module/jyjc/biz/service/TaskModelServiceImpl.java
+77
-1
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/mapper/JyjcBaseMapper.java
View file @
56f59fc1
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper;
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
...
@@ -28,7 +27,10 @@ public interface JyjcBaseMapper {
...
@@ -28,7 +27,10 @@ public interface JyjcBaseMapper {
String
selectBusinessData
(
String
tableName
,
String
instanceId
,
String
key
);
String
selectBusinessData
(
String
tableName
,
String
instanceId
,
String
key
);
void
updateBusinessData
(
String
tableName
,
String
assignee
,
String
transferToUserIds
,
String
instanceId
,
String
nextTaskId
,
String
key
);
void
updateBusinessData
(
String
tableName
,
String
assignee
,
String
transferToUserIds
,
String
instanceId
,
String
nextTaskId
,
String
key
);
void
updateBusinessDataWithCompany
(
String
tableName
,
String
assignee
,
String
transferToUserIds
,
String
instanceId
,
String
nextTaskId
,
String
key
,
String
inspectionUnitCode
,
String
companyName
);
List
<
TzsUserInfoDto
>
selectParentOrgUsers
(
@Param
(
"parentOrgCodeList"
)
Set
<
String
>
parentOrgCodeList
);
List
<
TzsUserInfoDto
>
selectParentOrgUsers
(
@Param
(
"parentOrgCodeList"
)
Set
<
String
>
parentOrgCodeList
);
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcBaseMapper.xml
View file @
56f59fc1
...
@@ -8,6 +8,15 @@
...
@@ -8,6 +8,15 @@
next_task_id = #{nextTaskId}
next_task_id = #{nextTaskId}
where ${key} = #{instanceId}
where ${key} = #{instanceId}
</update>
</update>
<update
id=
"updateBusinessDataWithCompany"
>
update ${tableName}
set transfer_to_user_ids = #{transferToUserIds},
next_execute_user_ids = #{assignee},
next_task_id = #{nextTaskId},
inspection_unit_code = #{inspectionUnitCode},
inspection_unit_name = #{companyName}
where ${key} = #{instanceId}
</update>
<select
id=
"selectBaseUnitLicenceList"
parameterType=
"map"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto"
>
<select
id=
"selectBaseUnitLicenceList"
parameterType=
"map"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto"
>
select * from tz_base_unit_licence
select * from tz_base_unit_licence
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/controller/CommonController.java
View file @
56f59fc1
...
@@ -134,29 +134,29 @@ public class CommonController extends BaseController {
...
@@ -134,29 +134,29 @@ public class CommonController extends BaseController {
* /common/transfer
* /common/transfer
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/
bj
/transfer"
)
@PostMapping
(
value
=
"/
kt
/transfer"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"公共转办接口
"
,
notes
=
"公共转办接口
"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"公共转办接口
-开通"
,
notes
=
"公共转办接口-开通
"
)
public
ResponseModel
<
Object
>
transfer
BJ
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Object
>
transfer
KT
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"key"
,
"
in
stance_id"
);
map
.
put
(
"key"
,
"
workflow_pro
stance_id"
);
Object
result
=
taskModelService
.
transfer
(
map
);
Object
result
=
taskModelService
.
transfer
(
map
);
return
ResponseHelper
.
buildResponse
(
result
);
return
ResponseHelper
.
buildResponse
(
result
);
}
}
/**
/**
* 公共转办接口
* 公共转办接口
* /common/transfer
* /common/transfer
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/
kt
/transfer"
)
@PostMapping
(
value
=
"/
bj
/transfer"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"公共转办接口
"
,
notes
=
"公共转办接口
"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"公共转办接口
-报检"
,
notes
=
"公共转办接口-报检
"
)
public
ResponseModel
<
Object
>
transfer
KT
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Object
>
transfer
BJ
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"key"
,
"
workflow_pro
stance_id"
);
map
.
put
(
"key"
,
"
in
stance_id"
);
Object
result
=
taskModelService
.
transfer
(
map
);
Object
result
=
taskModelService
.
transfer
2
(
map
);
return
ResponseHelper
.
buildResponse
(
result
);
return
ResponseHelper
.
buildResponse
(
result
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{unitCode}/user-list"
)
@GetMapping
(
value
=
"/{unitCode}/user-list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询指定公司、指定人员类型的人员列表"
,
notes
=
"查询指定公司、指定人员类型的人员列表"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询指定公司、指定人员类型的人员列表"
,
notes
=
"查询指定公司、指定人员类型的人员列表"
)
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/TaskModelServiceImpl.java
View file @
56f59fc1
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonServiceImpl;
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonServiceImpl;
import
com.yeejoin.amos.boot.module.jyjc.biz.util.JsonUtils
;
import
com.yeejoin.amos.boot.module.jyjc.biz.util.JsonUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.model.ActTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActTaskDTO
;
...
@@ -380,7 +381,6 @@ public class TaskModelServiceImpl {
...
@@ -380,7 +381,6 @@ public class TaskModelServiceImpl {
return
workflowResultDtoList
;
return
workflowResultDtoList
;
}
}
public
Object
transfer
(
Map
<
String
,
Object
>
map
)
{
public
Object
transfer
(
Map
<
String
,
Object
>
map
)
{
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"nextTaskId"
))
||
map
.
get
(
"nextTaskId"
)
==
null
)
{
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"nextTaskId"
))
||
map
.
get
(
"nextTaskId"
)
==
null
)
{
throw
new
BadRequest
(
"nextTaskId不能为空"
);
throw
new
BadRequest
(
"nextTaskId不能为空"
);
...
@@ -454,6 +454,82 @@ public class TaskModelServiceImpl {
...
@@ -454,6 +454,82 @@ public class TaskModelServiceImpl {
return
Boolean
.
FALSE
;
return
Boolean
.
FALSE
;
}
}
public
Object
transfer2
(
Map
<
String
,
Object
>
map
)
{
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"nextTaskId"
))
||
map
.
get
(
"nextTaskId"
)
==
null
)
{
throw
new
BadRequest
(
"nextTaskId不能为空"
);
}
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"instanceId"
))
||
map
.
get
(
"instanceId"
)
==
null
)
{
throw
new
BadRequest
(
"instanceId不能为空"
);
}
String
inspectUnitCode
=
map
.
get
(
"transferOrg"
).
toString
();
CompanyModel
companyModel
=
jyjcBaseMapper
.
selectOneCompanyByCode
(
inspectUnitCode
);
String
taskId
=
map
.
get
(
"nextTaskId"
).
toString
();
String
instanceId
=
map
.
get
(
"instanceId"
).
toString
();
String
lockKey
=
CommonServiceImpl
.
buildJcExecuteLockKey
(
instanceId
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
try
{
boolean
isLocked
=
lock
.
tryLock
(
0
,
180
,
TimeUnit
.
SECONDS
);
// 解决并发问题:多个人同时操作一个流程(并发执行通过、驳回、撤回)
if
(!
isLocked
)
{
throw
new
BadRequest
(
"当前流程已经被执行!请重新打开页面查看并执行!"
);
}
// 流程执行时,状态及权限校验
commonService
.
checkForExecuteFlow
(
taskId
,
instanceId
);
String
tableName
=
map
.
get
(
"tableName"
).
toString
();
String
assignee
=
map
.
get
(
"assignee"
).
toString
();
FlowTaskVo
flowTaskVo
=
new
FlowTaskVo
();
flowTaskVo
.
setTaskId
(
taskId
);
flowTaskVo
.
setAssignee
(
assignee
);
ProcessTaskDTO
processTaskDTO
=
cmWorkflowService
.
assign
(
flowTaskVo
);
//修改待办
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
instanceId
).
getResult
();
List
<
TaskV2Model
>
collect
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getSequenceNbr
().
compareTo
(
r1
.
getSequenceNbr
())).
collect
(
Collectors
.
toList
());
if
(
collect
.
size
()
==
0
)
{
return
null
;
}
TaskV2Model
taskV2Model
=
collect
.
get
(
0
);
taskV2Model
.
setExecuteUserIds
(
RequestContext
.
getExeUserId
());
taskV2Model
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_TRANSFER
.
getCode
());
taskV2Model
.
setTaskStatusLabel
(
FlowStatusEnum
.
TO_BE_TRANSFER
.
getName
());
taskV2Model
.
setEndUserId
(
RequestContext
.
getExeUserId
());
taskV2Model
.
setEndDate
(
new
Date
());
String
routhPath
=
taskV2Model
.
getRoutePath
().
replace
(
"nextExecuteUserIds"
,
"executeUserId"
)
+
"&nextExecuteUserIds="
+
assignee
;
taskV2Model
.
setRoutePath
(
routhPath
);
Systemctl
.
taskV2Client
.
update
(
taskV2Model
,
taskV2Model
.
getSequenceNbr
());
//创建新待办
taskV2Model
.
setExecuteUserIds
(
assignee
);
String
nextTaskId
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getId
();
taskV2Model
.
setFlowCode
(
nextTaskId
);
String
routhPath1
=
routhPath
.
replace
(
"nextTaskId"
,
"nextTask"
)
+
"&nextTaskId="
+
nextTaskId
;
taskV2Model
.
setCreateDate
(
new
Date
());
taskV2Model
.
setRoutePath
(
routhPath1
);
taskV2Model
.
setTaskStatus
(
0
);
taskV2Model
.
setTaskStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskV2Model
.
setEndUserId
(
null
);
taskV2Model
.
setEndDate
(
null
);
taskV2Model
.
setSequenceNbr
(
null
);
Systemctl
.
taskV2Client
.
create
(
taskV2Model
);
String
key
=
map
.
get
(
"key"
).
toString
();
String
id
=
jyjcBaseMapper
.
selectBusinessData
(
tableName
,
instanceId
,
key
);
id
=
ObjectUtils
.
isEmpty
(
id
)
?
assignee
:
id
+
","
+
assignee
;
//修改业务数据
jyjcBaseMapper
.
updateBusinessDataWithCompany
(
tableName
,
assignee
,
id
,
instanceId
,
nextTaskId
,
key
,
inspectUnitCode
,
companyModel
.
getCompanyName
());
// 更新流程中的流程数据
commonService
.
saveExecuteFlowData2Redis
(
instanceId
,
this
.
buildInstanceRuntimeData
(
assignee
,
""
,
nextTaskId
));
return
Boolean
.
TRUE
;
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
lock
.
isHeldByCurrentThread
())
{
lock
.
unlock
();
}
}
return
Boolean
.
FALSE
;
}
public
InstanceRuntimeData
buildInstanceRuntimeData
(
String
executeUserIds
,
String
promoter
,
String
nextTaskId
)
{
public
InstanceRuntimeData
buildInstanceRuntimeData
(
String
executeUserIds
,
String
promoter
,
String
nextTaskId
)
{
return
InstanceRuntimeData
.
builder
()
return
InstanceRuntimeData
.
builder
()
.
nextExecuteUserIds
(
executeUserIds
)
.
nextExecuteUserIds
(
executeUserIds
)
...
...
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