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
8d9e401a
Commit
8d9e401a
authored
Oct 27, 2022
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理原铝重取编号获取问题;
parent
93814ef6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+18
-17
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
8d9e401a
...
@@ -417,13 +417,15 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -417,13 +417,15 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
public
void
changeExcelToPdf
(
Long
[]
ids
,
List
<
EntrustSampleItem
>
list
)
{
public
void
changeExcelToPdf
(
Long
[]
ids
,
List
<
EntrustSampleItem
>
list
)
{
List
<
ItemRelOriginalRecord
>
recordList
=
itemRelOriginalRecordService
.
list
(
Condition
.
create
().
setSqlSelect
(
"record_id"
).
in
(
"item_id"
,
ids
).
isNotNull
(
"record_id"
).
groupBy
(
"record_id"
));
List
<
ItemRelOriginalRecord
>
recordList
=
itemRelOriginalRecordService
.
list
(
Condition
.
create
().
setSqlSelect
(
"record_id"
).
in
(
"item_id"
,
ids
).
isNotNull
(
"record_id"
).
groupBy
(
"record_id"
));
if
(
CollectionUtils
.
isEmpty
(
recordList
))
if
(
CollectionUtils
.
isEmpty
(
recordList
))
{
return
;
return
;
}
List
<
Long
>
recordsList
=
recordList
.
stream
().
map
(
ItemRelOriginalRecord:
:
getRecordId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
recordsList
=
recordList
.
stream
().
map
(
ItemRelOriginalRecord:
:
getRecordId
).
collect
(
Collectors
.
toList
());
List
<
OriginalRecord
>
originalRecordList
=
originalRecordService
.
list
(
Condition
.
create
().
in
(
"id"
,
recordsList
).
isNull
(
"pdf_object_key"
));
List
<
OriginalRecord
>
originalRecordList
=
originalRecordService
.
list
(
Condition
.
create
().
in
(
"id"
,
recordsList
).
isNull
(
"pdf_object_key"
));
if
(
CollectionUtils
.
isEmpty
(
originalRecordList
))
if
(
CollectionUtils
.
isEmpty
(
originalRecordList
))
{
return
;
return
;
}
excelToPdf
(
originalRecordList
);
excelToPdf
(
originalRecordList
);
...
@@ -1469,7 +1471,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1469,7 +1471,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
/**
/**
* 发送判级后的样品检测数据至ERP
* 发送判级后的样品检测数据至ERP
*
*
* @param sample
VOList
* @param sample
BrandMap
*/
*/
private
void
sendTestDataToErp
(
List
<
Long
>
ids
,
Map
<
Long
,
String
>
sampleBrandMap
)
{
private
void
sendTestDataToErp
(
List
<
Long
>
ids
,
Map
<
Long
,
String
>
sampleBrandMap
)
{
log
(
"执行发送的样品IDS:"
+
StringUtils
.
join
(
ids
,
","
));
log
(
"执行发送的样品IDS:"
+
StringUtils
.
join
(
ids
,
","
));
...
@@ -1493,7 +1495,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1493,7 +1495,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
}
// 获取检测项目指标数据
// 获取检测项目指标数据
List
<
Map
<
String
,
Object
>>
dataList
=
null
;
List
<
Map
<
String
,
Object
>>
dataList
;
// 此处原铝的和铝成品的查询分开了,实际上只用原铝的即可,铝成品的重写是为了不再对比重取数据
// 此处原铝的和铝成品的查询分开了,实际上只用原铝的即可,铝成品的重写是为了不再对比重取数据
if
(
Objects
.
equals
(
ylname
,
sampleName
))
{
if
(
Objects
.
equals
(
ylname
,
sampleName
))
{
...
@@ -1516,7 +1518,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1516,7 +1518,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
//Y2112052110C2
//Y2112052110C2
//测试环境中,原铝重取可能并不是同一天生成的,"Y" + DateUtils.dateTransfer(sample.getCtime(), "yyMMdd") + "-" + sample.getSlotNo().trim();
//测试环境中,原铝重取可能并不是同一天生成的,"Y" + DateUtils.dateTransfer(sample.getCtime(), "yyMMdd") + "-" + sample.getSlotNo().trim();
//根据样品编号,查询出委托id
//根据样品编号,查询出委托id
List
<
Long
>
entrustIds
=
entrustSampleService
.
getEntrustIdsBySampleCodes
(
sampleCodeList
);
List
<
String
>
sampleCodes
=
sampleCodeHandle
(
sampleList
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleCodes
),
"根据重取编号获取的原铝编号为空!"
);
List
<
Long
>
entrustIds
=
entrustSampleService
.
getEntrustIdsBySampleCodes
(
sampleCodes
);
logger
.
error
(
"entrust id is : {}"
,
entrustIds
);
logger
.
error
(
"entrust id is : {}"
,
entrustIds
);
// 基本上不可能为空的
// 基本上不可能为空的
...
@@ -1557,16 +1561,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1557,16 +1561,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
}
}
}
private
List
<
String
>
getSampleCodes
(
List
<
EntrustSample
>
sampleList
)
{
private
List
<
String
>
sampleCodeHandle
(
List
<
EntrustSample
>
samples
)
{
List
<
String
>
sampleCodes
=
new
ArrayList
<
String
>();
List
<
String
>
codeList
=
new
ArrayList
<>();
for
(
EntrustSample
sample
:
sampleList
)
{
for
(
EntrustSample
sample
:
samples
)
{
String
sampleCode
=
getSampleCode
(
sample
);
sampleCodes
.
add
(
sampleCode
);
}
return
sampleCodes
;
}
private
String
getSampleCode
(
EntrustSample
sample
)
{
String
sampleCode
=
sample
.
getCode
(),
prefix
=
"Y"
;
String
sampleCode
=
sample
.
getCode
(),
prefix
=
"Y"
;
// == 只有旧数据会有这种情况,可以不去考虑
// == 只有旧数据会有这种情况,可以不去考虑
if
(
StringUtils
.
isBlank
(
sampleCode
))
{
if
(
StringUtils
.
isBlank
(
sampleCode
))
{
...
@@ -1575,7 +1572,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1575,7 +1572,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
sampleCode
=
sampleCode
.
startsWith
(
prefix
)
?
sampleCode
:
(
prefix
+
sampleCode
);
sampleCode
=
sampleCode
.
startsWith
(
prefix
)
?
sampleCode
:
(
prefix
+
sampleCode
);
sampleCode
=
sampleCode
.
substring
(
0
,
7
)
+
"-"
+
sample
.
getSlotNo
().
trim
();
sampleCode
=
sampleCode
.
substring
(
0
,
7
)
+
"-"
+
sample
.
getSlotNo
().
trim
();
}
}
return
sampleCode
;
codeList
.
add
(
sampleCode
);
}
return
codeList
;
}
}
private
void
log
(
String
str
)
{
private
void
log
(
String
str
)
{
...
@@ -1629,7 +1628,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1629,7 +1628,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Override
@Override
public
List
<
EntrustSampleItemIndexVO
>
getItemTestByEntrustId
(
Long
entrustId
)
{
public
List
<
EntrustSampleItemIndexVO
>
getItemTestByEntrustId
(
Long
entrustId
)
{
if
(
null
==
entrustId
)
return
null
;
if
(
null
==
entrustId
)
{
return
null
;
}
return
baseMapper
.
selectItemTestByEntrustId
(
entrustId
);
return
baseMapper
.
selectItemTestByEntrustId
(
entrustId
);
}
}
...
...
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