Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qianhe-ydsj
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangyun
qianhe-ydsj
Commits
0ab6dc74
Commit
0ab6dc74
authored
Nov 29, 2025
by
jiang'yun
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
78717c08
4a1e9b17
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
2 deletions
+82
-2
qianhe-ydsj/src/main/java/com/qianhe/controller/SjGfjsZsdwkhpjController.java
+81
-1
qianhe-ydsj/src/main/resources/mapper/SjGfjsZsdwkhpjZbMapper.xml
+1
-1
qianhe-ydsj/src/main/resources/static/gfjs_zsdwkhpj_fdjg.xlsx
+0
-0
No files found.
qianhe-ydsj/src/main/java/com/qianhe/controller/SjGfjsZsdwkhpjController.java
View file @
0ab6dc74
...
@@ -477,7 +477,7 @@ public class SjGfjsZsdwkhpjController extends BaseController
...
@@ -477,7 +477,7 @@ public class SjGfjsZsdwkhpjController extends BaseController
{
{
sjGfjsZsdwkhpjZb
.
setZt
(
"1"
);
sjGfjsZsdwkhpjZb
.
setZt
(
"1"
);
sjGfjsZsdwkhpjZb
.
setJb
(
"直属单位"
);
sjGfjsZsdwkhpjZb
.
setJb
(
"直属单位"
);
List
<
SjGfjsZsdwkhpjZb
>
list
=
sjGfjsZsdwkhpjZbService
.
selectSjGfjsZsdwkhpjZbList
(
sjGfjsZsdwkhpjZb
);
List
<
SjGfjsZsdwkhpjZb
>
list
=
sjGfjsZsdwkhpjZbService
.
selectSjGfjsZsdwkhpjZbList
(
sjGfjsZsdwkhpjZb
);
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
...
@@ -517,5 +517,85 @@ public class SjGfjsZsdwkhpjController extends BaseController
...
@@ -517,5 +517,85 @@ public class SjGfjsZsdwkhpjController extends BaseController
}
}
//分档结果导出
@PostMapping
(
"/exportFdjg"
)
public
void
exportFdjg
(
HttpServletResponse
response
,
SjGfjsZsdwkhpjZb
sjGfjsZsdwkhpjZb
)
{
sjGfjsZsdwkhpjZb
.
setZt
(
"1"
);
sjGfjsZsdwkhpjZb
.
setJb
(
"直属单位"
);
List
<
SjGfjsZsdwkhpjZb
>
list
=
sjGfjsZsdwkhpjZbService
.
selectSjGfjsZsdwkhpjZbList
(
sjGfjsZsdwkhpjZb
);
Workbook
exl
=
null
;
OutputStream
out
=
null
;
InputStream
in
=
null
;
try
{
in
=
this
.
getClass
().
getResourceAsStream
(
"/static/gfjs_zsdwkhpj_fdjg.xlsx"
);
exl
=
WorkbookFactory
.
create
(
in
);
out
=
response
.
getOutputStream
();
response
.
reset
();
String
filename
=
URLEncoder
.
encode
(
"分档结果.xlsx"
,
"UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
filename
);
response
.
setContentType
(
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
);
Sheet
sheet
=
exl
.
getSheet
(
"Sheet1"
);
CellStyle
cellStyle
=
exl
.
createCellStyle
();
cellStyle
.
setWrapText
(
true
);
cellStyle
.
setAlignment
(
HorizontalAlignment
.
LEFT
);
cellStyle
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
cellStyle
.
setBorderBottom
(
BorderStyle
.
THIN
);
cellStyle
.
setBottomBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
cellStyle
.
setBorderLeft
(
BorderStyle
.
THIN
);
cellStyle
.
setLeftBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
cellStyle
.
setBorderRight
(
BorderStyle
.
THIN
);
cellStyle
.
setRightBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
cellStyle
.
setBorderTop
(
BorderStyle
.
THIN
);
cellStyle
.
setTopBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
String
deptName
=
""
;
int
lastRow
=
sheet
.
getLastRowNum
()+
1
;
for
(
SjGfjsZsdwkhpjZb
zsdwkhpj:
list
){
deptName
=
zsdwkhpj
.
getDeptName
();;
Row
row
=
sheet
.
createRow
(
lastRow
);
row
.
setHeightInPoints
(
18
);
int
m
=
0
;
Cell
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getParentName
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getDeptName
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getZqfw
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getJb
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getFdjb
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getPm
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getDeptLx
());
lastRow
++;
}
//合并行
mergeCellsByColumn
(
sheet
,
0
);
mergeCellsByColumn
(
sheet
,
1
);
sheet
.
getRow
(
0
).
getCell
(
0
).
setCellValue
(
sjGfjsZsdwkhpjZb
.
getNd
()+
sjGfjsZsdwkhpjZb
.
getZqfw
()+
deptName
+
"分档结果"
);
exl
.
write
(
out
);
exl
.
close
();
}
catch
(
Exception
e
){
e
.
getMessage
();
throw
new
BusinessException
(
"导出Excel失败,请联系网站管理员!"
);
}
finally
{
if
(
exl
!=
null
)
{
try
{
exl
.
close
();
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
}
if
(
out
!=
null
)
{
try
{
out
.
close
();
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
}
}
}
}
}
qianhe-ydsj/src/main/resources/mapper/SjGfjsZsdwkhpjZbMapper.xml
View file @
0ab6dc74
...
@@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
zqlx,
zqlx,
jb,
jb,
d.dept_dfl,
d.dept_dfl,
d.
dept_lx,
(select dwlx from sys_dept_cb cb where cb.dept_id = a.dept_id order by cb.nd desc limit 1)
dept_lx,
d.dept_ywfl,
d.dept_ywfl,
djyjzfs,
djyjzfs,
djyjkfs,
djyjkfs,
...
...
qianhe-ydsj/src/main/resources/static/gfjs_zsdwkhpj_fdjg.xlsx
0 → 100644
View file @
0ab6dc74
File added
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