Compare commits

...

537 Commits
v2.3 ... master

Author SHA1 Message Date
1020109007@qq.com e1c9e88a52 使用nginx代理后,需要进行请求ip的重新提取,将真实的请求ip提取出来,否则无法微信请求 2021-12-21 15:15:02 +08:00
1020109007@qq.com d603e15ca8 最近完整 2021-12-19 12:39:15 +08:00
1020109007@qq.com 8a4bf18611 最近完整 2021-12-19 11:35:56 +08:00
1020109007@qq.com 1243a89f2a Merge remote-tracking branch 'origin/master' 2021-12-19 11:28:19 +08:00
1020109007@qq.com d5eafdd147 Revert "最近版本保存"
This reverts commit 30be2b01
2021-12-19 11:27:42 +08:00
laohan 35a1448ff4
删除文件 ruoyi-ui 2021-12-19 02:50:33 +00:00
1020109007@qq.com 30be2b01e2 最近版本保存 2021-12-14 15:55:31 +08:00
1020109007@qq.com 644e02547e 完善了会员卡列表,优惠券列表信息,并绑定了卡片的背景图 2021-11-05 16:52:00 +08:00
1020109007@qq.com d6ec6b1949 绑定时将用户微信信息写入redis,支付和提现时,先取redis,没有则重新向微信请求微信信息,并保存。超时7100秒 2021-11-05 14:50:41 +08:00
1020109007@qq.com ad00a1aeaf 多个项目 2021-11-05 10:03:40 +08:00
1020109007@qq.com 7445f7ac6a 多个项目 2021-11-04 19:28:38 +08:00
1020109007@qq.com 57f5b1b939 对后台管理界面对用户推荐设置增加重复检查 2021-11-04 19:16:41 +08:00
1020109007@qq.com cae2fbdc3c 对后台管理界面对商家图片增加重复检查 2021-11-04 11:02:29 +08:00
1020109007@qq.com b53fc86ce7 对后台管理界面对首页,商家标签,进行重复检查,如果禁止重复添加 2021-11-04 10:43:06 +08:00
1020109007@qq.com 91b51320c1 对后台管理界面完善了排序,增加了图片的展示,在商家基础信息表中,增加只修改商家详情内容的弹窗和功能 2021-11-03 19:01:10 +08:00
1020109007@qq.com 55b9415a74 对后台管理界面部分已开放的功能,增加了一些排序的方案 2021-11-02 14:09:16 +08:00
1020109007@qq.com d5023e4221 对后台管理中销售人员,会员推荐控制,商家累积评价,商户余额信息,商户提现记录表,商户核卡管理,商家图片,商家标签,商户奖励功能界面进行完善及相应的更新后台管理的接口 2021-11-02 11:25:47 +08:00
1020109007@qq.com b2f1e18a07 系统设置增加用户隐私协议,会员充值协议,解决了可买多张卡的bug,解决了商家赠卡核消bug。 2021-10-29 18:28:31 +08:00
1020109007@qq.com 441c0b01ac 解决平台基础信息设置,完善运营商管理功能 2021-10-28 18:21:16 +08:00
1020109007@qq.com 5259ee8419 增加用户优惠券列表带商户id,便于跳转到指定商户详情,增加用户协调接口及相关的类。后期需要把网站基础信息做成全局可用,便于从后台管理界面进行基础信息设置及管理 2021-10-25 15:22:48 +08:00
1020109007@qq.com 6557fc5f43 完善推荐人信息绑定,完善推荐人(商户,用户)返利计算,提示跨地区注册用户,完成赠卡流程,完善商户核消统计 2021-10-24 00:59:25 +08:00
1020109007@qq.com 69ac550fc0 小程序后端个人中心返回信息中,增加用户注册地,推荐人信息 2021-10-16 23:27:27 +08:00
1020109007@qq.com 630831b315 vue端完善给运营商相关的商家界面,完善了标签等管理。后台后商admin,完善了后台的相关接口。小程序后端完善了标签和搜索功能 2021-10-16 15:07:40 +08:00
1020109007@qq.com ab75d446bc 调试微信支付,已发现可能是绑定时微信openid获取不正确 2021-10-02 00:56:26 +08:00
1020109007@qq.com f513c18d3c 补充留存文件 2021-10-01 22:15:22 +08:00
1020109007@qq.com e9ec13475e 在每个controller增加调试信息 2021-10-01 09:59:26 +08:00
1020109007@qq.com cfae0404fc 增加了海报功能(未完善),redis选库,小程序后台去掉对frame中的jwt依赖 2021-09-24 13:40:20 +08:00
1020109007@qq.com d972b2b661 增加了海报功能(未完善),redis选库,小程序后台去掉对frame中的jwt依赖 2021-09-24 13:27:59 +08:00
1020109007@qq.com bda9c6054e segchk商城接口层进行了整理 2021-08-27 18:11:17 +08:00
1020109007@qq.com e4f6b13dd6 增加segchk相关代码mvc三层 2021-08-26 16:18:00 +08:00
1020109007@qq.com c9d9135ea2 增加segchk相关代码 2021-08-25 15:11:12 +08:00
1020109007@qq.com 0449ad1ddb 增加vue跳转js文件 2021-08-25 15:08:03 +08:00
1020109007@qq.com d18b4e53f9 初始版本 2021-08-22 00:40:59 +08:00
RuoYi cb5ee9c8a1 补充定时任务表字段注释 2021-08-20 11:04:15 +08:00
RuoYi 1e37f0430b 定时任务屏蔽ldap远程调用 2021-08-19 15:26:22 +08:00
若依 295173258c !295 update 优化 使用权限工具 获取用户信息
Merge pull request !295 from 疯狂的狮子Li/update
2021-08-19 06:55:13 +00:00
若依 fec90d0487 !294 update ruoyi-ui/src/layout/index.vue.
Merge pull request !294 from aasdd/N/A
2021-08-19 06:49:06 +00:00
疯狂的狮子li aead560227 update 优化 使用权限工具 获取用户信息 2021-08-19 11:13:59 +08:00
aasdd 8133c60ab3 update ruoyi-ui/src/layout/index.vue.
删掉此处代码,使右边栏动画生效。现在是没有动画的
2021-08-18 09:29:22 +00:00
RuoYi 5c155f5f11 支持自定义注解实现接口限流 2021-08-17 14:08:18 +08:00
RuoYi 03cf98d3c9 优化异常信息 2021-08-16 16:25:25 +08:00
若依 6f51f729ba !289 添加日期范围支持重复添加多组日期范围,请求参数中对象的属性为null、undefined不进行拼接
Merge pull request !289 from wangzhaoqiang/master
2021-08-16 08:23:27 +00:00
wangzhaoqiang 57b159eb98 添加日期范围支持重复添加多组日期范围,请求参数中对象的属性为null、undefined不进行拼接 2021-08-16 14:48:34 +08:00
若依 08da6834a5 !288 修正方法名单词拼写错误
Merge pull request !288 from 稚屿/N/A
2021-08-16 02:36:36 +00:00
若依 268468fb47 !287 更新到【默认首页使用keep-alive缓存】后报错
Merge pull request !287 from wangzhaoqiang/master
2021-08-16 02:36:29 +00:00
稚屿 333e19339c 修正方法名单词拼写错误 2021-08-15 10:26:05 +00:00
wangzhaoqiang 7b6ccd9b22 解决登录后浏览器后台Breadcrumb组件报错 2021-08-14 20:16:48 +08:00
RuoYi 5d6f134609 多图上传组件移除多余的api地址 2021-08-13 15:15:35 +08:00
RuoYi f02743bde5 代码生成主子表多选行数据 2021-08-13 14:50:35 +08:00
RuoYi 3003bb0f50 Excel注解图片导入兼容xls 2021-08-13 10:56:35 +08:00
RuoYi 5139265d32 默认首页使用keep-alive缓存 2021-08-13 10:10:29 +08:00
若依 8a67af6c26 !285 修复角色分配用户页面接收参数与传递参数类型不一致导致的错误
Merge pull request !285 from 稚屿/N/A
2021-08-13 01:55:58 +00:00
若依 8e4802505e !284 添加SysConfigservice,SysDictTypeService的实现方法遗漏的@Override注解
Merge pull request !284 from Old丶x/master
2021-08-13 01:55:52 +00:00
稚屿 8ee641c1bc 修复角色分配用户页面接收参数与传递参数类型不一致导致的错误 2021-08-13 01:08:00 +00:00
mroldx 779508989f 添加加载字典数据,清空字典数据,重置字典数据方法上遗漏的@Override注解 2021-08-12 17:30:31 +08:00
mroldx d9e805a6a5 添加获取验证码方法上遗漏的@Override注解 2021-08-12 17:19:56 +08:00
RuoYi 7be17ea89a Excel注解支持Image图片导入 2021-08-11 10:13:34 +08:00
RuoYi 1f07641d9b update bin 2021-08-11 10:11:13 +08:00
若依 c0f4f805d0 !281 补全注册用户方法上遗漏的@Override注解
Merge pull request !281 from 稚屿/N/A
2021-08-11 02:08:58 +00:00
稚屿 b84224d7ba 补全注册用户方法上遗漏的@Override注解 2021-08-08 14:08:52 +00:00
RuoYi 98a143f1fe 添加新群号:101456076 2021-08-08 19:50:50 +08:00
RuoYi 3243428009 优化用户不能删除自己 2021-08-08 19:12:52 +08:00
RuoYi 7736097f6b 提取通用方法到基类控制器 2021-08-08 19:12:12 +08:00
RuoYi fc60c003c3 升级element-ui到最新版本2.15.5 2021-08-06 14:31:39 +08:00
RuoYi 68ae4df2dc 升级commons.io到最新版本v2.11.0 2021-07-31 17:52:06 +08:00
RuoYi de33e6ecc8 优化代码生成模板 2021-07-30 22:18:20 +08:00
RuoYi a1cc346aca 优化代码生成模板 2021-07-30 21:50:47 +08:00
RuoYi 5397e345ca 新增是否开启用户注册功能 2021-07-30 21:23:35 +08:00
RuoYi 8ed7916b61 定时任务屏蔽http(s)远程调用 2021-07-30 11:28:46 +08:00
RuoYi 2de5cc52d1 启用父部门状态排除顶级节点 2021-07-30 11:28:04 +08:00
RuoYi f6bc28000e 防止错误token导致的解析异常 2021-07-29 17:32:55 +08:00
RuoYi 6b5dd4d2be 优化XSS跨站脚本过滤 2021-07-28 16:04:59 +08:00
RuoYi e6becb9337 BLOB下载时清除URL对象引用 2021-07-28 13:13:28 +08:00
RuoYi 8da55fb72a 添加新群号:101456076 2021-07-28 09:51:19 +08:00
RuoYi 6a5c86541a 跳转路由高亮相对应的菜单栏 2021-07-27 11:54:20 +08:00
RuoYi 3803ac78e2 升级oshi到最新版本v5.8.0 2021-07-27 11:53:59 +08:00
Ricky 4095a1b6ee !275 fix Issue #I42GRW 任意账户越权漏洞
Merge pull request !275 from lagXkjy/master
2021-07-27 02:08:04 +00:00
江强 3347ca4d74 fix:Issue #I42GRW 修复任意账户越权漏洞 2021-07-27 09:33:12 +08:00
RuoYi 9b1883988b 升级element-ui到最新版本2.15.3 2021-07-26 09:50:58 +08:00
RuoYi 49c8a007cc 修复定时任务日志执行状态显示 2021-07-26 09:50:33 +08:00
RuoYi 64f6d28441 角色&菜单新增字段属性提示信息 2021-07-25 20:08:55 +08:00
RuoYi c26d87c677 内链设置meta信息 2021-07-25 20:05:18 +08:00
RuoYi 97ae0eb7c7 密码框新增显示切换密码图标 2021-07-25 19:13:56 +08:00
RuoYi 6c1cccd031 导入用户样式调整 2021-07-25 19:08:00 +08:00
RuoYi 856d1ceba8 顶部菜单样式调整 2021-07-25 19:06:57 +08:00
RuoYi 60673b3b64 去除默认分页合理化参数 2021-07-25 10:35:37 +08:00
RuoYi 0a516e3001 更多操作按钮添加权限控制 2021-07-25 10:20:52 +08:00
RuoYi bb87f35797 富文本新增上传文件大小限制 2021-07-25 08:57:01 +08:00
RuoYi c43f9bc3c2 顶部菜单排除隐藏的默认路由 2021-07-24 18:20:55 +08:00
若依 46b43b1bd9 !269 code=401时request方法没有返回Promise.reject 修复
Merge pull request !269 from 严俊东/N/A
2021-07-24 02:48:01 +00:00
若依 8dbda47174 !268 修正方法名单词拼写错误
Merge pull request !268 from 稚屿/N/A
2021-07-23 11:34:30 +00:00
严俊东 cdace51197 code=401时request方法没有返回Promise.reject 修复 2021-07-20 04:49:22 +00:00
稚屿 c24fc4282c 修正方法名单词拼写错误 2021-07-20 00:54:50 +00:00
RuoYi b616a2f2e7 定时任务新增更多操作 2021-07-15 17:35:33 +08:00
RuoYi 60abdf1dbc 升级oshi到最新版本v5.7.5 2021-07-14 09:53:26 +08:00
RuoYi 7b894da43c 参数管理支持配置验证码开关 2021-07-13 10:30:40 +08:00
RuoYi c8b66f9b04 删除富文本video事件 2021-07-13 10:28:55 +08:00
若依 25d9edd5c9 !259 图片上传 - 多图时无法删除相应图片修复
Merge pull request !259 from 严俊东/N/A
2021-07-13 02:26:10 +00:00
严俊东 77a21d098f 图片上传 - 多图时无法删除相应图片修复 2021-07-12 03:01:50 +00:00
RuoYi 170cfb356c 若依 3.6.0 2021-07-12 08:42:11 +08:00
RuoYi 5879c2484a 菜单路由配置支持内链访问 2021-07-11 16:31:10 +08:00
RuoYi c02dad2ca3 默认访问首页新增提示语 2021-07-11 15:28:11 +08:00
RuoYi 1bfa14e3c6 富文本默认上传返回url类型 2021-07-10 12:17:32 +08:00
RuoYi 5dec58e7f5 自定义弹窗拖拽指令 2021-07-09 17:12:29 +08:00
RuoYi 8321f92d2c 全局注册通用组件 2021-07-09 17:09:57 +08:00
RuoYi da1095e298 授权用户添加访问权限 2021-07-09 17:08:30 +08:00
RuoYi f56da498ab ImageUpload组件支持多图片上传 2021-07-08 19:17:09 +08:00
RuoYi e259093e01 文件上传组件添加数量限制属性 2021-07-08 15:49:04 +08:00
RuoYi e963a86b15 富文本编辑组件添加类型属性 2021-07-08 15:48:11 +08:00
RuoYi e447fb806b FileUpload组件支持多文件上传 2021-07-08 12:36:02 +08:00
RuoYi 90c41d498c 角色管理新增分配用户功能 2021-07-05 14:54:09 +08:00
RuoYi ce6bea4ba0 限制超级管理员不允许操作 2021-07-05 09:57:15 +08:00
RuoYi 9c7901f526 用户管理新增分配角色功能 2021-07-01 18:01:36 +08:00
RuoYi 04f5a93aa8 升级pagehelper到最新版1.3.1 2021-06-25 17:25:49 +08:00
若依 751ca90690 !251 修复日志列表取消字段排序时的报错问题
Merge pull request !251 from 稚屿/N/A
2021-06-25 09:23:45 +00:00
稚屿 1dfeae6a03 修复日志列表取消字段排序时的报错问题 2021-06-24 00:27:37 +00:00
RuoYi 1ed60c79c0 用户信息长度校验限制 2021-06-22 20:45:19 +08:00
RuoYi aee1e53140 全局挂载字典标签组件 2021-06-22 20:44:40 +08:00
Ricky 253e2b2de1 增加字典标签样式回显 2021-06-22 14:24:26 +08:00
Ricky b1413f021e 增加字典标签样式回显 2021-06-22 14:04:14 +08:00
RuoYi 60c22b6a43 update ry.sh. 2021-06-17 21:29:00 +08:00
RuoYi 3f05ed6ffa 封装iframe组件 2021-06-17 20:17:42 +08:00
RuoYi 090ad5323a 日志列表支持排序操作 2021-06-17 12:30:43 +08:00
RuoYi 3e90fd010d 升级commons.fileupload到最新版本v1.4 2021-06-16 09:53:00 +08:00
RuoYi 462862ba65 升级commons.io到最新版本v2.10.0 2021-06-16 09:52:38 +08:00
RuoYi 7601a72faf 升级element-ui到最新版本2.15.2 2021-06-15 10:26:19 +08:00
RuoYi 7ab14ff293 定时任务屏蔽rmi远程调用 2021-06-15 10:26:02 +08:00
RuoYi 200106df39 升级oshi到最新版本v5.7.4 2021-06-11 10:29:14 +08:00
RuoYi ea66e20282 修复用户搜索分页变量错误 2021-06-10 22:36:22 +08:00
RuoYi a209b39552 分页组件新增pagerCount属性 2021-06-10 22:29:13 +08:00
RuoYi 557672ba9f 系统布局配置支持动态标题开关 2021-06-10 18:05:27 +08:00
RuoYi a3116cd27d 优化部门父级启用状态 2021-06-10 15:34:38 +08:00
RuoYi 2ace3257f9 升级swagger到最新版本v3.0.0 2021-06-09 20:07:36 +08:00
RuoYi c16ee7fc2c 升级swagger到最新版本v3.0.0 2021-06-08 16:34:36 +08:00
RuoYi fd33fe869d 修复导出角色数据范围翻译缺少仅本人 2021-06-08 16:27:24 +08:00
RuoYi b7446f8d0f 富文本工具栏配置视频 2021-06-03 13:26:09 +08:00
RuoYi 19924cd184 修复关闭confirm提示框控制台报错问题 2021-06-03 13:24:29 +08:00
RuoYi 85470a1549 修复表单构建选择下拉选择控制台报错问题 2021-06-02 20:43:34 +08:00
若依 2a604c0548 !237 同步菜单新增、修改界面“功能权限”maxlength为100(保持与数据库字段长度一致),避免因超过50后不能录入问题
Merge pull request !237 from 老李/origin
2021-06-02 20:40:09 +08:00
RuoYi b7f3c68eca 优化图片工具类读取文件 2021-06-02 11:45:40 +08:00
RuoYi edd2981076 调整用户测试接口swagger注解 2021-06-02 11:45:30 +08:00
RuoYi c105a63c8b 添加bat脚本执行应用 2021-05-31 12:16:27 +08:00
xx2yy 01fef0b9e1 同步菜单新增、修改界面“功能权限”maxlength为100(保持与数据库字段长度一致),避免因超过50后不能录入问题 2021-05-31 10:31:50 +08:00
RuoYi af9cfb40a4 优化参数&字典缓存操作 2021-05-27 17:38:44 +08:00
RuoYi 6fa3bfe051 修复两处存在SQL注入漏洞问题 2021-05-27 17:38:27 +08:00
RuoYi 5e64a93d11 若依 3.5.0 2021-05-25 09:37:55 +08:00
RuoYi 4aabf5d8be Redis设置HashKey序列化 2021-05-24 15:10:55 +08:00
RuoYi cf6254a8d5 用户登录后记录最后登录IP&时间 2021-05-24 14:21:29 +08:00
RuoYi 883cff5de9 新增IE浏览器版本过低提示页面 2021-05-24 14:15:41 +08:00
RuoYi 7e79c4f249 生成vue模板导出按钮点击后添加遮罩 2021-05-24 11:34:03 +08:00
若依 504638eb41 !234 【轻量级 PR】:删去两处冗余代码
Merge pull request !234 from xivLi/master
2021-05-24 11:30:21 +08:00
RuoYi 2adac4a899 升级fastjson到最新版1.2.76 2021-05-24 11:25:17 +08:00
RuoYi 56a943bf48 升级druid到最新版本v1.2.6 2021-05-24 11:24:54 +08:00
RuoYi 77ebca264a 修复请求形参未传值记录日志异常问题 2021-05-23 19:22:30 +08:00
RuoYi 7b94ae3a9a xss校验json条件优化 2021-05-23 19:20:36 +08:00
若依 bd1edc6dcc !233 修正方法名单词拼写错误
Merge pull request !233 from lyqwer/N/A
2021-05-23 17:15:18 +08:00
若依 09d166e97d !231 修正注释
Merge pull request !231 from 刘立伟/N/A
2021-05-23 17:14:52 +08:00
xivLi f3e5d908d6 quartz模块下 domain包中的 SysJob类不需要实现Serializable接口 2021-05-22 16:05:12 +08:00
xivLi 9651a7d7fc 删去utils.uuid下 IdUtils类中 多余的import(同包下的UUID类) 2021-05-22 15:52:19 +08:00
lyqwer b2914cbcb1 修正方法名单词拼写错误 2021-05-21 17:24:48 +08:00
刘立伟 d0a4d6b111 修正注释 2021-05-18 10:21:48 +08:00
RuoYi b431703262 导出按钮点击之后添加遮罩 2021-05-17 15:37:58 +08:00
RuoYi 99726be9ac 修正导入表权限标识 2021-05-11 14:26:20 +08:00
RuoYi 32f333a00e 删除操作日志记录日志 2021-05-11 14:25:39 +08:00
RuoYi be5c19b764 树级结构更新子节点使用replaceFirst 2021-05-11 14:25:25 +08:00
RuoYi dd384e4a31 上传媒体类型添加视频格式 2021-05-11 14:25:08 +08:00
若依 bdde195e2b !225 【bug修复】文件上传时出现java.nio.file.FileAlreadyExistsException
Merge pull request !225 from CANYON/master
2021-05-11 14:19:53 +08:00
libin 14ea071306 修复文件上传时java.nio.file.FileAlreadyExistsException 2021-05-08 15:31:16 +08:00
RuoYi 50034301ac 添加新群号:201396349 2021-05-06 20:40:25 +08:00
若依 85ed712c50 !222 update ruoyi-ui/src/assets/styles/element-ui.scss.
Merge pull request !222 from leizhuogogo/N/A
2021-05-06 20:39:36 +08:00
若依 f67d682345 !221 update ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java.
Merge pull request !221 from phper08/N/A
2021-05-06 20:39:26 +08:00
leizhuogogo 3f1427eef9 update ruoyi-ui/src/assets/styles/element-ui.scss. 2021-05-06 17:50:28 +08:00
phper08 7d0f5e94ef update ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java. 2021-05-03 13:18:33 +08:00
RuoYi 62081aebb9 修复开启TopNav后,左侧打开外链问题 2021-04-21 16:34:44 +08:00
RuoYi 3f07632cd4 修复一级菜单包屑显示重复问题 2021-04-21 15:14:36 +08:00
Ricky 2c94587263 优化ExcelUtil空值处理 2021-04-21 09:53:14 +08:00
RuoYi 2575c17f47 主题颜色保存配置 2021-04-19 16:59:56 +08:00
RuoYi b6f13c546b 过滤BindingResult对象,防止异常 2021-04-18 21:54:53 +08:00
RuoYi e60a69b670 兼容顶部栏一级菜单内部跳转 2021-04-18 18:33:13 +08:00
RuoYi cb18eec802 修正模板字符编码 2021-04-18 15:45:49 +08:00
RuoYi bef080c60a 升级mybatis到最新版3.5.6 阻止远程代码执行漏洞 2021-04-18 15:45:37 +08:00
Ricky de73cf300b 优化树表代码生成模板 2021-04-15 10:39:09 +08:00
Ricky cbcee86d2c 优化树表代码生成模板 2021-04-15 10:37:22 +08:00
RuoYi cc50224d90 固定顶部导航栏&窗口大小改变实时更新栏数 2021-04-14 11:01:16 +08:00
RuoYi ff09e1cf55 数据监控默认地址修改 2021-04-13 18:15:11 +08:00
RuoYi fe2ccbdc1b 优化代码生成导出模板名称 2021-04-13 14:49:42 +08:00
RuoYi c8df1f5e1f 布局设置支持保存&重置配置 2021-04-13 09:47:28 +08:00
RuoYi e71c00e6fa 富文本编辑器支持自定义上传地址 2021-04-13 09:38:32 +08:00
若依 dcb9839596 !209 导出 Excel 工作表的名称 由 ${businessName} 更改为 ${functionName}
Merge pull request !209 from lihy2021/N/A
2021-04-13 09:36:49 +08:00
若依 f13b6d92d2 !205 富文本编辑器自定义上传地址
Merge pull request !205 from hechieh/N/A
2021-04-13 09:36:42 +08:00
lihy2021 6595c68df1 导出 Excel 工作表的名称 由 ${businessName} 更改为 ${functionName} 2021-04-12 14:52:14 +08:00
Ricky 5a2a0c09b6 优化主子表代码生成 2021-04-12 13:26:54 +08:00
RuoYi 9aac65ff32 新增菜单导航显示风格TopNav(false为左侧导航菜单,true为顶部导航菜单) 2021-04-12 09:54:08 +08:00
RuoYi 5f2350569a 页签新增关闭右侧 2021-04-10 21:15:45 +08:00
hechieh ccf05b697d 富文本编辑器自定义上传地址 2021-04-10 17:08:49 +08:00
RuoYi 6810243ab7 修复树表数据显示不全&加载慢问题 2021-04-09 08:31:13 +08:00
RuoYi b56b8846d9 修改主题后mini类型按钮无效问题 2021-04-08 13:54:48 +08:00
RuoYi 8e1e4cd8fe 通用下载完成后删除节点 2021-04-08 13:46:22 +08:00
若依 9fa5c79713 !200 update ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java.
Merge pull request !200 from yvan7123/N/A
2021-04-08 13:42:30 +08:00
若依 40a72c2b7e !199 规范命名、用户角色单个逻辑删除、去除多余代码
Merge pull request !199 from fuzui/some_problems
2021-04-08 13:40:28 +08:00
yvan7123 6fe9a358b7 update ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java. 2021-04-06 11:47:27 +08:00
wangze 9f6bc13e64 🔥 去除多余代码 2021-04-02 23:06:48 +08:00
wangze ba5ab4b091 用户、角色单条删除时,使其逻辑删除 2021-04-02 22:49:19 +08:00
wangze 17407d0127 调整cache_repeat_key为驼峰格式 2021-04-02 22:40:15 +08:00
RuoYi 30f330f4a0 修复firefox下表单构建拖拽会新打卡一个选项卡 2021-03-30 17:45:35 +08:00
RuoYi 6ca7870393 修正注释 2021-03-30 15:30:18 +08:00
若依 2a7342ec43 !195 读取excel增加非空判断
Merge pull request !195 from 叫我宏锅锅/yuhong
2021-03-30 15:23:04 +08:00
若依 fc57e91b80 !196 RepeatedlyRequestWrapper.ServletInputStream 实现available方法
Merge pull request !196 from wangyang/master
2021-03-30 15:17:34 +08:00
wangyuanyang 347f36ceff fix:RepeatedlyRequestWrapper.ServletInputStream 实现available方法 2021-03-29 10:17:31 +08:00
yuhong0206@sina.cn 9b9c1b999f 读取excel增加
if(row == null)
{
    continue;
}
判断。防止有时候Excel表中有空数据行,导致读取时出现空指针异常。
2021-03-29 09:00:44 +08:00
yuhong0206@sina.cn ec627704b2 取消 2021-03-29 08:58:46 +08:00
yuhong0206@sina.cn 9e6b2a1265 读取excel增加
if(row == null)
{
    continue;
}
判断。防止有时候Excel表中有空数据行,导致读取时出现空指针异常。
2021-03-29 08:56:51 +08:00
若依 266a5e844f !193 修复request.getInputStream() 重复读取错误问题
Merge pull request !193 from MccRay/master
2021-03-27 13:22:01 +08:00
MccRay 0822680158 update ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java.
修复 getInputStream() has already been called for this request异常问题
2021-03-25 17:39:51 +08:00
RuoYi 090e258bf9 显隐列初始默认隐藏列 2021-03-24 15:46:37 +08:00
若依 505fa06dc3 !192 update ruoyi-ui/src/views/system/user/profile/userAvatar.vue.
Merge pull request !192 from 谢凯/N/A
2021-03-24 15:32:24 +08:00
若依 6cf53bfacb !191 update ruoyi-ui/src/views/system/user/profile/userAvatar.vue.
Merge pull request !191 from allworldg/N/A
2021-03-24 15:31:51 +08:00
谢凯 881dc3fcf0 update ruoyi-ui/src/views/system/user/profile/userAvatar.vue. 2021-03-22 17:52:34 +08:00
allworldg b65c8d4512 update ruoyi-ui/src/views/system/user/profile/userAvatar.vue. 2021-03-21 21:20:23 +08:00
RuoYi 67371a9028 个人信息添加手机&邮箱重复验证 2021-03-21 08:53:11 +08:00
RuoYi 01b545e4ab 通用Controller添加响应返回消息 2021-03-16 14:43:55 +08:00
RuoYi c2e9200626 数据监控默认账户密码防止越权访问 2021-03-14 16:37:34 +08:00
若依 9502203bbe !187 【漏洞修复】升级commons-collections版本,解决3.2.1版本的反序列化漏洞问题
Merge pull request !187 from Delusive/master
2021-03-14 16:32:07 +08:00
hh44h1144 c0f1569ad9 修复commons-collections引起的反序列化漏洞 2021-03-12 16:59:06 +08:00
RuoYi 61432480c8 删除多余的代码 2021-03-07 11:06:47 +08:00
若依 78deee063d !180 富文本编辑组件支持只读
Merge pull request !180 from JOSWAY/master
2021-03-07 10:44:04 +08:00
若依 4ad003649e !182 解决 Byte[] 类型 to string 死循环的问题
Merge pull request !182 from sproutcat/master
2021-03-07 10:39:41 +08:00
若依 616f5a6aca !185 update ruoyi-ui/src/views/monitor/logininfor/index.vue.
Merge pull request !185 from asher/N/A
2021-03-07 10:39:30 +08:00
若依 fea3ff7b2a !184 update ruoyi-ui/src/views/monitor/operlog/index.vue.
Merge pull request !184 from asher/N/A
2021-03-07 10:39:22 +08:00
asher f938a24df0 update ruoyi-ui/src/views/monitor/logininfor/index.vue. 2021-03-04 17:00:07 +08:00
asher 45fa686a64 update ruoyi-ui/src/views/monitor/operlog/index.vue. 2021-03-04 16:58:18 +08:00
RuoYi 0d8c3b4940 升级oshi到最新版本v5.6.0 2021-03-03 13:53:03 +08:00
RuoYi 64e807f27b 添加新群号:186866453 2021-02-24 13:45:24 +08:00
tzg 9a384a2fc2 解决 Byte[] 类型 to string 死循环的问题 2021-02-23 16:30:14 +08:00
Josway 339b932a3d 富文本编辑组件支持只读 2021-02-22 17:49:17 +08:00
RuoYi 0b5c7f4c96 若依 3.4.0 2021-02-22 09:40:28 +08:00
RuoYi 265e3010aa 升级SpringBoot到最新版本2.2.13 2021-02-21 11:01:56 +08:00
RuoYi b7a36bfe8a 修改ip字段长度防止ipv6地址长度不够 2021-02-10 12:48:52 +08:00
RuoYi 3a51c53823 角色非自定义权限范围清空选择值 2021-02-06 10:34:12 +08:00
RuoYi df504c5c14 修复四级菜单无法显示问题 2021-02-06 09:29:50 +08:00
RuoYi baeed2e8d3 修复角色管理-编辑角色-功能权限显示异常 2021-02-02 16:25:37 +08:00
RuoYi 2903de1561 升级element-ui到最新版本2.15.0 2021-01-24 12:06:19 +08:00
RuoYi cca2f5c62d update README.md 2021-01-14 13:20:08 +08:00
RuoYi ce54416e4f 升级fastjson到最新版1.2.75 2021-01-13 16:20:39 +08:00
RuoYi bd19892aff 修复生成树表代码异常 2021-01-13 16:19:23 +08:00
RuoYi 14a859899c 代码生成模板支持主子表 2021-01-08 10:47:36 +08:00
若依 f3cb18c836 !161 修复导入数据为负浮点数时,导入结果会丢失精度问题
Merge pull request !161 from 嘿白熊/master
2021-01-08 10:46:36 +08:00
RuoYi 7d0eb3b8c7 用户显隐列添加不同key防止被复用 2021-01-07 13:28:16 +08:00
RuoYi 654aa6b30c 表格右侧工具栏组件支持显隐列 2021-01-06 17:30:39 +08:00
X.B-H b7cdd10f9f 修复导入数据为负浮点数时丢失精度问题 2021-01-06 11:11:11 +08:00
RuoYi 9bd35cb7be 升级druid到最新版本v1.2.4 2021-01-06 11:00:20 +08:00
RuoYi 7a86c714fc 代码生成支持文件上传组件 2021-01-06 11:00:09 +08:00
RuoYi edd090a098 代码生成支持文件上传组件 2021-01-05 20:59:14 +08:00
RuoYi 3cd886785b 图片组件添加预览功能 2021-01-05 20:33:41 +08:00
RuoYi ae5a0f9774 新增文件上传组件 2021-01-05 20:11:09 +08:00
RuoYi 074b3c735d 设置单图上传控件 2021-01-05 16:17:41 +08:00
RuoYi a118738d0f 单图上传组件添加移除 2021-01-05 16:13:22 +08:00
RuoYi 56fa3912ae 修复IE11浏览器报错问题 2021-01-05 09:44:08 +08:00
RuoYi 2116ee1822 Update copyright 2021-01-04 17:49:52 +08:00
RuoYi 57a2eb4217 操作按钮组调整为朴素按钮样式 2021-01-04 17:48:46 +08:00
RuoYi 647af5b485 菜单组件修改允许空字符串 2020-12-29 17:27:48 +08:00
若依 3f33219134 !156 修复 用户管理 -> 修改用户 手机号码 和 邮箱 不能清空
Merge pull request !156 from li_oxen/N/A
2020-12-29 17:14:31 +08:00
li_oxen a04bb71777 修复 用户管理 -> 修改用户 手机号码 和 邮箱 不能清空 2020-12-29 13:51:15 +08:00
RuoYi 63992ac906 代码生成数据库文本类型生成表单文本域 2020-12-29 11:14:48 +08:00
RuoYi 0187344798 Excel注解支持Image图片导出 2020-12-27 10:04:45 +08:00
RuoYi a9c6ba12e6 代码生成日期控件区分范围 2020-12-25 09:35:20 +08:00
RuoYi ba068eae65 修正侧边栏静态路由丢失问题 2020-12-24 19:32:18 +08:00
若依 1a87ee7c19 防止get请求参数值为false或0等特殊值会导致无法正确的传参
Merge pull request !146 from wugh/hotfix/gitee-issue_I2A5FU
2020-12-22 16:19:51 +08:00
DokiYoloo 3c4b01ab83 权限工具类增加admin判断 2020-12-21 19:43:57 +08:00
wugh 886ce995af [bug修复] 解决get请求,如果参数值为false或0等特殊值会导致无法正确传参 2020-12-21 11:58:15 +08:00
RuoYi 52264b6e2a 优化多级菜单之间切换无法缓存的问题 2020-12-21 10:50:48 +08:00
RuoYi fd7e88a518 配置文件新增redis数据库索引属性 2020-12-21 10:26:54 +08:00
若依 854a6f805f !145 redis 增加 database配置项,设置不同的库
Merge pull request !145 from li_oxen/N/A
2020-12-21 10:13:47 +08:00
li_oxen 1caec85f46 redis 增加 database配置项,设置不同的库 2020-12-19 10:08:09 +08:00
RuoYi c86dc20743 移除path-to-regexp正则匹配插件 2020-12-17 12:05:29 +08:00
RuoYi ecc7a8be46 优化多级菜单之间切换无法缓存的问题 2020-12-16 20:57:48 +08:00
RuoYi e23ad20186 README 2020-12-16 10:20:02 +08:00
RuoYi 6cf2a8edeb 升级SpringBoot到最新版本2.2.12 提升启动速度 2020-12-16 10:05:53 +08:00
RuoYi 67198aede9 README 2020-12-15 10:06:12 +08:00
RuoYi 4f33da2a3f 登录后push添加catch防止出现检查错误 2020-12-15 10:04:09 +08:00
RuoYi 8988d0b4ab 若依 3.3.0 2020-12-14 09:02:10 +08:00
RuoYi ceefa20aa2 调整代码生成页列宽 2020-12-13 16:05:49 +08:00
RuoYi 89e1f2a53f 修改Set可能导致嵌套的问题 2020-12-13 15:01:03 +08:00
若依 6800a12014 !138 修改Set可能导致嵌套的问题
Merge pull request !138 from BecomeDream/N/A
2020-12-13 14:54:17 +08:00
BecomeDream e8f63b2994 修改Set可能导致嵌套的问题 2020-12-11 18:16:57 +08:00
RuoYi ecfe7006e2 代码生成预览支持高亮显示 2020-12-11 17:04:54 +08:00
RuoYi 9e387dc447 去除用户手机邮箱部门必填验证 2020-12-11 13:26:14 +08:00
若依 231bbf6928 !135 增加日志记录过滤对象类型(解决多文件场景报错)
Merge pull request !135 from geruishi/master
2020-12-11 13:24:03 +08:00
RuoYi d6eac2dc8d 前端更新插件版本 2020-12-11 09:27:12 +08:00
RuoYi b368ad764f 升级core-js到最新版本3.8.1 2020-12-10 12:08:18 +08:00
RuoYi ffd5f0ce5d 升级vue-router到最新版本3.4.9 2020-12-10 11:14:44 +08:00
RuoYi a50beae599 代码生成预览提供滚动机制 2020-12-10 11:13:39 +08:00
葛瑞士 cf7f51a633 解决多文件上传Log报错 2020-12-09 16:05:09 +08:00
RuoYi 4d46f4c1b5 删除用户和角色解绑关联 2020-12-09 10:32:53 +08:00
若依 a941c1b488 !134 修改 代码生成 预览无法左右滑动
Merge pull request !134 from 〝走走停停/master
2020-12-09 10:27:34 +08:00
〝走走停停 d6b6151aea update ruoyi-ui/src/assets/styles/ruoyi.scss. 2020-12-08 17:49:51 +08:00
RuoYi fbc071a573 关闭页签清理缓存数据 2020-12-08 16:43:26 +08:00
RuoYi 6cfff90b4a 缓存仪表图设置默认大小 2020-12-08 16:13:21 +08:00
RuoYi 474cca921e 回显数据字典防止空值报错 2020-12-08 16:12:00 +08:00
若依 1657e06be6 !132 update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java.
Merge pull request !132 from abbfun/N/A
2020-12-08 16:03:51 +08:00
abbfun c01eeb8521 update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java. 2020-12-08 11:11:34 +08:00
RuoYi f90899d72a 支持主题风格配置 2020-12-07 14:13:02 +08:00
RuoYi 7e78a9167f 修改用户头像预览宽高 2020-12-06 16:22:45 +08:00
RuoYi 563e11d9c1 get请求params添加null值判断 2020-12-06 11:05:02 +08:00
RuoYi ef92ad4d8c 支持get请求映射params参数 2020-12-04 10:52:20 +08:00
RuoYi d8b006c15f 升级bitwalker到最新版本1.21 2020-12-04 10:51:20 +08:00
RuoYi 0e2b97a886 升级poi到最新版本4.1.2 2020-12-03 13:28:04 +08:00
RuoYi 1c7a5faae8 Excel支持注解align对齐方式 2020-12-03 13:26:46 +08:00
RuoYi 23868c4fad 防止安全扫描YUI出现的风险提示 2020-12-03 10:26:22 +08:00
RuoYi 3b2669d148 修改缓存监控内存单位 2020-11-30 19:27:03 +08:00
RuoYi 1147ea5f8a 设置用户头像悬停高度 2020-11-30 11:10:27 +08:00
RuoYi a1bf5aaf8e 升级element-ui版本到2.14.1 2020-11-30 10:37:48 +08:00
RuoYi 2797c1eb3a 修正转换字符串的目标字符集属性 2020-11-30 10:31:11 +08:00
若依 1791d7cf40 !126 update pom.xml.
Merge pull request !126 from abbfun/N/A
2020-11-30 10:07:08 +08:00
abbfun 01861f0aae update pom.xml. 2020-11-29 16:16:54 +08:00
RuoYi a69cc94f35 三级菜单自动配置组件 2020-11-28 20:39:03 +08:00
RuoYi c666faed66 修复三级菜单之间切换页面无法缓存的问题 2020-11-28 20:31:45 +08:00
RuoYi 6072239a40 修改缓存监控内存单位 2020-11-28 13:57:19 +08:00
RuoYi a3b86d6f6d 代码生成删除多余的数字float类型 2020-11-28 12:09:24 +08:00
RuoYi fd831d5a90 Excel支持导入Boolean型数据 2020-11-28 12:08:55 +08:00
RuoYi e83412b9a5 升级oshi到最新版本v5.3.6 2020-11-24 16:17:33 +08:00
RuoYi 90ac416e02 新增缓存监控功能 2020-11-23 10:02:50 +08:00
RuoYi 5b63f0cab9 优化头像样式,鼠标移入悬停遮罩 2020-11-19 09:33:10 +08:00
RuoYi 8f145bba3a 若依 v3.2.1 2020-11-18 09:32:15 +08:00
RuoYi 6bb166b89f 阻止任意文件下载漏洞 2020-11-17 10:29:52 +08:00
RuoYi 823e95667e 代码生成支持上传控件 2020-11-16 16:20:17 +08:00
RuoYi 566053da0c 新增图片上传组件 2020-11-16 15:52:58 +08:00
RuoYi 0ef007240d 调整默认首页 2020-11-07 10:38:35 +08:00
RuoYi 0a75dcdd85 升级druid到最新版本v1.2.2 2020-11-05 13:58:36 +08:00
RuoYi 4c2626ffec 2020年双十一云服务器优惠,错过又要等一年 2020-11-04 16:58:28 +08:00
RuoYi 082b19e33a mapperLocations配置支持分隔符 2020-11-02 17:34:52 +08:00
若依 b779cf053d !112 未选择时,点击“确认”,出现必填验证提示。使用blur的话,选择之后验证消息不会自动消失,使用change会自动消失。
Merge pull request !112 from FlyFive/N/A
2020-11-02 17:30:06 +08:00
FlyFive 212012dc62 未选择时,点击“确认”,出现必填验证提示。使用blur的话,选择之后验证消息不会自动消失,使用change会自动消失。 2020-11-02 11:49:25 +08:00
若依 7de2cf77b4 !111 update ruoyi-ui/src/views/system/dept/index.vue.
Merge pull request !111 from FlyFive/N/A
2020-10-26 16:57:58 +08:00
FlyFive 2b9d46439f update ruoyi-ui/src/views/system/dept/index.vue.
验证的提示信息错了
2020-10-26 16:31:51 +08:00
若依 79265d59b7 !109 误修改,回退
Merge pull request !109 from tucke/master
2020-10-26 10:00:46 +08:00
tucke 093ba5b389 误修改,回退 2020-10-26 09:53:58 +08:00
RuoYi 3807b11290 权限调整 2020-10-23 17:27:20 +08:00
RuoYi c9f25cb34e 调整sql默认时间 2020-10-21 11:30:37 +08:00
若依 203b54e5aa !106 update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java.
Merge pull request !106 from abbfun/N/A
2020-10-14 17:12:57 +08:00
RuoYi 403f5c5dcf 解决代码生成没有bit类型的问题 2020-10-14 17:08:20 +08:00
abbfun c6d0b9a9ae update ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java.
权限字符串修正
2020-10-14 16:21:43 +08:00
RuoYi 08df2c93a9 删除不必要的代码 2020-10-13 14:41:26 +08:00
若依 fbbdd94999 !105 update ruoyi-ui/src/views/system/role/index.vue.
Merge pull request !105 from FlyFive/N/A
2020-10-13 14:38:02 +08:00
FlyFive 0cae7d0058 update ruoyi-ui/src/views/system/role/index.vue.
getMenuAllCheckedKeys()方法中选中节点和半选节点获取的方法反了。
2020-10-12 13:50:25 +08:00
RuoYi b0965653bf 删除不必要的代码 2020-10-10 17:54:30 +08:00
RuoYi e472f62523 升级pagehelper到最新版1.3.0 2020-10-10 16:39:14 +08:00
RuoYi 69256940df 若依 3.2 2020-10-10 09:38:21 +08:00
RuoYi b9f686be53 升级druid到最新版本v1.2.1 2020-10-09 11:45:33 +08:00
RuoYi 521ff51238 升级fastjson到最新版1.2.74 2020-10-09 11:45:06 +08:00
若依 f67c97e095 !102 rouyi.js中添加日期范围方法dateRange获取bug修复
Merge pull request !102 from zora/master
2020-10-09 11:37:18 +08:00
RuoYi dd721ff894 修正定时任务执行一次权限标识 2020-10-07 13:36:55 +08:00
RuoYi ae4290bdda 修复页签关闭所有固定标签路由不刷新问题 2020-10-03 20:05:24 +08:00
RuoYi c19fec2cf8 格式化代码 2020-10-03 20:05:06 +08:00
RuoYi 669c42795a 表单构建布局型组件新增按钮 2020-10-03 17:47:24 +08:00
RuoYi 0d79f10c2f jna指定版本 2020-10-03 11:43:23 +08:00
RuoYi d3595cd930 修正菜单提示信息错误 2020-10-03 11:15:18 +08:00
shizhenwei 5b0525d05c [修改]此工具类应使用参数dateRange而非bind在model上的dateRange 2020-09-27 13:22:23 +08:00
RuoYi fb07677c32 左侧菜单文字过长显示省略号 2020-09-24 19:21:55 +08:00
RuoYi a82a3d9465 升级oshi到最新版本v5.2.5 2020-09-22 18:25:58 +08:00
RuoYi 28bceda630 修正文字错误 2020-09-22 11:09:18 +08:00
RuoYi 69829827fe 菜单&数据权限新增(展开/折叠 全选/全不选 父子联动) 2020-09-21 14:10:01 +08:00
若依 89607fb028 !100 解决添加用户角色时报错问题
Merge pull request !100 from wensanpi/master
2020-09-21 10:31:59 +08:00
wensanpi 1aa18c523d update ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml. 2020-09-20 17:38:21 +08:00
RuoYi abeb8d7fd8 菜单新增是否缓存keep-alive 2020-09-20 10:34:03 +08:00
RuoYi 478fae0d28 菜单&数据权限新增(展开/折叠 全选/全不选 父子联动) 2020-09-19 13:42:37 +08:00
RuoYi 0ecf27f8d6 去除多余的空格 2020-09-18 17:09:27 +08:00
RuoYi 0a5bb34fbf 升级springboot到2.1.17 提升安全性 2020-09-18 16:51:27 +08:00
RuoYi 9e38c7de2e 代码生成支持同步数据库 2020-09-18 10:24:21 +08:00
RuoYi 9ca28d6dbf 表格操作列间距调整 2020-09-18 10:23:31 +08:00
RuoYi 497f98ba90 导入excel整形值校验优化 2020-09-17 18:22:50 +08:00
RuoYi a948affb2d 代码生成支持富文本控件 2020-09-15 15:53:27 +08:00
RuoYi 57b49dd5fa 限制系统内置参数不允许删除 2020-09-15 15:51:12 +08:00
RuoYi 9c0ed9c424 修复通知公告longblob类型乱码问题 2020-09-10 18:23:12 +08:00
RuoYi 70ab18052c 富文本工具栏样式对齐 2020-09-10 16:56:33 +08:00
RuoYi aeb02c79d8 修正注释图标路径 2020-09-10 16:53:58 +08:00
RuoYi 33793d8eff Excel导出类型NUMERIC支持精度浮点类型 2020-09-09 11:30:34 +08:00
RuoYi 9652906954 降级druid到版本v1.1.22,防止出现一些错误 2020-09-09 10:08:31 +08:00
RuoYi 9fccc7de40 修正调用目标字符串最大长度 2020-09-07 16:40:38 +08:00
RuoYi 599be64fa8 升级jjwt到0.9.1 2020-09-07 16:40:21 +08:00
RuoYi 50ac363682 升级druid到最新版本v1.1.23 2020-09-04 14:47:07 +08:00
若依 f84b157419 !87 数据权限中的空值处理
Merge pull request !87 from sproutcat/master
2020-09-04 14:17:32 +08:00
若依 f4536d5d2e !86 数据字典缓存处理的一点小问题
Merge pull request !86 from 说一/master
2020-09-04 14:07:47 +08:00
若依 aed958b1be !82 修复Editor组件在传入内容为null时无法响应式更新其内容的bug
Merge pull request !82 from HaoRan/N/A
2020-09-04 14:04:08 +08:00
tzg 0a51f7d743 空值处理 2020-09-02 14:59:10 +08:00
dawn 3fd9147afb 解决“在只填加了字典类型,没有添加字典数据时,会出现缓存了空集合,即使后边添加了字典数据也没用,只能清空redis缓存。”的问题,小问题就是判断稍稍改了下,若依大大让我pr当个贡献者,很荣幸很欣慰。感谢! 2020-09-02 10:14:34 +08:00
RuoYi 4f86b6d9ca 修改公告内容字段类型 2020-09-01 18:07:59 +08:00
HaoRan a65c287075 修复Editor组件无法对响应式更新null值问题 2020-08-31 02:10:01 +08:00
RuoYi 1af0d1665c 数据权限判断对象类型 2020-08-28 15:45:54 +08:00
RuoYi 4e32788b36 修正数据库字符串类型nvarchar 2020-08-28 14:11:32 +08:00
RuoYi 068c3e6f0d 优化递归子节点 2020-08-28 10:14:59 +08:00
RuoYi dd6640086e 代码生成树模板去掉多余双引号 2020-08-27 17:34:06 +08:00
RuoYi be54188ba6 导出Excel调整targetAttr获取值方法,防止get方法不规范 2020-08-26 15:39:46 +08:00
RuoYi a4e2339f90 生成页面时不忽略remark属性 2020-08-26 14:24:37 +08:00
RuoYi bf771ae5c8 Excel注解支持自动统计数据总和 2020-08-26 11:37:49 +08:00
RuoYi fa5596bb20 Editor组件优化,支持自定义高度&图片冲突问题 2020-08-22 13:18:41 +08:00
RuoYi eb30fc4b1a 修改公告内容字段类型 2020-08-22 13:11:40 +08:00
RuoYi 0446d211df 设置默认排序顺序 2020-08-19 17:02:23 +08:00
RuoYi da146c2a70 Excel注解支持设置BigDecimal精度&舍入规则 2020-08-19 11:20:31 +08:00
RuoYi 7de5358dcd 升级fastjson到最新版1.2.73 2020-08-19 11:17:24 +08:00
RuoYi 549c7ee97a 代码生成添加select必填选项 2020-08-18 18:15:12 +08:00
RuoYi 5fcf342f5a 修改sass为node-sass,避免el-icon图标乱码 2020-08-18 17:36:20 +08:00
若依 c89722a7dd !74 update ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java.
Merge pull request !74 from Lyy/N/A
2020-08-18 17:30:18 +08:00
若依 61e10f2783 !73 代码生成:select的表单验证失效
Merge pull request !73 from sunshine/master
2020-08-18 17:30:03 +08:00
若依 c6912ca1d5 !64 修改sass为node-sass,避免el-icon图标乱码
Merge pull request !64 from 心悦李国楠/dev-心悦
2020-08-18 17:27:19 +08:00
若依 5c4f0c5503 !65 根节点为子部门时,树状结构显示问题
Merge pull request !65 from GSTong/master
2020-08-18 17:21:51 +08:00
Lyy 4f7702b22a update ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java.
修改注释,CRSF禁用
2020-08-17 17:05:33 +08:00
sunshine 04e294b3e5 代码生成:select的表单验证失效 2020-08-17 12:08:34 +08:00
RuoYi d596d5bb8e 还原 addDateRange js 函数 2020-08-13 12:08:24 +08:00
RuoYi 8f9f0c04cc 若依 3.1 2020-08-13 10:27:56 +08:00
RuoYi 1bad003fe3 修改公私钥 2020-08-12 11:55:26 +08:00
RuoYi ad4df6245d 优化防重复提交拦截器,请求没有消息头则使用地址 2020-08-11 11:24:55 +08:00
gst 0070297fe1 根节点为子部门时,树状结构显示问题 2020-08-11 10:59:02 +08:00
RuoYi 71ec44a545 修正在线用户日志记录类型 2020-08-10 17:26:11 +08:00
RuoYi 1efae4a588 优化防重复提交拦截器,接口请求非json数据不获取Body消息体 2020-08-10 17:10:34 +08:00
liguonan 650359c357 修改sass为node-sass,避免el-icon图标乱码 2020-08-10 16:28:50 +08:00
RuoYi a78211ca00 优化上级菜单不能选择自己 2020-08-10 12:20:52 +08:00
RuoYi 74f52677be 表格右侧工具栏组件 2020-08-10 10:12:39 +08:00
若依 60d5c03e65 !63 重写表格工具栏右侧添加刷新&显隐查询栏
Merge pull request !63 from 平凡/重写表格工具栏右侧添加刷新&显隐查询栏
2020-08-10 09:53:27 +08:00
平凡 5b04f388e9 重写表格工具栏右侧添加刷新&显隐查询栏 2020-08-09 11:07:10 +08:00
RuoYi a7eb07c7a0 Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue 2020-08-07 16:07:02 +08:00
RuoYi d0b315f4a5 删除重复的placeholder 2020-08-07 16:03:45 +08:00
若依 a6051d4638 !60 代码注释错误
Merge pull request !60 from waylon/master
2020-08-07 15:56:44 +08:00
wanglei c4ee9ea7c8 修复注释错误 2020-08-07 14:26:30 +08:00
RuoYi 7c39f92538 修复富文本空格和缩进保存后不生效问题 2020-08-07 12:26:15 +08:00
RuoYi 51fa66f61a 唯一限制条件只返回单条数据 2020-08-05 14:28:45 +08:00
RuoYi 3b61ed56b0 添加获取当前的环境配置方法 2020-08-05 12:56:32 +08:00
若依 db904f679e !57 若干 ruoyi-ui 前端公共工具函数优化
Merge pull request !57 from FungLeo/master
2020-08-05 11:39:56 +08:00
若依 98982515f7 !55 修复在线用户判断逻辑
Merge pull request !55 from 心悦李国楠/dev-心悦
2020-08-05 11:39:09 +08:00
若依 1a7baa0639 !58 cell的cellType由Numeric修正为String
Merge pull request !58 from 4ook/master
2020-08-05 11:38:44 +08:00
mazh a9695d1756 修复BUG: 导出Excel功能, 当attr的cellType为String时, cell的cellType由Numeric修正为String。 2020-08-05 11:28:57 +08:00
fungleo d78f642201 Merge remote-tracking branch 'upstream/master' 2020-08-05 10:26:05 +08:00
fungleo 26dfee2ce8 彻底重写回显数据字典方法 2020-08-05 10:24:54 +08:00
RuoYi b56898858d 超时登录后页面跳转到首页 2020-08-05 10:04:43 +08:00
fungleo 503dd64e3f 优化 addDateRange js 函数 2020-08-04 14:32:29 +08:00
fungleo 876ecf21c7 优化构建树形数据JS方法 2020-08-04 14:11:02 +08:00
fungleo 107672419e Merge remote-tracking branch 'upstream/master' 2020-08-04 11:59:42 +08:00
RuoYi 21d07c1d71 修复角色的权限分配后,未实时生效问题 2020-08-04 11:51:25 +08:00
fungleo d8d636fdbd 优化 回显数据字典(字符串数组)JS 函数 2020-08-04 11:39:43 +08:00
RuoYi 743fce7829 优化防重提交唯一标识 2020-08-04 11:07:37 +08:00
liguonan de2ac66f0b 修复在线用户判断逻辑 2020-08-03 17:57:33 +08:00
RuoYi 8b5d254242 全局异常状态汉化拦截处理 2020-08-03 09:11:49 +08:00
RuoYi a7eb0f98ac README 2020-08-03 09:02:28 +08:00
RuoYi 4dcf737db0 表格工具栏右侧添加刷新&显隐查询栏 2020-08-01 15:45:38 +08:00
RuoYi b32d0724b7 升级vue-cli版本到4.4.4 2020-07-31 22:35:30 +08:00
若依 8deacb702e !54 update ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml.
Merge pull request !54 from yongdaidai/N/A
2020-07-31 16:50:28 +08:00
若依 5be8d46d05 !51 优化生成vue文件的vm模板文件
Merge pull request !51 from FungLeo/master
2020-07-31 16:49:51 +08:00
yongdaidai fb19dd3e4e update ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml.
解决如果导入多个同名部门dept_name,parent_id相同,但是删除状态(del_flag)不同,导致查询结果为多条,mybatis不能映射为一条数据的问题.
2020-07-31 14:59:23 +08:00
RuoYi cbf4795fd5 表单类型为Integer/Long设置整形默认值 2020-07-30 21:47:50 +08:00
RuoYi 5d74ed32bd 表单类型为Integer/Long设置整形默认值 2020-07-30 16:03:44 +08:00
若依 6afaced3cf !53 update ruoyi-ui/src/views/system/role/index.vue.
Merge pull request !53 from abbfun/N/A
2020-07-30 10:04:11 +08:00
abbfun f3976c0792 update ruoyi-ui/src/views/system/role/index.vue.
权限修正(角色导出权限)
2020-07-29 21:16:53 +08:00
RuoYi 22225a5119 HTML过滤器改为将html转义 2020-07-28 17:28:09 +08:00
RuoYi fe030cc022 修改 node-sass 为 dart-sass 2020-07-27 16:55:51 +08:00
fungleo ca657b0482 优化 index-tree.vue.vm 文件,undefined 修改为 null 2020-07-26 17:33:42 +08:00
fungleo c1d1ace36d 优化index.vue.vm模板,!=1修改为严格不等;undefined修改为null 2020-07-26 17:29:40 +08:00
RuoYi 6e7d7aba93 代码生成支持自定义路径 2020-07-24 15:37:57 +08:00
RuoYi 388e36ed4d 优化参数 2020-07-23 21:45:22 +08:00
若依 5d89d0b36a !49 代码生成器默认mapper路径与默认mapperScan路径不一致
Merge pull request !49 from HaoRan/master
2020-07-23 21:25:10 +08:00
若依 55095a50b5 !48 ExcelUtil 功能优化
Merge pull request !48 from soulCoke/master
2020-07-23 21:25:02 +08:00
HR.Hu ee4b4de7b1 修复 代码生成器默认mapper路径与默认mapperScan路径不一致的bug 2020-07-23 21:01:18 +08:00
RuoYi 92c6301285 Excel支持分割字符串组内容 2020-07-23 18:58:45 +08:00
RuoYi 5c6adb25fc 代码生成支持复选框 2020-07-23 17:02:55 +08:00
soulCoke 8dd3ca5bb6 excel 导入数字不需要格式化 ,导入允许列和属性个数不一致。 2020-07-23 15:54:03 +08:00
Sxile be778ba370 修复参数注释 2020-07-23 14:54:11 +08:00
RuoYi 52d48fa63e 检查字符支持小数点&降级改成异常提醒 2020-07-23 11:29:40 +08:00
RuoYi df3ef54b41 验证码类型支持(数组计算、字符验证) 2020-07-23 11:17:04 +08:00
RuoYi 1e40e60dbf 支持CORS跨域请求 2020-07-22 15:25:42 +08:00
若依 133a10ecf2 !47 修复和优化前端 utils 工具函数
Merge pull request !47 from FungLeo/master
2020-07-22 13:00:51 +08:00
RuoYi 6a84ae42a5 代码生成支持选择上级菜单 2020-07-21 15:52:11 +08:00
RuoYi b2d79b62d1 代码生成支持选择上级菜单 2020-07-21 11:21:20 +08:00
fungleo a09a342f58 优化 uitls/ruoyi.js 中 selectDictLabel 方法,数组迭代器换为 some
提高性能
2020-07-21 10:22:07 +08:00
fungleo 3e1bd8e3bc 修复 utils/index.js 中不包含 parseTime 函数的 bug 2020-07-21 10:18:56 +08:00
RuoYi 8a076e175f Excel导出导入支持dictType字典类型 2020-07-20 15:25:05 +08:00
RuoYi cee572f237 若依 3.0 2020-07-19 10:25:40 +08:00
RuoYi 0d341f1aaa 代码生成查询条件修正 2020-07-18 16:24:04 +08:00
RuoYi 11ab4b4832 缺少JsonIgnore包路径。 2020-07-18 12:32:22 +08:00
若依 3afa664173 !42 处理代码生成页面中的查询条件“创建时间”未生效的问题
Merge pull request !42 from 平凡/hmxmylove-master-patch-60881
2020-07-18 12:23:28 +08:00
若依 1624debefe !41 禁止加密密文返回前端
Merge pull request !41 from 平凡/hmxmylove-master-patch-79033
2020-07-18 12:23:20 +08:00
平凡 0238c4ad92 处理代码生成页面中的查询条件“创建时间”未生效的问题 2020-07-18 00:07:17 +08:00
平凡 0d52e11e3d 禁止加密密文返回前端 2020-07-18 00:03:27 +08:00
RuoYi d5cc95fefb 升级element-ui版本到2.13.2 2020-07-17 16:56:03 +08:00
RuoYi d29fe10b93 删除babel,提高编译速度。 2020-07-17 16:20:31 +08:00
RuoYi 086b9cdc23 新增菜单默认主类目 2020-07-17 15:19:06 +08:00
Sxile 22b09535af 修复param参数名称 2020-07-17 11:11:03 +08:00
Sxile aad58640dc 翻转""为equals调用方,防止空指针异常 2020-07-17 11:10:14 +08:00
RuoYi 2211a75704 编码文件名修改为uuid方式 2020-07-17 09:24:04 +08:00
RuoYi 4088463adf 定时任务cron表达式验证 2020-07-16 16:54:14 +08:00
若依 dd7a9850e3 !39 角色权限修改时已有权限未自动勾选异常修复
Merge pull request !39 from 严俊东/N/A
2020-07-10 18:28:20 +08:00
RuoYi a691da0c97 防止切换权限用户后登录出现404 2020-07-10 16:36:25 +08:00
RuoYi ec09696512 Excel支持sort导出排序 2020-07-10 14:47:58 +08:00
严俊东 d04ec69df4 角色权限修改时已有权限未自动勾选异常修复 2020-07-10 12:52:45 +08:00
若依 bc56aae219 !33 RedisCache中所有方法参数添加final,并优化list和set存取效率,添加其它常用redis方法
RedisCache中所有方法参数添加final,并优化list和set存取效率,添加其它常用redis方法
2020-07-10 10:28:57 +08:00
RuoYi 31765f6392 Merge branch 'master' of https://github.com/yangzongzhuan/RuoYi-Vue 2020-07-04 16:07:51 +08:00
RuoYi 1e2a2026c6 修改文件编码格式 2020-07-04 16:04:30 +08:00
RuoYi e56efebce5 调整文件编码 2020-07-04 15:56:56 +08:00
若依 fb53780d8a !32 令牌秘钥的“秘”写错了,看到顺手就提交了哈
Merge pull request !32 from jack/N/A
2020-07-02 21:01:23 +08:00
liguonan 3a69a31d07 RedisCache中所有方法参数添加final,并优化list取出效率,添加其它常用redis方法 2020-07-02 19:35:37 +08:00
jack d9367425fa 令牌秘钥的“秘”写错了,看到顺手就提交了哈 2020-07-02 18:03:18 +08:00
RuoYi 338f661d41 创建用户不允许选择系统管理员角色 2020-06-29 11:44:46 +08:00
RuoYi 794d6f17db 修复代码生成导入表结构出现异常页面不提醒问题 2020-06-24 17:55:36 +08:00
RuoYi 7a9564ced5 修复代码生成点击多次表修改数据不变化的问题 2020-06-24 17:17:22 +08:00
RuoYi 5d5f955a34 修复头像上传成功二次打开无法改变裁剪框大小和位置问题 2020-06-24 15:59:18 +08:00
RuoYi eac9403ea4 修复布局为small者mini用户表单显示错位问题 2020-06-24 15:21:39 +08:00
RuoYi f7f02e3a3f 修复热部署导致的强换异常问题 2020-06-24 14:26:21 +08:00
若依 0dff669374 !28 update ruoyi-ui/src/views/monitor/job/log.vue.
Merge pull request !28 from abbfun/N/A
2020-06-19 22:17:49 +08:00
Sxile 5bd2838b2b 修复注释与参数名称不对应 2020-06-19 18:22:47 +08:00
Sxile f39be3ab9b 添加缺少的@ Override 2020-06-19 18:17:57 +08:00
Sxile f5badba2bb 添加{}使代码更容易理解 2020-06-19 18:13:54 +08:00
Sxile 9ea0041fab 常量接口修改为常量类 2020-06-19 16:01:48 +08:00
abbfun f6de03a009 update ruoyi-ui/src/views/monitor/job/log.vue.
data对象中属性【表单参数form】重复
2020-06-19 10:00:41 +08:00
RuoYi a195df175f 修正定时任务日志权限字符 2020-06-18 15:07:56 +08:00
RuoYi 48ba7d5ed6 修改用户管理复选框宽度,防止部分浏览器出现省略号 2020-06-12 13:45:27 +08:00
RuoYi 03aef64693 缺少EscapeUtil包路径。 2020-06-10 22:09:35 +08:00
若依 c3b5cb20d8 !25 Live轻量级PR
Merge pull request !25 from Live/live
2020-06-10 22:04:51 +08:00
Live 2daf89e0c6 HttpUtils.sendPost()方法,参数无需拼接参数到url,否则会出现双份参数
请求url或form参数 会出现双份参数,并无法获取
{"token":["xxxxxxx","xxxxxxx"],"payType":["weixin","weixin"],"amount":["100","100"],"orderId":["123","123"]}
2020-06-10 18:30:17 +08:00
Live a2d1160205 add ruoyi-ui/public/robots.txt.
项目添加robots.txt 防止后台管理系统被搜索引擎收录
2020-06-09 11:38:16 +08:00
Live 0c069a57cc 项目添加robots.txt 防止后台管理系统被搜索引擎收录 2020-06-09 11:37:39 +08:00
Live 19b8688759 IpUtils工具,清除Xss特殊字符,防止Xff注入攻击 2020-06-09 11:36:10 +08:00
Live 33f09d7747 生成domain 如果是浮点型 统一用BigDecimal 2020-06-09 11:33:09 +08:00
RuoYi 7afc5acc6f 定时任务调整label-width,防止部署出现错位 2020-06-07 17:52:14 +08:00
RuoYi 8a7f33807b 调整表头固定列默认样式 2020-06-07 17:20:35 +08:00
RuoYi 945fb282dd 代码生成模板调整,字段为String并且必填则加空串条件 2020-06-07 16:11:36 +08:00
RuoYi 2fd3cbbd18 Merge branch 'master' of https://github.com/yangzongzhuan/RuoYi-Vue 2020-06-07 16:05:48 +08:00
RuoYi 5680d91a87 代码生成字典Integer/Long使用parseInt 2020-06-07 16:04:07 +08:00
RuoYi 9d8da28f2e Merge branch 'master' of https://github.com/yangzongzhuan/RuoYi-Vue 2020-06-04 16:00:06 +08:00
若依 40185f27e2 !23 修复退出登录重定向到登录页,登录后参数丢失 update ruoyi-ui/src/permission.js.
Merge pull request !23 from Elune/N/A
2020-06-04 14:57:05 +08:00
Elune ef5adf2e2a update ruoyi-ui/src/permission.js.
修复退出登录重定向到登录页,登录后参数丢失。/article?id=6

