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
ecc8c696
Commit
ecc8c696
authored
Aug 10, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加部分提示消息;
parent
1ce7dc74
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
36 deletions
+95
-36
IEntrustSampleItemService.java
.../service/lims/hmhj/service/IEntrustSampleItemService.java
+1
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+8
-0
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+46
-36
UserInfoServiceImpl.java
...d/service/lims/hmhj/service/impl/UserInfoServiceImpl.java
+34
-0
20200810新增业务数据字段.sql
...test/java/resources/db_sql/hmhj/v150/20200810新增业务数据字段.sql
+6
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleItemService.java
View file @
ecc8c696
...
...
@@ -106,4 +106,5 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
boolean
revokeDeletedItems
(
Long
[]
sampleIds
);
List
<
EntrustSampleItem
>
getListByEntrustId
(
Long
entrustId
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
ecc8c696
...
...
@@ -1318,6 +1318,14 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
baseMapper
.
updateForRevokeDeletedItems
(
sampleIds
);
}
@Override
public
List
<
EntrustSampleItem
>
getListByEntrustId
(
Long
entrustId
)
{
if
(
null
==
entrustId
)
{
return
null
;
}
return
list
(
Condition
.
create
().
exists
(
"select 1 from entrust_sample s where s.deleted = 0 and s.id = entrust_sample_item.entrust_sample_id and s.entrust_id = "
+
entrustId
));
}
/**
* 处理 原铝等标准为
*/
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
ecc8c696
...
...
@@ -16,6 +16,7 @@ import com.patzn.cloud.feign.base.client.SysUserClient;
import
com.patzn.cloud.feign.lims.hmhj.client.LmsChemicalCategoryClient
;
import
com.patzn.cloud.oss.starter.OssClient
;
import
com.patzn.cloud.oss.starter.OssFileResult
;
import
com.patzn.cloud.service.BaseEntity
;
import
com.patzn.cloud.service.base.entity.SysOrg
;
import
com.patzn.cloud.service.base.entity.SysUser
;
import
com.patzn.cloud.service.hmhj.dto.EntrustDTO
;
...
...
@@ -26,10 +27,10 @@ import com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO;
import
com.patzn.cloud.service.hmhj.vo.EntrustSampleVO
;
import
com.patzn.cloud.service.hmhj.vo.EntrustVO
;
import
com.patzn.cloud.service.lims.chemical.entity.LmsChemicalCategory
;
import
com.patzn.cloud.service.lims.hmhj.common.consts.HmConst
;
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.common.EntrustFlowUtils
;
import
com.patzn.cloud.service.lims.hmhj.common.consts.HmConst
;
import
com.patzn.cloud.service.lims.hmhj.mapper.EntrustMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.*
;
import
com.patzn.poibox.xwpf.XWPFTemplate
;
...
...
@@ -141,7 +142,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
public
boolean
isExistSampleCode
(
EntrustSample
sample
)
{
String
category
=
sample
.
getCategory
();
String
sampleName
=
sample
.
getName
();
RestAssert
.
fail
(
StringUtils
.
isBlank
(
category
),
"样品类型为空"
);
LmsChemicalCategory
chemicalCategory
=
lmsChemicalCategoryClient
.
getTopCategory
(
category
).
getData
();
RestAssert
.
fail
(
null
==
chemicalCategory
,
"样品(物资)类型为空"
);
...
...
@@ -169,7 +169,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
int
codeTypeNo
=
0
;
List
<
SysOrg
>
orgList
=
sysOrgClient
.
getListByUserId
(
account
.
getUserId
()).
getData
();
// 具体是哪一期
String
phase
=
orgList
.
stream
().
filter
(
t
->
t
.
getName
().
contains
(
"二期"
)).
count
()
>
0
?
"Z"
:
"F"
;
String
phase
=
orgList
.
stream
().
anyMatch
(
t
->
t
.
getName
().
contains
(
"二期"
))
?
"Z"
:
"F"
;
// 默认样品初始编号
CodeTypeEnum
codeType
=
null
;
switch
(
parentCategory
)
{
...
...
@@ -199,7 +199,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
break
;
}
String
sampleCode
=
null
;
String
sampleCode
;
String
replaceStr
=
"XX"
,
inspectNo
=
""
,
secondCode
=
""
,
thirdCode
=
""
;
// ==
if
(
HmConst
.
EXIST_CODE_MATERIALS
.
equals
(
parentCategory
))
{
...
...
@@ -239,7 +239,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
LocalTime
zero
=
LocalTime
.
parse
(
"00:00:00"
);
LocalTime
eight
=
LocalTime
.
parse
(
"08:00:00"
);
LocalTime
sixth
=
LocalTime
.
parse
(
"16:00:00"
);
String
clazz
=
""
;
String
clazz
;
if
(
now
.
isAfter
(
zero
)
&&
now
.
isBefore
(
eight
))
{
clazz
=
"E"
;
}
else
if
(
now
.
isAfter
(
eight
)
&&
now
.
isBefore
(
sixth
))
{
...
...
@@ -290,9 +290,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
/**
* 样品编号处理
* @param sample
*/
private
void
handleSampleCode
(
EntrustSample
sample
){
private
void
handleSampleCode
(
EntrustSample
sample
)
{
String
sampleCode
=
sample
.
getCode
();
if
(
isExistSampleCode
(
sample
)
&&
StringUtils
.
isBlank
(
sampleCode
))
{
throw
new
PatznException
(
"样品编号为空"
);
...
...
@@ -311,7 +310,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
RestAssert
.
fail
(
StringUtils
.
isBlank
(
dto
.
getClient
()),
"委托单位不能为空!"
);
Entrust
entrust
=
dto
.
convert
(
Entrust
.
class
);
List
<
EntrustSampleDTO
>
sampleDTOList
=
dto
.
getSampleDTOList
();
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleDTOList
),
"委托样品为空"
);
if
(
null
==
entrust
.
getEntrustTime
())
{
entrust
.
setEntrustTime
(
new
Date
());
}
...
...
@@ -358,6 +357,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
//计算费用
entrust
.
setTotalFee
(
totalFee
);
//保存样品名称
entrust
.
setSampleName
(
sampleDTOList
.
get
(
0
).
getName
());
if
(
saveEntrust
(
entrust
))
{
if
(
CollectionUtils
.
isNotEmpty
(
saveSampleList
))
{
entrustSampleService
.
saveBatch
(
saveSampleList
);
...
...
@@ -373,9 +374,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override
public
Boolean
saveOutEntrust
(
EntrustDTO
dto
,
Account
account
)
{
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
dto
.
getSampleDTOList
()),
"外委样品不能为空"
);
dto
.
getSampleDTOList
().
stream
().
forEach
(
t
->
{
t
.
setCategory
(
HmConst
.
EXTERNAL_INSPECTION_MATERIALS
);
});
dto
.
getSampleDTOList
().
forEach
(
t
->
t
.
setCategory
(
HmConst
.
EXTERNAL_INSPECTION_MATERIALS
));
return
saveEntrustDTO
(
dto
,
account
);
}
...
...
@@ -392,7 +391,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
CHECK
.
getName
());
if
(
update
(
entrust
,
Condition
.
create
().
in
(
"id"
,
ids
)))
{
entrustRecordService
.
record
(
ids
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
0
,
account
,
"提交至委托审核"
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_review"
,
"有委托从委托登记提交过来,请及时审核"
,
"新的委托审核任务!"
,
account
,
null
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_review"
,
"有委托从委托登记提交过来,请及时审核"
,
"新的委托审核任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
}
return
true
;
}
...
...
@@ -409,7 +408,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrust
.
setProgress
(
EntrustStatusEnum
.
OUT_INPUT
);
if
(
update
(
entrust
,
Condition
.
create
().
in
(
"id"
,
ids
)))
{
entrustRecordService
.
record
(
ids
,
EntrustStatusEnum
.
OUT_DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
OUT_INPUT
.
getDisplay
(),
0
,
account
,
"提交至外委数据录入"
);
lmsMsgService
.
sendMsg
(
"/hmhj/accept_manage/sub_input"
,
"有外委登记提交过来,请及时填写外委数据"
,
"新的委托外委数据录入任务!"
,
account
,
null
);
lmsMsgService
.
sendMsg
(
"/hmhj/accept_manage/sub_input"
,
"有外委登记提交过来,请及时填写外委数据"
,
"新的委托外委数据录入任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
}
return
true
;
}
...
...
@@ -436,7 +435,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
}
if
(!
hasSendMessage
)
{
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从委托审核驳回,请及时查看退回原因并处理"
,
"新的委托审核退回任务!"
,
account
,
null
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从委托审核驳回,请及时查看退回原因并处理"
,
"新的委托审核退回任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
}
return
true
;
...
...
@@ -464,7 +463,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
}
if
(!
hasSendMessage
)
{
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托审核通过,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
null
);
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托审核通过,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
}
return
true
;
}
...
...
@@ -493,7 +492,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
if
(!
hasSendMessage
)
{
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托登记提交至样品待制备,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
null
);
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托登记提交至样品待制备,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
}
return
true
;
...
...
@@ -507,17 +506,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
return
false
;
}
List
<
EntrustSampleDTO
>
sampleList
=
entrustDTO
.
getSampleDTOList
();
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleList
),
"委托样品为空"
);
RestAssert
.
fail
(
sampleList
.
stream
().
map
(
EntrustSampleDTO:
:
getName
).
distinct
().
count
()
>
1
,
"一个委托只能下同一种样品!"
);
if
(
CollectionUtils
.
isEmpty
(
sampleList
))
{
// PtAssert.fail("样品不能为空");
}
for
(
EntrustSampleDTO
sampleDTO
:
sampleList
)
{
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sampleDTO
.
getName
()),
"样品名称不能为空"
);
}
Entrust
entrust
=
entrustDTO
.
convert
(
Entrust
.
class
);
entrust
.
setSampleName
(
sampleList
.
get
(
0
).
getName
());
if
(
updateById
(
entrust
))
{
List
<
Long
>
sampleIdsList
=
new
ArrayList
<>();
List
<
EntrustSample
>
updateSampleList
=
new
ArrayList
<>();
List
<
EntrustSample
>
saveSampleList
=
new
ArrayList
<>();
...
...
@@ -529,7 +525,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
incNum
+=
10
;
if
(
null
!=
sample
.
getId
())
{
updateSampleList
.
add
(
sample
);
sampleIdsList
.
add
(
sample
.
getId
());
}
else
{
sample
.
setEntrustId
(
entrust
.
getId
());
handleSampleCode
(
sample
);
...
...
@@ -584,9 +579,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if
(
CollectionUtils
.
isEmpty
(
entrustSamples
))
{
return
;
}
List
<
Long
>
sampleIdList
=
entrustSamples
.
stream
().
map
(
e
->
{
return
e
.
getId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleIdList
=
entrustSamples
.
stream
().
map
(
BaseEntity:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
EntrustSampleItem
>
itemList
=
entrustSampleItemService
.
list
(
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIdList
).
isNotNull
(
"price"
));
BigDecimal
totalFee
=
BigDecimal
.
ZERO
;
...
...
@@ -899,13 +892,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
EntrustFlowEnum
nextFlowStatus
=
EntrustFlowUtils
.
getNextFlowStatus
(
flowStatus
,
statusPath
);
RestAssert
.
fail
(
null
==
nextFlowStatus
,
String
.
format
(
"编号为【%s】的委托,未配置下一流程状态信息!"
,
entrust
.
getCode
()));
int
nextFlowValue
=
nextFlowStatus
.
getValue
()
.
intValue
()
;
int
nextFlowValue
=
nextFlowStatus
.
getValue
();
EntrustStatusEnum
nextStatus
=
EntrustFlowUtils
.
getStatus
(
nextFlowStatus
);
RestAssert
.
fail
(
null
==
nextStatus
,
String
.
format
(
"编号为【%s】的委托,未配置下一流程状态信息!"
,
entrust
.
getCode
()));
// 当前委托状态
EntrustStatusEnum
status
=
entrust
.
getStatus
();
// 是否特殊需求
boolean
isSpecAsk
=
null
==
entrust
.
getSpecialAsk
()
?
false
:
(
"是"
.
equals
(
entrust
.
getSpecialAsk
()));
boolean
isSpecAsk
=
null
!=
entrust
.
getSpecialAsk
()
&&
(
"是"
.
equals
(
entrust
.
getSpecialAsk
()));
// 是否需要修改样品和检测项目(由于报告处只会修改部分样品)
boolean
isUpdateSampleInfo
=
nextFlowValue
<
9
||
nextFlowValue
>
12
;
// 若为特殊需求,必须要走评审
...
...
@@ -914,6 +907,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
uri
=
"/hmhj/entrust_manage/entrust_review"
;
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
MAKE
)
{
uri
=
"/hmhj/sample_manage/sample_prepare"
;
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
TEST
)
{
uri
=
"/hmhj/accept_manage/input"
;
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
OUT_INPUT
)
{
uri
=
"/hmhj/accept_manage/sub_input"
;
}
else
if
(
nextStatus
==
EntrustStatusEnum
.
QUALITY_CHECK
)
{
...
...
@@ -935,7 +930,17 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
content
=
String
.
format
(
"有%s提交过来,请及时%s"
,
EntrustFlowEnum
.
convert
(
flowStatus
).
getDisplay
(),
nextFlowStatus
.
getDisplay
());
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
status
.
getDisplay
(),
nextStatus
.
getDisplay
(),
0
,
account
,
remark
);
if
(
StringUtils
.
isNotBlank
(
uri
))
{
lmsMsgService
.
sendMsg
(
uri
,
content
,
title
,
account
,
null
);
List
<
Long
>
userIds
=
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
);
// 若为数据录入,消息具体到检测人
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
;
}
...
...
@@ -969,7 +974,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
CHECK
)
{
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
MAKE
)
{
uri
=
"/hmhj/sample_manage/sample_prepare"
;
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
OUT_INPUT
)
{
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
QUALITY_CHECK
)
{
...
...
@@ -988,7 +993,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
content
=
String
.
format
(
"有%s驳回过来,请及时%s"
,
EntrustFlowEnum
.
convert
(
flowStatus
).
getDisplay
(),
prevFlowStatus
.
getDisplay
());
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
status
.
getDisplay
(),
prevStatus
.
getDisplay
(),
1
,
account
,
reason
);
if
(
StringUtils
.
isNotBlank
(
uri
))
{
lmsMsgService
.
sendMsg
(
uri
,
content
,
title
,
account
,
null
);
lmsMsgService
.
sendMsg
(
uri
,
content
,
title
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
}
return
true
;
}
...
...
@@ -1012,7 +1017,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrust
.
setId
(
null
);
entrust
.
setCode
(
null
).
setStatus
(
EntrustStatusEnum
.
DRAFT
).
setProgress
(
EntrustStatusEnum
.
DRAFT
)
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
()).
setEntrustTime
(
new
Date
()).
setExpectSendTime
(
new
Date
())
.
setUid
(
account
.
getUserId
()).
setCtime
(
new
Date
()).
setLid
(
null
).
setLtime
(
null
).
setOrgId
(
null
);
.
setUid
(
account
.
getUserId
()).
setCtime
(
new
Date
()).
setLid
(
null
).
setLtime
(
null
).
setOrgId
(
null
)
.
setSampleName
(
sampleList
.
get
(
0
).
getName
())
;
// 保存委托信息
saveEntrust
(
entrust
);
entrustIdList
.
add
(
entrust
.
getId
());
...
...
@@ -1079,7 +1084,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
int
count
=
super
.
count
(
Condition
.
create
().
in
(
"id"
,
ids
).
eq
(
"status"
,
EntrustStatusEnum
.
MAKE
));
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择要退回至登记的委托"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
boolean
hasSendMessage
=
false
;
for
(
Entrust
e
:
entrustList
)
{
e
.
setStatus
(
EntrustStatusEnum
.
DRAFT
);
e
.
setProgress
(
EntrustStatusEnum
.
BACK_MAKE
);
...
...
@@ -1100,7 +1104,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrustSampleItemService
.
update
(
entrustSampleItem
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
));
}
}
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品制备退回,请及时查看退回原因并处理"
,
"新的样品制备退回任务!"
,
account
,
null
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品制备退回,请及时查看退回原因并处理"
,
"新的样品制备退回任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
return
true
;
}
...
...
@@ -1134,7 +1138,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
// 删除委托下样品备样
entrustSampleBackupService
.
remove
(
Condition
.
create
().
eq
(
"entrust_id"
,
e
.
getId
()));
}
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品接收退回,请及时查看退回原因并处理"
,
"新的样品接收退回任务!"
,
account
,
null
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品接收退回,请及时查看退回原因并处理"
,
"新的样品接收退回任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
return
true
;
}
...
...
@@ -1418,6 +1422,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrustSampleItemService
.
update
(
item
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
));
// 3.日志
entrustRecordService
.
record
(
ids
,
EntrustFlowEnum
.
REPORT_MAKE
.
getDisplay
(),
prevFlow
.
getDisplay
(),
1
,
account
,
reason
);
// 4.消息
List
<
EntrustSampleItem
>
items
=
entrustSampleItemService
.
getListByEntrustId
(
entrust
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
items
))
{
lmsMsgService
.
sendMsg
(
"/hmhj/test_manage/test_input"
,
"有委托从报告编制退回过来,请及时处理"
,
"新的(报告编制退回)数据录入任务!"
,
account
,
items
.
stream
().
map
(
EntrustSampleItem:
:
getTesterId
).
collect
(
Collectors
.
toList
()));
}
}
// 4.删除报告
EntrustReport
report
=
new
EntrustReport
();
...
...
@@ -1475,7 +1485,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
updateModel
.
setFlowStatus
(
EntrustFlowEnum
.
CHECK
.
getName
());
update
(
updateModel
,
Condition
.
create
().
in
(
"id"
,
specialIds
));
entrustRecordService
.
record
(
specialIds
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
0
,
account
,
"提交至委托审核"
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_review"
,
"有委托从委托登记提交过来,请及时审核"
,
"新的委托审核任务!"
,
account
,
null
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_review"
,
"有委托从委托登记提交过来,请及时审核"
,
"新的委托审核任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
}
if
(
CollectionUtils
.
isNotEmpty
(
normalIds
))
{
...
...
@@ -1488,7 +1498,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrustSampleService
.
updateSampleCodeByEntrustId
(
entrustId
,
HmConst
.
TWO
);
});
entrustRecordService
.
record
(
normalIds
,
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
0
,
account
,
"提交至样品待制备"
);
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托审核通过,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
null
);
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托审核通过,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
userInfoService
.
getUserIds
(
MessageUserEnum
.
GROUP_USER
,
null
)
);
}
return
true
;
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/UserInfoServiceImpl.java
View file @
ecc8c696
...
...
@@ -11,7 +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.SysUser
;
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.vo.GroupUserVO
;
import
com.patzn.cloud.service.lims.common.consts.Symbol
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -20,6 +23,7 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
@Service
public
class
UserInfoServiceImpl
{
...
...
@@ -75,6 +79,24 @@ public class UserInfoServiceImpl {
return
StringUtils
.
join
(
curGroupNameList
,
"-"
);
}
public
List
<
Long
>
getGroupUserIds
(
Long
userId
)
{
// 为空默认获取当前用户所有组
Account
account
=
LoginHelper
.
getAccount
();
if
(
null
==
userId
)
{
userId
=
account
.
getUserId
();
}
List
<
LmsUserGroup
>
userGroups
=
getGroupList
(
userId
);
if
(
CollectionUtils
.
isEmpty
(
userGroups
))
{
return
null
;
}
List
<
String
>
groupNames
=
userGroups
.
stream
().
map
(
LmsUserGroup:
:
getName
).
collect
(
Collectors
.
toList
());
List
<
GroupUserVO
>
groupUserList
=
lmsUserGroupClient
.
getGroupUserIdsList
(
account
.
getCompanyId
()).
serviceData
();
String
userIdStr
=
groupUserList
.
stream
().
filter
(
t
->
groupNames
.
contains
(
t
.
getGroupName
())
&&
StringUtils
.
isNotBlank
(
t
.
getUserIds
())
).
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
)
{
if
(
null
==
entrustId
)
{
return
false
;
...
...
@@ -117,4 +139,16 @@ public class UserInfoServiceImpl {
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
;
}
}
src/test/java/resources/db_sql/hmhj/v150/20200810新增业务数据字段.sql
0 → 100644
View file @
ecc8c696
/** created by meazty on 2021/8/10 11:11 **/
/** created by meazty on 2021/8/10 11:11 **/
ALTER
TABLE
"public"
.
"business_data"
ADD
COLUMN
"data_name"
varchar
(
128
)
COLLATE
"pg_catalog"
.
"default"
;
COMMENT
ON
COLUMN
"public"
.
"business_data"
.
"data_name"
IS
'数据名称'
;
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