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
2418e6e2
Commit
2418e6e2
authored
Apr 28, 2021
by
wangweidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
霍煤鸿骏
parent
6ebe7617
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
35 deletions
+1
-35
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+1
-35
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
2418e6e2
...
...
@@ -305,39 +305,24 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Override
public
OriginalRecord
saveExcelOriginalRecord
(
Long
[]
ids
,
Long
templateId
,
Account
account
)
{
logger
.
error
(
"saveExcelOriginalRecord"
);
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择试验项目!"
);
RestAssert
.
fail
(
null
==
templateId
,
"请选择原始记录模板"
);
OriginalTemplate
template
=
originalTemplateService
.
getById
(
templateId
);
if
(
null
==
template
){
logger
.
error
(
"----------------------0"
);
RestAssert
.
fail
(
"模板不存在"
);
}
logger
.
error
(
"saveExcelOriginalRecord模板存在"
);
List
<
EntrustSampleItemVO
>
voList
=
listVOByIds
(
ids
);
if
(
CollectionUtils
.
isEmpty
(
voList
)){
return
null
;
}
List
<
Long
>
sampleIdList
=
voList
.
stream
().
map
(
s
->{
return
s
.
getEntrustSampleId
();
}).
collect
(
Collectors
.
toList
());
Entrust
entrust
=
entrustService
.
getById
(
voList
.
get
(
0
).
getEntrustId
());
logger
.
error
(
"saveExcelOriginalRecord entrust"
);
InputStream
io
=
ossClient
.
download
(
template
.
getObjectKey
());
if
(
null
==
io
){
logger
.
error
(
"----------------------2"
);
RestAssert
.
fail
(
"模板不存在"
);
}
logger
.
error
(
" InputStream io 存在"
);
OriginalRecord
objectKey
=
null
;
XSSFWorkbook
xssfWorkbook
=
null
;
try
{
...
...
@@ -348,35 +333,16 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
Map
<
String
,
String
>
mapReplace
=
new
HashMap
<>();
mapReplace
.
put
(
"#{client}"
,
entrust
.
getClient
());
List
<
OriginalTemplateConfig
>
configList
=
originalTemplateConfigService
.
list
(
Condition
.
create
().
eq
(
"template_id"
,
templateId
));
if
(
null
==
template
.
getMoreSheet
()
||
0
==
template
.
getMoreSheet
()){
logger
.
error
(
"----------------------3"
);
HSSFWorkbookUtil
.
replaceModel
(
mapReplace
,
xssfWorkbook
,
0
);
logger
.
error
(
"----------------------4"
);
XSSFSheet
sheetOne
=
xssfWorkbook
.
getSheetAt
(
0
);
sheetOne
.
setForceFormulaRecalculation
(
true
);
logger
.
error
(
"----------------------5"
);
Integer
beginRow
=
template
.
getSampleBeginRow
();
if
(
null
!=
beginRow
&&
null
!=
template
.
getSampleMergerNum
()
&&
null
!=
template
.
getTemplateSampleNum
()){
if
(
null
!=
beginRow
&&
null
!=
template
.
getSampleMergerNum
()&&
null
!=
template
.
getTemplateSampleNum
()){
int
templateSampleNum
=
template
.
getTemplateSampleNum
();
if
(
voList
.
size
()<
templateSampleNum
){
int
sampleMergerNum
=
template
.
getSampleMergerNum
();
int
xBegin1
=
9
;
int
xBegin2
=
10
;
int
xBegin3
=
11
;
int
xStep
=
5
;
for
(
EntrustSampleItemVO
vo:
voList
)
{
XSSFRow
xssfRow
=
sheetOne
.
getRow
(
beginRow
);
for
(
OriginalTemplateConfig
config:
configList
)
{
...
...
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