https://github.com/elunez/eladmin-web/pull/94
2020-06-04 14:53:24 +08:00
RuoYi ff695831dc 修复dict_sort不可update为0的问题&查询返回增加dict_sort升序排序 2020-06-04 14:34:57 +08:00
RuoYi ea9effaf32 修正岗位导出权限注解 2020-06-04 13:57:25 +08:00
RuoYi 4cb4de86db 修复首页搜索菜单外链无法点击跳转问题 2020-06-04 09:48:05 +08:00
RuoYi c861b78f80 修复菜单管理选择图标,backspace删除时不过滤数据 2020-06-03 17:59:32 +08:00
RuoYi 5123832cd7 用户管理部门分支节点不可检查&显示计数 2020-06-03 16:53:17 +08:00
RuoYi ec407bbe25 数据范围过滤属性调整 2020-06-03 13:00:30 +08:00
RuoYi 0d7f5e037e 若依 2.3 2020-06-01 10:36:19 +08:00
RuoYi 31b63bf14d 升级fastjson到最新版1.2.70 修复高危安全漏洞 2020-06-01 10:09:39 +08:00
RuoYi 5ce4291ef1 若依 2.3 2020-06-01 09:18:18 +08:00
1184 changed files with 134177 additions and 28196 deletions

View File

