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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
45 deletions
+50
-45
EntrustReportServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustReportServiceImpl.java
+34
-29
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+0
-0
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
());
if
(
null
==
io
)
continue
;
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
);
}
entrustService
.
submitToNextNode
(
entrust
,
account
);
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
This diff is collapsed.
Click to expand it.
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