Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
ef174668
Commit
ef174668
authored
Dec 15, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下载视频
parent
40fdd28c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
29 deletions
+16
-29
ExcelDaoFinish.java
...main/java/com/yanzuoguang/cloud/excel/ExcelDaoFinish.java
+1
-1
ExcelDaoStatus.java
...main/java/com/yanzuoguang/cloud/excel/ExcelDaoStatus.java
+0
-20
ExcelHttp.java
.../src/main/java/com/yanzuoguang/cloud/excel/ExcelHttp.java
+15
-8
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/excel/ExcelDaoFinish.java
View file @
ef174668
...
@@ -7,7 +7,7 @@ import com.yanzuoguang.db.impl.DbRow;
...
@@ -7,7 +7,7 @@ import com.yanzuoguang.db.impl.DbRow;
*
*
* @author 颜佐光
* @author 颜佐光
*/
*/
public
interface
ExcelDaoFinish
<
T
extends
Object
,
M
extends
Object
>
extends
ExcelDao
Status
<
T
,
M
>
{
public
interface
ExcelDaoFinish
<
T
extends
Object
,
M
extends
Object
>
extends
ExcelDao
<
T
,
M
>
{
/**
/**
* 循环处理每行数据
* 循环处理每行数据
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/excel/ExcelDaoStatus.java
deleted
100644 → 0
View file @
40fdd28c
package
com
.
yanzuoguang
.
cloud
.
excel
;
import
com.yanzuoguang.db.impl.DbRow
;
import
com.yanzuoguang.excel.ExcelStatus
;
/**
* Excel导出接口
*
* @author 颜佐光
*/
public
interface
ExcelDaoStatus
<
T
extends
Object
,
M
extends
Object
>
extends
ExcelStatus
<
T
>
{
/**
* 循环处理每行数据
*
* @param excel excel对象
* @param cond 条件参数
*/
void
export
(
DbRow
<
M
>
excel
,
T
cond
);
}
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/excel/ExcelHttp.java
View file @
ef174668
...
@@ -79,7 +79,7 @@ public class ExcelHttp<T extends Object> extends ExcelConsole<T> {
...
@@ -79,7 +79,7 @@ public class ExcelHttp<T extends Object> extends ExcelConsole<T> {
* @param req 请求对接
* @param req 请求对接
* @param excelDao dao层实现接口
* @param excelDao dao层实现接口
*/
*/
public
static
<
T
extends
Object
,
M
extends
Object
>
ExcelHttp
<
M
>
export
(
ExportBase
<
T
>
req
,
ExcelDao
<
T
,
M
>
excelDao
)
{
public
static
<
T
extends
Object
,
M
extends
Object
>
ExcelHttp
<
M
>
export
(
ExportBase
<
T
>
req
,
ExcelDao
<
T
,
M
>
excelDao
,
ExcelStatus
<
M
>
excelStatus
)
{
ExportData
config
=
req
.
getConfig
();
ExportData
config
=
req
.
getConfig
();
if
(
config
==
null
)
{
if
(
config
==
null
)
{
throw
YzgError
.
getRuntimeException
(
"024"
);
throw
YzgError
.
getRuntimeException
(
"024"
);
...
@@ -95,12 +95,7 @@ public class ExcelHttp<T extends Object> extends ExcelConsole<T> {
...
@@ -95,12 +95,7 @@ public class ExcelHttp<T extends Object> extends ExcelConsole<T> {
config
.
setDownFileName
(
String
.
format
(
"%s-%s.xlsx"
,
config
.
getTitle
(),
config
.
getSubTitle
()));
config
.
setDownFileName
(
String
.
format
(
"%s-%s.xlsx"
,
config
.
getTitle
(),
config
.
getSubTitle
()));
}
}
ExcelHttp
<
M
>
excel
=
null
;
ExcelHttp
<
M
>
excel
=
new
ExcelHttp
<>(
config
,
excelStatus
);
if
(
excelDao
instanceof
ExcelStatus
)
{
excel
=
new
ExcelHttp
<>(
config
,
(
ExcelStatus
<
M
>)
excelDao
);
}
else
{
excel
=
new
ExcelHttp
<>(
config
,
null
);
}
// 普通模式生成文件并下载
// 普通模式生成文件并下载
releaseExcel
(
req
,
excelDao
,
excel
);
releaseExcel
(
req
,
excelDao
,
excel
);
...
@@ -115,7 +110,19 @@ public class ExcelHttp<T extends Object> extends ExcelConsole<T> {
...
@@ -115,7 +110,19 @@ public class ExcelHttp<T extends Object> extends ExcelConsole<T> {
* @param excelDao dao层实现接口
* @param excelDao dao层实现接口
*/
*/
public
static
<
T
extends
Object
,
M
extends
Object
>
void
export
(
ExportBase
<
T
>
req
,
HttpServletResponse
response
,
ExcelDao
<
T
,
M
>
excelDao
)
{
public
static
<
T
extends
Object
,
M
extends
Object
>
void
export
(
ExportBase
<
T
>
req
,
HttpServletResponse
response
,
ExcelDao
<
T
,
M
>
excelDao
)
{
ExcelHttp
<
M
>
excel
=
export
(
req
,
excelDao
);
export
(
req
,
response
,
excelDao
,
null
);
}
/**
* 导出数据
*
* @param req 请求对接
* @param response 输出结果
* @param excelDao dao层实现接口
* @param excelStatus excel状态实现
*/
public
static
<
T
extends
Object
,
M
extends
Object
>
void
export
(
ExportBase
<
T
>
req
,
HttpServletResponse
response
,
ExcelDao
<
T
,
M
>
excelDao
,
ExcelStatus
<
M
>
excelStatus
)
{
ExcelHttp
<
M
>
excel
=
export
(
req
,
excelDao
,
excelStatus
);
try
{
try
{
// 等待下载模式,下载文件
// 等待下载模式,下载文件
excel
.
down
(
response
);
excel
.
down
(
response
);
...
...
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