@ -37,7 +37,9 @@ nbdist/
# Others
*.log
*.xml.versionsBackup
*.swp
!*/build/*.java
!*/build/*.html
!*/build/*.xml
!*/build/*.xml
/logs/

5
.run/test#1.run.xml Normal file
View File

@ -0,0 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="test#1" type="HttpClient.HttpRequestRunConfigurationType" factoryName="HTTP Request" path="$PROJECT_DIR$/ruoyi-segchk-web/src/main/resources/test.http" runType="Run single request">
<method v="2" />
</configuration>
</component>

View File

@ -1,14 +1,17 @@
## 平台简介
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 前端采用Vue、Element UI。
* 后端采用Spring Boot、Spring Security、Redis & Jwt。
* 权限认证使用Jwt支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* 高效率开发,使用代码生成器可以一键生成前后端代码。
* 提供了一个Oracle版本[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 感谢[Vue-Element-Admin](https://github.com/PanJiaChen/vue-element-admin)[eladmin-web](https://gitee.com/elunez/eladmin-web?_from=gitee_search)。
* 提供了单应用版本[RuoYi-Vue-fast](https://github.com/yangzongzhuan/RuoYi-Vue-fast)Oracle版本[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
* 阿里云优惠券:[点我进入](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)&nbsp;&nbsp;
* 特别鸣谢:[element](https://github.com/ElemeFE/element)[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)[eladmin-web](https://github.com/elunez/eladmin-web)。
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)&nbsp;&nbsp;
## 内置功能
@ -27,8 +30,9 @@
13. 代码生成前后端代码的生成java、html、xml、sql支持CRUD下载 。
14. 系统接口根据业务代码自动生成相关的api接口文档。
15. 服务监控监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 在线构建器拖动表单元素生成相应的HTML代码。
17. 连接池监视监视当前系统数据库连接池状态可进行分析SQL找出系统性能瓶颈。
16. 缓存监控:对系统的缓存信息查询,命令统计等。
17. 在线构建器拖动表单元素生成相应的HTML代码。
18. 连接池监视监视当前系统数据库连接池状态可进行分析SQL找出系统性能瓶颈。
## 在线体验
@ -46,36 +50,36 @@
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/707825ad3f29de74a8d6d02fbd73ad631ea.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/46be40cc6f01aa300eed53a19b5012bf484.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/4284796d4cea240d181b8f2201813dda710.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/3ecfac87a049f7fe36abbcaafb2c40d36cf.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/71c2d48905221a09a728df4aff4160b8607.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/c14c1ee9a64a6a9c2c22f67d43198767dbe.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/fdea1d8bb8625c27bf964176a2c8ebc6945.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/509d2708cfd762b6e6339364cac1cc1970c.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-f1fd681cc9d295db74e85ad6d2fe4389454.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-6d73c2140ce694e3de4c05035fdc1868d4c.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
</tr>
</table>
## 若依前后端分离交流群
QQ群 [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) 点击按钮入群。
QQ群 [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/已满-104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) [![加入QQ群](https://img.shields.io/badge/已满-186866453-blue.svg)](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [![加入QQ群](https://img.shields.io/badge/已满-201396349-blue.svg)](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [![加入QQ群](https://img.shields.io/badge/101456076-blue.svg)](https://jq.qq.com/?_wv=1027&k=kOIINEb5) 点击按钮入群。

View File

@ -1,6 +1,6 @@
@echo off
echo.
echo [信息] 清理生成路径。
echo [信息] 清理工程target生成路径。
echo.
%~d0

14
bin/run.bat Normal file
View File

@ -0,0 +1,14 @@
@echo off
echo.
echo [信息] 使用Jar命令运行Web工程。
echo.
cd %~dp0
cd ../ruoyi-admin/target
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -jar %JAVA_OPTS% ruoyi-admin.jar
cd bin
pause

Binary file not shown.

298
java_sdk_v3.0.9/README.md Normal file
View File

@ -0,0 +1,298 @@
微信支付 Java SDK
------
对[微信支付开发者文档](https://pay.weixin.qq.com/wiki/doc/api/index.html)中给出的API进行了封装。
com.github.wxpay.sdk.WXPay类下提供了对应的方法
|方法名 | 说明 |
|--------|--------|
|microPay| 刷卡支付 |
|unifiedOrder | 统一下单|
|orderQuery | 查询订单 |
|reverse | 撤销订单 |
|closeOrder|关闭订单|
|refund|申请退款|
|refundQuery|查询退款|
|downloadBill|下载对账单|
|report|交易保障|
|shortUrl|转换短链接|
|authCodeToOpenid|授权码查询openid|
* 注意:
* 证书文件不能放在web服务器虚拟目录应放在有访问权限控制的目录中防止被他人下载
* 建议将证书文件名改为复杂且不容易猜测的文件名
* 商户服务器要做好病毒和木马防护工作,不被非法侵入者窃取证书文件
* 请妥善保管商户支付密钥、公众帐号SECRET避免密钥泄露
* 参数为`Map<String, String>`对象,返回类型也是`Map<String, String>`
* 方法内部会将参数会转换成含有`appid`、`mch_id`、`nonce_str`、`sign\_type`和`sign`的XML
* 可选HMAC-SHA256算法和MD5算法签名
* 通过HTTPS请求得到返回数据后会对其做必要的处理例如验证签名签名错误则抛出异常
* 对于downloadBill无论是否成功都返回Map且都含有`return_code`和`return_msg`,若成功,其中`return_code`为`SUCCESS`,另外`data`对应对账单数据
## 示例
配置类MyConfig:
```java
import com.github.wxpay.sdk.WXPayConfig;
import java.io.*;
public class MyConfig implements WXPayConfig{
private byte[] certData;
public MyConfig() throws Exception {
String certPath = "/path/to/apiclient_cert.p12";
File file = new File(certPath);
InputStream certStream = new FileInputStream(file);
this.certData = new byte[(int) file.length()];
certStream.read(this.certData);
certStream.close();
}
public String getAppID() {
return "wx8888888888888888";
}
public String getMchID() {
return "12888888";
}
public String getKey() {
return "88888888888888888888888888888888";
}
public InputStream getCertStream() {
ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
return certBis;
}
public int getHttpConnectTimeoutMs() {
return 8000;
}
public int getHttpReadTimeoutMs() {
return 10000;
}
}
```
统一下单:
```java
import com.github.wxpay.sdk.WXPay;
import java.util.HashMap;
import java.util.Map;
public class WXPayExample {
public static void main(String[] args) throws Exception {
MyConfig config = new MyConfig();
WXPay wxpay = new WXPay(config);
Map<String, String> data = new HashMap<String, String>();
data.put("body", "腾讯充值中心-QQ会员充值");
data.put("out_trade_no", "2016090910595900000012");
data.put("device_info", "");
data.put("fee_type", "CNY");
data.put("total_fee", "1");
data.put("spbill_create_ip", "123.12.12.123");
data.put("notify_url", "http://www.example.com/wxpay/notify");
data.put("trade_type", "NATIVE"); // 此处指定为扫码支付
data.put("product_id", "12");
try {
Map<String, String> resp = wxpay.unifiedOrder(data);
System.out.println(resp);
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
订单查询:
```java
import com.github.wxpay.sdk.WXPay;
import java.util.HashMap;
import java.util.Map;
public class WXPayExample {
public static void main(String[] args) throws Exception {
MyConfig config = new MyConfig();
WXPay wxpay = new WXPay(config);
Map<String, String> data = new HashMap<String, String>();
data.put("out_trade_no", "2016090910595900000012");
try {
Map<String, String> resp = wxpay.orderQuery(data);
System.out.println(resp);
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
退款查询:
```java
import com.github.wxpay.sdk.WXPay;
import java.util.HashMap;
import java.util.Map;
public class WXPayExample {
public static void main(String[] args) throws Exception {
MyConfig config = new MyConfig();
WXPay wxpay = new WXPay(config);
Map<String, String> data = new HashMap<String, String>();
data.put("out_trade_no", "2016090910595900000012");
try {
Map<String, String> resp = wxpay.refundQuery(data);
System.out.println(resp);
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
下载对账单:
```java
import com.github.wxpay.sdk.WXPay;
import java.util.HashMap;
import java.util.Map;
public class WXPayExample {
public static void main(String[] args) throws Exception {
MyConfig config = new MyConfig();
WXPay wxpay = new WXPay(config);
Map<String, String> data = new HashMap<String, String>();
data.put("bill_date", "20140603");
data.put("bill_type", "ALL");
try {
Map<String, String> resp = wxpay.downloadBill(data);
System.out.println(resp);
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
其他API的使用和上面类似。
暂时不支持下载压缩格式的对账单但可以使用该SDK生成请求用的XML数据
```java
import com.github.wxpay.sdk.WXPay;
import com.github.wxpay.sdk.WXPayUtil;
import java.util.HashMap;
import java.util.Map;
public class WXPayExample {
public static void main(String[] args) throws Exception {
MyConfig config = new MyConfig();
WXPay wxpay = new WXPay(config);
Map<String, String> data = new HashMap<String, String>();
data.put("bill_date", "20140603");
data.put("bill_type", "ALL");
data.put("tar_type", "GZIP");
try {
data = wxpay.fillRequestData(data);
System.out.println(WXPayUtil.mapToXml(data));
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
收到支付结果通知时,需要验证签名,可以这样做:
```java
import com.github.wxpay.sdk.WXPay;
import com.github.wxpay.sdk.WXPayUtil;
import java.util.Map;
public class WXPayExample {
public static void main(String[] args) throws Exception {
String notifyData = "...."; // 支付结果通知的xml格式数据
MyConfig config = new MyConfig();
WXPay wxpay = new WXPay(config);
Map<String, String> notifyMap = WXPayUtil.xmlToMap(notifyData); // 转换成map
if (wxpay.isPayResultNotifySignatureValid(notifyMap)) {
// 签名正确
// 进行处理。
// 注意特殊情况:订单已经退款,但收到了支付结果成功的通知,不应把商户侧订单状态从退款改成支付成功
}
else {
// 签名错误如果数据里没有sign字段也认为是签名错误
}
}
}
```
HTTPS请求可选HMAC-SHA256算法和MD5算法签名
```
import com.github.wxpay.sdk.WXPay;
import com.github.wxpay.sdk.WXPayConstants;
public class WXPayExample {
public static void main(String[] args) throws Exception {
MyConfig config = new MyConfig();
WXPay wxpay = new WXPay(config, WXPayConstants.SignType.HMACSHA256);
// ......
}
}
```
若需要使用sandbox环境
```
import com.github.wxpay.sdk.WXPay;
import com.github.wxpay.sdk.WXPayConstants;
public class WXPayExample {
public static void main(String[] args) throws Exception {
MyConfig config = new MyConfig();
WXPay wxpay = new WXPay(config, WXPayConstants.SignType.MD5, true);
// ......
}
}
```

127
java_sdk_v3.0.9/pom.xml Normal file
View File

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.wxpay</groupId>
<artifactId>wxpay-sdk</artifactId>
<version>3.0.9</version>
<name>wxpay-sdk</name>
<description>wxpay sdk</description>
<!-- <url>https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=11_1</url>-->
<properties>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.21</version>
</dependency>
</dependencies>
<!--<licenses>
<license>
<name>The BSD 3-Clause License</name>
<url>https://opensource.org/licenses/BSD-3-Clause</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url></url>
<connection></connection>
<developerConnection></developerConnection>
</scm>
<developers>
<developer>
<name>wxpay</name>
<email></email>
<url>https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=11_1</url>
</developer>
</developers>-->
<profiles>
<profile>
<id>release</id>
<distributionManagement>
<snapshotRepository>
<id>oss</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>oss</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<!-- Source -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Gpg Signature -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,42 @@
package com.github.wxpay.sdk;
/**
*
*/
public abstract interface IWXPayDomain {
/**
*
* @param domain api.mch.weixin.qq.com
* @param elapsedTimeMillis
* @param ex
* null
* ConnectTimeoutException
* UnknownHostException dns
*/
abstract void report(final String domain, long elapsedTimeMillis, final Exception ex);
/**
*
* @param config
* @return
*/
abstract DomainInfo getDomain(final WXPayConfig config);
static class DomainInfo{
public String domain; //域名
public boolean primaryDomain; //该域名是否为主域名。例如:api.mch.weixin.qq.com为主域名
public DomainInfo(String domain, boolean primaryDomain) {
this.domain = domain;
this.primaryDomain = primaryDomain;
}
@Override
public String toString() {
return "DomainInfo{" +
"domain='" + domain + '\'' +
", primaryDomain=" + primaryDomain +
'}';
}
}
}

View File

@ -0,0 +1,689 @@
package com.github.wxpay.sdk;
import com.github.wxpay.sdk.WXPayConstants.SignType;
import java.util.HashMap;
import java.util.Map;
public class WXPay {
private WXPayConfig config;
private SignType signType;
private boolean autoReport;
private boolean useSandbox;
private String notifyUrl;
private WXPayRequest wxPayRequest;
public WXPay(final WXPayConfig config) throws Exception {
this(config, null, true, false);
}
public WXPay(final WXPayConfig config, final boolean autoReport) throws Exception {
this(config, null, autoReport, false);
}
public WXPay(final WXPayConfig config, final boolean autoReport, final boolean useSandbox) throws Exception{
this(config, null, autoReport, useSandbox);
}
public WXPay(final WXPayConfig config, final String notifyUrl) throws Exception {
this(config, notifyUrl, true, false);
}
public WXPay(final WXPayConfig config, final String notifyUrl, final boolean autoReport) throws Exception {
this(config, notifyUrl, autoReport, false);
}
public WXPay(final WXPayConfig config, final String notifyUrl, final boolean autoReport, final boolean useSandbox) throws Exception {
this.config = config;
this.notifyUrl = notifyUrl;
this.autoReport = autoReport;
this.useSandbox = useSandbox;
if (useSandbox) {
this.signType = SignType.MD5; // 沙箱环境
}
else {
this.signType = SignType.HMACSHA256;
}
this.wxPayRequest = new WXPayRequest(config);
}
private void checkWXPayConfig() throws Exception {
if (this.config == null) {
throw new Exception("config is null");
}
if (this.config.getAppID() == null || this.config.getAppID().trim().length() == 0) {
throw new Exception("appid in config is empty");
}
if (this.config.getMchID() == null || this.config.getMchID().trim().length() == 0) {
throw new Exception("appid in config is empty");
}
if (this.config.getCertStream() == null) {
throw new Exception("cert stream in config is empty");
}
if (this.config.getWXPayDomain() == null){
throw new Exception("config.getWXPayDomain() is null");
}
if (this.config.getHttpConnectTimeoutMs() < 10) {
throw new Exception("http connect timeout is too small");
}
if (this.config.getHttpReadTimeoutMs() < 10) {
throw new Exception("http read timeout is too small");
}
}
/**
* Map appidmch_idnonce_strsign_typesign <br>
*
*
* @param reqData
* @return
* @throws Exception
*/
public Map<String, String> fillRequestData(Map<String, String> reqData) throws Exception {
reqData.put("appid", config.getAppID());
reqData.put("mch_id", config.getMchID());
reqData.put("nonce_str", WXPayUtil.generateNonceStr());
if (SignType.MD5.equals(this.signType)) {
reqData.put("sign_type", WXPayConstants.MD5);
}
else if (SignType.HMACSHA256.equals(this.signType)) {
reqData.put("sign_type", WXPayConstants.HMACSHA256);
}
reqData.put("sign", WXPayUtil.generateSignature(reqData, config.getKey(), this.signType));
return reqData;
}
/**
* xmlsignsignfalse
*
* @param reqData wxpay post
* @return
* @throws Exception
*/
public boolean isResponseSignatureValid(Map<String, String> reqData) throws Exception {
// 返回数据的签名方式和请求中给定的签名方式是一致的
return WXPayUtil.isSignatureValid(reqData, this.config.getKey(), this.signType);
}
/**
* sign
*
* @param reqData wxpay post
* @return
* @throws Exception
*/
public boolean isPayResultNotifySignatureValid(Map<String, String> reqData) throws Exception {
String signTypeInData = reqData.get(WXPayConstants.FIELD_SIGN_TYPE);
SignType signType;
if (signTypeInData == null) {
signType = SignType.MD5;
}
else {
signTypeInData = signTypeInData.trim();
if (signTypeInData.length() == 0) {
signType = SignType.MD5;
}
else if (WXPayConstants.MD5.equals(signTypeInData)) {
signType = SignType.MD5;
}
else if (WXPayConstants.HMACSHA256.equals(signTypeInData)) {
signType = SignType.HMACSHA256;
}
else {
throw new Exception(String.format("Unsupported sign_type: %s", signTypeInData));
}
}
return WXPayUtil.isSignatureValid(reqData, this.config.getKey(), signType);
}
/**
*
* @param urlSuffix String
* @param reqData wxpay post
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public String requestWithoutCert(String urlSuffix, Map<String, String> reqData,
int connectTimeoutMs, int readTimeoutMs) throws Exception {
String msgUUID = reqData.get("nonce_str");
String reqBody = WXPayUtil.mapToXml(reqData);
String resp = this.wxPayRequest.requestWithoutCert(urlSuffix, msgUUID, reqBody, connectTimeoutMs, readTimeoutMs, autoReport);
return resp;
}
/**
*
* @param urlSuffix String
* @param reqData wxpay post Map
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public String requestWithCert(String urlSuffix, Map<String, String> reqData,
int connectTimeoutMs, int readTimeoutMs) throws Exception {
String msgUUID= reqData.get("nonce_str");
String reqBody = WXPayUtil.mapToXml(reqData);
String resp = this.wxPayRequest.requestWithCert(urlSuffix, msgUUID, reqBody, connectTimeoutMs, readTimeoutMs, this.autoReport);
return resp;
}
/**
* HTTPS APIMapreturn_codeSUCCESS
* @param xmlStr APIXML
* @return Map
* @throws Exception
*/
public Map<String, String> processResponseXml(String xmlStr) throws Exception {
String RETURN_CODE = "return_code";
String return_code;
Map<String, String> respData = WXPayUtil.xmlToMap(xmlStr);
if (respData.containsKey(RETURN_CODE)) {
return_code = respData.get(RETURN_CODE);
}
else {
throw new Exception(String.format("No `return_code` in XML: %s", xmlStr));
}
if (return_code.equals(WXPayConstants.FAIL)) {
return respData;
}
else if (return_code.equals(WXPayConstants.SUCCESS)) {
if (this.isResponseSignatureValid(respData)) {
return respData;
}
else {
throw new Exception(String.format("Invalid sign value in XML: %s", xmlStr));
}
}
else {
throw new Exception(String.format("return_code value %s is invalid in XML: %s", return_code, xmlStr));
}
}
/**
* <br>
*
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> microPay(Map<String, String> reqData) throws Exception {
return this.microPay(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* <br>
*
* @param reqData wxpay post
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public Map<String, String> microPay(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_MICROPAY_URL_SUFFIX;
}
else {
url = WXPayConstants.MICROPAY_URL_SUFFIX;
}
String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs);
return this.processResponseXml(respXml);
}
/**
* POS
* 60s
* @param reqData
* @return
* @throws Exception
*/
public Map<String, String> microPayWithPos(Map<String, String> reqData) throws Exception {
return this.microPayWithPos(reqData, this.config.getHttpConnectTimeoutMs());
}
/**
* POS
* 60s
* @param reqData
* @param connectTimeoutMs
* @return
* @throws Exception
*/
public Map<String, String> microPayWithPos(Map<String, String> reqData, int connectTimeoutMs) throws Exception {
int remainingTimeMs = 60*1000;
long startTimestampMs = 0;
Map<String, String> lastResult = null;
Exception lastException = null;
while (true) {
startTimestampMs = WXPayUtil.getCurrentTimestampMs();
int readTimeoutMs = remainingTimeMs - connectTimeoutMs;
if (readTimeoutMs > 1000) {
try {
lastResult = this.microPay(reqData, connectTimeoutMs, readTimeoutMs);
String returnCode = lastResult.get("return_code");
if (returnCode.equals("SUCCESS")) {
String resultCode = lastResult.get("result_code");
String errCode = lastResult.get("err_code");
if (resultCode.equals("SUCCESS")) {
break;
}
else {
// 看错误码,若支付结果未知,则重试提交刷卡支付
if (errCode.equals("SYSTEMERROR") || errCode.equals("BANKERROR") || errCode.equals("USERPAYING")) {
remainingTimeMs = remainingTimeMs - (int)(WXPayUtil.getCurrentTimestampMs() - startTimestampMs);
if (remainingTimeMs <= 100) {
break;
}
else {
WXPayUtil.getLogger().info("microPayWithPos: try micropay again");
if (remainingTimeMs > 5*1000) {
Thread.sleep(5*1000);
}
else {
Thread.sleep(1*1000);
}
continue;
}
}
else {
break;
}
}
}
else {
break;
}
}
catch (Exception ex) {
lastResult = null;
lastException = ex;
}
}
else {
break;
}
}
if (lastResult == null) {
throw lastException;
}
else {
return lastResult;
}
}
/**
* <br>
* APP
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> unifiedOrder(Map<String, String> reqData) throws Exception {
return this.unifiedOrder(reqData, config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* <br>
* APP
* @param reqData wxpay post
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public Map<String, String> unifiedOrder(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_UNIFIEDORDER_URL_SUFFIX;
}
else {
url = WXPayConstants.UNIFIEDORDER_URL_SUFFIX;
}
if(this.notifyUrl != null) {
reqData.put("notify_url", this.notifyUrl);
}
String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs);
return this.processResponseXml(respXml);
}
/**
* <br>
* APP
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> orderQuery(Map<String, String> reqData) throws Exception {
return this.orderQuery(reqData, config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* <br>
* APP
* @param reqData wxpay post int
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public Map<String, String> orderQuery(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_ORDERQUERY_URL_SUFFIX;
}
else {
url = WXPayConstants.ORDERQUERY_URL_SUFFIX;
}
String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs);
return this.processResponseXml(respXml);
}
/**
* <br>
*
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> reverse(Map<String, String> reqData) throws Exception {
return this.reverse(reqData, config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* <br>
* <br>
*
* @param reqData wxpay post
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public Map<String, String> reverse(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_REVERSE_URL_SUFFIX;
}
else {
url = WXPayConstants.REVERSE_URL_SUFFIX;
}
String respXml = this.requestWithCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs);
return this.processResponseXml(respXml);
}
/**
* <br>
* APP
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> closeOrder(Map<String, String> reqData) throws Exception {
return this.closeOrder(reqData, config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* <br>
* APP
* @param reqData wxpay post
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public Map<String, String> closeOrder(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_CLOSEORDER_URL_SUFFIX;
}
else {
url = WXPayConstants.CLOSEORDER_URL_SUFFIX;
}
String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs);
return this.processResponseXml(respXml);
}
/**
* 退<br>
* APP
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> refund(Map<String, String> reqData) throws Exception {
return this.refund(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* 退<br>
* APP<br>
*
* @param reqData wxpay post
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public Map<String, String> refund(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_REFUND_URL_SUFFIX;
}
else {
url = WXPayConstants.REFUND_URL_SUFFIX;
}
String respXml = this.requestWithCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs);
return this.processResponseXml(respXml);
}
/**
* 退<br>
* APP
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> refundQuery(Map<String, String> reqData) throws Exception {
return this.refundQuery(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* 退<br>
* APP
* @param reqData wxpay post
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public Map<String, String> refundQuery(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_REFUNDQUERY_URL_SUFFIX;
}
else {
url = WXPayConstants.REFUNDQUERY_URL_SUFFIX;
}
String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs);
return this.processResponseXml(respXml);
}
/**
* XML<br>
* APP
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> downloadBill(Map<String, String> reqData) throws Exception {
return this.downloadBill(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* <br>
* APP<br>
* MapMapreturn_codereturn_msgdata
* return_code`SUCCESS`data
* @param reqData wxpay post
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public Map<String, String> downloadBill(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_DOWNLOADBILL_URL_SUFFIX;
}
else {
url = WXPayConstants.DOWNLOADBILL_URL_SUFFIX;
}
String respStr = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs).trim();
Map<String, String> ret;
// 出现错误返回XML数据
if (respStr.indexOf("<") == 0) {
ret = WXPayUtil.xmlToMap(respStr);
}
else {
// 正常返回csv数据
ret = new HashMap<String, String>();
ret.put("return_code", WXPayConstants.SUCCESS);
ret.put("return_msg", "ok");
ret.put("data", respStr);
}
return ret;
}
/**
* <br>
* APP
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> report(Map<String, String> reqData) throws Exception {
return this.report(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* <br>
* APP
* @param reqData wxpay post
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public Map<String, String> report(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_REPORT_URL_SUFFIX;
}
else {
url = WXPayConstants.REPORT_URL_SUFFIX;
}
String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs);
return WXPayUtil.xmlToMap(respXml);
}
/**
* <br>
*
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> shortUrl(Map<String, String> reqData) throws Exception {
return this.shortUrl(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* <br>
*
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> shortUrl(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_SHORTURL_URL_SUFFIX;
}
else {
url = WXPayConstants.SHORTURL_URL_SUFFIX;
}
String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs);
return this.processResponseXml(respXml);
}
/**
* OPENID<br>
*
* @param reqData wxpay post
* @return API
* @throws Exception
*/
public Map<String, String> authCodeToOpenid(Map<String, String> reqData) throws Exception {
return this.authCodeToOpenid(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs());
}
/**
* OPENID<br>
*
* @param reqData wxpay post
* @param connectTimeoutMs
* @param readTimeoutMs
* @return API
* @throws Exception
*/
public Map<String, String> authCodeToOpenid(Map<String, String> reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception {
String url;
if (this.useSandbox) {
url = WXPayConstants.SANDBOX_AUTHCODETOOPENID_URL_SUFFIX;
}
else {
url = WXPayConstants.AUTHCODETOOPENID_URL_SUFFIX;
}
String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs);
return this.processResponseXml(respXml);
}
} // end class

View File

@ -0,0 +1,103 @@
package com.github.wxpay.sdk;
import java.io.InputStream;
public abstract class WXPayConfig {
/**
* App ID
*
* @return App ID
*/
abstract String getAppID();
/**
* Mch ID
*
* @return Mch ID
*/
abstract String getMchID();
/**
* API
*
* @return API
*/
abstract String getKey();
/**
*
*
* @return
*/
abstract InputStream getCertStream();
/**
* HTTP(S)
*
* @return
*/
public int getHttpConnectTimeoutMs() {
return 6*1000;
}
/**
* HTTP(S)
*
* @return
*/
public int getHttpReadTimeoutMs() {
return 8*1000;
}
/**
* WXPayDomain,
* @return
*/
abstract IWXPayDomain getWXPayDomain();
/**
*
* false
*
* @return
*/
public boolean shouldAutoReport() {
return true;
}
/**
* 线
*
* @return
*/
public int getReportWorkerNum() {
return 6;
}
/**
* 线
* 200B10000 2000 KB2MB
*
* @return
*/
public int getReportQueueMaxSize() {
return 10000;
}
/**
*
*
* @return
*/
public int getReportBatchSize() {
return 10;
}
}

View File

@ -0,0 +1,59 @@
package com.github.wxpay.sdk;
import org.apache.http.client.HttpClient;
/**
*
*/
public class WXPayConstants {
public enum SignType {
MD5, HMACSHA256
}
public static final String DOMAIN_API = "api.mch.weixin.qq.com";
public static final String DOMAIN_API2 = "api2.mch.weixin.qq.com";
public static final String DOMAIN_APIHK = "apihk.mch.weixin.qq.com";
public static final String DOMAIN_APIUS = "apius.mch.weixin.qq.com";
public static final String FAIL = "FAIL";
public static final String SUCCESS = "SUCCESS";
public static final String HMACSHA256 = "HMAC-SHA256";
public static final String MD5 = "MD5";
public static final String FIELD_SIGN = "sign";
public static final String FIELD_SIGN_TYPE = "sign_type";
public static final String WXPAYSDK_VERSION = "WXPaySDK/3.0.9";
public static final String USER_AGENT = WXPAYSDK_VERSION +
" (" + System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version") +
") Java/" + System.getProperty("java.version") + " HttpClient/" + HttpClient.class.getPackage().getImplementationVersion();
public static final String MICROPAY_URL_SUFFIX = "/pay/micropay";
public static final String UNIFIEDORDER_URL_SUFFIX = "/pay/unifiedorder";
public static final String ORDERQUERY_URL_SUFFIX = "/pay/orderquery";
public static final String REVERSE_URL_SUFFIX = "/secapi/pay/reverse";
public static final String CLOSEORDER_URL_SUFFIX = "/pay/closeorder";
public static final String REFUND_URL_SUFFIX = "/secapi/pay/refund";
public static final String REFUNDQUERY_URL_SUFFIX = "/pay/refundquery";
public static final String DOWNLOADBILL_URL_SUFFIX = "/pay/downloadbill";
public static final String REPORT_URL_SUFFIX = "/payitil/report";
public static final String SHORTURL_URL_SUFFIX = "/tools/shorturl";
public static final String AUTHCODETOOPENID_URL_SUFFIX = "/tools/authcodetoopenid";
// sandbox
public static final String SANDBOX_MICROPAY_URL_SUFFIX = "/sandboxnew/pay/micropay";
public static final String SANDBOX_UNIFIEDORDER_URL_SUFFIX = "/sandboxnew/pay/unifiedorder";
public static final String SANDBOX_ORDERQUERY_URL_SUFFIX = "/sandboxnew/pay/orderquery";
public static final String SANDBOX_REVERSE_URL_SUFFIX = "/sandboxnew/secapi/pay/reverse";
public static final String SANDBOX_CLOSEORDER_URL_SUFFIX = "/sandboxnew/pay/closeorder";
public static final String SANDBOX_REFUND_URL_SUFFIX = "/sandboxnew/secapi/pay/refund";
public static final String SANDBOX_REFUNDQUERY_URL_SUFFIX = "/sandboxnew/pay/refundquery";
public static final String SANDBOX_DOWNLOADBILL_URL_SUFFIX = "/sandboxnew/pay/downloadbill";
public static final String SANDBOX_REPORT_URL_SUFFIX = "/sandboxnew/payitil/report";
public static final String SANDBOX_SHORTURL_URL_SUFFIX = "/sandboxnew/tools/shorturl";
public static final String SANDBOX_AUTHCODETOOPENID_URL_SUFFIX = "/sandboxnew/tools/authcodetoopenid";
}

View File

@ -0,0 +1,265 @@
package com.github.wxpay.sdk;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
import org.apache.http.util.EntityUtils;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
/**
*
*/
public class WXPayReport {
public static class ReportInfo {
/**
* 使int0false 1true
*/
// 基本信息
private String version = "v1";
private String sdk = WXPayConstants.WXPAYSDK_VERSION;
private String uuid; // 交易的标识
private long timestamp; // 上报时的时间戳,单位秒
private long elapsedTimeMillis; // 耗时,单位 毫秒
// 针对主域名
private String firstDomain; // 第1次请求的域名
private boolean primaryDomain; //是否主域名
private int firstConnectTimeoutMillis; // 第1次请求设置的连接超时时间单位 毫秒
private int firstReadTimeoutMillis; // 第1次请求设置的读写超时时间单位 毫秒
private int firstHasDnsError; // 第1次请求是否出现dns问题
private int firstHasConnectTimeout; // 第1次请求是否出现连接超时
private int firstHasReadTimeout; // 第1次请求是否出现连接超时
public ReportInfo(String uuid, long timestamp, long elapsedTimeMillis, String firstDomain, boolean primaryDomain, int firstConnectTimeoutMillis, int firstReadTimeoutMillis, boolean firstHasDnsError, boolean firstHasConnectTimeout, boolean firstHasReadTimeout) {
this.uuid = uuid;
this.timestamp = timestamp;
this.elapsedTimeMillis = elapsedTimeMillis;
this.firstDomain = firstDomain;
this.primaryDomain = primaryDomain;
this.firstConnectTimeoutMillis = firstConnectTimeoutMillis;
this.firstReadTimeoutMillis = firstReadTimeoutMillis;
this.firstHasDnsError = firstHasDnsError?1:0;
this.firstHasConnectTimeout = firstHasConnectTimeout?1:0;
this.firstHasReadTimeout = firstHasReadTimeout?1:0;
}
@Override
public String toString() {
return "ReportInfo{" +
"version='" + version + '\'' +
", sdk='" + sdk + '\'' +
", uuid='" + uuid + '\'' +
", timestamp=" + timestamp +
", elapsedTimeMillis=" + elapsedTimeMillis +
", firstDomain='" + firstDomain + '\'' +
", primaryDomain=" + primaryDomain +
", firstConnectTimeoutMillis=" + firstConnectTimeoutMillis +
", firstReadTimeoutMillis=" + firstReadTimeoutMillis +
", firstHasDnsError=" + firstHasDnsError +
", firstHasConnectTimeout=" + firstHasConnectTimeout +
", firstHasReadTimeout=" + firstHasReadTimeout +
'}';
}
/**
* csv
*
* @return
*/
public String toLineString(String key) {
String separator = ",";
Object[] objects = new Object[] {
version, sdk, uuid, timestamp, elapsedTimeMillis,
firstDomain, primaryDomain, firstConnectTimeoutMillis, firstReadTimeoutMillis,
firstHasDnsError, firstHasConnectTimeout, firstHasReadTimeout
};
StringBuffer sb = new StringBuffer();
for(Object obj: objects) {
sb.append(obj).append(separator);
}
try {
String sign = WXPayUtil.HMACSHA256(sb.toString(), key);
sb.append(sign);
return sb.toString();
}
catch (Exception ex) {
return null;
}
}
}
private static final String REPORT_URL = "http://report.mch.weixin.qq.com/wxpay/report/default";
// private static final String REPORT_URL = "http://127.0.0.1:5000/test";
private static final int DEFAULT_CONNECT_TIMEOUT_MS = 6*1000;
private static final int DEFAULT_READ_TIMEOUT_MS = 8*1000;
private LinkedBlockingQueue<String> reportMsgQueue = null;
private WXPayConfig config;
private ExecutorService executorService;
private volatile static WXPayReport INSTANCE;
private WXPayReport(final WXPayConfig config) {
this.config = config;
reportMsgQueue = new LinkedBlockingQueue<String>(config.getReportQueueMaxSize());
// 添加处理线程
executorService = Executors.newFixedThreadPool(config.getReportWorkerNum(), new ThreadFactory() {
public Thread newThread(Runnable r) {
Thread t = Executors.defaultThreadFactory().newThread(r);
t.setDaemon(true);
return t;
}
});
if (config.shouldAutoReport()) {
WXPayUtil.getLogger().info("report worker num: {}", config.getReportWorkerNum());
for (int i = 0; i < config.getReportWorkerNum(); ++i) {
executorService.execute(new Runnable() {
public void run() {
while (true) {
// 先用 take 获取数据
try {
StringBuffer sb = new StringBuffer();
String firstMsg = reportMsgQueue.take();
WXPayUtil.getLogger().info("get first report msg: {}", firstMsg);
String msg = null;
sb.append(firstMsg); //会阻塞至有消息
int remainNum = config.getReportBatchSize() - 1;
for (int j=0; j<remainNum; ++j) {
WXPayUtil.getLogger().info("try get remain report msg");
// msg = reportMsgQueue.poll(); // 不阻塞了
msg = reportMsgQueue.take();
WXPayUtil.getLogger().info("get remain report msg: {}", msg);
if (msg == null) {
break;
}
else {
sb.append("\n");
sb.append(msg);
}
}
// 上报
WXPayReport.httpRequest(sb.toString(), DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_READ_TIMEOUT_MS);
}
catch (Exception ex) {
WXPayUtil.getLogger().warn("report fail. reason: {}", ex.getMessage());
}
}
}
});
}
}
}
/**
* JDK 1.5使
*
* @param config
* @return
*/
public static WXPayReport getInstance(WXPayConfig config) {
if (INSTANCE == null) {
synchronized (WXPayReport.class) {
if (INSTANCE == null) {
INSTANCE = new WXPayReport(config);
}
}
}
return INSTANCE;
}
public void report(String uuid, long elapsedTimeMillis,
String firstDomain, boolean primaryDomain, int firstConnectTimeoutMillis, int firstReadTimeoutMillis,
boolean firstHasDnsError, boolean firstHasConnectTimeout, boolean firstHasReadTimeout) {
long currentTimestamp = WXPayUtil.getCurrentTimestamp();
ReportInfo reportInfo = new ReportInfo(uuid, currentTimestamp, elapsedTimeMillis,
firstDomain, primaryDomain, firstConnectTimeoutMillis, firstReadTimeoutMillis,
firstHasDnsError, firstHasConnectTimeout, firstHasReadTimeout);
String data = reportInfo.toLineString(config.getKey());
WXPayUtil.getLogger().info("report {}", data);
if (data != null) {
reportMsgQueue.offer(data);
}
}
@Deprecated
private void reportSync(final String data) throws Exception {
httpRequest(data, DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_READ_TIMEOUT_MS);
}
@Deprecated
private void reportAsync(final String data) throws Exception {
new Thread(new Runnable() {
public void run() {
try {
httpRequest(data, DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_READ_TIMEOUT_MS);
}
catch (Exception ex) {
WXPayUtil.getLogger().warn("report fail. reason: {}", ex.getMessage());
}
}
}).start();
}
/**
* http
* @param data
* @param connectTimeoutMs
* @param readTimeoutMs
* @return
* @throws Exception
*/
private static String httpRequest(String data, int connectTimeoutMs, int readTimeoutMs) throws Exception{
BasicHttpClientConnectionManager connManager;
connManager = new BasicHttpClientConnectionManager(
RegistryBuilder.<ConnectionSocketFactory>create()
.register("http", PlainConnectionSocketFactory.getSocketFactory())
.register("https", SSLConnectionSocketFactory.getSocketFactory())
.build(),
null,
null,
null
);
HttpClient httpClient = HttpClientBuilder.create()
.setConnectionManager(connManager)
.build();
HttpPost httpPost = new HttpPost(REPORT_URL);
RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(readTimeoutMs).setConnectTimeout(connectTimeoutMs).build();
httpPost.setConfig(requestConfig);
StringEntity postEntity = new StringEntity(data, "UTF-8");
httpPost.addHeader("Content-Type", "text/xml");
httpPost.addHeader("User-Agent", WXPayConstants.USER_AGENT);
httpPost.setEntity(postEntity);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
return EntityUtils.toString(httpEntity, "UTF-8");
}
}

View File

