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
374be0e2
Commit
374be0e2
authored
Jan 04, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加待办功能
parent
d4d0f8f0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
179 additions
and
3 deletions
+179
-3
BizTypeEnum.java
.../yeejoin/amos/boot/module/jyjc/api/enums/BizTypeEnum.java
+10
-0
CommonserviceImpl.java
.../boot/module/jyjc/biz/service/impl/CommonserviceImpl.java
+72
-0
JyjcInspectionApplicationServiceImpl.java
...iz/service/impl/JyjcInspectionApplicationServiceImpl.java
+69
-3
bizTypeInfo.json
...-module-jyjc-biz/src/main/resources/json/bizTypeInfo.json
+28
-0
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/enums/BizTypeEnum.java
View file @
374be0e2
...
...
@@ -33,4 +33,14 @@ public enum BizTypeEnum {
}
return
codeList
;
}
public
static
String
getNameByCode
(
String
code
)
{
for
(
BizTypeEnum
c
:
BizTypeEnum
.
values
())
{
if
(
c
.
getCode
().
equals
(
code
)){
return
c
.
getName
();
}
}
return
null
;
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/CommonserviceImpl.java
View file @
374be0e2
...
...
@@ -3,19 +3,30 @@ package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
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.RedisUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper
;
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.model.TaskV2Model
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -27,6 +38,8 @@ public class CommonserviceImpl {
RedisUtils
redisUtils
;
@Autowired
TzsUserInfoMapper
userInfoMapper
;
@Autowired
private
WorkflowHelper
workflowHelper
;
@Autowired
TzBaseEnterpriseInfoMapper
enterpriseInfoMapper
;
...
...
@@ -68,4 +81,63 @@ public class CommonserviceImpl {
public
TzBaseEnterpriseInfo
getInspectionUnitBySequenceNbr
(
Long
sequenceNbr
)
{
return
enterpriseInfoMapper
.
selectBySeq
(
sequenceNbr
);
}
public
void
buildTaskModel
(
Map
<
String
,
Object
>
params
){
TaskV2Model
model
=
new
TaskV2Model
();
//获取待办任务执行人
Map
<
String
,
Object
>
nextNodeInfo
=
workflowHelper
.
getNextWorkflowNode
(
params
.
get
(
"instanceId"
).
toString
());
String
role
=
(
String
)
nextNodeInfo
.
get
(
"role"
);
model
.
setExecuteUserIds
(
role
);
List
<
AgencyUserModel
>
userList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
role
,
null
,
false
).
getResult
();
List
<
String
>
userIds
=
userList
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
model
.
setExecuteUserIds
(
CollectionUtils
.
isEmpty
(
userIds
)?
""
:
String
.
join
(
","
,
userIds
));
model
.
setExtras
(
params
.
getOrDefault
(
"extras"
,
""
).
toString
());
model
.
setRelationId
(
params
.
getOrDefault
(
"instanceId"
,
""
).
toString
());
model
.
setRoutePath
(
params
.
getOrDefault
(
"routePath"
,
""
).
toString
());
model
.
setStartDate
((
Date
)
params
.
getOrDefault
(
"startDate"
,
""
));
model
.
setStartUserId
(
params
.
getOrDefault
(
"startUser"
,
""
).
toString
());
model
.
setTaskContent
(
params
.
getOrDefault
(
"taskContent"
,
""
).
toString
());
model
.
setTaskType
(
params
.
getOrDefault
(
"taskType"
,
""
).
toString
());
model
.
setTaskTypeLabel
(
params
.
getOrDefault
(
"taskTypeLabel"
,
""
).
toString
());
model
.
setTaskTitle
(
params
.
getOrDefault
(
"taskTitle"
,
""
).
toString
());
model
.
setTaskName
(
params
.
getOrDefault
(
"taskName"
,
""
).
toString
());
model
.
setTaskStatus
(
Integer
.
valueOf
(
params
.
getOrDefault
(
"taskStatus"
,
0
).
toString
()));
model
.
setTaskStatusLabel
(
params
.
getOrDefault
(
"taskStatusLabel"
,
""
).
toString
());
model
.
setTaskSource
(
params
.
getOrDefault
(
"taskSource"
,
"workFlow"
).
toString
());
// model.setTerminal(params.getOrDefault("terminal","WEB").toString());
model
.
setCreateDate
(
new
Date
());
model
.
setTaskCode
(
params
.
get
(
"taskCode"
).
toString
());
model
.
setRecUserId
(
params
.
get
(
"userId"
).
toString
());
model
.
setAgencyCode
(
params
.
get
(
"agencyCode"
).
toString
());
Systemctl
.
taskV2Client
.
create
(
model
);
}
public
TaskV2Model
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
.
setEndUserId
(
reginParams
.
getUserModel
().
getUserId
());
model
.
setEndDate
(
new
Date
());
Systemctl
.
taskV2Client
.
update
(
model
,
model
.
getSequenceNbr
());
//修改model并返回 用于组装新待办
model
.
setEndUserId
(
null
);
model
.
setTaskStatus
(
null
);
model
.
setEndDate
(
null
);
model
.
setSequenceNbr
(
null
);
model
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
model
.
setCreateDate
(
new
Date
());
model
.
setTaskStatus
(
FlowStatusEnum
.
REJECTED
.
getCode
());
model
.
setTaskStatusLabel
(
FlowStatusEnum
.
REJECTED
.
getName
());
model
.
setStartDate
(
new
Date
());
return
model
;
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionApplicationServiceImpl.java
View file @
374be0e2
...
...
@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.*
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.DocumentEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.ResultStatusEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationEquipMapper
;
...
...
@@ -29,14 +30,20 @@ import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler.JyjcInspection
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
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.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
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
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -46,10 +53,13 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
parseArray
;
import
static
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
service
.
impl
.
WorkflowExcuteServiceImpl
.
buildOrderNo
;
/**
...
...
@@ -85,6 +95,10 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
JyjcOpeningApplicationServiceImpl
jyjcOpeningApplicationService
;
@Autowired
WorkflowFeignService
workflowFeignService
;
@Autowired
CommonserviceImpl
commonservice
;
@Value
(
"classpath:/json/bizTypeInfo.json"
)
private
Resource
bizTypeInfo
;
@Autowired
private
JyjcInspectionApplicationEquipMapper
jyjcInspectionApplicationEquipMapper
;
...
...
@@ -104,6 +118,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
}
if
(!
model
.
getOperationType
().
equals
(
"2"
))
{
String
taskName
=
""
;
if
(
model
.
getOperationType
().
equals
(
"0"
))
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
...
...
@@ -121,16 +136,18 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
// region 获取下一个流程节点的数据
Map
<
String
,
Object
>
nextNodeInfo
=
workflowHelper
.
getNextWorkflowNode
(
model
.
getProcessInstanceId
());
String
role
=
(
String
)
nextNodeInfo
.
get
(
"role"
);
taskName
=
(
String
)
nextNodeInfo
.
get
(
"taskName"
);
model
.
setNextExecuteIds
(
role
);
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
model
.
getWorkflowRole
()))
{
model
.
setWorkflowRole
(
model
.
getWorkflowRole
()
+
","
+
role
);
}
else
{
model
.
setWorkflowRole
(
role
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
model
.
setStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_SUBMITTED
.
getCode
()));
//6611 对应数据字典 检验流程状态 待受理
}
else
if
(
model
.
getOperationType
().
equals
(
"1"
))
{
model
.
setStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
()));
...
...
@@ -176,8 +193,32 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
}
else
{
model
=
this
.
updateWithModel
(
model
);
}
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
(
model
.
getBizType
()
)&&
"look"
.
equals
(
map
.
get
(
"pageType"
))){
url
=
map
.
get
(
"url"
).
toString
();
}
}
Map
<
String
,
Object
>
userOrgRoleMap
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
userOrgRoleClient
.
getme
());
List
<
String
>
userOrgRoleList
=
(
List
<
String
>)
userOrgRoleMap
.
get
(
"roleId"
);
String
roleIds
=
String
.
join
(
","
,
userOrgRoleList
);
if
(
StringUtils
.
isNotBlank
(
model
.
getProcessInstanceId
())){
commonservice
.
buildTaskModel
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"instanceId"
,
model
.
getProcessInstanceId
()).
put
(
"startDate"
,
new
Date
())
.
put
(
"agencyCode"
,
reginParams
.
getUserModel
().
getAgencyCode
()).
put
(
"userId"
,
reginParams
.
getUserModel
().
getUserId
()).
put
(
"startUser"
,
reginParams
.
getUserModel
().
getUserId
()).
put
(
"startUserId"
,
reginParams
.
getUserModel
().
getUserId
())
.
put
(
"taskStatus"
,
FlowStatusEnum
.
REJECTED
.
getCode
()).
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
REJECTED
.
getName
()).
put
(
"taskName"
,
taskName
).
put
(
"taskType"
,
model
.
getBizType
()).
put
(
"taskTypeLabel"
,
BizTypeEnum
.
getNameByCode
(
model
.
getBizType
())).
put
(
"taskContent"
,
""
)
.
put
(
"taskTitle"
,
reginParams
.
getUserModel
().
getUserName
()+
"发起了"
+
taskName
).
put
(
"taskDesc"
,
""
).
put
(
"taskCode"
,
model
.
getApplicationNo
())
.
put
(
"extras"
,
JSON
.
toJSONString
(
model
)).
put
(
"createUserId"
,
reginParams
.
getUserModel
().
getUserName
()).
put
(
"startUserId"
,
reginParams
.
getUserModel
().
getUserId
())
.
put
(
"routePath"
,
url
.
replace
(
"{sequenceNbr}"
,
String
.
valueOf
(
model
.
getSequenceNbr
())).
replace
(
"{userId}"
,
reginParams
.
getUserModel
().
getUserId
()).
replace
(
"{roleIds}"
,
roleIds
))
.
build
());
}
//保存报检装备监管码
for
(
JyjcInspectionApplicationEquip
equipInfo
:
equipInfos
)
{
...
...
@@ -414,9 +455,34 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
*/
public
Boolean
doReject
(
Map
<
String
,
Object
>
params
)
{
execueFlow
(
params
);
String
instanceId
=
Optional
.
ofNullable
(
params
.
get
(
"instanceId"
)).
orElse
(
""
).
toString
();
String
op
=
params
.
get
(
"op"
).
toString
();
Long
sequenceNbr
=
Long
.
parseLong
(
params
.
get
(
"sequenceNbr"
)
+
""
);
String
instanceId
=
Optional
.
ofNullable
(
params
.
get
(
"instanceId"
)).
orElse
(
""
).
toString
();
params
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
params
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
TaskV2Model
taskV2Model
=
commonservice
.
updateTaskModel
(
params
);
JyjcInspectionApplicationModel
model
=
this
.
queryBySeq
(
sequenceNbr
);
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
(
model
.
getBizType
()
)&&
"edit"
.
equals
(
map
.
get
(
"pageType"
))){
url
=
map
.
get
(
"url"
).
toString
();
}
}
taskV2Model
.
setRoutePath
(
url
);
Map
<
String
,
Object
>
nextNodeInfo
=
workflowHelper
.
getNextWorkflowNode
(
instanceId
);
String
role
=
(
String
)
nextNodeInfo
.
get
(
"role"
);
taskV2Model
.
setExecuteUserIds
(
role
);
commonservice
.
buildTaskModel
(
BeanUtil
.
beanToMap
(
taskV2Model
));
params
.
put
(
"status"
,
FlowStatusEnum
.
REJECTED
.
getCode
()
+
""
);
Boolean
rollBack
=
"1"
.
equals
(
op
)
?
true
:
false
;
updateModelByInstanceId
(
sequenceNbr
,
instanceId
,
params
,
rollBack
);
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/resources/json/bizTypeInfo.json
0 → 100644
View file @
374be0e2
[
{
"type"
:
"supervise"
,
"pageType"
:
"look"
,
"url"
:
"/mixuap?appId=1742358052905971713&id=1735205097765367809&sequenceNbr={sequenceNbr}&roleIds={roleIds}&userId=userId={userId}&pageType=look"
},
{
"type"
:
"firstinspect"
,
"pageType"
:
"look"
,
"url"
:
"/mixuap?appId=1742358052905971713&id=1736588187213524994&sequenceNbr={sequenceNbr}&roleIds={roleIds}&userId=userId={userId}&pageType=look"
},
{
"type"
:
"detection"
,
"pageType"
:
"look"
,
"url"
:
"/mixuap?appId=1742358052905971713&id=1736642376224501762&sequenceNbr={sequenceNbr}&roleIds={roleIds}&userId=userId={userId}&pageType=look"
},
{
"type"
:
"supervise"
,
"pageType"
:
"edit"
,
"url"
:
"/mixuap?appId=1742358052905971713&id=1736642376224501762&sequenceNbr={sequenceNbr}&roleIds={roleIds}&userId=userId={userId}&pageType=edit"
},
{
"type"
:
"firstinspect"
,
"pageType"
:
"edit"
,
"url"
:
"/mixuap?appId=1742358052905971713&id=1736728282272919554&sequenceNbr={sequenceNbr}&roleIds={roleIds}&userId=userId={userId}&pageType=edit"
},
{
"type"
:
"detection"
,
"pageType"
:
"edit"
,
"url"
:
"/mixuap?appId=1742358052905971713&id=1736733779709423618&sequenceNbr={sequenceNbr}&roleIds={roleIds}&userId=userId={userId}&pageType=edit"
}
]
\ 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