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
41a9cc67
Commit
41a9cc67
authored
Jul 10, 2023
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报告生成复制报告未形成单元格问题处理;
parent
406c9f7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+21
-12
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
41a9cc67
...
...
@@ -16,7 +16,7 @@ import com.patzn.cloud.commons.exception.PatznException;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.commons.toolkit.DateUtils
;
import
com.patzn.cloud.commons.toolkit.FileUtils
;
import
com.patzn.cloud.commons.toolkit.
Jackson
Utils
;
import
com.patzn.cloud.commons.toolkit.
Io
Utils
;
import
com.patzn.cloud.commons.toolkit.MapMergeUtils
;
import
com.patzn.cloud.oss.starter.OssClient
;
import
com.patzn.cloud.service.hmhj.dto.*
;
...
...
@@ -994,15 +994,13 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
os
.
flush
();
entrustReportService
.
uploadReportGenerateDocx
(
entrust
,
ids
,
account
,
StringHandleUtils
.
join
(
sampleNameSet
),
"报告生成"
,
file
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
"==== EntrustSampleServiceImpl ==== makeReport ====> 生成上传报告时异常:"
,
e
);
}
finally
{
try
{
os
.
close
();
baseDoc
.
close
();
io
.
close
();
IoUtils
.
close
(
os
,
baseDoc
,
io
);
FileUtils
.
deleteFiles
(
file
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
"==== EntrustSampleServiceImpl ==== makeReport ====> 关闭IO时异常:"
,
e
);
}
}
...
...
@@ -1071,13 +1069,13 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
if
(
null
==
config
.
getColumnPlace
())
{
continue
;
}
XSSFCell
cell
=
xssfRow
.
getCell
(
config
.
getColumnPlace
());
if
(
"sn"
.
equals
(
config
.
getDataAttribute
()))
{
continue
;
}
if
(
StringUtils
.
isBlank
(
config
.
getDataAttribute
()))
{
continue
;
}
XSSFCell
cell
=
getOrCreateCell
(
xssfRow
,
config
.
getColumnPlace
());
String
value
=
StringHandleUtils
.
getFieldValue
(
config
.
getDataAttribute
(),
vo
);
cell
.
setCellValue
(
value
);
}
...
...
@@ -1105,13 +1103,16 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
XSSFRow
xssfRow
=
sheetOneIndex
.
getRow
(
beginRow
);
for
(
EntrustReportTemplateConfig
config
:
configList
)
{
XSSFCell
cell
=
xssfRow
.
getCell
(
config
.
getColumnPlace
());
if
(
"sn"
.
equals
(
config
.
getDataAttribute
()))
{
continue
;
}
if
(
StringUtils
.
isBlank
(
config
.
getDataAttribute
()))
{
continue
;
}
if
(
null
==
config
.
getColumnPlace
())
{
continue
;
}
XSSFCell
cell
=
getOrCreateCell
(
xssfRow
,
config
.
getColumnPlace
());
String
value
=
StringHandleUtils
.
getFieldValue
(
config
.
getDataAttribute
(),
vo
);
cell
.
setCellValue
(
value
);
}
...
...
@@ -1153,7 +1154,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
if
(
null
==
config
.
getColumnPlace
())
{
continue
;
}
XSSFCell
cell
=
xssfRow
.
getCell
(
config
.
getColumnPlace
());
XSSFCell
cell
=
getOrCreateCell
(
xssfRow
,
config
.
getColumnPlace
());
if
(
"sn"
.
equals
(
config
.
getDataAttribute
()))
{
cell
.
setCellValue
(
sn
);
}
else
{
...
...
@@ -1223,6 +1224,14 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
return
true
;
}
private
static
XSSFCell
getOrCreateCell
(
XSSFRow
xssfRow
,
int
column
)
{
XSSFCell
cell
=
xssfRow
.
getCell
(
column
);
if
(
null
==
cell
)
{
cell
=
xssfRow
.
createCell
(
column
);
}
return
cell
;
}
@Override
public
boolean
makeSingleReport
(
Long
sampleId
,
Long
[]
itemIds
,
Long
templateId
,
Account
account
)
{
...
...
@@ -1458,7 +1467,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
if
(
null
==
config
.
getColumnPlace
())
{
continue
;
}
XSSFCell
cell
=
xssfRow
.
getCell
(
config
.
getColumnPlace
());
XSSFCell
cell
=
getOrCreateCell
(
xssfRow
,
config
.
getColumnPlace
());
if
(
"sn"
.
equals
(
config
.
getDataAttribute
()))
{
cell
.
setCellValue
(
sn
);
}
else
{
...
...
@@ -2187,13 +2196,13 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
if
(
null
==
config
.
getColumnPlace
())
{
continue
;
}
XSSFCell
cell
=
xssfRow
.
getCell
(
config
.
getColumnPlace
());
if
(
"sn"
.
equals
(
config
.
getDataAttribute
()))
{
continue
;
}
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
config
.
getDataAttribute
()))
{
continue
;
}
XSSFCell
cell
=
getOrCreateCell
(
xssfRow
,
config
.
getColumnPlace
());
String
value
=
StringHandleUtils
.
getFieldValue
(
config
.
getDataAttribute
(),
vo
);
cell
.
setCellValue
(
value
);
}
...
...
@@ -2267,7 +2276,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
if
(
null
==
config
.
getColumnPlace
())
{
continue
;
}
XSSFCell
cell
=
xssfRow
.
getCell
(
config
.
getColumnPlace
());
XSSFCell
cell
=
getOrCreateCell
(
xssfRow
,
config
.
getColumnPlace
());
if
(
"sn"
.
equals
(
config
.
getDataAttribute
()))
{
cell
.
setCellValue
(
sn
);
}
else
{
...
...
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