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
5cffced4
Commit
5cffced4
authored
Jan 05, 2022
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修约问题修改;
parent
39a65541
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
32 deletions
+32
-32
Operation.java
...com/patzn/cloud/service/lims/hmhj/original/Operation.java
+8
-6
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+0
-0
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+12
-2
EntrustMapper.xml
src/main/resources/mapper/hmhj/EntrustMapper.xml
+12
-24
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/original/Operation.java
View file @
5cffced4
...
...
@@ -13,6 +13,7 @@ public interface Operation {
/**
* 对从直读光谱中抓取过来的原铝分析结果,进行修约
*
* @param cell
* @param value
* @param roundNum
...
...
@@ -32,21 +33,22 @@ public interface Operation {
// CEILING(ABS(TRUNC(A1,B1+1)-0.5*10^(-B1),2*10^(-B1)*SIGN(A1)))
int
beginIndex
=
value
.
lastIndexOf
(
"."
)
+
1
,
valueLength
=
value
.
length
();
String
intVal
=
value
.
substring
(
0
,
value
.
indexOf
(
"."
)
+
1
);
int
remindLength
=
valueLength
-
beginIndex
;
String
truncValue
=
""
,
zeroStr
=
"000000000"
;
// bdA = TRUNC(A1,B1+5)*10^B1
if
(
remindLength
>=
roundNum
+
5
)
{
truncValue
=
"0."
+
value
.
substring
(
beginIndex
,
beginIndex
+
roundNum
+
5
);
truncValue
=
intVal
+
value
.
substring
(
beginIndex
,
beginIndex
+
roundNum
+
5
);
}
else
{
truncValue
=
"0."
+
value
.
substring
(
beginIndex
)
+
zeroStr
.
substring
(
0
,
roundNum
+
5
-
remindLength
);
truncValue
=
intVal
+
value
.
substring
(
beginIndex
)
+
zeroStr
.
substring
(
0
,
roundNum
+
5
-
remindLength
);
}
BigDecimal
bdDiff
=
new
BigDecimal
(
truncValue
).
scaleByPowerOfTen
(
roundNum
);
// bdB = TRUNC(A1,B1+5)*10^B1
if
(
remindLength
>=
roundNum
)
{
truncValue
=
"0."
+
value
.
substring
(
beginIndex
,
beginIndex
+
roundNum
);
truncValue
=
intVal
+
value
.
substring
(
beginIndex
,
beginIndex
+
roundNum
);
}
else
{
truncValue
=
"0."
+
value
.
substring
(
beginIndex
)
+
zeroStr
.
substring
(
0
,
roundNum
-
remindLength
);
truncValue
=
intVal
+
value
.
substring
(
beginIndex
)
+
zeroStr
.
substring
(
0
,
roundNum
-
remindLength
);
}
bdDiff
=
bdDiff
.
subtract
(
new
BigDecimal
(
truncValue
).
scaleByPowerOfTen
(
roundNum
)).
abs
();
...
...
@@ -59,9 +61,9 @@ public interface Operation {
// 处理第三种情况
// CEILING(ABS(TRUNC(A1,B1+1)-0.5*10^(-B1),2*10^(-B1)*SIGN(A1))
if
(
remindLength
>=
roundNum
+
1
)
{
truncValue
=
"0."
+
value
.
substring
(
beginIndex
,
beginIndex
+
roundNum
+
1
);
truncValue
=
intVal
+
value
.
substring
(
beginIndex
,
beginIndex
+
roundNum
+
1
);
}
else
{
truncValue
=
"0."
+
value
.
substring
(
beginIndex
)
+
zeroStr
.
substring
(
0
,
roundNum
+
1
-
remindLength
);
truncValue
=
intVal
+
value
.
substring
(
beginIndex
)
+
zeroStr
.
substring
(
0
,
roundNum
+
1
-
remindLength
);
}
bdDiff
=
new
BigDecimal
(
truncValue
);
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
5cffced4
This diff is collapsed.
Click to expand it.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
5cffced4
...
...
@@ -329,7 +329,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if
(
null
!=
samplingId
)
{
ContractSampling
sampling
=
contractSamplingService
.
getById
(
samplingId
);
sample
.
setCode
(
sampling
.
getCode
()).
setFirstCode
(
sampling
.
getFirstCode
())
.
setSecondCode
(
sampling
.
getSecondCode
()).
setThirdCode
(
sampling
.
getThirdCode
());
.
setSecondCode
(
sampling
.
getSecondCode
());
// 进场物资,使用针对进场物资的生成规则
if
(
1
==
entrust
.
getType
())
{
thirdCode
=
getSampleThirdCode
(
sample
);
}
else
{
thirdCode
=
sampling
.
getThirdCode
();
}
sample
.
setThirdCode
(
thirdCode
);
}
else
{
initSampleCode
(
entrust
,
sample
);
if
(
StringUtils
.
isNotBlank
(
sampleCode
))
{
...
...
@@ -340,6 +347,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
sample
.
setSecondCode
(
secondCode
);
}
if
(
StringUtils
.
isNotBlank
(
thirdCode
))
{
if
(
1
==
entrust
.
getType
())
{
thirdCode
=
getSampleThirdCode
(
sample
);
}
sample
.
setThirdCode
(
thirdCode
);
}
}
...
...
@@ -1114,7 +1124,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
String
sampleCode
=
sample
.
getCode
();
sample
.
setId
(
null
);
sample
.
setId
(
IdWorker
.
getId
());
sample
.
setCode
(
null
);
sample
.
setCode
(
null
)
.
setFirstCode
(
null
).
setSecondCode
(
null
).
setThirdCode
(
null
)
;
//生成样品编号,可能存在为空的情况
initSampleCode
(
entrust
,
sample
);
// 样品编号问题,手填的样品编号不清空
...
...
src/main/resources/mapper/hmhj/EntrustMapper.xml
View file @
5cffced4
...
...
@@ -243,35 +243,23 @@
WHERE e.deleted = 0
<include
refid=
"basicCondition"
/>
<if
test=
"
null!=vo.itemStatus
"
>
<if
test=
"
null != vo.itemStatus || null != vo.itemStatusEnumList || null != vo.testerId
"
>
and exists (
select 1 from entrust_sample es
join entrust_sample_item esi on esi.entrust_sample_id = es.id
where es.deleted = 0 and esi.deleted = 0 and es.entrust_id = e.id
and esi.status = #{vo.itemStatus}
)
</if>
<if
test=
"null!=vo.itemStatusEnumList"
>
and exists (
select 1 from entrust_sample es
join entrust_sample_item esi on esi.entrust_sample_id = es.id
where es.deleted = 0 and esi.deleted = 0 and es.entrust_id = e.id
and esi.status IN
<foreach
collection=
"vo.itemStatusEnumList"
index=
"index"
item=
"status"
open=
"("
separator=
","
close=
")"
>
#{status}
</foreach>
)
</if>
<if
test=
"null!=vo.testerId"
>
and exists (
select 1 from entrust_sample es
join entrust_sample_item esi on esi.entrust_sample_id = es.id
where es.deleted = 0 and esi.deleted = 0 and es.entrust_id = e.id
and esi.tester_id = #{vo.testerId}
-- 数据录入节点,处理完成的数据不再显示
join entrust_sample_item esi on esi.entrust_sample_id = es.id and esi.deleted = 0
where es.entrust_id = e.id and es.deleted = 0
<if
test=
"null != vo.itemStatus"
>
and esi.status = #{vo.itemStatus}
</if>
<if
test=
"null != vo.itemStatusEnumList"
>
and esi.status IN
<foreach
collection=
"vo.itemStatusEnumList"
index=
"index"
item=
"status"
open=
"("
separator=
","
close=
")"
>
#{status}
</foreach>
</if>
<if
test=
"null!=vo.testerId"
>
and esi.tester_id = #{vo.testerId}
</if>
)
</if>
order by e.entrust_time desc,e.code desc
...
...
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