Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes
Project
Project
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
ximai
mes
Commits
002253e2
Commit
002253e2
authored
Oct 21, 2024
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
excel导出方法调整
parent
e3ba36e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
controller.java.vm
generator/src/main/resources/vm/java/controller.java.vm
+5
-5
No files found.
generator/src/main/resources/vm/java/controller.java.vm
View file @
002253e2
...
...
@@ -26,8 +26,9 @@ import ${packageName}.dto${childPackageName}.${ClassName}Create;
import
${
packageName
}.
dto
${
childPackageName
}.${
ClassName
}
Update
;
import
${
packageName
}.
dto
${
childPackageName
}.${
ClassName
}
ExcelExport
;
import
${
packageName
}.
service
${
childPackageName
}.
I
${
ClassName
}
Service
;
import
com
.
ximai
.
common
.
utils
.
poi
.
ExcelUtil
;
import
com
.
ximai
.
common
.
utils
.
excel
.
ExcelWriter
;
import
cn
.
hutool
.
core
.
bean
.
BeanUtil
;
import
java
.
io
.
IOException
;
#
if
($
table
.
crud
||
$
table
.
sub
)
import
com
.
ximai
.
common
.
core
.
page
.
TableDataInfo
;
#
elseif
($
table
.
tree
)
...
...
@@ -97,11 +98,10 @@ public class ${ClassName}Controller extends BaseController
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:export')"
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
EXPORT
)
@
PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
${
ClassName
}
${
className
})
{
public
void
export
(
HttpServletResponse
response
,
${
ClassName
}
${
className
})
throws
IOException
{
List
<${
ClassName
}
Dto
>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
ExcelUtil
<${
ClassName
}
ExcelExport
>
util
=
new
ExcelUtil
<${
ClassName
}
ExcelExport
>(${
ClassName
}
ExcelExport
.
class
);
List
<${
ClassName
}
ExcelExport
>
tempList
=
BeanUtil
.
copyToList
(
list
,
${
ClassName
}
ExcelExport
.
class
);
util
.
exportExcel
(
response
,
tempList
,
"${functionName}数据"
);
List
<${
ClassName
}
ExcelExport
>
exportList
=
BeanUtil
.
copyToList
(
list
,
${
ClassName
}
ExcelExport
.
class
);
ExcelWriter
.
write
(
response
,
${
ClassName
}
ExcelExport
.
class
,
exportList
);
}
/**
...
...
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