Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-soil
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-soil
Commits
0b1f56cc
Commit
0b1f56cc
authored
Nov 21, 2020
by
wangweidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
土工试验修改
parent
d6d63194
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
SoilEntrustServiceImpl.java
...ervice/lims/soil/service/impl/SoilEntrustServiceImpl.java
+35
-0
SoilPrepareRecordExport.xlsx
...in/resources/templates/excel/SoilPrepareRecordExport.xlsx
+0
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilEntrustServiceImpl.java
View file @
0b1f56cc
...
...
@@ -41,6 +41,8 @@ import com.patzn.poibox.xwpf.HSSFWorkbookUtil;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.usermodel.BorderStyle
;
import
org.apache.poi.ss.usermodel.CellStyle
;
import
org.apache.poi.ss.usermodel.HorizontalAlignment
;
import
org.apache.poi.ss.usermodel.VerticalAlignment
;
import
org.apache.poi.ss.util.CellRangeAddress
;
...
...
@@ -917,6 +919,12 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
xssfCellStyle
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
xssfCellStyle
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
soilSampleService
.
initItemInfo
(
sampleList
);
CellStyle
cellStyle
=
xssfWorkbook
.
createCellStyle
();
cellStyle
.
setAlignment
(
HorizontalAlignment
.
LEFT
);
cellStyle
.
setBorderBottom
(
BorderStyle
.
NONE
);
cellStyle
.
setBorderLeft
(
BorderStyle
.
NONE
);
cellStyle
.
setBorderTop
(
BorderStyle
.
NONE
);
cellStyle
.
setBorderRight
(
BorderStyle
.
NONE
);
int
index
=
7
;
int
length
=
sampleList
.
size
();
if
(
length
<=
10
){
...
...
@@ -984,6 +992,33 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
}
int
rowNum
=
sheet
.
getLastRowNum
();
int
beginNum
=
index
+
1
;
for
(
int
m
=
beginNum
;
m
<
rowNum
;
m
++){
if
(
m
+
1
>
rowNum
){
continue
;
}
XSSFRow
row
=
sheet
.
getRow
(
m
);
XSSFCell
cell
=
row
.
getCell
(
0
);
String
num
=
HSSFWorkbookUtil
.
getJavaValue
(
cell
).
toString
();
if
(
num
.
contains
(
"0"
)){
sheet
.
shiftRows
(
m
+
1
,
sheet
.
getLastRowNum
(),
1
,
true
,
false
);
XSSFRow
footRow
=
sheet
.
createRow
(
m
+
1
);
footRow
.
setHeight
(
row7
.
getHeight
());
for
(
int
j
=
0
;
j
<
12
;
j
++)
{
XSSFCell
footRowCell
=
footRow
.
createCell
(
j
);
footRowCell
.
setCellStyle
(
cellStyle
);
}
CellRangeAddress
region1
=
new
CellRangeAddress
(
m
+
1
,
m
+
1
,
0
,
11
);
sheet
.
addMergedRegion
(
region1
);
XSSFCell
foot
=
footRow
.
getCell
(
0
);
foot
.
setCellStyle
(
cellStyle
);
foot
.
setCellValue
(
"开土人: 记录人: 校核人: "
);
}
}
exportService
.
downloadXlsx
(
response
,
entrust
.
getBoreholeName
()+
".xlsx"
,
xssfWorkbook
);
}
...
...
src/main/resources/templates/excel/SoilPrepareRecordExport.xlsx
View file @
0b1f56cc
No preview for this file type
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