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
6e64a479
Commit
6e64a479
authored
Jan 04, 2024
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
安装告知代办业务
parent
155d6d2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
185 additions
and
25 deletions
+185
-25
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+172
-25
urlInfo.json
...s-boot-module-jg-biz/src/main/resources/json/urlInfo.json
+13
-0
No files found.
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/JgInstallationNoticeServiceImpl.java
View file @
6e64a479
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.aspose.words.SaveFormat
;
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.
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.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.ByteArrayMultipartFile
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq
;
...
@@ -24,52 +21,50 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
...
@@ -24,52 +21,50 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
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.IIdxBizJgConstructionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.boot.module.ymt.api.service.ITzBaseUnitLicenceService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
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.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
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.AjaxResult
;
import
com.yeejoin.amos.feign.workflow.model.AjaxResult
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
fr.opensagres.xdocreport.core.io.IOUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
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.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.
util.Assert
;
import
org.springframework.
transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
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
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
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
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.text.ParseException
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
parseArray
;
/**
/**
* 服务实现类
* 服务实现类
...
@@ -129,6 +124,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -129,6 +124,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
@Autowired
private
TzBaseUnitLicenceMapper
baseUnitLicenceMapper
;
private
TzBaseUnitLicenceMapper
baseUnitLicenceMapper
;
@Value
(
"classpath:/json/urlInfo.json"
)
private
Resource
bizTypeInfo
;
/**
/**
* 根据sequenceNbr查询
* 根据sequenceNbr查询
*
*
...
@@ -166,10 +165,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -166,10 +165,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
for
(
String
s:
fields
)
{
for
(
String
s:
fields
)
{
if
(
installationInfo
.
containsKey
(
s
))
{
if
(
installationInfo
.
containsKey
(
s
))
{
installationInfo
.
put
(
s
,
JSON
.
parseArray
(
installationInfo
.
get
(
s
).
toString
()));
installationInfo
.
put
(
s
,
parseArray
(
installationInfo
.
get
(
s
).
toString
()));
}
}
if
(
equipmentInfos
.
get
(
0
).
containsKey
(
s
))
{
if
(
equipmentInfos
.
get
(
0
).
containsKey
(
s
))
{
equipmentInfos
.
get
(
0
).
put
(
s
,
JSON
.
parseArray
(
equipmentInfos
.
get
(
0
).
get
(
s
).
toString
()));
equipmentInfos
.
get
(
0
).
put
(
s
,
parseArray
(
equipmentInfos
.
get
(
0
).
get
(
s
).
toString
()));
}
}
}
}
...
@@ -232,6 +231,35 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -232,6 +231,35 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
notice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
notice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
jgInstallationNoticeMapper
.
updateById
(
notice
);
jgInstallationNoticeMapper
.
updateById
(
notice
);
}
}
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"relationId"
,
notice
.
getInstanceId
());
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
map
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
updateTaskModel
(
map
);
TaskV2Model
taskV2Model
=
new
TaskV2Model
();
//获取待办任务执行人
List
<
AgencyUserModel
>
userList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
notice
.
getNextExecuteIds
(),
null
,
Boolean
.
FALSE
).
getResult
();
List
<
String
>
userIds
=
userList
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
taskV2Model
.
setExecuteUserIds
(
CollectionUtils
.
isEmpty
(
userIds
)?
""
:
String
.
join
(
","
,
userIds
));
taskV2Model
.
setExtras
(
JSON
.
toJSONString
(
notice
));
taskV2Model
.
setRelationId
(
notice
.
getInstanceId
());
Map
<
String
,
Object
>
userOrgRoleMap
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
userOrgRoleClient
.
getme
());
List
<
String
>
userOrgRoleList
=
(
List
<
String
>)
userOrgRoleMap
.
get
(
"roleId"
);
String
roleIds
=
String
.
join
(
","
,
userOrgRoleList
);
taskV2Model
.
setTaskType
(
"installNotice"
);
taskV2Model
.
setTaskTypeLabel
(
"安装告知"
);
String
url
=
getUrl
(
taskV2Model
.
getTaskType
(),
"look"
);
String
format
=
String
.
format
(
url
,
notice
.
getSequenceNbr
(),
roleIds
,
notice
.
getNextExecuteIds
(),
notice
.
getNoticeStatus
());
taskV2Model
.
setRoutePath
(
format
);
taskV2Model
.
setTaskTitle
(
notice
.
getStatus
());
taskV2Model
.
setTaskName
(
notice
.
getStatus
());
taskV2Model
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
taskV2Model
.
setTaskStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskV2Model
.
setTaskCode
(
notice
.
getApplyNo
());
buildTaskModel
(
taskV2Model
);
}
else
{
}
else
{
JgInstallationNotice
bean
=
new
JgInstallationNotice
();
JgInstallationNotice
bean
=
new
JgInstallationNotice
();
BeanUtils
.
copyProperties
(
noticeDto
,
bean
);
BeanUtils
.
copyProperties
(
noticeDto
,
bean
);
...
@@ -509,6 +537,33 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -509,6 +537,33 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
});
});
jgInstallationNoticeMapper
.
insertBatchSomeColumn
(
list
);
jgInstallationNoticeMapper
.
insertBatchSomeColumn
(
list
);
list
.
forEach
(
item
->
{
// 代办业务
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
TaskV2Model
taskV2Model
=
new
TaskV2Model
();
//获取待办任务执行人
List
<
AgencyUserModel
>
userList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
item
.
getNextExecuteIds
(),
null
,
Boolean
.
FALSE
).
getResult
();
List
<
String
>
userIds
=
userList
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
taskV2Model
.
setExecuteUserIds
(
CollectionUtils
.
isEmpty
(
userIds
)?
""
:
String
.
join
(
","
,
userIds
));
taskV2Model
.
setExtras
(
JSON
.
toJSONString
(
item
));
taskV2Model
.
setRelationId
(
item
.
getInstanceId
());
Map
<
String
,
Object
>
userOrgRoleMap
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
userOrgRoleClient
.
getme
());
List
<
String
>
userOrgRoleList
=
(
List
<
String
>)
userOrgRoleMap
.
get
(
"roleId"
);
String
roleIds
=
String
.
join
(
","
,
userOrgRoleList
);
taskV2Model
.
setTaskType
(
"installNotice"
);
taskV2Model
.
setTaskTypeLabel
(
"安装告知"
);
String
url
=
getUrl
(
taskV2Model
.
getTaskType
(),
"look"
);
String
format
=
String
.
format
(
url
,
item
.
getSequenceNbr
(),
roleIds
,
item
.
getNextExecuteIds
(),
item
.
getNoticeStatus
());
taskV2Model
.
setRoutePath
(
format
);
taskV2Model
.
setTaskTitle
(
item
.
getStatus
());
taskV2Model
.
setTaskName
(
item
.
getStatus
());
taskV2Model
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
taskV2Model
.
setTaskStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskV2Model
.
setTaskCode
(
item
.
getApplyNo
());
buildTaskModel
(
taskV2Model
);
}
});
List
<
JgInstallationNoticeEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
{
List
<
JgInstallationNoticeEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
{
List
<
JgInstallationNotice
>
collect
=
list
.
stream
().
filter
(
jgInstallationNotice
->
jgRelationEquip
.
getEquipTransferId
().
equals
(
jgInstallationNotice
.
getApplyNo
())).
collect
(
Collectors
.
toList
());
List
<
JgInstallationNotice
>
collect
=
list
.
stream
().
filter
(
jgInstallationNotice
->
jgRelationEquip
.
getEquipTransferId
().
equals
(
jgInstallationNotice
.
getApplyNo
())).
collect
(
Collectors
.
toList
());
...
@@ -527,7 +582,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -527,7 +582,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
String
nextTaskId
=
taskNoAuth
.
getString
(
"id"
);
String
nextTaskId
=
taskNoAuth
.
getString
(
"id"
);
AjaxResult
taskGroupName
=
Workflow
.
taskClient
.
getTaskGroupName
(
nextTaskId
);
AjaxResult
taskGroupName
=
Workflow
.
taskClient
.
getTaskGroupName
(
nextTaskId
);
taskName
[
0
]
=
taskNoAuth
.
getString
(
"name"
);
taskName
[
0
]
=
taskNoAuth
.
getString
(
"name"
);
JSONArray
data
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
taskGroupName
.
get
(
"data"
)));
JSONArray
data
=
parseArray
(
JSON
.
toJSONString
(
taskGroupName
.
get
(
"data"
)));
for
(
Object
datum
:
data
)
{
for
(
Object
datum
:
data
)
{
if
(((
Map
)
datum
).
containsKey
(
"groupId"
))
{
if
(((
Map
)
datum
).
containsKey
(
"groupId"
))
{
roleListFirst
.
add
(((
Map
)
datum
).
get
(
"groupId"
).
toString
());
roleListFirst
.
add
(((
Map
)
datum
).
get
(
"groupId"
).
toString
());
...
@@ -669,6 +724,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -669,6 +724,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
JgInstallationNotice
jgInstallationNotice
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
JgInstallationNotice
jgInstallationNotice
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
if
(
ajaxResult
.
getStatus
()
==
200
)
{
if
(
ajaxResult
.
getStatus
()
==
200
)
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"relationId"
,
noticeDto
.
getInstanceId
());
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
map
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
map
.
put
(
"isDelete"
,
Boolean
.
TRUE
);
updateTaskModel
(
map
);
getNext
(
roleList
,
noticeDto
.
getInstanceId
(),
taskName
);
getNext
(
roleList
,
noticeDto
.
getInstanceId
(),
taskName
);
jgInstallationNotice
.
setStatus
(
taskName
[
0
]);
jgInstallationNotice
.
setStatus
(
taskName
[
0
]);
jgInstallationNotice
.
setPromoter
(
""
);
jgInstallationNotice
.
setPromoter
(
""
);
...
@@ -802,12 +865,95 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -802,12 +865,95 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
jgInstallationNotice
.
setPromoter
(
userId
);
jgInstallationNotice
.
setPromoter
(
userId
);
jgInstallationNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
jgInstallationNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
}
}
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"relationId"
,
jgInstallationNotice
.
getInstanceId
());
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
map
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
updateTaskModel
(
map
);
}
else
{
}
else
{
jgInstallationNotice
.
setPromoter
(
""
);
jgInstallationNotice
.
setPromoter
(
""
);
jgInstallationNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
REJECTED
.
getCode
()));
jgInstallationNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
REJECTED
.
getCode
()));
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"relationId"
,
jgInstallationNotice
.
getInstanceId
());
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
REJECTED
.
getCode
());
map
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
REJECTED
.
getName
());
updateTaskModel
(
map
);
TaskV2Model
taskV2Model
=
new
TaskV2Model
();
//获取待办任务执行人
List
<
AgencyUserModel
>
userList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
jgInstallationNotice
.
getNextExecuteIds
(),
null
,
Boolean
.
FALSE
).
getResult
();
List
<
String
>
userIds
=
userList
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
taskV2Model
.
setExecuteUserIds
(
CollectionUtils
.
isEmpty
(
userIds
)?
""
:
String
.
join
(
","
,
userIds
));
taskV2Model
.
setExtras
(
JSON
.
toJSONString
(
jgInstallationNotice
));
taskV2Model
.
setRelationId
(
jgInstallationNotice
.
getInstanceId
());
Map
<
String
,
Object
>
userOrgRoleMap
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
userOrgRoleClient
.
getme
());
List
<
String
>
userOrgRoleList
=
(
List
<
String
>)
userOrgRoleMap
.
get
(
"roleId"
);
String
roleIds
=
String
.
join
(
","
,
userOrgRoleList
);
taskV2Model
.
setTaskType
(
"installNotice"
);
taskV2Model
.
setTaskTypeLabel
(
"安装告知"
);
String
url
=
getUrl
(
taskV2Model
.
getTaskType
(),
"edit"
);
String
format
=
String
.
format
(
url
,
jgInstallationNotice
.
getSequenceNbr
(),
roleIds
,
jgInstallationNotice
.
getNextExecuteIds
(),
jgInstallationNotice
.
getNoticeStatus
(),
jgInstallationNotice
.
getPromoter
(),
""
);
taskV2Model
.
setRoutePath
(
format
);
taskV2Model
.
setTaskTitle
(
jgInstallationNotice
.
getStatus
());
taskV2Model
.
setTaskName
(
jgInstallationNotice
.
getStatus
());
taskV2Model
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
taskV2Model
.
setTaskStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskV2Model
.
setTaskCode
(
jgInstallationNotice
.
getApplyNo
());
buildTaskModel
(
taskV2Model
);
}
}
jgInstallationNoticeMapper
.
updateById
(
jgInstallationNotice
);
jgInstallationNoticeMapper
.
updateById
(
jgInstallationNotice
);
}
}
}
}
public
void
buildTaskModel
(
TaskV2Model
model
){
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
model
.
setStartDate
(
new
Date
());
model
.
setStartUserId
(
reginParams
.
getUserModel
().
getUserId
());
model
.
setTaskSource
(
"workFlow"
);
model
.
setCreateDate
(
new
Date
());
model
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
model
.
setAgencyCode
(
reginParams
.
getUserModel
().
getAgencyCode
());
model
.
setTaskTitle
(
reginParams
.
getUserModel
().
getRealName
()
+
"发起了"
+
model
.
getTaskTitle
());
Systemctl
.
taskV2Client
.
create
(
model
);
}
public
void
updateTaskModel
(
Map
<
String
,
Object
>
params
){
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
params
.
get
(
"relationId"
).
toString
()).
getResult
();
TaskV2Model
model
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getCreateDate
().
compareTo
(
r1
.
getCreateDate
()))
// 按时间降序排序
.
findFirst
()
.
orElse
(
null
);
model
.
setTaskStatus
(
Integer
.
valueOf
(
params
.
get
(
"taskStatus"
).
toString
()));
model
.
setTaskStatusLabel
(
params
.
get
(
"taskStatusLabel"
).
toString
());
model
.
setEndDate
(
new
Date
());
model
.
setEndUserId
(
reginParams
.
getUserModel
().
getUserId
());
if
(
params
.
containsKey
(
"isDelete"
))
{
Systemctl
.
taskV2Client
.
delete
(
model
.
getSequenceNbr
().
toString
());
}
else
{
Systemctl
.
taskV2Client
.
update
(
model
,
model
.
getSequenceNbr
());
}
}
private
String
getUrl
(
String
type
,
String
pageType
)
{
String
json
=
null
;
try
{
json
=
IOUtils
.
toString
(
bizTypeInfo
.
getInputStream
(),
java
.
lang
.
String
.
valueOf
(
StandardCharsets
.
UTF_8
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
List
<
Map
>
list
=
parseArray
(
json
,
Map
.
class
);
String
url
=
null
;
for
(
Map
map
:
list
)
{
if
(
map
.
get
(
"type"
).
equals
(
type
)&&
pageType
.
equals
(
map
.
get
(
"pageType"
))){
url
=
map
.
get
(
"url"
).
toString
();
break
;
}
}
return
url
;
}
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/json/urlInfo.json
0 → 100644
View file @
6e64a479
[
{
"type"
:
"installNotice"
,
"pageType"
:
"look"
,
"url"
:
"/mixuap?appId=1742358052905971713&id=1735246137364869121&sequenceNbr=%s&roleIds=%s&nextExecuteIds=%s&formType=detail¬iceStatus=%s"
},
{
"type"
:
"installNotice"
,
"pageType"
:
"edit"
,
"url"
:
"/mixuap?appId=1742358052905971713&id=1734127099570057217&sequenceNbr=%s&roleIds=%s&nextExecuteIds=%s&formType=edit¬iceStatus=%s&promoter=%s&userId=%s"
}
]
\ No newline at end of file
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