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
30719670
Commit
30719670
authored
Jul 28, 2021
by
ghxdhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
特殊值修约时处理以及保存原始记录时取正常样品的数据
parent
0818cf5d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
11 deletions
+39
-11
SingleSheetMoreItemOperation.java
...vice/lims/hmhj/original/SingleSheetMoreItemOperation.java
+10
-3
SingleSheetMoreOperation.java
.../service/lims/hmhj/original/SingleSheetMoreOperation.java
+10
-3
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+18
-4
EntrustSampleItemMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
+1
-1
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/original/SingleSheetMoreItemOperation.java
View file @
30719670
...
...
@@ -237,12 +237,19 @@ public class SingleSheetMoreItemOperation implements Operation {
// 四舍六入五成双
private
static
void
rounding
(
Cell
cell
,
String
value
,
Integer
roundNum
)
{
if
(
StringUtils
.
isNotBlank
(
value
)
&&
StringHandleUtils
.
validateNumber
(
value
))
{
if
(
StringUtils
.
isNotBlank
(
value
))
{
if
(!
StringHandleUtils
.
validateNumber
(
value
))
{
if
(
value
.
startsWith
(
"!"
))
{
value
=
value
.
substring
(
1
);
}
else
{
cell
.
setCellValue
(
value
);
return
;
}
}
BigDecimal
bd1
=
new
BigDecimal
(
value
);
BigDecimal
bd2
=
bd1
.
setScale
(
roundNum
,
BigDecimal
.
ROUND_HALF_EVEN
);
cell
.
setCellValue
(
bd2
.
toPlainString
());
}
else
{
cell
.
setCellValue
(
""
);
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/original/SingleSheetMoreOperation.java
View file @
30719670
...
...
@@ -250,12 +250,19 @@ public class SingleSheetMoreOperation implements Operation {
// 四舍六入五成双
private
static
void
rounding
(
Cell
cell
,
String
value
,
Integer
roundNum
)
{
if
(
StringUtils
.
isNotBlank
(
value
)
&&
StringHandleUtils
.
validateNumber
(
value
))
{
if
(
StringUtils
.
isNotBlank
(
value
))
{
if
(!
StringHandleUtils
.
validateNumber
(
value
))
{
if
(
value
.
startsWith
(
"!"
))
{
value
=
value
.
substring
(
1
);
}
else
{
cell
.
setCellValue
(
value
);
return
;
}
}
BigDecimal
bd1
=
new
BigDecimal
(
value
);
BigDecimal
bd2
=
bd1
.
setScale
(
roundNum
,
BigDecimal
.
ROUND_HALF_EVEN
);
cell
.
setCellValue
(
bd2
.
toPlainString
());
}
else
{
cell
.
setCellValue
(
""
);
}
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
30719670
...
...
@@ -578,9 +578,16 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
sampleIdsList
.
add
(
itemVO
.
getEntrustSampleId
());
}
List
<
EntrustSample
>
sampleList
=
entrustSampleService
.
list
(
Condition
.
create
().
in
(
"id"
,
sampleIdsList
).
orderBy
(
"order_by"
,
true
));
EntrustSample
firstSample
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
sampleList
))
{
mapReplace
.
put
(
"#{sampleFrom}"
,
sampleList
.
get
(
0
).
getSampleFrom
());
mapReplace
.
put
(
"#{sampleName}"
,
sampleList
.
get
(
0
).
getName
());
for
(
EntrustSample
sample
:
sampleList
)
{
if
(
sample
.
getType
()
==
0
)
{
firstSample
=
sample
;
break
;
}
}
mapReplace
.
put
(
"#{sampleFrom}"
,
firstSample
==
null
?
""
:
firstSample
.
getSampleFrom
());
mapReplace
.
put
(
"#{sampleName}"
,
firstSample
==
null
?
""
:
firstSample
.
getName
());
}
List
<
EntrustSampleVO
>
sampleVOList
=
new
ArrayList
<>(
sampleList
.
size
());
...
...
@@ -614,9 +621,16 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
/* 获取采集到的数据 */
getCollectionData
(
voList
,
null
,
entrustCode
,
itemNameMap
,
template
);
EntrustSampleItemVO
firstVO
=
null
;
for
(
EntrustSampleItemVO
vo
:
voList
)
{
if
(
vo
.
getType
()
==
0
)
{
firstVO
=
vo
;
}
}
if
(
CollectionUtils
.
isNotEmpty
(
voList
))
{
mapReplace
.
put
(
"#{sampleFrom}"
,
voList
.
get
(
0
)
.
getSampleFrom
());
mapReplace
.
put
(
"#{sampleName}"
,
voList
.
get
(
0
)
.
getSampleName
());
mapReplace
.
put
(
"#{sampleFrom}"
,
firstVO
==
null
?
""
:
firstVO
.
getSampleFrom
());
mapReplace
.
put
(
"#{sampleName}"
,
firstVO
==
null
?
""
:
firstVO
.
getSampleName
());
}
...
...
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
View file @
30719670
...
...
@@ -256,7 +256,7 @@
<select
id=
"selectVOListByIds"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO"
>
SELECT i.id,i.name,i.entrust_sample_id,s.entrust_id,i.agreed_value,i.test_value,i.standard,s.code AS
"sampleCode",s.name AS "sampleName",
s.order_by,
s.order_by,
s.type,
s.sample_shape ,s.sample_quantity, s.standard, s.sample_from,s.product_code,s.name_code
FROM
entrust_sample_item i
...
...
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