@ -0,0 +1,258 @@
package com.github.wxpay.sdk;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.DefaultHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
import org.apache.http.util.EntityUtils;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import java.io.InputStream;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.security.KeyStore;
import java.security.SecureRandom;
import static com.github.wxpay.sdk.WXPayConstants.USER_AGENT;
public class WXPayRequest {
private WXPayConfig config;
public WXPayRequest(WXPayConfig config) throws Exception{
this.config = config;
}
/**
*
* @param domain
* @param urlSuffix
* @param uuid
* @param data
* @param connectTimeoutMs
* @param readTimeoutMs
* @param useCert 使退
* @return
* @throws Exception
*/
private String requestOnce(final String domain, String urlSuffix, String uuid, String data, int connectTimeoutMs, int readTimeoutMs, boolean useCert) throws Exception {
BasicHttpClientConnectionManager connManager;
if (useCert) {
// 证书
char[] password = config.getMchID().toCharArray();
InputStream certStream = config.getCertStream();
KeyStore ks = KeyStore.getInstance("PKCS12");
ks.load(certStream, password);
// 实例化密钥库 & 初始化密钥工厂
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(ks, password);
// 创建 SSLContext
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(kmf.getKeyManagers(), null, new SecureRandom());
SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(
sslContext,
new String[]{"TLSv1"},
null,
new DefaultHostnameVerifier());
connManager = new BasicHttpClientConnectionManager(
RegistryBuilder.<ConnectionSocketFactory>create()
.register("http", PlainConnectionSocketFactory.getSocketFactory())
.register("https", sslConnectionSocketFactory)
.build(),
null,
null,
null
);
}
else {
connManager = new BasicHttpClientConnectionManager(
RegistryBuilder.<ConnectionSocketFactory>create()
.register("http", PlainConnectionSocketFactory.getSocketFactory())
.register("https", SSLConnectionSocketFactory.getSocketFactory())
.build(),
null,
null,
null
);
}
HttpClient httpClient = HttpClientBuilder.create()
.setConnectionManager(connManager)
.build();
String url = "https://" + domain + urlSuffix;
HttpPost httpPost = new HttpPost(url);
RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(readTimeoutMs).setConnectTimeout(connectTimeoutMs).build();
httpPost.setConfig(requestConfig);
StringEntity postEntity = new StringEntity(data, "UTF-8");
httpPost.addHeader("Content-Type", "text/xml");
httpPost.addHeader("User-Agent", USER_AGENT + " " + config.getMchID());
httpPost.setEntity(postEntity);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
return EntityUtils.toString(httpEntity, "UTF-8");
}
private String request(String urlSuffix, String uuid, String data, int connectTimeoutMs, int readTimeoutMs, boolean useCert, boolean autoReport) throws Exception {
Exception exception = null;
long elapsedTimeMillis = 0;
long startTimestampMs = WXPayUtil.getCurrentTimestampMs();
boolean firstHasDnsErr = false;
boolean firstHasConnectTimeout = false;
boolean firstHasReadTimeout = false;
IWXPayDomain.DomainInfo domainInfo = config.getWXPayDomain().getDomain(config);
if(domainInfo == null){
throw new Exception("WXPayConfig.getWXPayDomain().getDomain() is empty or null");
}
try {
String result = requestOnce(domainInfo.domain, urlSuffix, uuid, data, connectTimeoutMs, readTimeoutMs, useCert);
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
config.getWXPayDomain().report(domainInfo.domain, elapsedTimeMillis, null);
WXPayReport.getInstance(config).report(
uuid,
elapsedTimeMillis,
domainInfo.domain,
domainInfo.primaryDomain,
connectTimeoutMs,
readTimeoutMs,
firstHasDnsErr,
firstHasConnectTimeout,
firstHasReadTimeout);
return result;
}
catch (UnknownHostException ex) { // dns 解析错误,或域名不存在
exception = ex;
firstHasDnsErr = true;
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
WXPayUtil.getLogger().warn("UnknownHostException for domainInfo {}", domainInfo);
WXPayReport.getInstance(config).report(
uuid,
elapsedTimeMillis,
domainInfo.domain,
domainInfo.primaryDomain,
connectTimeoutMs,
readTimeoutMs,
firstHasDnsErr,
firstHasConnectTimeout,
firstHasReadTimeout
);
}
catch (ConnectTimeoutException ex) {
exception = ex;
firstHasConnectTimeout = true;
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
WXPayUtil.getLogger().warn("connect timeout happened for domainInfo {}", domainInfo);
WXPayReport.getInstance(config).report(
uuid,
elapsedTimeMillis,
domainInfo.domain,
domainInfo.primaryDomain,
connectTimeoutMs,
readTimeoutMs,
firstHasDnsErr,
firstHasConnectTimeout,
firstHasReadTimeout
);
}
catch (SocketTimeoutException ex) {
exception = ex;
firstHasReadTimeout = true;
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
WXPayUtil.getLogger().warn("timeout happened for domainInfo {}", domainInfo);
WXPayReport.getInstance(config).report(
uuid,
elapsedTimeMillis,
domainInfo.domain,
domainInfo.primaryDomain,
connectTimeoutMs,
readTimeoutMs,
firstHasDnsErr,
firstHasConnectTimeout,
firstHasReadTimeout);
}
catch (Exception ex) {
exception = ex;
elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs;
WXPayReport.getInstance(config).report(
uuid,
elapsedTimeMillis,
domainInfo.domain,
domainInfo.primaryDomain,
connectTimeoutMs,
readTimeoutMs,
firstHasDnsErr,
firstHasConnectTimeout,
firstHasReadTimeout);
}
config.getWXPayDomain().report(domainInfo.domain, elapsedTimeMillis, exception);
throw exception;
}
/**
*
* @param urlSuffix
* @param uuid
* @param data
* @return
*/
public String requestWithoutCert(String urlSuffix, String uuid, String data, boolean autoReport) throws Exception {
return this.request(urlSuffix, uuid, data, config.getHttpConnectTimeoutMs(), config.getHttpReadTimeoutMs(), false, autoReport);
}
/**
*
* @param urlSuffix
* @param uuid
* @param data
* @param connectTimeoutMs
* @param readTimeoutMs
* @return
*/
public String requestWithoutCert(String urlSuffix, String uuid, String data, int connectTimeoutMs, int readTimeoutMs, boolean autoReport) throws Exception {
return this.request(urlSuffix, uuid, data, connectTimeoutMs, readTimeoutMs, false, autoReport);
}
/**
*
* @param urlSuffix
* @param uuid
* @param data
* @return
*/
public String requestWithCert(String urlSuffix, String uuid, String data, boolean autoReport) throws Exception {
return this.request(urlSuffix, uuid, data, config.getHttpConnectTimeoutMs(), config.getHttpReadTimeoutMs(), true, autoReport);
}
/**
*
* @param urlSuffix
* @param uuid
* @param data
* @param connectTimeoutMs
* @param readTimeoutMs
* @return
*/
public String requestWithCert(String urlSuffix, String uuid, String data, int connectTimeoutMs, int readTimeoutMs, boolean autoReport) throws Exception {
return this.request(urlSuffix, uuid, data, connectTimeoutMs, readTimeoutMs, true, autoReport);
}
}

View File

@ -0,0 +1,295 @@
package com.github.wxpay.sdk;
import com.github.wxpay.sdk.WXPayConstants.SignType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.StringWriter;
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.util.*;
public class WXPayUtil {
private static final String SYMBOLS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
private static final Random RANDOM = new SecureRandom();
/**
* XMLMap
*
* @param strXML XML
* @return XMLMap
* @throws Exception
*/
public static Map<String, String> xmlToMap(String strXML) throws Exception {
try {
Map<String, String> data = new HashMap<String, String>();
DocumentBuilder documentBuilder = WXPayXmlUtil.newDocumentBuilder();
InputStream stream = new ByteArrayInputStream(strXML.getBytes("UTF-8"));
org.w3c.dom.Document doc = documentBuilder.parse(stream);
doc.getDocumentElement().normalize();
NodeList nodeList = doc.getDocumentElement().getChildNodes();
for (int idx = 0; idx < nodeList.getLength(); ++idx) {
Node node = nodeList.item(idx);
if (node.getNodeType() == Node.ELEMENT_NODE) {
org.w3c.dom.Element element = (org.w3c.dom.Element) node;
data.put(element.getNodeName(), element.getTextContent());
}
}
try {
stream.close();
} catch (Exception ex) {
// do nothing
}
return data;
} catch (Exception ex) {
WXPayUtil.getLogger().warn("Invalid XML, can not convert to map. Error message: {}. XML content: {}", ex.getMessage(), strXML);
throw ex;
}
}
/**
* MapXML
*
* @param data Map
* @return XML
* @throws Exception
*/
public static String mapToXml(Map<String, String> data) throws Exception {
org.w3c.dom.Document document = WXPayXmlUtil.newDocument();
org.w3c.dom.Element root = document.createElement("xml");
document.appendChild(root);
for (String key: data.keySet()) {
String value = data.get(key);
if (value == null) {
value = "";
}
value = value.trim();
org.w3c.dom.Element filed = document.createElement(key);
filed.appendChild(document.createTextNode(value));
root.appendChild(filed);
}
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
DOMSource source = new DOMSource(document);
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
StringWriter writer = new StringWriter();
StreamResult result = new StreamResult(writer);
transformer.transform(source, result);
String output = writer.getBuffer().toString(); //.replaceAll("\n|\r", "");
try {
writer.close();
}
catch (Exception ex) {
}
return output;
}
/**
* sign XML
*
* @param data Map
* @param key API
* @return signXML
*/
public static String generateSignedXml(final Map<String, String> data, String key) throws Exception {
return generateSignedXml(data, key, SignType.MD5);
}
/**
* sign XML
*
* @param data Map
* @param key API
* @param signType
* @return signXML
*/
public static String generateSignedXml(final Map<String, String> data, String key, SignType signType) throws Exception {
String sign = generateSignature(data, key, signType);
data.put(WXPayConstants.FIELD_SIGN, sign);
return mapToXml(data);
}
/**
*
*
* @param xmlStr XML
* @param key API
* @return
* @throws Exception
*/
public static boolean isSignatureValid(String xmlStr, String key) throws Exception {
Map<String, String> data = xmlToMap(xmlStr);
if (!data.containsKey(WXPayConstants.FIELD_SIGN) ) {
return false;
}
String sign = data.get(WXPayConstants.FIELD_SIGN);
return generateSignature(data, key).equals(sign);
}
/**
* signfalse使MD5
*
* @param data Map
* @param key API
* @return
* @throws Exception
*/
public static boolean isSignatureValid(Map<String, String> data, String key) throws Exception {
return isSignatureValid(data, key, SignType.MD5);
}
/**
* signfalse
*
* @param data Map
* @param key API
* @param signType
* @return
* @throws Exception
*/
public static boolean isSignatureValid(Map<String, String> data, String key, SignType signType) throws Exception {
if (!data.containsKey(WXPayConstants.FIELD_SIGN) ) {
return false;
}
String sign = data.get(WXPayConstants.FIELD_SIGN);
return generateSignature(data, key, signType).equals(sign);
}
/**
*
*
* @param data
* @param key API
* @return
*/
public static String generateSignature(final Map<String, String> data, String key) throws Exception {
return generateSignature(data, key, SignType.MD5);
}
/**
* . sign_typesignType
*
* @param data
* @param key API
* @param signType
* @return
*/
public static String generateSignature(final Map<String, String> data, String key, SignType signType) throws Exception {
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN)) {
continue;
}
if (data.get(k).trim().length() > 0) // 参数值为空,则不参与签名
sb.append(k).append("=").append(data.get(k).trim()).append("&");
}
sb.append("key=").append(key);
if (SignType.MD5.equals(signType)) {
return MD5(sb.toString()).toUpperCase();
}
else if (SignType.HMACSHA256.equals(signType)) {
return HMACSHA256(sb.toString(), key);
}
else {
throw new Exception(String.format("Invalid sign_type: %s", signType));
}
}
/**
* Nonce Str
*
* @return String
*/
public static String generateNonceStr() {
char[] nonceChars = new char[32];
for (int index = 0; index < nonceChars.length; ++index) {
nonceChars[index] = SYMBOLS.charAt(RANDOM.nextInt(SYMBOLS.length()));
}
return new String(nonceChars);
}
/**
* MD5
*
* @param data
* @return MD5
*/
public static String MD5(String data) throws Exception {
java.security.MessageDigest md = MessageDigest.getInstance("MD5");
byte[] array = md.digest(data.getBytes("UTF-8"));
StringBuilder sb = new StringBuilder();
for (byte item : array) {
sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3));
}
return sb.toString().toUpperCase();
}
/**
* HMACSHA256
* @param data
* @param key
* @return
* @throws Exception
*/
public static String HMACSHA256(String data, String key) throws Exception {
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256");
sha256_HMAC.init(secret_key);
byte[] array = sha256_HMAC.doFinal(data.getBytes("UTF-8"));
StringBuilder sb = new StringBuilder();
for (byte item : array) {
sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3));
}
return sb.toString().toUpperCase();
}
/**
*
* @return
*/
public static Logger getLogger() {
Logger logger = LoggerFactory.getLogger("wxpay java sdk");
return logger;
}
/**
*
* @return
*/
public static long getCurrentTimestamp() {
return System.currentTimeMillis()/1000;
}
/**
*
* @return
*/
public static long getCurrentTimestampMs() {
return System.currentTimeMillis();
}
}

View File

@ -0,0 +1,30 @@
package com.github.wxpay.sdk;
import org.w3c.dom.Document;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
/**
* 2018/7/3
*/
public final class WXPayXmlUtil {
public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
documentBuilderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
documentBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
documentBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
documentBuilderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
documentBuilderFactory.setXIncludeAware(false);
documentBuilderFactory.setExpandEntityReferences(false);
return documentBuilderFactory.newDocumentBuilder();
}
public static Document newDocument() throws ParserConfigurationException {
return newDocumentBuilder().newDocument();
}
}

362
pom.xml Normal file
View File

@ -0,0 +1,362 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<packaging>pom</packaging>
<version>3.6.0</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<properties>
<ruoyi.version>3.6.0</ruoyi.version>
<wxsdk.version>3.0.9</wxsdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<druid.version>1.2.6</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.2</kaptcha.version>
<mybatis-spring-boot.version>2.1.4</mybatis-spring-boot.version>
<pagehelper.boot.version>1.3.1</pagehelper.boot.version>
<fastjson.version>1.2.76</fastjson.version>
<oshi.version>5.8.0</oshi.version>
<jna.version>5.8.0</jna.version>
<commons.io.version>2.11.0</commons.io.version>
<commons.fileupload.version>1.4</commons.fileupload.version>
<commons.collections.version>3.2.2</commons.collections.version>
<poi.version>4.1.2</poi.version>
<velocity.version>1.7</velocity.version>
<jwt.version>0.9.1</jwt.version>
<alipay.version>4.8.10.ALL</alipay.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- 生成二维码的jar -->
<!-- https://mvnrepository.com/artifact/com.google.zxing/core -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>${alipay.version}</version>
<exclusions>
<exclusion>
<artifactId>fastjson</artifactId>
<groupId>com.alibaba</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
</dependency>
<!--dom4j -->
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<!--腾讯云短信-->
<dependency>
<groupId>com.github.qcloudsms</groupId>
<artifactId>qcloudsms</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.0.6</version> <!-- 注:如提示报错,先升级基础包版,无法解决可联系技术支持 -->
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>1.1.0</version>
</dependency>
<!--腾讯云OSS-->
<dependency>
<groupId>com.qcloud</groupId>
<artifactId>cos_api</artifactId>
<version>5.6.8</version>
</dependency>
<!-- 阿里云OSS -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>2.5.0</version>
</dependency>
<!--lombok-->
<!-- <dependency>-->
<!-- <groupId>org.projectlombok</groupId>-->
<!-- <artifactId>lombok</artifactId>-->
<!-- <version>1.18.12</version>-->
<!-- </dependency>-->
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.13.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- 阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<!-- SpringBoot集成mybatis框架 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-spring-boot.version}</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>${jna.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>${jna.version}</version>
</dependency>
<!-- Swagger3依赖 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!-- 文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!-- velocity代码生成使用模板 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>${velocity.version}</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- collections工具类 -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons.collections.version}</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- 验证码 -->
<dependency>
<groupId>com.github.penggle</groupId>
<artifactId>kaptcha</artifactId>
<version>${kaptcha.version}</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- segchk服务层-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-segchk</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- segchk接口层-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-segchk-web</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>com.github.wxpay</groupId>
<artifactId>wxpay-sdk</artifactId>
<version>${wxsdk.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>ruoyi-segchk</module>
<module>ruoyi-segchk-web</module>
<module>ruoyi-admin</module>
<module>ruoyi-framework</module>
<module>ruoyi-system</module>
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
<!-- 加入微信sdk-->
<module>java_sdk_v3.0.9</module>
</modules>
<dependencies>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<meminitial>512m</meminitial>
<maxmem>1048m</maxmem>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

281
pom.xmlbak Normal file
View File

@ -0,0 +1,281 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.6.0</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<properties>
<ruoyi.version>3.6.0</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<druid.version>1.2.6</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.2</kaptcha.version>
<mybatis-spring-boot.version>2.1.4</mybatis-spring-boot.version>
<pagehelper.boot.version>1.3.1</pagehelper.boot.version>
<fastjson.version>1.2.76</fastjson.version>
<oshi.version>5.8.0</oshi.version>
<jna.version>5.8.0</jna.version>
<commons.io.version>2.11.0</commons.io.version>
<commons.fileupload.version>1.4</commons.fileupload.version>
<commons.collections.version>3.2.2</commons.collections.version>
<poi.version>4.1.2</poi.version>
<velocity.version>1.7</velocity.version>
<jwt.version>0.9.1</jwt.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.13.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- 阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<!-- SpringBoot集成mybatis框架 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-spring-boot.version}</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>${jna.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>${jna.version}</version>
</dependency>
<!-- Swagger3依赖 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!-- 文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!-- velocity代码生成使用模板 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>${velocity.version}</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- collections工具类 -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons.collections.version}</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- 验证码 -->
<dependency>
<groupId>com.github.penggle</groupId>
<artifactId>kaptcha</artifactId>
<version>${kaptcha.version}</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- segchk服务层-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-segchk</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- segchk接口层-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-segchk-web</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>ruoyi-segchk</module>
<module>ruoyi-segchk-web</module>
<module>ruoyi-admin</module>
<module>ruoyi-framework</module>
<module>ruoyi-system</module>
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
</modules>
<packaging>pom</packaging>
<dependencies>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

320
pom1.xml Normal file
View File

@ -0,0 +1,320 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.0.0</version>
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>魔金商城平台管理</description>
<properties>
<ruoyi.version>3.0.0</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<mybatis.boot.version>1.3.2</mybatis.boot.version>
<druid.version>1.1.14</druid.version>
<bitwalker.version>1.19</bitwalker.version>
<swagger.version>2.9.2</swagger.version>
<pagehelper.boot.version>1.2.5</pagehelper.boot.version>
<fastjson.version>1.2.70</fastjson.version>
<oshi.version>3.9.1</oshi.version>
<commons.io.version>2.5</commons.io.version>
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<poi.version>3.17</poi.version>
<velocity.version>1.7</velocity.version>
<jwt.version>0.9.0</jwt.version>
<alipay.version>4.8.10.ALL</alipay.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- 生成二维码的jar -->
<!-- https://mvnrepository.com/artifact/com.google.zxing/core -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>${alipay.version}</version>
<exclusions>
<exclusion>
<artifactId>fastjson</artifactId>
<groupId>com.alibaba</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
</dependency>
<!--dom4j -->
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<!--腾讯云短信-->
<dependency>
<groupId>com.github.qcloudsms</groupId>
<artifactId>qcloudsms</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.0.6</version> <!-- 注:如提示报错,先升级基础包版,无法解决可联系技术支持 -->
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>1.1.0</version>
</dependency>
<!--腾讯云OSS-->
<dependency>
<groupId>com.qcloud</groupId>
<artifactId>cos_api</artifactId>
<version>5.6.8</version>
</dependency>
<!-- 阿里云OSS -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>2.5.0</version>
</dependency>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
</dependency>
<!--swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!--阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<!--io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!--文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!--velocity代码生成使用模板 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>${velocity.version}</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!--Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-mall</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>ruoyi-store</module>
<!-- <module>ruoyi-web</module>-->
<module>ruoyi-web</module>
<module>ruoyi-admin</module>
<module>ruoyi-framework</module>
<module>ruoyi-system</module>
<module>ruoyi-mall</module>
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
</modules>
<packaging>pom</packaging>
<dependencies>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

98
ruoyi-admin/pom.xml Normal file
View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.6.0</version>
<!-- <relativePath>../pom.xml</relativePath>-->
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>ruoyi-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.1.RELEASE</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>

View File

@ -14,7 +14,7 @@ public class RuoYiApplication
{
public static void main(String[] args)
{
System.setProperty("spring.devtools.restart.enabled", "false");
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +

View File

@ -1,135 +1,131 @@
package com.ruoyi.framework.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter;
import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl;
import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
/**
* spring security
*
* @author ruoyi
*/
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter
{
/**
*
*/
@Autowired
private UserDetailsService userDetailsService;
/**
*
*/
@Autowired
private AuthenticationEntryPointImpl unauthorizedHandler;
/**
* 退
*/
@Autowired
private LogoutSuccessHandlerImpl logoutSuccessHandler;
/**
* token
*/
@Autowired
private JwtAuthenticationTokenFilter authenticationTokenFilter;
/**
* AuthenticationManager
*
* @return
* @throws Exception
*/
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception
{
return super.authenticationManagerBean();
}
/**
* anyRequest |
* access | SpringEltrue访
* anonymous | 访
* denyAll | 访
* fullyAuthenticated | 访remember-me
* hasAnyAuthority | 访
* hasAnyRole | 访
* hasAuthority | 访
* hasIpAddress | IPIP访
* hasRole | 访
* permitAll | 访
* rememberMe | remember-me访
* authenticated | 访
*/
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception
{
httpSecurity
// CRSF禁用因为不使用session
.csrf().disable()
// 认证失败处理类
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
// 基于token所以不需要session
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
// 过滤请求
.authorizeRequests()
// 对于登录login 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/captchaImage").anonymous()
.antMatchers(
HttpMethod.GET,
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js"
).permitAll()
.antMatchers("/profile/**").anonymous()
.antMatchers("/common/download**").anonymous()
.antMatchers("/common/download/resource**").anonymous()
.antMatchers("/swagger-ui.html").anonymous()
.antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous()
.antMatchers("/*/api-docs").anonymous()
.antMatchers("/druid/**").anonymous()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()
.headers().frameOptions().disable();
httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
// 添加JWT filter
httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
}
/**
*
*/
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder()
{
return new BCryptPasswordEncoder();
}
/**
*
*/
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception
{
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
}
}
package com.ruoyi.security;
import com.ruoyi.security.filter.JwtAuthenticationTokenFilter;
import com.ruoyi.security.handle.AuthenticationEntryPointImpl;
import com.ruoyi.security.handle.LogoutSuccessHandlerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
/**
* spring security
*
* @author ruoyi
*/
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
/**
*
*/
@Autowired
private UserDetailsService userDetailsService;
/**
*
*/
@Autowired
private AuthenticationEntryPointImpl unauthorizedHandler;
/**
* 退
*/
@Autowired
private LogoutSuccessHandlerImpl logoutSuccessHandler;
/**
* token
*/
@Autowired
private JwtAuthenticationTokenFilter authenticationTokenFilter;
/**
* AuthenticationManager
*
* @return
* @throws Exception
*/
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
/**
* anyRequest |
* access | SpringEltrue访
* anonymous | 访
* denyAll | 访
* fullyAuthenticated | 访remember-me
* hasAnyAuthority | 访
* hasAnyRole | 访
*
* @ss.hasPermi | 访
* hasIpAddress | IPIP访
* hasRole | 访
* permitAll | 访
* rememberMe | remember-me访
* authenticated | 访
*/
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity
// CRSF禁用因为不使用session
.csrf().disable()
// 认证失败处理类
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
// 基于token所以不需要session
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
// 过滤请求
.authorizeRequests()
// 对于登录login 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/captchaImage").anonymous()
.antMatchers(
HttpMethod.GET,
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js"
).permitAll()
.antMatchers("/profile/**").anonymous()
.antMatchers("/common/download**").anonymous()
.antMatchers("/common/download/resource**").anonymous()
.antMatchers("/swagger-ui.html").anonymous()
.antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous()
.antMatchers("/*/api-docs").anonymous()
.antMatchers("/druid/**").anonymous()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()
.headers().frameOptions().disable();
httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
// 添加JWT filter
httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
}
/**
*
*/
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder() {
return new BCryptPasswordEncoder();
}
/**
*
*/
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
}
}

View File

@ -1,44 +1,43 @@
package com.ruoyi.framework.security.filter;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.security.service.TokenService;
/**
* token token
*
* @author ruoyi
*/
@Component
public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
{
@Autowired
private TokenService tokenService;
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws ServletException, IOException
{
LoginUser loginUser = tokenService.getLoginUser(request);
if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication()))
{
tokenService.verifyToken(loginUser);
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities());
authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
SecurityContextHolder.getContext().setAuthentication(authenticationToken);
}
chain.doFilter(request, response);
}
}
package com.ruoyi.security.filter;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* token token
*
* @author ruoyi
*/
@Component
public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
@Autowired
private TokenService tokenService;
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws ServletException, IOException {
logger.debug(request.getRequestURI());
LoginUser loginUser = tokenService.getLoginUser(request);
if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) {
tokenService.verifyToken(loginUser);
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities());
authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
SecurityContextHolder.getContext().setAuthentication(authenticationToken);
}
chain.doFilter(request, response);
}
}

View File

@ -1,34 +1,33 @@
package com.ruoyi.framework.security.handle;
import java.io.IOException;
import java.io.Serializable;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.domain.AjaxResult;
/**
*
*
* @author ruoyi
*/
@Component
public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable
{
private static final long serialVersionUID = -8970718410437077606L;
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e)
throws IOException
{
int code = HttpStatus.UNAUTHORIZED;
String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI());
ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg)));
}
}
package com.ruoyi.security.handle;
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Serializable;
/**
*
*
* @author ruoyi
*/
@Component
public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable {
private static final long serialVersionUID = -8970718410437077606L;
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e)
throws IOException {
int code = HttpStatus.UNAUTHORIZED;
String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI());
ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg)));
}
}

View File

@ -1,53 +1,51 @@
package com.ruoyi.framework.security.handle;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.security.service.TokenService;
import com.ruoyi.framework.web.domain.AjaxResult;
/**
* 退
*
* @author ruoyi
*/
@Configuration
public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
{
@Autowired
private TokenService tokenService;
/**
* 退
*
* @return
*/
@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
throws IOException, ServletException
{
LoginUser loginUser = tokenService.getLoginUser(request);
if (StringUtils.isNotNull(loginUser))
{
String userName = loginUser.getUsername();
// 删除用户缓存记录
tokenService.delLoginUser(loginUser.getToken());
// 记录用户退出日志
AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
}
ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功")));
}
}
package com.ruoyi.security.handle;
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.web.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 退
*
* @author ruoyi
*/
@Configuration
public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler {
@Autowired
private TokenService tokenService;
/**
* 退
*
* @return
*/
@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
throws IOException, ServletException {
LoginUser loginUser = tokenService.getLoginUser(request);
if (StringUtils.isNotNull(loginUser)) {
String userName = loginUser.getUsername();
// 删除用户缓存记录
tokenService.delLoginUser(loginUser.getToken());
// 记录用户退出日志
AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
}
ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功")));
}
}

View File

@ -1,240 +1,211 @@
package com.ruoyi.framework.web.domain;
import java.net.UnknownHostException;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
import com.ruoyi.common.utils.Arith;
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.framework.web.domain.server.Cpu;
import com.ruoyi.framework.web.domain.server.Jvm;
import com.ruoyi.framework.web.domain.server.Mem;
import com.ruoyi.framework.web.domain.server.Sys;
import com.ruoyi.framework.web.domain.server.SysFile;
import oshi.SystemInfo;
import oshi.hardware.CentralProcessor;
import oshi.hardware.CentralProcessor.TickType;
import oshi.hardware.GlobalMemory;
import oshi.hardware.HardwareAbstractionLayer;
import oshi.software.os.FileSystem;
import oshi.software.os.OSFileStore;
import oshi.software.os.OperatingSystem;
import oshi.util.Util;
/**
*
*
* @author ruoyi
*/
public class Server
{
private static final int OSHI_WAIT_SECOND = 1000;
/**
* CPU
*/
private Cpu cpu = new Cpu();
/**
*
*/
private Mem mem = new Mem();
/**
* JVM
*/
private Jvm jvm = new Jvm();
/**
*
*/
private Sys sys = new Sys();
/**
*
*/
private List<SysFile> sysFiles = new LinkedList<SysFile>();
public Cpu getCpu()
{
return cpu;
}
public void setCpu(Cpu cpu)
{
this.cpu = cpu;
}
public Mem getMem()
{
return mem;
}
public void setMem(Mem mem)
{
this.mem = mem;
}
public Jvm getJvm()
{
return jvm;
}
public void setJvm(Jvm jvm)
{
this.jvm = jvm;
}
public Sys getSys()
{
return sys;
}
public void setSys(Sys sys)
{
this.sys = sys;
}
public List<SysFile> getSysFiles()
{
return sysFiles;
}
public void setSysFiles(List<SysFile> sysFiles)
{
this.sysFiles = sysFiles;
}
public void copyTo() throws Exception
{
SystemInfo si = new SystemInfo();
HardwareAbstractionLayer hal = si.getHardware();
setCpuInfo(hal.getProcessor());
setMemInfo(hal.getMemory());
setSysInfo();
setJvmInfo();
setSysFiles(si.getOperatingSystem());
}
/**
* CPU
*/
private void setCpuInfo(CentralProcessor processor)
{
// CPU信息
long[] prevTicks = processor.getSystemCpuLoadTicks();
Util.sleep(OSHI_WAIT_SECOND);
long[] ticks = processor.getSystemCpuLoadTicks();
long nice = ticks[TickType.NICE.getIndex()] - prevTicks[TickType.NICE.getIndex()];
long irq = ticks[TickType.IRQ.getIndex()] - prevTicks[TickType.IRQ.getIndex()];
long softirq = ticks[TickType.SOFTIRQ.getIndex()] - prevTicks[TickType.SOFTIRQ.getIndex()];
long steal = ticks[TickType.STEAL.getIndex()] - prevTicks[TickType.STEAL.getIndex()];
long cSys = ticks[TickType.SYSTEM.getIndex()] - prevTicks[TickType.SYSTEM.getIndex()];
long user = ticks[TickType.USER.getIndex()] - prevTicks[TickType.USER.getIndex()];
long iowait = ticks[TickType.IOWAIT.getIndex()] - prevTicks[TickType.IOWAIT.getIndex()];
long idle = ticks[TickType.IDLE.getIndex()] - prevTicks[TickType.IDLE.getIndex()];
long totalCpu = user + nice + cSys + idle + iowait + irq + softirq + steal;
cpu.setCpuNum(processor.getLogicalProcessorCount());
cpu.setTotal(totalCpu);
cpu.setSys(cSys);
cpu.setUsed(user);
cpu.setWait(iowait);
cpu.setFree(idle);
}
/**
*
*/
private void setMemInfo(GlobalMemory memory)
{
mem.setTotal(memory.getTotal());
mem.setUsed(memory.getTotal() - memory.getAvailable());
mem.setFree(memory.getAvailable());
}
/**
*
*/
private void setSysInfo()
{
Properties props = System.getProperties();
sys.setComputerName(IpUtils.getHostName());
sys.setComputerIp(IpUtils.getHostIp());
sys.setOsName(props.getProperty("os.name"));
sys.setOsArch(props.getProperty("os.arch"));
sys.setUserDir(props.getProperty("user.dir"));
}
/**
* Java
*/
private void setJvmInfo() throws UnknownHostException
{
Properties props = System.getProperties();
jvm.setTotal(Runtime.getRuntime().totalMemory());
jvm.setMax(Runtime.getRuntime().maxMemory());
jvm.setFree(Runtime.getRuntime().freeMemory());
jvm.setVersion(props.getProperty("java.version"));
jvm.setHome(props.getProperty("java.home"));
}
/**
*
*/
private void setSysFiles(OperatingSystem os)
{
FileSystem fileSystem = os.getFileSystem();
OSFileStore[] fsArray = fileSystem.getFileStores();
for (OSFileStore fs : fsArray)
{
long free = fs.getUsableSpace();
long total = fs.getTotalSpace();
long used = total - free;
SysFile sysFile = new SysFile();
sysFile.setDirName(fs.getMount());
sysFile.setSysTypeName(fs.getType());
sysFile.setTypeName(fs.getName());
sysFile.setTotal(convertFileSize(total));
sysFile.setFree(convertFileSize(free));
sysFile.setUsed(convertFileSize(used));
sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100));
sysFiles.add(sysFile);
}
}
/**
*
*
* @param size
* @return
*/
public String convertFileSize(long size)
{
long kb = 1024;
long mb = kb * 1024;
long gb = mb * 1024;
if (size >= gb)
{
return String.format("%.1f GB", (float) size / gb);
}
else if (size >= mb)
{
float f = (float) size / mb;
return String.format(f > 100 ? "%.0f MB" : "%.1f MB", f);
}
else if (size >= kb)
{
float f = (float) size / kb;
return String.format(f > 100 ? "%.0f KB" : "%.1f KB", f);
}
else
{
return String.format("%d B", size);
}
}
}
package com.ruoyi.security.web.domain;
import com.ruoyi.common.utils.Arith;
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.security.web.domain.server.*;
import oshi.SystemInfo;
import oshi.hardware.CentralProcessor;
import oshi.hardware.CentralProcessor.TickType;
import oshi.hardware.GlobalMemory;
import oshi.hardware.HardwareAbstractionLayer;
import oshi.software.os.FileSystem;
import oshi.software.os.OSFileStore;
import oshi.software.os.OperatingSystem;
import oshi.util.Util;
import java.net.UnknownHostException;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
/**
*
*
* @author ruoyi
*/
public class Server {
private static final int OSHI_WAIT_SECOND = 1000;
/**
* CPU
*/
private Cpu cpu = new Cpu();
/**
*
*/
private Mem mem = new Mem();
/**
* JVM
*/
private Jvm jvm = new Jvm();
/**
*
*/
private Sys sys = new Sys();
/**
*
*/
private List<SysFile> sysFiles = new LinkedList<SysFile>();
public Cpu getCpu() {
return cpu;
}
public void setCpu(Cpu cpu) {
this.cpu = cpu;
}
public Mem getMem() {
return mem;
}
public void setMem(Mem mem) {
this.mem = mem;
}
public Jvm getJvm() {
return jvm;
}
public void setJvm(Jvm jvm) {
this.jvm = jvm;
}
public Sys getSys() {
return sys;
}
public void setSys(Sys sys) {
this.sys = sys;
}
public List<SysFile> getSysFiles() {
return sysFiles;
}
public void setSysFiles(List<SysFile> sysFiles) {
this.sysFiles = sysFiles;
}
/**
*
*/
private void setSysFiles(OperatingSystem os) {
FileSystem fileSystem = os.getFileSystem();
OSFileStore[] fsArray = fileSystem.getFileStores().toArray(new OSFileStore[0]);
for (OSFileStore fs : fsArray) {
long free = fs.getUsableSpace();
long total = fs.getTotalSpace();
long used = total - free;
SysFile sysFile = new SysFile();
sysFile.setDirName(fs.getMount());
sysFile.setSysTypeName(fs.getType());
sysFile.setTypeName(fs.getName());
sysFile.setTotal(convertFileSize(total));
sysFile.setFree(convertFileSize(free));
sysFile.setUsed(convertFileSize(used));
sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100));
sysFiles.add(sysFile);
}
}
public void copyTo() throws Exception {
SystemInfo si = new SystemInfo();
HardwareAbstractionLayer hal = si.getHardware();
setCpuInfo(hal.getProcessor());
setMemInfo(hal.getMemory());
setSysInfo();
setJvmInfo();
setSysFiles(si.getOperatingSystem());
}
/**
* CPU
*/
private void setCpuInfo(CentralProcessor processor) {
// CPU信息
long[] prevTicks = processor.getSystemCpuLoadTicks();
Util.sleep(OSHI_WAIT_SECOND);
long[] ticks = processor.getSystemCpuLoadTicks();
long nice = ticks[TickType.NICE.getIndex()] - prevTicks[TickType.NICE.getIndex()];
long irq = ticks[TickType.IRQ.getIndex()] - prevTicks[TickType.IRQ.getIndex()];
long softirq = ticks[TickType.SOFTIRQ.getIndex()] - prevTicks[TickType.SOFTIRQ.getIndex()];
long steal = ticks[TickType.STEAL.getIndex()] - prevTicks[TickType.STEAL.getIndex()];
long cSys = ticks[TickType.SYSTEM.getIndex()] - prevTicks[TickType.SYSTEM.getIndex()];
long user = ticks[TickType.USER.getIndex()] - prevTicks[TickType.USER.getIndex()];
long iowait = ticks[TickType.IOWAIT.getIndex()] - prevTicks[TickType.IOWAIT.getIndex()];
long idle = ticks[TickType.IDLE.getIndex()] - prevTicks[TickType.IDLE.getIndex()];
long totalCpu = user + nice + cSys + idle + iowait + irq + softirq + steal;
cpu.setCpuNum(processor.getLogicalProcessorCount());
cpu.setTotal(totalCpu);
cpu.setSys(cSys);
cpu.setUsed(user);
cpu.setWait(iowait);
cpu.setFree(idle);
}
/**
*
*/
private void setMemInfo(GlobalMemory memory) {
mem.setTotal(memory.getTotal());
mem.setUsed(memory.getTotal() - memory.getAvailable());
mem.setFree(memory.getAvailable());
}
/**
*
*/
private void setSysInfo() {
Properties props = System.getProperties();
sys.setComputerName(IpUtils.getHostName());
sys.setComputerIp(IpUtils.getHostIp());
sys.setOsName(props.getProperty("os.name"));
sys.setOsArch(props.getProperty("os.arch"));
sys.setUserDir(props.getProperty("user.dir"));
}
/**
* Java
*/
private void setJvmInfo() throws UnknownHostException {
Properties props = System.getProperties();
jvm.setTotal(Runtime.getRuntime().totalMemory());
jvm.setMax(Runtime.getRuntime().maxMemory());
jvm.setFree(Runtime.getRuntime().freeMemory());
jvm.setVersion(props.getProperty("java.version"));
jvm.setHome(props.getProperty("java.home"));
}
/**
*
*
* @param size
* @return
*/
public String convertFileSize(long size) {
long kb = 1024;
long mb = kb * 1024;
long gb = mb * 1024;
if (size >= gb) {
return String.format("%.1f GB", (float) size / gb);
} else if (size >= mb) {
float f = (float) size / mb;
return String.format(f > 100 ? "%.0f MB" : "%.1f MB", f);
} else if (size >= kb) {
float f = (float) size / kb;
return String.format(f > 100 ? "%.0f KB" : "%.1f KB", f);
} else {
return String.format("%d B", size);
}
}
}

