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
e9a39c1e
Commit
e9a39c1e
authored
Jan 10, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.单位更名
parent
991b59ec
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
159 additions
and
262 deletions
+159
-262
JgChangeRegistrationNameDto.java
...s/boot/module/jg/api/dto/JgChangeRegistrationNameDto.java
+7
-0
JgChangeRegistrationName.java
...s/boot/module/jg/api/entity/JgChangeRegistrationName.java
+7
-0
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+1
-1
JgChangeRegistrationNameServiceImpl.java
...biz/service/impl/JgChangeRegistrationNameServiceImpl.java
+142
-259
urlInfo.json
...s-boot-module-jg-biz/src/main/resources/json/urlInfo.json
+2
-2
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/JgChangeRegistrationNameDto.java
View file @
e9a39c1e
...
@@ -99,4 +99,11 @@ public class JgChangeRegistrationNameDto extends BaseDto {
...
@@ -99,4 +99,11 @@ public class JgChangeRegistrationNameDto extends BaseDto {
// 区分监管和企业
// 区分监管和企业
private
String
type
;
private
String
type
;
/**
* 下一步任务id
*/
private
String
nextTaskId
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgChangeRegistrationName.java
View file @
e9a39c1e
...
@@ -142,4 +142,11 @@ public class JgChangeRegistrationName extends BaseEntity {
...
@@ -142,4 +142,11 @@ public class JgChangeRegistrationName extends BaseEntity {
@TableField
(
"instance_status"
)
@TableField
(
"instance_status"
)
private
String
instanceStatus
;
private
String
instanceStatus
;
/**
* 下一步任务id
*/
@TableField
(
"next_task_id"
)
private
String
nextTaskId
;
}
}
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 @
e9a39c1e
...
@@ -630,7 +630,7 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -630,7 +630,7 @@ public class CommonServiceImpl implements ICommonService {
}
}
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
for
(
Map
map
:
urlList
)
{
for
(
Map
map
:
urlList
)
{
if
(
map
.
get
(
"type"
).
equals
(
obj
.
getTaskType
())
&&
map
.
get
(
"pageType"
).
equals
(
"look"
)){
if
(
map
.
get
(
"type"
).
equals
(
obj
.
getTaskType
())
&&
map
.
get
(
"pageType"
).
equals
(
"look"
)
&&
map
.
get
(
"url"
)
!=
null
){
model
.
setRoutePath
(
map
.
get
(
"url"
).
toString
().
replace
(
"{roleIds}"
,
obj
.
getNextExecuteUser
()).
replace
(
"{userId}"
,
RequestContext
.
getExeUserId
())+
urlParams
);
model
.
setRoutePath
(
map
.
get
(
"url"
).
toString
().
replace
(
"{roleIds}"
,
obj
.
getNextExecuteUser
()).
replace
(
"{userId}"
,
RequestContext
.
getExeUserId
())+
urlParams
);
}
}
}
}
...
...
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 @
e9a39c1e
...
@@ -2,9 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
...
@@ -2,9 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.map.MapUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -21,6 +19,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
...
@@ -21,6 +19,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import
com.yeejoin.amos.boot.module.jg.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationNameService
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationNameService
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
...
@@ -30,14 +29,10 @@ import com.yeejoin.amos.boot.module.ymt.flc.api.entity.RegUnitInfo;
...
@@ -30,14 +29,10 @@ import com.yeejoin.amos.boot.module.ymt.flc.api.entity.RegUnitInfo;
import
com.yeejoin.amos.boot.module.ymt.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.feign.AccessFeignService
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.mapper.RegUnitInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.flc.api.mapper.RegUnitInfoMapper
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
import
com.yeejoin.amos.feign.workflow.model.*
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.AjaxResult
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
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
;
...
@@ -49,6 +44,7 @@ import org.springframework.util.StringUtils;
...
@@ -49,6 +44,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.*
;
...
@@ -108,7 +104,8 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -108,7 +104,8 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
@Autowired
@Autowired
CommonServiceImpl
commonService
;
CommonServiceImpl
commonService
;
@Autowired
ICmWorkflowService
cmWorkflowService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -119,18 +116,11 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -119,18 +116,11 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
}
}
public
void
save
(
String
submitType
,
Map
<
String
,
JSONObject
>
jgRegistrationInfoMap
)
{
public
void
save
(
String
submitType
,
Map
<
String
,
JSONObject
>
jgRegistrationInfoMap
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
[]
taskName
=
new
String
[]{
"流程结束"
};
String
[]
taskName
=
new
String
[]{
"流程结束"
};
JSONObject
jgRegistrationInfo
=
jgRegistrationInfoMap
.
get
(
"jgRegistrationInfo"
);
JSONObject
jgRegistrationInfo
=
jgRegistrationInfoMap
.
get
(
"jgRegistrationInfo"
);
JgChangeRegistrationNameDto
model
=
JSON
.
parseObject
(
jgRegistrationInfo
.
toJSONString
(),
JgChangeRegistrationNameDto
.
class
);
JgChangeRegistrationNameDto
model
=
JSON
.
parseObject
(
jgRegistrationInfo
.
toJSONString
(),
JgChangeRegistrationNameDto
.
class
);
List
<
Map
<
String
,
Object
>>
deviceList
=
jgChangeRegistrationNameMapper
.
getEquipInfoByOrgCode
(
reginParams
.
getCompany
().
getCompanyCode
());
// 获取告知单号
// 获取告知单号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
GMBG
.
getCode
(),
1
);
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
GMBG
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
)
&&
listResponseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
)
&&
listResponseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
...
@@ -141,74 +131,47 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -141,74 +131,47 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
if
(
CollectionUtils
.
isEmpty
(
applyNoList
))
{
if
(
CollectionUtils
.
isEmpty
(
applyNoList
))
{
return
;
return
;
}
}
List
<
ProcessTaskDTO
>
processTasks
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListSecond
=
new
ArrayList
<>();
// 判断当前是否为提交
// 判断当前是否为提交
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
String
instanceId
=
""
;
String
nextTaskId
=
""
;
List
<
String
>
roleListNext
=
new
ArrayList
<>();
List
<
String
>
roleListAll
=
new
ArrayList
<>();
String
applyNo
=
applyNoList
.
get
(
0
);
if
(
"1"
.
equals
(
submitType
))
{
if
(
"1"
.
equals
(
submitType
))
{
// 发起流程
// 发起流程
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
"unitRename"
);
dto
.
setBusinessKey
(
"1"
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
try
{
try
{
FeignClientResult
result
=
Workflow
.
taskV2Client
.
startByVariableBatch
(
actWorkflowBatchDTO
);
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
Object
>
returnList
=
(
List
<
Object
>)
result
.
getResult
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
for
(
Object
obj
:
returnList
)
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
dto
.
setProcessDefinitionKey
(
"unitRename"
);
String
instanceId
=
jsonObject
.
getString
(
"id"
);
dto
.
setBusinessKey
(
applyNo
);
instanceIdList
.
add
(
instanceId
);
dto
.
setCompleteFirstTask
(
true
);
// 查询下节点任务
list
.
add
(
dto
);
if
(
returnList
.
get
(
0
).
equals
(
obj
))
{
actWorkflowBatchDTO
.
setProcess
(
list
);
getNext
(
roleListFirst
,
instanceId
,
taskName
);
processTasks
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
}
this
.
buildRoleList
(
processTasks
,
roleListNext
,
roleListAll
);
// 推动下一个节点
instanceId
=
processTasks
.
get
(
0
).
getProcessInstance
().
getId
();
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
nextTaskId
=
processTasks
.
get
(
0
).
getNextTask
().
get
(
0
).
getId
();
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
taskName
[
0
]
=
processTasks
.
get
(
0
).
getNextTask
().
get
(
0
).
getName
();
String
taskId
=
dataObject
.
getString
(
"id"
);
this
.
buildRoleList
(
processTasks
,
roleListNext
,
roleListAll
);
//组装信息
TaskResultDTO
dto2
=
new
TaskResultDTO
();
dto2
.
setResultCode
(
"approvalStatus"
);
dto2
.
setTaskId
(
taskId
);
dto2
.
setComment
(
"提交流程"
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
"0"
);
dto2
.
setVariable
(
map
);
//执行流程
AjaxResult
ajaxResult1
=
null
;
try
{
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto2
);
if
(
ajaxResult1
.
get
(
"code"
).
equals
(
200
))
{
getNext
(
roleListSecond
,
instanceId
,
taskName
);
roleListFirst
.
addAll
(
roleListSecond
);
}
else
{
log
.
error
(
"提交失败"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
log
.
error
(
"提交失败:{}"
,
e
);
throw
new
BadRequest
(
"提交失败"
+
e
.
getMessage
());
}
}
}
}
JgChangeRegistrationName
dto
=
new
JgChangeRegistrationName
();
JgChangeRegistrationName
dto
=
new
JgChangeRegistrationName
();
// 字段转换
// 字段转换
convertField
(
model
);
convertField
(
model
);
BeanUtils
.
copyProperties
(
model
,
dto
);
BeanUtils
.
copyProperties
(
model
,
dto
);
dto
.
setApplyNo
(
applyNo
);
dto
.
setApplyNo
(
applyNoList
.
get
(
0
));
dto
.
setCreateDate
(
new
Date
());
dto
.
setCreateDate
(
new
Date
());
dto
.
setNextExecutorIds
(
String
.
join
(
","
,
roleList
Second
));
dto
.
setNextExecutorIds
(
String
.
join
(
","
,
roleList
Next
));
dto
.
setInstanceStatus
(
String
.
join
(
","
,
roleList
First
));
dto
.
setInstanceStatus
(
String
.
join
(
","
,
roleList
All
));
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
if
(!
CollectionUtils
.
isEmpty
(
instanceIdList
))
{
if
(!
StringUtils
.
isEmpty
(
instanceId
))
{
dto
.
setInstanceId
(
instanceIdList
.
get
(
0
));
dto
.
setInstanceId
(
instanceId
);
dto
.
setNextTaskId
(
nextTaskId
);
dto
.
setAuditStatus
(
String
.
valueOf
(
WorkFlowStatusEnum
.
UNIT_RENAME_RECEIVE
.
getPass
()));
dto
.
setAuditStatus
(
String
.
valueOf
(
WorkFlowStatusEnum
.
UNIT_RENAME_RECEIVE
.
getPass
()));
}
else
{
}
else
{
dto
.
setAuditStatus
(
String
.
valueOf
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getPass
()));
dto
.
setAuditStatus
(
String
.
valueOf
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getPass
()));
...
@@ -218,35 +181,20 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -218,35 +181,20 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
this
.
save
(
dto
);
this
.
save
(
dto
);
// 创建代办
// 创建代办
this
.
createTaskModel
(
dto
,
taskName
[
0
],
submitType
);
this
.
createTaskModel
(
dto
,
taskName
[
0
],
submitType
);
List
<
JgChangeRegistrationNameEq
>
equipList
=
new
ArrayList
<>();
}
List
<
JgRegistrationHistory
>
list
=
new
ArrayList
<>();
deviceList
.
forEach
(
obj
->
{
private
void
buildRoleList
(
List
<
ProcessTaskDTO
>
processTasks
,
List
<
String
>
roleListNext
,
List
<
String
>
roleListAll
)
{
JgChangeRegistrationNameEq
jgRelationEquip
=
new
JgChangeRegistrationNameEq
();
processTasks
.
forEach
(
p
->
{
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"equipId"
)));
p
.
getNextCandidateGroups
().
values
().
forEach
(
e
->
{
jgRelationEquip
.
setNameChangeRegistrationId
(
String
.
valueOf
(
dto
.
getSequenceNbr
()));
roleListNext
.
addAll
(
e
);
jgRelationEquip
.
setIsInvalid
(
"0"
);
roleListAll
.
addAll
(
e
);
jgRelationEquip
.
setCreateDate
(
dto
.
getCreateDate
());
});
jgRelationEquip
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
roleListAll
.
addAll
(
p
.
getCandidateGroups
());
jgRelationEquip
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
equipList
.
add
(
jgRelationEquip
);
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
jgRegistrationHistory
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgRegistrationHistory
.
setCreateDate
(
dto
.
getCreateDate
());
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
dto
));
jgRegistrationHistory
.
setOldData
(
JSON
.
toJSONString
(
dto
));
jgRegistrationHistory
.
setRegistrationClass
(
"使用单位名称变更登记"
);
jgRegistrationHistory
.
setStatus
(
"new"
);
jgRegistrationHistory
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"equipId"
)));
jgRegistrationHistory
.
setSupervisoryCode
(
String
.
valueOf
(
obj
.
get
(
"supervisoryCode"
)));
jgRegistrationHistory
.
setUseRegistrationCode
(
String
.
valueOf
(
obj
.
get
(
"useOrgCode"
)));
jgRegistrationHistory
.
setCurrentDocumentId
(
dto
.
getApplyNo
());
list
.
add
(
jgRegistrationHistory
);
});
});
jgRegistrationHistoryService
.
saveBatch
(
list
);
}
}
private
void
createTaskModel
(
JgChangeRegistrationName
dto
,
String
taskName
,
String
submitType
)
{
private
void
createTaskModel
(
JgChangeRegistrationName
dto
,
String
taskName
,
String
submitType
)
{
if
(
"1"
.
equals
(
submitType
))
{
if
(
"1"
.
equals
(
submitType
))
{
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
taskModelDto
.
setFlowCreateDate
(
dto
.
getApplyDate
());
taskModelDto
.
setFlowCreateDate
(
dto
.
getApplyDate
());
taskModelDto
.
setTaskName
(
taskName
);
taskModelDto
.
setTaskName
(
taskName
);
...
@@ -262,6 +210,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -262,6 +210,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
taskModelDto
.
setStartUserId
(
dto
.
getCreateUserId
());
taskModelDto
.
setStartUserId
(
dto
.
getCreateUserId
());
taskModelDto
.
setStartUser
(
dto
.
getCreateUserName
());
taskModelDto
.
setStartUser
(
dto
.
getCreateUserName
());
taskModelDto
.
setStartUserCompanyName
(
dto
.
getUseUnitName
());
taskModelDto
.
setStartUserCompanyName
(
dto
.
getUseUnitName
());
taskModelDto
.
setNextExecuteUser
(
dto
.
getNextExecutorIds
());
taskModelDto
.
setStartDate
(
dto
.
getCreateDate
());
taskModelDto
.
setStartDate
(
dto
.
getCreateDate
());
taskModelDto
.
setModel
(
dto
);
taskModelDto
.
setModel
(
dto
);
commonService
.
buildTaskModel
(
Collections
.
singletonList
(
taskModelDto
));
commonService
.
buildTaskModel
(
Collections
.
singletonList
(
taskModelDto
));
...
@@ -269,13 +218,14 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -269,13 +218,14 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
}
}
private
Integer
getTaskCodeByName
(
String
auditStatus
)
{
private
Integer
getTaskCodeByName
(
String
auditStatus
)
{
return
null
;
return
commonService
.
getDictionaryCodeByName
(
auditStatus
)
;
}
}
/**
/**
* 摘要构建
* 摘要构建
*
* @param dto 业务
* @param dto 业务
* @return
摘要
* @return 摘要
*/
*/
private
String
buildTaskContent
(
JgChangeRegistrationName
dto
)
{
private
String
buildTaskContent
(
JgChangeRegistrationName
dto
)
{
return
"申请单号:"
+
dto
.
getApplyNo
()
+
"的业务办理"
;
return
"申请单号:"
+
dto
.
getApplyNo
()
+
"的业务办理"
;
...
@@ -283,89 +233,65 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -283,89 +233,65 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
public
JgChangeRegistrationNameDto
updateInfo
(
String
submitType
,
JgChangeRegistrationNameDto
jgChangeRegistrationNameDto
,
String
op
)
{
public
JgChangeRegistrationNameDto
updateInfo
(
String
submitType
,
JgChangeRegistrationNameDto
jgChangeRegistrationNameDto
,
String
op
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
Objects
.
isNull
(
jgChangeRegistrationNameDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
if
(
Objects
.
isNull
(
jgChangeRegistrationNameDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
}
String
[]
taskName
=
new
String
[]{
"流程结束"
};
// 字段转换
// 字段转换
this
.
convertField
(
jgChangeRegistrationNameDto
);
this
.
convertField
(
jgChangeRegistrationNameDto
);
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
List
<
String
>
roleListNext
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListSecond
=
new
ArrayList
<>();
List
<
String
>
roleListAll
=
new
ArrayList
<>();
JgChangeRegistrationName
jgChangeRegistrationName
=
this
.
getById
(
jgChangeRegistrationNameDto
.
getSequenceNbr
());
if
(
"1"
.
equals
(
submitType
))
{
if
(
"1"
.
equals
(
submitType
))
{
AjaxResult
ajaxResult
;
//发起流程
// 发起流程
if
(!
StringUtils
.
hasText
(
jgChangeRegistrationNameDto
.
getInstanceId
()))
{
if
(!
StringUtils
.
hasText
(
jgChangeRegistrationNameDto
.
getInstanceId
()))
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
"unitRename"
);
dto
.
setBusinessKey
(
"1"
);
try
{
try
{
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
List
<
ProcessTaskDTO
>
processTasks
=
new
ArrayList
<>();
String
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
"unitRename"
);
dto
.
setBusinessKey
(
jgChangeRegistrationNameDto
.
getApplyNo
());
dto
.
setCompleteFirstTask
(
true
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
processTasks
=
cmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
String
instanceId
=
processTasks
.
get
(
0
).
getProcessInstance
().
getId
();
String
nextTaskId
=
processTasks
.
get
(
0
).
getNextTask
().
get
(
0
).
getId
();
String
taskName
=
processTasks
.
get
(
0
).
getNextTask
().
get
(
0
).
getName
();
this
.
buildRoleList
(
processTasks
,
roleListNext
,
roleListAll
);
jgChangeRegistrationNameDto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListAll
));
jgChangeRegistrationNameDto
.
setInstanceId
(
instanceId
);
jgChangeRegistrationNameDto
.
setInstanceId
(
instanceId
);
// 查询下节点任务
jgChangeRegistrationNameDto
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListNext
));
getNext
(
roleListFirst
,
instanceId
,
taskName
);
jgChangeRegistrationNameDto
.
setNextTaskId
(
nextTaskId
);
jgChangeRegistrationNameDto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
// 创建待办
JgChangeRegistrationName
bean
=
new
JgChangeRegistrationName
();
BeanUtil
.
copyProperties
(
jgChangeRegistrationNameDto
,
bean
);
createTaskModel
(
bean
,
taskName
,
"1"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
log
.
error
(
"提交失败:{}"
,
e
);
throw
new
BadRequest
(
"提交失败"
+
e
.
getMessage
());
}
}
}
}
else
{
JgChangeRegistrationName
jgChangeRegistrationName
=
this
.
getById
(
jgChangeRegistrationNameDto
.
getSequenceNbr
());
// 执行一步
BeanUtils
.
copyProperties
(
jgChangeRegistrationNameDto
,
jgChangeRegistrationName
);
ProcessTaskDTO
processTaskDTO
=
submit
(
op
,
jgChangeRegistrationName
.
getNextTaskId
());
String
nextTaskId
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getId
();
boolean
submit
=
submit
(
jgChangeRegistrationName
,
op
);
String
taskName
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getName
();
//删除重新生成 eq表数据
this
.
buildRoleList
(
Collections
.
singletonList
(
processTaskDTO
),
roleListNext
,
roleListAll
);
if
(!
Objects
.
isNull
(
jgChangeRegistrationName
.
getSequenceNbr
()))
{
jgChangeRegistrationNameMapper
.
deleteByChangeRegistrationId
(
jgChangeRegistrationName
.
getSequenceNbr
());
}
if
(!
Objects
.
isNull
(
jgChangeRegistrationName
.
getApplyNo
()))
{
jgChangeRegistrationNameMapper
.
deleteHistoryInfoById
(
jgChangeRegistrationName
.
getApplyNo
());
}
List
<
Map
<
String
,
Object
>>
deviceList
=
jgChangeRegistrationNameMapper
.
getEquipInfoByOrgCode
(
reginParams
.
getCompany
().
getCompanyCode
());
List
<
JgRegistrationHistory
>
list
=
new
ArrayList
<>();
List
<
JgChangeRegistrationNameEq
>
equipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
obj
->
{
JgChangeRegistrationNameEq
jgRelationEquip
=
new
JgChangeRegistrationNameEq
();
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"equipId"
)));
jgRelationEquip
.
setNameChangeRegistrationId
(
String
.
valueOf
(
jgChangeRegistrationName
.
getSequenceNbr
()));
jgRelationEquip
.
setIsInvalid
(
"0"
);
jgRelationEquip
.
setCreateDate
(
jgChangeRegistrationName
.
getCreateDate
());
jgRelationEquip
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgRelationEquip
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
equipList
.
add
(
jgRelationEquip
);
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
jgRegistrationHistory
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgRegistrationHistory
.
setCreateDate
(
jgChangeRegistrationName
.
getCreateDate
());
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
jgChangeRegistrationName
));
jgRegistrationHistory
.
setOldData
(
JSON
.
toJSONString
(
jgChangeRegistrationName
));
jgRegistrationHistory
.
setRegistrationClass
(
"使用单位名称变更登记"
);
jgRegistrationHistory
.
setStatus
(
"new"
);
jgRegistrationHistory
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"equipId"
)));
jgRegistrationHistory
.
setSupervisoryCode
(
String
.
valueOf
(
obj
.
get
(
"supervisoryCode"
)));
jgRegistrationHistory
.
setUseRegistrationCode
(
String
.
valueOf
(
obj
.
get
(
"useOrgCode"
)));
jgRegistrationHistory
.
setCurrentDocumentId
(
jgChangeRegistrationName
.
getApplyNo
());
list
.
add
(
jgRegistrationHistory
);
});
jgChangeRegistrationNameEqService
.
saveBatch
(
equipList
);
jgRegistrationHistoryService
.
saveBatch
(
list
);
if
(
submit
)
{
// 查询下节点任务
// 查询下节点任务
getNext
(
roleListSecond
,
jgChangeRegistrationName
.
getInstanceId
(),
taskName
);
String
join
=
String
.
join
(
","
,
roleListSecond
);
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationName
.
getInstanceStatus
()))
{
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationName
.
getInstanceStatus
()))
{
jgChangeRegistrationName
.
setInstanceStatus
(
jgChangeRegistrationName
.
getInstanceStatus
()
+
","
+
join
);
jgChangeRegistrationName
.
setInstanceStatus
(
jgChangeRegistrationName
.
getInstanceStatus
()
+
","
+
String
.
join
(
""
,
roleListNext
)
);
}
else
{
}
else
{
jgChangeRegistrationName
.
setInstanceStatus
(
String
.
join
(
","
,
roleList
Second
));
jgChangeRegistrationName
.
setInstanceStatus
(
String
.
join
(
","
,
roleList
All
));
}
}
jgChangeRegistrationName
.
setPromoter
(
RequestContext
.
getExeUserId
());
jgChangeRegistrationName
.
setPromoter
(
RequestContext
.
getExeUserId
());
jgChangeRegistrationName
.
setNextExecutorIds
(
String
.
join
(
","
,
roleList
Second
));
jgChangeRegistrationName
.
setNextExecutorIds
(
String
.
join
(
","
,
roleList
Next
));
jgChangeRegistrationName
.
setAuditStatus
(
String
.
valueOf
(
WorkFlowStatusEnum
.
UNIT_RENAME_RECEIVE
.
getPass
()));
jgChangeRegistrationName
.
setAuditStatus
(
String
.
valueOf
(
WorkFlowStatusEnum
.
UNIT_RENAME_RECEIVE
.
getPass
()));
this
.
updateById
(
jgChangeRegistrationName
);
jgChangeRegistrationName
.
setNextTaskId
(
nextTaskId
);
executeOneStep
(
jgChangeRegistrationName
);
}
}
BeanUtils
.
copyProperties
(
jgChangeRegistrationNameDto
,
jgChangeRegistrationName
);
this
.
updateById
(
jgChangeRegistrationName
);
}
else
{
}
else
{
JgChangeRegistrationName
bean
=
new
JgChangeRegistrationName
();
JgChangeRegistrationName
bean
=
new
JgChangeRegistrationName
();
BeanUtils
.
copyProperties
(
jgChangeRegistrationNameDto
,
bean
);
BeanUtils
.
copyProperties
(
jgChangeRegistrationNameDto
,
bean
);
...
@@ -374,12 +300,16 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -374,12 +300,16 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
return
jgChangeRegistrationNameDto
;
return
jgChangeRegistrationNameDto
;
}
}
private
void
executeOneStep
(
JgChangeRegistrationName
jgChangeRegistrationName
)
{
// 先更新之前的待办
TaskV2Model
taskV2Model
=
updateTaskModel
(
jgChangeRegistrationName
);
// 再插入新代办、数据待定
taskV2Model
.
setExecuteUserIds
(
jgChangeRegistrationName
.
getNextExecutorIds
());
Systemctl
.
taskV2Client
.
create
(
taskV2Model
);
}
public
boolean
submit
(
JgChangeRegistrationName
notice
,
String
op
)
{
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
notice
.
getInstanceId
());
public
ProcessTaskDTO
submit
(
String
op
,
String
taskId
)
{
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskId
=
dataObject
.
getString
(
"id"
);
//组装信息
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setResultCode
(
"approvalStatus"
);
...
@@ -388,19 +318,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -388,19 +318,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
op
);
map
.
put
(
"approvalStatus"
,
op
);
dto
.
setVariable
(
map
);
dto
.
setVariable
(
map
);
//执行流程
return
cmWorkflowService
.
complete
(
taskId
,
dto
);
AjaxResult
ajaxResult1
=
null
;
try
{
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
if
(
ajaxResult1
.
get
(
"code"
).
equals
(
200
))
{
return
true
;
}
else
{
return
false
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
return
false
;
}
}
}
private
void
convertField
(
JgChangeRegistrationNameDto
model
)
{
private
void
convertField
(
JgChangeRegistrationNameDto
model
)
{
...
@@ -419,22 +337,6 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -419,22 +337,6 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
}
}
void
getNext
(
ArrayList
<
String
>
roleListFirst
,
String
instanceId
,
String
[]
taskName
)
{
AjaxResult
aj
=
Workflow
.
taskClient
.
getTaskNoAuth
(
instanceId
);
JSONObject
taskNoAuth
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
aj
.
get
(
"data"
)));
if
(!
ObjectUtils
.
isEmpty
(
taskNoAuth
))
{
String
nextTaskId
=
taskNoAuth
.
getString
(
"id"
);
AjaxResult
taskGroupName
=
Workflow
.
taskClient
.
getTaskGroupName
(
nextTaskId
);
taskName
[
0
]
=
taskNoAuth
.
getString
(
"name"
);
JSONArray
data
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
taskGroupName
.
get
(
"data"
)));
for
(
Object
datum
:
data
)
{
if
(((
Map
)
datum
).
containsKey
(
"groupId"
))
{
roleListFirst
.
add
(((
Map
)
datum
).
get
(
"groupId"
).
toString
());
}
}
}
}
public
void
deleteBatch
(
List
<
Long
>
ids
)
{
public
void
deleteBatch
(
List
<
Long
>
ids
)
{
JgChangeRegistrationName
jgChangeRegistrationName
=
new
JgChangeRegistrationName
();
JgChangeRegistrationName
jgChangeRegistrationName
=
new
JgChangeRegistrationName
();
jgChangeRegistrationName
.
setIsDelete
(
true
);
jgChangeRegistrationName
.
setIsDelete
(
true
);
...
@@ -445,49 +347,35 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -445,49 +347,35 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
public
void
revocation
(
String
instanceId
)
{
public
void
revocation
(
String
instanceId
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
// 执行流程
String
taskCode
=
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
String
taskCode
=
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
JgChangeRegistrationName
jgChangeRegistrationName
=
new
JgChangeRegistrationName
();
JgChangeRegistrationName
jgChangeRegistrationName
=
new
JgChangeRegistrationName
();
LambdaQueryWrapper
<
JgChangeRegistrationName
>
lambda
=
new
QueryWrapper
<
JgChangeRegistrationName
>().
lambda
();
LambdaQueryWrapper
<
JgChangeRegistrationName
>
lambda
=
new
QueryWrapper
<
JgChangeRegistrationName
>().
lambda
();
lambda
.
eq
(
JgChangeRegistrationName:
:
getInstanceId
,
instanceId
);
lambda
.
eq
(
JgChangeRegistrationName:
:
getInstanceId
,
instanceId
);
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
List
<
String
>
roleListNext
=
new
ArrayList
<>();
try
{
List
<
String
>
roleListAll
=
new
ArrayList
<>();
workFlowFeignService
.
rollBack
(
instanceId
);
ProcessTaskDTO
processTaskDTO
=
cmWorkflowService
.
rollBack
(
instanceId
);
JSONObject
taskNoAuth
=
workFlowFeignService
.
getTaskNoAuth
(
instanceId
);
String
nextTaskId
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getId
();
JSONObject
nextTask
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
taskNoAuth
.
get
(
"data"
)));
this
.
buildRoleList
(
Collections
.
singletonList
(
processTaskDTO
),
roleListNext
,
roleListAll
);
if
(!
ObjectUtils
.
isEmpty
(
taskNoAuth
.
get
(
"data"
)))
{
// 待调整
String
nextTaskId
=
nextTask
.
getString
(
"id"
);
taskCode
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getKey
();
FeignClientResult
<
JSONObject
>
nodeInfo
=
workFlowFeignService
.
getNodeInfo
(
nextTaskId
);
JSONObject
result
=
nodeInfo
.
getResult
();
Map
<
String
,
Object
>
taskInfo
=
(
Map
<
String
,
Object
>)
result
.
get
(
"taskInfo"
);
taskCode
=
String
.
valueOf
(
taskInfo
.
get
(
"taskDefinitionKey"
));
AjaxResult
taskGroupName
=
Workflow
.
taskClient
.
getTaskGroupName
(
nextTaskId
);
JSONArray
data
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
taskGroupName
.
get
(
"data"
)));
for
(
Object
datum
:
data
)
{
if
(((
Map
<?,
?>)
datum
).
containsKey
(
"groupId"
))
{
roleList
.
add
(((
Map
<?,
?>)
datum
).
get
(
"groupId"
).
toString
());
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(!
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
().
equals
(
taskCode
))
{
if
(!
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
().
equals
(
taskCode
))
{
jgChangeRegistrationName
.
setAuditStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getRollBack
());
jgChangeRegistrationName
.
setAuditStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getRollBack
());
}
}
String
join
=
String
.
join
(
","
,
roleList
);
jgChangeRegistrationName
.
setPromoter
(
RequestContext
.
getExeUserId
()
);
jgChangeRegistrationName
.
set
Promoter
(
reginParams
.
getUserModel
().
getUserId
(
));
jgChangeRegistrationName
.
set
NextExecutorIds
(
String
.
join
(
","
,
roleListNext
));
jgChangeRegistrationName
.
setNext
ExecutorIds
(
join
);
jgChangeRegistrationName
.
setNext
TaskId
(
nextTaskId
);
this
.
update
(
jgChangeRegistrationName
,
lambda
);
this
.
update
(
jgChangeRegistrationName
,
lambda
);
// 删除待办
commonService
.
deleteTaskModel
(
jgChangeRegistrationName
.
getInstanceId
());
commonService
.
rollbackTask
(
jgChangeRegistrationName
.
getInstanceId
());
}
}
public
void
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
)
{
public
void
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
)
{
try
{
try
{
JgChangeRegistrationName
jgChangeRegistrationName
=
this
.
getBaseMapper
().
selectById
(
id
);
JgChangeRegistrationName
jgChangeRegistrationName
=
this
.
getBaseMapper
().
selectById
(
id
);
JSONObject
task
=
workFlowFeignService
.
getTaskNoAuth
(
instanceId
);
String
taskId
=
jgChangeRegistrationName
.
getNextTaskId
();
JSONObject
taskMessage
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
task
.
get
(
"data"
)));
String
taskId
=
taskMessage
.
getString
(
"id"
);
//组装信息
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setResultCode
(
"approvalStatus"
);
...
@@ -496,57 +384,39 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -496,57 +384,39 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
operate
);
map
.
put
(
"approvalStatus"
,
operate
);
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationName
.
getInstanceStatus
())
&&
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationName
.
getInstanceStatus
())
&&
(
jgChangeRegistrationName
.
get
Instance
Status
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getReject
())
||
(
jgChangeRegistrationName
.
get
Audit
Status
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getReject
())
||
jgChangeRegistrationName
.
get
Instance
Status
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getRollBack
())))
{
jgChangeRegistrationName
.
get
Audit
Status
().
equals
(
WorkFlowStatusEnum
.
UNIT_RENAME_SUBMIT
.
getRollBack
())))
{
map
.
put
(
"approvalStatus"
,
"提交"
);
map
.
put
(
"approvalStatus"
,
"提交"
);
}
}
dto
.
setVariable
(
map
);
dto
.
setVariable
(
map
);
//执行流程
//执行流程
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
ProcessTaskDTO
processTaskDTO
=
cmWorkflowService
.
complete
(
taskId
,
dto
);
// 更新下一步执行人、创建待办
updateExecuteIds
(
instanceId
,
id
,
operate
,
processTaskDTO
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
// 更新下一步执行人
updateExecuteIds
(
instanceId
,
id
,
operate
);
}
}
public
void
updateExecuteIds
(
String
instanceId
,
Long
sequenceNbr
,
String
operate
)
{
public
void
updateExecuteIds
(
String
instanceId
,
Long
sequenceNbr
,
String
operate
,
ProcessTaskDTO
processTaskDTO
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
List
<
String
>
roleListNext
=
new
ArrayList
<>(
);
String
role
=
""
;
List
<
String
>
roleListAll
=
new
ArrayList
<>()
;
String
taskCode
=
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
String
taskCode
=
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
ArrayList
<
String
>
roleList
=
new
ArrayList
<>()
;
String
taskName
=
""
;
JgChangeRegistrationName
jgChangeRegistrationName
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
JgChangeRegistrationName
jgChangeRegistrationName
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
try
{
if
(
processTaskDTO
!=
null
){
// 查询下节点任务
taskCode
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getKey
();
JSONObject
taskNoAuth
=
workFlowFeignService
.
getTaskNoAuth
(
instanceId
);
taskName
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getName
();
if
(!
ObjectUtils
.
isEmpty
(
taskNoAuth
.
get
(
"data"
)))
{
JSONObject
nextTask
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
taskNoAuth
.
get
(
"data"
)));
String
nextTaskId
=
nextTask
.
getString
(
"id"
);
FeignClientResult
<
JSONObject
>
nodeInfo
=
workFlowFeignService
.
getNodeInfo
(
nextTaskId
);
JSONObject
result
=
nodeInfo
.
getResult
();
Map
<
String
,
Object
>
taskInfo
=
(
Map
<
String
,
Object
>)
result
.
get
(
"taskInfo"
);
taskCode
=
String
.
valueOf
(
taskInfo
.
get
(
"taskDefinitionKey"
));
AjaxResult
taskGroupName
=
Workflow
.
taskClient
.
getTaskGroupName
(
nextTaskId
);
JSONArray
data
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
taskGroupName
.
get
(
"data"
)));
for
(
Object
datum
:
data
)
{
if
(((
Map
)
datum
).
containsKey
(
"groupId"
))
{
roleList
.
add
(((
Map
)
datum
).
get
(
"groupId"
).
toString
());
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
if
(!
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
().
equals
(
taskCode
))
{
if
(!
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
().
equals
(
taskCode
))
{
role
=
String
.
join
(
","
,
roleList
);
this
.
buildRoleList
(
Collections
.
singletonList
(
processTaskDTO
),
roleListNext
,
roleListAll
);
jgChangeRegistrationName
.
setNextExecutorIds
(
role
);
jgChangeRegistrationName
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListNext
)
);
jgChangeRegistrationName
.
setPromoter
(
reginParams
.
getUserModel
().
get
UserId
());
jgChangeRegistrationName
.
setPromoter
(
RequestContext
.
getExe
UserId
());
jgChangeRegistrationName
.
setInstanceId
(
instanceId
);
jgChangeRegistrationName
.
setInstanceId
(
instanceId
);
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationName
.
getInstanceStatus
()))
{
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationName
.
getInstanceStatus
()))
{
jgChangeRegistrationName
.
setInstanceStatus
(
jgChangeRegistrationName
.
getInstanceStatus
()
+
","
+
role
);
jgChangeRegistrationName
.
setInstanceStatus
(
jgChangeRegistrationName
.
getInstanceStatus
()
+
","
+
String
.
join
(
","
,
roleListNext
)
);
}
else
{
}
else
{
jgChangeRegistrationName
.
setInstanceStatus
(
role
);
jgChangeRegistrationName
.
setInstanceStatus
(
String
.
join
(
","
,
roleListNext
)
);
}
}
if
(
"0"
.
equals
(
operate
))
{
if
(
"0"
.
equals
(
operate
))
{
// 通过操作
// 通过操作
...
@@ -556,16 +426,29 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
...
@@ -556,16 +426,29 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
jgChangeRegistrationName
.
setAuditStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getReject
());
jgChangeRegistrationName
.
setAuditStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getReject
());
jgChangeRegistrationName
.
setPromoter
(
null
);
jgChangeRegistrationName
.
setPromoter
(
null
);
}
}
// 更新上一步待办、创建待办
executeOneStep
(
jgChangeRegistrationName
);
}
else
{
}
else
{
jgChangeRegistrationName
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
jgChangeRegistrationName
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
jgChangeRegistrationName
.
setAuditPassDate
(
new
Date
());
jgChangeRegistrationName
.
setAuditPassDate
(
new
Date
());
// 修改业务信息
// 修改业务信息
updateInfoOther
(
jgChangeRegistrationName
);
updateInfoOther
(
jgChangeRegistrationName
);
updateTaskModel
(
jgChangeRegistrationName
);
}
}
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationName
);
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationName
);
}
private
TaskV2Model
updateTaskModel
(
JgChangeRegistrationName
jgChangeRegistrationName
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"relationId"
,
jgChangeRegistrationName
.
getInstanceId
());
params
.
put
(
"taskStatus"
,
this
.
getTaskStatusByName
(
jgChangeRegistrationName
.
getAuditStatus
()));
params
.
put
(
"taskStatusLabel"
,
jgChangeRegistrationName
.
getAuditStatus
());
return
commonService
.
updateTaskModel
(
params
);
}
}
private
Integer
getTaskStatusByName
(
String
auditStatus
)
{
return
commonService
.
getDictionaryCodeByName
(
auditStatus
);
}
public
void
updateInfoOther
(
JgChangeRegistrationName
jgChangeRegistrationName
)
{
public
void
updateInfoOther
(
JgChangeRegistrationName
jgChangeRegistrationName
)
{
LambdaQueryWrapper
<
JgChangeRegistrationNameEq
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
JgChangeRegistrationNameEq
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/json/urlInfo.json
View file @
e9a39c1e
...
@@ -87,13 +87,13 @@
...
@@ -87,13 +87,13 @@
"type"
:
"108"
,
"type"
:
"108"
,
"pageType"
:
"look"
,
"pageType"
:
"look"
,
"name"
:
"更名变更登记"
,
"name"
:
"更名变更登记"
,
"url"
:
""
"url"
:
"
/mixuap?appId=1742358052905971713&id=1739186702624256001&roleIds={roleIds}&userId={userId}&pageType=look
"
},
},
{
{
"type"
:
"108"
,
"type"
:
"108"
,
"pageType"
:
"edit"
,
"pageType"
:
"edit"
,
"name"
:
"更名变更登记"
,
"name"
:
"更名变更登记"
,
"url"
:
""
"url"
:
"
/mixuap?appId=1742358052905971713&id=1739186702624256001&roleIds={roleIds}&userId={userId}&pageType=edit
"
},
},
{
{
"type"
:
"109"
,
"type"
:
"109"
,
...
...
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