Commit 02ff516f0fc506e69d636c4a5ed72b62dfa38a01
1 parent
6a36fe65
1. 完成通知模块的迁移
2. 实现 excel 导出的基础功能
Showing
13 changed files
with
47 additions
and
100 deletions
ruoyi-admin/src/main/resources/application.yml
| @@ -77,22 +77,6 @@ spring: | @@ -77,22 +77,6 @@ spring: | ||
| 77 | # #连接池最大阻塞等待时间(使用负值表示没有限制) | 77 | # #连接池最大阻塞等待时间(使用负值表示没有限制) |
| 78 | max-wait: -1ms | 78 | max-wait: -1ms |
| 79 | 79 | ||
| 80 | -# MyBatis配置 | ||
| 81 | -mybatis: | ||
| 82 | - # 搜索指定包别名 | ||
| 83 | - typeAliasesPackage: com.ruoyi.**.domain | ||
| 84 | - # 配置mapper的扫描,找到所有的mapper.xml映射文件 | ||
| 85 | - mapperLocations: classpath*:mapper/**/*Mapper.xml | ||
| 86 | - # 加载全局的配置文件 | ||
| 87 | - configLocation: classpath:mybatis/mybatis-config.xml | ||
| 88 | - | ||
| 89 | -# PageHelper分页插件 | ||
| 90 | -pagehelper: | ||
| 91 | - helperDialect: mysql | ||
| 92 | - reasonable: true | ||
| 93 | - supportMethodsArguments: true | ||
| 94 | - params: count=countSql | ||
| 95 | - | ||
| 96 | # Swagger配置 | 80 | # Swagger配置 |
| 97 | swagger: | 81 | swagger: |
| 98 | # 是否开启swagger | 82 | # 是否开启swagger |
ruoyi-framework/pom.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 3 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 4 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 5 | - <parent> | ||
| 6 | - <artifactId>ruoyi</artifactId> | ||
| 7 | - <groupId>com.ruoyi</groupId> | ||
| 8 | - <version>3.3.0</version> | ||
| 9 | - </parent> | ||
| 10 | - <modelVersion>4.0.0</modelVersion> | ||
| 11 | - | ||
| 12 | - <artifactId>ruoyi-framework</artifactId> | ||
| 13 | - | ||
| 14 | - <description> | ||
| 15 | - framework框架核心 | ||
| 16 | - </description> | ||
| 17 | - | ||
| 18 | - <dependencies> | ||
| 19 | - | ||
| 20 | - | ||
| 21 | - <!-- SpringBoot 拦截器 --> | ||
| 22 | - <dependency> | ||
| 23 | - <groupId>org.springframework.boot</groupId> | ||
| 24 | - <artifactId>spring-boot-starter-aop</artifactId> | ||
| 25 | - </dependency> | ||
| 26 | - | ||
| 27 | - <!-- 获取系统信息 --> | ||
| 28 | - <dependency> | ||
| 29 | - <groupId>com.github.oshi</groupId> | ||
| 30 | - <artifactId>oshi-core</artifactId> | ||
| 31 | - </dependency> | ||
| 32 | - | ||
| 33 | - </dependencies> | ||
| 34 | - | ||
| 35 | -</project> |
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java
| @@ -58,31 +58,16 @@ public class Cpu { | @@ -58,31 +58,16 @@ public class Cpu { | ||
| 58 | return Arith.round(Arith.mul(sys / total, 100), 2); | 58 | return Arith.round(Arith.mul(sys / total, 100), 2); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | - public void setSys(double sys) { | ||
| 62 | - this.sys = sys; | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | public double getUsed() { | 61 | public double getUsed() { |
| 66 | return Arith.round(Arith.mul(used / total, 100), 2); | 62 | return Arith.round(Arith.mul(used / total, 100), 2); |
| 67 | } | 63 | } |
| 68 | 64 | ||
| 69 | - public void setUsed(double used) { | ||
| 70 | - this.used = used; | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | public double getWait() { | 65 | public double getWait() { |
| 74 | return Arith.round(Arith.mul(wait / total, 100), 2); | 66 | return Arith.round(Arith.mul(wait / total, 100), 2); |
| 75 | } | 67 | } |
| 76 | 68 | ||
| 77 | - public void setWait(double wait) { | ||
| 78 | - this.wait = wait; | ||
| 79 | - } | ||
| 80 | - | ||
| 81 | public double getFree() { | 69 | public double getFree() { |
| 82 | return Arith.round(Arith.mul(free / total, 100), 2); | 70 | return Arith.round(Arith.mul(free / total, 100), 2); |
| 83 | } | 71 | } |
| 84 | 72 | ||
| 85 | - public void setFree(double free) { | ||
| 86 | - this.free = free; | ||
| 87 | - } | ||
| 88 | } | 73 | } |
ruoyi-ui/src/api/system/notice.js
| @@ -30,7 +30,7 @@ export function addNotice(data) { | @@ -30,7 +30,7 @@ export function addNotice(data) { | ||
| 30 | export function updateNotice(data) { | 30 | export function updateNotice(data) { |
| 31 | return request({ | 31 | return request({ |
| 32 | url: '/system/notice/update', | 32 | url: '/system/notice/update', |
| 33 | - method: 'put', | 33 | + method: 'post', |
| 34 | data: data | 34 | data: data |
| 35 | }) | 35 | }) |
| 36 | } | 36 | } |
| @@ -39,6 +39,6 @@ export function updateNotice(data) { | @@ -39,6 +39,6 @@ export function updateNotice(data) { | ||
| 39 | export function delNotice(noticeId) { | 39 | export function delNotice(noticeId) { |
| 40 | return request({ | 40 | return request({ |
| 41 | url: '/system/notice/delete?id=' + noticeId, | 41 | url: '/system/notice/delete?id=' + noticeId, |
| 42 | - method: 'delete' | 42 | + method: 'post' |
| 43 | }) | 43 | }) |
| 44 | } | 44 | } |
ruoyi-ui/src/api/system/user.js
| @@ -49,7 +49,8 @@ export function exportUser(query) { | @@ -49,7 +49,8 @@ export function exportUser(query) { | ||
| 49 | return request({ | 49 | return request({ |
| 50 | url: '/system/user/export', | 50 | url: '/system/user/export', |
| 51 | method: 'get', | 51 | method: 'get', |
| 52 | - params: query | 52 | + params: query, |
| 53 | + responseType: 'blob' | ||
| 53 | }) | 54 | }) |
| 54 | } | 55 | } |
| 55 | 56 |
ruoyi-ui/src/views/system/notice/index.vue
| @@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
| 49 | </el-row> | 49 | </el-row> |
| 50 | 50 | ||
| 51 | <el-table v-loading="loading" :data="noticeList"> | 51 | <el-table v-loading="loading" :data="noticeList"> |
| 52 | - <el-table-column label="序号" align="center" prop="noticeId" width="100" /> | 52 | + <el-table-column label="序号" align="center" prop="id" width="100" /> |
| 53 | <el-table-column | 53 | <el-table-column |
| 54 | label="公告标题" | 54 | label="公告标题" |
| 55 | align="center" | 55 | align="center" |
| @@ -117,11 +117,11 @@ | @@ -117,11 +117,11 @@ | ||
| 117 | <el-form-item label="公告类型" prop="type"> | 117 | <el-form-item label="公告类型" prop="type"> |
| 118 | <el-select v-model="form.type" placeholder="请选择"> | 118 | <el-select v-model="form.type" placeholder="请选择"> |
| 119 | <el-option | 119 | <el-option |
| 120 | - v-for="dict in typeOptions" | ||
| 121 | - :key="dict.dictValue" | ||
| 122 | - :label="dict.dictLabel" | ||
| 123 | - :value="dict.dictValue" | ||
| 124 | - ></el-option> | 120 | + v-for="dict in noticeTypeDictDatas" |
| 121 | + :key="parseInt(dict.value)" | ||
| 122 | + :label="dict.label" | ||
| 123 | + :value="parseInt(dict.value)" | ||
| 124 | + /> | ||
| 125 | </el-select> | 125 | </el-select> |
| 126 | </el-form-item> | 126 | </el-form-item> |
| 127 | </el-col> | 127 | </el-col> |
| @@ -131,9 +131,9 @@ | @@ -131,9 +131,9 @@ | ||
| 131 | <el-radio | 131 | <el-radio |
| 132 | v-for="dict in statusDictDatas" | 132 | v-for="dict in statusDictDatas" |
| 133 | :key="parseInt(dict.value)" | 133 | :key="parseInt(dict.value)" |
| 134 | - :label="dict.label" | ||
| 135 | - :value="parseInt(dict.value)" | 134 | + :label="parseInt(dict.value)" |
| 136 | >{{dict.label}}</el-radio> | 135 | >{{dict.label}}</el-radio> |
| 136 | + </el-radio-group> | ||
| 137 | </el-form-item> | 137 | </el-form-item> |
| 138 | </el-col> | 138 | </el-col> |
| 139 | <el-col :span="24"> | 139 | <el-col :span="24"> |
| @@ -177,10 +177,6 @@ export default { | @@ -177,10 +177,6 @@ export default { | ||
| 177 | title: "", | 177 | title: "", |
| 178 | // 是否显示弹出层 | 178 | // 是否显示弹出层 |
| 179 | open: false, | 179 | open: false, |
| 180 | - // 类型数据字典 | ||
| 181 | - statusOptions: [], | ||
| 182 | - // 状态数据字典 | ||
| 183 | - typeOptions: [], | ||
| 184 | // 查询参数 | 180 | // 查询参数 |
| 185 | queryParams: { | 181 | queryParams: { |
| 186 | pageNo: 1, | 182 | pageNo: 1, |
| @@ -227,7 +223,7 @@ export default { | @@ -227,7 +223,7 @@ export default { | ||
| 227 | }, | 223 | }, |
| 228 | // 公告状态字典翻译 | 224 | // 公告状态字典翻译 |
| 229 | typeFormat(row, column) { | 225 | typeFormat(row, column) { |
| 230 | - return getDictDataLabel(DICT_TYPE.SYS_NOTICE_TYPE, row.status) | 226 | + return getDictDataLabel(DICT_TYPE.SYS_NOTICE_TYPE, row.type) |
| 231 | }, | 227 | }, |
| 232 | // 取消按钮 | 228 | // 取消按钮 |
| 233 | cancel() { | 229 | cancel() { |
| @@ -237,7 +233,7 @@ export default { | @@ -237,7 +233,7 @@ export default { | ||
| 237 | // 表单重置 | 233 | // 表单重置 |
| 238 | reset() { | 234 | reset() { |
| 239 | this.form = { | 235 | this.form = { |
| 240 | - noticeId: undefined, | 236 | + id: undefined, |
| 241 | title: undefined, | 237 | title: undefined, |
| 242 | type: undefined, | 238 | type: undefined, |
| 243 | content: undefined, | 239 | content: undefined, |
| @@ -264,8 +260,8 @@ export default { | @@ -264,8 +260,8 @@ export default { | ||
| 264 | /** 修改按钮操作 */ | 260 | /** 修改按钮操作 */ |
| 265 | handleUpdate(row) { | 261 | handleUpdate(row) { |
| 266 | this.reset(); | 262 | this.reset(); |
| 267 | - const noticeId = row.noticeId || this.ids | ||
| 268 | - getNotice(noticeId).then(response => { | 263 | + const id = row.id || this.ids |
| 264 | + getNotice(id).then(response => { | ||
| 269 | this.form = response.data; | 265 | this.form = response.data; |
| 270 | this.open = true; | 266 | this.open = true; |
| 271 | this.title = "修改公告"; | 267 | this.title = "修改公告"; |
| @@ -275,7 +271,7 @@ export default { | @@ -275,7 +271,7 @@ export default { | ||
| 275 | submitForm: function() { | 271 | submitForm: function() { |
| 276 | this.$refs["form"].validate(valid => { | 272 | this.$refs["form"].validate(valid => { |
| 277 | if (valid) { | 273 | if (valid) { |
| 278 | - if (this.form.noticeId !== undefined) { | 274 | + if (this.form.id !== undefined) { |
| 279 | updateNotice(this.form).then(response => { | 275 | updateNotice(this.form).then(response => { |
| 280 | this.msgSuccess("修改成功"); | 276 | this.msgSuccess("修改成功"); |
| 281 | this.open = false; | 277 | this.open = false; |
| @@ -293,13 +289,13 @@ export default { | @@ -293,13 +289,13 @@ export default { | ||
| 293 | }, | 289 | }, |
| 294 | /** 删除按钮操作 */ | 290 | /** 删除按钮操作 */ |
| 295 | handleDelete(row) { | 291 | handleDelete(row) { |
| 296 | - const noticeIds = row.noticeId || this.ids | ||
| 297 | - this.$confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', "警告", { | 292 | + const ids = row.id || this.ids |
| 293 | + this.$confirm('是否确认删除公告编号为"' + ids + '"的数据项?', "警告", { | ||
| 298 | confirmButtonText: "确定", | 294 | confirmButtonText: "确定", |
| 299 | cancelButtonText: "取消", | 295 | cancelButtonText: "取消", |
| 300 | type: "warning" | 296 | type: "warning" |
| 301 | }).then(function() { | 297 | }).then(function() { |
| 302 | - return delNotice(noticeIds); | 298 | + return delNotice(ids); |
| 303 | }).then(() => { | 299 | }).then(() => { |
| 304 | this.getList(); | 300 | this.getList(); |
| 305 | this.msgSuccess("删除成功"); | 301 | this.msgSuccess("删除成功"); |
ruoyi-ui/src/views/system/user/index.vue
| @@ -655,7 +655,15 @@ export default { | @@ -655,7 +655,15 @@ export default { | ||
| 655 | }).then(function() { | 655 | }).then(function() { |
| 656 | return exportUser(queryParams); | 656 | return exportUser(queryParams); |
| 657 | }).then(response => { | 657 | }).then(response => { |
| 658 | - this.download(response.msg); | 658 | + // this.download(response.msg); |
| 659 | + let blob = new Blob([response], {type: 'application/vnd.ms-excel'}); | ||
| 660 | + window.URL = window.URL || window.webkitURL; | ||
| 661 | + let href = URL.createObjectURL(blob); | ||
| 662 | + let downA = document.createElement("a"); | ||
| 663 | + downA.href = href;// | ||
| 664 | + downA.download = '123321.xls'; | ||
| 665 | + downA.click(); | ||
| 666 | + window.URL.revokeObjectURL(href); | ||
| 659 | }) | 667 | }) |
| 660 | }, | 668 | }, |
| 661 | /** 导入按钮操作 */ | 669 | /** 导入按钮操作 */ |
src/main/java/cn/iocoder/dashboard/modules/system/controller/auth/SysAuthController.java
| @@ -2,10 +2,10 @@ package cn.iocoder.dashboard.modules.system.controller.auth; | @@ -2,10 +2,10 @@ package cn.iocoder.dashboard.modules.system.controller.auth; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.common.enums.CommonStatusEnum; | 3 | import cn.iocoder.dashboard.common.enums.CommonStatusEnum; |
| 4 | import cn.iocoder.dashboard.common.pojo.CommonResult; | 4 | import cn.iocoder.dashboard.common.pojo.CommonResult; |
| 5 | -import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthMenuRespVO; | ||
| 6 | -import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthPermissionInfoRespVO; | ||
| 7 | import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthLoginReqVO; | 5 | import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthLoginReqVO; |
| 8 | import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthLoginRespVO; | 6 | import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthLoginRespVO; |
| 7 | +import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthMenuRespVO; | ||
| 8 | +import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthPermissionInfoRespVO; | ||
| 9 | import cn.iocoder.dashboard.modules.system.convert.auth.SysAuthConvert; | 9 | import cn.iocoder.dashboard.modules.system.convert.auth.SysAuthConvert; |
| 10 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysMenuDO; | 10 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysMenuDO; |
| 11 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO; | 11 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO; |
| @@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.*; | @@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.*; | ||
| 22 | 22 | ||
| 23 | import javax.annotation.Resource; | 23 | import javax.annotation.Resource; |
| 24 | import javax.validation.Valid; | 24 | import javax.validation.Valid; |
| 25 | - | ||
| 26 | import java.util.List; | 25 | import java.util.List; |
| 27 | 26 | ||
| 28 | import static cn.iocoder.dashboard.common.pojo.CommonResult.success; | 27 | import static cn.iocoder.dashboard.common.pojo.CommonResult.success; |
src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeCreateReqVO.java
| 1 | package cn.iocoder.dashboard.modules.system.controller.notice.vo; | 1 | package cn.iocoder.dashboard.modules.system.controller.notice.vo; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.modules.system.controller.dept.vo.post.SysPostBaseVO; | ||
| 4 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | import lombok.EqualsAndHashCode; | 5 | import lombok.EqualsAndHashCode; |
| @@ -8,5 +7,5 @@ import lombok.EqualsAndHashCode; | @@ -8,5 +7,5 @@ import lombok.EqualsAndHashCode; | ||
| 8 | @ApiModel("通知公告创建 Request VO") | 7 | @ApiModel("通知公告创建 Request VO") |
| 9 | @Data | 8 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 9 | @EqualsAndHashCode(callSuper = true) |
| 11 | -public class SysNoticeCreateReqVO extends SysPostBaseVO { | 10 | +public class SysNoticeCreateReqVO extends SysNoticeBaseVO { |
| 12 | } | 11 | } |
src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeRespVO.java
| 1 | package cn.iocoder.dashboard.modules.system.controller.notice.vo; | 1 | package cn.iocoder.dashboard.modules.system.controller.notice.vo; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.modules.system.controller.dept.vo.post.SysPostBaseVO; | ||
| 4 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 5 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| @@ -11,7 +10,7 @@ import java.util.Date; | @@ -11,7 +10,7 @@ import java.util.Date; | ||
| 11 | @ApiModel("通知公告信息 Response VO") | 10 | @ApiModel("通知公告信息 Response VO") |
| 12 | @Data | 11 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 14 | -public class SysNoticeRespVO extends SysPostBaseVO { | 13 | +public class SysNoticeRespVO extends SysNoticeBaseVO { |
| 15 | 14 | ||
| 16 | @ApiModelProperty(value = "通知公告序号", required = true, example = "1024") | 15 | @ApiModelProperty(value = "通知公告序号", required = true, example = "1024") |
| 17 | private Long id; | 16 | private Long id; |
src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeUpdateReqVO.java
| 1 | package cn.iocoder.dashboard.modules.system.controller.notice.vo; | 1 | package cn.iocoder.dashboard.modules.system.controller.notice.vo; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.modules.system.controller.dept.vo.post.SysPostBaseVO; | ||
| 4 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 5 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| @@ -11,7 +10,7 @@ import javax.validation.constraints.NotNull; | @@ -11,7 +10,7 @@ import javax.validation.constraints.NotNull; | ||
| 11 | @ApiModel("岗位公告更新 Request VO") | 10 | @ApiModel("岗位公告更新 Request VO") |
| 12 | @Data | 11 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 14 | -public class SysNoticeUpdateReqVO extends SysPostBaseVO { | 13 | +public class SysNoticeUpdateReqVO extends SysNoticeBaseVO { |
| 15 | 14 | ||
| 16 | @ApiModelProperty(value = "岗位公告编号", required = true, example = "1024") | 15 | @ApiModelProperty(value = "岗位公告编号", required = true, example = "1024") |
| 17 | @NotNull(message = "岗位公告编号不能为空") | 16 | @NotNull(message = "岗位公告编号不能为空") |
src/main/java/cn/iocoder/dashboard/modules/system/controller/user/SysUserController.java
| @@ -10,6 +10,7 @@ import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.user.SysUserDO; | @@ -10,6 +10,7 @@ import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.user.SysUserDO; | ||
| 10 | import cn.iocoder.dashboard.modules.system.service.dept.SysDeptService; | 10 | import cn.iocoder.dashboard.modules.system.service.dept.SysDeptService; |
| 11 | import cn.iocoder.dashboard.modules.system.service.user.SysUserService; | 11 | import cn.iocoder.dashboard.modules.system.service.user.SysUserService; |
| 12 | import cn.iocoder.dashboard.util.collection.CollectionUtils; | 12 | import cn.iocoder.dashboard.util.collection.CollectionUtils; |
| 13 | +import com.alibaba.excel.EasyExcel; | ||
| 13 | import io.swagger.annotations.Api; | 14 | import io.swagger.annotations.Api; |
| 14 | import io.swagger.annotations.ApiImplicitParam; | 15 | import io.swagger.annotations.ApiImplicitParam; |
| 15 | import io.swagger.annotations.ApiOperation; | 16 | import io.swagger.annotations.ApiOperation; |
| @@ -17,6 +18,8 @@ import org.springframework.validation.annotation.Validated; | @@ -17,6 +18,8 @@ import org.springframework.validation.annotation.Validated; | ||
| 17 | import org.springframework.web.bind.annotation.*; | 18 | import org.springframework.web.bind.annotation.*; |
| 18 | 19 | ||
| 19 | import javax.annotation.Resource; | 20 | import javax.annotation.Resource; |
| 21 | +import javax.servlet.http.HttpServletResponse; | ||
| 22 | +import java.io.IOException; | ||
| 20 | import java.util.*; | 23 | import java.util.*; |
| 21 | 24 | ||
| 22 | import static cn.iocoder.dashboard.common.pojo.CommonResult.success; | 25 | import static cn.iocoder.dashboard.common.pojo.CommonResult.success; |
| @@ -116,6 +119,15 @@ public class SysUserController { | @@ -116,6 +119,15 @@ public class SysUserController { | ||
| 116 | return success(true); | 119 | return success(true); |
| 117 | } | 120 | } |
| 118 | 121 | ||
| 122 | + @ApiOperation("导出用户") | ||
| 123 | + @GetMapping("/export") | ||
| 124 | + public void exportUsers(HttpServletResponse response) throws IOException { | ||
| 125 | + String fileName = "测试文件.xls"; | ||
| 126 | + response.addHeader("Content-Disposition", "attachment;filename=" + fileName); | ||
| 127 | + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); | ||
| 128 | + EasyExcel.write(response.getOutputStream(), SysUserExcelVO.class).sheet().doWrite(new ArrayList<>()); | ||
| 129 | + } | ||
| 130 | + | ||
| 119 | // @Log(title = "用户管理", businessType = BusinessType.EXPORT) | 131 | // @Log(title = "用户管理", businessType = BusinessType.EXPORT) |
| 120 | // @PreAuthorize("@ss.hasPermi('system:user:export')") | 132 | // @PreAuthorize("@ss.hasPermi('system:user:export')") |
| 121 | // @GetMapping("/export") | 133 | // @GetMapping("/export") |
src/main/java/cn/iocoder/dashboard/modules/system/service/notice/impl/SysNoticeServiceImpl.java
| @@ -5,7 +5,6 @@ import cn.iocoder.dashboard.common.pojo.PageResult; | @@ -5,7 +5,6 @@ import cn.iocoder.dashboard.common.pojo.PageResult; | ||
| 5 | import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticeCreateReqVO; | 5 | import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticeCreateReqVO; |
| 6 | import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticePageReqVO; | 6 | import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticePageReqVO; |
| 7 | import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticeUpdateReqVO; | 7 | import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticeUpdateReqVO; |
| 8 | -import cn.iocoder.dashboard.modules.system.convert.dept.SysPostConvert; | ||
| 9 | import cn.iocoder.dashboard.modules.system.convert.notice.SysNoticeConvert; | 8 | import cn.iocoder.dashboard.modules.system.convert.notice.SysNoticeConvert; |
| 10 | import cn.iocoder.dashboard.modules.system.dal.mysql.dao.notice.SysNoticeMapper; | 9 | import cn.iocoder.dashboard.modules.system.dal.mysql.dao.notice.SysNoticeMapper; |
| 11 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.notice.SysNoticeDO; | 10 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.notice.SysNoticeDO; |
| @@ -40,6 +39,7 @@ public class SysNoticeServiceImpl implements SysNoticeService { | @@ -40,6 +39,7 @@ public class SysNoticeServiceImpl implements SysNoticeService { | ||
| 40 | @Override | 39 | @Override |
| 41 | public Long createNotice(SysNoticeCreateReqVO reqVO) { | 40 | public Long createNotice(SysNoticeCreateReqVO reqVO) { |
| 42 | SysNoticeDO notice = SysNoticeConvert.INSTANCE.convert(reqVO); | 41 | SysNoticeDO notice = SysNoticeConvert.INSTANCE.convert(reqVO); |
| 42 | + noticeMapper.insert(notice); | ||
| 43 | return notice.getId(); | 43 | return notice.getId(); |
| 44 | } | 44 | } |
| 45 | 45 |