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
95585259
Commit
95585259
authored
Jul 11, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加委托流程日志;
parent
aeb546d1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
88 deletions
+96
-88
EntrustReportServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustReportServiceImpl.java
+31
-26
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+49
-46
EntrustSamplePrepareServiceImpl.java
...ms/hmhj/service/impl/EntrustSamplePrepareServiceImpl.java
+15
-12
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+0
-3
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+1
-1
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustReportServiceImpl.java
View file @
95585259
...
...
@@ -20,11 +20,8 @@ import com.patzn.cloud.service.hmhj.enums.EntrustSampleItemStatusEnum;
import
com.patzn.cloud.service.hmhj.enums.EntrustSampleStatusEnum
;
import
com.patzn.cloud.service.lims.hmhj.common.LabreOfficeUtil
;
import
com.patzn.cloud.service.lims.hmhj.mapper.EntrustReportMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustReportRelSampleService
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustReportService
;
import
com.patzn.cloud.service.lims.hmhj.service.*
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustSampleService
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -37,10 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.io.File
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
java.util.concurrent.Executor
;
import
java.util.stream.Collectors
;
...
...
@@ -62,6 +56,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
@Autowired
private
IEntrustService
entrustService
;
@Autowired
private
IEntrustRecordService
entrustRecordService
;
@Autowired
private
Executor
executor1
;
@Value
(
"${libreOffice.url}"
)
...
...
@@ -150,7 +146,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
// 存在的状态路径时,方可进入处理操作
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
account
);
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
EntrustFlowEnum
.
REPORT_MAKE
,
EntrustFlowEnum
.
REPORT_CHECK
,
account
);
//转化PDF
...
...
@@ -164,19 +160,19 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
private
void
changeExcelReportToPdf
(
Long
[]
ids
)
{
List
<
EntrustReport
>
reportList
=
list
(
Condition
.
create
().
in
(
"id"
,
ids
).
isNotNull
(
"object_key"
));
if
(
CollectionUtils
.
isEmpty
(
reportList
)){
List
<
EntrustReport
>
reportList
=
list
(
Condition
.
create
().
in
(
"id"
,
ids
).
isNotNull
(
"object_key"
));
if
(
CollectionUtils
.
isEmpty
(
reportList
))
{
return
;
}
List
<
File
>
deleteFileList
=
new
ArrayList
<>();
List
<
EntrustReport
>
updateReportList
=
new
ArrayList
<>();
for
(
EntrustReport
report
:
reportList
)
{
InputStream
io
=
ossClient
.
download
(
report
.
getObjectKey
());
InputStream
io
=
ossClient
.
download
(
report
.
getObjectKey
());
if
(
null
==
io
)
continue
;
File
file
=
LabreOfficeUtil
.
inputStream2File
(
io
);
File
filePdf
=
LabreOfficeUtil
.
convertOffice2PDF
(
libreOfficeUrl
,
file
);
File
filePdf
=
LabreOfficeUtil
.
convertOffice2PDF
(
libreOfficeUrl
,
file
);
deleteFileList
.
add
(
file
);
deleteFileList
.
add
(
filePdf
);
...
...
@@ -186,7 +182,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
u
.
setId
(
report
.
getId
());
updateReportList
.
add
(
u
);
}
if
(
CollectionUtils
.
isNotEmpty
(
updateReportList
)){
if
(
CollectionUtils
.
isNotEmpty
(
updateReportList
))
{
updateBatchById
(
updateReportList
);
}
FileUtils
.
deleteFiles
(
deleteFileList
);
...
...
@@ -201,12 +197,17 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
return
entrustService
.
getById
(
report
.
getEntrustId
());
}
private
boolean
executeSubmitOperation
(
Entrust
entrust
,
Account
account
)
{
if
(
StringUtils
.
isBlank
(
entrust
.
getStatusPath
()))
{
logger
.
error
(
"委托为空,或者委托路径为空不进行下一步操作"
);
return
false
;
private
boolean
isToStatusPath
(
Entrust
entrust
)
{
return
StringUtils
.
isNotBlank
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
())
?
true
:
false
;
}
private
boolean
executeSubmitOperation
(
Entrust
entrust
,
EntrustFlowEnum
fromFlowStatus
,
EntrustFlowEnum
toFlowStatus
,
Account
account
)
{
if
(
isToStatusPath
(
entrust
))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
String
remark
=
(
fromFlowStatus
.
getValue
()
<
toFlowStatus
.
getValue
()
?
"提交至"
:
"驳回至"
)
+
toFlowStatus
.
getDisplay
();
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
fromFlowStatus
.
getDisplay
(),
toFlowStatus
.
getDisplay
(),
0
,
account
,
remark
);
}
return
true
;
}
...
...
@@ -237,7 +238,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
// 存在的状态路径时,方可进入处理操作
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
account
);
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
EntrustFlowEnum
.
REPORT_CHECK
,
EntrustFlowEnum
.
REPORT_ALLOW
,
account
);
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
...
...
@@ -272,7 +273,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
Entrust
entrust
=
getByReportId
(
ids
[
0
]);
entrust
.
setTestTimeE
(
new
Date
());
entrustService
.
updateById
(
entrust
);
executeSubmitOperation
(
entrust
,
account
);
executeSubmitOperation
(
entrust
,
EntrustFlowEnum
.
REPORT_ALLOW
,
EntrustFlowEnum
.
REPORT_SEND
,
account
);
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
...
...
@@ -309,7 +310,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
entrust
.
setTestTimeE
(
new
Date
());
entrustService
.
updateById
(
entrust
);
executeSubmitOperation
(
entrust
,
account
);
executeSubmitOperation
(
entrust
,
EntrustFlowEnum
.
REPORT_ALLOW
,
EntrustFlowEnum
.
REPORT_ISSUE
,
account
);
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
...
...
@@ -340,7 +341,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
// 存在的状态路径时,方可进入处理操作
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
account
);
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
EntrustFlowEnum
.
REPORT_SEND
,
EntrustFlowEnum
.
QUALITY_JUDGE
,
account
);
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
...
...
@@ -371,7 +372,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
// 存在的状态路径时,方可进入处理操作
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
account
);
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
EntrustFlowEnum
.
REPORT_ISSUE
,
EntrustFlowEnum
.
QUALITY_JUDGE
,
account
);
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
...
...
@@ -389,13 +390,14 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
private
void
rejectEntrustInfo
(
Long
[]
reportIds
,
String
reason
,
EntrustReportStatusEnum
reportStatusEnum
,
Account
account
)
{
List
<
EntrustReport
>
reports
=
baseMapper
.
selectBatchIds
(
Arrays
.
asList
(
reportIds
));
Map
<
Long
,
EntrustReport
>
reportMap
=
reports
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
getEntrustId
(),
t
->
t
));
List
<
Long
>
entrustIds
=
reports
.
stream
().
map
(
t
->
t
.
getEntrustId
()).
collect
(
Collectors
.
toList
());
List
<
Entrust
>
entrustList
=
entrustService
.
getBatchIds
(
entrustIds
);
entrustList
.
stream
().
forEach
(
t
->
{
if
(
StringUtils
.
isNotBlank
(
t
.
getStatusPath
()
))
{
if
(
isToStatusPath
(
t
))
{
entrustService
.
rejectToPrevNode
(
t
,
reason
,
account
);
}
else
{
rejectByReportStatus
(
t
,
reportStatusEnum
,
account
);
rejectByReportStatus
(
t
,
report
Map
.
get
(
t
.
getId
()),
report
StatusEnum
,
account
);
}
});
}
...
...
@@ -407,7 +409,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
* @param reportStatus
* @param account
*/
private
void
rejectByReportStatus
(
Entrust
entrust
,
EntrustReportStatusEnum
reportStatus
,
Account
account
)
{
private
void
rejectByReportStatus
(
Entrust
entrust
,
EntrustReport
entrustReport
,
EntrustReport
StatusEnum
reportStatus
,
Account
account
)
{
EntrustSample
entrustSample
=
new
EntrustSample
();
EntrustSampleStatusEnum
sampleStatusEnum
=
null
;
...
...
@@ -427,6 +429,9 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
entrustSample
.
setStatus
(
sampleStatusEnum
);
entrustSample
.
setProgress
(
sampleStatusEnum
);
entrustSampleService
.
update
(
entrustSample
,
Condition
.
create
().
eq
(
"entrust_id"
,
entrust
.
getId
()));
if
(
null
!=
entrustReport
)
{
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
entrustReport
.
getStatus
().
getDisplay
(),
sampleStatusEnum
.
getDisplay
(),
2
,
account
,
"退回至"
+
sampleStatusEnum
.
getDisplay
());
}
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
95585259
...
...
@@ -13,6 +13,7 @@ import com.patzn.cloud.oss.starter.OssClient;
import
com.patzn.cloud.oss.starter.OssFileResult
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.entity.*
;
import
com.patzn.cloud.service.hmhj.enums.EntrustFlowEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustSampleItemStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustSampleStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustStatusEnum
;
...
...
@@ -86,7 +87,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
private
IItemDeviateService
itemDeviateService
;
@Autowired
private
IItemRelOriginalRecordService
itemRelOriginalRecordService
;
...
...
@@ -118,8 +118,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
String
name
=
entrustSampleItem
.
getName
();
entrustSampleItem
.
setName
(
null
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustSampleItem
);
if
(
StringUtils
.
isNotBlank
(
name
))
{
wrapper
.
like
(
"name"
,
name
);
if
(
StringUtils
.
isNotBlank
(
name
))
{
wrapper
.
like
(
"name"
,
name
);
}
return
this
.
page
(
page
,
wrapper
);
}
...
...
@@ -162,22 +162,28 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 判定是否委托下的检测项目都已分配
Entrust
entrust
=
getEntrustByItemId
(
ids
[
0
]);
if
(
null
!=
entrust
&&
isAllocatedByEntrustId
(
entrust
.
getId
())
&&
StringUtils
.
isNotBlank
(
entrust
.
getStatusPath
())){
entrustService
.
submitToNextNode
(
entrust
,
account
);
if
(
null
!=
entrust
&&
isAllocatedByEntrustId
(
entrust
.
getId
()))
{
// 添加流程数据录入节点
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
TEST
.
getName
());
if
(
StringUtils
.
isNotBlank
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
()))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
"任务分配"
,
"数据录入"
,
0
,
account
,
"提交至数据录入"
);
}
}
return
true
;
}
private
Entrust
getEntrustByItemId
(
Long
itemId
){
if
(
null
==
itemId
)
{
private
Entrust
getEntrustByItemId
(
Long
itemId
)
{
if
(
null
==
itemId
)
{
return
null
;
}
EntrustSampleItem
entrustSampleItem
=
baseMapper
.
selectById
(
itemId
);
if
(
null
==
entrustSampleItem
)
{
if
(
null
==
entrustSampleItem
)
{
return
null
;
}
EntrustSample
entrustSample
=
entrustSampleService
.
getById
(
entrustSampleItem
.
getEntrustSampleId
());
if
(
null
==
entrustSample
||
null
==
entrustSample
.
getEntrustId
())
{
if
(
null
==
entrustSample
||
null
==
entrustSample
.
getEntrustId
())
{
return
null
;
}
return
entrustService
.
getById
(
entrustSample
.
getEntrustId
());
...
...
@@ -265,23 +271,23 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
entrustSampleService
.
update
(
sample
,
Condition
.
create
().
eq
(
"entrust_id"
,
entrustId
));
// 提交到下一节点,可能是不更改状态
if
(
isConfigureStatusPath
(
entrust
))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
if
(
isConfigureStatusPath
(
entrust
))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
return
true
;
}
// 样品操作日志
// 暂时不提供
// 修改委托信息
entrust
.
setLid
(
account
.
getUserId
()).
setLtime
(
new
Date
()).
setProgress
(
EntrustStatusEnum
.
TEST
).
setStatus
(
EntrustStatusEnum
.
TEST
);
entrust
.
setLid
(
account
.
getUserId
()).
setLtime
(
new
Date
()).
set
FlowStatus
(
EntrustFlowEnum
.
REPORT_MAKE
.
getName
()).
set
Progress
(
EntrustStatusEnum
.
TEST
).
setStatus
(
EntrustStatusEnum
.
TEST
);
entrustService
.
updateById
(
entrust
);
// 添加委托日志
entrustRecordService
.
record
(
new
Long
[]{
entrustId
},
EntrustStatusEnum
.
TEST
.
getDisplay
(),
EntrustStatusEnum
.
TEST
.
getDisplay
()
,
0
,
account
,
"提交至报告编制"
);
entrustRecordService
.
record
(
new
Long
[]{
entrustId
},
"数据录入"
,
"报告编制"
,
0
,
account
,
"提交至报告编制"
);
//执行转PDF操作
executor1
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
changeExcelToPdf
(
ids
,
list
);
changeExcelToPdf
(
ids
,
list
);
}
});
...
...
@@ -289,15 +295,15 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
public
void
changeExcelToPdf
(
Long
[]
ids
,
List
<
EntrustSampleItem
>
list
)
{
List
<
ItemRelOriginalRecord
>
recordList
=
itemRelOriginalRecordService
.
list
(
Condition
.
create
().
setSqlSelect
(
"record_id"
).
in
(
"item_id"
,
ids
).
isNotNull
(
"record_id"
).
groupBy
(
"record_id"
));
public
void
changeExcelToPdf
(
Long
[]
ids
,
List
<
EntrustSampleItem
>
list
)
{
List
<
ItemRelOriginalRecord
>
recordList
=
itemRelOriginalRecordService
.
list
(
Condition
.
create
().
setSqlSelect
(
"record_id"
).
in
(
"item_id"
,
ids
).
isNotNull
(
"record_id"
).
groupBy
(
"record_id"
));
if
(
CollectionUtils
.
isEmpty
(
recordList
))
return
;
List
<
Long
>
recordsList
=
recordList
.
stream
().
map
(
r
->
{
List
<
Long
>
recordsList
=
recordList
.
stream
().
map
(
r
->
{
return
r
.
getRecordId
();
}).
collect
(
Collectors
.
toList
());
List
<
OriginalRecord
>
originalRecordList
=
originalRecordService
.
list
(
Condition
.
create
().
in
(
"id"
,
recordList
).
isNull
(
"pdf_object_key"
));
List
<
OriginalRecord
>
originalRecordList
=
originalRecordService
.
list
(
Condition
.
create
().
in
(
"id"
,
recordList
).
isNull
(
"pdf_object_key"
));
if
(
CollectionUtils
.
isEmpty
(
originalRecordList
))
return
;
...
...
@@ -312,7 +318,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
for
(
OriginalRecord
record
:
originalRecordList
)
{
InputStream
io
=
ossClient
.
download
(
record
.
getObjectKey
());
File
file
=
LabreOfficeUtil
.
inputStream2File
(
io
);
File
filePdf
=
LabreOfficeUtil
.
convertOffice2PDF
(
libreOfficeUrl
,
file
);
File
filePdf
=
LabreOfficeUtil
.
convertOffice2PDF
(
libreOfficeUrl
,
file
);
OssFileResult
fileResult
=
ossClient
.
upload
(
filePdf
);
...
...
@@ -323,7 +329,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
deleteFileList
.
add
(
file
);
deleteFileList
.
add
(
filePdf
);
}
if
(
CollectionUtils
.
isNotEmpty
(
updateList
)){
if
(
CollectionUtils
.
isNotEmpty
(
updateList
))
{
originalRecordService
.
updateBatchById
(
updateList
);
}
FileUtils
.
deleteFiles
(
deleteFileList
);
...
...
@@ -331,8 +337,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
submitCheck
(
Long
[]
ids
,
Account
account
)
{
...
...
@@ -477,7 +481,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
Map
<
String
,
String
>
mapReplace
=
new
HashMap
<>();
mapReplace
.
put
(
"#{nowDate}"
,
DateUtils
.
toYearMonthDay
(
new
Date
()));
mapReplace
.
put
(
"#{sampleNum}"
,
entrustSampleService
.
countByEntrustId
(
entrust
.
getId
())
+
""
);
mapReplace
.
put
(
"#{sampleNum}"
,
entrustSampleService
.
countByEntrustId
(
entrust
.
getId
())
+
""
);
if
(
null
!=
template
.
getMoreItem
()
&&
1
==
template
.
getMoreItem
())
{
Set
<
Long
>
sampleIdsList
=
new
HashSet
<>();
...
...
@@ -485,9 +489,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
sampleIdsList
.
add
(
itemVO
.
getEntrustSampleId
());
}
List
<
EntrustSample
>
sampleList
=
entrustSampleService
.
list
(
Condition
.
create
().
in
(
"id"
,
sampleIdsList
));
if
(
CollectionUtils
.
isNotEmpty
(
sampleList
)){
mapReplace
.
put
(
"#{sampleFrom}"
,
sampleList
.
get
(
0
).
getSampleFrom
());
mapReplace
.
put
(
"#{sampleName}"
,
sampleList
.
get
(
0
).
getName
());
if
(
CollectionUtils
.
isNotEmpty
(
sampleList
))
{
mapReplace
.
put
(
"#{sampleFrom}"
,
sampleList
.
get
(
0
).
getSampleFrom
());
mapReplace
.
put
(
"#{sampleName}"
,
sampleList
.
get
(
0
).
getName
());
}
List
<
EntrustSampleVO
>
sampleVOList
=
new
ArrayList
<>(
sampleList
.
size
());
...
...
@@ -512,9 +516,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
else
{
if
(
CollectionUtils
.
isNotEmpty
(
voList
)){
mapReplace
.
put
(
"#{sampleFrom}"
,
voList
.
get
(
0
).
getSampleFrom
());
mapReplace
.
put
(
"#{sampleName}"
,
voList
.
get
(
0
).
getSampleName
());
if
(
CollectionUtils
.
isNotEmpty
(
voList
))
{
mapReplace
.
put
(
"#{sampleFrom}"
,
voList
.
get
(
0
).
getSampleFrom
());
mapReplace
.
put
(
"#{sampleName}"
,
voList
.
get
(
0
).
getSampleName
());
}
OriginalFactory
factory
=
new
OriginalFactory
(
template
,
voList
,
entrust
,
configList
,
xssfWorkbook
);
...
...
@@ -525,8 +529,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
0
);
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
0
);
FileOutputStream
os
=
null
;
File
file
=
null
;
...
...
@@ -812,15 +815,15 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
@Override
public
boolean
isAllocatedByEntrustId
(
Long
entrustId
){
if
(
null
==
entrustId
||
0
l
==
entrustId
.
longValue
())
{
public
boolean
isAllocatedByEntrustId
(
Long
entrustId
)
{
if
(
null
==
entrustId
||
0
l
==
entrustId
.
longValue
())
{
return
false
;
}
return
baseMapper
.
selectUnallocatedCountByEntrustId
(
entrustId
)
==
0
;
}
private
boolean
isConfigureStatusPath
(
Entrust
entrust
){
return
StringUtils
.
is
Blank
(
entrust
.
getStatusPath
())
?
false
:
tru
e
;
private
boolean
isConfigureStatusPath
(
Entrust
entrust
)
{
return
StringUtils
.
is
NotBlank
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
())
?
true
:
fals
e
;
}
@Override
...
...
@@ -828,17 +831,17 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
Page
<
LmsUserRelGroup
>
relGroupPage
=
lmsUserRelGroupClient
.
getPageUser
(
userRelGroup
).
serviceData
();
List
<
LmsUserRelGroup
>
groupList
=
relGroupPage
.
getRecords
();
if
(
CollectionUtils
.
isEmpty
(
groupList
)){
if
(
CollectionUtils
.
isEmpty
(
groupList
))
{
return
page
;
}
List
<
Long
>
userIdsList
=
groupList
.
stream
().
map
(
r
->
{
List
<
Long
>
userIdsList
=
groupList
.
stream
().
map
(
r
->
{
return
r
.
getUserId
();
}).
collect
(
Collectors
.
toList
());
/* 检测中的所有项目 */
List
<
EntrustSampleItem
>
experimentList
=
super
.
list
(
Condition
.
create
().
in
(
"tester_id"
,
userIdsList
).
eq
(
"status"
,
EntrustSampleItemStatusEnum
.
TEST
));
List
<
EntrustSampleItem
>
experimentList
=
super
.
list
(
Condition
.
create
().
in
(
"tester_id"
,
userIdsList
).
eq
(
"status"
,
EntrustSampleItemStatusEnum
.
TEST
));
/* 未检测 -- 还未填写原始记录 */
List
<
EntrustSampleItem
>
notTestingItems
=
experimentList
.
stream
().
filter
(
item
->
isNotTesting
(
item
)).
collect
(
Collectors
.
toList
());
...
...
@@ -849,23 +852,23 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
List
<
LmsUserRelGroupVO
>
groupVOS
=
new
ArrayList
<>();
for
(
LmsUserRelGroup
group
:
groupList
)
{
for
(
LmsUserRelGroup
group
:
groupList
)
{
LmsUserRelGroupVO
vo
=
group
.
convert
(
LmsUserRelGroupVO
.
class
);
int
num
=
0
,
notTestingNum
=
0
,
TestedNum
=
0
;
for
(
EntrustSampleItem
experiment
:
experimentList
)
{
if
(
experiment
.
getTesterId
().
equals
(
group
.
getUserId
())){
int
num
=
0
,
notTestingNum
=
0
,
TestedNum
=
0
;
for
(
EntrustSampleItem
experiment
:
experimentList
)
{
if
(
experiment
.
getTesterId
().
equals
(
group
.
getUserId
()))
{
num
++;
}
}
/* 未检测 */
for
(
EntrustSampleItem
notTestingItem
:
notTestingItems
)
{
if
(
notTestingItem
.
getTesterId
().
equals
(
group
.
getUserId
())){
if
(
notTestingItem
.
getTesterId
().
equals
(
group
.
getUserId
()))
{
notTestingNum
++;
}
}
/* 已完成 */
for
(
EntrustSampleItem
notTestingItem
:
TestedItem
)
{
if
(
notTestingItem
.
getTesterId
().
equals
(
group
.
getUserId
())){
if
(
notTestingItem
.
getTesterId
().
equals
(
group
.
getUserId
()))
{
TestedNum
++;
}
}
...
...
@@ -882,12 +885,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
@Override
public
List
<
TesterWorkloadStatsVO
>
getTesterWorkloadStatusQuery
(
QueryDTO
queryDTO
){
public
List
<
TesterWorkloadStatsVO
>
getTesterWorkloadStatusQuery
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectTesterWorkloadStatus
(
queryDTO
);
}
@Override
public
List
<
EntrustSampleCalcResultVO
>
getSampleCalcResult
(
QueryDTO
queryDTO
){
public
List
<
EntrustSampleCalcResultVO
>
getSampleCalcResult
(
QueryDTO
queryDTO
)
{
return
baseMapper
.
selectSampleCalcResult
(
queryDTO
);
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSamplePrepareServiceImpl.java
View file @
95585259
...
...
@@ -53,6 +53,10 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
@Autowired
private
IEntrustService
entrustService
;
@Autowired
private
IEntrustRecordService
entrustRecordService
;
@Override
public
Page
<
EntrustSamplePrepare
>
page
(
Page
<
EntrustSamplePrepare
>
page
,
EntrustSamplePrepare
entrustSamplePrepare
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustSamplePrepare
);
...
...
@@ -67,13 +71,13 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
@Override
public
boolean
removeBySampleIds
(
Long
[]
sampleIds
)
{
if
(
null
==
sampleIds
||
sampleIds
.
length
==
0
)
{
if
(
null
==
sampleIds
||
sampleIds
.
length
==
0
)
{
return
false
;
}
Account
account
=
LoginHelper
.
getAccount
();
EntrustSamplePrepare
samplePrepare
=
new
EntrustSamplePrepare
();
samplePrepare
.
setDeleted
(
1
).
setLid
(
account
.
getUserId
()).
setLtime
(
new
Date
());
return
update
(
samplePrepare
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
).
eq
(
"deleted"
,
0
));
return
update
(
samplePrepare
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
).
eq
(
"deleted"
,
0
));
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -91,7 +95,7 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
List
<
EntrustSampleBackup
>
saveBackupList
=
new
ArrayList
<>();
for
(
EntrustSampleVO
vo
:
sampleVOList
)
{
if
(
"送检样"
.
equalsIgnoreCase
(
vo
.
getMakeType
())){
if
(
"送检样"
.
equalsIgnoreCase
(
vo
.
getMakeType
()))
{
EntrustSamplePrepare
prepare
=
vo
.
convert
(
EntrustSamplePrepare
.
class
);
prepare
.
setEntrustSampleId
(
vo
.
getEntrustSampleId
());
prepare
.
setStatus
(
EntrustSamplePrepareStatusEnum
.
RECEIVE
);
...
...
@@ -102,7 +106,7 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
// 主要用来修改委托的复合型检测信息
EntrustSample
entrustSample
=
vo
.
convert
(
EntrustSample
.
class
);
entrustSampleService
.
updateById
(
entrustSample
);
}
else
if
(
"备样"
.
equalsIgnoreCase
(
vo
.
getMakeType
()))
{
}
else
if
(
"备样"
.
equalsIgnoreCase
(
vo
.
getMakeType
()))
{
EntrustSampleBackup
backup
=
new
EntrustSampleBackup
();
EntrustSample
sample
=
entrustSampleService
.
getById
(
vo
.
getId
());
backup
.
setEntrustId
(
vo
.
getEntrustId
());
...
...
@@ -130,7 +134,6 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
}).
collect
(
Collectors
.
toList
());
for
(
EntrustSample
sample
:
sampleList
)
{
if
(
haveSampleIds
.
contains
(
sample
.
getId
()))
{
continue
;
...
...
@@ -151,7 +154,6 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
// saveBackupList.add(backup);
// 添加样品管理数据
EntrustSampleBackup
manage
=
new
EntrustSampleBackup
();
BeanUtils
.
copyProperties
(
backup
,
manage
);
...
...
@@ -187,7 +189,7 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
// updateEntrust.setId(entrust.getId());
// entrustService.updateById(updateEntrust);
// 根据流程状态提交
if
(
StringUtils
.
isNotEmpty
(
entrust
.
getStatusPath
()))
{
if
(
StringUtils
.
isNotEmpty
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
())
)
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
Entrust
updateEntrust
=
new
Entrust
();
...
...
@@ -196,8 +198,7 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
updateEntrust
.
setFlowStatus
(
EntrustFlowEnum
.
RECEIVE
.
getName
());
updateEntrust
.
setId
(
entrust
.
getId
());
entrustService
.
updateById
(
updateEntrust
);
// String remark = "提交至样品接收", title = "新的样品接收任务!";
// entrustRecordService.record(new Long[]{entrust.getId()}, status.getDisplay(), nextStatus.getDisplay(), 0, account, remark);
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
"样品制备"
,
"样品接收"
,
0
,
account
,
"提交至样品接收"
);
}
}
...
...
@@ -225,7 +226,7 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
EntrustSample
entrustSample
=
entrustSampleService
.
getById
(
prepareList
.
get
(
0
).
getEntrustSampleId
());
Entrust
entrust
=
entrustService
.
getById
(
entrustSample
.
getEntrustId
());
if
(
null
==
entrust
.
getTestAddress
())
{
if
(
null
==
entrust
.
getTestAddress
())
{
// entrust.setReceiveTime(new Date());
}
...
...
@@ -262,11 +263,13 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
if
(
CollectionUtils
.
isEmpty
(
notOkSampleIds
))
{
// 检测开始时间为接收时间
entrust
.
setTestTimeS
(
new
Date
());
if
(
StringUtils
.
isNotEmpty
(
entrust
.
getStatusPath
()))
{
if
(
StringUtils
.
isNotEmpty
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
())
)
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
}
else
{
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
TEST
.
getName
());
entrustService
.
updateById
(
entrust
);
// 添加委托操作记录
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
"样品接收"
,
"任务分配"
,
0
,
account
,
"提交至任务分配"
);
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
95585259
...
...
@@ -386,9 +386,6 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
}
else
if
(
nextFlowStatus
==
EntrustFlowEnum
.
QUALITY_JUDGE
)
{
sampleStatus
=
EntrustSampleStatusEnum
.
END
;
itemStatus
=
EntrustSampleItemStatusEnum
.
END
;
}
else
if
(
nextFlowStatus
==
EntrustFlowEnum
.
QUALITY_CHECK
)
{
sampleStatus
=
EntrustSampleStatusEnum
.
END
;
itemStatus
=
EntrustSampleItemStatusEnum
.
END
;
}
if
(
null
!=
sampleStatus
)
{
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
95585259
...
...
@@ -350,7 +350,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
boolean
hasSendMessage
=
false
;
for
(
Entrust
e
:
entrustList
)
{
// 若存在路径,根据状态路径处理数据
if
(
StringUtils
.
isNotBlank
(
e
.
getStatusPath
()))
{
if
(
StringUtils
.
isNotBlank
(
e
.
getStatusPath
())
&&
e
.
getStatusPath
().
contains
(
e
.
getFlowStatus
())
)
{
submitToNextNode
(
e
,
account
);
hasSendMessage
=
true
;
}
else
{
...
...
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