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
ab2b5a8b
Commit
ab2b5a8b
authored
Jul 22, 2021
by
ghxdhr
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.patzn.com:wangweidong/patzn-cloud-service-hmhj
parents
d8cd9aa2
b4a6fac3
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
77 deletions
+77
-77
IEntrustSamplePrepareService.java
...rvice/lims/hmhj/service/IEntrustSamplePrepareService.java
+2
-0
IEntrustService.java
...atzn/cloud/service/lims/hmhj/service/IEntrustService.java
+3
-0
EntrustReportServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustReportServiceImpl.java
+45
-62
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+3
-7
EntrustSamplePrepareServiceImpl.java
...ms/hmhj/service/impl/EntrustSamplePrepareServiceImpl.java
+4
-5
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+16
-1
OriginalTemplateServiceImpl.java
...e/lims/hmhj/service/impl/OriginalTemplateServiceImpl.java
+4
-2
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSamplePrepareService.java
View file @
ab2b5a8b
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.plugins.Page;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.dto.SamplePrepareDTO
;
import
com.patzn.cloud.service.hmhj.entity.Entrust
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSample
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSamplePrepare
;
import
com.patzn.cloud.service.hmhj.enums.EntrustSampleItemStatusEnum
;
...
...
@@ -30,4 +31,5 @@ public interface IEntrustSamplePrepareService extends IBaseService<EntrustSample
boolean
addOrUpdateToSetStatus
(
Long
[]
sampleIds
,
EntrustSamplePrepareStatusEnum
statusEnum
);
boolean
removeBySampleIds
(
Long
[]
sampleIds
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustService.java
View file @
ab2b5a8b
...
...
@@ -99,4 +99,7 @@ public interface IEntrustService extends IBaseService<Entrust> {
Boolean
saveOutEntrust
(
EntrustDTO
dto
,
Account
account
);
boolean
isCanIntoNextNode
(
Entrust
entrust
);
boolean
isCanIntoPrevNode
(
Entrust
entrust
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustReportServiceImpl.java
View file @
ab2b5a8b
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.toolkit.ArrayUtils
;
import
com.baomidou.mybatisplus.toolkit.CollectionUtils
;
import
com.google.common.collect.Lists
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.
controller.LoginHelper
;
import
com.patzn.cloud.commons.
service.impl.BaseServiceImpl
;
import
com.patzn.cloud.commons.toolkit.FileUtils
;
import
com.patzn.cloud.feign.base.client.SysUserClient
;
import
com.patzn.cloud.oss.starter.OssClient
;
import
com.patzn.cloud.oss.starter.OssFileResult
;
import
com.patzn.cloud.service.base.entity.SysOrg
;
import
com.patzn.cloud.service.base.vo.SysOrgVO
;
import
com.patzn.cloud.service.base.vo.SysUserOrgVO
;
import
com.patzn.cloud.service.hmhj.entity.Entrust
;
import
com.patzn.cloud.service.hmhj.entity.EntrustReport
;
import
com.patzn.cloud.service.hmhj.entity.EntrustReportRelSample
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSample
;
import
com.patzn.cloud.service.hmhj.enums.*
;
import
com.patzn.cloud.service.hmhj.enums.EntrustFlowEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustReportStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustSampleStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustStatusEnum
;
import
com.patzn.cloud.service.hmhj.vo.EntrustReportVO
;
import
com.patzn.cloud.service.lims.hmhj.common.EntrustFlowUtils
;
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.*
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.File
;
...
...
@@ -64,17 +63,12 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
@Autowired
private
SysUserClient
sysUserClient
;
@Autowired
private
IEntrustReportRecordService
entrustReportRecordService
;
@Value
(
"${libreOffice.url}"
)
private
String
libreOfficeUrl
;
@Override
public
Page
<
EntrustReport
>
page
(
Page
<
EntrustReport
>
page
,
EntrustReport
entrustReport
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustReport
);
return
this
.
page
(
page
,
wrapper
);
return
this
.
page
(
page
,
new
EntityWrapper
<>(
entrustReport
));
}
@Override
...
...
@@ -84,7 +78,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
@Override
public
Page
<
EntrustReport
>
pageStatus
(
Page
<
EntrustReport
>
page
,
List
<
EntrustReportStatusEnum
>
reportStatusList
,
EntrustReport
entrustReport
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustReport
);
Wrapper
<
EntrustReport
>
wrapper
=
new
EntityWrapper
<>(
entrustReport
);
if
(
CollectionUtils
.
isNotEmpty
(
reportStatusList
))
{
wrapper
.
in
(
"status"
,
reportStatusList
);
}
...
...
@@ -96,9 +90,9 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustReportVO
);
List
<
SysUserOrgVO
>
userOrgVOList
=
sysUserClient
.
getUserOrg
(
Arrays
.
as
List
(
account
.
getUserId
())).
serviceData
();
List
<
SysUserOrgVO
>
userOrgVOList
=
sysUserClient
.
getUserOrg
(
Collections
.
singleton
List
(
account
.
getUserId
())).
serviceData
();
// 为空或者不包含质检中心的部门,需要根据当前用户查询对应的委托
if
(
CollectionUtils
.
isEmpty
(
userOrgVOList
)
||
userOrgVOList
.
stream
().
filter
(
t
->
t
.
getOrgName
().
contains
(
"质检中心"
)).
count
()
==
0
)
{
if
(
CollectionUtils
.
isEmpty
(
userOrgVOList
)
||
userOrgVOList
.
stream
().
noneMatch
(
t
->
t
.
getOrgName
().
contains
(
"质检中心"
))
)
{
wrapper
.
exists
(
"select 1 from entrust e where e.deleted = 0 and e.id = entrust_id and e.uid = "
+
account
.
getUserId
());
}
return
this
.
page
(
page
,
wrapper
);
...
...
@@ -173,9 +167,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
List
<
EntrustReportRelSample
>
relSamples
=
entrustReportRelSampleService
.
list
(
Condition
.
create
().
in
(
"report_id"
,
ids
));
if
(
CollectionUtils
.
isNotEmpty
(
relSamples
))
{
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
s
->
{
return
s
.
getSampleId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
EntrustReportRelSample:
:
getSampleId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
sampleIds
))
{
EntrustSample
sample
=
new
EntrustSample
();
...
...
@@ -189,14 +181,6 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
// 存在的状态路径时,方可进入处理操作
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
EntrustFlowEnum
.
REPORT_MAKE
,
EntrustFlowEnum
.
REPORT_CHECK
,
account
);
//转化PDF
executor1
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
changeExcelReportToPdf
(
ids
);
}
});
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
...
...
@@ -238,12 +222,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
return
entrustService
.
getById
(
report
.
getEntrustId
());
}
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
))
{
private
void
executeSubmitOperation
(
Entrust
entrust
,
EntrustFlowEnum
fromFlowStatus
,
EntrustFlowEnum
toFlowStatus
,
Account
account
)
{
if
(
entrustService
.
isCanIntoNextNode
(
entrust
))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
String
remark
=
(
fromFlowStatus
.
getValue
()
<
toFlowStatus
.
getValue
()
?
"提交至"
:
"驳回至"
)
+
toFlowStatus
.
getDisplay
();
...
...
@@ -261,7 +241,6 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
fromFlowStatus
.
getDisplay
(),
toFlowStatus
.
getDisplay
(),
0
,
account
,
remark
);
}
return
true
;
}
...
...
@@ -277,9 +256,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
List
<
EntrustReportRelSample
>
relSamples
=
entrustReportRelSampleService
.
list
(
Condition
.
create
().
in
(
"report_id"
,
ids
));
if
(
CollectionUtils
.
isNotEmpty
(
relSamples
))
{
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
s
->
{
return
s
.
getSampleId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
EntrustReportRelSample:
:
getSampleId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
sampleIds
))
{
EntrustSample
sample
=
new
EntrustSample
();
...
...
@@ -296,12 +273,24 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
private
void
judgeStatusPath
(
Entrust
entrust
,
EntrustFlowEnum
nextStatus
)
{
RestAssert
.
fail
(
null
==
entrust
,
"委托信息为空"
);
String
statusPath
=
entrust
.
getStatusPath
();
// 为空,或者路径中不包含当前流程状态
if
(
StringUtils
.
isBlank
(
statusPath
)
||
!
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
()))
{
return
;
}
EntrustFlowEnum
nextFlowStatus
=
EntrustFlowUtils
.
getNextFlowStatus
(
entrust
.
getFlowStatus
(),
statusPath
);
// RestAssert.fail(null == nextFlowStatus,"状态路径配置的下一流程节点为空,无法进行下一步");
RestAssert
.
fail
(
null
!=
nextFlowStatus
&&
nextFlowStatus
!=
nextStatus
,
String
.
format
(
"状态路径配置的下一节点为【%s】,无法进行下一步"
,
nextFlowStatus
.
getDisplay
()));
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
submitFromAllowToSend
(
Long
[]
ids
,
Account
account
)
{
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要提交的报告"
);
Entrust
entrust
=
getByReportId
(
ids
[
0
]);
judgeStatusPath
(
entrust
,
EntrustFlowEnum
.
REPORT_SEND
);
EntrustReport
report
=
new
EntrustReport
();
report
.
setStatus
(
EntrustReportStatusEnum
.
SEND
);
report
.
setProgress
(
EntrustReportStatusEnum
.
SEND
);
...
...
@@ -309,9 +298,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
List
<
EntrustReportRelSample
>
relSamples
=
entrustReportRelSampleService
.
list
(
Condition
.
create
().
in
(
"report_id"
,
ids
));
if
(
CollectionUtils
.
isNotEmpty
(
relSamples
))
{
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
s
->
{
return
s
.
getSampleId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
EntrustReportRelSample:
:
getSampleId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
sampleIds
))
{
EntrustSample
sample
=
new
EntrustSample
();
...
...
@@ -323,11 +310,11 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
// 存在的状态路径时,方可进入处理操作
Entrust
entrust
=
getByReportId
(
ids
[
0
]);
entrust
.
setTestTimeE
(
new
Date
());
entrustService
.
updateById
(
entrust
);
executeSubmitOperation
(
entrust
,
EntrustFlowEnum
.
REPORT_ALLOW
,
EntrustFlowEnum
.
REPORT_SEND
,
account
);
//转化PDF
executor1
.
execute
(()
->
changeExcelReportToPdf
(
ids
));
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
...
...
@@ -336,7 +323,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
@Override
public
boolean
submitFromAllowToIssue
(
Long
[]
ids
,
Account
account
)
{
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要提交的报告"
);
Entrust
entrust
=
getByReportId
(
ids
[
0
]);
judgeStatusPath
(
entrust
,
EntrustFlowEnum
.
REPORT_ISSUE
);
EntrustReport
report
=
new
EntrustReport
();
report
.
setStatus
(
EntrustReportStatusEnum
.
ISSUE
);
report
.
setProgress
(
EntrustReportStatusEnum
.
ISSUE
);
...
...
@@ -344,9 +332,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
List
<
EntrustReportRelSample
>
relSamples
=
entrustReportRelSampleService
.
list
(
Condition
.
create
().
in
(
"report_id"
,
ids
));
if
(
CollectionUtils
.
isNotEmpty
(
relSamples
))
{
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
s
->
{
return
s
.
getSampleId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
EntrustReportRelSample:
:
getSampleId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
sampleIds
))
{
EntrustSample
sample
=
new
EntrustSample
();
...
...
@@ -358,13 +344,13 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
// 存在的状态路径时,方可进入处理操作
Entrust
entrust
=
getByReportId
(
ids
[
0
]);
// 报告批准,获取当前时间为检测结束时间
entrust
.
setTestTimeE
(
new
Date
());
entrustService
.
updateById
(
entrust
);
executeSubmitOperation
(
entrust
,
EntrustFlowEnum
.
REPORT_ALLOW
,
EntrustFlowEnum
.
REPORT_ISSUE
,
account
);
//转化PDF
executor1
.
execute
(()
->
changeExcelReportToPdf
(
ids
));
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
...
...
@@ -380,9 +366,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
List
<
EntrustReportRelSample
>
relSamples
=
entrustReportRelSampleService
.
list
(
Condition
.
create
().
in
(
"report_id"
,
ids
));
if
(
CollectionUtils
.
isNotEmpty
(
relSamples
))
{
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
s
->
{
return
s
.
getSampleId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
EntrustReportRelSample:
:
getSampleId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
sampleIds
))
{
EntrustSample
sample
=
new
EntrustSample
();
...
...
@@ -411,9 +395,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
List
<
EntrustReportRelSample
>
relSamples
=
entrustReportRelSampleService
.
list
(
Condition
.
create
().
in
(
"report_id"
,
ids
));
if
(
CollectionUtils
.
isNotEmpty
(
relSamples
))
{
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
s
->
{
return
s
.
getSampleId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleIds
=
relSamples
.
stream
().
map
(
EntrustReportRelSample:
:
getSampleId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
sampleIds
))
{
EntrustSample
sample
=
new
EntrustSample
();
...
...
@@ -443,11 +425,11 @@ 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
());
Map
<
Long
,
EntrustReport
>
reportMap
=
reports
.
stream
().
collect
(
Collectors
.
toMap
(
EntrustReport:
:
getEntrustId
,
t
->
t
));
List
<
Long
>
entrustIds
=
reports
.
stream
().
map
(
EntrustReport:
:
getEntrustId
).
collect
(
Collectors
.
toList
());
List
<
Entrust
>
entrustList
=
entrustService
.
getBatchIds
(
entrustIds
);
entrustList
.
stream
().
forEach
(
t
->
{
if
(
isToStatusPath
(
t
))
{
entrustList
.
forEach
(
t
->
{
if
(
entrustService
.
isCanIntoPrevNode
(
t
))
{
entrustService
.
rejectToPrevNode
(
t
,
reason
,
account
);
}
else
{
rejectByReportStatus
(
t
,
reportMap
.
get
(
t
.
getId
()),
reportStatusEnum
,
reason
,
account
);
...
...
@@ -455,6 +437,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
});
}
/**
* 通过报告状态更改驳回的委托样品状态
*
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
ab2b5a8b
...
...
@@ -31,6 +31,7 @@ import com.patzn.cloud.service.lims.base.entity.LmsUserRelGroup;
import
com.patzn.cloud.service.lims.base.vo.LmsUserRelGroupVO
;
import
com.patzn.cloud.service.lims.collection.entity.LmsOriginalRecordInfo
;
import
com.patzn.cloud.service.lims.common.CompareUtils
;
import
com.patzn.cloud.service.lims.hmhj.common.EntrustFlowUtils
;
import
com.patzn.cloud.service.lims.hmhj.common.HSSFWorkbookUtil
;
import
com.patzn.cloud.service.lims.hmhj.common.LabreOfficeUtil
;
import
com.patzn.cloud.service.lims.hmhj.mapper.EntrustSampleItemMapper
;
...
...
@@ -213,8 +214,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
Entrust
entrust
=
getEntrustByItemId
(
ids
[
0
]);
if
(
null
!=
entrust
&&
isAllocatedByEntrustId
(
entrust
.
getId
()))
{
// 添加流程数据录入节点
// entrust.setFlowStatus(EntrustFlowEnum.TEST.getName());
if
(
StringUtils
.
isNotBlank
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
()))
{
if
(
entrustService
.
isCanIntoNextNode
(
entrust
))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
"任务分配"
,
"数据录入"
,
0
,
account
,
"提交至数据录入"
);
...
...
@@ -316,7 +316,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
entrustSampleService
.
update
(
sample
,
Condition
.
create
().
eq
(
"entrust_id"
,
entrustId
));
// 提交到下一节点,可能是不更改状态
if
(
isConfigureStatusPath
(
entrust
))
{
if
(
entrustService
.
isCanIntoNextNode
(
entrust
))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
return
true
;
}
...
...
@@ -1052,10 +1052,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
baseMapper
.
selectUnallocatedCountByEntrustId
(
entrustId
)
==
0
;
}
private
boolean
isConfigureStatusPath
(
Entrust
entrust
)
{
return
StringUtils
.
isNotBlank
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
());
}
@Override
public
Page
<
LmsUserRelGroupVO
>
pageGroupUser
(
Page
<
LmsUserRelGroupVO
>
page
,
LmsUserRelGroup
userRelGroup
)
{
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSamplePrepareServiceImpl.java
View file @
ab2b5a8b
...
...
@@ -175,7 +175,7 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
// 根据样品IDS更新样品编号
// 样品制备 -> 样品接收 相当于从二级编码 变为 三级编码
entrustSampleService
.
updateSampleCodeByIds
(
sampleIdsList
,
3
);
entrustSampleService
.
updateSampleCodeByIds
(
sampleIdsList
,
3
);
List
<
EntrustSample
>
checkMakeList
=
entrustSampleService
.
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
entrust
.
getId
()).
eq
(
"status"
,
EntrustSampleStatusEnum
.
DRAFT
));
if
(
CollectionUtils
.
isEmpty
(
checkMakeList
))
{
...
...
@@ -193,7 +193,7 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
// updateEntrust.setId(entrust.getId());
// entrustService.updateById(updateEntrust);
// 根据流程状态提交
if
(
StringUtils
.
isNotEmpty
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
()
))
{
if
(
entrustService
.
isCanIntoNextNode
(
entrust
))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
Entrust
updateEntrust
=
new
Entrust
();
...
...
@@ -205,11 +205,10 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
"样品制备"
,
"样品接收"
,
0
,
account
,
"提交至样品接收"
);
}
}
return
true
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
submitSampleReceive
(
Long
[]
ids
,
String
receiveType
,
Account
account
)
{
...
...
@@ -267,7 +266,7 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
if
(
CollectionUtils
.
isEmpty
(
notOkSampleIds
))
{
// 检测开始时间为接收时间
entrust
.
setTestTimeS
(
new
Date
());
if
(
StringUtils
.
isNotEmpty
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
()
))
{
if
(
entrustService
.
isCanIntoNextNode
(
entrust
))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
TEST
.
getName
());
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
ab2b5a8b
...
...
@@ -953,7 +953,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if
(
StringUtils
.
isBlank
(
flowStatus
)
&&
entrust
.
getStatus
()
==
EntrustStatusEnum
.
DRAFT
)
{
flowStatus
=
EntrustFlowEnum
.
DRAFT
.
getName
();
}
RestAssert
.
fail
(
StringUtils
.
isBlank
(
flowStatus
),
String
.
format
(
"编号为【%s】的委托,未配置流程状态信息!"
,
entrust
.
getCode
()));
EntrustFlowEnum
nextFlowStatus
=
EntrustFlowUtils
.
getNextFlowStatus
(
flowStatus
,
statusPath
);
EntrustStatusEnum
nextStatus
=
EntrustFlowUtils
.
getStatus
(
nextFlowStatus
);
RestAssert
.
fail
(
null
==
nextStatus
,
String
.
format
(
"编号为【%s】的委托,未配置下一流程状态信息!"
,
entrust
.
getCode
()));
...
...
@@ -1043,6 +1042,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
cloneEntrust
(
Long
[]
ids
,
Account
account
)
{
RestAssert
.
fail
(
null
==
ids
||
ids
.
length
==
0
,
"请选择要复制的委托记录"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
...
...
@@ -1075,6 +1075,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
//生成样品编号,可能存在为空的情况
initSampleCode
(
sample
);
sample
.
setId
(
null
);
sample
.
setId
(
IdWorker
.
getId
());
sample
.
setEntrustId
(
entrust
.
getId
()).
setOrderBy
(
sampleIndex
);
sample
.
setStatus
(
EntrustSampleStatusEnum
.
DRAFT
).
setProgress
(
EntrustSampleStatusEnum
.
DRAFT
);
...
...
@@ -1390,4 +1391,18 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
return
files
;
}
@Override
public
boolean
isCanIntoNextNode
(
Entrust
entrust
)
{
// 路径不为空且当前流程状态不为空且存在下一步流程节点
String
statusPath
=
entrust
.
getStatusPath
(),
flowStatus
=
entrust
.
getFlowStatus
();
return
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
statusPath
)
&&
statusPath
.
contains
(
flowStatus
)
&&
null
!=
EntrustFlowUtils
.
getNextFlowStatus
(
flowStatus
,
statusPath
);
}
@Override
public
boolean
isCanIntoPrevNode
(
Entrust
entrust
)
{
// 路径不为空且当前流程状态不为空且存在上一步流程节点
String
statusPath
=
entrust
.
getStatusPath
(),
flowStatus
=
entrust
.
getFlowStatus
();
return
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
statusPath
)
&&
statusPath
.
contains
(
flowStatus
)
&&
null
!=
EntrustFlowUtils
.
getPrevFlowStatus
(
flowStatus
,
statusPath
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/OriginalTemplateServiceImpl.java
View file @
ab2b5a8b
...
...
@@ -83,12 +83,14 @@ public class OriginalTemplateServiceImpl extends BaseServiceImpl<OriginalTemplat
@Override
public
Page
<
OriginalTemplate
>
page
(
Page
<
OriginalTemplate
>
page
,
OriginalTemplate
originalTemplate
)
{
String
alias
=
originalTemplate
.
getAlias
();
String
name
=
originalTemplate
.
getName
()
,
alias
=
originalTemplate
.
getAlias
();
// 支持模糊搜索
originalTemplate
.
setAlias
(
null
);
originalTemplate
.
setName
(
null
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
originalTemplate
);
wrapper
.
like
(
"name"
,
name
);
wrapper
.
like
(
"alias"
,
alias
);
wrapper
.
orderBy
(
"class_type"
).
orderBy
(
"alias"
);
wrapper
.
orderBy
(
"class_type"
).
orderBy
(
"
name"
).
orderBy
(
"
alias"
);
return
this
.
page
(
page
,
wrapper
);
}
...
...
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