View File

@ -1,101 +1,88 @@
package com.ruoyi.framework.web.domain.server;
import com.ruoyi.common.utils.Arith;
/**
* CPU
*
* @author ruoyi
*/
public class Cpu
{
/**
*
*/
private int cpuNum;
/**
* CPU使
*/
private double total;
/**
* CPU使
*/
private double sys;
/**
* CPU使
*/
private double used;
/**
* CPU
*/
private double wait;
/**
* CPU
*/
private double free;
public int getCpuNum()
{
return cpuNum;
}
public void setCpuNum(int cpuNum)
{
this.cpuNum = cpuNum;
}
public double getTotal()
{
return Arith.round(Arith.mul(total, 100), 2);
}
public void setTotal(double total)
{
this.total = total;
}
public double getSys()
{
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;
}
}
package com.ruoyi.security.web.domain.server;
import com.ruoyi.common.utils.Arith;
/**
* CPU
*
* @author ruoyi
*/
public class Cpu {
/**
*
*/
private int cpuNum;
/**
* CPU使
*/
private double total;
/**
* CPU使
*/
private double sys;
/**
* CPU使
*/
private double used;
/**
* CPU
*/
private double wait;
/**
* CPU
*/
private double free;
public int getCpuNum() {
return cpuNum;
}
public void setCpuNum(int cpuNum) {
this.cpuNum = cpuNum;
}
public double getTotal() {
return Arith.round(Arith.mul(total, 100), 2);
}
public void setTotal(double total) {
this.total = total;
}
public double getSys() {
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;
}
}

View File

@ -1,122 +1,107 @@
package com.ruoyi.framework.web.domain.server;
import java.lang.management.ManagementFactory;
import com.ruoyi.common.utils.Arith;
import com.ruoyi.common.utils.DateUtils;
/**
* JVM
*
* @author ruoyi
*/
public class Jvm
{
/**
* JVM(M)
*/
private double total;
/**
* JVM(M)
*/
private double max;
/**
* JVM(M)
*/
private double free;
/**
* JDK
*/
private String version;
/**
* JDK
*/
private String home;
public double getTotal()
{
return Arith.div(total, (1024 * 1024), 2);
}
public void setTotal(double total)
{
this.total = total;
}
public double getMax()
{
return Arith.div(max, (1024 * 1024), 2);
}
public void setMax(double max)
{
this.max = max;
}
public double getFree()
{
return Arith.div(free, (1024 * 1024), 2);
}
public void setFree(double free)
{
this.free = free;
}
public double getUsed()
{
return Arith.div(total - free, (1024 * 1024), 2);
}
public double getUsage()
{
return Arith.mul(Arith.div(total - free, total, 4), 100);
}
/**
* JDK
*/
public String getName()
{
return ManagementFactory.getRuntimeMXBean().getVmName();
}
public String getVersion()
{
return version;
}
public void setVersion(String version)
{
this.version = version;
}
public String getHome()
{
return home;
}
public void setHome(String home)
{
this.home = home;
}
/**
* JDK
*/
public String getStartTime()
{
return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate());
}
/**
* JDK
*/
public String getRunTime()
{
return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate());
}
}
package com.ruoyi.security.web.domain.server;
import com.ruoyi.common.utils.Arith;
import com.ruoyi.common.utils.DateUtils;
import java.lang.management.ManagementFactory;
/**
* JVM
*
* @author ruoyi
*/
public class Jvm {
/**
* JVM(M)
*/
private double total;
/**
* JVM(M)
*/
private double max;
/**
* JVM(M)
*/
private double free;
/**
* JDK
*/
private String version;
/**
* JDK
*/
private String home;
public double getTotal() {
return Arith.div(total, (1024 * 1024), 2);
}
public void setTotal(double total) {
this.total = total;
}
public double getMax() {
return Arith.div(max, (1024 * 1024), 2);
}
public void setMax(double max) {
this.max = max;
}
public double getFree() {
return Arith.div(free, (1024 * 1024), 2);
}
public void setFree(double free) {
this.free = free;
}
public double getUsed() {
return Arith.div(total - free, (1024 * 1024), 2);
}
public double getUsage() {
return Arith.mul(Arith.div(total - free, total, 4), 100);
}
/**
* JDK
*/
public String getName() {
return ManagementFactory.getRuntimeMXBean().getVmName();
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getHome() {
return home;
}
public void setHome(String home) {
this.home = home;
}
/**
* JDK
*/
public String getStartTime() {
return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate());
}
/**
* JDK
*/
public String getRunTime() {
return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate());
}
}

View File

@ -1,61 +1,53 @@
package com.ruoyi.framework.web.domain.server;
import com.ruoyi.common.utils.Arith;
/**
*
*
* @author ruoyi
*/
public class Mem
{
/**
*
*/
private double total;
/**
*
*/
private double used;
/**
*
*/
private double free;
public double getTotal()
{
return Arith.div(total, (1024 * 1024 * 1024), 2);
}
public void setTotal(long total)
{
this.total = total;
}
public double getUsed()
{
return Arith.div(used, (1024 * 1024 * 1024), 2);
}
public void setUsed(long used)
{
this.used = used;
}
public double getFree()
{
return Arith.div(free, (1024 * 1024 * 1024), 2);
}
public void setFree(long free)
{
this.free = free;
}
public double getUsage()
{
return Arith.mul(Arith.div(used, total, 4), 100);
}
}
package com.ruoyi.security.web.domain.server;
import com.ruoyi.common.utils.Arith;
/**
*
*
* @author ruoyi
*/
public class Mem {
/**
*
*/
private double total;
/**
*
*/
private double used;
/**
*
*/
private double free;
public double getTotal() {
return Arith.div(total, (1024 * 1024 * 1024), 2);
}
public void setTotal(long total) {
this.total = total;
}
public double getUsed() {
return Arith.div(used, (1024 * 1024 * 1024), 2);
}
public void setUsed(long used) {
this.used = used;
}
public double getFree() {
return Arith.div(free, (1024 * 1024 * 1024), 2);
}
public void setFree(long free) {
this.free = free;
}
public double getUsage() {
return Arith.mul(Arith.div(used, total, 4), 100);
}
}

View File

@ -1,84 +1,73 @@
package com.ruoyi.framework.web.domain.server;
/**
*
*
* @author ruoyi
*/
public class Sys
{
/**
*
*/
private String computerName;
/**
* Ip
*/
private String computerIp;
/**
*
*/
private String userDir;
/**
*
*/
private String osName;
/**
*
*/
private String osArch;
public String getComputerName()
{
return computerName;
}
public void setComputerName(String computerName)
{
this.computerName = computerName;
}
public String getComputerIp()
{
return computerIp;
}
public void setComputerIp(String computerIp)
{
this.computerIp = computerIp;
}
public String getUserDir()
{
return userDir;
}
public void setUserDir(String userDir)
{
this.userDir = userDir;
}
public String getOsName()
{
return osName;
}
public void setOsName(String osName)
{
this.osName = osName;
}
public String getOsArch()
{
return osArch;
}
public void setOsArch(String osArch)
{
this.osArch = osArch;
}
}
package com.ruoyi.security.web.domain.server;
/**
*
*
* @author ruoyi
*/
public class Sys {
/**
*
*/
private String computerName;
/**
* Ip
*/
private String computerIp;
/**
*
*/
private String userDir;
/**
*
*/
private String osName;
/**
*
*/
private String osArch;
public String getComputerName() {
return computerName;
}
public void setComputerName(String computerName) {
this.computerName = computerName;
}
public String getComputerIp() {
return computerIp;
}
public void setComputerIp(String computerIp) {
this.computerIp = computerIp;
}
public String getUserDir() {
return userDir;
}
public void setUserDir(String userDir) {
this.userDir = userDir;
}
public String getOsName() {
return osName;
}
public void setOsName(String osName) {
this.osName = osName;
}
public String getOsArch() {
return osArch;
}
public void setOsArch(String osArch) {
this.osArch = osArch;
}
}

View File

@ -1,114 +1,99 @@
package com.ruoyi.framework.web.domain.server;
/**
*
*
* @author ruoyi
*/
public class SysFile
{
/**
*
*/
private String dirName;
/**
*
*/
private String sysTypeName;
/**
*
*/
private String typeName;
/**
*
*/
private String total;
/**
*
*/
private String free;
/**
* 使
*/
private String used;
/**
* 使
*/
private double usage;
public String getDirName()
{
return dirName;
}
public void setDirName(String dirName)
{
this.dirName = dirName;
}
public String getSysTypeName()
{
return sysTypeName;
}
public void setSysTypeName(String sysTypeName)
{
this.sysTypeName = sysTypeName;
}
public String getTypeName()
{
return typeName;
}
public void setTypeName(String typeName)
{
this.typeName = typeName;
}
public String getTotal()
{
return total;
}
public void setTotal(String total)
{
this.total = total;
}
public String getFree()
{
return free;
}
public void setFree(String free)
{
this.free = free;
}
public String getUsed()
{
return used;
}
public void setUsed(String used)
{
this.used = used;
}
public double getUsage()
{
return usage;
}
public void setUsage(double usage)
{
this.usage = usage;
}
}
package com.ruoyi.security.web.domain.server;
/**
*
*
* @author ruoyi
*/
public class SysFile {
/**
*
*/
private String dirName;
/**
*
*/
private String sysTypeName;
/**
*
*/
private String typeName;
/**
*
*/
private String total;
/**
*
*/
private String free;
/**
* 使
*/
private String used;
/**
* 使
*/
private double usage;
public String getDirName() {
return dirName;
}
public void setDirName(String dirName) {
this.dirName = dirName;
}
public String getSysTypeName() {
return sysTypeName;
}
public void setSysTypeName(String sysTypeName) {
this.sysTypeName = sysTypeName;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getTotal() {
return total;
}
public void setTotal(String total) {
this.total = total;
}
public String getFree() {
return free;
}
public void setFree(String free) {
this.free = free;
}
public String getUsed() {
return used;
}
public void setUsed(String used) {
this.used = used;
}
public double getUsage() {
return usage;
}
public void setUsage(double usage) {
this.usage = usage;
}
}

View File

@ -1,117 +1,105 @@
package com.ruoyi.framework.web.exception;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.AccountExpiredException;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.validation.BindException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.NoHandlerFoundException;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.exception.BaseException;
import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.exception.DemoModeException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.domain.AjaxResult;
/**
*
*
* @author ruoyi
*/
@RestControllerAdvice
public class GlobalExceptionHandler
{
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
/**
*
*/
@ExceptionHandler(BaseException.class)
public AjaxResult baseException(BaseException e)
{
return AjaxResult.error(e.getMessage());
}
/**
*
*/
@ExceptionHandler(CustomException.class)
public AjaxResult businessException(CustomException e)
{
if (StringUtils.isNull(e.getCode()))
{
return AjaxResult.error(e.getMessage());
}
return AjaxResult.error(e.getCode(), e.getMessage());
}
@ExceptionHandler(NoHandlerFoundException.class)
public AjaxResult handlerNoFoundException(Exception e)
{
log.error(e.getMessage(), e);
return AjaxResult.error(HttpStatus.NOT_FOUND, "路径不存在,请检查路径是否正确");
}
@ExceptionHandler(AccessDeniedException.class)
public AjaxResult handleAuthorizationException(AccessDeniedException e)
{
log.error(e.getMessage());
return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
}
@ExceptionHandler(AccountExpiredException.class)
public AjaxResult handleAccountExpiredException(AccountExpiredException e)
{
log.error(e.getMessage(), e);
return AjaxResult.error(e.getMessage());
}
@ExceptionHandler(UsernameNotFoundException.class)
public AjaxResult handleUsernameNotFoundException(UsernameNotFoundException e)
{
log.error(e.getMessage(), e);
return AjaxResult.error(e.getMessage());
}
@ExceptionHandler(Exception.class)
public AjaxResult handleException(Exception e)
{
log.error(e.getMessage(), e);
return AjaxResult.error(e.getMessage());
}
/**
*
*/
@ExceptionHandler(BindException.class)
public AjaxResult validatedBindException(BindException e)
{
log.error(e.getMessage(), e);
String message = e.getAllErrors().get(0).getDefaultMessage();
return AjaxResult.error(message);
}
/**
*
*/
@ExceptionHandler(MethodArgumentNotValidException.class)
public Object validExceptionHandler(MethodArgumentNotValidException e)
{
log.error(e.getMessage(), e);
String message = e.getBindingResult().getFieldError().getDefaultMessage();
return AjaxResult.error(message);
}
/**
*
*/
@ExceptionHandler(DemoModeException.class)
public AjaxResult demoModeException(DemoModeException e)
{
return AjaxResult.error("演示模式,不允许操作");
}
}
package com.ruoyi.security.web.exception;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.exception.DemoModeException;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.AccountExpiredException;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.validation.BindException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.NoHandlerFoundException;
/**
*
*
* @author ruoyi
*/
@RestControllerAdvice
public class GlobalExceptionHandler {
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
/**
*
*/
@ExceptionHandler(BaseException.class)
public AjaxResult baseException(BaseException e) {
return AjaxResult.error(e.getMessage());
}
/**
*
*/
@ExceptionHandler(CustomException.class)
public AjaxResult businessException(CustomException e) {
if (StringUtils.isNull(e.getCode())) {
return AjaxResult.error(e.getMessage());
}
return AjaxResult.error(e.getCode(), e.getMessage());
}
@ExceptionHandler(NoHandlerFoundException.class)
public AjaxResult handlerNoFoundException(Exception e) {
log.error(e.getMessage(), e);
return AjaxResult.error(HttpStatus.NOT_FOUND, "路径不存在,请检查路径是否正确");
}
@ExceptionHandler(AccessDeniedException.class)
public AjaxResult handleAuthorizationException(AccessDeniedException e) {
log.error(e.getMessage());
return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
}
@ExceptionHandler(AccountExpiredException.class)
public AjaxResult handleAccountExpiredException(AccountExpiredException e) {
log.error(e.getMessage(), e);
return AjaxResult.error(e.getMessage());
}
@ExceptionHandler(UsernameNotFoundException.class)
public AjaxResult handleUsernameNotFoundException(UsernameNotFoundException e) {
log.error(e.getMessage(), e);
return AjaxResult.error(e.getMessage());
}
@ExceptionHandler(Exception.class)
public AjaxResult handleException(Exception e) {
log.error(e.getMessage(), e);
return AjaxResult.error(e.getMessage());
}
/**
*
*/
@ExceptionHandler(BindException.class)
public AjaxResult validatedBindException(BindException e) {
log.error(e.getMessage(), e);
String message = e.getAllErrors().get(0).getDefaultMessage();
return AjaxResult.error(message);
}
/**
*
*/
@ExceptionHandler(MethodArgumentNotValidException.class)
public Object validExceptionHandler(MethodArgumentNotValidException e) {
log.error(e.getMessage(), e);
String message = e.getBindingResult().getFieldError().getDefaultMessage();
return AjaxResult.error(message);
}
/**
*
*/
@ExceptionHandler(DemoModeException.class)
public AjaxResult demoModeException(DemoModeException e) {
return AjaxResult.error("演示模式,不允许操作");
}
}

View File

@ -1,169 +1,153 @@
package com.ruoyi.framework.security.service;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.project.system.domain.SysRole;
/**
* RuoYi ssSpringSecurity
*
* @author ruoyi
*/
@Service("ss")
public class PermissionService
{
/** 所有权限标识 */
private static final String ALL_PERMISSION = "*:*:*";
/** 管理员角色权限标识 */
private static final String SUPER_ADMIN = "admin";
private static final String ROLE_DELIMETER = ",";
private static final String PERMISSION_DELIMETER = ",";
@Autowired
private TokenService tokenService;
/**
*
*
* @param permission
* @return
*/
public boolean hasPermi(String permission)
{
if (StringUtils.isEmpty(permission))
{
return false;
}
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions()))
{
return false;
}
return hasPermissions(loginUser.getPermissions(), permission);
}
/**
* hasPermi
*
* @param permission
* @return
*/
public boolean lacksPermi(String permission)
{
return hasPermi(permission) != true;
}
/**
*
*
* @param permissions PERMISSION_NAMES_DELIMETER
* @return
*/
public boolean hasAnyPermi(String permissions)
{
if (StringUtils.isEmpty(permissions))
{
return false;
}
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions()))
{
return false;
}
Set<String> authorities = loginUser.getPermissions();
for (String permission : permissions.split(PERMISSION_DELIMETER))
{
if (permission != null && hasPermissions(authorities, permission))
{
return true;
}
}
return false;
}
/**
*
*
* @param role
* @return
*/
public boolean hasRole(String role)
{
if (StringUtils.isEmpty(role))
{
return false;
}
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles()))
{
return false;
}
for (SysRole sysRole : loginUser.getUser().getRoles())
{
String roleKey = sysRole.getRoleKey();
if (SUPER_ADMIN.contains(roleKey) || roleKey.contains(StringUtils.trim(role)))
{
return true;
}
}
return false;
}
/**
* isRole
*
* @param role
* @return
*/
public boolean lacksRole(String role)
{
return hasRole(role) != true;
}
/**
*
*
* @param roles ROLE_NAMES_DELIMETER
* @return
*/
public boolean hasAnyRoles(String roles)
{
if (StringUtils.isEmpty(roles))
{
return false;
}
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles()))
{
return false;
}
for (String role : roles.split(ROLE_DELIMETER))
{
if (hasRole(role))
{
return true;
}
}
return false;
}
/**
*
*
* @param permissions
* @param permission
* @return
*/
private boolean hasPermissions(Set<String> permissions, String permission)
{
return permissions.contains(ALL_PERMISSION) || permissions.contains(StringUtils.trim(permission));
}
}
package com.ruoyi.security.web.service;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Set;
/**
* RuoYi ssSpringSecurity
*
* @author ruoyi
*/
@Service("ss")
public class PermissionService {
/**
*
*/
private static final String ALL_PERMISSION = "*:*:*";
/**
*
*/
private static final String SUPER_ADMIN = "admin";
private static final String ROLE_DELIMETER = ",";
private static final String PERMISSION_DELIMETER = ",";
@Autowired
private TokenService tokenService;
/**
*
*
* @param permission
* @return
*/
public boolean hasPermi(String permission) {
if (StringUtils.isEmpty(permission)) {
return false;
}
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) {
return false;
}
return hasPermissions(loginUser.getPermissions(), permission);
}
/**
* hasPermi
*
* @param permission
* @return
*/
public boolean lacksPermi(String permission) {
return hasPermi(permission) != true;
}
/**
*
*
* @param permissions PERMISSION_NAMES_DELIMETER
* @return
*/
public boolean hasAnyPermi(String permissions) {
if (StringUtils.isEmpty(permissions)) {
return false;
}
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions())) {
return false;
}
Set<String> authorities = loginUser.getPermissions();
for (String permission : permissions.split(PERMISSION_DELIMETER)) {
if (permission != null && hasPermissions(authorities, permission)) {
return true;
}
}
return false;
}
/**
*
*
* @param role
* @return
*/
public boolean hasRole(String role) {
if (StringUtils.isEmpty(role)) {
return false;
}
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) {
return false;
}
for (SysRole sysRole : loginUser.getUser().getRoles()) {
String roleKey = sysRole.getRoleKey();
if (SUPER_ADMIN.contains(roleKey) || roleKey.contains(StringUtils.trim(role))) {
return true;
}
}
return false;
}
/**
* isRole
*
* @param role
* @return
*/
public boolean lacksRole(String role) {
return hasRole(role) != true;
}
/**
*
*
* @param roles ROLE_NAMES_DELIMETER
* @return
*/
public boolean hasAnyRoles(String roles) {
if (StringUtils.isEmpty(roles)) {
return false;
}
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) {
return false;
}
for (String role : roles.split(ROLE_DELIMETER)) {
if (hasRole(role)) {
return true;
}
}
return false;
}
/**
*
*
* @param permissions
* @param permission
* @return
*/
private boolean hasPermissions(Set<String> permissions, String permission) {
return permissions.contains(ALL_PERMISSION) || permissions.contains(StringUtils.trim(permission));
}
}

View File

@ -1,88 +1,80 @@
package com.ruoyi.framework.security.service;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.exception.user.CaptchaException;
import com.ruoyi.common.exception.user.CaptchaExpireException;
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.redis.RedisCache;
import com.ruoyi.framework.security.LoginUser;
/**
*
*
* @author ruoyi
*/
@Component
public class SysLoginService
{
@Autowired
private TokenService tokenService;
@Resource
private AuthenticationManager authenticationManager;
@Autowired
private RedisCache redisCache;
/**
*
*
* @param username
* @param password
* @param captcha
* @param uuid
* @return
*/
public String login(String username, String password, String code, String uuid)
{
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
String captcha = redisCache.getCacheObject(verifyKey);
redisCache.deleteObject(verifyKey);
if (captcha == null)
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
throw new CaptchaExpireException();
}
if (!code.equalsIgnoreCase(captcha))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException();
}
// 用户验证
Authentication authentication = null;
try
{
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
authentication = authenticationManager
.authenticate(new UsernamePasswordAuthenticationToken(username, password));
}
catch (Exception e)
{
if (e instanceof BadCredentialsException)
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
throw new UserPasswordNotMatchException();
}
else
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
throw new CustomException(e.getMessage());
}
}
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
// 生成token
return tokenService.createToken(loginUser);
}
}
package com.ruoyi.security.web.service;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.exception.user.CaptchaException;
import com.ruoyi.common.exception.user.CaptchaExpireException;
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.web.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
*
*
* @author ruoyi
*/
@Component
public class SysLoginService {
@Autowired
private TokenService tokenService;
@Resource
private AuthenticationManager authenticationManager;
@Autowired
private RedisCache redisCache;
/**
*
*
* @param username
* @param password
* @param code
* @param uuid
* @return
*/
public String login(String username, String password, String code, String uuid) {
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
String captcha = redisCache.getCacheObject(verifyKey);
redisCache.deleteObject(verifyKey);
if (captcha == null) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
throw new CaptchaExpireException();
}
if (!code.equalsIgnoreCase(captcha)) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException();
}
// 用户验证
Authentication authentication = null;
try {
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
authentication = authenticationManager
.authenticate(new UsernamePasswordAuthenticationToken(username, password));
} catch (Exception e) {
if (e instanceof BadCredentialsException) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
throw new UserPasswordNotMatchException();
} else {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
throw new CustomException(e.getMessage());
}
}
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
// 生成token
return tokenService.createToken(loginUser);
}
}

View File

@ -1,66 +1,58 @@
package com.ruoyi.framework.security.service;
import java.util.HashSet;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.service.ISysMenuService;
import com.ruoyi.project.system.service.ISysRoleService;
/**
*
*
* @author ruoyi
*/
@Component
public class SysPermissionService
{
@Autowired
private ISysRoleService roleService;
@Autowired
private ISysMenuService menuService;
/**
*
*
* @param user
* @return
*/
public Set<String> getRolePermission(SysUser user)
{
Set<String> roles = new HashSet<String>();
// 管理员拥有所有权限
if (user.isAdmin())
{
roles.add("admin");
}
else
{
roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId()));
}
return roles;
}
/**
*
*
* @param user
* @return
*/
public Set<String> getMenuPermission(SysUser user)
{
Set<String> perms = new HashSet<String>();
// 管理员拥有所有权限
if (user.isAdmin())
{
perms.add("*:*:*");
}
else
{
perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId()));
}
return perms;
}
}
package com.ruoyi.security.web.service;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.segchk.service.ISegchkProviderMgtService;
import com.ruoyi.system.service.ISysMenuService;
import com.ruoyi.system.service.ISysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashSet;
import java.util.Set;
/**
*
*
* @author ruoyi
*/
@Component
public class SysPermissionService {
@Autowired
private ISysRoleService roleService;
@Autowired
private ISysMenuService menuService;
/**
*
*
* @param user
* @return
*/
public Set<String> getRolePermission(SysUser user) {
Set<String> roles = new HashSet<String>();
// 管理员拥有所有权限
if (user.isAdmin()) {
roles.add("admin");
} else {
roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId()));
}
return roles;
}
/**
*
*
* @param user
* @return
*/
public Set<String> getMenuPermission(SysUser user) {
Set<String> perms = new HashSet<String>();
// 管理员拥有所有权限
if (user.isAdmin()) {
perms.add("*:*:*");
} else {
perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId()));
}
return perms;
}
}

View File

@ -1,60 +1,52 @@
package com.ruoyi.framework.security.service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import com.ruoyi.common.enums.UserStatus;
import com.ruoyi.common.exception.BaseException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.service.ISysUserService;
/**
*
*
* @author ruoyi
*/
@Service
public class UserDetailsServiceImpl implements UserDetailsService
{
private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class);
@Autowired
private ISysUserService userService;
@Autowired
private SysPermissionService permissionService;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
{
SysUser user = userService.selectUserByUserName(username);
if (StringUtils.isNull(user))
{
log.info("登录用户:{} 不存在.", username);
throw new UsernameNotFoundException("登录用户:" + username + " 不存在");
}
else if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
{
log.info("登录用户:{} 已被删除.", username);
throw new BaseException("对不起,您的账号:" + username + " 已被删除");
}
else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
{
log.info("登录用户:{} 已被停用.", username);
throw new BaseException("对不起,您的账号:" + username + " 已停用");
}
return createLoginUser(user);
}
public UserDetails createLoginUser(SysUser user)
{
return new LoginUser(user, permissionService.getMenuPermission(user));
}
}
package com.ruoyi.security.web.service;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.UserStatus;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
/**
*
*
* @author ruoyi
*/
@Service
public class UserDetailsServiceImpl implements UserDetailsService {
private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class);
@Autowired
private ISysUserService userService;
@Autowired
private SysPermissionService permissionService;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
SysUser user = userService.selectUserByUserName(username);
if (StringUtils.isNull(user)) {
log.info("登录用户:{} 不存在.", username);
throw new UsernameNotFoundException("登录用户:" + username + " 不存在");
} else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
log.info("登录用户:{} 已被删除.", username);
throw new BaseException("对不起,您的账号:" + username + " 已被删除");
} else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
log.info("登录用户:{} 已被停用.", username);
throw new BaseException("对不起,您的账号:" + username + " 已停用");
}
return createLoginUser(user);
}
public UserDetails createLoginUser(SysUser user) {
return new LoginUser(user, permissionService.getMenuPermission(user));
}
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.web.controller.common;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.FastByteArrayOutputStream;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.google.code.kaptcha.Producer;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.sign.Base64;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysConfigService;
/**
*
*
* @author ruoyi
*/
@RestController
public class CaptchaController
{
@Resource(name = "captchaProducer")
private Producer captchaProducer;
@Resource(name = "captchaProducerMath")
private Producer captchaProducerMath;
@Autowired
private RedisCache redisCache;
// 验证码类型
@Value("${ruoyi.captchaType}")
private String captchaType;
@Autowired
private ISysConfigService configService;
/**
*
*/
@GetMapping("/captchaImage")
public AjaxResult getCode(HttpServletResponse response) throws IOException
{
AjaxResult ajax = AjaxResult.success();
boolean captchaOnOff = configService.selectCaptchaOnOff();
ajax.put("captchaOnOff", captchaOnOff);
if (!captchaOnOff)
{
return ajax;
}
// 保存验证码信息
String uuid = IdUtils.simpleUUID();
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
String capStr = null, code = null;
BufferedImage image = null;
// 生成验证码
if ("math".equals(captchaType))
{
String capText = captchaProducerMath.createText();
capStr = capText.substring(0, capText.lastIndexOf("@"));
code = capText.substring(capText.lastIndexOf("@") + 1);
image = captchaProducerMath.createImage(capStr);
}
else if ("char".equals(captchaType))
{
capStr = code = captchaProducer.createText();
image = captchaProducer.createImage(capStr);
}
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
// 转换流信息写出
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
try
{
ImageIO.write(image, "jpg", os);
}
catch (IOException e)
{
return AjaxResult.error(e.getMessage());
}
ajax.put("uuid", uuid);
ajax.put("img", Base64.encode(os.toByteArray()));
return ajax;
}
}

View File

@ -1,21 +1,22 @@
package com.ruoyi.project.common;
package com.ruoyi.web.controller.common;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.RuoYiConfig;
import com.ruoyi.framework.config.ServerConfig;
import com.ruoyi.framework.web.domain.AjaxResult;
/**
*
@ -41,17 +42,15 @@ public class CommonController
{
try
{
if (!FileUtils.isValidFilename(fileName))
if (!FileUtils.checkAllowDownload(fileName))
{
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
String filePath = RuoYiConfig.getDownloadPath() + fileName;
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition",
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName));
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName);
FileUtils.writeBytes(filePath, response.getOutputStream());
if (delete)
{
@ -76,7 +75,9 @@ public class CommonController
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
log.debug("/common/upload with url: {{}}, filename: {{}}", url, fileName );
AjaxResult ajax = AjaxResult.success();
ajax.put("fileName", fileName);
ajax.put("url", url);
@ -92,18 +93,28 @@ public class CommonController
*
*/
@GetMapping("/common/download/resource")
public void resourceDownload(String name, HttpServletRequest request, HttpServletResponse response) throws Exception
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception
{
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
// 数据库资源地址
String downloadPath = localPath + StringUtils.substringAfter(name, Constants.RESOURCE_PREFIX);
// 下载名称
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition",
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName));
FileUtils.writeBytes(downloadPath, response.getOutputStream());
try
{
if (!FileUtils.checkAllowDownload(resource))
{
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
}
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
// 数据库资源地址
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
// 下载名称
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, downloadName);
FileUtils.writeBytes(downloadPath, response.getOutputStream());
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
}

View File

@ -0,0 +1,53 @@
package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/cache")
public class CacheController
{
@Autowired
private RedisTemplate<String, String> redisTemplate;
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
Map<String, Object> result = new HashMap<>(3);
result.put("info", info);
result.put("dbSize", dbSize);
List<Map<String, String>> pieList = new ArrayList<>();
commandStats.stringPropertyNames().forEach(key -> {
Map<String, String> data = new HashMap<>(2);
String property = commandStats.getProperty(key);
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
pieList.add(data);
});
result.put("commandStats", pieList);
return AjaxResult.success(result);
}
}

View File

