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
39a65541
Commit
39a65541
authored
Dec 27, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
样品编号不一致问题修改;
parent
a7d78e6d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
ContractSamplingServiceImpl.java
...e/lims/hmhj/service/impl/ContractSamplingServiceImpl.java
+3
-0
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+19
-2
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/ContractSamplingServiceImpl.java
View file @
39a65541
...
...
@@ -96,7 +96,10 @@ public class ContractSamplingServiceImpl extends BaseServiceImpl<ContractSamplin
sampleList
.
forEach
(
t
->
{
RestAssert
.
fail
(
null
==
t
.
getType
(),
"样品类型为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
t
.
getName
()),
"样品名称为空"
);
// 编号不为空,赋值
if
(
StringUtils
.
isBlank
(
t
.
getCode
()))
{
initSamplingCode
(
t
);
}
t
.
setMaterialId
(
contractSample
.
getMaterialId
());
});
return
saveOrUpdateBatch
(
sampleList
);
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
39a65541
...
...
@@ -113,6 +113,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Autowired
private
IMaterialService
materialService
;
@Autowired
private
IContractSamplingService
contractSamplingService
;
@Override
public
Page
<
Entrust
>
page
(
Page
<
Entrust
>
page
,
Entrust
entrust
)
{
...
...
@@ -316,15 +319,29 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
* 样品编号处理
*/
private
void
handleSampleCode
(
Entrust
entrust
,
EntrustSample
sample
)
{
String
sampleCode
=
sample
.
getCode
();
String
sampleCode
=
sample
.
getCode
()
,
secondCode
=
sample
.
getSecondCode
(),
thirdCode
=
sample
.
getThirdCode
()
;
if
(
isExistSampleCode
(
sample
)
&&
StringUtils
.
isBlank
(
sampleCode
))
{
throw
new
PatznException
(
"样品编号为空"
);
}
// 非已有编码物质为空时,需要生成样品编号
// 生成样品编号
// 若有采样ID,样品编号自动获取
Long
samplingId
=
sample
.
getSamplingId
();
if
(
null
!=
samplingId
)
{
ContractSampling
sampling
=
contractSamplingService
.
getById
(
samplingId
);
sample
.
setCode
(
sampling
.
getCode
()).
setFirstCode
(
sampling
.
getFirstCode
())
.
setSecondCode
(
sampling
.
getSecondCode
()).
setThirdCode
(
sampling
.
getThirdCode
());
}
else
{
initSampleCode
(
entrust
,
sample
);
if
(
StringUtils
.
isNotBlank
(
sampleCode
))
{
sample
.
setCode
(
sampleCode
);
sample
.
setFirstCode
(
sampleCode
);
}
if
(
StringUtils
.
isNotBlank
(
secondCode
))
{
sample
.
setSecondCode
(
secondCode
);
}
if
(
StringUtils
.
isNotBlank
(
thirdCode
))
{
sample
.
setThirdCode
(
thirdCode
);
}
}
}
...
...
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