Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-hmhj
Overview
Overview
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
wangweidong
patzn-cloud-service-hmhj
Commits
53edf4f5
Commit
53edf4f5
authored
Aug 11, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通知消息发送调整;
parent
04371dfb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
38 deletions
+69
-38
IEntrustSampleItemService.java
.../service/lims/hmhj/service/IEntrustSampleItemService.java
+2
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+6
-0
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+44
-25
UserInfoServiceImpl.java
...d/service/lims/hmhj/service/impl/UserInfoServiceImpl.java
+17
-13
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleItemService.java
View file @
53edf4f5
...
@@ -108,6 +108,8 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
...
@@ -108,6 +108,8 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
List
<
EntrustSampleItem
>
getListByEntrustId
(
Long
entrustId
);
List
<
EntrustSampleItem
>
getListByEntrustId
(
Long
entrustId
);
List
<
Long
>
getTesterIdListByEntrustId
(
Long
entrustId
);
boolean
revokeRemovedItem
(
Long
[]
ids
);
boolean
revokeRemovedItem
(
Long
[]
ids
);
Page
<
EntrustSampleItemVO
>
getItemFillProgressQuery
(
Page
<
EntrustSampleItemVO
>
page
,
EntrustSampleItemVO
itemVO
);
Page
<
EntrustSampleItemVO
>
getItemFillProgressQuery
(
Page
<
EntrustSampleItemVO
>
page
,
EntrustSampleItemVO
itemVO
);
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
53edf4f5
...
@@ -1327,6 +1327,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1327,6 +1327,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
}
@Override
@Override
public
List
<
Long
>
getTesterIdListByEntrustId
(
Long
entrustId
)
{
List
<
EntrustSampleItem
>
sampleItems
=
getListByEntrustId
(
entrustId
);
return
CollectionUtils
.
isEmpty
(
sampleItems
)
?
null
:
sampleItems
.
stream
().
map
(
EntrustSampleItem:
:
getTesterId
).
collect
(
Collectors
.
toList
());
}
@Override
public
boolean
revokeRemovedItem
(
Long
[]
ids
)
{
public
boolean
revokeRemovedItem
(
Long
[]
ids
)
{
if
(
null
==
ids
)
{
if
(
null
==
ids
)
{
throw
new
PatznException
(
"检测项目编号为空"
);
throw
new
PatznException
(
"检测项目编号为空"
);
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
53edf4f5
...
@@ -391,7 +391,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -391,7 +391,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
CHECK
.
getName
());
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
CHECK
.
getName
());
if
(
update
(
entrust
,
Condition
.
create
().
in
(
"id"
,
ids
)))
{
if
(
update
(
entrust
,
Condition
.
create
().
in
(
"id"
,
ids
)))
{
entrustRecordService
.
record
(
ids
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
0
,
account
,
"提交至委托审核"
);
entrustRecordService
.
record
(
ids
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
0
,
account
,
"提交至委托审核"
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_review"
,
"有委托从委托登记提交过来,请及时审核"
,
"新的委托审核任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_review"
,
"有委托从委托登记提交过来,请及时审核"
,
"新的委托审核任务!"
,
account
,
null
);
}
}
return
true
;
return
true
;
}
}
...
@@ -408,7 +408,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -408,7 +408,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrust
.
setProgress
(
EntrustStatusEnum
.
OUT_INPUT
);
entrust
.
setProgress
(
EntrustStatusEnum
.
OUT_INPUT
);
if
(
update
(
entrust
,
Condition
.
create
().
in
(
"id"
,
ids
)))
{
if
(
update
(
entrust
,
Condition
.
create
().
in
(
"id"
,
ids
)))
{
entrustRecordService
.
record
(
ids
,
EntrustStatusEnum
.
OUT_DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
OUT_INPUT
.
getDisplay
(),
0
,
account
,
"提交至外委数据录入"
);
entrustRecordService
.
record
(
ids
,
EntrustStatusEnum
.
OUT_DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
OUT_INPUT
.
getDisplay
(),
0
,
account
,
"提交至外委数据录入"
);
lmsMsgService
.
sendMsg
(
"/hmhj/accept_manage/sub_input"
,
"有外委登记提交过来,请及时填写外委数据"
,
"新的委托外委数据录入任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
lmsMsgService
.
sendMsg
(
"/hmhj/accept_manage/sub_input"
,
"有外委登记提交过来,请及时填写外委数据"
,
"新的委托外委数据录入任务!"
,
account
,
null
);
}
}
return
true
;
return
true
;
}
}
...
@@ -422,6 +422,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -422,6 +422,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择退回委托审核的委托"
);
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择退回委托审核的委托"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
boolean
hasSendMessage
=
false
;
boolean
hasSendMessage
=
false
;
List
<
Long
>
userIds
=
new
ArrayList
<>();
for
(
Entrust
e
:
entrustList
)
{
for
(
Entrust
e
:
entrustList
)
{
if
(
isCanIntoNextNode
(
e
))
{
if
(
isCanIntoNextNode
(
e
))
{
rejectToPrevNode
(
e
,
reason
,
account
);
rejectToPrevNode
(
e
,
reason
,
account
);
...
@@ -432,10 +433,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -432,10 +433,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
e
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
());
e
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
());
updateById
(
e
);
updateById
(
e
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
1
,
account
,
reason
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
1
,
account
,
reason
);
userIds
.
add
(
e
.
getUid
());
}
}
}
}
if
(!
hasSendMessage
)
{
if
(!
hasSendMessage
)
{
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从委托审核驳回,请及时查看退回原因并处理"
,
"新的委托审核退回任务!"
,
account
,
userI
nfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从委托审核驳回,请及时查看退回原因并处理"
,
"新的委托审核退回任务!"
,
account
,
userI
ds
);
}
}
return
true
;
return
true
;
...
@@ -448,6 +450,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -448,6 +450,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择委托审核的委托"
);
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择委托审核的委托"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
boolean
hasSendMessage
=
false
;
boolean
hasSendMessage
=
false
;
List
<
Long
>
userIds
=
new
ArrayList
<>();
for
(
Entrust
e
:
entrustList
)
{
for
(
Entrust
e
:
entrustList
)
{
// 若存在路径,根据状态路径处理数据
// 若存在路径,根据状态路径处理数据
if
(
isCanIntoNextNode
(
e
))
{
if
(
isCanIntoNextNode
(
e
))
{
...
@@ -460,10 +463,15 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -460,10 +463,15 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
updateById
(
e
);
updateById
(
e
);
entrustSampleService
.
updateSampleCodeByEntrustId
(
e
.
getId
(),
2
);
entrustSampleService
.
updateSampleCodeByEntrustId
(
e
.
getId
(),
2
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
0
,
account
,
"提交至样品待制备"
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
0
,
account
,
"提交至样品待制备"
);
List
<
Long
>
uidList
=
userInfoService
.
getUserIdsByGroupName
(
e
.
getTestSide
());
if
(
CollectionUtils
.
isNotEmpty
(
uidList
))
{
userIds
.
addAll
(
uidList
);
}
}
}
}
if
(!
hasSendMessage
)
{
}
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托审核通过,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
));
userIds
=
userIds
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
if
(!
hasSendMessage
&&
CollectionUtils
.
isNotEmpty
(
userIds
))
{
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托审核通过,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
userIds
);
}
}
return
true
;
return
true
;
}
}
...
@@ -475,6 +483,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -475,6 +483,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择委托登记的委托"
);
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择委托登记的委托"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
boolean
hasSendMessage
=
false
;
boolean
hasSendMessage
=
false
;
List
<
Long
>
userIds
=
new
ArrayList
<>();
for
(
Entrust
e
:
entrustList
)
{
for
(
Entrust
e
:
entrustList
)
{
// 若存在路径,根据状态路径处理数据
// 若存在路径,根据状态路径处理数据
if
(
isCanIntoNextNode
(
e
))
{
if
(
isCanIntoNextNode
(
e
))
{
...
@@ -488,11 +497,16 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -488,11 +497,16 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
0
,
account
,
"委托登记提交至样品待制备"
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
0
,
account
,
"委托登记提交至样品待制备"
);
// 此处需要批量更新样品编码,根据级别更新
// 此处需要批量更新样品编码,根据级别更新
entrustSampleService
.
updateSampleCodeByEntrustId
(
e
.
getId
(),
1
);
entrustSampleService
.
updateSampleCodeByEntrustId
(
e
.
getId
(),
1
);
List
<
Long
>
uidList
=
userInfoService
.
getUserIdsByGroupName
(
e
.
getTestSide
());
if
(
CollectionUtils
.
isNotEmpty
(
uidList
))
{
userIds
.
addAll
(
uidList
);
}
}
}
}
}
if
(!
hasSendMessage
)
{
userIds
=
userIds
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托登记提交至样品待制备,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
));
if
(!
hasSendMessage
&&
CollectionUtils
.
isNotEmpty
(
userIds
))
{
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托登记提交至样品待制备,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
userIds
);
}
}
return
true
;
return
true
;
...
@@ -903,12 +917,15 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -903,12 +917,15 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
boolean
isUpdateSampleInfo
=
nextFlowValue
<
9
||
nextFlowValue
>
12
;
boolean
isUpdateSampleInfo
=
nextFlowValue
<
9
||
nextFlowValue
>
12
;
// 若为特殊需求,必须要走评审
// 若为特殊需求,必须要走评审
String
uri
=
""
;
String
uri
=
""
;
List
<
Long
>
sendUidList
=
new
ArrayList
<>();
if
(
isSpecAsk
||
nextStatus
==
EntrustStatusEnum
.
CHECK
)
{
if
(
isSpecAsk
||
nextStatus
==
EntrustStatusEnum
.
CHECK
)
{
uri
=
"/hmhj/entrust_manage/entrust_review"
;
uri
=
"/hmhj/entrust_manage/entrust_review"
;
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
MAKE
)
{
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
MAKE
)
{
uri
=
"/hmhj/sample_manage/sample_prepare"
;
uri
=
"/hmhj/sample_manage/sample_prepare"
;
sendUidList
=
userInfoService
.
getUserIdsByGroupName
(
entrust
.
getTestSide
());
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
TEST
)
{
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
TEST
)
{
uri
=
"/hmhj/accept_manage/input"
;
uri
=
"/hmhj/accept_manage/input"
;
sendUidList
=
entrustSampleItemService
.
getTesterIdListByEntrustId
(
entrust
.
getId
());
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
OUT_INPUT
)
{
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
OUT_INPUT
)
{
uri
=
"/hmhj/accept_manage/sub_input"
;
uri
=
"/hmhj/accept_manage/sub_input"
;
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
QUALITY_CHECK
)
{
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
QUALITY_CHECK
)
{
...
@@ -924,23 +941,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -924,23 +941,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrust
.
setProgress
(
nextStatus
);
entrust
.
setProgress
(
nextStatus
);
entrust
.
setFlowStatus
(
nextFlowStatus
.
getName
());
entrust
.
setFlowStatus
(
nextFlowStatus
.
getName
());
updateById
(
entrust
);
updateById
(
entrust
);
//
String
remark
=
"提交至"
+
nextFlowStatus
.
getDisplay
(),
String
remark
=
"提交至"
+
nextFlowStatus
.
getDisplay
(),
title
=
String
.
format
(
"新的%s任务!"
,
nextFlowStatus
.
getDisplay
()),
title
=
String
.
format
(
"新的%s任务!"
,
nextFlowStatus
.
getDisplay
()),
content
=
String
.
format
(
"有%s提交过来,请及时%s"
,
EntrustFlowEnum
.
convert
(
flowStatus
).
getDisplay
(),
nextFlowStatus
.
getDisplay
());
content
=
String
.
format
(
"有%s提交过来,请及时%s"
,
EntrustFlowEnum
.
convert
(
flowStatus
).
getDisplay
(),
nextFlowStatus
.
getDisplay
());
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
status
.
getDisplay
(),
nextStatus
.
getDisplay
(),
0
,
account
,
remark
);
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
status
.
getDisplay
(),
nextStatus
.
getDisplay
(),
0
,
account
,
remark
);
if
(
StringUtils
.
isNotBlank
(
uri
))
{
if
(
StringUtils
.
isNotBlank
(
uri
))
{
List
<
Long
>
userIds
=
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
);
lmsMsgService
.
sendMsg
(
uri
,
content
,
title
,
account
,
sendUidList
);
// 若为数据录入,消息具体到检测人
if
(
nextFlowStatus
==
EntrustFlowEnum
.
TEST
)
{
List
<
EntrustSampleItem
>
sampleItems
=
entrustSampleItemService
.
getListByEntrustId
(
entrust
.
getId
());
if
(
CollectionUtils
.
isEmpty
(
sampleItems
))
{
// 为空不发消息,直接返回
return
true
;
}
userIds
=
sampleItems
.
stream
().
map
(
EntrustSampleItem:
:
getTesterId
).
collect
(
Collectors
.
toList
());
}
lmsMsgService
.
sendMsg
(
uri
,
content
,
title
,
account
,
userIds
);
}
}
return
true
;
return
true
;
}
}
...
@@ -969,12 +976,15 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -969,12 +976,15 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
// 当前委托状态
// 当前委托状态
EntrustStatusEnum
status
=
entrust
.
getStatus
();
EntrustStatusEnum
status
=
entrust
.
getStatus
();
String
uri
=
""
;
String
uri
=
""
;
List
<
Long
>
sendUidList
=
new
ArrayList
<>();
if
(
prevStatus
==
EntrustStatusEnum
.
DRAFT
)
{
if
(
prevStatus
==
EntrustStatusEnum
.
DRAFT
)
{
uri
=
"/hmhj/entrust_manage/entrust_register"
;
uri
=
"/hmhj/entrust_manage/entrust_register"
;
sendUidList
.
add
(
entrust
.
getUid
());
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
CHECK
)
{
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
CHECK
)
{
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
MAKE
)
{
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
MAKE
)
{
uri
=
"/hmhj/sample_manage/sample_prepare"
;
uri
=
"/hmhj/sample_manage/sample_prepare"
;
sendUidList
=
userInfoService
.
getUserIdsByGroupName
(
entrust
.
getTestSide
());
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
OUT_INPUT
)
{
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
OUT_INPUT
)
{
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
QUALITY_CHECK
)
{
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
QUALITY_CHECK
)
{
...
@@ -993,7 +1003,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -993,7 +1003,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
content
=
String
.
format
(
"有%s驳回过来,请及时%s"
,
EntrustFlowEnum
.
convert
(
flowStatus
).
getDisplay
(),
prevFlowStatus
.
getDisplay
());
content
=
String
.
format
(
"有%s驳回过来,请及时%s"
,
EntrustFlowEnum
.
convert
(
flowStatus
).
getDisplay
(),
prevFlowStatus
.
getDisplay
());
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
status
.
getDisplay
(),
prevStatus
.
getDisplay
(),
1
,
account
,
reason
);
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
status
.
getDisplay
(),
prevStatus
.
getDisplay
(),
1
,
account
,
reason
);
if
(
StringUtils
.
isNotBlank
(
uri
))
{
if
(
StringUtils
.
isNotBlank
(
uri
))
{
lmsMsgService
.
sendMsg
(
uri
,
content
,
title
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
lmsMsgService
.
sendMsg
(
uri
,
content
,
title
,
account
,
sendUidList
);
}
}
return
true
;
return
true
;
}
}
...
@@ -1016,7 +1026,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1016,7 +1026,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
}
entrust
.
setId
(
null
);
entrust
.
setId
(
null
);
entrust
.
setCode
(
null
).
setStatus
(
EntrustStatusEnum
.
DRAFT
).
setProgress
(
EntrustStatusEnum
.
DRAFT
)
entrust
.
setCode
(
null
).
setStatus
(
EntrustStatusEnum
.
DRAFT
).
setProgress
(
EntrustStatusEnum
.
DRAFT
)
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
()).
setEntrustTime
(
new
Date
()).
setExpectSendTime
(
new
Date
())
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
()).
setEntrustTime
(
new
Date
()).
setExpectSendTime
(
new
Date
())
.
setReceiveTime
(
new
Date
())
.
setUid
(
account
.
getUserId
()).
setCtime
(
new
Date
()).
setLid
(
null
).
setLtime
(
null
).
setOrgId
(
null
).
setSampleName
(
sampleList
.
get
(
0
).
getName
());
.
setUid
(
account
.
getUserId
()).
setCtime
(
new
Date
()).
setLid
(
null
).
setLtime
(
null
).
setOrgId
(
null
).
setSampleName
(
sampleList
.
get
(
0
).
getName
());
// 保存委托信息
// 保存委托信息
saveEntrust
(
entrust
);
saveEntrust
(
entrust
);
...
@@ -1084,6 +1094,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1084,6 +1094,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
int
count
=
super
.
count
(
Condition
.
create
().
in
(
"id"
,
ids
).
eq
(
"status"
,
EntrustStatusEnum
.
MAKE
));
int
count
=
super
.
count
(
Condition
.
create
().
in
(
"id"
,
ids
).
eq
(
"status"
,
EntrustStatusEnum
.
MAKE
));
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择要退回至登记的委托"
);
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择要退回至登记的委托"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Long
>
sendUidList
=
new
ArrayList
<>();
for
(
Entrust
e
:
entrustList
)
{
for
(
Entrust
e
:
entrustList
)
{
e
.
setStatus
(
EntrustStatusEnum
.
DRAFT
);
e
.
setStatus
(
EntrustStatusEnum
.
DRAFT
);
e
.
setProgress
(
EntrustStatusEnum
.
BACK_MAKE
);
e
.
setProgress
(
EntrustStatusEnum
.
BACK_MAKE
);
...
@@ -1091,6 +1102,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1091,6 +1102,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
e
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
());
e
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
());
updateById
(
e
);
updateById
(
e
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
1
,
account
,
reason
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
1
,
account
,
reason
);
sendUidList
.
add
(
e
.
getUid
());
// 更新样品状态
// 更新样品状态
EntrustSample
entrustSample
=
new
EntrustSample
();
EntrustSample
entrustSample
=
new
EntrustSample
();
entrustSample
.
setStatus
(
EntrustSampleStatusEnum
.
DRAFT
);
entrustSample
.
setStatus
(
EntrustSampleStatusEnum
.
DRAFT
);
...
@@ -1104,7 +1116,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1104,7 +1116,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrustSampleItemService
.
update
(
entrustSampleItem
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
));
entrustSampleItemService
.
update
(
entrustSampleItem
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
));
}
}
}
}
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品制备退回,请及时查看退回原因并处理"
,
"新的样品制备退回任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品制备退回,请及时查看退回原因并处理"
,
"新的样品制备退回任务!"
,
account
,
sendUidList
);
return
true
;
return
true
;
}
}
...
@@ -1115,6 +1127,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1115,6 +1127,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
int
count
=
super
.
count
(
Condition
.
create
().
in
(
"id"
,
ids
).
eq
(
"status"
,
EntrustStatusEnum
.
TEST
));
int
count
=
super
.
count
(
Condition
.
create
().
in
(
"id"
,
ids
).
eq
(
"status"
,
EntrustStatusEnum
.
TEST
));
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择要退回至登记的委托"
);
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择要退回至登记的委托"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Long
>
sendUidList
=
new
ArrayList
<>();
for
(
Entrust
e
:
entrustList
)
{
for
(
Entrust
e
:
entrustList
)
{
e
.
setStatus
(
EntrustStatusEnum
.
DRAFT
);
e
.
setStatus
(
EntrustStatusEnum
.
DRAFT
);
e
.
setProgress
(
EntrustStatusEnum
.
BACK_RECEIVE
);
e
.
setProgress
(
EntrustStatusEnum
.
BACK_RECEIVE
);
...
@@ -1122,6 +1135,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1122,6 +1135,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
e
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
());
e
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
());
updateById
(
e
);
updateById
(
e
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
TEST
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
1
,
account
,
reason
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
TEST
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
1
,
account
,
reason
);
sendUidList
.
add
(
e
.
getUid
());
// 更新样品状态
// 更新样品状态
EntrustSample
entrustSample
=
new
EntrustSample
();
EntrustSample
entrustSample
=
new
EntrustSample
();
entrustSample
.
setStatus
(
EntrustSampleStatusEnum
.
DRAFT
);
entrustSample
.
setStatus
(
EntrustSampleStatusEnum
.
DRAFT
);
...
@@ -1138,7 +1152,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1138,7 +1152,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
// 删除委托下样品备样
// 删除委托下样品备样
entrustSampleBackupService
.
remove
(
Condition
.
create
().
eq
(
"entrust_id"
,
e
.
getId
()));
entrustSampleBackupService
.
remove
(
Condition
.
create
().
eq
(
"entrust_id"
,
e
.
getId
()));
}
}
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品接收退回,请及时查看退回原因并处理"
,
"新的样品接收退回任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品接收退回,请及时查看退回原因并处理"
,
"新的样品接收退回任务!"
,
account
,
sendUidList
);
return
true
;
return
true
;
}
}
...
@@ -1466,6 +1480,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1466,6 +1480,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
RestAssert
.
fail
(
null
==
ids
||
0
==
ids
.
length
,
"请选择要提交的委托!"
);
RestAssert
.
fail
(
null
==
ids
||
0
==
ids
.
length
,
"请选择要提交的委托!"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Long
>
specialIds
=
new
ArrayList
<>(),
normalIds
=
new
ArrayList
<>();
List
<
Long
>
specialIds
=
new
ArrayList
<>(),
normalIds
=
new
ArrayList
<>();
List
<
Long
>
sendUserIdList
=
new
ArrayList
<>();
for
(
Entrust
entrust
:
entrustList
)
{
for
(
Entrust
entrust
:
entrustList
)
{
if
(
"是"
.
equals
(
entrust
.
getSpecialAsk
()))
{
if
(
"是"
.
equals
(
entrust
.
getSpecialAsk
()))
{
specialIds
.
add
(
entrust
.
getId
());
specialIds
.
add
(
entrust
.
getId
());
...
@@ -1475,6 +1490,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1475,6 +1490,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
submitToNextNode
(
entrust
,
account
);
submitToNextNode
(
entrust
,
account
);
}
else
{
}
else
{
normalIds
.
add
(
entrust
.
getId
());
normalIds
.
add
(
entrust
.
getId
());
List
<
Long
>
userIdList
=
userInfoService
.
getUserIdsByGroupName
(
entrust
.
getTestSide
());
if
(
CollectionUtils
.
isNotEmpty
(
userIdList
))
{
sendUserIdList
.
addAll
(
userIdList
);
}
}
}
}
}
}
}
...
@@ -1485,7 +1504,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1485,7 +1504,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
updateModel
.
setFlowStatus
(
EntrustFlowEnum
.
CHECK
.
getName
());
updateModel
.
setFlowStatus
(
EntrustFlowEnum
.
CHECK
.
getName
());
update
(
updateModel
,
Condition
.
create
().
in
(
"id"
,
specialIds
));
update
(
updateModel
,
Condition
.
create
().
in
(
"id"
,
specialIds
));
entrustRecordService
.
record
(
specialIds
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
0
,
account
,
"提交至委托审核"
);
entrustRecordService
.
record
(
specialIds
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
0
,
account
,
"提交至委托审核"
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_review"
,
"有委托从委托登记提交过来,请及时审核"
,
"新的委托审核任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_review"
,
"有委托从委托登记提交过来,请及时审核"
,
"新的委托审核任务!"
,
account
,
null
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
normalIds
))
{
if
(
CollectionUtils
.
isNotEmpty
(
normalIds
))
{
...
@@ -1498,7 +1517,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1498,7 +1517,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrustSampleService
.
updateSampleCodeByEntrustId
(
entrustId
,
HmConst
.
TWO
);
entrustSampleService
.
updateSampleCodeByEntrustId
(
entrustId
,
HmConst
.
TWO
);
});
});
entrustRecordService
.
record
(
normalIds
,
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
0
,
account
,
"提交至样品待制备"
);
entrustRecordService
.
record
(
normalIds
,
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
0
,
account
,
"提交至样品待制备"
);
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托审核通过,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托审核通过,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
sendUserIdList
);
}
}
return
true
;
return
true
;
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/UserInfoServiceImpl.java
View file @
53edf4f5
...
@@ -11,10 +11,10 @@ import com.patzn.cloud.feign.lims.base.client.LmsUserGroupClient;
...
@@ -11,10 +11,10 @@ import com.patzn.cloud.feign.lims.base.client.LmsUserGroupClient;
import
com.patzn.cloud.service.base.entity.SysOrg
;
import
com.patzn.cloud.service.base.entity.SysOrg
;
import
com.patzn.cloud.service.base.entity.SysUser
;
import
com.patzn.cloud.service.base.entity.SysUser
;
import
com.patzn.cloud.service.hmhj.entity.Entrust
;
import
com.patzn.cloud.service.hmhj.entity.Entrust
;
import
com.patzn.cloud.service.hmhj.enums.MessageUserEnum
;
import
com.patzn.cloud.service.lims.base.entity.LmsUserGroup
;
import
com.patzn.cloud.service.lims.base.entity.LmsUserGroup
;
import
com.patzn.cloud.service.lims.base.vo.GroupUserVO
;
import
com.patzn.cloud.service.lims.base.vo.GroupUserVO
;
import
com.patzn.cloud.service.lims.common.consts.Symbol
;
import
com.patzn.cloud.service.lims.common.consts.Symbol
;
import
com.patzn.cloud.service.lims.common.service.ILmsMsgService
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustService
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -51,6 +51,9 @@ public class UserInfoServiceImpl {
...
@@ -51,6 +51,9 @@ public class UserInfoServiceImpl {
@Autowired
@Autowired
private
SysRoleClient
sysRoleClient
;
private
SysRoleClient
sysRoleClient
;
@Autowired
private
ILmsMsgService
lmsMsgService
;
public
List
<
LmsUserGroup
>
getGroupList
(
Long
userId
)
{
public
List
<
LmsUserGroup
>
getGroupList
(
Long
userId
)
{
if
(
null
==
userId
)
{
if
(
null
==
userId
)
{
return
OTHER_GROUP_LIST
;
return
OTHER_GROUP_LIST
;
...
@@ -97,6 +100,19 @@ public class UserInfoServiceImpl {
...
@@ -97,6 +100,19 @@ public class UserInfoServiceImpl {
return
Stream
.
of
(
userIdStr
.
split
(
Symbol
.
COMMA
)).
map
(
Long:
:
valueOf
).
distinct
().
collect
(
Collectors
.
toList
());
return
Stream
.
of
(
userIdStr
.
split
(
Symbol
.
COMMA
)).
map
(
Long:
:
valueOf
).
distinct
().
collect
(
Collectors
.
toList
());
}
}
public
List
<
Long
>
getUserIdsByGroupName
(
String
groupName
)
{
if
(
StringUtils
.
isBlank
(
groupName
))
{
return
null
;
}
Account
account
=
LoginHelper
.
getAccount
();
List
<
GroupUserVO
>
groupUserList
=
lmsUserGroupClient
.
getGroupUserIdsList
(
account
.
getCompanyId
()).
serviceData
();
if
(
CollectionUtils
.
isEmpty
(
groupUserList
))
{
return
null
;
}
String
userIdStr
=
groupUserList
.
stream
().
filter
(
t
->
t
.
getGroupName
().
equals
(
groupName
)).
map
(
GroupUserVO:
:
getUserIds
).
collect
(
Collectors
.
joining
(
Symbol
.
COMMA
));
return
Stream
.
of
(
userIdStr
.
split
(
Symbol
.
COMMA
)).
map
(
Long:
:
valueOf
).
distinct
().
collect
(
Collectors
.
toList
());
}
public
boolean
isGroupLeader
(
Long
entrustId
,
Account
account
)
{
public
boolean
isGroupLeader
(
Long
entrustId
,
Account
account
)
{
if
(
null
==
entrustId
)
{
if
(
null
==
entrustId
)
{
return
false
;
return
false
;
...
@@ -139,16 +155,4 @@ public class UserInfoServiceImpl {
...
@@ -139,16 +155,4 @@ public class UserInfoServiceImpl {
return
getUserById
(
LoginHelper
.
getAccount
().
getUserId
());
return
getUserById
(
LoginHelper
.
getAccount
().
getUserId
());
}
}
public
List
<
Long
>
getUserIds
(
MessageUserEnum
messageUserEnum
,
Long
someoneId
)
{
List
<
Long
>
userIdList
=
new
ArrayList
<>();
if
(
MessageUserEnum
.
CURRENT
==
messageUserEnum
)
{
userIdList
.
add
(
LoginHelper
.
getAccount
().
getUserId
());
}
else
if
(
MessageUserEnum
.
SOMEONE
==
messageUserEnum
)
{
userIdList
.
add
(
someoneId
);
}
else
{
userIdList
.
addAll
(
getGroupUserIds
(
null
));
}
return
userIdList
;
}
}
}
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