@ -1,12 +1,11 @@
package com.ruoyi.project.monitor.controller;
package com.ruoyi.web.controller.monitor;
import com.ruoyi.security.web.domain.Server;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.domain.Server;
import com.ruoyi.common.core.domain.AjaxResult;
/**
*
@ -15,7 +14,7 @@ import com.ruoyi.framework.web.domain.Server;
*/
@RestController
@RequestMapping("/monitor/server")
public class ServerController extends BaseController
public class ServerController
{
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
@GetMapping()

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.monitor.controller;
package com.ruoyi.web.controller.monitor;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@ -8,14 +8,14 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.monitor.domain.SysLogininfor;
import com.ruoyi.project.monitor.service.ISysLogininforService;
import com.ruoyi.system.domain.SysLogininfor;
import com.ruoyi.system.service.ISysLogininforService;
/**
* 访
@ -38,18 +38,18 @@ public class SysLogininforController extends BaseController
return getDataTable(list);
}
@Log(title = "登日志", businessType = BusinessType.EXPORT)
@Log(title = "登日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
@GetMapping("/export")
public AjaxResult export(SysLogininfor logininfor)
{
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
return util.exportExcel(list, "登日志");
return util.exportExcel(list, "登日志");
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@Log(title = "登日志", businessType = BusinessType.DELETE)
@Log(title = "登日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{infoIds}")
public AjaxResult remove(@PathVariable Long[] infoIds)
{
@ -57,7 +57,7 @@ public class SysLogininforController extends BaseController
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@Log(title = "登日志", businessType = BusinessType.CLEAN)
@Log(title = "登日志", businessType = BusinessType.CLEAN)
@DeleteMapping("/clean")
public AjaxResult clean()
{

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.monitor.controller;
package com.ruoyi.web.controller.monitor;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@ -8,14 +8,14 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.monitor.domain.SysOperLog;
import com.ruoyi.project.monitor.service.ISysOperLogService;
import com.ruoyi.system.domain.SysOperLog;
import com.ruoyi.system.service.ISysOperLogService;
/**
*
@ -48,6 +48,7 @@ public class SysOperlogController extends BaseController
return util.exportExcel(list, "操作日志");
}
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/{operIds}")
public AjaxResult remove(@PathVariable Long[] operIds)

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.monitor.controller;
package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
@ -11,17 +11,17 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.redis.RedisCache;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.monitor.domain.SysUserOnline;
import com.ruoyi.project.system.service.ISysUserOnlineService;
import com.ruoyi.system.domain.SysUserOnline;
import com.ruoyi.system.service.ISysUserOnlineService;
/**
* 线
@ -82,7 +82,7 @@ public class SysUserOnlineController extends BaseController
* 退
*/
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
@Log(title = "在线用户", businessType = BusinessType.DELETE)
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@DeleteMapping("/{tokenId}")
public AjaxResult forceLogout(@PathVariable String tokenId)
{

View File

@ -0,0 +1,183 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkCarouseMgt;
import com.ruoyi.segchk.service.ISegchkCarouseMgtService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_carouse_mgt")
public class SegchkCarouseMgtController extends BaseController
{
@Autowired
private ISegchkCarouseMgtService segchkCarouseMgtService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkCarouseMgt segchkCarouseMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkCarouseMgt.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkCarouseMgt> list = segchkCarouseMgtService.selectSegchkCarouseMgtList(segchkCarouseMgt);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:export')")
@Log(title = "seg首页轮播图管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkCarouseMgt segchkCarouseMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkCarouseMgt.setProviderId(sysUser.getProviderId());
}
List<SegchkCarouseMgt> list = segchkCarouseMgtService.selectSegchkCarouseMgtList(segchkCarouseMgt);
ExcelUtil<SegchkCarouseMgt> util = new ExcelUtil<SegchkCarouseMgt>(SegchkCarouseMgt.class);
return util.exportExcel(list, "seg首页轮播图管理数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:query')")
@GetMapping(value = "/{carouseId}")
public AjaxResult getInfo(@PathVariable("carouseId") Long carouseId)
{
return AjaxResult.success(segchkCarouseMgtService.selectSegchkCarouseMgtByCarouseId(carouseId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:add')")
@Log(title = "seg首页轮播图管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkCarouseMgt segchkCarouseMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkCarouseMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkCarouseMgtService.insertSegchkCarouseMgt(segchkCarouseMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:edit')")
@Log(title = "seg首页轮播图管理", businessType = BusinessType.UPDATE)
@PutMapping("edit_info")
public AjaxResult edit(@RequestBody SegchkCarouseMgt segchkCarouseMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkCarouseMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkCarouseMgtService.updateSegchkCarouseMgt(segchkCarouseMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:edit')")
@Log(title = "seg首页轮播图管理", businessType = BusinessType.UPDATE)
@PutMapping("/mgt_state")
public AjaxResult mgt_state(@RequestBody SegchkCarouseMgt segchkCarouseMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkCarouseMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkCarouseMgtService.updateSegchkCarouseMgt(segchkCarouseMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:edit')")
@Log(title = "seg首页轮播图管理", businessType = BusinessType.UPDATE)
@PutMapping("/sort_update")
public AjaxResult sort_update(@RequestBody String[] sortInfos)
{
logger.debug("sort_update with {}", sortInfos);
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
;
}
return toAjax(segchkCarouseMgtService.updateSegchkCarouseMgtSort(sortInfos));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:remove')")
@Log(title = "seg首页轮播图管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{carouseIds}")
public AjaxResult remove(@PathVariable Long[] carouseIds)
{
return toAjax(segchkCarouseMgtService.deleteSegchkCarouseMgtByCarouseIds(carouseIds));
}
}

View File

@ -0,0 +1,154 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkChargeCard;
import com.ruoyi.segchk.service.ISegchkChargeCardService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_charge_card")
public class SegchkChargeCardController extends BaseController
{
@Autowired
private ISegchkChargeCardService segchkChargeCardService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_charge_card:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkChargeCard segchkChargeCard)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkChargeCard.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkChargeCard> list = segchkChargeCardService.selectSegchkChargeCardList(segchkChargeCard);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_charge_card:export')")
@Log(title = "seg充值卡管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkChargeCard segchkChargeCard)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkChargeCard.setProviderId(sysUser.getProviderId());
}
List<SegchkChargeCard> list = segchkChargeCardService.selectSegchkChargeCardList(segchkChargeCard);
ExcelUtil<SegchkChargeCard> util = new ExcelUtil<SegchkChargeCard>(SegchkChargeCard.class);
return util.exportExcel(list, "seg充值卡管理数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_charge_card:query')")
@GetMapping(value = "/{cardTypeId}")
public AjaxResult getInfo(@PathVariable("cardTypeId") Long cardTypeId)
{
SegchkChargeCard segchkChargeCard = new SegchkChargeCard();
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkChargeCard.setProviderId(sysUser.getProviderId());
}
return AjaxResult.success(segchkChargeCardService.selectSegchkChargeCardByCardTypeId(cardTypeId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_charge_card:add')")
@Log(title = "seg充值卡管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkChargeCard segchkChargeCard)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
if(ObjectUtils.isEmpty(segchkChargeCard.getProviderId())){
return AjaxResult.error("500", "请输入运营商id");
}
}
else{
segchkChargeCard.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkChargeCardService.insertSegchkChargeCard(segchkChargeCard));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_charge_card:edit')")
@Log(title = "seg充值卡管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkChargeCard segchkChargeCard)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkChargeCard.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkChargeCardService.updateSegchkChargeCard(segchkChargeCard));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_charge_card:remove')")
@Log(title = "seg充值卡管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{cardTypeIds}")
public AjaxResult remove(@PathVariable String[] cardTypeIds)
{
return toAjax(segchkChargeCardService.deleteSegchkChargeCardByCardTypeIds(cardTypeIds));
}
}

View File

@ -0,0 +1,145 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkCommentAcc;
import com.ruoyi.segchk.service.ISegchkCommentAccService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_comment_acc")
public class SegchkCommentAccController extends BaseController
{
@Autowired
private ISegchkCommentAccService segchkCommentAccService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_comment_acc:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkCommentAcc segchkCommentAcc)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkCommentAcc.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkCommentAcc> list = segchkCommentAccService.selectSegchkCommentAccList(segchkCommentAcc);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_comment_acc:export')")
@Log(title = "seg商家累积评价", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkCommentAcc segchkCommentAcc)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkCommentAcc.setProviderId(sysUser.getProviderId());
}
List<SegchkCommentAcc> list = segchkCommentAccService.selectSegchkCommentAccList(segchkCommentAcc);
ExcelUtil<SegchkCommentAcc> util = new ExcelUtil<SegchkCommentAcc>(SegchkCommentAcc.class);
return util.exportExcel(list, "seg商家累积评价数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_comment_acc:query')")
@GetMapping(value = "/{updateId}")
public AjaxResult getInfo(@PathVariable("updateId") Long updateId)
{
return AjaxResult.success(segchkCommentAccService.selectSegchkCommentAccByUpdateId(updateId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_comment_acc:add')")
@Log(title = "seg商家累积评价", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkCommentAcc segchkCommentAcc)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkCommentAcc.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkCommentAccService.insertSegchkCommentAcc(segchkCommentAcc));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_comment_acc:edit')")
@Log(title = "seg商家累积评价", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkCommentAcc segchkCommentAcc)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkCommentAcc.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkCommentAccService.updateSegchkCommentAcc(segchkCommentAcc));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_comment_acc:remove')")
@Log(title = "seg商家累积评价", businessType = BusinessType.DELETE)
@DeleteMapping("/{updateIds}")
public AjaxResult remove(@PathVariable Long[] updateIds)
{
return toAjax(segchkCommentAccService.deleteSegchkCommentAccByUpdateIds(updateIds));
}
}

View File

@ -0,0 +1,105 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkDistrictInfo;
import com.ruoyi.segchk.service.ISegchkDistrictInfoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_district_info")
public class SegchkDistrictInfoController extends BaseController
{
@Autowired
private ISegchkDistrictInfoService segchkDistrictInfoService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_district_info:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkDistrictInfo segchkDistrictInfo)
{
startPage();
List<SegchkDistrictInfo> list = segchkDistrictInfoService.selectSegchkDistrictInfoList(segchkDistrictInfo);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_district_info:export')")
@Log(title = "seg行政区域代码", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkDistrictInfo segchkDistrictInfo)
{
List<SegchkDistrictInfo> list = segchkDistrictInfoService.selectSegchkDistrictInfoList(segchkDistrictInfo);
ExcelUtil<SegchkDistrictInfo> util = new ExcelUtil<SegchkDistrictInfo>(SegchkDistrictInfo.class);
return util.exportExcel(list, "seg行政区域代码数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_district_info:query')")
@GetMapping(value = "/{districtId}")
public AjaxResult getInfo(@PathVariable("districtId") Integer districtId)
{
return AjaxResult.success(segchkDistrictInfoService.selectSegchkDistrictInfoByDistrictId(districtId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_district_info:add')")
@Log(title = "seg行政区域代码", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkDistrictInfo segchkDistrictInfo)
{
return toAjax(segchkDistrictInfoService.insertSegchkDistrictInfo(segchkDistrictInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_district_info:edit')")
@Log(title = "seg行政区域代码", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkDistrictInfo segchkDistrictInfo)
{
return toAjax(segchkDistrictInfoService.updateSegchkDistrictInfo(segchkDistrictInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_district_info:remove')")
@Log(title = "seg行政区域代码", businessType = BusinessType.DELETE)
@DeleteMapping("/{districtIds}")
public AjaxResult remove(@PathVariable Integer[] districtIds)
{
return toAjax(segchkDistrictInfoService.deleteSegchkDistrictInfoByDistrictIds(districtIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkKeywordLable;
import com.ruoyi.segchk.service.ISegchkKeywordLableService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_keyword_lable")
public class SegchkKeywordLableController extends BaseController
{
@Autowired
private ISegchkKeywordLableService segchkKeywordLableService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_keyword_lable:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkKeywordLable segchkKeywordLable)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkKeywordLable.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkKeywordLable> list = segchkKeywordLableService.selectSegchkKeywordLableList(segchkKeywordLable);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_keyword_lable:export')")
@Log(title = "seg关键字管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkKeywordLable segchkKeywordLable)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkKeywordLable.setProviderId(sysUser.getProviderId());
}
List<SegchkKeywordLable> list = segchkKeywordLableService.selectSegchkKeywordLableList(segchkKeywordLable);
ExcelUtil<SegchkKeywordLable> util = new ExcelUtil<SegchkKeywordLable>(SegchkKeywordLable.class);
return util.exportExcel(list, "seg关键字管理数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_keyword_lable:query')")
@GetMapping(value = "/{keywordId}")
public AjaxResult getInfo(@PathVariable("keywordId") Long keywordId)
{
return AjaxResult.success(segchkKeywordLableService.selectSegchkKeywordLableByKeywordId(keywordId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_keyword_lable:add')")
@Log(title = "seg关键字管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkKeywordLable segchkKeywordLable)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkKeywordLable.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkKeywordLableService.insertSegchkKeywordLable(segchkKeywordLable));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_keyword_lable:edit')")
@Log(title = "seg关键字管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkKeywordLable segchkKeywordLable)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkKeywordLable.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkKeywordLableService.updateSegchkKeywordLable(segchkKeywordLable));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_keyword_lable:remove')")
@Log(title = "seg关键字管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{keywordIds}")
public AjaxResult remove(@PathVariable Long[] keywordIds)
{
return toAjax(segchkKeywordLableService.deleteSegchkKeywordLableByKeywordIds(keywordIds));
}
}

View File

@ -0,0 +1,165 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkLableMgt;
import com.ruoyi.segchk.service.ISegchkLableMgtService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_lable_mgt")
public class SegchkLableMgtController extends BaseController
{
@Autowired
private ISegchkLableMgtService segchkLableMgtService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_lable_mgt:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkLableMgt segchkLableMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
logger.debug("segchk:segchk_lable_mgt:list get with---user: {}",sysUser.toString());
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkLableMgt.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkLableMgt> list = segchkLableMgtService.selectSegchkLableMgtList(segchkLableMgt);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_lable_mgt:export')")
@Log(title = "seg首页标签管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkLableMgt segchkLableMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkLableMgt.setProviderId(sysUser.getProviderId());
}
List<SegchkLableMgt> list = segchkLableMgtService.selectSegchkLableMgtList(segchkLableMgt);
ExcelUtil<SegchkLableMgt> util = new ExcelUtil<SegchkLableMgt>(SegchkLableMgt.class);
return util.exportExcel(list, "seg首页标签管理数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_lable_mgt:query')")
@GetMapping(value = "/{mgtId}")
public AjaxResult getInfo(@PathVariable("mgtId") Long mgtId)
{
return AjaxResult.success(segchkLableMgtService.selectSegchkLableMgtByMgtId(mgtId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_lable_mgt:add')")
@Log(title = "seg首页标签管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkLableMgt segchkLableMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkLableMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkLableMgtService.insertSegchkLableMgt(segchkLableMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_lable_mgt:edit')")
@Log(title = "seg首页标签管理", businessType = BusinessType.UPDATE)
@PutMapping("/edit_info")
public AjaxResult edit(@RequestBody SegchkLableMgt segchkLableMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkLableMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkLableMgtService.updateSegchkLableMgt(segchkLableMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_lable_mgt:edit')")
@Log(title = "seg首页标签管理", businessType = BusinessType.UPDATE)
@PutMapping("/mgt_state")
public AjaxResult mgt_state(@RequestBody SegchkLableMgt segchkLableMgt)
{
logger.debug("mgt_state with --- {}", segchkLableMgt.toString());
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkLableMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkLableMgtService.updateSegchkLableMgt(segchkLableMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_lable_mgt:remove')")
@Log(title = "seg首页标签管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{mgtIds}")
public AjaxResult remove(@PathVariable Long[] mgtIds)
{
return toAjax(segchkLableMgtService.deleteSegchkLableMgtByProviderIds(mgtIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkLogionDetail;
import com.ruoyi.segchk.service.ISegchkLogionDetailService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_logion_detail")
public class SegchkLogionDetailController extends BaseController
{
@Autowired
private ISegchkLogionDetailService segchkLogionDetailService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_logion_detail:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkLogionDetail segchkLogionDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkLogionDetail.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkLogionDetail> list = segchkLogionDetailService.selectSegchkLogionDetailList(segchkLogionDetail);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_logion_detail:export')")
@Log(title = "seg登录记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkLogionDetail segchkLogionDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkLogionDetail.setProviderId(sysUser.getProviderId());
}
List<SegchkLogionDetail> list = segchkLogionDetailService.selectSegchkLogionDetailList(segchkLogionDetail);
ExcelUtil<SegchkLogionDetail> util = new ExcelUtil<SegchkLogionDetail>(SegchkLogionDetail.class);
return util.exportExcel(list, "seg登录记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_logion_detail:query')")
@GetMapping(value = "/{loginId}")
public AjaxResult getInfo(@PathVariable("loginId") Long loginId)
{
return AjaxResult.success(segchkLogionDetailService.selectSegchkLogionDetailByLoginId(loginId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_logion_detail:add')")
@Log(title = "seg登录记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkLogionDetail segchkLogionDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkLogionDetail.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkLogionDetailService.insertSegchkLogionDetail(segchkLogionDetail));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_logion_detail:edit')")
@Log(title = "seg登录记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkLogionDetail segchkLogionDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkLogionDetail.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkLogionDetailService.updateSegchkLogionDetail(segchkLogionDetail));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_logion_detail:remove')")
@Log(title = "seg登录记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{loginIds}")
public AjaxResult remove(@PathVariable Long[] loginIds)
{
return toAjax(segchkLogionDetailService.deleteSegchkLogionDetailByLoginIds(loginIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkMsgDetail;
import com.ruoyi.segchk.service.ISegchkMsgDetailService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_msg_detail")
public class SegchkMsgDetailController extends BaseController
{
@Autowired
private ISegchkMsgDetailService segchkMsgDetailService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_msg_detail:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkMsgDetail segchkMsgDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkMsgDetail.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkMsgDetail> list = segchkMsgDetailService.selectSegchkMsgDetailList(segchkMsgDetail);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_msg_detail:export')")
@Log(title = "seg消息记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkMsgDetail segchkMsgDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkMsgDetail.setProviderId(sysUser.getProviderId());
}
List<SegchkMsgDetail> list = segchkMsgDetailService.selectSegchkMsgDetailList(segchkMsgDetail);
ExcelUtil<SegchkMsgDetail> util = new ExcelUtil<SegchkMsgDetail>(SegchkMsgDetail.class);
return util.exportExcel(list, "seg消息记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_msg_detail:query')")
@GetMapping(value = "/{msgId}")
public AjaxResult getInfo(@PathVariable("msgId") Long msgId)
{
return AjaxResult.success(segchkMsgDetailService.selectSegchkMsgDetailByMsgId(msgId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_msg_detail:add')")
@Log(title = "seg消息记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkMsgDetail segchkMsgDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkMsgDetail.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkMsgDetailService.insertSegchkMsgDetail(segchkMsgDetail));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_msg_detail:edit')")
@Log(title = "seg消息记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkMsgDetail segchkMsgDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkMsgDetail.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkMsgDetailService.updateSegchkMsgDetail(segchkMsgDetail));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_msg_detail:remove')")
@Log(title = "seg消息记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{msgIds}")
public AjaxResult remove(@PathVariable Long[] msgIds)
{
return toAjax(segchkMsgDetailService.deleteSegchkMsgDetailByMsgIds(msgIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkPreferenceLable;
import com.ruoyi.segchk.service.ISegchkPreferenceLableService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_preference_lable")
public class SegchkPreferenceLableController extends BaseController
{
@Autowired
private ISegchkPreferenceLableService segchkPreferenceLableService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_preference_lable:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkPreferenceLable segchkPreferenceLable)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkPreferenceLable.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkPreferenceLable> list = segchkPreferenceLableService.selectSegchkPreferenceLableList(segchkPreferenceLable);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_preference_lable:export')")
@Log(title = "seg优惠管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkPreferenceLable segchkPreferenceLable)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkPreferenceLable.setProviderId(sysUser.getProviderId());
}
List<SegchkPreferenceLable> list = segchkPreferenceLableService.selectSegchkPreferenceLableList(segchkPreferenceLable);
ExcelUtil<SegchkPreferenceLable> util = new ExcelUtil<SegchkPreferenceLable>(SegchkPreferenceLable.class);
return util.exportExcel(list, "seg优惠管理数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_preference_lable:query')")
@GetMapping(value = "/{preferenceId}")
public AjaxResult getInfo(@PathVariable("preferenceId") Long preferenceId)
{
return AjaxResult.success(segchkPreferenceLableService.selectSegchkPreferenceLableByPreferenceId(preferenceId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_preference_lable:add')")
@Log(title = "seg优惠管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkPreferenceLable segchkPreferenceLable)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkPreferenceLable.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkPreferenceLableService.insertSegchkPreferenceLable(segchkPreferenceLable));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_preference_lable:edit')")
@Log(title = "seg优惠管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkPreferenceLable segchkPreferenceLable)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkPreferenceLable.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkPreferenceLableService.updateSegchkPreferenceLable(segchkPreferenceLable));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_preference_lable:remove')")
@Log(title = "seg优惠管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{preferenceIds}")
public AjaxResult remove(@PathVariable Long[] preferenceIds)
{
return toAjax(segchkPreferenceLableService.deleteSegchkPreferenceLableByPreferenceIds(preferenceIds));
}
}

View File

@ -0,0 +1,161 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkProviderMgt;
import com.ruoyi.segchk.service.ISegchkProviderMgtService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_provider_mgt")
public class SegchkProviderMgtController extends BaseController
{
@Autowired
private ISegchkProviderMgtService segchkProviderMgtService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_provider_mgt:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkProviderMgt segchkProviderMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkProviderMgt.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkProviderMgt> list = segchkProviderMgtService.selectSegchkProviderMgtList(segchkProviderMgt);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_provider_mgt:export')")
@Log(title = "seg运营商管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkProviderMgt segchkProviderMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkProviderMgt.setProviderId(sysUser.getProviderId());
}
List<SegchkProviderMgt> list = segchkProviderMgtService.selectSegchkProviderMgtList(segchkProviderMgt);
ExcelUtil<SegchkProviderMgt> util = new ExcelUtil<SegchkProviderMgt>(SegchkProviderMgt.class);
return util.exportExcel(list, "seg运营商管理数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_provider_mgt:query')")
@GetMapping(value = "/{providerId}")
public AjaxResult getInfo(@PathVariable("providerId") Long providerId)
{
return AjaxResult.success(segchkProviderMgtService.selectSegchkProviderMgtByProviderId(providerId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_provider_mgt:add')")
@Log(title = "seg运营商管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkProviderMgt segchkProviderMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkProviderMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkProviderMgtService.insertSegchkProviderMgt(segchkProviderMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_provider_mgt:edit')")
@Log(title = "seg运营商管理", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SegchkProviderMgt segchkProviderMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkProviderMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkProviderMgtService.updateSegchkProviderMgt(segchkProviderMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_provider_mgt:edit')")
@Log(title = "seg运营商管理", businessType = BusinessType.UPDATE)
@PutMapping("/status")
public AjaxResult status(@RequestBody SegchkProviderMgt segchkProviderMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkProviderMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkProviderMgtService.updateSegchkProviderMgt(segchkProviderMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_provider_mgt:remove')")
@Log(title = "seg运营商管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{providerIds}")
public AjaxResult remove(@PathVariable Long[] providerIds)
{
return toAjax(segchkProviderMgtService.deleteSegchkProviderMgtByProviderIds(providerIds));
}
}

View File

@ -0,0 +1,161 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkRecommenderStore;
import com.ruoyi.segchk.service.ISegchkRecommenderStoreService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_recommender_store")
public class SegchkRecommenderStoreController extends BaseController
{
@Autowired
private ISegchkRecommenderStoreService segchkRecommenderStoreService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_recommender_store:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkRecommenderStore segchkRecommenderStore)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkRecommenderStore.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkRecommenderStore> list = segchkRecommenderStoreService.selectSegchkRecommenderStoreList(segchkRecommenderStore);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_recommender_store:export')")
@Log(title = "seg首页推荐商户", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkRecommenderStore segchkRecommenderStore)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkRecommenderStore.setProviderId(sysUser.getProviderId());
}
List<SegchkRecommenderStore> list = segchkRecommenderStoreService.selectSegchkRecommenderStoreList(segchkRecommenderStore);
ExcelUtil<SegchkRecommenderStore> util = new ExcelUtil<SegchkRecommenderStore>(SegchkRecommenderStore.class);
return util.exportExcel(list, "seg首页推荐商户数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_recommender_store:query')")
@GetMapping(value = "/{recommenderId}")
public AjaxResult getInfo(@PathVariable("recommenderId") Long recommenderId)
{
return AjaxResult.success(segchkRecommenderStoreService.selectSegchkRecommenderStoreByRecommenderId(recommenderId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_recommender_store:add')")
@Log(title = "seg首页推荐商户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkRecommenderStore segchkRecommenderStore)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkRecommenderStore.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkRecommenderStoreService.insertSegchkRecommenderStore(segchkRecommenderStore));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_recommender_store:edit')")
@Log(title = "seg首页推荐商户", businessType = BusinessType.UPDATE)
@PutMapping("/edit_info")
public AjaxResult edit(@RequestBody SegchkRecommenderStore segchkRecommenderStore)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkRecommenderStore.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkRecommenderStoreService.updateSegchkRecommenderStore(segchkRecommenderStore));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_recommender_store:edit')")
@Log(title = "seg首页推荐商户", businessType = BusinessType.UPDATE)
@PutMapping("/mgt_state")
public AjaxResult mgt_state(@RequestBody SegchkRecommenderStore segchkRecommenderStore)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkRecommenderStore.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkRecommenderStoreService.updateSegchkRecommenderStore(segchkRecommenderStore));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_recommender_store:remove')")
@Log(title = "seg首页推荐商户", businessType = BusinessType.DELETE)
@DeleteMapping("/{recommenderIds}")
public AjaxResult remove(@PathVariable Long[] recommenderIds)
{
return toAjax(segchkRecommenderStoreService.deleteSegchkRecommenderStoreByRecommenderIds(recommenderIds));
}
}

View File

@ -0,0 +1,161 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkSalerInfo;
import com.ruoyi.segchk.service.ISegchkSalerInfoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_saler_info")
public class SegchkSalerInfoController extends BaseController
{
@Autowired
private ISegchkSalerInfoService segchkSalerInfoService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_saler_info:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkSalerInfo segchkSalerInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSalerInfo.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkSalerInfo> list = segchkSalerInfoService.selectSegchkSalerInfoList(segchkSalerInfo);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_saler_info:export')")
@Log(title = "seg销售人员信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkSalerInfo segchkSalerInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSalerInfo.setProviderId(sysUser.getProviderId());
}
List<SegchkSalerInfo> list = segchkSalerInfoService.selectSegchkSalerInfoList(segchkSalerInfo);
ExcelUtil<SegchkSalerInfo> util = new ExcelUtil<SegchkSalerInfo>(SegchkSalerInfo.class);
return util.exportExcel(list, "seg销售人员信息数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_saler_info:query')")
@GetMapping(value = "/{salerId}")
public AjaxResult getInfo(@PathVariable("salerId") Integer salerId)
{
return AjaxResult.success(segchkSalerInfoService.selectSegchkSalerInfoBySalerId(salerId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_saler_info:add')")
@Log(title = "seg销售人员信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkSalerInfo segchkSalerInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSalerInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkSalerInfoService.insertSegchkSalerInfo(segchkSalerInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_saler_info:edit')")
@Log(title = "seg销售人员信息", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SegchkSalerInfo segchkSalerInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSalerInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkSalerInfoService.updateSegchkSalerInfo(segchkSalerInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_saler_info:edit')")
@Log(title = "seg销售人员信息", businessType = BusinessType.UPDATE)
@PutMapping("/update_status")
public AjaxResult update_status(@RequestBody SegchkSalerInfo segchkSalerInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSalerInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkSalerInfoService.updateSegchkSalerInfo(segchkSalerInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_saler_info:remove')")
@Log(title = "seg销售人员信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{salerIds}")
public AjaxResult remove(@PathVariable Integer[] salerIds)
{
return toAjax(segchkSalerInfoService.deleteSegchkSalerInfoBySalerIds(salerIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkSelfServiceChk;
import com.ruoyi.segchk.service.ISegchkSelfServiceChkService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_self_service_chk")
public class SegchkSelfServiceChkController extends BaseController
{
@Autowired
private ISegchkSelfServiceChkService segchkSelfServiceChkService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk: segchk_self_service_chk:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkSelfServiceChk segchkSelfServiceChk)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSelfServiceChk.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkSelfServiceChk> list = segchkSelfServiceChkService.selectSegchkSelfServiceChkList(segchkSelfServiceChk);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk: segchk_self_service_chk:export')")
@Log(title = "seg自定义卡核消记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkSelfServiceChk segchkSelfServiceChk)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSelfServiceChk.setProviderId(sysUser.getProviderId());
}
List<SegchkSelfServiceChk> list = segchkSelfServiceChkService.selectSegchkSelfServiceChkList(segchkSelfServiceChk);
ExcelUtil<SegchkSelfServiceChk> util = new ExcelUtil<SegchkSelfServiceChk>(SegchkSelfServiceChk.class);
return util.exportExcel(list, "seg自定义卡核消记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk: segchk_self_service_chk:query')")
@GetMapping(value = "/{chkServiceId}")
public AjaxResult getInfo(@PathVariable("chkServiceId") Long chkServiceId)
{
return AjaxResult.success(segchkSelfServiceChkService.selectSegchkSelfServiceChkByChkServiceId(chkServiceId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk: segchk_self_service_chk:add')")
@Log(title = "seg自定义卡核消记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkSelfServiceChk segchkSelfServiceChk)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSelfServiceChk.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkSelfServiceChkService.insertSegchkSelfServiceChk(segchkSelfServiceChk));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk: segchk_self_service_chk:edit')")
@Log(title = "seg自定义卡核消记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkSelfServiceChk segchkSelfServiceChk)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSelfServiceChk.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkSelfServiceChkService.updateSegchkSelfServiceChk(segchkSelfServiceChk));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk: segchk_self_service_chk:remove')")
@Log(title = "seg自定义卡核消记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{chkServiceIds}")
public AjaxResult remove(@PathVariable Long[] chkServiceIds)
{
return toAjax(segchkSelfServiceChkService.deleteSegchkSelfServiceChkByChkServiceIds(chkServiceIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkServiceChk;
import com.ruoyi.segchk.service.ISegchkServiceChkService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_service_chk")
public class SegchkServiceChkController extends BaseController
{
@Autowired
private ISegchkServiceChkService segchkServiceChkService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_chk:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkServiceChk segchkServiceChk)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkServiceChk.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkServiceChk> list = segchkServiceChkService.selectSegchkServiceChkList(segchkServiceChk);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_chk:export')")
@Log(title = "seg核消记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkServiceChk segchkServiceChk)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkServiceChk.setProviderId(sysUser.getProviderId());
}
List<SegchkServiceChk> list = segchkServiceChkService.selectSegchkServiceChkList(segchkServiceChk);
ExcelUtil<SegchkServiceChk> util = new ExcelUtil<SegchkServiceChk>(SegchkServiceChk.class);
return util.exportExcel(list, "seg核消记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_chk:query')")
@GetMapping(value = "/{chkServiceId}")
public AjaxResult getInfo(@PathVariable("chkServiceId") Long chkServiceId)
{
return AjaxResult.success(segchkServiceChkService.selectSegchkServiceChkByChkServiceId(chkServiceId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_chk:add')")
@Log(title = "seg核消记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkServiceChk segchkServiceChk)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkServiceChk.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkServiceChkService.insertSegchkServiceChk(segchkServiceChk));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_chk:edit')")
@Log(title = "seg核消记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkServiceChk segchkServiceChk)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkServiceChk.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkServiceChkService.updateSegchkServiceChk(segchkServiceChk));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_chk:remove')")
@Log(title = "seg核消记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{chkServiceIds}")
public AjaxResult remove(@PathVariable Long[] chkServiceIds)
{
return toAjax(segchkServiceChkService.deleteSegchkServiceChkByChkServiceIds(chkServiceIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkServiceComment;
import com.ruoyi.segchk.service.ISegchkServiceCommentService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_service_comment")
public class SegchkServiceCommentController extends BaseController
{
@Autowired
private ISegchkServiceCommentService segchkServiceCommentService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_comment:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkServiceComment segchkServiceComment)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkServiceComment.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkServiceComment> list = segchkServiceCommentService.selectSegchkServiceCommentList(segchkServiceComment);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_comment:export')")
@Log(title = "seg评价记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkServiceComment segchkServiceComment)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkServiceComment.setProviderId(sysUser.getProviderId());
}
List<SegchkServiceComment> list = segchkServiceCommentService.selectSegchkServiceCommentList(segchkServiceComment);
ExcelUtil<SegchkServiceComment> util = new ExcelUtil<SegchkServiceComment>(SegchkServiceComment.class);
return util.exportExcel(list, "seg评价记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_comment:query')")
@GetMapping(value = "/{commentId}")
public AjaxResult getInfo(@PathVariable("commentId") Long commentId)
{
return AjaxResult.success(segchkServiceCommentService.selectSegchkServiceCommentByCommentId(commentId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_comment:add')")
@Log(title = "seg评价记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkServiceComment segchkServiceComment)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkServiceComment.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkServiceCommentService.insertSegchkServiceComment(segchkServiceComment));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_comment:edit')")
@Log(title = "seg评价记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkServiceComment segchkServiceComment)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkServiceComment.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkServiceCommentService.updateSegchkServiceComment(segchkServiceComment));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_service_comment:remove')")
@Log(title = "seg评价记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{commentIds}")
public AjaxResult remove(@PathVariable Long[] commentIds)
{
return toAjax(segchkServiceCommentService.deleteSegchkServiceCommentByCommentIds(commentIds));
}
}

View File

@ -0,0 +1,304 @@
package com.ruoyi.web.controller.segchk;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.UnAuth;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.segchk.domain.*;
import com.ruoyi.segchk.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/simple_list")
public class SegchkSimpleListController extends BaseController
{
@Autowired
private ISegchkProviderMgtService segchkProviderMgtService;
@Autowired
private ISegchkSalerInfoService segchkSalerInfoService;
@Autowired
private ISegchkStoreBasicInfoService segchkStoreBasicInfoService;
@Autowired
private ISegchkChargeCardService segchkChargeCardService;
@Autowired
private ISegchkKeywordLableService segchkKeywordLableService;
@Autowired
private ISegchkPreferenceLableService segchkPreferenceLableService;
@Autowired
private ISegchkDistrictInfoService segchkDistrictInfoService;
/**
* seg
*/
@UnAuth
// @PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:list')")
@GetMapping("/salerList")
public TableDataInfo saler_list()
{
logger.debug("salerList is call");
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
// sysUser.getNickName();
Long providerId = sysUser.getUserId() == 1 ? null : sysUser.getProviderId();
startPage();
SegchkSalerInfo segchkSalerInfo = new SegchkSalerInfo();
segchkSalerInfo.setProviderId(providerId);
List<SegchkSalerInfo> list = segchkSalerInfoService.selectSegchkSalerInfoList(segchkSalerInfo);
List<SimpleListObj> collect = list.parallelStream().filter(v -> v.getSalerState() == 0).map(v -> {
SimpleListObj simpleListObj1 = new SimpleListObj();
simpleListObj1.setProviderId(String.valueOf(v.getProviderId()));
simpleListObj1.setKey(String.valueOf(v.getSalerId()));
simpleListObj1.setValue(String.valueOf(v.getSalerName()));
return simpleListObj1;
}).collect(Collectors.toList());
return getDataTable(collect);
}
/**
* seg
*/
@UnAuth
// @PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:list')")
@GetMapping("/providerList")
public TableDataInfo provider_list()
{
logger.debug("providerList is call");
SimpleListObj simpleListObj = new SimpleListObj();
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
// sysUser.getNickName();
Long providerId = sysUser.getUserId() == 1 ? null : sysUser.getProviderId();
startPage();
SegchkProviderMgt segchkProviderMgt = new SegchkProviderMgt();
segchkProviderMgt.setProviderId(providerId);
List<SegchkProviderMgt> list = segchkProviderMgtService.selectSegchkProviderMgtList(segchkProviderMgt);
List<SimpleListObj> collect = list.parallelStream().map(v -> {
SimpleListObj simpleListObj1 = new SimpleListObj();
simpleListObj1.setProviderId(String.valueOf(v.getProviderId()));
simpleListObj1.setKey(String.valueOf(v.getProviderId()));
simpleListObj1.setValue(String.valueOf(v.getNickName()));
return simpleListObj1;
}).collect(Collectors.toList());
collect.forEach(v -> logger.debug("providerList ret : {}", v.toString()));
return getDataTable(collect);
}
/**
* seg
*/
@UnAuth
// @PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:list')")
@GetMapping("/storeList")
public TableDataInfo store_list()
{
logger.debug("storeList is call");
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
// sysUser.getNickName();
Long providerId = sysUser.getUserId() == 1 ? null : sysUser.getProviderId();
startPage();
SegchkStoreBasicInfo segchkStoreBasicInfo = new SegchkStoreBasicInfo();
segchkStoreBasicInfo.setProviderId(providerId);
List<SegchkStoreBasicInfo> list = segchkStoreBasicInfoService.selectSegchkStoreBasicInfoList(segchkStoreBasicInfo);
List<SimpleListObj> collect = list.parallelStream().map(v -> {
SimpleListObj simpleListObj1 = new SimpleListObj();
simpleListObj1.setProviderId(String.valueOf(v.getProviderId()));
simpleListObj1.setKey(String.valueOf(v.getStoreId()));
simpleListObj1.setValue(String.valueOf(v.getStoreName()));
return simpleListObj1;
}).collect(Collectors.toList());
collect.forEach(v -> logger.debug("providerList ret : {}", v.toString()));
return getDataTable(collect);
}
/**
* seg
*/
@UnAuth
// @PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:list')")
@GetMapping("/ChargeCardList")
public TableDataInfo charge_card_list()
{
logger.debug("ChargeCardList is call");
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
// sysUser.getNickName();
Long providerId = sysUser.getUserId() == 1 ? null : sysUser.getProviderId();
startPage();
SegchkChargeCard segchkChargeCard = new SegchkChargeCard();
segchkChargeCard.setProviderId(providerId);
List<SegchkChargeCard> list = segchkChargeCardService.selectSegchkChargeCardList(segchkChargeCard);
List<SimpleListObj> collect = list.parallelStream().map(v -> {
SimpleListObj simpleListObj1 = new SimpleListObj();
simpleListObj1.setProviderId(String.valueOf(v.getProviderId()));
simpleListObj1.setKey(String.valueOf(v.getCardTypeId()));
simpleListObj1.setValue(String.valueOf(v.getCardTypeName()));
return simpleListObj1;
}).collect(Collectors.toList());
collect.forEach(v -> logger.debug("ChargeCardList ret : {}", v.toString()));
return getDataTable(collect);
}
/**
* seg
*/
@UnAuth
// @PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:list')")
@GetMapping("/KerwordList")
public TableDataInfo kerword_list()
{
logger.debug("KerwordList is call");
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
// sysUser.getNickName();
Long providerId = sysUser.getUserId() == 1 ? null : sysUser.getProviderId();
startPage();
SegchkKeywordLable segchkKeywordLable = new SegchkKeywordLable();
segchkKeywordLable.setProviderId(providerId);
List<SegchkKeywordLable> list = segchkKeywordLableService.selectSegchkKeywordLableList(segchkKeywordLable);
List<SimpleListObj> collect = list.parallelStream().map(v -> {
SimpleListObj simpleListObj1 = new SimpleListObj();
simpleListObj1.setProviderId(String.valueOf(v.getProviderId()));
simpleListObj1.setKey(String.valueOf(v.getKeywordId()));
simpleListObj1.setValue(String.valueOf(v.getKeywordName()));
simpleListObj1.setImgUrl(String.valueOf(v.getKeywordUrl()));
return simpleListObj1;
}).collect(Collectors.toList());
collect.forEach(v -> logger.debug("KerwordList ret : {}", v.toString()));
return getDataTable(collect);
}
/**
* seg
*/
@UnAuth
// @PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:list')")
@GetMapping("/PreferenceLableList")
public TableDataInfo preference_lable_list()
{
logger.debug("PreferenceLableList is call");
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
// sysUser.getNickName();
Long providerId = sysUser.getUserId() == 1 ? null : sysUser.getProviderId();
startPage();
SegchkPreferenceLable segchkPreferenceLable = new SegchkPreferenceLable();
segchkPreferenceLable.setProviderId(providerId);
List<SegchkPreferenceLable> list = segchkPreferenceLableService.selectSegchkPreferenceLableList(segchkPreferenceLable);
List<SimpleListObj> collect = list.parallelStream().map(v -> {
SimpleListObj simpleListObj1 = new SimpleListObj();
simpleListObj1.setProviderId(String.valueOf(v.getProviderId()));
simpleListObj1.setKey(String.valueOf(v.getPreferenceId()));
simpleListObj1.setValue(String.valueOf(v.getPreferenceName()));
simpleListObj1.setImgUrl(String.valueOf(v.getPreferenceUrl()));
return simpleListObj1;
}).collect(Collectors.toList());
collect.forEach(v -> logger.debug("PreferenceLableList ret : {}", v.toString()));
return getDataTable(collect);
}
/**
* seg
*/
@UnAuth
// @PreAuthorize("@ss.hasPermi('segchk:segchk_carouse_mgt:list')")
@GetMapping("/DistictList")
public TableDataInfo distict_list()
{
logger.debug("DistictList is call");
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
// sysUser.getNickName();
Long providerId = sysUser.getUserId() == 1 ? null : sysUser.getProviderId();
startPage();
SegchkDistrictInfo segchkDistrictInfo = new SegchkDistrictInfo();
List<SegchkDistrictInfo> list = segchkDistrictInfoService.selectSegchkDistrictInfoList(segchkDistrictInfo);
List<SimpleListObj> collect = list.parallelStream().filter(v -> v.getDistrictLevel() == 0 || v.getDistrictLevel() == 1).map(v -> {
SimpleListObj simpleListObj1 = new SimpleListObj();
simpleListObj1.setProviderId(String.valueOf(providerId));
simpleListObj1.setKey(String.valueOf(v.getDistrictId()));
simpleListObj1.setValue(String.valueOf(v.getDistrictName()));
return simpleListObj1;
}).collect(Collectors.toList());
collect.forEach(v -> logger.debug("PreferenceLableList ret : {}", v.toString()));
return getDataTable(collect);
}
private class SimpleListObj extends BaseEntity {
private String providerId;
private String key;
private String value;
private String imgUrl;
public String getProviderId() {
return providerId;
}
public void setProviderId(String providerId) {
this.providerId = providerId;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
@Override
public String toString() {
return "SimpleListObj{" +
"providerId='" + providerId + '\'' +
", key='" + key + '\'' +
", value='" + value + '\'' +
", imgUrl='" + imgUrl + '\'' +
'}';
}
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkSmsDetail;
import com.ruoyi.segchk.service.ISegchkSmsDetailService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_sms_detail")
public class SegchkSmsDetailController extends BaseController
{
@Autowired
private ISegchkSmsDetailService segchkSmsDetailService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_sms_detail:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkSmsDetail segchkSmsDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSmsDetail.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkSmsDetail> list = segchkSmsDetailService.selectSegchkSmsDetailList(segchkSmsDetail);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_sms_detail:export')")
@Log(title = "seg短信记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkSmsDetail segchkSmsDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSmsDetail.setProviderId(sysUser.getProviderId());
}
List<SegchkSmsDetail> list = segchkSmsDetailService.selectSegchkSmsDetailList(segchkSmsDetail);
ExcelUtil<SegchkSmsDetail> util = new ExcelUtil<SegchkSmsDetail>(SegchkSmsDetail.class);
return util.exportExcel(list, "seg短信记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_sms_detail:query')")
@GetMapping(value = "/{shortMsgId}")
public AjaxResult getInfo(@PathVariable("shortMsgId") Long shortMsgId)
{
return AjaxResult.success(segchkSmsDetailService.selectSegchkSmsDetailByShortMsgId(shortMsgId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_sms_detail:add')")
@Log(title = "seg短信记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkSmsDetail segchkSmsDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSmsDetail.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkSmsDetailService.insertSegchkSmsDetail(segchkSmsDetail));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_sms_detail:edit')")
@Log(title = "seg短信记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkSmsDetail segchkSmsDetail)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkSmsDetail.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkSmsDetailService.updateSegchkSmsDetail(segchkSmsDetail));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_sms_detail:remove')")
@Log(title = "seg短信记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{shortMsgIds}")
public AjaxResult remove(@PathVariable Long[] shortMsgIds)
{
return toAjax(segchkSmsDetailService.deleteSegchkSmsDetailByShortMsgIds(shortMsgIds));
}
}

View File

@ -0,0 +1,142 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkStoreAccount;
import com.ruoyi.segchk.service.ISegchkStoreAccountService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_store_account")
public class SegchkStoreAccountController extends BaseController
{
@Autowired
private ISegchkStoreAccountService segchkStoreAccountService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_account:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkStoreAccount segchkStoreAccount)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreAccount.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkStoreAccount> list = segchkStoreAccountService.selectSegchkStoreAccountList(segchkStoreAccount);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_account:export')")
@Log(title = "seg商户余额信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkStoreAccount segchkStoreAccount)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreAccount.setProviderId(sysUser.getProviderId());
}
List<SegchkStoreAccount> list = segchkStoreAccountService.selectSegchkStoreAccountList(segchkStoreAccount);
ExcelUtil<SegchkStoreAccount> util = new ExcelUtil<SegchkStoreAccount>(SegchkStoreAccount.class);
return util.exportExcel(list, "seg商户余额信息数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_account:query')")
@GetMapping(value = "/{accountId}")
public AjaxResult getInfo(@PathVariable("accountId") Long accountId)
{
return AjaxResult.success(segchkStoreAccountService.selectSegchkStoreAccountByAccountId(accountId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_account:add')")
@Log(title = "seg商户余额信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkStoreAccount segchkStoreAccount)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreAccount.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreAccountService.insertSegchkStoreAccount(segchkStoreAccount));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_account:edit')")
@Log(title = "seg商户余额信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkStoreAccount segchkStoreAccount)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreAccount.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreAccountService.updateSegchkStoreAccount(segchkStoreAccount));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_account:remove')")
@Log(title = "seg商户余额信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{accountIds}")
public AjaxResult remove(@PathVariable Long[] accountIds)
{
return toAjax(segchkStoreAccountService.deleteSegchkStoreAccountByAccountIds(accountIds));
}
}

View File

@ -0,0 +1,206 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkStoreBasicInfo;
import com.ruoyi.segchk.service.ISegchkStoreBasicInfoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_store_basic_info")
public class SegchkStoreBasicInfoController extends BaseController
{
@Autowired
private ISegchkStoreBasicInfoService segchkStoreBasicInfoService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_basic_info:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkStoreBasicInfo segchkStoreBasicInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreBasicInfo.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkStoreBasicInfo> list = segchkStoreBasicInfoService.selectSegchkStoreBasicInfoList(segchkStoreBasicInfo);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_basic_info:export')")
@Log(title = "seg商家基础信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkStoreBasicInfo segchkStoreBasicInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreBasicInfo.setProviderId(sysUser.getProviderId());
}
List<SegchkStoreBasicInfo> list = segchkStoreBasicInfoService.selectSegchkStoreBasicInfoList(segchkStoreBasicInfo);
ExcelUtil<SegchkStoreBasicInfo> util = new ExcelUtil<SegchkStoreBasicInfo>(SegchkStoreBasicInfo.class);
return util.exportExcel(list, "seg商家基础信息数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_basic_info:query')")
@GetMapping(value = "/{storeId}")
public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
{
return AjaxResult.success(segchkStoreBasicInfoService.selectSegchkStoreBasicInfoByStoreId(storeId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_basic_info:add')")
@Log(title = "seg商家基础信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkStoreBasicInfo segchkStoreBasicInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreBasicInfo.setProviderId(sysUser.getProviderId());
}
int i = segchkStoreBasicInfoService.insertSegchkStoreBasicInfo(segchkStoreBasicInfo);
if(i < 0){
return AjaxResult.error(500, "手机号码已绑定商户");
}
else {
return toAjax(i);
}
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_basic_info:edit')")
@Log(title = "seg商家基础信息", businessType = BusinessType.UPDATE)
@PutMapping("edit_info")
public AjaxResult edit(@RequestBody SegchkStoreBasicInfo segchkStoreBasicInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreBasicInfo.setProviderId(sysUser.getProviderId());
}
logger.debug("edit_info with ---> {}", segchkStoreBasicInfo.toString());
int i = segchkStoreBasicInfoService.updateSegchkStoreBasicInfo(segchkStoreBasicInfo);
if(i < 0){
return AjaxResult.error(500, "手机号码已绑定商户");
}
else {
return toAjax(i);
}
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_basic_info:edit')")
@Log(title = "seg商家基础信息", businessType = BusinessType.UPDATE)
@PutMapping("update_detail")
public AjaxResult update_detail(@RequestBody SegchkStoreBasicInfo segchkStoreBasicInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreBasicInfo.setProviderId(sysUser.getProviderId());
}
logger.debug("update_detail with ---> {}", segchkStoreBasicInfo.toString());
int i = segchkStoreBasicInfoService.updateSegchkStoreDetail(segchkStoreBasicInfo);
return toAjax(i);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_basic_info:edit')")
@Log(title = "seg商家基础信息", businessType = BusinessType.UPDATE)
@PutMapping("service_state")
// public AjaxResult service_state(Long providerId, Long storeId, String serviceState)
public AjaxResult service_state(@RequestBody SegchkStoreBasicInfo segchkStoreBasicInfo)
{
// SegchkStoreBasicInfo segchkStoreBasicInfo = new SegchkStoreBasicInfo();
// segchkStoreBasicInfo.setProviderId(providerId);
// segchkStoreBasicInfo.setStoreId(storeId);
// segchkStoreBasicInfo.setServiceState(serviceState);
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreBasicInfo.setProviderId(sysUser.getProviderId());
}
logger.debug("service_state with: {}", segchkStoreBasicInfo.toString());
return toAjax(segchkStoreBasicInfoService.updateSegchkStoreServiceStatus(segchkStoreBasicInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_basic_info:remove')")
@Log(title = "seg商家基础信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{storeIds}")
public AjaxResult remove(@PathVariable Long[] storeIds)
{
return toAjax(segchkStoreBasicInfoService.deleteSegchkStoreBasicInfoByStoreIds(storeIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkStoreCash;
import com.ruoyi.segchk.service.ISegchkStoreCashService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_store_cash")
public class SegchkStoreCashController extends BaseController
{
@Autowired
private ISegchkStoreCashService segchkStoreCashService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_cash:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkStoreCash segchkStoreCash)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreCash.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkStoreCash> list = segchkStoreCashService.selectSegchkStoreCashList(segchkStoreCash);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_cash:export')")
@Log(title = "seg商户户提现记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkStoreCash segchkStoreCash)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreCash.setProviderId(sysUser.getProviderId());
}
List<SegchkStoreCash> list = segchkStoreCashService.selectSegchkStoreCashList(segchkStoreCash);
ExcelUtil<SegchkStoreCash> util = new ExcelUtil<SegchkStoreCash>(SegchkStoreCash.class);
return util.exportExcel(list, "seg商户户提现记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_cash:query')")
@GetMapping(value = "/{cashId}")
public AjaxResult getInfo(@PathVariable("cashId") Long cashId)
{
return AjaxResult.success(segchkStoreCashService.selectSegchkStoreCashByCashId(cashId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_cash:add')")
@Log(title = "seg商户户提现记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkStoreCash segchkStoreCash)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreCash.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreCashService.insertSegchkStoreCash(segchkStoreCash));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_cash:edit')")
@Log(title = "seg商户户提现记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkStoreCash segchkStoreCash)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreCash.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreCashService.updateSegchkStoreCash(segchkStoreCash));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_cash:remove')")
@Log(title = "seg商户户提现记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{cashIds}")
public AjaxResult remove(@PathVariable Long[] cashIds)
{
return toAjax(segchkStoreCashService.deleteSegchkStoreCashByCashIds(cashIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkStoreCharge;
import com.ruoyi.segchk.service.ISegchkStoreChargeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_store_charge")
public class SegchkStoreChargeController extends BaseController
{
@Autowired
private ISegchkStoreChargeService segchkStoreChargeService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_charge:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkStoreCharge segchkStoreCharge)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreCharge.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkStoreCharge> list = segchkStoreChargeService.selectSegchkStoreChargeList(segchkStoreCharge);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_charge:export')")
@Log(title = "seg商户充值记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkStoreCharge segchkStoreCharge)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreCharge.setProviderId(sysUser.getProviderId());
}
List<SegchkStoreCharge> list = segchkStoreChargeService.selectSegchkStoreChargeList(segchkStoreCharge);
ExcelUtil<SegchkStoreCharge> util = new ExcelUtil<SegchkStoreCharge>(SegchkStoreCharge.class);
return util.exportExcel(list, "seg商户充值记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_charge:query')")
@GetMapping(value = "/{chargeId}")
public AjaxResult getInfo(@PathVariable("chargeId") Long chargeId)
{
return AjaxResult.success(segchkStoreChargeService.selectSegchkStoreChargeByChargeId(chargeId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_charge:add')")
@Log(title = "seg商户充值记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkStoreCharge segchkStoreCharge)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreCharge.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreChargeService.insertSegchkStoreCharge(segchkStoreCharge));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_charge:edit')")
@Log(title = "seg商户充值记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkStoreCharge segchkStoreCharge)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreCharge.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreChargeService.updateSegchkStoreCharge(segchkStoreCharge));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_charge:remove')")
@Log(title = "seg商户充值记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{chargeIds}")
public AjaxResult remove(@PathVariable Long[] chargeIds)
{
return toAjax(segchkStoreChargeService.deleteSegchkStoreChargeByChargeIds(chargeIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkStoreChkMgt;
import com.ruoyi.segchk.service.ISegchkStoreChkMgtService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_store_chk_mgt")
public class SegchkStoreChkMgtController extends BaseController
{
@Autowired
private ISegchkStoreChkMgtService segchkStoreChkMgtService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_chk_mgt:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkStoreChkMgt segchkStoreChkMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreChkMgt.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkStoreChkMgt> list = segchkStoreChkMgtService.selectSegchkStoreChkMgtList(segchkStoreChkMgt);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_chk_mgt:export')")
@Log(title = "seg商家核消卡管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkStoreChkMgt segchkStoreChkMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreChkMgt.setProviderId(sysUser.getProviderId());
}
List<SegchkStoreChkMgt> list = segchkStoreChkMgtService.selectSegchkStoreChkMgtList(segchkStoreChkMgt);
ExcelUtil<SegchkStoreChkMgt> util = new ExcelUtil<SegchkStoreChkMgt>(SegchkStoreChkMgt.class);
return util.exportExcel(list, "seg商家核消卡管理数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_chk_mgt:query')")
@GetMapping(value = "/{mgtId}")
public AjaxResult getInfo(@PathVariable("mgtId") Integer mgtId)
{
return AjaxResult.success(segchkStoreChkMgtService.selectSegchkStoreChkMgtByMgtId(mgtId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_chk_mgt:add')")
@Log(title = "seg商家核消卡管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkStoreChkMgt segchkStoreChkMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreChkMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreChkMgtService.insertSegchkStoreChkMgt(segchkStoreChkMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_chk_mgt:edit')")
@Log(title = "seg商家核消卡管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkStoreChkMgt segchkStoreChkMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreChkMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreChkMgtService.updateSegchkStoreChkMgt(segchkStoreChkMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_chk_mgt:remove')")
@Log(title = "seg商家核消卡管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{mgtIds}")
public AjaxResult remove(@PathVariable Integer[] mgtIds)
{
return toAjax(segchkStoreChkMgtService.deleteSegchkStoreChkMgtByMgtIds(mgtIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkStoreImage;
import com.ruoyi.segchk.service.ISegchkStoreImageService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_store_image")
public class SegchkStoreImageController extends BaseController
{
@Autowired
private ISegchkStoreImageService segchkStoreImageService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_image:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkStoreImage segchkStoreImage)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreImage.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkStoreImage> list = segchkStoreImageService.selectSegchkStoreImageList(segchkStoreImage);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_image:export')")
@Log(title = "seg商家图片信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkStoreImage segchkStoreImage)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreImage.setProviderId(sysUser.getProviderId());
}
List<SegchkStoreImage> list = segchkStoreImageService.selectSegchkStoreImageList(segchkStoreImage);
ExcelUtil<SegchkStoreImage> util = new ExcelUtil<SegchkStoreImage>(SegchkStoreImage.class);
return util.exportExcel(list, "seg商家图片信息数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_image:query')")
@GetMapping(value = "/{storeId}")
public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
{
return AjaxResult.success(segchkStoreImageService.selectSegchkStoreImageByStoreId(storeId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_image:add')")
@Log(title = "seg商家图片信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkStoreImage segchkStoreImage)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreImage.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreImageService.insertSegchkStoreImage(segchkStoreImage));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_image:edit')")
@Log(title = "seg商家图片信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkStoreImage segchkStoreImage)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreImage.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreImageService.updateSegchkStoreImage(segchkStoreImage));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_image:remove')")
@Log(title = "seg商家图片信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{storeIds}")
public AjaxResult remove(@PathVariable Long[] storeIds)
{
return toAjax(segchkStoreImageService.deleteSegchkStoreImageByStoreIds(storeIds));
}
}

View File

@ -0,0 +1,166 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkStoreLableMgt;
import com.ruoyi.segchk.service.ISegchkStoreLableMgtService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_store_lable_mgt")
public class SegchkStoreLableMgtController extends BaseController
{
@Autowired
private ISegchkStoreLableMgtService segchkStoreLableMgtService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_lable_mgt:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkStoreLableMgt segchkStoreLableMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreLableMgt.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkStoreLableMgt> list = segchkStoreLableMgtService.selectSegchkStoreLableMgtList(segchkStoreLableMgt);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_lable_mgt:export')")
@Log(title = "seg商家标签管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkStoreLableMgt segchkStoreLableMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreLableMgt.setProviderId(sysUser.getProviderId());
}
List<SegchkStoreLableMgt> list = segchkStoreLableMgtService.selectSegchkStoreLableMgtList(segchkStoreLableMgt);
ExcelUtil<SegchkStoreLableMgt> util = new ExcelUtil<SegchkStoreLableMgt>(SegchkStoreLableMgt.class);
return util.exportExcel(list, "seg商家标签管理数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_lable_mgt:query')")
@GetMapping(value = "/{mgtId}")
public AjaxResult getInfo(@PathVariable("mgtId") Integer mgtId)
{
return AjaxResult.success(segchkStoreLableMgtService.selectSegchkStoreLableMgtByMgtId(mgtId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_lable_mgt:add')")
@Log(title = "seg商家标签管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkStoreLableMgt segchkStoreLableMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreLableMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreLableMgtService.insertSegchkStoreLableMgt(segchkStoreLableMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_lable_mgt:edit')")
@Log(title = "seg商家标签管理", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SegchkStoreLableMgt segchkStoreLableMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreLableMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreLableMgtService.updateSegchkStoreLableMgt(segchkStoreLableMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_lable_mgt:edit')")
@Log(title = "seg商家标签管理", businessType = BusinessType.UPDATE)
@PutMapping("/update_status")
public AjaxResult update_status(@RequestBody SegchkStoreLableMgt segchkStoreLableMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreLableMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreLableMgtService.updateSegchkStoreLableMgt(segchkStoreLableMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_lable_mgt:remove')")
@Log(title = "seg商家标签管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{mgtIds}")
public AjaxResult remove(@PathVariable Integer[] mgtIds)
{
return toAjax(segchkStoreLableMgtService.deleteSegchkStoreLableMgtByMgtIds(mgtIds));
}
}

View File

@ -0,0 +1,145 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkStoreReward;
import com.ruoyi.segchk.service.ISegchkStoreRewardService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_store_reward")
public class SegchkStoreRewardController extends BaseController
{
@Autowired
private ISegchkStoreRewardService segchkStoreRewardService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_reward:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkStoreReward segchkStoreReward)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreReward.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkStoreReward> list = segchkStoreRewardService.selectSegchkStoreRewardList(segchkStoreReward);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_reward:export')")
@Log(title = "seg商户奖励", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkStoreReward segchkStoreReward)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreReward.setProviderId(sysUser.getProviderId());
}
List<SegchkStoreReward> list = segchkStoreRewardService.selectSegchkStoreRewardList(segchkStoreReward);
ExcelUtil<SegchkStoreReward> util = new ExcelUtil<SegchkStoreReward>(SegchkStoreReward.class);
return util.exportExcel(list, "seg商户奖励数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_reward:query')")
@GetMapping(value = "/{rewardId}")
public AjaxResult getInfo(@PathVariable("rewardId") Long rewardId)
{
return AjaxResult.success(segchkStoreRewardService.selectSegchkStoreRewardByRewardId(rewardId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_reward:add')")
@Log(title = "seg商户奖励", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkStoreReward segchkStoreReward)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreReward.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreRewardService.insertSegchkStoreReward(segchkStoreReward));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_reward:edit')")
@Log(title = "seg商户奖励", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkStoreReward segchkStoreReward)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreReward.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreRewardService.updateSegchkStoreReward(segchkStoreReward));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_reward:remove')")
@Log(title = "seg商户奖励", businessType = BusinessType.DELETE)
@DeleteMapping("/{rewardIds}")
public AjaxResult remove(@PathVariable Long[] rewardIds)
{
return toAjax(segchkStoreRewardService.deleteSegchkStoreRewardByRewardIds(rewardIds));
}
}

View File

@ -0,0 +1,145 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkStoreSecurity;
import com.ruoyi.segchk.service.ISegchkStoreSecurityService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_store_security")
public class SegchkStoreSecurityController extends BaseController
{
@Autowired
private ISegchkStoreSecurityService segchkStoreSecurityService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_security:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkStoreSecurity segchkStoreSecurity)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreSecurity.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkStoreSecurity> list = segchkStoreSecurityService.selectSegchkStoreSecurityList(segchkStoreSecurity);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_security:export')")
@Log(title = "seg商户密码", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkStoreSecurity segchkStoreSecurity)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreSecurity.setProviderId(sysUser.getProviderId());
}
List<SegchkStoreSecurity> list = segchkStoreSecurityService.selectSegchkStoreSecurityList(segchkStoreSecurity);
ExcelUtil<SegchkStoreSecurity> util = new ExcelUtil<SegchkStoreSecurity>(SegchkStoreSecurity.class);
return util.exportExcel(list, "seg商户密码数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_security:query')")
@GetMapping(value = "/{pwdId}")
public AjaxResult getInfo(@PathVariable("pwdId") Long pwdId)
{
return AjaxResult.success(segchkStoreSecurityService.selectSegchkStoreSecurityByPwdId(pwdId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_security:add')")
@Log(title = "seg商户密码", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkStoreSecurity segchkStoreSecurity)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreSecurity.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreSecurityService.insertSegchkStoreSecurity(segchkStoreSecurity));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_security:edit')")
@Log(title = "seg商户密码", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkStoreSecurity segchkStoreSecurity)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreSecurity.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreSecurityService.updateSegchkStoreSecurity(segchkStoreSecurity));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_security:remove')")
@Log(title = "seg商户密码", businessType = BusinessType.DELETE)
@DeleteMapping("/{pwdIds}")
public AjaxResult remove(@PathVariable Long[] pwdIds)
{
return toAjax(segchkStoreSecurityService.deleteSegchkStoreSecurityByPwdIds(pwdIds));
}
}

View File

@ -0,0 +1,142 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkStoreSelfMgt;
import com.ruoyi.segchk.service.ISegchkStoreSelfMgtService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_store_self_mgt")
public class SegchkStoreSelfMgtController extends BaseController
{
@Autowired
private ISegchkStoreSelfMgtService segchkStoreSelfMgtService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_self_mgt:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkStoreSelfMgt segchkStoreSelfMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreSelfMgt.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkStoreSelfMgt> list = segchkStoreSelfMgtService.selectSegchkStoreSelfMgtList(segchkStoreSelfMgt);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_self_mgt:export')")
@Log(title = "seg商家自定义卡管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkStoreSelfMgt segchkStoreSelfMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreSelfMgt.setProviderId(sysUser.getProviderId());
}
List<SegchkStoreSelfMgt> list = segchkStoreSelfMgtService.selectSegchkStoreSelfMgtList(segchkStoreSelfMgt);
ExcelUtil<SegchkStoreSelfMgt> util = new ExcelUtil<SegchkStoreSelfMgt>(SegchkStoreSelfMgt.class);
return util.exportExcel(list, "seg商家自定义卡管理数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_self_mgt:query')")
@GetMapping(value = "/{freeCardId}")
public AjaxResult getInfo(@PathVariable("freeCardId") Long freeCardId)
{
return AjaxResult.success(segchkStoreSelfMgtService.selectSegchkStoreSelfMgtByFreeCardId(freeCardId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_self_mgt:add')")
@Log(title = "seg商家自定义卡管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkStoreSelfMgt segchkStoreSelfMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreSelfMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreSelfMgtService.insertSegchkStoreSelfMgt(segchkStoreSelfMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_self_mgt:edit')")
@Log(title = "seg商家自定义卡管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkStoreSelfMgt segchkStoreSelfMgt)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkStoreSelfMgt.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkStoreSelfMgtService.updateSegchkStoreSelfMgt(segchkStoreSelfMgt));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_store_self_mgt:remove')")
@Log(title = "seg商家自定义卡管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{freeCardIds}")
public AjaxResult remove(@PathVariable Long[] freeCardIds)
{
return toAjax(segchkStoreSelfMgtService.deleteSegchkStoreSelfMgtByFreeCardIds(freeCardIds));
}
}

View File

@ -0,0 +1,131 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.annotation.UnAuth;
import com.ruoyi.segchk.domain.BaseInfoSet;
import com.ruoyi.segchk.domain.SegchkBaseInfoSet;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkSystemSetting;
import com.ruoyi.segchk.service.ISegchkSystemSettingService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author yinzhiying
* @date 2021-10-27
*/
@RestController
@RequestMapping("/segchk/segchk_system_setting")
public class SegchkSystemSettingController extends BaseController
{
@Autowired
private ISegchkSystemSettingService segchkSystemSettingService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_system_setting:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkSystemSetting segchkSystemSetting)
{
startPage();
List<SegchkSystemSetting> list = segchkSystemSettingService.selectSegchkSystemSettingList(segchkSystemSetting);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_system_setting:export')")
@Log(title = "系统设置", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkSystemSetting segchkSystemSetting)
{
List<SegchkSystemSetting> list = segchkSystemSettingService.selectSegchkSystemSettingList(segchkSystemSetting);
ExcelUtil<SegchkSystemSetting> util = new ExcelUtil<SegchkSystemSetting>(SegchkSystemSetting.class);
return util.exportExcel(list, "系统设置数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_system_setting:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(segchkSystemSettingService.selectSegchkSystemSettingById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_system_setting:add')")
@Log(title = "系统设置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkSystemSetting segchkSystemSetting)
{
return toAjax(segchkSystemSettingService.insertSegchkSystemSetting(segchkSystemSetting));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_system_setting:edit')")
@Log(title = "系统设置", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SegchkSystemSetting segchkSystemSetting)
{
return toAjax(segchkSystemSettingService.updateSegchkSystemSetting(segchkSystemSetting));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_system_setting:remove')")
@Log(title = "系统设置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(segchkSystemSettingService.deleteSegchkSystemSettingByIds(ids));
}
/**
*
*/
@UnAuth
@GetMapping("/query")
public AjaxResult query()
{
BaseInfoSet baseInfoSet = segchkSystemSettingService.queryBaseInfoSet();
return AjaxResult.success(baseInfoSet);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_system_setting')")
@Log(title = "系统设置", businessType = BusinessType.UPDATE)
@PutMapping("/update")
public AjaxResult update(@RequestBody BaseInfoSet baseInfoSet)
{
logger.debug("update with --- {}", baseInfoSet.toString());
return toAjax(segchkSystemSettingService.editBaseInfoSet(baseInfoSet, 1));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserAccount;
import com.ruoyi.segchk.service.ISegchkUserAccountService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_account")
public class SegchkUserAccountController extends BaseController
{
@Autowired
private ISegchkUserAccountService segchkUserAccountService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_account:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserAccount segchkUserAccount)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserAccount.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserAccount> list = segchkUserAccountService.selectSegchkUserAccountList(segchkUserAccount);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_account:export')")
@Log(title = "seg用户余额信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserAccount segchkUserAccount)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserAccount.setProviderId(sysUser.getProviderId());
}
List<SegchkUserAccount> list = segchkUserAccountService.selectSegchkUserAccountList(segchkUserAccount);
ExcelUtil<SegchkUserAccount> util = new ExcelUtil<SegchkUserAccount>(SegchkUserAccount.class);
return util.exportExcel(list, "seg用户余额信息数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_account:query')")
@GetMapping(value = "/{accountId}")
public AjaxResult getInfo(@PathVariable("accountId") Long accountId)
{
return AjaxResult.success(segchkUserAccountService.selectSegchkUserAccountByAccountId(accountId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_account:add')")
@Log(title = "seg用户余额信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserAccount segchkUserAccount)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserAccount.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserAccountService.insertSegchkUserAccount(segchkUserAccount));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_account:edit')")
@Log(title = "seg用户余额信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserAccount segchkUserAccount)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserAccount.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserAccountService.updateSegchkUserAccount(segchkUserAccount));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_account:remove')")
@Log(title = "seg用户余额信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{accountIds}")
public AjaxResult remove(@PathVariable Long[] accountIds)
{
return toAjax(segchkUserAccountService.deleteSegchkUserAccountByAccountIds(accountIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserBasicInfo;
import com.ruoyi.segchk.service.ISegchkUserBasicInfoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_basic_info")
public class SegchkUserBasicInfoController extends BaseController
{
@Autowired
private ISegchkUserBasicInfoService segchkUserBasicInfoService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_basic_info:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserBasicInfo segchkUserBasicInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserBasicInfo.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserBasicInfo> list = segchkUserBasicInfoService.selectSegchkUserBasicInfoList(segchkUserBasicInfo);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_basic_info:export')")
@Log(title = "seg用户基本信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserBasicInfo segchkUserBasicInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserBasicInfo.setProviderId(sysUser.getProviderId());
}
List<SegchkUserBasicInfo> list = segchkUserBasicInfoService.selectSegchkUserBasicInfoList(segchkUserBasicInfo);
ExcelUtil<SegchkUserBasicInfo> util = new ExcelUtil<SegchkUserBasicInfo>(SegchkUserBasicInfo.class);
return util.exportExcel(list, "seg用户基本信息数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_basic_info:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return AjaxResult.success(segchkUserBasicInfoService.selectSegchkUserBasicInfoByUserId(userId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_basic_info:add')")
@Log(title = "seg用户基本信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserBasicInfo segchkUserBasicInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserBasicInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserBasicInfoService.insertSegchkUserBasicInfo(segchkUserBasicInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_basic_info:edit')")
@Log(title = "seg用户基本信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserBasicInfo segchkUserBasicInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserBasicInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserBasicInfoService.updateSegchkUserBasicInfo(segchkUserBasicInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_basic_info:remove')")
@Log(title = "seg用户基本信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
return toAjax(segchkUserBasicInfoService.deleteSegchkUserBasicInfoByUserIds(userIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserCash;
import com.ruoyi.segchk.service.ISegchkUserCashService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_cash")
public class SegchkUserCashController extends BaseController
{
@Autowired
private ISegchkUserCashService segchkUserCashService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_cash:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserCash segchkUserCash)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCash.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserCash> list = segchkUserCashService.selectSegchkUserCashList(segchkUserCash);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_cash:export')")
@Log(title = "seg用户提现记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserCash segchkUserCash)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCash.setProviderId(sysUser.getProviderId());
}
List<SegchkUserCash> list = segchkUserCashService.selectSegchkUserCashList(segchkUserCash);
ExcelUtil<SegchkUserCash> util = new ExcelUtil<SegchkUserCash>(SegchkUserCash.class);
return util.exportExcel(list, "seg用户提现记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_cash:query')")
@GetMapping(value = "/{cashId}")
public AjaxResult getInfo(@PathVariable("cashId") Long cashId)
{
return AjaxResult.success(segchkUserCashService.selectSegchkUserCashByCashId(cashId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_cash:add')")
@Log(title = "seg用户提现记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserCash segchkUserCash)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCash.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserCashService.insertSegchkUserCash(segchkUserCash));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_cash:edit')")
@Log(title = "seg用户提现记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserCash segchkUserCash)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCash.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserCashService.updateSegchkUserCash(segchkUserCash));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_cash:remove')")
@Log(title = "seg用户提现记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{cashIds}")
public AjaxResult remove(@PathVariable Long[] cashIds)
{
return toAjax(segchkUserCashService.deleteSegchkUserCashByCashIds(cashIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserCertificationInfo;
import com.ruoyi.segchk.service.ISegchkUserCertificationInfoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_certification_info")
public class SegchkUserCertificationInfoController extends BaseController
{
@Autowired
private ISegchkUserCertificationInfoService segchkUserCertificationInfoService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_certification_info:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserCertificationInfo segchkUserCertificationInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCertificationInfo.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserCertificationInfo> list = segchkUserCertificationInfoService.selectSegchkUserCertificationInfoList(segchkUserCertificationInfo);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_certification_info:export')")
@Log(title = "seg用户实名认证信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserCertificationInfo segchkUserCertificationInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCertificationInfo.setProviderId(sysUser.getProviderId());
}
List<SegchkUserCertificationInfo> list = segchkUserCertificationInfoService.selectSegchkUserCertificationInfoList(segchkUserCertificationInfo);
ExcelUtil<SegchkUserCertificationInfo> util = new ExcelUtil<SegchkUserCertificationInfo>(SegchkUserCertificationInfo.class);
return util.exportExcel(list, "seg用户实名认证信息数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_certification_info:query')")
@GetMapping(value = "/{usercardId}")
public AjaxResult getInfo(@PathVariable("usercardId") Long usercardId)
{
return AjaxResult.success(segchkUserCertificationInfoService.selectSegchkUserCertificationInfoByUsercardId(usercardId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_certification_info:add')")
@Log(title = "seg用户实名认证信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserCertificationInfo segchkUserCertificationInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCertificationInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserCertificationInfoService.insertSegchkUserCertificationInfo(segchkUserCertificationInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_certification_info:edit')")
@Log(title = "seg用户实名认证信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserCertificationInfo segchkUserCertificationInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCertificationInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserCertificationInfoService.updateSegchkUserCertificationInfo(segchkUserCertificationInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_certification_info:remove')")
@Log(title = "seg用户实名认证信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{usercardIds}")
public AjaxResult remove(@PathVariable Long[] usercardIds)
{
return toAjax(segchkUserCertificationInfoService.deleteSegchkUserCertificationInfoByUsercardIds(usercardIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserCharge;
import com.ruoyi.segchk.service.ISegchkUserChargeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_charge")
public class SegchkUserChargeController extends BaseController
{
@Autowired
private ISegchkUserChargeService segchkUserChargeService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_charge:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserCharge segchkUserCharge)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCharge.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserCharge> list = segchkUserChargeService.selectSegchkUserChargeList(segchkUserCharge);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_charge:export')")
@Log(title = "seg用户充值记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserCharge segchkUserCharge)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCharge.setProviderId(sysUser.getProviderId());
}
List<SegchkUserCharge> list = segchkUserChargeService.selectSegchkUserChargeList(segchkUserCharge);
ExcelUtil<SegchkUserCharge> util = new ExcelUtil<SegchkUserCharge>(SegchkUserCharge.class);
return util.exportExcel(list, "seg用户充值记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_charge:query')")
@GetMapping(value = "/{chargeId}")
public AjaxResult getInfo(@PathVariable("chargeId") Long chargeId)
{
return AjaxResult.success(segchkUserChargeService.selectSegchkUserChargeByChargeId(chargeId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_charge:add')")
@Log(title = "seg用户充值记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserCharge segchkUserCharge)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCharge.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserChargeService.insertSegchkUserCharge(segchkUserCharge));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_charge:edit')")
@Log(title = "seg用户充值记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserCharge segchkUserCharge)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCharge.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserChargeService.updateSegchkUserCharge(segchkUserCharge));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_charge:remove')")
@Log(title = "seg用户充值记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{chargeIds}")
public AjaxResult remove(@PathVariable Long[] chargeIds)
{
return toAjax(segchkUserChargeService.deleteSegchkUserChargeByChargeIds(chargeIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserCollect;
import com.ruoyi.segchk.service.ISegchkUserCollectService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_collect")
public class SegchkUserCollectController extends BaseController
{
@Autowired
private ISegchkUserCollectService segchkUserCollectService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_collect:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserCollect segchkUserCollect)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCollect.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserCollect> list = segchkUserCollectService.selectSegchkUserCollectList(segchkUserCollect);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_collect:export')")
@Log(title = "seg用户收藏记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserCollect segchkUserCollect)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCollect.setProviderId(sysUser.getProviderId());
}
List<SegchkUserCollect> list = segchkUserCollectService.selectSegchkUserCollectList(segchkUserCollect);
ExcelUtil<SegchkUserCollect> util = new ExcelUtil<SegchkUserCollect>(SegchkUserCollect.class);
return util.exportExcel(list, "seg用户收藏记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_collect:query')")
@GetMapping(value = "/{collectId}")
public AjaxResult getInfo(@PathVariable("collectId") Long collectId)
{
return AjaxResult.success(segchkUserCollectService.selectSegchkUserCollectByCollectId(collectId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_collect:add')")
@Log(title = "seg用户收藏记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserCollect segchkUserCollect)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCollect.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserCollectService.insertSegchkUserCollect(segchkUserCollect));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_collect:edit')")
@Log(title = "seg用户收藏记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserCollect segchkUserCollect)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserCollect.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserCollectService.updateSegchkUserCollect(segchkUserCollect));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_collect:remove')")
@Log(title = "seg用户收藏记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{collectIds}")
public AjaxResult remove(@PathVariable Long[] collectIds)
{
return toAjax(segchkUserCollectService.deleteSegchkUserCollectByCollectIds(collectIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserExtInfo;
import com.ruoyi.segchk.service.ISegchkUserExtInfoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_ext_info")
public class SegchkUserExtInfoController extends BaseController
{
@Autowired
private ISegchkUserExtInfoService segchkUserExtInfoService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_ext_info:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserExtInfo segchkUserExtInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserExtInfo.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserExtInfo> list = segchkUserExtInfoService.selectSegchkUserExtInfoList(segchkUserExtInfo);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_ext_info:export')")
@Log(title = "seg用户扩展信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserExtInfo segchkUserExtInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserExtInfo.setProviderId(sysUser.getProviderId());
}
List<SegchkUserExtInfo> list = segchkUserExtInfoService.selectSegchkUserExtInfoList(segchkUserExtInfo);
ExcelUtil<SegchkUserExtInfo> util = new ExcelUtil<SegchkUserExtInfo>(SegchkUserExtInfo.class);
return util.exportExcel(list, "seg用户扩展信息数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_ext_info:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return AjaxResult.success(segchkUserExtInfoService.selectSegchkUserExtInfoByUserId(userId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_ext_info:add')")
@Log(title = "seg用户扩展信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserExtInfo segchkUserExtInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserExtInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserExtInfoService.insertSegchkUserExtInfo(segchkUserExtInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_ext_info:edit')")
@Log(title = "seg用户扩展信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserExtInfo segchkUserExtInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserExtInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserExtInfoService.updateSegchkUserExtInfo(segchkUserExtInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_ext_info:remove')")
@Log(title = "seg用户扩展信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
return toAjax(segchkUserExtInfoService.deleteSegchkUserExtInfoByUserIds(userIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserLikego;
import com.ruoyi.segchk.service.ISegchkUserLikegoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_likego")
public class SegchkUserLikegoController extends BaseController
{
@Autowired
private ISegchkUserLikegoService segchkUserLikegoService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_likego:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserLikego segchkUserLikego)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserLikego.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserLikego> list = segchkUserLikegoService.selectSegchkUserLikegoList(segchkUserLikego);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_likego:export')")
@Log(title = "seg用户想去记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserLikego segchkUserLikego)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserLikego.setProviderId(sysUser.getProviderId());
}
List<SegchkUserLikego> list = segchkUserLikegoService.selectSegchkUserLikegoList(segchkUserLikego);
ExcelUtil<SegchkUserLikego> util = new ExcelUtil<SegchkUserLikego>(SegchkUserLikego.class);
return util.exportExcel(list, "seg用户想去记录数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_likego:query')")
@GetMapping(value = "/{likegoId}")
public AjaxResult getInfo(@PathVariable("likegoId") Long likegoId)
{
return AjaxResult.success(segchkUserLikegoService.selectSegchkUserLikegoByLikegoId(likegoId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_likego:add')")
@Log(title = "seg用户想去记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserLikego segchkUserLikego)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserLikego.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserLikegoService.insertSegchkUserLikego(segchkUserLikego));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_likego:edit')")
@Log(title = "seg用户想去记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserLikego segchkUserLikego)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserLikego.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserLikegoService.updateSegchkUserLikego(segchkUserLikego));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_likego:remove')")
@Log(title = "seg用户想去记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{likegoIds}")
public AjaxResult remove(@PathVariable Long[] likegoIds)
{
return toAjax(segchkUserLikegoService.deleteSegchkUserLikegoByLikegoIds(likegoIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserReward;
import com.ruoyi.segchk.service.ISegchkUserRewardService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_reward")
public class SegchkUserRewardController extends BaseController
{
@Autowired
private ISegchkUserRewardService segchkUserRewardService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserReward segchkUserReward)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserReward.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserReward> list = segchkUserRewardService.selectSegchkUserRewardList(segchkUserReward);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward:export')")
@Log(title = "seg用户奖励", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserReward segchkUserReward)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserReward.setProviderId(sysUser.getProviderId());
}
List<SegchkUserReward> list = segchkUserRewardService.selectSegchkUserRewardList(segchkUserReward);
ExcelUtil<SegchkUserReward> util = new ExcelUtil<SegchkUserReward>(SegchkUserReward.class);
return util.exportExcel(list, "seg用户奖励数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward:query')")
@GetMapping(value = "/{rewardId}")
public AjaxResult getInfo(@PathVariable("rewardId") Long rewardId)
{
return AjaxResult.success(segchkUserRewardService.selectSegchkUserRewardByRewardId(rewardId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward:add')")
@Log(title = "seg用户奖励", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserReward segchkUserReward)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserReward.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserRewardService.insertSegchkUserReward(segchkUserReward));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward:edit')")
@Log(title = "seg用户奖励", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserReward segchkUserReward)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserReward.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserRewardService.updateSegchkUserReward(segchkUserReward));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward:remove')")
@Log(title = "seg用户奖励", businessType = BusinessType.DELETE)
@DeleteMapping("/{rewardIds}")
public AjaxResult remove(@PathVariable Long[] rewardIds)
{
return toAjax(segchkUserRewardService.deleteSegchkUserRewardByRewardIds(rewardIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserRewardCtl;
import com.ruoyi.segchk.service.ISegchkUserRewardCtlService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_reward_ctl")
public class SegchkUserRewardCtlController extends BaseController
{
@Autowired
private ISegchkUserRewardCtlService segchkUserRewardCtlService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward_ctl:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserRewardCtl segchkUserRewardCtl)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserRewardCtl.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserRewardCtl> list = segchkUserRewardCtlService.selectSegchkUserRewardCtlList(segchkUserRewardCtl);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward_ctl:export')")
@Log(title = "seg会员推荐控制", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserRewardCtl segchkUserRewardCtl)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserRewardCtl.setProviderId(sysUser.getProviderId());
}
List<SegchkUserRewardCtl> list = segchkUserRewardCtlService.selectSegchkUserRewardCtlList(segchkUserRewardCtl);
ExcelUtil<SegchkUserRewardCtl> util = new ExcelUtil<SegchkUserRewardCtl>(SegchkUserRewardCtl.class);
return util.exportExcel(list, "seg会员推荐控制数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward_ctl:query')")
@GetMapping(value = "/{rewardCtlId}")
public AjaxResult getInfo(@PathVariable("rewardCtlId") Integer rewardCtlId)
{
return AjaxResult.success(segchkUserRewardCtlService.selectSegchkUserRewardCtlByRewardCtlId(rewardCtlId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward_ctl:add')")
@Log(title = "seg会员推荐控制", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserRewardCtl segchkUserRewardCtl)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserRewardCtl.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserRewardCtlService.insertSegchkUserRewardCtl(segchkUserRewardCtl));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward_ctl:edit')")
@Log(title = "seg会员推荐控制", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserRewardCtl segchkUserRewardCtl)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserRewardCtl.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserRewardCtlService.updateSegchkUserRewardCtl(segchkUserRewardCtl));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_reward_ctl:remove')")
@Log(title = "seg会员推荐控制", businessType = BusinessType.DELETE)
@DeleteMapping("/{rewardCtlIds}")
public AjaxResult remove(@PathVariable Integer[] rewardCtlIds)
{
return toAjax(segchkUserRewardCtlService.deleteSegchkUserRewardCtlByRewardCtlIds(rewardCtlIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserSecurity;
import com.ruoyi.segchk.service.ISegchkUserSecurityService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_security")
public class SegchkUserSecurityController extends BaseController
{
@Autowired
private ISegchkUserSecurityService segchkUserSecurityService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_security:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserSecurity segchkUserSecurity)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserSecurity.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserSecurity> list = segchkUserSecurityService.selectSegchkUserSecurityList(segchkUserSecurity);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_security:export')")
@Log(title = "seg用户密码", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserSecurity segchkUserSecurity)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserSecurity.setProviderId(sysUser.getProviderId());
}
List<SegchkUserSecurity> list = segchkUserSecurityService.selectSegchkUserSecurityList(segchkUserSecurity);
ExcelUtil<SegchkUserSecurity> util = new ExcelUtil<SegchkUserSecurity>(SegchkUserSecurity.class);
return util.exportExcel(list, "seg用户密码数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_security:query')")
@GetMapping(value = "/{pwdId}")
public AjaxResult getInfo(@PathVariable("pwdId") Long pwdId)
{
return AjaxResult.success(segchkUserSecurityService.selectSegchkUserSecurityByPwdId(pwdId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_security:add')")
@Log(title = "seg用户密码", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserSecurity segchkUserSecurity)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserSecurity.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserSecurityService.insertSegchkUserSecurity(segchkUserSecurity));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_security:edit')")
@Log(title = "seg用户密码", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserSecurity segchkUserSecurity)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserSecurity.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserSecurityService.updateSegchkUserSecurity(segchkUserSecurity));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_security:remove')")
@Log(title = "seg用户密码", businessType = BusinessType.DELETE)
@DeleteMapping("/{pwdIds}")
public AjaxResult remove(@PathVariable Long[] pwdIds)
{
return toAjax(segchkUserSecurityService.deleteSegchkUserSecurityByPwdIds(pwdIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserVip;
import com.ruoyi.segchk.service.ISegchkUserVipService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_vip")
public class SegchkUserVipController extends BaseController
{
@Autowired
private ISegchkUserVipService segchkUserVipService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_vip:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserVip segchkUserVip)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserVip.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserVip> list = segchkUserVipService.selectSegchkUserVipList(segchkUserVip);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_vip:export')")
@Log(title = "seg会员卡", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserVip segchkUserVip)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserVip.setProviderId(sysUser.getProviderId());
}
List<SegchkUserVip> list = segchkUserVipService.selectSegchkUserVipList(segchkUserVip);
ExcelUtil<SegchkUserVip> util = new ExcelUtil<SegchkUserVip>(SegchkUserVip.class);
return util.exportExcel(list, "seg会员卡数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_vip:query')")
@GetMapping(value = "/{cardId}")
public AjaxResult getInfo(@PathVariable("cardId") Long cardId)
{
return AjaxResult.success(segchkUserVipService.selectSegchkUserVipByCardId(cardId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_vip:add')")
@Log(title = "seg会员卡", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserVip segchkUserVip)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserVip.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserVipService.insertSegchkUserVip(segchkUserVip));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_vip:edit')")
@Log(title = "seg会员卡", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserVip segchkUserVip)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserVip.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserVipService.updateSegchkUserVip(segchkUserVip));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_vip:remove')")
@Log(title = "seg会员卡", businessType = BusinessType.DELETE)
@DeleteMapping("/{cardIds}")
public AjaxResult remove(@PathVariable Long[] cardIds)
{
return toAjax(segchkUserVipService.deleteSegchkUserVipByCardIds(cardIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkUserWechat;
import com.ruoyi.segchk.service.ISegchkUserWechatService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_user_wechat")
public class SegchkUserWechatController extends BaseController
{
@Autowired
private ISegchkUserWechatService segchkUserWechatService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_wechat:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkUserWechat segchkUserWechat)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserWechat.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkUserWechat> list = segchkUserWechatService.selectSegchkUserWechatList(segchkUserWechat);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_wechat:export')")
@Log(title = "seg用户微信信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkUserWechat segchkUserWechat)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserWechat.setProviderId(sysUser.getProviderId());
}
List<SegchkUserWechat> list = segchkUserWechatService.selectSegchkUserWechatList(segchkUserWechat);
ExcelUtil<SegchkUserWechat> util = new ExcelUtil<SegchkUserWechat>(SegchkUserWechat.class);
return util.exportExcel(list, "seg用户微信信息数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_wechat:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return AjaxResult.success(segchkUserWechatService.selectSegchkUserWechatByUserId(userId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_wechat:add')")
@Log(title = "seg用户微信信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkUserWechat segchkUserWechat)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserWechat.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserWechatService.insertSegchkUserWechat(segchkUserWechat));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_wechat:edit')")
@Log(title = "seg用户微信信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkUserWechat segchkUserWechat)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkUserWechat.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkUserWechatService.updateSegchkUserWechat(segchkUserWechat));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_user_wechat:remove')")
@Log(title = "seg用户微信信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
return toAjax(segchkUserWechatService.deleteSegchkUserWechatByUserIds(userIds));
}
}

View File

@ -0,0 +1,141 @@
package com.ruoyi.web.controller.segchk;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.segchk.domain.SegchkVipSetInfo;
import com.ruoyi.segchk.service.ISegchkVipSetInfoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* segController
*
* @author yinzhiying
* @date 2021-08-23
*/
@RestController
@RequestMapping("/segchk/segchk_vip_set_info")
public class SegchkVipSetInfoController extends BaseController
{
@Autowired
private ISegchkVipSetInfoService segchkVipSetInfoService;
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_vip_set_info:list')")
@GetMapping("/list")
public TableDataInfo list(SegchkVipSetInfo segchkVipSetInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkVipSetInfo.setProviderId(sysUser.getProviderId());
}
startPage();
List<SegchkVipSetInfo> list = segchkVipSetInfoService.selectSegchkVipSetInfoList(segchkVipSetInfo);
return getDataTable(list);
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_vip_set_info:export')")
@Log(title = "seg会员卡设置", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SegchkVipSetInfo segchkVipSetInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkVipSetInfo.setProviderId(sysUser.getProviderId());
}
List<SegchkVipSetInfo> list = segchkVipSetInfoService.selectSegchkVipSetInfoList(segchkVipSetInfo);
ExcelUtil<SegchkVipSetInfo> util = new ExcelUtil<SegchkVipSetInfo>(SegchkVipSetInfo.class);
return util.exportExcel(list, "seg会员卡设置数据");
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_vip_set_info:query')")
@GetMapping(value = "/{modeId}")
public AjaxResult getInfo(@PathVariable("modeId") Integer modeId)
{
return AjaxResult.success(segchkVipSetInfoService.selectSegchkVipSetInfoByModeId(modeId));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_vip_set_info:add')")
@Log(title = "seg会员卡设置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SegchkVipSetInfo segchkVipSetInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkVipSetInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkVipSetInfoService.insertSegchkVipSetInfo(segchkVipSetInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_vip_set_info:edit')")
@Log(title = "seg会员卡设置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SegchkVipSetInfo segchkVipSetInfo)
{
// 获取当前登录用户信息
SysUser sysUser = getLoginUser().getUser();
if(sysUser.getUserId() == 1){
// 说明是超级管理员
;
}
else{
segchkVipSetInfo.setProviderId(sysUser.getProviderId());
}
return toAjax(segchkVipSetInfoService.updateSegchkVipSetInfo(segchkVipSetInfo));
}
/**
* seg
*/
@PreAuthorize("@ss.hasPermi('segchk:segchk_vip_set_info:remove')")
@Log(title = "seg会员卡设置", businessType = BusinessType.DELETE)
@DeleteMapping("/{modeIds}")
public AjaxResult remove(@PathVariable Integer[] modeIds)
{
return toAjax(segchkVipSetInfoService.deleteSegchkVipSetInfoByModeIds(modeIds));
}
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@ -12,16 +12,16 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.system.domain.SysConfig;
import com.ruoyi.project.system.service.ISysConfigService;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.service.ISysConfigService;
/**
*
@ -82,13 +82,14 @@ public class SysConfigController extends BaseController
@PreAuthorize("@ss.hasPermi('system:config:add')")
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping
@RepeatSubmit
public AjaxResult add(@Validated @RequestBody SysConfig config)
{
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
{
return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setCreateBy(SecurityUtils.getUsername());
config.setCreateBy(getUsername());
return toAjax(configService.insertConfig(config));
}
@ -104,7 +105,7 @@ public class SysConfigController extends BaseController
{
return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setUpdateBy(SecurityUtils.getUsername());
config.setUpdateBy(getUsername());
return toAjax(configService.updateConfig(config));
}
@ -116,18 +117,19 @@ public class SysConfigController extends BaseController
@DeleteMapping("/{configIds}")
public AjaxResult remove(@PathVariable Long[] configIds)
{
return toAjax(configService.deleteConfigByIds(configIds));
configService.deleteConfigByIds(configIds);
return success();
}
/**
*
*
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
@DeleteMapping("/clearCache")
public AjaxResult clearCache()
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
configService.clearCache();
configService.resetConfigCache();
return AjaxResult.success();
}
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.util.Iterator;
import java.util.List;
@ -14,15 +14,14 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.domain.SysDept;
import com.ruoyi.project.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysDeptService;
/**
*
@ -113,7 +112,7 @@ public class SysDeptController extends BaseController
{
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
dept.setCreateBy(SecurityUtils.getUsername());
dept.setCreateBy(getUsername());
return toAjax(deptService.insertDept(dept));
}
@ -138,7 +137,7 @@ public class SysDeptController extends BaseController
{
return AjaxResult.error("该部门包含未停用的子部门!");
}
dept.setUpdateBy(SecurityUtils.getUsername());
dept.setUpdateBy(getUsername());
return toAjax(deptService.updateDept(dept));
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@ -12,16 +13,16 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.system.domain.SysDictData;
import com.ruoyi.project.system.service.ISysDictDataService;
import com.ruoyi.project.system.service.ISysDictTypeService;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysDictTypeService;
/**
*
@ -73,7 +74,12 @@ public class SysDictDataController extends BaseController
@GetMapping(value = "/type/{dictType}")
public AjaxResult dictType(@PathVariable String dictType)
{
return AjaxResult.success(dictTypeService.selectDictDataByType(dictType));
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data))
{
data = new ArrayList<SysDictData>();
}
return AjaxResult.success(data);
}
/**
@ -84,7 +90,7 @@ public class SysDictDataController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictData dict)
{
dict.setCreateBy(SecurityUtils.getUsername());
dict.setCreateBy(getUsername());
return toAjax(dictDataService.insertDictData(dict));
}
@ -96,7 +102,7 @@ public class SysDictDataController extends BaseController
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
{
dict.setUpdateBy(SecurityUtils.getUsername());
dict.setUpdateBy(getUsername());
return toAjax(dictDataService.updateDictData(dict));
}
@ -108,6 +114,7 @@ public class SysDictDataController extends BaseController
@DeleteMapping("/{dictCodes}")
public AjaxResult remove(@PathVariable Long[] dictCodes)
{
return toAjax(dictDataService.deleteDictDataByIds(dictCodes));
dictDataService.deleteDictDataByIds(dictCodes);
return success();
}
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@ -12,16 +12,15 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.system.domain.SysDictType;
import com.ruoyi.project.system.service.ISysDictTypeService;
import com.ruoyi.system.service.ISysDictTypeService;
/**
*
@ -76,7 +75,7 @@ public class SysDictTypeController extends BaseController
{
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setCreateBy(SecurityUtils.getUsername());
dict.setCreateBy(getUsername());
return toAjax(dictTypeService.insertDictType(dict));
}
@ -92,7 +91,7 @@ public class SysDictTypeController extends BaseController
{
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setUpdateBy(SecurityUtils.getUsername());
dict.setUpdateBy(getUsername());
return toAjax(dictTypeService.updateDictType(dict));
}
@ -104,18 +103,19 @@ public class SysDictTypeController extends BaseController
@DeleteMapping("/{dictIds}")
public AjaxResult remove(@PathVariable Long[] dictIds)
{
return toAjax(dictTypeService.deleteDictTypeByIds(dictIds));
dictTypeService.deleteDictTypeByIds(dictIds);
return success();
}
/**
*
*
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
@DeleteMapping("/clearCache")
public AjaxResult clearCache()
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
dictTypeService.clearCache();
dictTypeService.resetDictCache();
return AjaxResult.success();
}

View File

@ -0,0 +1,29 @@
package com.ruoyi.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.utils.StringUtils;
/**
*
*
* @author ruoyi
*/
@RestController
public class SysIndexController
{
/** 系统基础配置 */
@Autowired
private RuoYiConfig ruoyiConfig;
/**
* 访
*/
@RequestMapping("/")
public String index()
{
return StringUtils.format("欢迎使用{}后台管理框架当前版本v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
}
}

View File

@ -1,23 +1,25 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import com.ruoyi.security.web.service.SysLoginService;
import com.ruoyi.security.web.service.SysPermissionService;
import com.ruoyi.segchk.service.ISegchkProviderMgtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.framework.security.LoginBody;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.security.service.SysLoginService;
import com.ruoyi.framework.security.service.SysPermissionService;
import com.ruoyi.framework.security.service.TokenService;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.domain.SysMenu;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.service.ISysMenuService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysMenuService;
/**
*
@ -36,16 +38,14 @@ public class SysLoginController
@Autowired
private SysPermissionService permissionService;
@Autowired
private TokenService tokenService;
@Autowired
private ISegchkProviderMgtService segchkProviderMgtService;
/**
*
*
* @param username
* @param password
* @param captcha
* @param uuid
* @param loginBody
* @return
*/
@PostMapping("/login")
@ -56,6 +56,7 @@ public class SysLoginController
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
loginBody.getUuid());
ajax.put(Constants.TOKEN, token);
System.out.println("login token is : " + token);
return ajax;
}
@ -67,16 +68,20 @@ public class SysLoginController
@GetMapping("getInfo")
public AjaxResult getInfo()
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
SysUser user = loginUser.getUser();
SysUser user = SecurityUtils.getLoginUser().getUser();
Long providerId = segchkProviderMgtService.getProviderIdByPhoneNo(user.getPhonenumber());
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
user.setProviderId(providerId);
// 权限集合
Set<String> permissions = permissionService.getMenuPermission(user);
AjaxResult ajax = AjaxResult.success();
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
System.out.println("getInfo with " + user.toString());
System.out.println("getInfo with " + String.join(",", roles));
System.out.println("getInfo with " + String.join(",", permissions));
return ajax;
}
@ -88,10 +93,10 @@ public class SysLoginController
@GetMapping("getRouters")
public AjaxResult getRouters()
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
// 用户信息
SysUser user = loginUser.getUser();
List<SysMenu> menus = menuService.selectMenuTreeByUserId(user.getUserId());
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
List<String> collect = menus.parallelStream().map(v -> v.toString()).collect(Collectors.toList());
System.out.println(String.format("getRouters with {}---{}", userId, String.join(",", collect)));
return AjaxResult.success(menuService.buildMenus(menus));
}
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@ -12,19 +12,14 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.security.service.TokenService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.domain.SysMenu;
import com.ruoyi.project.system.service.ISysMenuService;
import com.ruoyi.system.service.ISysMenuService;
/**
*
@ -38,9 +33,6 @@ public class SysMenuController extends BaseController
@Autowired
private ISysMenuService menuService;
@Autowired
private TokenService tokenService;
/**
*
*/
@ -48,9 +40,7 @@ public class SysMenuController extends BaseController
@GetMapping("/list")
public AjaxResult list(SysMenu menu)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
Long userId = loginUser.getUser().getUserId();
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return AjaxResult.success(menus);
}
@ -70,9 +60,7 @@ public class SysMenuController extends BaseController
@GetMapping("/treeselect")
public AjaxResult treeselect(SysMenu menu)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
Long userId = loginUser.getUser().getUserId();
List<SysMenu> menus = menuService.selectMenuList(menu, userId);
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return AjaxResult.success(menuService.buildMenuTreeSelect(menus));
}
@ -82,8 +70,7 @@ public class SysMenuController extends BaseController
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
List<SysMenu> menus = menuService.selectMenuList(loginUser.getUser().getUserId());
List<SysMenu> menus = menuService.selectMenuList(getUserId());
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
@ -102,12 +89,11 @@ public class SysMenuController extends BaseController
{
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
&& !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
menu.setCreateBy(SecurityUtils.getUsername());
menu.setCreateBy(getUsername());
return toAjax(menuService.insertMenu(menu));
}
@ -123,12 +109,15 @@ public class SysMenuController extends BaseController
{
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
&& !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
menu.setUpdateBy(SecurityUtils.getUsername());
else if (menu.getMenuId().equals(menu.getParentId()))
{
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
}
menu.setUpdateBy(getUsername());
return toAjax(menuService.updateMenu(menu));
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@ -12,14 +12,13 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.system.domain.SysNotice;
import com.ruoyi.project.system.service.ISysNoticeService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.service.ISysNoticeService;
/**
*
@ -63,7 +62,7 @@ public class SysNoticeController extends BaseController
@PostMapping
public AjaxResult add(@Validated @RequestBody SysNotice notice)
{
notice.setCreateBy(SecurityUtils.getUsername());
notice.setCreateBy(getUsername());
return toAjax(noticeService.insertNotice(notice));
}
@ -75,7 +74,7 @@ public class SysNoticeController extends BaseController
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
{
notice.setUpdateBy(SecurityUtils.getUsername());
notice.setUpdateBy(getUsername());
return toAjax(noticeService.updateNotice(notice));
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@ -12,16 +12,15 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.system.domain.SysPost;
import com.ruoyi.project.system.service.ISysPostService;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.service.ISysPostService;
/**
*
@ -48,7 +47,7 @@ public class SysPostController extends BaseController
}
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:config:export')")
@PreAuthorize("@ss.hasPermi('system:post:export')")
@GetMapping("/export")
public AjaxResult export(SysPost post)
{
@ -83,7 +82,7 @@ public class SysPostController extends BaseController
{
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setCreateBy(SecurityUtils.getUsername());
post.setCreateBy(getUsername());
return toAjax(postService.insertPost(post));
}
@ -103,7 +102,7 @@ public class SysPostController extends BaseController
{
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setUpdateBy(SecurityUtils.getUsername());
post.setUpdateBy(getUsername());
return toAjax(postService.updatePost(post));
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.io.IOException;
import org.springframework.beans.factory.annotation.Autowired;
@ -10,18 +10,19 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.config.RuoYiConfig;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.security.service.TokenService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.service.ISysUserService;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysUserService;
/**
*
@ -44,7 +45,7 @@ public class SysProfileController extends BaseController
@GetMapping
public AjaxResult profile()
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
AjaxResult ajax = AjaxResult.success(user);
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
@ -59,14 +60,27 @@ public class SysProfileController extends BaseController
@PutMapping
public AjaxResult updateProfile(@RequestBody SysUser user)
{
if (StringUtils.isNotEmpty(user.getPhonenumber())
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
{
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
}
if (StringUtils.isNotEmpty(user.getEmail())
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
{
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
LoginUser loginUser = getLoginUser();
SysUser sysUser = loginUser.getUser();
user.setUserId(sysUser.getUserId());
user.setPassword(null);
if (userService.updateUserProfile(user) > 0)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
// 更新缓存用户信息
loginUser.getUser().setNickName(user.getNickName());
loginUser.getUser().setPhonenumber(user.getPhonenumber());
loginUser.getUser().setEmail(user.getEmail());
loginUser.getUser().setSex(user.getSex());
sysUser.setNickName(user.getNickName());
sysUser.setPhonenumber(user.getPhonenumber());
sysUser.setEmail(user.getEmail());
sysUser.setSex(user.getSex());
tokenService.setLoginUser(loginUser);
return AjaxResult.success();
}
@ -80,7 +94,7 @@ public class SysProfileController extends BaseController
@PutMapping("/updatePwd")
public AjaxResult updatePwd(String oldPassword, String newPassword)
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
LoginUser loginUser = getLoginUser();
String userName = loginUser.getUsername();
String password = loginUser.getPassword();
if (!SecurityUtils.matchesPassword(oldPassword, password))
@ -110,7 +124,7 @@ public class SysProfileController extends BaseController
{
if (!file.isEmpty())
{
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
LoginUser loginUser = getLoginUser();
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file);
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
{

View File

@ -0,0 +1,38 @@
package com.ruoyi.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.RegisterBody;
import com.ruoyi.framework.web.service.SysRegisterService;
import com.ruoyi.system.service.ISysConfigService;
/**
*
*
* @author ruoyi
*/
@RestController
public class SysRegisterController extends BaseController
{
@Autowired
private SysRegisterService registerService;
@Autowired
private ISysConfigService configService;
@PostMapping("/register")
public AjaxResult register(@RequestBody RegisterBody user)
{
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
{
return error("当前系统没有开启注册功能!");
}
String msg = registerService.register(user);
return StringUtils.isEmpty(msg) ? success() : error(msg);
}
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.util.List;
import com.ruoyi.security.web.service.SysPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
@ -12,16 +14,21 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.system.domain.SysRole;
import com.ruoyi.project.system.service.ISysRoleService;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
/**
*
@ -35,6 +42,15 @@ public class SysRoleController extends BaseController
@Autowired
private ISysRoleService roleService;
@Autowired
private TokenService tokenService;
@Autowired
private SysPermissionService permissionService;
@Autowired
private ISysUserService userService;
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/list")
public TableDataInfo list(SysRole role)
@ -80,7 +96,7 @@ public class SysRoleController extends BaseController
{
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setCreateBy(SecurityUtils.getUsername());
role.setCreateBy(getUsername());
return toAjax(roleService.insertRole(role));
}
@ -102,8 +118,21 @@ public class SysRoleController extends BaseController
{
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setUpdateBy(SecurityUtils.getUsername());
return toAjax(roleService.updateRole(role));
role.setUpdateBy(getUsername());
if (roleService.updateRole(role) > 0)
{
// 更新缓存用户权限
LoginUser loginUser = getLoginUser();
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
{
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
tokenService.setLoginUser(loginUser);
}
return AjaxResult.success();
}
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
}
/**
@ -127,7 +156,7 @@ public class SysRoleController extends BaseController
public AjaxResult changeStatus(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
role.setUpdateBy(SecurityUtils.getUsername());
role.setUpdateBy(getUsername());
return toAjax(roleService.updateRoleStatus(role));
}
@ -151,4 +180,61 @@ public class SysRoleController extends BaseController
{
return AjaxResult.success(roleService.selectRoleAll());
}
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/allocatedList")
public TableDataInfo allocatedList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectAllocatedList(user);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/unallocatedList")
public TableDataInfo unallocatedList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUnallocatedList(user);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/cancel")
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
{
return toAjax(roleService.deleteAuthUser(userRole));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/cancelAll")
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
{
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/selectAll")
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
{
return toAjax(roleService.insertAuthUsers(roleId, userIds));
}
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.project.system.controller;
package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
@ -13,22 +15,20 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.security.service.TokenService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.service.ISysPostService;
import com.ruoyi.project.system.service.ISysRoleService;
import com.ruoyi.project.system.service.ISysUserService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
/**
*
@ -48,9 +48,6 @@ public class SysUserController extends BaseController
@Autowired
private ISysPostService postService;
@Autowired
private TokenService tokenService;
/**
*
*/
@ -80,8 +77,7 @@ public class SysUserController extends BaseController
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
List<SysUser> userList = util.importExcel(file.getInputStream());
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
String operName = loginUser.getUsername();
String operName = getUsername();
String message = userService.importUser(userList, updateSupport, operName);
return AjaxResult.success(message);
}
@ -101,7 +97,8 @@ public class SysUserController extends BaseController
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
{
AjaxResult ajax = AjaxResult.success();
ajax.put("roles", roleService.selectRoleAll());
List<SysRole> roles = roleService.selectRoleAll();
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
ajax.put("posts", postService.selectPostAll());
if (StringUtils.isNotNull(userId))
{
@ -124,15 +121,17 @@ public class SysUserController extends BaseController
{
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
else if (StringUtils.isNotEmpty(user.getPhonenumber())
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
{
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
else if (StringUtils.isNotEmpty(user.getEmail())
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
{
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setCreateBy(SecurityUtils.getUsername());
user.setCreateBy(getUsername());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
return toAjax(userService.insertUser(user));
}
@ -146,15 +145,17 @@ public class SysUserController extends BaseController
public AjaxResult edit(@Validated @RequestBody SysUser user)
{
userService.checkUserAllowed(user);
if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
if (StringUtils.isNotEmpty(user.getPhonenumber())
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
{
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
}
else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
else if (StringUtils.isNotEmpty(user.getEmail())
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
{
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setUpdateBy(SecurityUtils.getUsername());
user.setUpdateBy(getUsername());
return toAjax(userService.updateUser(user));
}
@ -166,20 +167,24 @@ public class SysUserController extends BaseController
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
if (ArrayUtils.contains(userIds, getUserId()))
{
return error("当前用户不能删除");
}
return toAjax(userService.deleteUserByIds(userIds));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/resetPwd")
public AjaxResult resetPwd(@RequestBody SysUser user)
{
userService.checkUserAllowed(user);
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
user.setUpdateBy(SecurityUtils.getUsername());
user.setUpdateBy(getUsername());
return toAjax(userService.resetPwd(user));
}
@ -192,7 +197,34 @@ public class SysUserController extends BaseController
public AjaxResult changeStatus(@RequestBody SysUser user)
{
userService.checkUserAllowed(user);
user.setUpdateBy(SecurityUtils.getUsername());
user.setUpdateBy(getUsername());
return toAjax(userService.updateUserStatus(user));
}
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping("/authRole/{userId}")
public AjaxResult authRole(@PathVariable("userId") Long userId)
{
AjaxResult ajax = AjaxResult.success();
SysUser user = userService.selectUserById(userId);
List<SysRole> roles = roleService.selectRolesByUserId(userId);
ajax.put("user", user);
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
return ajax;
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.GRANT)
@PutMapping("/authRole")
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
{
userService.insertUserAuth(userId, roleIds);
return success();
}
}

Some files were not shown because too many files have changed in this diff Show More