diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 4dd6f2e9c..929a8352f 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -77,22 +77,6 @@ spring: # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms -# MyBatis配置 -mybatis: - # 搜索指定包别名 - typeAliasesPackage: com.ruoyi.**.domain - # 配置mapper的扫描,找到所有的mapper.xml映射文件 - mapperLocations: classpath*:mapper/**/*Mapper.xml - # 加载全局的配置文件 - configLocation: classpath:mybatis/mybatis-config.xml - -# PageHelper分页插件 -pagehelper: - helperDialect: mysql - reasonable: true - supportMethodsArguments: true - params: count=countSql - # Swagger配置 swagger: # 是否开启swagger diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml deleted file mode 100644 index 64095c618..000000000 --- a/ruoyi-framework/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - ruoyi - com.ruoyi - 3.3.0 - - 4.0.0 - - ruoyi-framework - - - framework框架核心 - - - - - - - - org.springframework.boot - spring-boot-starter-aop - - - - - com.github.oshi - oshi-core - - - - - diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java index 89040c21f..5e0d150a8 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java @@ -58,31 +58,16 @@ public class Cpu { return Arith.round(Arith.mul(sys / total, 100), 2); } - public void setSys(double sys) { - this.sys = sys; - } - public double getUsed() { return Arith.round(Arith.mul(used / total, 100), 2); } - public void setUsed(double used) { - this.used = used; - } - public double getWait() { return Arith.round(Arith.mul(wait / total, 100), 2); } - public void setWait(double wait) { - this.wait = wait; - } - public double getFree() { return Arith.round(Arith.mul(free / total, 100), 2); } - public void setFree(double free) { - this.free = free; - } } diff --git a/ruoyi-ui/src/api/system/notice.js b/ruoyi-ui/src/api/system/notice.js index b8c7cf709..744bba745 100644 --- a/ruoyi-ui/src/api/system/notice.js +++ b/ruoyi-ui/src/api/system/notice.js @@ -30,7 +30,7 @@ export function addNotice(data) { export function updateNotice(data) { return request({ url: '/system/notice/update', - method: 'put', + method: 'post', data: data }) } @@ -39,6 +39,6 @@ export function updateNotice(data) { export function delNotice(noticeId) { return request({ url: '/system/notice/delete?id=' + noticeId, - method: 'delete' + method: 'post' }) } diff --git a/ruoyi-ui/src/api/system/user.js b/ruoyi-ui/src/api/system/user.js index 5d63dd4ad..b739d0ad0 100644 --- a/ruoyi-ui/src/api/system/user.js +++ b/ruoyi-ui/src/api/system/user.js @@ -49,7 +49,8 @@ export function exportUser(query) { return request({ url: '/system/user/export', method: 'get', - params: query + params: query, + responseType: 'blob' }) } diff --git a/ruoyi-ui/src/views/system/notice/index.vue b/ruoyi-ui/src/views/system/notice/index.vue index 24105bc0a..bc46b0d1b 100644 --- a/ruoyi-ui/src/views/system/notice/index.vue +++ b/ruoyi-ui/src/views/system/notice/index.vue @@ -49,7 +49,7 @@ - + + v-for="dict in noticeTypeDictDatas" + :key="parseInt(dict.value)" + :label="dict.label" + :value="parseInt(dict.value)" + /> @@ -131,9 +131,9 @@ {{dict.label}} + @@ -177,10 +177,6 @@ export default { title: "", // 是否显示弹出层 open: false, - // 类型数据字典 - statusOptions: [], - // 状态数据字典 - typeOptions: [], // 查询参数 queryParams: { pageNo: 1, @@ -227,7 +223,7 @@ export default { }, // 公告状态字典翻译 typeFormat(row, column) { - return getDictDataLabel(DICT_TYPE.SYS_NOTICE_TYPE, row.status) + return getDictDataLabel(DICT_TYPE.SYS_NOTICE_TYPE, row.type) }, // 取消按钮 cancel() { @@ -237,7 +233,7 @@ export default { // 表单重置 reset() { this.form = { - noticeId: undefined, + id: undefined, title: undefined, type: undefined, content: undefined, @@ -264,8 +260,8 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - const noticeId = row.noticeId || this.ids - getNotice(noticeId).then(response => { + const id = row.id || this.ids + getNotice(id).then(response => { this.form = response.data; this.open = true; this.title = "修改公告"; @@ -275,7 +271,7 @@ export default { submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { - if (this.form.noticeId !== undefined) { + if (this.form.id !== undefined) { updateNotice(this.form).then(response => { this.msgSuccess("修改成功"); this.open = false; @@ -293,13 +289,13 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - const noticeIds = row.noticeId || this.ids - this.$confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', "警告", { + const ids = row.id || this.ids + this.$confirm('是否确认删除公告编号为"' + ids + '"的数据项?', "警告", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }).then(function() { - return delNotice(noticeIds); + return delNotice(ids); }).then(() => { this.getList(); this.msgSuccess("删除成功"); diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index 1662c2ec5..15e18205a 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -655,7 +655,15 @@ export default { }).then(function() { return exportUser(queryParams); }).then(response => { - this.download(response.msg); + // this.download(response.msg); + let blob = new Blob([response], {type: 'application/vnd.ms-excel'}); + window.URL = window.URL || window.webkitURL; + let href = URL.createObjectURL(blob); + let downA = document.createElement("a"); + downA.href = href;// + downA.download = '123321.xls'; + downA.click(); + window.URL.revokeObjectURL(href); }) }, /** 导入按钮操作 */ diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/auth/SysAuthController.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/auth/SysAuthController.java index 86b643f6c..008482420 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/auth/SysAuthController.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/auth/SysAuthController.java @@ -2,10 +2,10 @@ package cn.iocoder.dashboard.modules.system.controller.auth; import cn.iocoder.dashboard.common.enums.CommonStatusEnum; import cn.iocoder.dashboard.common.pojo.CommonResult; -import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthMenuRespVO; -import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthPermissionInfoRespVO; import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthLoginReqVO; import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthLoginRespVO; +import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthMenuRespVO; +import cn.iocoder.dashboard.modules.system.controller.auth.vo.SysAuthPermissionInfoRespVO; import cn.iocoder.dashboard.modules.system.convert.auth.SysAuthConvert; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysMenuDO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO; @@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; - import java.util.List; import static cn.iocoder.dashboard.common.pojo.CommonResult.success; diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeCreateReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeCreateReqVO.java index 9cfe3b31f..1a1811447 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeCreateReqVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeCreateReqVO.java @@ -1,6 +1,5 @@ package cn.iocoder.dashboard.modules.system.controller.notice.vo; -import cn.iocoder.dashboard.modules.system.controller.dept.vo.post.SysPostBaseVO; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.EqualsAndHashCode; @@ -8,5 +7,5 @@ import lombok.EqualsAndHashCode; @ApiModel("通知公告创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) -public class SysNoticeCreateReqVO extends SysPostBaseVO { +public class SysNoticeCreateReqVO extends SysNoticeBaseVO { } diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeRespVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeRespVO.java index bb917e35f..afca87f79 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeRespVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeRespVO.java @@ -1,6 +1,5 @@ package cn.iocoder.dashboard.modules.system.controller.notice.vo; -import cn.iocoder.dashboard.modules.system.controller.dept.vo.post.SysPostBaseVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -11,7 +10,7 @@ import java.util.Date; @ApiModel("通知公告信息 Response VO") @Data @EqualsAndHashCode(callSuper = true) -public class SysNoticeRespVO extends SysPostBaseVO { +public class SysNoticeRespVO extends SysNoticeBaseVO { @ApiModelProperty(value = "通知公告序号", required = true, example = "1024") private Long id; diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeUpdateReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeUpdateReqVO.java index b8c82032e..fffe4b84c 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeUpdateReqVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/notice/vo/SysNoticeUpdateReqVO.java @@ -1,6 +1,5 @@ package cn.iocoder.dashboard.modules.system.controller.notice.vo; -import cn.iocoder.dashboard.modules.system.controller.dept.vo.post.SysPostBaseVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -11,7 +10,7 @@ import javax.validation.constraints.NotNull; @ApiModel("岗位公告更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) -public class SysNoticeUpdateReqVO extends SysPostBaseVO { +public class SysNoticeUpdateReqVO extends SysNoticeBaseVO { @ApiModelProperty(value = "岗位公告编号", required = true, example = "1024") @NotNull(message = "岗位公告编号不能为空") diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/user/SysUserController.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/user/SysUserController.java index 7e392e762..4018a5a22 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/user/SysUserController.java +++ b/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; import cn.iocoder.dashboard.modules.system.service.dept.SysDeptService; import cn.iocoder.dashboard.modules.system.service.user.SysUserService; import cn.iocoder.dashboard.util.collection.CollectionUtils; +import com.alibaba.excel.EasyExcel; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; @@ -17,6 +18,8 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.*; import static cn.iocoder.dashboard.common.pojo.CommonResult.success; @@ -116,6 +119,15 @@ public class SysUserController { return success(true); } + @ApiOperation("导出用户") + @GetMapping("/export") + public void exportUsers(HttpServletResponse response) throws IOException { + String fileName = "测试文件.xls"; + response.addHeader("Content-Disposition", "attachment;filename=" + fileName); + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); + EasyExcel.write(response.getOutputStream(), SysUserExcelVO.class).sheet().doWrite(new ArrayList<>()); + } + // @Log(title = "用户管理", businessType = BusinessType.EXPORT) // @PreAuthorize("@ss.hasPermi('system:user:export')") // @GetMapping("/export") diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/service/notice/impl/SysNoticeServiceImpl.java b/src/main/java/cn/iocoder/dashboard/modules/system/service/notice/impl/SysNoticeServiceImpl.java index 04097f7ef..b40bef781 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/service/notice/impl/SysNoticeServiceImpl.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/service/notice/impl/SysNoticeServiceImpl.java @@ -5,7 +5,6 @@ import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticeCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticePageReqVO; import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticeUpdateReqVO; -import cn.iocoder.dashboard.modules.system.convert.dept.SysPostConvert; import cn.iocoder.dashboard.modules.system.convert.notice.SysNoticeConvert; import cn.iocoder.dashboard.modules.system.dal.mysql.dao.notice.SysNoticeMapper; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.notice.SysNoticeDO; @@ -40,6 +39,7 @@ public class SysNoticeServiceImpl implements SysNoticeService { @Override public Long createNotice(SysNoticeCreateReqVO reqVO) { SysNoticeDO notice = SysNoticeConvert.INSTANCE.convert(reqVO); + noticeMapper.insert(notice); return notice.getId(); }