init
This commit is contained in:
18
.editorconfig
Normal file
18
.editorconfig
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# http://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# 空格替代Tab缩进在各种编辑工具下效果一致
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.{json,yml,yaml}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
insert_final_newline = false
|
||||||
|
trim_trailing_whitespace = false
|
||||||
46
.gitignore
vendored
Normal file
46
.gitignore
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
######################################################################
|
||||||
|
# Build Tools
|
||||||
|
|
||||||
|
.gradle
|
||||||
|
/build/
|
||||||
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# IDE
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### JRebel ###
|
||||||
|
rebel.xml
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
nbproject/private/
|
||||||
|
build/*
|
||||||
|
nbbuild/
|
||||||
|
nbdist/
|
||||||
|
.nb-gradle/
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# Others
|
||||||
|
*.log
|
||||||
|
*.xml.versionsBackup
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
!*/build/*.java
|
||||||
|
!*/build/*.html
|
||||||
|
!*/build/*.xml
|
||||||
12
.run/ruoyi-monitor-admin.run.xml
Normal file
12
.run/ruoyi-monitor-admin.run.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="ruoyi-monitor-admin" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
|
||||||
|
<deployment type="dockerfile">
|
||||||
|
<settings>
|
||||||
|
<option name="imageTag" value="ruoyi/ruoyi-monitor-admin:4.8.1" />
|
||||||
|
<option name="buildOnly" value="true" />
|
||||||
|
<option name="sourceFilePath" value="ruoyi-extend/ruoyi-monitor-admin/Dockerfile" />
|
||||||
|
</settings>
|
||||||
|
</deployment>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
12
.run/ruoyi-server.run.xml
Normal file
12
.run/ruoyi-server.run.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="ruoyi-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
|
||||||
|
<deployment type="dockerfile">
|
||||||
|
<settings>
|
||||||
|
<option name="imageTag" value="ruoyi/ruoyi-server:4.8.1" />
|
||||||
|
<option name="buildOnly" value="true" />
|
||||||
|
<option name="sourceFilePath" value="ruoyi-admin/Dockerfile" />
|
||||||
|
</settings>
|
||||||
|
</deployment>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
12
.run/ruoyi-xxl-job-admin.run.xml
Normal file
12
.run/ruoyi-xxl-job-admin.run.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="ruoyi-xxl-job-admin" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
|
||||||
|
<deployment type="dockerfile">
|
||||||
|
<settings>
|
||||||
|
<option name="imageTag" value="ruoyi/ruoyi-xxl-job-admin:4.8.1" />
|
||||||
|
<option name="buildOnly" value="true" />
|
||||||
|
<option name="sourceFilePath" value="ruoyi-extend/ruoyi-xxl-job-admin/Dockerfile" />
|
||||||
|
</settings>
|
||||||
|
</deployment>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
70
.vscode/launch.json
vendored
Normal file
70
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
{
|
||||||
|
// 使用 IntelliSense 了解相关属性。
|
||||||
|
// 悬停以查看现有属性的描述。
|
||||||
|
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "Current File",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "${file}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "CTAPIApplication",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "com.ruoyi.CTAPIApplication",
|
||||||
|
"projectName": "api"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "EncryptDemo",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "com.ruoyi.api.EncryptDemo",
|
||||||
|
"projectName": "api"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "APIController",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "com.ruoyi.api.controller.APIController",
|
||||||
|
"projectName": "api"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "CTServiceImpl",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "com.ruoyi.ct.service.impl.CTServiceImpl",
|
||||||
|
"projectName": "ct"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "RuoYiApplication",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "com.ruoyi.RuoYiApplication",
|
||||||
|
"projectName": "ruoyi-admin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "CTUtils",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "com.ruoyi.common.utils.CTUtils",
|
||||||
|
"projectName": "ruoyi-common"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "MonitorAdminApplication",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "com.ruoyi.monitor.admin.MonitorAdminApplication",
|
||||||
|
"projectName": "ruoyi-monitor-admin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "XxlJobAdminApplication",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "com.xxl.job.admin.XxlJobAdminApplication",
|
||||||
|
"projectName": "ruoyi-xxl-job-admin"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"java.compile.nullAnalysis.mode": "automatic"
|
||||||
|
}
|
||||||
20
LICENSE
Normal file
20
LICENSE
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2019 RuoYi-Vue-Plus
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
163
README.md
Normal file
163
README.md
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
<img src="https://foruda.gitee.com/images/1679673773341074847/178e8451_1766278.png" width="50%" height="50%">
|
||||||
|
<div style="height: 10px; clear: both;"></div>
|
||||||
|
|
||||||
|
- - -
|
||||||
|
|
||||||
|
## 平台简介
|
||||||
|
|
||||||
|
[](https://gitee.com/dromara/RuoYi-Vue-Plus)
|
||||||
|
[](https://github.com/dromara/RuoYi-Vue-Plus)
|
||||||
|
[](https://gitee.com/dromara/RuoYi-Vue-Plus/blob/master/LICENSE)
|
||||||
|
[](https://www.jetbrains.com/?from=RuoYi-Vue-Plus)
|
||||||
|
<br>
|
||||||
|
[](https://gitee.com/dromara/RuoYi-Vue-Plus)
|
||||||
|
[]()
|
||||||
|
[]()
|
||||||
|
[]()
|
||||||
|
|
||||||
|
> RuoYi-Vue-Plus 是重写 RuoYi-Vue 针对 `分布式集群` 场景全方位升级(不兼容原框架)
|
||||||
|
|
||||||
|
> 项目代码、文档 均开源免费可商用 遵循开源协议在项目中保留开源协议文件即可<br>
|
||||||
|
活到老写到老 为兴趣而开源 为学习而开源 为让大家真正可以学到技术而开源
|
||||||
|
|
||||||
|
> 系统演示: [传送门](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=4836388&doc_id=1469725)
|
||||||
|
|
||||||
|
# 本框架与RuoYi的功能差异
|
||||||
|
|
||||||
|
| 功能 | 本框架 | RuoYi |
|
||||||
|
|-------------|-------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
|
||||||
|
| 前端项目 | 基于vue3-element-admin开源项目重写<br/>Vue3 + TS + ElementPlus | 基于Vue2/Vue3 + JS |
|
||||||
|
| 后端项目结构 | 采用插件化 + 扩展包形式 结构解耦 易于扩展 | 模块相互注入耦合严重难以扩展 |
|
||||||
|
| 后端代码风格 | 严格遵守Alibaba规范与项目统一配置的代码格式化 | 代码书写与常规结构不同阅读障碍大 |
|
||||||
|
| Web容器 | 采用 Undertow 基于 XNIO 的高性能容器 | 采用 Tomcat |
|
||||||
|
| 权限认证 | 采用 Sa-Token、Jwt 静态使用功能齐全 低耦合 高扩展 | Spring Security 配置繁琐扩展性极差 |
|
||||||
|
| 权限注解 | 采用 Sa-Token 支持注解 登录校验、角色校验、权限校验、二级认证校验、HttpBasic校验、忽略校验<br/>角色与权限校验支持多种条件 如 `AND` `OR` 或 `权限 OR 角色` 等复杂表达式 | 只支持是否存在匹配 |
|
||||||
|
| 关系数据库支持 | 原生支持 MySQL、Oracle、PostgreSQL、SQLServer<br/>可同时使用异构切换 | 支持 Mysql、Oracle 不支持同时使用、不支持异构切换 |
|
||||||
|
| 缓存数据库 | 支持 Redis 5-7 支持大部分新功能特性 如 分布式限流、分布式队列 | Redis 简单 get set 支持 |
|
||||||
|
| Redis客户端 | 采用 Redisson Redis官方推荐 基于Netty的客户端工具<br/>支持Redis 90%以上的命令 底层优化规避很多不正确的用法 例如: keys被转换为scan<br/>支持单机、哨兵、单主集群、多主集群等模式 | Lettuce + RedisTemplate 支持模式少 工具使用繁琐<br/>连接池采用 common-pool Bug多经常性出问题 |
|
||||||
|
| 缓存注解 | 采用 Spring-Cache 注解 对其扩展了实现支持了更多功能<br/>例如 过期时间 最大空闲时间 组最大长度等 只需一个注解即可完成数据自动缓存 | 需手动编写Redis代码逻辑 |
|
||||||
|
| ORM框架 | 采用 Mybatis-Plus 基于对象几乎不用写SQL全java操作 功能强大插件众多<br/>例如多租户插件 分页插件 乐观锁插件等等 | 采用 Mybatis 基于XML需要手写SQL |
|
||||||
|
| SQL监控 | 采用 p6spy 可输出完整SQL与执行时间监控 | log输出 需手动拼接sql与参数无法快速查看调试问题 |
|
||||||
|
| 数据分页 | 采用 Mybatis-Plus 分页插件<br/>框架对其进行了扩展 对象化分页对象 支持多种方式传参 支持前端多排序 复杂排序 | 采用 PageHelper 仅支持单查询分页 参数只能从param传 只能单排序 功能扩展性差 体验不好 |
|
||||||
|
| 数据权限 | 采用 Mybatis-Plus 插件 自行分析拼接SQL 无感式过滤<br/>只需为Mapper设置好注解条件 支持多种自定义 不限于部门角色 | 采用 注解+aop 实现 基于部门角色 生成的sql兼容性差 不支持其他业务扩展<br/>生成sql后需手动拼接到具体业务sql上 对于多个Mapper查询不起作用 |
|
||||||
|
| 数据脱敏 | 采用 注解 + jackson 序列化期间脱敏 支持不同模块不同的脱敏条件<br/>支持多种策略 如身份证、手机号、地址、邮箱、银行卡等 可自行扩展 | 无 |
|
||||||
|
| 数据加解密 | 采用 注解 + mybatis 拦截器 对存取数据期间自动加解密<br/>支持多种策略 如BASE64、AES、RSA、SM2、SM4等 | 无 |
|
||||||
|
| 数据翻译 | 采用 注解 + jackson 序列化期间动态修改数据 数据进行翻译<br/>支持多种模式: `映射翻译` `直接翻译` `其他扩展条件翻译` 接口化两步即可完成自定义扩展 内置多种翻译实现 | 无 |
|
||||||
|
| 多数据源框架 | 采用 dynamic-datasource 支持世面大部分数据库<br/>通过yml配置即可动态管理异构不同种类的数据库 也可通过前端页面添加数据源<br/>支持spel表达式从请求头参数等条件切换数据源 | 基于 druid 手动编写代码配置数据源 配置繁琐 支持性差 |
|
||||||
|
| 多数据源事务 | 采用 dynamic-datasource 支持多数据源不同种类的数据库事务回滚 | 不支持 |
|
||||||
|
| 数据库连接池 | 采用 HikariCP Spring官方内置连接池 配置简单 以性能与稳定性闻名天下 | 采用 druid bug众多 社区维护差 活跃度低 配置众多繁琐性能一般 |
|
||||||
|
| 数据库主键 | 采用 雪花ID 基于时间戳的 有序增长 唯一ID 再也不用为分库分表 数据合并主键冲突重复而发愁 | 采用 数据库自增ID 支持数据量有限 不支持多数据源主键唯一 |
|
||||||
|
| WebSocket协议 | 基于 Spring 封装的 WebSocket 协议 扩展了Token鉴权与分布式会话同步 不再只是基于单机的废物 | 无 |
|
||||||
|
| 序列化 | 采用 Jackson Spring官方内置序列化 靠谱!!! | 采用 fastjson bugjson 远近闻名 |
|
||||||
|
| 分布式幂等 | 参考美团GTIS防重系统简化实现(细节可看文档) | 手动编写注解基于aop实现 |
|
||||||
|
| 分布式任务调度 | 采用 Xxl-Job 天生支持分布式 统一的管理中心 | 采用 Quartz 基于数据库锁性能差 集群需要做很多配置与改造 |
|
||||||
|
| 文件存储 | 采用 Minio 分布式文件存储 天生支持多机、多硬盘、多分片、多副本存储<br/>支持权限管理 安全可靠 文件可加密存储 | 采用 本机文件存储 文件裸漏 易丢失泄漏 不支持集群有单点效应 |
|
||||||
|
| 云存储 | 采用 AWS S3 协议客户端 支持 七牛、阿里、腾讯 等一切支持S3协议的厂家 | 不支持 |
|
||||||
|
| 短信 | 采用 sms4j 短信融合包 支持数十种短信厂家 只需在yml配置好厂家密钥即可使用 可多厂家共用 | 不支持 |
|
||||||
|
| 邮件 | 采用 mail-api 通用协议支持大部分邮件厂商 | 不支持 |
|
||||||
|
| 接口文档 | 采用 SpringDoc、javadoc 无注解零入侵基于java注释<br/>只需把注释写好 无需再写一大堆的文档注解了 | 采用 Springfox 已停止维护 需要编写大量的注解来支持文档生成 |
|
||||||
|
| 校验框架 | 采用 Validation 支持注解与工具类校验 注解支持国际化 | 仅支持注解 且注解不支持国际化 |
|
||||||
|
| Excel框架 | 采用 Alibaba EasyExcel 基于插件化<br/>框架对其增加了很多功能 例如 自动合并相同内容 自动排列布局 字典翻译等 | 基于 POI 手写实现 功能有限 复杂 扩展性差 |
|
||||||
|
| 工具类框架 | 采用 Hutool、Lombok 上百种工具覆盖90%的使用需求 基于注解自动生成 get set 等简化框架大量代码 | 手写工具稳定性差易出问题 工具数量有限 代码臃肿需自己手写 get set 等 |
|
||||||
|
| 监控框架 | 采用 SpringBoot-Admin 基于SpringBoot官方 actuator 探针机制<br/>实时监控服务状态 框架还为其扩展了在线日志查看监控 | 无 |
|
||||||
|
| 链路追踪 | 采用 Apache SkyWalking 还在为请求不知道去哪了 到哪出了问题而烦恼吗<br/>用了它即可实时查看请求经过的每一处每一个节点 | 无 |
|
||||||
|
| 代码生成器 | 只需设计好表结构 一键生成所有crud代码与页面<br/>降低80%的开发量 把精力都投入到业务设计上<br/>框架为其适配MP、SpringDoc规范化代码 同时支持动态多数据源代码生成 | 代码生成原生结构 只支持单数据源生成 |
|
||||||
|
| 部署方式 | 支持 Docker 编排 一键搭建所有环境 让开发人员从此不再为搭建环境而烦恼 | 原生jar部署 其他环境需手动下载安装 自行搭建 |
|
||||||
|
| 项目路径修改 | 提供详细的修改方案文档 并为其做了一些改动 非常简单即可修改成自己想要的 | 需要做很多改造 文档说明有限 |
|
||||||
|
| 国际化 | 基于请求头动态返回不同语种的文本内容 开发难度低 有对应的工具类 支持大部分注解内容国际化 | 只提供基础功能 其他需自行编写扩展 |
|
||||||
|
| 代码单例测试 | 提供单例测试 使用方式编写方法与maven多环境单测插件 | 只提供基础功能 其他需自行编写扩展 |
|
||||||
|
| Demo案例 | 提供框架功能的实际使用案例 单独一个模块提供了很多很全 | 无 |
|
||||||
|
|
||||||
|
|
||||||
|
## 本框架与RuoYi的业务差异
|
||||||
|
|
||||||
|
| 业务 | 功能说明 | 本框架 | RuoYi |
|
||||||
|
|--------|-----------------------------------------|-----|------------------|
|
||||||
|
| 用户管理 | 用户的管理配置 如:新增用户、分配用户所属部门、角色、岗位等 | 支持 | 支持 |
|
||||||
|
| 部门管理 | 配置系统组织机构(公司、部门、小组) 树结构展现支持数据权限 | 支持 | 支持 |
|
||||||
|
| 岗位管理 | 配置系统用户所属担任职务 | 支持 | 支持 |
|
||||||
|
| 菜单管理 | 配置系统菜单、操作权限、按钮权限标识等 | 支持 | 支持 |
|
||||||
|
| 角色管理 | 角色菜单权限分配、设置角色按机构进行数据范围权限划分 | 支持 | 支持 |
|
||||||
|
| 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 | 支持 | 支持 |
|
||||||
|
| 参数管理 | 对系统动态配置常用参数 | 支持 | 支持 |
|
||||||
|
| 通知公告 | 系统通知公告信息发布维护 | 支持 | 支持 |
|
||||||
|
| 操作日志 | 系统正常操作日志记录和查询 系统异常信息日志记录和查询 | 支持 | 支持 |
|
||||||
|
| 登录日志 | 系统登录日志记录查询包含登录异常 | 支持 | 支持 |
|
||||||
|
| 文件管理 | 系统文件展示、上传、下载、删除等管理 | 支持 | 无 |
|
||||||
|
| 文件配置管理 | 系统文件上传、下载所需要的配置信息动态添加、修改、删除等管理 | 支持 | 无 |
|
||||||
|
| 在线用户管理 | 已登录系统的在线用户信息监控与强制踢出操作 | 支持 | 支持 |
|
||||||
|
| 定时任务 | 运行报表、任务管理(添加、修改、删除)、日志管理、执行器管理等 | 支持 | 仅支持任务与日志管理 |
|
||||||
|
| 代码生成 | 多数据源前后端代码的生成(java、html、xml、sql)支持CRUD下载 | 支持 | 仅支持单数据源 |
|
||||||
|
| 系统接口 | 根据业务代码自动生成相关的api接口文档 | 支持 | 支持 |
|
||||||
|
| 服务监控 | 监视集群系统CPU、内存、磁盘、堆栈、在线日志、Spring相关配置等 | 支持 | 仅支持单机CPU、内存、磁盘监控 |
|
||||||
|
| 缓存监控 | 对系统的缓存信息查询,命令统计等。 | 支持 | 支持 |
|
||||||
|
| 在线构建器 | 拖动表单元素生成相应的HTML代码。 | 支持 | 支持 |
|
||||||
|
| 使用案例 | 系统的一些功能案例 | 支持 | 不支持 |
|
||||||
|
|
||||||
|
## 参考文档
|
||||||
|
|
||||||
|
使用框架前请仔细阅读文档重点注意事项
|
||||||
|
<br>
|
||||||
|
>[初始化项目 必看](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=4164117&doc_id=1469725)
|
||||||
|
>>[https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=4164117&doc_id=1469725](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=4164117&doc_id=1469725)
|
||||||
|
>
|
||||||
|
>[专栏与视频 入门必看](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=5473272&doc_id=1469725)
|
||||||
|
>>[https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=5473272&doc_id=1469725](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=5473272&doc_id=1469725)
|
||||||
|
>
|
||||||
|
>[部署项目 必看](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=4219382&doc_id=1469725)
|
||||||
|
>>[https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=4219382&doc_id=1469725](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=4219382&doc_id=1469725)
|
||||||
|
>
|
||||||
|
>[参考文档 Wiki](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages)
|
||||||
|
>>[https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages)
|
||||||
|
|
||||||
|
## 软件架构图
|
||||||
|
|
||||||
|

|
||||||
|
## 贡献代码
|
||||||
|
|
||||||
|
欢迎各路英雄豪杰 `PR` 代码 请提交到 `dev` 开发分支 统一测试发版
|
||||||
|
|
||||||
|
框架定位为 `通用后台管理系统(分布式集群强化)` 原则上不接受业务 `PR`
|
||||||
|
|
||||||
|
### 其他
|
||||||
|
|
||||||
|
* 同步升级 RuoYi-Vue
|
||||||
|
* GitHub 地址 [RuoYi-Vue-Plus-github](https://github.com/dromara/RuoYi-Vue-Plus)
|
||||||
|
* 单模块 分支 [RuoYi-Vue-Plus-fast](https://gitee.com/dromara/RuoYi-Vue-Plus/tree/fast/)
|
||||||
|
* 微服务 分支 [RuoYi-Cloud-Plus](https://gitee.com/JavaLionLi/RuoYi-Cloud-Plus)
|
||||||
|
* 用户扩展项目 [扩展项目列表](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/pages?sort_id=4478302&doc_id=1469725)
|
||||||
|
|
||||||
|
## 加群与捐献
|
||||||
|
>[加群与捐献](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/加群与捐献?sort_id=4104598)
|
||||||
|
>>[https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/加群与捐献?sort_id=4104598](https://gitee.com/dromara/RuoYi-Vue-Plus/wikis/加群与捐献?sort_id=4104598)
|
||||||
|
|
||||||
|
## 捐献作者
|
||||||
|
作者为兼职做开源,平时还需要工作,如果帮到了您可以请作者吃个盒饭
|
||||||
|
<img src="https://images.gitee.com/uploads/images/2022/0218/213734_b1b8197f_1766278.jpeg" width="300px" height="450px" />
|
||||||
|
<img src="https://images.gitee.com/uploads/images/2021/0525/101713_3d18b119_1766278.jpeg" width="300px" height="450px" />
|
||||||
|
|
||||||
|
## 演示图例
|
||||||
|
|
||||||
|
| | |
|
||||||
|
|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|  |  |
|
||||||
|
|
||||||
|
|
||||||
33
api/.gitignore
vendored
Normal file
33
api/.gitignore
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
65
api/pom.xml
Normal file
65
api/pom.xml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>ruoyi-vue-plus</artifactId>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<version>4.8.1</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<artifactId>api</artifactId>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- Mysql驱动包 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>p6spy</groupId>
|
||||||
|
<artifactId>p6spy</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ct</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>${spring-boot.version}</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.2.2</version>
|
||||||
|
<configuration>
|
||||||
|
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||||
|
<warName>${project.artifactId}</warName>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
BIN
api/src/main/.DS_Store
vendored
Normal file
BIN
api/src/main/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
api/src/main/java/.DS_Store
vendored
Normal file
BIN
api/src/main/java/.DS_Store
vendored
Normal file
Binary file not shown.
17
api/src/main/java/com/ruoyi/CTAPIApplication.java
Normal file
17
api/src/main/java/com/ruoyi/CTAPIApplication.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ruoyi;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
||||||
|
|
||||||
|
@SpringBootApplication(scanBasePackages = {"com.ruoyi.api", "com.ruoyi.ct"})
|
||||||
|
public class CTAPIApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication application = new SpringApplication(CTAPIApplication.class);
|
||||||
|
application.setApplicationStartup(new BufferingApplicationStartup(2048));
|
||||||
|
application.run(args);
|
||||||
|
System.out.println("(♥◠‿◠)ノ゙ API启动成功 ლ(´ڡ`ლ)゙");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
BIN
api/src/main/java/com/ruoyi/api/.DS_Store
vendored
Normal file
BIN
api/src/main/java/com/ruoyi/api/.DS_Store
vendored
Normal file
Binary file not shown.
45
api/src/main/java/com/ruoyi/api/EncryptDemo.java
Normal file
45
api/src/main/java/com/ruoyi/api/EncryptDemo.java
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
package com.ruoyi.api;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.SmUtil;
|
||||||
|
import cn.hutool.crypto.asymmetric.KeyType;
|
||||||
|
import cn.hutool.crypto.asymmetric.SM2;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
|
||||||
|
public class EncryptDemo {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// SM2的公钥
|
||||||
|
// String publicKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEZRdaHuSCG8U87+Cmh9LKbgC+DRBEwWpAyN31aCzoE1flWonnZezX2GqbvDdz7a0AxE6+FGEH1lxPYW39XhYupw==";
|
||||||
|
String publicKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEPWIPW8Q8OvHvDfDe3cA4ipkUvR+sDLpqA5uCDqp4BQy3iYCUO62HdNsBnB8/IplMZy8LiJeiRkt0zn740FqGtw==";
|
||||||
|
// SM2的私钥
|
||||||
|
String privateKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQggIODudYqK6cb2KKXtVAcoMRSoWotOAuZRKqbgixUmdmgCgYIKoEcz1UBgi2hRANCAARR6gv7bA9ZXo7nr5dnk7K2q8JrnaoyDZ3mr2GPvPVlff9BH/jc6E9j1Ua6GJLpHsjdR+DgdoHrZNF4BqgaabQL";
|
||||||
|
// String privateKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQghUZb+m/+ficnlbtoVJhkbUsw9FKQ5yF1wYcOP+tRQK+gCgYIKoEcz1UBgi2hRANCAASsJ3XVa/Udszyl0/tudSM7tUJsK190+2UQmEEZ6qLbRguzN+vaI3dsc04KllUojTRgXvE3vfaNAHOwQ6H5cjH+";
|
||||||
|
// 初始化SM2
|
||||||
|
SM2 sm2 = SmUtil.sm2(privateKey, publicKey);
|
||||||
|
// 使用SM2加密字符串
|
||||||
|
String encryptStr = sm2.encryptBase64("何琳琳", KeyType.PublicKey);
|
||||||
|
// String encryptStr3 = sm2.encryptBase64("13371893748", KeyType.PublicKey);
|
||||||
|
// System.out.println(sm2.encryptBase64("e34c1951-c492-4ed5-8e02-1e44eee3df7b", KeyType.PublicKey));
|
||||||
|
// System.out.println(encryptStr);
|
||||||
|
String b = "{\n" +
|
||||||
|
" \"saleId\": \"108103\",\n" +
|
||||||
|
" \"name\": \"毕彦兵\",\n" +
|
||||||
|
" \"idCard\": \"230104198809293718\",\n" +
|
||||||
|
" \"contactMobile\": \"18980692055\",\n" +
|
||||||
|
" \"province\": \"黑龙江省\",\n" +
|
||||||
|
" \"city\": \"哈尔滨市\",\n" +
|
||||||
|
" \"county\": \"松北区\",\n" +
|
||||||
|
" \"installedAddress\": \"世茂大道\",\n" +
|
||||||
|
" \"number\": \"17301750842\"\n" +
|
||||||
|
"}";
|
||||||
|
|
||||||
|
System.out.println(sm2.encryptBase64(b, KeyType.PublicKey));
|
||||||
|
// System.out.println(encryptStr3);
|
||||||
|
// 使用SM2解密字符串
|
||||||
|
// String data = sm2.decryptStr("BI7jtmBaoB+O0E/5qbBZd35h5M/BGhLcCB0kOM5ONebPJNC7+mS404aeYpqQEmW5caqLYX9y6eV87tOKwWC3bs+ns83SHA8k1yMMTZrHKooPAH28ylgrgv/jZZbw7Xtsfxm3+XjWUQDmacHrYujwlhCiAHRxAEIot/3fvSkVB49gHjaDj7ER0NQCKUwVt5xLXgJlCHyYsWmY+ZWj6LmzBzIdND1IFQIEx3iKDuXAgZ05ojQb+y27YlI1TLKn36eTOlhifdnOG89UN1UWkMZuZ8m5qnaMyR7bT+7LazIyBvgAGMkgGpCNwVBXT4t5y+/nRvHwYkURGGO7DLgybL5/KtZ74yemZ52tqgU8pm4HWNWncdZ7veeu55gwUe8ttt3C8UtTwtSYlrRpfoWTSwE8rBtvl//MZWkNXqePCnO1QIQYhKiX5GopqjlxFLlr0CirW0/fhA==", KeyType.PrivateKey);
|
||||||
|
// String data = sm2.decryptStr("BLmSzK7I1FAzi+bePR5HhCL0WruEYftUA4bw1cU0TBM0xfX4MX6ImLJzVBJP5jATbOsDC136xuDBf8uFZxmXf2gnIEOX+qBfZD7LcPgdcv06TpnCVtEQEcGULMe/iB3SEHj2xAx3R3bbkgXKGrJ2paj2D4S0uwbs0mLYpIQLFXsXogNupeUHEIq8aLNyUEDRH9HMFG+sJMJpGW80CaywaCCoevpwjc2pAdMdejT5+4/mQjXhKE5kBMyuRA0ugHR6ZfMd9P+pEk6UFDzlWw8kJ11xWgPZcNKWNA3JJBt035jdyMLNfIrPSeHjVXoQZR/l0CXcu+CsFuYvRH3zVaZBqFy+mmeB8omsdnGiuVYcJQfhAnrdU2p4bZEYAwN7KdaZCOPwE/xHoEyAsxKn/WExsYNfyaCs7wzrVaRJmOGBxL4AxzH9W4M6K6SILdPWeaz/DnPZG+pkSIck9jUwcYQnXR9y2EO95l1kwnbYrhFvL5EdLvHZgnrpWP2P7NCqixCKWYP/2rOoXpfhC0e+6w26lKAOUNbqlMWmvEcNBSUqLLzlmogmhB+Dk3SaJX6cwsFzJR9qW/4jE52V+E2pcD4ZIiqNu6UkFWZvMwQqxUvn/evyoKpPQZNr16HKTmyqG/BODPSDPOACmLDD/B8cLidb9MQaYbfS9eEXkTR7GMWji4YGBU8sMBP7WA==", KeyType.PrivateKey);
|
||||||
|
// System.out.println(data);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.ruoyi.api.config;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
|
import org.springframework.web.servlet.NoHandlerFoundException;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestControllerAdvice
|
||||||
|
public class GlobalExceptionHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求方式不支持
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
|
||||||
|
public R<Void> handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
String requestURI = request.getRequestURI();
|
||||||
|
log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod());
|
||||||
|
return R.fail(405, e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拦截未知的运行时异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(RuntimeException.class)
|
||||||
|
public R<Void> handleRuntimeException(RuntimeException e, HttpServletRequest request) {
|
||||||
|
String requestURI = request.getRequestURI();
|
||||||
|
log.error("请求地址'{}',发生未知异常.", requestURI, e);
|
||||||
|
return R.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统异常
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(Exception.class)
|
||||||
|
public R<Void> handleException(Exception e, HttpServletRequest request) {
|
||||||
|
if (e instanceof NoHandlerFoundException) {
|
||||||
|
return R.fail(404, e.getMessage());
|
||||||
|
}
|
||||||
|
String requestURI = request.getRequestURI();
|
||||||
|
log.error("请求地址'{}',发生系统异常.", requestURI, e);
|
||||||
|
return R.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.ruoyi.api.config;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.DbType;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@MapperScan("com.ruoyi.ct.mapper")
|
||||||
|
public class MybatisPlusConfig {
|
||||||
|
@Bean
|
||||||
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); //配置插件类
|
||||||
|
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); //具体到配置哪一个插件
|
||||||
|
return interceptor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
454
api/src/main/java/com/ruoyi/api/controller/APIController.java
Normal file
454
api/src/main/java/com/ruoyi/api/controller/APIController.java
Normal file
@@ -0,0 +1,454 @@
|
|||||||
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.asymmetric.KeyType;
|
||||||
|
import cn.hutool.crypto.asymmetric.SM2;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.common.core.domain.CTResponse;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.ct.domain.AgentOrder;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||||
|
import com.ruoyi.ct.service.*;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping("api/v1.0.0")
|
||||||
|
public class APIController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CTService ctService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentAccountService agentAccountService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentAccountGoodService agentAccountGoodService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentService agentService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentOrderService agentOrderService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IGoodService goodService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取账号下的商品列表
|
||||||
|
* @param request
|
||||||
|
* @param page 页码,默认:1
|
||||||
|
* @param pageSize 每页条数:默认20,最大不超过50
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("getGoodsList")
|
||||||
|
public R<JSONObject> getGoodsList(HttpServletRequest request, Integer page, Integer pageSize) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
AgentAccountGoodBo agentAccountGoodBo = new AgentAccountGoodBo();
|
||||||
|
agentAccountGoodBo.setAgentAccountId(agentAccountVo.getId());
|
||||||
|
Page<AgentAccountGoodVo> result = agentAccountGoodService.queryPage(agentAccountGoodBo, page, pageSize);
|
||||||
|
JSONObject resultData = new JSONObject();
|
||||||
|
JSONObject meta = new JSONObject();
|
||||||
|
meta.set("total", result.getTotal());
|
||||||
|
meta.set("page", page);
|
||||||
|
meta.set("pageSize", pageSize);
|
||||||
|
resultData.set("meta", meta);
|
||||||
|
|
||||||
|
List<JSONObject> dataList = new ArrayList<>();
|
||||||
|
for(AgentAccountGoodVo vo: result.getRecords()) {
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.set("saleId", vo.getSaleId());
|
||||||
|
data.set("title", vo.getTitle());
|
||||||
|
data.set("content", vo.getContent());
|
||||||
|
dataList.add(data);
|
||||||
|
}
|
||||||
|
resultData.set("objects", dataList);
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 1, "", resultData.toString());
|
||||||
|
return R.ok(resultData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getNumberList")
|
||||||
|
public R<List<JSONObject>> getNumberList(HttpServletRequest request, Integer page, Integer pageSize, String saleId) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
if (ObjectUtils.isNull(saleId)) {
|
||||||
|
log.error("参数错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "参数错误:saleId为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = agentAccountGoodService.getByGoodAndAccount(saleId, agentAccountVo.getId());
|
||||||
|
if (ObjectUtils.isNull(agentAccountGoodVo)) {
|
||||||
|
log.error("参数错误");
|
||||||
|
log.error("agentAccountVo: "+agentAccountVo);
|
||||||
|
log.error("saleId: "+saleId);
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "参数错误:没找到代理商账号代理的商品", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
List<JSONObject> data = ctService.selectNumber(agentAccountVo.getPersonnelId(), agentAccountGoodVo.getSaleId(), String.valueOf(page), String.valueOf(pageSize));
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 1, "", data.toString());
|
||||||
|
return R.ok(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 1, "电信请求异常", "[]");
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return R.ok(new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("confirmOrder")
|
||||||
|
public R<String> confirmOrder(HttpServletRequest request, @RequestBody String body) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
try {
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
body = sm2.decryptStr(body, KeyType.PrivateKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("数据解密错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "数据解密错误", null);
|
||||||
|
return R.fail(ERROR_CODE_ENCRYPT, "数据解密错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject requestBody = JSONUtil.parseObj(body);
|
||||||
|
System.out.println("requestBody = " + requestBody);
|
||||||
|
AgentOrderBo agentOrderBo = requestBody.toBean(AgentOrderBo.class);
|
||||||
|
// 填充固定数据
|
||||||
|
agentOrderBo.setAgentName(agentAccountVo.getAgentName());
|
||||||
|
agentOrderBo.setAgentId(agentAccountVo.getAgentId());
|
||||||
|
agentOrderBo.setStoreId("13");
|
||||||
|
agentOrderBo.setSerialNumber(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
agentOrderBo.setStatus("0");
|
||||||
|
agentOrderBo.setPersonnelId(agentAccountVo.getPersonnelId());
|
||||||
|
agentOrderBo.setCreateTime(new Date());
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo;
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
{
|
||||||
|
// 校验数据
|
||||||
|
// 校验gid
|
||||||
|
String saleId = requestBody.getStr("saleId");
|
||||||
|
if (ObjectUtils.isNull(saleId)) {
|
||||||
|
log.error("saleId为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "saleId为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
agentAccountGoodVo = agentAccountGoodService.getByGoodAndAccount(saleId, agentAccountVo.getId());
|
||||||
|
agentOrderBo.setAgentAccountId(agentAccountGoodVo.getId());
|
||||||
|
agentOrderBo.setSaleId(agentAccountGoodVo.getSaleId());
|
||||||
|
GoodVo goodVo = goodService.queryById(agentAccountGoodVo.getGoodId());
|
||||||
|
agentOrderBo.setTitle(goodVo.getName());
|
||||||
|
agentOrderBo.setContent(goodVo.getContent());
|
||||||
|
|
||||||
|
if (ObjectUtils.isNull(agentAccountGoodVo)) {
|
||||||
|
log.error("saleId无效");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "saleId无效", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("saleId格式错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "saleId格式错误", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验用户信息,姓名、身份证、手机号
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getName())) {
|
||||||
|
log.error("姓名为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "姓名为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getIdCard())) {
|
||||||
|
log.error("身份证号为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "身份证号为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
// String regex = "^\\d{17}[Xx]|\\d{15}$";
|
||||||
|
// Pattern pattern = Pattern.compile(regex);
|
||||||
|
// Matcher matcher = pattern.matcher(agentOrderBo.getIdCard());
|
||||||
|
// if (!matcher.matches()) {
|
||||||
|
// log.error("身份证号格式错误");
|
||||||
|
// saveLog(request, agentAccountVo.getPersonnelId(), 0, "身份证号格式错误", null);
|
||||||
|
// return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
// }
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getContactMobile())) {
|
||||||
|
log.error("手机号为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "手机号为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
// regex = "^1[3-9]\\d{9}$";
|
||||||
|
// pattern = Pattern.compile(regex);
|
||||||
|
// matcher = pattern.matcher(agentOrderBo.getContactMobile());
|
||||||
|
// if (!matcher.matches()) {
|
||||||
|
// log.error("手机号格式错误");
|
||||||
|
// saveLog(request, agentAccountVo.getPersonnelId(), 0, "手机号格式错误", null);
|
||||||
|
// return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 校验地址信息
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getProvince())) {
|
||||||
|
log.error("省为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "省为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getCity())) {
|
||||||
|
log.error("市为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "市为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getCounty())) {
|
||||||
|
log.error("区为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "区为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getInstalledAddress())) {
|
||||||
|
log.error("地址为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "地址为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getInstallAddress())) {
|
||||||
|
agentOrderBo.setInstallAddress(agentOrderBo.getInstalledAddress());
|
||||||
|
}
|
||||||
|
// todo 根据代理商提供的验证url验证用户
|
||||||
|
JSONObject paramMap = new JSONObject();
|
||||||
|
paramMap.set("name", agentOrderBo.getName());
|
||||||
|
paramMap.set("idCard", agentOrderBo.getIdCard());
|
||||||
|
paramMap.set("contactMobile", agentOrderBo.getContactMobile());
|
||||||
|
if (ObjectUtils.isNotNull(agentAccountVo.getVerifyUrl())) {
|
||||||
|
try {
|
||||||
|
String verifyResult = HttpUtil.post(agentAccountVo.getVerifyUrl(), sm2.encryptBase64(paramMap.toString(), KeyType.PublicKey));
|
||||||
|
JSONObject verifyData = JSONUtil.parseObj(verifyResult);
|
||||||
|
if (verifyData.getInt("code") != 200) {
|
||||||
|
log.error("验证不通过");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "验证不通过", null);
|
||||||
|
return R.fail(ERROR_CODE_VERIFY, "验证错误");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("验证请求错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "验证请求错误", null);
|
||||||
|
return R.fail(ERROR_CODE_VERIFY, "验证错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存数据
|
||||||
|
// agentOrderService.insertByBo(agentOrderBo);
|
||||||
|
try {
|
||||||
|
CTResponse<String> response = ctService.saveOrder(agentOrderBo.getName(), agentOrderBo.getIdCard(), agentOrderBo.getContactMobile(),
|
||||||
|
agentOrderBo.getInstalledAddress(), agentOrderBo.getSaleId(), agentOrderBo.getStoreId(),
|
||||||
|
agentOrderBo.getPersonnelId(), agentOrderBo.getProvince(), agentOrderBo.getCity(),
|
||||||
|
agentOrderBo.getCounty(), agentOrderBo.getSerialNumber(), agentOrderBo.getNumber(),
|
||||||
|
agentOrderBo.getLogiRemark(), agentOrderBo.getPageUrl(), agentOrderBo.getRemark(),
|
||||||
|
agentOrderBo.getInstallAddress(), "", "");
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
agentOrderBo.setOrderNum(response.getData());
|
||||||
|
agentOrderBo.setOrderStatus("S1000");
|
||||||
|
agentOrderBo.setStatus("0");
|
||||||
|
agentOrderService.insertByBo(agentOrderBo);
|
||||||
|
return R.ok("操作成功", agentOrderBo.getSerialNumber());
|
||||||
|
} else {
|
||||||
|
// 订单验证失败
|
||||||
|
log.error("电信订单验证失败");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "电信订单验证失败", response.getMessage());
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "电信请求异常", "");
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return R.fail(ERROR_CODE_NETWORK, "电信网络异常");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getOrderList")
|
||||||
|
public R<JSONObject> getOrderList(HttpServletRequest request,
|
||||||
|
Integer page, Integer pageSize,
|
||||||
|
String saleId,
|
||||||
|
String name, String contactMobile, String number) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
|
||||||
|
AgentAccountGoodBo agentAccountGoodBo = new AgentAccountGoodBo();
|
||||||
|
agentAccountGoodBo.setPersonnelId(agentAccountVo.getPersonnelId());
|
||||||
|
|
||||||
|
// if (ObjectUtils.isNull(saleId) && ObjectUtils.isNull(name) && ObjectUtils.isNull(contactMobile) && ObjectUtils.isNull(number)) {
|
||||||
|
if (ObjectUtils.isNull(saleId)) {
|
||||||
|
log.error("无saleId");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "无参数", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<AgentOrder> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(AgentOrder::getPersonnelId, agentAccountVo.getPersonnelId());
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(saleId), AgentOrder::getSaleId, saleId);
|
||||||
|
if (ObjectUtils.isNotNull(name)) {
|
||||||
|
try {
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(name), AgentOrder::getName, sm2.decryptStr(name, KeyType.PrivateKey));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解密姓名错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "解密姓名错误", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotNull(contactMobile)) {
|
||||||
|
try {
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(contactMobile), AgentOrder::getContactMobile, sm2.decryptStr(contactMobile, KeyType.PrivateKey));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解密联系电话错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "解密联系电话错误", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotNull(number)) {
|
||||||
|
try {
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(number), AgentOrder::getNumber, sm2.decryptStr(number, KeyType.PrivateKey));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解密手机号错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "解密手机号错误", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lqw.gt(AgentOrder::getStatus, "-1");
|
||||||
|
|
||||||
|
PageQuery pageQuery = new PageQuery();
|
||||||
|
pageQuery.setPageNum(page);
|
||||||
|
pageQuery.setPageSize(pageSize);
|
||||||
|
TableDataInfo<AgentOrderVo> tableDataInfo = agentOrderService.queryList(lqw, pageQuery);
|
||||||
|
|
||||||
|
JSONObject resultData = new JSONObject();
|
||||||
|
JSONObject meta = new JSONObject();
|
||||||
|
meta.set("total", tableDataInfo.getTotal());
|
||||||
|
meta.set("page", page);
|
||||||
|
meta.set("pageSize", pageSize);
|
||||||
|
resultData.set("meta", meta);
|
||||||
|
List<JSONObject> objects = new ArrayList<>();
|
||||||
|
|
||||||
|
for (AgentOrderVo vo: tableDataInfo.getRows()) {
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.set("serialNumber", vo.getSerialNumber());
|
||||||
|
data.set("name", vo.getName());
|
||||||
|
data.set("contactMobile", vo.getContactMobile());
|
||||||
|
data.set("idCard", vo.getIdCard());
|
||||||
|
data.set("number", vo.getNumber());
|
||||||
|
data.set("status", vo.getStatus());
|
||||||
|
data.set("orderStatus", vo.getOrderStatus());
|
||||||
|
data.set("createTime", vo.getCreateTime());
|
||||||
|
data.set("updateTime", vo.getUpdateTime());
|
||||||
|
data.set("isRecharge", vo.getIsRecharge());
|
||||||
|
data.set("chargeTitle", vo.getChargeTitle());
|
||||||
|
data.set("expressVendor", vo.getExpressVendor());
|
||||||
|
data.set("expressNum", vo.getExpressNum());
|
||||||
|
JSONObject goods = new JSONObject();
|
||||||
|
goods.set("saleId", vo.getSaleId());
|
||||||
|
goods.set("title", vo.getTitle());
|
||||||
|
goods.set("content", vo.getContent());
|
||||||
|
data.set("bookingGoods", goods);
|
||||||
|
|
||||||
|
objects.add(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
resultData.set("objects", sm2.encryptBase64(objects.toString(), KeyType.PublicKey));
|
||||||
|
|
||||||
|
return R.ok(resultData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getOrderDetail")
|
||||||
|
public R<String> getOrderDetail(HttpServletRequest request, String serialNumber) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
if (ObjectUtils.isNull(serialNumber)) {
|
||||||
|
log.error("参数错误:serialNumber为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "参数错误:serialNumber为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
AgentOrderBo bo = new AgentOrderBo();
|
||||||
|
bo.setSerialNumber(serialNumber);
|
||||||
|
bo.setAgentId(agentAccountVo.getAgentId());
|
||||||
|
bo.setPersonnelId(agentAccountVo.getPersonnelId());
|
||||||
|
List<AgentOrderVo> voList = agentOrderService.queryList(bo);
|
||||||
|
if (voList.size() > 0) {
|
||||||
|
AgentOrderVo vo = voList.get(0);
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.set("serialNumber", vo.getSerialNumber());
|
||||||
|
data.set("name", vo.getName());
|
||||||
|
data.set("contactMobile", vo.getContactMobile());
|
||||||
|
data.set("idCard", vo.getIdCard());
|
||||||
|
data.set("number", vo.getNumber());
|
||||||
|
data.set("status", vo.getStatus());
|
||||||
|
data.set("orderStatus", vo.getStatus());
|
||||||
|
data.set("isRecharge", vo.getIsRecharge());
|
||||||
|
data.set("chargeTitle", vo.getChargeTitle());
|
||||||
|
data.set("expressVendor", vo.getExpressVendor());
|
||||||
|
data.set("expressNum", vo.getExpressNum());
|
||||||
|
data.set("routeArr", JSONUtil.parseArray(vo.getRouteArr()));
|
||||||
|
data.set("expressRoutes", JSONUtil.parseArray(vo.getExpressRoutes()));
|
||||||
|
data.set("createTime", vo.getCreateTime());
|
||||||
|
data.set("updateTime", vo.getUpdateTime());
|
||||||
|
JSONObject goods = new JSONObject();
|
||||||
|
goods.set("saleId", vo.getSaleId());
|
||||||
|
goods.set("title", vo.getTitle());
|
||||||
|
goods.set("content", vo.getContent());
|
||||||
|
data.set("bookingGoods", goods);
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
return R.ok(null, sm2.encryptBase64(data.toString(), KeyType.PublicKey));
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String body = "{\"name\":\"毕彦兵\",\"idCard\":\"230104198809293718\",\"contactNumber\":\"18980692055\",\"installedAddress\":\"世贸大道世贸都柏林49栋3单元2402\",\"gid\":1,\"province\":\"黑龙江\",\"city\":\"哈尔滨\",\"county\":\"松北区\",\"number\":\"19384158592\",\"logiRemark\":\"\",\"pageUrl\":\"\",\"remark\":\"\",}";
|
||||||
|
}
|
||||||
|
}
|
||||||
547
api/src/main/java/com/ruoyi/api/controller/APIControllerV2.java
Normal file
547
api/src/main/java/com/ruoyi/api/controller/APIControllerV2.java
Normal file
@@ -0,0 +1,547 @@
|
|||||||
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.asymmetric.KeyType;
|
||||||
|
import cn.hutool.crypto.asymmetric.SM2;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.common.core.domain.CTResponse;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.ct.domain.AgentOrder;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||||
|
import com.ruoyi.ct.service.*;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping("api/v2.0.0")
|
||||||
|
public class APIControllerV2 extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CTService ctService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentAccountService agentAccountService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentAccountGoodService agentAccountGoodService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentService agentService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentOrderService agentOrderService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IGoodService goodService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取账号下的商品列表
|
||||||
|
* @param request
|
||||||
|
* @param page 页码,默认:1
|
||||||
|
* @param pageSize 每页条数:默认20,最大不超过50
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("getGoodsList")
|
||||||
|
public R<JSONObject> getGoodsList(HttpServletRequest request, Integer page, Integer pageSize) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
AgentAccountGoodBo agentAccountGoodBo = new AgentAccountGoodBo();
|
||||||
|
agentAccountGoodBo.setAgentAccountId(agentAccountVo.getId());
|
||||||
|
Page<AgentAccountGoodVo> result = agentAccountGoodService.queryPage(agentAccountGoodBo, page, pageSize);
|
||||||
|
JSONObject resultData = new JSONObject();
|
||||||
|
JSONObject meta = new JSONObject();
|
||||||
|
meta.set("total", result.getTotal());
|
||||||
|
meta.set("page", page);
|
||||||
|
meta.set("pageSize", pageSize);
|
||||||
|
resultData.set("meta", meta);
|
||||||
|
|
||||||
|
List<JSONObject> dataList = new ArrayList<>();
|
||||||
|
for(AgentAccountGoodVo vo: result.getRecords()) {
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.set("saleId", vo.getSaleId());
|
||||||
|
data.set("title", vo.getTitle());
|
||||||
|
data.set("content", vo.getContent());
|
||||||
|
dataList.add(data);
|
||||||
|
}
|
||||||
|
resultData.set("objects", dataList);
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 1, "", resultData.toString());
|
||||||
|
return R.ok(resultData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getNumberList")
|
||||||
|
public R<List<JSONObject>> getNumberList(HttpServletRequest request, Integer page, Integer pageSize, String saleId) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
if (ObjectUtils.isNull(saleId)) {
|
||||||
|
log.error("参数错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "参数错误:saleId为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = agentAccountGoodService.getByGoodAndAccount(saleId, agentAccountVo.getId());
|
||||||
|
if (ObjectUtils.isNull(agentAccountGoodVo)) {
|
||||||
|
log.error("参数错误");
|
||||||
|
log.error("agentAccountVo: "+agentAccountVo);
|
||||||
|
log.error("saleId: "+saleId);
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "参数错误:没找到代理商账号代理的商品", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
List<JSONObject> data = ctService.selectNumber(agentAccountVo.getPersonnelId(), agentAccountGoodVo.getSaleId(), String.valueOf(page), String.valueOf(pageSize));
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 1, "", data.toString());
|
||||||
|
return R.ok(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 1, "电信请求异常", "[]");
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return R.ok(new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("confirmOrderBaseInfo")
|
||||||
|
public R<String> confirmOrderBaseInfo(HttpServletRequest request, @RequestBody String body) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
try {
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
body = sm2.decryptStr(body, KeyType.PrivateKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("数据解密错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "数据解密错误", null);
|
||||||
|
return R.fail(ERROR_CODE_ENCRYPT, "数据解密错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject requestBody = JSONUtil.parseObj(body);
|
||||||
|
System.out.println("requestBody = " + requestBody);
|
||||||
|
AgentOrderBo agentOrderBo = requestBody.toBean(AgentOrderBo.class);
|
||||||
|
// 填充固定数据
|
||||||
|
agentOrderBo.setAgentName(agentAccountVo.getAgentName());
|
||||||
|
agentOrderBo.setAgentId(agentAccountVo.getAgentId());
|
||||||
|
agentOrderBo.setStoreId("13");
|
||||||
|
agentOrderBo.setSerialNumber(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
agentOrderBo.setStatus("0");
|
||||||
|
agentOrderBo.setPersonnelId(agentAccountVo.getPersonnelId());
|
||||||
|
agentOrderBo.setCreateTime(new Date());
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo;
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
{
|
||||||
|
// 校验数据
|
||||||
|
// 校验gid
|
||||||
|
String saleId = requestBody.getStr("saleId");
|
||||||
|
if (ObjectUtils.isNull(saleId)) {
|
||||||
|
log.error("saleId为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "saleId为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
agentAccountGoodVo = agentAccountGoodService.getByGoodAndAccount(saleId, agentAccountVo.getId());
|
||||||
|
agentOrderBo.setAgentAccountId(agentAccountGoodVo.getId());
|
||||||
|
agentOrderBo.setSaleId(agentAccountGoodVo.getSaleId());
|
||||||
|
GoodVo goodVo = goodService.queryById(agentAccountGoodVo.getGoodId());
|
||||||
|
agentOrderBo.setTitle(goodVo.getName());
|
||||||
|
agentOrderBo.setContent(goodVo.getContent());
|
||||||
|
|
||||||
|
if (ObjectUtils.isNull(agentAccountGoodVo)) {
|
||||||
|
log.error("saleId无效");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "saleId无效", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("saleId格式错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "saleId格式错误", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验用户信息,姓名、身份证、手机号
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getName())) {
|
||||||
|
log.error("姓名为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "姓名为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getIdCard())) {
|
||||||
|
log.error("身份证号为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "身份证号为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
// String regex = "^\\d{17}[Xx]|\\d{15}$";
|
||||||
|
// Pattern pattern = Pattern.compile(regex);
|
||||||
|
// Matcher matcher = pattern.matcher(agentOrderBo.getIdCard());
|
||||||
|
// if (!matcher.matches()) {
|
||||||
|
// log.error("身份证号格式错误");
|
||||||
|
// saveLog(request, agentAccountVo.getPersonnelId(), 0, "身份证号格式错误", null);
|
||||||
|
// return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
// }
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getContactMobile())) {
|
||||||
|
log.error("手机号为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "手机号为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
// regex = "^1[3-9]\\d{9}$";
|
||||||
|
// pattern = Pattern.compile(regex);
|
||||||
|
// matcher = pattern.matcher(agentOrderBo.getContactMobile());
|
||||||
|
// if (!matcher.matches()) {
|
||||||
|
// log.error("手机号格式错误");
|
||||||
|
// saveLog(request, agentAccountVo.getPersonnelId(), 0, "手机号格式错误", null);
|
||||||
|
// return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 校验地址信息
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getProvince())) {
|
||||||
|
log.error("省为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "省为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getCity())) {
|
||||||
|
log.error("市为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "市为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getCounty())) {
|
||||||
|
log.error("区为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "区为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getInstalledAddress())) {
|
||||||
|
log.error("地址为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "地址为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getInstallAddress())) {
|
||||||
|
agentOrderBo.setInstallAddress(agentOrderBo.getInstalledAddress());
|
||||||
|
}
|
||||||
|
// todo 根据代理商提供的验证url验证用户
|
||||||
|
JSONObject paramMap = new JSONObject();
|
||||||
|
paramMap.set("name", agentOrderBo.getName());
|
||||||
|
paramMap.set("idCard", agentOrderBo.getIdCard());
|
||||||
|
paramMap.set("contactMobile", agentOrderBo.getContactMobile());
|
||||||
|
// if (ObjectUtils.isNotNull(agentAccountVo.getVerifyUrl())) {
|
||||||
|
// try {
|
||||||
|
// String verifyResult = HttpUtil.post(agentAccountVo.getVerifyUrl(), sm2.encryptBase64(paramMap.toString(), KeyType.PublicKey));
|
||||||
|
// JSONObject verifyData = JSONUtil.parseObj(verifyResult);
|
||||||
|
// if (verifyData.getInt("code") != 200) {
|
||||||
|
// log.error("验证不通过");
|
||||||
|
// saveLog(request, agentAccountVo.getPersonnelId(), 0, "验证不通过", null);
|
||||||
|
// return R.fail(ERROR_CODE_VERIFY, "验证错误");
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// log.error("验证请求错误");
|
||||||
|
// saveLog(request, agentAccountVo.getPersonnelId(), 0, "验证请求错误", null);
|
||||||
|
// return R.fail(ERROR_CODE_VERIFY, "验证错误");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存数据
|
||||||
|
agentOrderService.insertByBo(agentOrderBo);
|
||||||
|
return R.ok("操作成功", agentOrderBo.getSerialNumber());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("uploadImg")
|
||||||
|
public R<String> uploadImg(HttpServletRequest request, @RequestBody String body) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
// try {
|
||||||
|
// SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
// body = sm2.decryptStr(body, KeyType.PrivateKey);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("数据解密错误");
|
||||||
|
// saveLog(request, agentAccountVo.getPersonnelId(), 0, "数据解密错误", null);
|
||||||
|
// return R.fail(ERROR_CODE_ENCRYPT, "数据解密错误");
|
||||||
|
// }
|
||||||
|
|
||||||
|
JSONObject requestBody = JSONUtil.parseObj(body);
|
||||||
|
System.out.println("requestBody = " + requestBody);
|
||||||
|
AgentOrderVo agentOrderVo = agentOrderService.queryBySerialNumber(requestBody.getStr("serialNumber"));
|
||||||
|
if (ObjectUtils.isNull(agentOrderVo)) {
|
||||||
|
log.error("订单不存在");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "订单不存在", null);
|
||||||
|
return R.fail(ERROR_CODE_ENCRYPT, "订单不存在");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
CTResponse<String> response = ctService.uploadFile(agentOrderVo.getSerialNumber(), agentOrderVo.getName(),
|
||||||
|
agentOrderVo.getIdCard(), requestBody.getStr("type"), agentOrderVo.getUploadMsgId(), requestBody.getStr("img"));
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
AgentOrderBo agentOrderBo = new AgentOrderBo();
|
||||||
|
agentOrderBo.setId(agentOrderVo.getId());
|
||||||
|
agentOrderBo.setUploadMsgId(response.getData());
|
||||||
|
if (requestBody.getStr("type").equals("idCardFront")) {
|
||||||
|
agentOrderBo.setIdCardFront(1);
|
||||||
|
}
|
||||||
|
else if (requestBody.getStr("type").equals("idCardBack")) {
|
||||||
|
agentOrderBo.setIdCardBack(1);
|
||||||
|
}
|
||||||
|
else if (requestBody.getStr("type").equals("frontFace")) {
|
||||||
|
agentOrderBo.setFrontFace(1);
|
||||||
|
}
|
||||||
|
agentOrderService.updateByBo(agentOrderBo);
|
||||||
|
return R.ok(agentOrderVo.getSerialNumber());
|
||||||
|
} else {
|
||||||
|
// 订单验证失败
|
||||||
|
log.error("上传失败");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "上传失败", response.getMessage());
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, response.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "电信请求异常", "");
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return R.fail(ERROR_CODE_NETWORK, "电信网络异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("confirmOrder")
|
||||||
|
public R<String> confirmOrder(HttpServletRequest request, @RequestBody String body) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
try {
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
body = sm2.decryptStr(body, KeyType.PrivateKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("数据解密错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "数据解密错误", null);
|
||||||
|
return R.fail(ERROR_CODE_ENCRYPT, "数据解密错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject requestBody = JSONUtil.parseObj(body);
|
||||||
|
System.out.println("requestBody = " + requestBody);
|
||||||
|
AgentOrderVo agentOrderVo = agentOrderService.queryBySerialNumber(requestBody.getStr("serialNumber"));
|
||||||
|
if (ObjectUtils.isNull(agentOrderVo)) {
|
||||||
|
log.error("订单不存在");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "订单不存在", null);
|
||||||
|
return R.fail(ERROR_CODE_ENCRYPT, "订单不存在");
|
||||||
|
}
|
||||||
|
if (agentOrderVo.getIdCardFront() == 0 || agentOrderVo.getIdCardBack() == 0 || agentOrderVo.getFrontFace() == 0) {
|
||||||
|
log.error("照片上传不完整");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "照片上传不完整", null);
|
||||||
|
return R.fail(ERROR_CODE_ENCRYPT, "照片上传不完整");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
CTResponse<String> response = ctService.saveOrder(agentOrderVo.getName(), agentOrderVo.getIdCard(), agentOrderVo.getContactMobile(),
|
||||||
|
agentOrderVo.getInstalledAddress(), agentOrderVo.getSaleId(), agentOrderVo.getStoreId(),
|
||||||
|
agentOrderVo.getPersonnelId(), agentOrderVo.getProvince(), agentOrderVo.getCity(),
|
||||||
|
agentOrderVo.getCounty(), agentOrderVo.getSerialNumber(), agentOrderVo.getNumber(),
|
||||||
|
agentOrderVo.getLogiRemark(), agentOrderVo.getPageUrl(), agentOrderVo.getRemark(),
|
||||||
|
agentOrderVo.getInstallAddress(), "", "idCardFront,idCardBack,frontFace");
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
AgentOrderBo agentOrderBo = new AgentOrderBo();
|
||||||
|
agentOrderBo.setId(agentOrderVo.getId());
|
||||||
|
agentOrderBo.setOrderNum(response.getData());
|
||||||
|
agentOrderBo.setOrderStatus("S1000");
|
||||||
|
agentOrderBo.setStatus("0");
|
||||||
|
agentOrderService.updateByBo(agentOrderBo);
|
||||||
|
return R.ok("操作成功", agentOrderBo.getSerialNumber());
|
||||||
|
} else {
|
||||||
|
// 订单验证失败
|
||||||
|
log.error("电信订单验证失败");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "电信订单验证失败", response.getMessage());
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "电信请求异常", "");
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return R.fail(ERROR_CODE_NETWORK, "电信网络异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getOrderList")
|
||||||
|
public R<JSONObject> getOrderList(HttpServletRequest request,
|
||||||
|
Integer page, Integer pageSize,
|
||||||
|
String saleId,
|
||||||
|
String name, String contactMobile, String number) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
|
||||||
|
AgentAccountGoodBo agentAccountGoodBo = new AgentAccountGoodBo();
|
||||||
|
agentAccountGoodBo.setPersonnelId(agentAccountVo.getPersonnelId());
|
||||||
|
|
||||||
|
// if (ObjectUtils.isNull(saleId) && ObjectUtils.isNull(name) && ObjectUtils.isNull(contactMobile) && ObjectUtils.isNull(number)) {
|
||||||
|
if (ObjectUtils.isNull(saleId)) {
|
||||||
|
log.error("无saleId");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "无参数", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<AgentOrder> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(AgentOrder::getPersonnelId, agentAccountVo.getPersonnelId());
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(saleId), AgentOrder::getSaleId, saleId);
|
||||||
|
if (ObjectUtils.isNotNull(name)) {
|
||||||
|
try {
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(name), AgentOrder::getName, sm2.decryptStr(name, KeyType.PrivateKey));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解密姓名错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "解密姓名错误", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotNull(contactMobile)) {
|
||||||
|
try {
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(contactMobile), AgentOrder::getContactMobile, sm2.decryptStr(contactMobile, KeyType.PrivateKey));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解密联系电话错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "解密联系电话错误", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotNull(number)) {
|
||||||
|
try {
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(number), AgentOrder::getNumber, sm2.decryptStr(number, KeyType.PrivateKey));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解密手机号错误");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "解密手机号错误", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lqw.gt(AgentOrder::getStatus, "-1");
|
||||||
|
|
||||||
|
PageQuery pageQuery = new PageQuery();
|
||||||
|
pageQuery.setPageNum(page);
|
||||||
|
pageQuery.setPageSize(pageSize);
|
||||||
|
TableDataInfo<AgentOrderVo> tableDataInfo = agentOrderService.queryList(lqw, pageQuery);
|
||||||
|
|
||||||
|
JSONObject resultData = new JSONObject();
|
||||||
|
JSONObject meta = new JSONObject();
|
||||||
|
meta.set("total", tableDataInfo.getTotal());
|
||||||
|
meta.set("page", page);
|
||||||
|
meta.set("pageSize", pageSize);
|
||||||
|
resultData.set("meta", meta);
|
||||||
|
List<JSONObject> objects = new ArrayList<>();
|
||||||
|
|
||||||
|
for (AgentOrderVo vo: tableDataInfo.getRows()) {
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.set("serialNumber", vo.getSerialNumber());
|
||||||
|
data.set("name", vo.getName());
|
||||||
|
data.set("contactMobile", vo.getContactMobile());
|
||||||
|
data.set("idCard", vo.getIdCard());
|
||||||
|
data.set("number", vo.getNumber());
|
||||||
|
data.set("status", vo.getStatus());
|
||||||
|
data.set("orderStatus", vo.getOrderStatus());
|
||||||
|
data.set("createTime", vo.getCreateTime());
|
||||||
|
data.set("updateTime", vo.getUpdateTime());
|
||||||
|
data.set("isRecharge", vo.getIsRecharge());
|
||||||
|
data.set("chargeTitle", vo.getChargeTitle());
|
||||||
|
data.set("expressVendor", vo.getExpressVendor());
|
||||||
|
data.set("expressNum", vo.getExpressNum());
|
||||||
|
JSONObject goods = new JSONObject();
|
||||||
|
goods.set("saleId", vo.getSaleId());
|
||||||
|
goods.set("title", vo.getTitle());
|
||||||
|
goods.set("content", vo.getContent());
|
||||||
|
data.set("bookingGoods", goods);
|
||||||
|
|
||||||
|
objects.add(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
resultData.set("objects", sm2.encryptBase64(objects.toString(), KeyType.PublicKey));
|
||||||
|
|
||||||
|
return R.ok(resultData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getOrderDetail")
|
||||||
|
public R<String> getOrderDetail(HttpServletRequest request, String serialNumber) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
if (ObjectUtils.isNull(serialNumber)) {
|
||||||
|
log.error("参数错误:serialNumber为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "参数错误:serialNumber为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
AgentOrderBo bo = new AgentOrderBo();
|
||||||
|
bo.setSerialNumber(serialNumber);
|
||||||
|
bo.setAgentId(agentAccountVo.getAgentId());
|
||||||
|
bo.setPersonnelId(agentAccountVo.getPersonnelId());
|
||||||
|
List<AgentOrderVo> voList = agentOrderService.queryList(bo);
|
||||||
|
if (voList.size() > 0) {
|
||||||
|
AgentOrderVo vo = voList.get(0);
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.set("serialNumber", vo.getSerialNumber());
|
||||||
|
data.set("name", vo.getName());
|
||||||
|
data.set("contactMobile", vo.getContactMobile());
|
||||||
|
data.set("idCard", vo.getIdCard());
|
||||||
|
data.set("number", vo.getNumber());
|
||||||
|
data.set("status", vo.getStatus());
|
||||||
|
data.set("orderStatus", vo.getStatus());
|
||||||
|
data.set("isRecharge", vo.getIsRecharge());
|
||||||
|
data.set("chargeTitle", vo.getChargeTitle());
|
||||||
|
data.set("expressVendor", vo.getExpressVendor());
|
||||||
|
data.set("expressNum", vo.getExpressNum());
|
||||||
|
data.set("routeArr", JSONUtil.parseArray(vo.getRouteArr()));
|
||||||
|
data.set("expressRoutes", JSONUtil.parseArray(vo.getExpressRoutes()));
|
||||||
|
data.set("createTime", vo.getCreateTime());
|
||||||
|
data.set("updateTime", vo.getUpdateTime());
|
||||||
|
JSONObject goods = new JSONObject();
|
||||||
|
goods.set("saleId", vo.getSaleId());
|
||||||
|
goods.set("title", vo.getTitle());
|
||||||
|
goods.set("content", vo.getContent());
|
||||||
|
data.set("bookingGoods", goods);
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
return R.ok(null, sm2.encryptBase64(data.toString(), KeyType.PublicKey));
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String body = "{\"name\":\"毕彦兵\",\"idCard\":\"230104198809293718\",\"contactNumber\":\"18980692055\",\"installedAddress\":\"世贸大道世贸都柏林49栋3单元2402\",\"gid\":1,\"province\":\"黑龙江\",\"city\":\"哈尔滨\",\"county\":\"松北区\",\"number\":\"19384158592\",\"logiRemark\":\"\",\"pageUrl\":\"\",\"remark\":\"\",}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,370 @@
|
|||||||
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.asymmetric.KeyType;
|
||||||
|
import cn.hutool.crypto.asymmetric.SM2;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.ruoyi.common.core.domain.CTResponse;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.ct.domain.AgentAccountGoodUser;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodUserBo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodUserVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||||
|
import com.ruoyi.ct.service.*;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping("free-api/v1.0.0")
|
||||||
|
public class APIFreeController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CTService ctService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentAccountService agentAccountService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentAccountGoodService agentAccountGoodService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentAccountGoodUserService agentAccountGoodUserService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentService agentService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentOrderService agentOrderService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IGoodService goodService;
|
||||||
|
|
||||||
|
private AgentAccountGoodVo checkCode(String code) {
|
||||||
|
try {
|
||||||
|
byte[] decodedBytes = Base64.getDecoder().decode(code); // 对Base64字符串进行解码得到byte数组
|
||||||
|
code = new String(decodedBytes);
|
||||||
|
String[] codes = code.split(",");
|
||||||
|
String agentAccountGoodId = codes[0];
|
||||||
|
String agentAccountId = codes[1];
|
||||||
|
String goodId = codes[2];
|
||||||
|
log.error("agentAccountGoodId: "+ agentAccountGoodId);
|
||||||
|
log.error("agentAccountId: "+ agentAccountId);
|
||||||
|
log.error("goodId: "+ goodId);
|
||||||
|
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = agentAccountGoodService.queryById(Long.valueOf(agentAccountGoodId));
|
||||||
|
log.error("agentAccountGoodVo: "+agentAccountGoodVo);
|
||||||
|
log.error("agentAccountId: "+ agentAccountId.equals(agentAccountGoodVo.getAgentAccountId().toString()));
|
||||||
|
log.error("goodId: "+ goodId.equals(agentAccountGoodVo.getGoodId().toString()));
|
||||||
|
if (ObjectUtils.isNotNull(agentAccountGoodVo)
|
||||||
|
&& agentAccountId.equals(agentAccountGoodVo.getAgentAccountId().toString())
|
||||||
|
&& goodId.equals(agentAccountGoodVo.getGoodId().toString())) {
|
||||||
|
return agentAccountGoodVo;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查有效性,用于H5
|
||||||
|
* @param code base64加密后数据,agentAccountGoodId+agentAccountId+goodId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/check")
|
||||||
|
public R<JSONObject> check(@RequestParam String code) {
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = checkCode(code);
|
||||||
|
if (ObjectUtils.isNotNull(agentAccountGoodVo)) {
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
GoodVo goodVo = goodService.queryById(agentAccountGoodVo.getGoodId());
|
||||||
|
data.set("title", goodVo.getName());
|
||||||
|
data.set("images", agentAccountGoodVo.getImages());
|
||||||
|
data.set("remark", agentAccountGoodVo.getRemark());
|
||||||
|
return R.ok(data);
|
||||||
|
}
|
||||||
|
return R.fail(CODE_ERROR, "活动不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情,用于上传用户信息页面
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public R<JSONObject> detail(@RequestParam String code, @RequestParam String verifyCode) {
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = checkCode(code);
|
||||||
|
if (ObjectUtils.isNotEmpty(agentAccountGoodVo) && agentAccountGoodVo.getTmpPassword().equals(verifyCode)) {
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.set("registerCount", agentAccountGoodVo.getRegisterCount());
|
||||||
|
data.set("registeredCount", agentAccountGoodVo.getCompleteCount() + agentAccountGoodVo.getWaitCount());
|
||||||
|
data.set("verifyCount", agentAccountGoodVo.getVerifyCount());
|
||||||
|
data.set("verifiedCount", agentAccountGoodVo.getVerifiedCount());
|
||||||
|
return R.ok(data);
|
||||||
|
}
|
||||||
|
return R.fail(CODE_ERROR, "活动不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 号码列表,用于H5
|
||||||
|
* @param request
|
||||||
|
* @param code
|
||||||
|
* @param page
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getNumberList")
|
||||||
|
public R<List<JSONObject>> getNumberList(HttpServletRequest request, @RequestParam String code, @RequestParam Integer page, @RequestParam Integer pageSize) {
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = checkCode(code);
|
||||||
|
if (ObjectUtils.isEmpty(agentAccountGoodVo)) {
|
||||||
|
return R.fail(CODE_ERROR, "活动不存在");
|
||||||
|
}
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
AgentAccountVo agentAccountVo = agentAccountService.queryById(agentAccountGoodVo.getAgentAccountId());
|
||||||
|
try {
|
||||||
|
List<JSONObject> data = ctService.selectNumber(agentAccountVo.getPersonnelId(), agentAccountGoodVo.getSaleId(), String.valueOf(page), String.valueOf(pageSize));
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 1, "", data.toString());
|
||||||
|
return R.ok(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 1, "电信请求异常", "[]");
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return R.ok(new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交订单,用于H5
|
||||||
|
* @param request
|
||||||
|
* @param code
|
||||||
|
* @param requestBody
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("confirmOrder")
|
||||||
|
public R<String> confirmOrder(HttpServletRequest request, @RequestParam String code,
|
||||||
|
@RequestBody JSONObject requestBody) {
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = checkCode(code);
|
||||||
|
if (ObjectUtils.isEmpty(agentAccountGoodVo)) {
|
||||||
|
return R.fail(CODE_ERROR, "活动不存在");
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = agentAccountService.queryById(agentAccountGoodVo.getAgentAccountId());
|
||||||
|
System.out.println("requestBody = " + requestBody);
|
||||||
|
AgentOrderBo agentOrderBo = requestBody.toBean(AgentOrderBo.class);
|
||||||
|
// 填充固定数据
|
||||||
|
agentOrderBo.setAgentName(agentAccountVo.getAgentName());
|
||||||
|
agentOrderBo.setAgentId(agentAccountVo.getAgentId());
|
||||||
|
agentOrderBo.setStoreId("13");
|
||||||
|
agentOrderBo.setSerialNumber(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
agentOrderBo.setStatus("0");
|
||||||
|
agentOrderBo.setPersonnelId(agentAccountVo.getPersonnelId());
|
||||||
|
agentOrderBo.setCreateTime(new Date());
|
||||||
|
agentOrderBo.setOrderType(1);
|
||||||
|
{
|
||||||
|
agentOrderBo.setAgentAccountId(agentAccountGoodVo.getId());
|
||||||
|
agentOrderBo.setSaleId(agentAccountGoodVo.getSaleId());
|
||||||
|
GoodVo goodVo = goodService.queryById(agentAccountGoodVo.getGoodId());
|
||||||
|
agentOrderBo.setTitle(goodVo.getName());
|
||||||
|
agentOrderBo.setContent(goodVo.getContent());
|
||||||
|
|
||||||
|
// 校验用户信息,姓名、身份证、手机号
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getName())) {
|
||||||
|
log.error("姓名为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "姓名为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getIdCard())) {
|
||||||
|
log.error("身份证号为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "身份证号为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getContactMobile())) {
|
||||||
|
log.error("手机号为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "手机号为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验地址信息
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getProvince())) {
|
||||||
|
log.error("省为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "省为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getCity())) {
|
||||||
|
log.error("市为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "市为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getCounty())) {
|
||||||
|
log.error("区为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "区为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getInstalledAddress())) {
|
||||||
|
log.error("地址为空");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "地址为空", null);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getInstallAddress())) {
|
||||||
|
agentOrderBo.setInstallAddress(agentOrderBo.getInstalledAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验数量
|
||||||
|
if (agentAccountGoodVo.getIsNeedVerify() == 1) {
|
||||||
|
Integer registerCount = agentAccountGoodVo.getRegisterCount();
|
||||||
|
Integer completeCount = agentAccountGoodVo.getCompleteCount();
|
||||||
|
Integer waitCount = agentAccountGoodVo.getWaitCount();;
|
||||||
|
Integer verifyCount = agentAccountGoodVo.getVerifyCount();
|
||||||
|
Integer verifiedCount = agentAccountGoodVo.getVerifiedCount();
|
||||||
|
|
||||||
|
if (registerCount > 0 && completeCount+waitCount >= registerCount) {
|
||||||
|
// 申请数量已到达上限
|
||||||
|
return R.fail(ERROR_CODE_VERIFY, "该推广码下单数量已到达上限");
|
||||||
|
}
|
||||||
|
if (verifyCount > 0) {
|
||||||
|
if (verifiedCount >= verifyCount) {
|
||||||
|
// 使用录入人员信息的数量已到达上限
|
||||||
|
return R.fail(ERROR_CODE_VERIFY, "该推广码下单数量已到达上限");
|
||||||
|
}
|
||||||
|
AgentAccountGoodUserBo agentAccountGoodUserBo = new AgentAccountGoodUserBo();
|
||||||
|
agentAccountGoodUserBo.setAgentAccountGoodId(agentAccountGoodVo.getId());
|
||||||
|
agentAccountGoodUserBo.setName(agentOrderBo.getName());
|
||||||
|
agentAccountGoodUserBo.setMobile(agentOrderBo.getContactMobile());
|
||||||
|
agentAccountGoodUserBo.setIdCardNo(agentOrderBo.getIdCard());
|
||||||
|
int c = agentAccountGoodUserService.queryList(agentAccountGoodUserBo).size();
|
||||||
|
if (c == 0) {
|
||||||
|
// 人员不在名单范围内
|
||||||
|
return R.fail(ERROR_CODE_VERIFY, "非授权用户");
|
||||||
|
}
|
||||||
|
AgentAccountGoodBo agentAccountGoodBo = new AgentAccountGoodBo();
|
||||||
|
agentAccountGoodBo.setVerifiedCount(agentAccountGoodVo.getVerifiedCount() + 1);
|
||||||
|
agentAccountGoodBo.setWaitCount(agentAccountGoodVo.getWaitCount() + 1);
|
||||||
|
agentAccountGoodBo.setId(agentAccountGoodVo.getId());
|
||||||
|
agentAccountGoodService.updateByBo(agentAccountGoodBo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 保存数据
|
||||||
|
try {
|
||||||
|
CTResponse<String> response = ctService.saveOrder(agentOrderBo.getName(), agentOrderBo.getIdCard(), agentOrderBo.getContactMobile(),
|
||||||
|
agentOrderBo.getInstalledAddress(), agentOrderBo.getSaleId(), agentOrderBo.getStoreId(),
|
||||||
|
agentOrderBo.getPersonnelId(), agentOrderBo.getProvince(), agentOrderBo.getCity(),
|
||||||
|
agentOrderBo.getCounty(), agentOrderBo.getSerialNumber(), agentOrderBo.getNumber(),
|
||||||
|
agentOrderBo.getLogiRemark(), agentOrderBo.getPageUrl(), agentOrderBo.getRemark(),
|
||||||
|
agentOrderBo.getInstallAddress(), "", "");
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
agentOrderBo.setOrderNum(response.getData());
|
||||||
|
agentOrderBo.setOrderStatus("S1000");
|
||||||
|
agentOrderBo.setStatus("0");
|
||||||
|
agentOrderService.insertByBo(agentOrderBo);
|
||||||
|
return R.ok("操作成功", agentOrderBo.getSerialNumber());
|
||||||
|
} else {
|
||||||
|
// 订单验证失败
|
||||||
|
log.error("电信订单验证失败");
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "电信订单验证失败", response.getMessage());
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLog(request, agentAccountVo.getPersonnelId(), 0, "电信请求异常", "");
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return R.fail(ERROR_CODE_NETWORK, "电信网络异常");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getUserList")
|
||||||
|
public R<TableDataInfo<AgentAccountGoodUserVo>> getUserList(HttpServletRequest request,
|
||||||
|
@RequestParam String code,
|
||||||
|
@RequestParam String verifyCode,
|
||||||
|
@RequestParam Integer page,
|
||||||
|
@RequestParam Integer pageSize) {
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = checkCode(code);
|
||||||
|
if (ObjectUtils.isEmpty(agentAccountGoodVo) || !agentAccountGoodVo.getTmpPassword().equals(verifyCode)) {
|
||||||
|
return R.fail(CODE_ERROR, "活动不存在");
|
||||||
|
}
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
AgentAccountGoodUserBo bo = new AgentAccountGoodUserBo();
|
||||||
|
bo.setAgentAccountGoodId(agentAccountGoodVo.getId());
|
||||||
|
PageQuery pageQuery = new PageQuery();
|
||||||
|
pageQuery.setPageSize(pageSize);
|
||||||
|
pageQuery.setPageNum(page);
|
||||||
|
TableDataInfo<AgentAccountGoodUserVo> tableDataInfo = agentAccountGoodUserService.queryPageList(bo, pageQuery);
|
||||||
|
return R.ok(tableDataInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/saveUser")
|
||||||
|
public R<Void> saveUser(HttpServletRequest request, @RequestParam String code,
|
||||||
|
@RequestParam String verifyCode, @RequestBody AgentAccountGoodUserBo agentAccountGoodUserBo) {
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = checkCode(code);
|
||||||
|
if (ObjectUtils.isEmpty(agentAccountGoodVo) || !agentAccountGoodVo.getTmpPassword().equals(verifyCode)) {
|
||||||
|
return R.fail(CODE_ERROR, "活动不存在");
|
||||||
|
}
|
||||||
|
AgentAccountGoodUserBo bo = new AgentAccountGoodUserBo();
|
||||||
|
bo.setAgentAccountGoodId(agentAccountGoodVo.getId());
|
||||||
|
int c = agentAccountGoodUserService.queryList(bo).size();
|
||||||
|
if (c >= agentAccountGoodVo.getVerifyCount()) {
|
||||||
|
return R.fail(ERROR_CODE_VERIFY, "授权人员名单已达上限");
|
||||||
|
}
|
||||||
|
agentAccountGoodUserBo.setAgentAccountGoodId(agentAccountGoodVo.getId());
|
||||||
|
|
||||||
|
c = agentAccountGoodUserService.queryList(agentAccountGoodUserBo).size();
|
||||||
|
if (c > 0) {
|
||||||
|
return R.fail(ERROR_CODE_VERIFY, "该用户已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
agentAccountGoodUserBo.setCreateTime(new Date());
|
||||||
|
agentAccountGoodUserService.insertByBo(agentAccountGoodUserBo);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/updateUser")
|
||||||
|
public R<Void> updateUser(HttpServletRequest request, @RequestParam String code,
|
||||||
|
@RequestParam String verifyCode, @RequestBody AgentAccountGoodUserBo agentAccountGoodUserBo) {
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = checkCode(code);
|
||||||
|
if (ObjectUtils.isEmpty(agentAccountGoodVo) || !agentAccountGoodVo.getTmpPassword().equals(verifyCode)) {
|
||||||
|
return R.fail(CODE_ERROR, "活动不存在");
|
||||||
|
}
|
||||||
|
agentAccountGoodUserBo.setAgentAccountGoodId(agentAccountGoodVo.getId());
|
||||||
|
agentAccountGoodUserService.updateByBo(agentAccountGoodUserBo);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/removeUser")
|
||||||
|
public R<Void> removeUser(HttpServletRequest request, @RequestParam String code,
|
||||||
|
@RequestParam String verifyCode,
|
||||||
|
@RequestParam Long id) {
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo = checkCode(code);
|
||||||
|
if (ObjectUtils.isEmpty(agentAccountGoodVo) || !agentAccountGoodVo.getTmpPassword().equals(verifyCode)) {
|
||||||
|
return R.fail(CODE_ERROR, "活动不存在");
|
||||||
|
}
|
||||||
|
AgentAccountGoodUser agentAccountGoodUser = new AgentAccountGoodUser();
|
||||||
|
agentAccountGoodUser.setId(id);
|
||||||
|
agentAccountGoodUser.setAgentAccountGoodId(agentAccountGoodVo.getId());
|
||||||
|
agentAccountGoodUserService.deleteByBo(agentAccountGoodUser);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,321 @@
|
|||||||
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.asymmetric.KeyType;
|
||||||
|
import cn.hutool.crypto.asymmetric.SM2;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.ct.domain.AgentOrder;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||||
|
import com.ruoyi.ct.service.CTService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static com.ruoyi.api.controller.BaseController.ERROR_CODE_VERIFY;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/test/v1.0.0")
|
||||||
|
@Slf4j
|
||||||
|
public class APITestController extends BaseTestController {
|
||||||
|
@Resource
|
||||||
|
private CTService ctService;
|
||||||
|
|
||||||
|
@GetMapping("getGoodsList")
|
||||||
|
public R<JSONObject> getGoodsList(HttpServletRequest request, Integer page, Integer pageSize) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
JSONObject resultData = new JSONObject();
|
||||||
|
JSONObject meta = new JSONObject();
|
||||||
|
meta.set("total", 2);
|
||||||
|
meta.set("page", page);
|
||||||
|
meta.set("pageSize", pageSize);
|
||||||
|
resultData.set("meta", meta);
|
||||||
|
resultData.set("objects", JSONUtil.parseArray("[{\"saleId\":\"108002\",\"title\":\"49套餐\",\"content\":\"大概的介绍\"},{\"saleId\":\"107657\",\"title\":\"59套餐\"}]"));
|
||||||
|
return R.ok(resultData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getNumberList")
|
||||||
|
public R<List<JSONObject>> getNumberList(HttpServletRequest request, Integer page, Integer pageSize, String saleId) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
if (ObjectUtils.isNull(saleId) || !SALE_ID.equals(saleId)) {
|
||||||
|
log.error("参数错误");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
List<JSONObject> data = ctService.selectNumber(agentAccountVo.getPersonnelId(), SALE_ID,
|
||||||
|
String.valueOf(page), String.valueOf(pageSize));
|
||||||
|
return R.ok(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return R.ok(new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("confirmOrder")
|
||||||
|
public R<String> confirmOrder(HttpServletRequest request, @RequestBody String body) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
try {
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
body = sm2.decryptStr(body, KeyType.PrivateKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("数据解密错误");
|
||||||
|
return R.fail(ERROR_CODE_ENCRYPT, "数据解密错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject requestBody = JSONUtil.parseObj(body);
|
||||||
|
System.out.println("requestBody = " + requestBody);
|
||||||
|
AgentOrderBo agentOrderBo = requestBody.toBean(AgentOrderBo.class);
|
||||||
|
// 填充固定数据
|
||||||
|
agentOrderBo.setAgentName(agentAccountVo.getAgentName());
|
||||||
|
agentOrderBo.setAgentId(agentAccountVo.getAgentId());
|
||||||
|
agentOrderBo.setStoreId("13");
|
||||||
|
agentOrderBo.setSerialNumber(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
agentOrderBo.setStatus("0");
|
||||||
|
agentOrderBo.setPersonnelId(agentAccountVo.getPersonnelId());
|
||||||
|
agentOrderBo.setCreateTime(new Date());
|
||||||
|
AgentAccountGoodVo agentAccountGoodVo;
|
||||||
|
{
|
||||||
|
// 校验数据
|
||||||
|
// 校验gid
|
||||||
|
String saleId = requestBody.getStr("saleId");
|
||||||
|
if (ObjectUtils.isNull(saleId)) {
|
||||||
|
log.error("saleId为空");
|
||||||
|
System.out.println("saleId为空");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (ObjectUtils.isNull(saleId) || !SALE_ID.equals(saleId)) {
|
||||||
|
log.error("saleId无效");
|
||||||
|
System.out.println("saleId无效");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("saleId格式错误");
|
||||||
|
System.out.println("saleId格式错误");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验用户信息,姓名、身份证、手机号
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getName())) {
|
||||||
|
log.error("姓名为空");
|
||||||
|
System.out.println("姓名为空");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getIdCard())) {
|
||||||
|
log.error("身份证号为空");
|
||||||
|
System.out.println("身份证号为空");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getContactMobile())) {
|
||||||
|
log.error("手机号为空");
|
||||||
|
System.out.println("手机号为空");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验地址信息
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getProvince())) {
|
||||||
|
log.error("省为空");
|
||||||
|
System.out.println("省为空");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getCity())) {
|
||||||
|
log.error("市为空");
|
||||||
|
System.out.println("市为空");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getCounty())) {
|
||||||
|
log.error("区为空");
|
||||||
|
System.out.println("区为空");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getInstalledAddress())) {
|
||||||
|
log.error("地址为空");
|
||||||
|
System.out.println("地址为空");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNull(agentOrderBo.getInstallAddress())) {
|
||||||
|
agentOrderBo.setInstallAddress(agentOrderBo.getInstalledAddress());
|
||||||
|
}
|
||||||
|
// todo 根据代理商提供的验证url验证用户
|
||||||
|
String url = requestBody.getStr("url");
|
||||||
|
if (ObjectUtils.isNotNull("url")) {
|
||||||
|
JSONObject paramMap = new JSONObject();
|
||||||
|
paramMap.set("name", agentOrderBo.getName());
|
||||||
|
paramMap.set("idCard", agentOrderBo.getIdCard());
|
||||||
|
paramMap.set("contactMobile", agentOrderBo.getContactMobile());
|
||||||
|
try {
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
String verifyResult = HttpUtil.post(url, sm2.encryptBase64(paramMap.toString(), KeyType.PublicKey));
|
||||||
|
JSONObject verifyData = JSONUtil.parseObj(verifyResult);
|
||||||
|
if (verifyData.getInt("code") != 200) {
|
||||||
|
log.error("验证不通过");
|
||||||
|
System.out.println("验证不通过");
|
||||||
|
return R.fail(ERROR_CODE_VERIFY, "验证错误");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("验证请求错误");
|
||||||
|
System.out.println("验证请求错误");
|
||||||
|
return R.fail(ERROR_CODE_VERIFY, "验证错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return R.ok("操作成功", UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getOrderList")
|
||||||
|
public R<JSONObject> getOrderList(HttpServletRequest request,
|
||||||
|
Integer page, Integer pageSize,
|
||||||
|
String saleId,
|
||||||
|
String name, String contactMobile, String number) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
System.out.println("saleId = " + saleId);
|
||||||
|
System.out.println("name = " + name);
|
||||||
|
System.out.println("contactMobile = " + contactMobile);
|
||||||
|
System.out.println("number = " + number);
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
if (page == null || page < 1) {
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1 || pageSize > 50) {
|
||||||
|
pageSize = 20;
|
||||||
|
}
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
|
||||||
|
// if (ObjectUtils.isNull(saleId) && ObjectUtils.isNull(name) && ObjectUtils.isNull(contactMobile) && ObjectUtils.isNull(number)) {
|
||||||
|
if (ObjectUtils.isNull(saleId)) {
|
||||||
|
log.error("参数错误");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<AgentOrder> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(AgentOrder::getPersonnelId, agentAccountVo.getPersonnelId());
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(saleId), AgentOrder::getSaleId, saleId);
|
||||||
|
if (ObjectUtils.isNotNull(name)) {
|
||||||
|
try {
|
||||||
|
System.out.println("name = " + sm2.decryptStr(name, KeyType.PrivateKey));
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(name), AgentOrder::getName, sm2.decryptStr(name, KeyType.PrivateKey));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("参数错误");
|
||||||
|
System.out.println("name = " + name);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotNull(contactMobile)) {
|
||||||
|
try {
|
||||||
|
System.out.println("contactMobile = " + sm2.decryptStr(contactMobile, KeyType.PrivateKey));
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(contactMobile), AgentOrder::getContactMobile, sm2.decryptStr(contactMobile, KeyType.PrivateKey));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("参数错误");
|
||||||
|
System.out.println("contactMobile = " + contactMobile);
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotNull(number)) {
|
||||||
|
try {
|
||||||
|
System.out.println("number = " + sm2.decryptStr(number, KeyType.PrivateKey));
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(number), AgentOrder::getNumber, sm2.decryptStr(number, KeyType.PrivateKey));
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("number = " + number);
|
||||||
|
log.error("参数错误");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JSONObject resultData = new JSONObject();
|
||||||
|
JSONObject meta = new JSONObject();
|
||||||
|
meta.set("total", 1);
|
||||||
|
meta.set("page", page);
|
||||||
|
meta.set("pageSize", pageSize);
|
||||||
|
resultData.set("meta", meta);
|
||||||
|
List<JSONObject> objects = new ArrayList<>();
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.set("serialNumber", UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
data.set("name", "李白");
|
||||||
|
data.set("contactMobile", "18900001234");
|
||||||
|
data.set("idCard", "310101200001011234");
|
||||||
|
data.set("number", "19112341234");
|
||||||
|
data.set("status", 0);
|
||||||
|
data.set("orderStatus", "S1005");
|
||||||
|
data.set("createTime", "2023-12-31 00:00:00");
|
||||||
|
data.set("updateTime", "2023-12-31 00:00:00");
|
||||||
|
JSONObject goods = new JSONObject();
|
||||||
|
goods.set("saleId", SALE_ID);
|
||||||
|
goods.set("title", "49套餐");
|
||||||
|
goods.set("content", "49套餐");
|
||||||
|
data.set("bookingGoods", goods);
|
||||||
|
|
||||||
|
objects.add(data);
|
||||||
|
|
||||||
|
resultData.set("objects", sm2.encryptBase64(objects.toString(), KeyType.PublicKey));
|
||||||
|
return R.ok(resultData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getOrderDetail")
|
||||||
|
public R<String> getOrderList(HttpServletRequest request, String serialNumber) {
|
||||||
|
if (!checkAccount(request)) {
|
||||||
|
return R.fail(ERROR_CODE_LOGIN, request.getAttribute("msg").toString());
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = (AgentAccountVo) request.getAttribute("agentAccount");
|
||||||
|
if (ObjectUtils.isNull(serialNumber)) {
|
||||||
|
log.error("参数错误:serialNumber为空");
|
||||||
|
return R.fail(ERROR_CODE_PARAMS, "参数错误");
|
||||||
|
}
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.set("serialNumber", UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
data.set("name", "李白");
|
||||||
|
data.set("contactMobile", "18900001234");
|
||||||
|
data.set("idCard", "310101200001011234");
|
||||||
|
data.set("number", "19112341234");
|
||||||
|
data.set("status", 1);
|
||||||
|
data.set("orderStatus", "S1013");
|
||||||
|
data.set("createTime", "2023-12-31 00:00:00");
|
||||||
|
data.set("updateTime", "2023-12-31 00:00:00");
|
||||||
|
JSONObject goods = new JSONObject();
|
||||||
|
goods.set("saleId", SALE_ID);
|
||||||
|
goods.set("title", "49套餐");
|
||||||
|
goods.set("content", "49套餐");
|
||||||
|
data.set("bookingGoods", goods);
|
||||||
|
data.set("expressNum", "SF001");
|
||||||
|
data.set("routeArr", JSONUtil.parseArray("[{\"fRouteTime\":\"2019-11-23 16:11:45\",\"fStatusName\":\"已提交\",\"fStatusId\":\"S1000\"},{\"fRouteTime\":\"2019-11-23 16:11:50\",\"fStatusName\":\"S1050\",\"fStatusId\":\"S1050\"},{\"fRouteTime\":\"2019-11-23 16:11:56\",\"fStatusName\":\"S105001\",\"fStatusId\":\"S105001\"},{\"fRouteTime\":\"2019-11-23 16:11:57\",\"fStatusName\":\"S100501\",\"fStatusId\":\"S100501\"},{\"fRouteTime\":\"2019-11-23 16:12:19\",\"fStatusName\":\"S100531\",\"fStatusId\":\"S100531\"},{\"fRouteTime\":\"2019-11-23 16:12:21\",\"fStatusName\":\"S100506\",\"fStatusId\":\"S100506\"},{\"fRouteTime\":\"2019-11-24 17:05:01\",\"fStatusName\":\"S100532\",\"fStatusId\":\"S100532\"},{\"fRouteTime\":\"2019-11-25 16:08:12\",\"fStatusName\":\"S1006\",\"fStatusId\":\"S1006\"},{\"fRouteTime\":\"2019-11-25 16:08:12\",\"fStatusName\":\"S101301\",\"fStatusId\":\"S101301\"}]"));
|
||||||
|
data.set("expressRoutes", JSONUtil.parseArray("[{\"updateDate\":\"2019-11-25 16:06:49\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100030\",\"remark\":\"订单提交补录 ICCID/串码:89811111111111;成功;\",\"createStaff\":165124796390,\"logiOrderId\":12444255,\"logiOrderFlowId\":13119474,\"dversion\":0,\"createDate\":\"2019-11-25 16:06:41\"},{\"updateDate\":\"2019-11-25 08:30:17\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100030\",\"remark\":\"预约再送-快递员:张三,电话:13333333333,预约您 2019-11-25 09 时, 再次为您配送快件! \",\"logiOrderId\":12444255,\"logiOrderFlowId\":12973108,\"createDate\":\"2019-11-25 08:29:34\"},{\"updateDate\":\"2019-11-25 08:30:17\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100030\",\"remark\":\"已派送-正在派送途中,将由快递员:张三,电话:13333333333送达, 请您准备签收。 \",\"logiOrderId\":12444255,\"logiOrderFlowId\":12973111,\"createDate\":\"2019-11-25 08:27:24\"},{\"updateDate\":\"2019-11-24 17:04:59\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100029\",\"remark\":\"快件已入库-您的快件正在运送中,已转至商海德中心仓库。\",\"logiOrderId\":12444255,\"logiOrderFlowId\":12796420,\"createDate\":\"2019-11-24 16:49:39\"},{\"updateDate\":\"2019-11-24 17:04:59\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100002\",\"remark\":\"已收件-您的快件已收取成功,我们将尽快为你派送!\",\"logiOrderId\":12444255,\"logiOrderFlowId\":12796421,\"createDate\":\"2019-11-24 16:46:22\"},{\"updateDate\":\"2019-11-24 16:34:17\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100004\",\"remark\":\"打包录入 ICCID/串码:89811111111111;成功;\",\"createStaff\":164294780591,\"logiOrderId\":12444255,\"logiOrderFlowId\":12802391,\"dversion\":0,\"createDate\":\"2019-11-24 16:34:16\"},{\"updateDate\":\"2019-11-24 17:04:59\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100010\",\"remark\":\"待取件\",\"logiOrderId\":12444255,\"logiOrderFlowId\":12796422,\"createDate\":\"2019-11-24 16:10:12\"},{\"updateDate\":\"2019-11-24 16:10:11\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100014\",\"remark\":\"物流单分发成功\",\"logiOrderId\":12444255,\"logiOrderFlowId\":12767190,\"dversion\":0,\"createDate\":\"2019-11-24 16:10:11\"},{\"updateDate\":\"2019-11-24 16:05:54\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100021\",\"createStaff\":115060634224,\"logiOrderId\":12444255,\"logiOrderFlowId\":12793430,\"dversion\":0,\"createDate\":\"2019-11-24 16:05:54\"},{\"updateDate\":\"2019-11-24 13:46:54\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100015\",\"remark\":\"派送通知\",\"logiOrderId\":12444255,\"logiOrderFlowId\":12749286,\"dversion\":0,\"createDate\":\"2019-11-24 13:46:54\"},{\"updateDate\":\"2019-11-23 16:12:02\",\"sourceLogiOrderId\":12444255,\"statusCd\":\"100005\",\"createStaff\":236240021834,\"logiOrderId\":12444255,\"logiOrderFlowId\":12444272,\"dversion\":0,\"createDate\":\"2019-11-23 16:12:02\"}]"));
|
||||||
|
SM2 sm2 = (SM2) request.getAttribute("sm2");
|
||||||
|
return R.ok(null, sm2.encryptBase64(data.toString(), KeyType.PublicKey));
|
||||||
|
}
|
||||||
|
}
|
||||||
165
api/src/main/java/com/ruoyi/api/controller/BaseController.java
Normal file
165
api/src/main/java/com/ruoyi/api/controller/BaseController.java
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.SmUtil;
|
||||||
|
import cn.hutool.crypto.asymmetric.KeyType;
|
||||||
|
import cn.hutool.crypto.asymmetric.SM2;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.ct.domain.ApiLog;
|
||||||
|
import com.ruoyi.ct.domain.bo.ApiLogBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||||
|
import com.ruoyi.ct.service.IAgentAccountService;
|
||||||
|
import com.ruoyi.ct.service.IApiLogService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class BaseController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作成功
|
||||||
|
*/
|
||||||
|
public final static Integer SUCCESS_CODE = 200;
|
||||||
|
/**
|
||||||
|
* 地址错误
|
||||||
|
*/
|
||||||
|
public final static Integer NOT_FOUND_CODE = 404;
|
||||||
|
/**
|
||||||
|
* 服务器异常
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_SYSTEM_CODE = 500;
|
||||||
|
/**
|
||||||
|
* AppId 或 AppSecret错误
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_CODE_LOGIN = 1000;
|
||||||
|
/**
|
||||||
|
* 参数错误
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_CODE_PARAMS = 1001;
|
||||||
|
/**
|
||||||
|
* 解密错误
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_CODE_ENCRYPT = 1002;
|
||||||
|
/**
|
||||||
|
* 电信网络异常
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_CODE_NETWORK = 1003;
|
||||||
|
/**
|
||||||
|
* 验证错误
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_CODE_VERIFY = 1004;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* H5验证错误
|
||||||
|
*/
|
||||||
|
public final static Integer CODE_ERROR = 1005;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentAccountService iAgentAccountService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IApiLogService apiLogService;
|
||||||
|
|
||||||
|
public boolean checkAccount(HttpServletRequest httpRequest) {
|
||||||
|
String appId = httpRequest.getHeader("x-ct-appid");
|
||||||
|
String appPwd = httpRequest.getHeader("x-ct-pwd");
|
||||||
|
System.out.println("appPwd = " + appPwd);
|
||||||
|
System.out.println("appId = " + appId);
|
||||||
|
if (ObjectUtils.isNull(appId) || ObjectUtils.isNull(appPwd)) {
|
||||||
|
log.error("账号或密码为空");
|
||||||
|
httpRequest.setAttribute("msg", "账号或密码为空");
|
||||||
|
saveLog(httpRequest, null, 0, "账号或密码为空", null);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = iAgentAccountService.getByAppId(appId);
|
||||||
|
|
||||||
|
System.out.println("agentAccountVo = " + agentAccountVo);
|
||||||
|
if (ObjectUtils.isNull(agentAccountVo)) {
|
||||||
|
log.error("账号错误");
|
||||||
|
httpRequest.setAttribute("msg", "账号错误");
|
||||||
|
saveLog(httpRequest, agentAccountVo.getPersonnelId(), 0, "账号错误", null);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String ip = StringUtils.blankToDefault(httpRequest.getHeader("x-real-ip"), httpRequest.getRemoteAddr());
|
||||||
|
if (ObjectUtils.isNotNull(agentAccountVo.getIpList())) {
|
||||||
|
boolean isWhite = agentAccountVo.getIpList().contains(ip);
|
||||||
|
if (!isWhite) {
|
||||||
|
log.error("IP 不在白名单");
|
||||||
|
httpRequest.setAttribute("msg", "IP 不在白名单");
|
||||||
|
saveLog(httpRequest, agentAccountVo.getPersonnelId(), 0, "IP 不在白名单", null);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SM2 sm2 = SmUtil.sm2(agentAccountVo.getAgentPrivateKey(), agentAccountVo.getPlatformPublicKey());
|
||||||
|
httpRequest.setAttribute("sm2", sm2);
|
||||||
|
String pwd;
|
||||||
|
try {
|
||||||
|
pwd = sm2.decryptStr(appPwd, KeyType.PrivateKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解密错误");
|
||||||
|
httpRequest.setAttribute("msg", "解密错误");
|
||||||
|
saveLog(httpRequest, agentAccountVo.getPersonnelId(), 0, "解密错误", null);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (pwd.equals(agentAccountVo.getAppSecret())) {
|
||||||
|
httpRequest.setAttribute("agentAccount", agentAccountVo);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
log.error("密码错误");
|
||||||
|
httpRequest.setAttribute("msg", "密码错误");
|
||||||
|
saveLog(httpRequest, agentAccountVo.getPersonnelId(), 0, "密码错误", null);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveLog(HttpServletRequest httpRequest, String personnelId, int isSuccess, String msg, String res) {
|
||||||
|
ApiLogBo apiLog = new ApiLogBo();
|
||||||
|
apiLog.setIp(StringUtils.blankToDefault(httpRequest.getHeader("x-real-ip"), httpRequest.getRemoteAddr()));
|
||||||
|
apiLog.setUrl(httpRequest.getRequestURL().toString());
|
||||||
|
System.out.println("httpRequest.getMethod() = " + httpRequest.getMethod());
|
||||||
|
if (httpRequest.getMethod().equals("POST")) {
|
||||||
|
try {
|
||||||
|
InputStream inputStream = httpRequest.getInputStream();
|
||||||
|
// 将输入流转换为字符串
|
||||||
|
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
String line;
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
stringBuilder.append(line);
|
||||||
|
}
|
||||||
|
String requestBody = stringBuilder.toString();
|
||||||
|
apiLog.setRequestBody(requestBody);
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
apiLog.setRequestBody(httpRequest.getQueryString());
|
||||||
|
}
|
||||||
|
JSONObject header = new JSONObject();
|
||||||
|
Enumeration<String> headerKeys = httpRequest.getHeaderNames();
|
||||||
|
while (headerKeys.hasMoreElements()) {
|
||||||
|
String key = headerKeys.nextElement();
|
||||||
|
header.put(key, httpRequest.getHeader(key));
|
||||||
|
}
|
||||||
|
apiLog.setRequestHeader(header.toString());
|
||||||
|
apiLog.setPersonnelId(personnelId);
|
||||||
|
apiLog.setIsSuccess(Long.valueOf(isSuccess));
|
||||||
|
apiLog.setErrorMsg(msg);
|
||||||
|
apiLog.setResponse(res);
|
||||||
|
Date now = new Date();
|
||||||
|
apiLog.setCreateTime(now);
|
||||||
|
apiLog.setCreateBy(String.valueOf(now.getTime()));
|
||||||
|
apiLogService.insertByBo(apiLog);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.SmUtil;
|
||||||
|
import cn.hutool.crypto.asymmetric.KeyType;
|
||||||
|
import cn.hutool.crypto.asymmetric.SM2;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||||
|
import com.ruoyi.ct.service.IAgentAccountService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
@Slf4j
|
||||||
|
public class BaseTestController {
|
||||||
|
/**
|
||||||
|
* 操作成功
|
||||||
|
*/
|
||||||
|
public final static Integer SUCCESS_CODE = 200;
|
||||||
|
/**
|
||||||
|
* 地址错误
|
||||||
|
*/
|
||||||
|
public final static Integer NOT_FOUND_CODE = 404;
|
||||||
|
/**
|
||||||
|
* 服务器异常
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_SYSTEM_CODE = 500;
|
||||||
|
/**
|
||||||
|
* AppId 或 AppSecret错误
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_CODE_LOGIN = 1000;
|
||||||
|
/**
|
||||||
|
* 参数错误
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_CODE_PARAMS = 1001;
|
||||||
|
/**
|
||||||
|
* 解密错误
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_CODE_ENCRYPT = 1002;
|
||||||
|
/**
|
||||||
|
* 电信网络异常
|
||||||
|
*/
|
||||||
|
public final static Integer ERROR_CODE_NETWORK = 1003;
|
||||||
|
|
||||||
|
public final static String APP_ID = "02a42036-fe1f-4ef1-945a-08660a946b38";
|
||||||
|
public final static String APP_SECRET = "ff2b4dd8-5843-475d-ac4e-c41bb77537fc";
|
||||||
|
public final static String PLATFORM_PUBLIC_KEY = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAETyWQQ6VYQkbeW5ELmFFr/U/DAJGocNEd3hunFm4EoRHZD1MZcyqlCR/p/6ICmwZWYTAK3dz96Nabxi6yGOSkCQ==";
|
||||||
|
public final static String PLATFORM_PRIVATE_KEY = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQg006Jj+5NK9HrtnyXNpnb131jV/8CHeo5t2T74WliktCgCgYIKoEcz1UBgi2hRANCAARPJZBDpVhCRt5bkQuYUWv9T8MAkahw0R3eG6cWbgShEdkPUxlzKqUJH+n/ogKbBlZhMArd3P3o1pvGLrIY5KQJ";
|
||||||
|
public final static String AGENT_PUBLIC_KEY = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEZRdaHuSCG8U87+Cmh9LKbgC+DRBEwWpAyN31aCzoE1flWonnZezX2GqbvDdz7a0AxE6+FGEH1lxPYW39XhYupw==";
|
||||||
|
public final static String AGENT_PRIVATE_KEY = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgTjIdgyVigyoyE86vsR+XshZ3c+shTCFO2hgNQpF+HT6gCgYIKoEcz1UBgi2hRANCAARlF1oe5IIbxTzv4KaH0spuAL4NEETBakDI3fVoLOgTV+Vaiedl7NfYapu8N3PtrQDETr4UYQfWXE9hbf1eFi6n";
|
||||||
|
public final static String PERSONNEL_ID = "207202";
|
||||||
|
|
||||||
|
public final static String SALE_ID = "108002";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IAgentAccountService iAgentAccountService;
|
||||||
|
|
||||||
|
public boolean checkAccount(HttpServletRequest httpRequest) {
|
||||||
|
String appId = httpRequest.getHeader("x-ct-appid");
|
||||||
|
String appPwd = httpRequest.getHeader("x-ct-pwd");
|
||||||
|
|
||||||
|
if (ObjectUtils.isNull(appId) || ObjectUtils.isNull(appPwd)) {
|
||||||
|
log.error("账号或密码为空");
|
||||||
|
httpRequest.setAttribute("msg", "账号或密码为空");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
AgentAccountVo agentAccountVo = iAgentAccountService.getByAppId(appId);
|
||||||
|
if (ObjectUtils.isNull(agentAccountVo)) {
|
||||||
|
log.error("账号错误");
|
||||||
|
httpRequest.setAttribute("msg", "账号错误");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
System.out.println("agentAccountVo = " + agentAccountVo);
|
||||||
|
System.out.println("PLATFORM_PUBLIC_KEY:"+PLATFORM_PUBLIC_KEY);
|
||||||
|
System.out.println("AGENT_PRIVATE_KEY:"+AGENT_PRIVATE_KEY);
|
||||||
|
SM2 sm2 = SmUtil.sm2(AGENT_PRIVATE_KEY, PLATFORM_PUBLIC_KEY);
|
||||||
|
httpRequest.setAttribute("sm2", sm2);
|
||||||
|
String pwd;
|
||||||
|
try {
|
||||||
|
pwd = sm2.decryptStr(appPwd, KeyType.PrivateKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解密错误");
|
||||||
|
httpRequest.setAttribute("msg", "解密错误");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (pwd.equals(agentAccountVo.getAppSecret())) {
|
||||||
|
httpRequest.setAttribute("agentAccount", agentAccountVo);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
log.error("密码错误");
|
||||||
|
httpRequest.setAttribute("msg", "密码错误");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
api/src/main/java/com/ruoyi/api/filter/APIFilter.java
Normal file
30
api/src/main/java/com/ruoyi/api/filter/APIFilter.java
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package com.ruoyi.api.filter;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.servlet.*;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class APIFilter implements Filter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||||
|
System.out.println("过滤所有Controller之前");
|
||||||
|
HttpServletRequest httpRequest = (HttpServletRequest) servletRequest;
|
||||||
|
System.out.println("RequestURL=" + httpRequest.getRequestURL());
|
||||||
|
filterChain.doFilter(servletRequest, servletResponse);
|
||||||
|
System.out.println("过滤所有Controller之后");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(FilterConfig filterConfig) throws ServletException {
|
||||||
|
Filter.super.init(filterConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
Filter.super.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
155
api/src/main/resources/application-dev.yml
Normal file
155
api/src/main/resources/application-dev.yml
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
|
||||||
|
--- # 数据源配置
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||||
|
dynamic:
|
||||||
|
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
||||||
|
p6spy: true
|
||||||
|
# 设置默认的数据源或者数据源组,默认值即为 master
|
||||||
|
primary: master
|
||||||
|
# 严格模式 匹配不到数据源则报错
|
||||||
|
strict: true
|
||||||
|
datasource:
|
||||||
|
# 主库数据源
|
||||||
|
master:
|
||||||
|
type: ${spring.datasource.type}
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||||
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||||
|
url: jdbc:mysql://43.140.198.163:3380/ct?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||||
|
username: root
|
||||||
|
password: qaHljgd123.
|
||||||
|
# 从库数据源
|
||||||
|
slave:
|
||||||
|
lazy: true
|
||||||
|
type: ${spring.datasource.type}
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
# oracle:
|
||||||
|
# type: ${spring.datasource.type}
|
||||||
|
# driverClassName: oracle.jdbc.OracleDriver
|
||||||
|
# url: jdbc:oracle:thin:@//localhost:1521/XE
|
||||||
|
# username: ROOT
|
||||||
|
# password: root
|
||||||
|
# hikari:
|
||||||
|
# connectionTestQuery: SELECT 1 FROM DUAL
|
||||||
|
# postgres:
|
||||||
|
# type: ${spring.datasource.type}
|
||||||
|
# driverClassName: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||||
|
# username: root
|
||||||
|
# password: root
|
||||||
|
# sqlserver:
|
||||||
|
# type: ${spring.datasource.type}
|
||||||
|
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
|
||||||
|
# username: SA
|
||||||
|
# password: root
|
||||||
|
hikari:
|
||||||
|
# 最大连接池数量
|
||||||
|
maxPoolSize: 20
|
||||||
|
# 最小空闲线程数量
|
||||||
|
minIdle: 10
|
||||||
|
# 配置获取连接等待超时的时间
|
||||||
|
connectionTimeout: 30000
|
||||||
|
# 校验超时时间
|
||||||
|
validationTimeout: 5000
|
||||||
|
# 空闲连接存活最大时间,默认10分钟
|
||||||
|
idleTimeout: 600000
|
||||||
|
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
|
||||||
|
maxLifetime: 1800000
|
||||||
|
# 连接测试query(配置检测连接是否有效)
|
||||||
|
connectionTestQuery: SELECT 1
|
||||||
|
# 多久检查一次连接的活性
|
||||||
|
keepaliveTime: 30000
|
||||||
|
|
||||||
|
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
|
||||||
|
spring:
|
||||||
|
redis:
|
||||||
|
# 地址
|
||||||
|
host: 43.140.198.163
|
||||||
|
# 端口,默认为6379
|
||||||
|
port: 3612
|
||||||
|
# 数据库索引
|
||||||
|
database: 4
|
||||||
|
# 密码(如没有密码请注释掉)
|
||||||
|
password: qaRedisPass123.
|
||||||
|
# 连接超时时间
|
||||||
|
timeout: 10s
|
||||||
|
# 是否开启ssl
|
||||||
|
ssl: false
|
||||||
|
|
||||||
|
redisson:
|
||||||
|
# redis key前缀
|
||||||
|
keyPrefix:
|
||||||
|
# 线程池数量
|
||||||
|
threads: 4
|
||||||
|
# Netty线程池数量
|
||||||
|
nettyThreads: 8
|
||||||
|
# 单节点配置
|
||||||
|
singleServerConfig:
|
||||||
|
# 客户端名称
|
||||||
|
clientName: ${ruoyi.name}
|
||||||
|
# 最小空闲连接数
|
||||||
|
connectionMinimumIdleSize: 8
|
||||||
|
# 连接池大小
|
||||||
|
connectionPoolSize: 32
|
||||||
|
# 连接空闲超时,单位:毫秒
|
||||||
|
idleConnectionTimeout: 10000
|
||||||
|
# 命令等待超时,单位:毫秒
|
||||||
|
timeout: 3000
|
||||||
|
# 发布和订阅连接池大小
|
||||||
|
subscriptionConnectionPoolSize: 50
|
||||||
|
|
||||||
|
--- # mail 邮件发送
|
||||||
|
mail:
|
||||||
|
enabled: false
|
||||||
|
host: smtp.163.com
|
||||||
|
port: 465
|
||||||
|
# 是否需要用户名密码验证
|
||||||
|
auth: true
|
||||||
|
# 发送方,遵循RFC-822标准
|
||||||
|
from: xxx@163.com
|
||||||
|
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
|
||||||
|
user: xxx@163.com
|
||||||
|
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
|
||||||
|
pass: xxxxxxxxxx
|
||||||
|
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
|
||||||
|
starttlsEnable: true
|
||||||
|
# 使用SSL安全连接
|
||||||
|
sslEnable: true
|
||||||
|
# SMTP超时时长,单位毫秒,缺省值不超时
|
||||||
|
timeout: 0
|
||||||
|
# Socket连接超时值,单位毫秒,缺省值不超时
|
||||||
|
connectionTimeout: 0
|
||||||
|
|
||||||
|
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
|
||||||
|
# https://wind.kim/doc/start 文档地址 各个厂商可同时使用
|
||||||
|
sms:
|
||||||
|
# 阿里云 dysmsapi.aliyuncs.com
|
||||||
|
alibaba:
|
||||||
|
#请求地址 默认为 dysmsapi.aliyuncs.com 如无特殊改变可以不用设置
|
||||||
|
requestUrl: dysmsapi.aliyuncs.com
|
||||||
|
#阿里云的accessKey
|
||||||
|
accessKeyId: xxxxxxx
|
||||||
|
#阿里云的accessKeySecret
|
||||||
|
accessKeySecret: xxxxxxx
|
||||||
|
#短信签名
|
||||||
|
signature: 测试
|
||||||
|
tencent:
|
||||||
|
#请求地址默认为 sms.tencentcloudapi.com 如无特殊改变可不用设置
|
||||||
|
requestUrl: sms.tencentcloudapi.com
|
||||||
|
#腾讯云的accessKey
|
||||||
|
accessKeyId: xxxxxxx
|
||||||
|
#腾讯云的accessKeySecret
|
||||||
|
accessKeySecret: xxxxxxx
|
||||||
|
#短信签名
|
||||||
|
signature: 测试
|
||||||
|
#短信sdkAppId
|
||||||
|
sdkAppId: appid
|
||||||
|
#地域信息默认为 ap-guangzhou 如无特殊改变可不用设置
|
||||||
|
territory: ap-guangzhou
|
||||||
189
api/src/main/resources/application-prod.yml
Normal file
189
api/src/main/resources/application-prod.yml
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
--- # 临时文件存储位置 避免临时文件被系统清理报错
|
||||||
|
spring.servlet.multipart.location: /ruoyi/server/temp
|
||||||
|
|
||||||
|
--- # 监控中心配置
|
||||||
|
spring.boot.admin.client:
|
||||||
|
# 增加客户端开关
|
||||||
|
enabled: false
|
||||||
|
url: http://localhost:9090/admin
|
||||||
|
instance:
|
||||||
|
service-host-type: IP
|
||||||
|
username: ruoyi
|
||||||
|
password: 123456
|
||||||
|
|
||||||
|
--- # xxl-job 配置
|
||||||
|
xxl.job:
|
||||||
|
# 执行器开关
|
||||||
|
enabled: false
|
||||||
|
# 调度中心地址:如调度中心集群部署存在多个地址则用逗号分隔。
|
||||||
|
admin-addresses: http://localhost:9100/xxl-job-admin
|
||||||
|
# 执行器通讯TOKEN:非空时启用
|
||||||
|
access-token: xxl-job
|
||||||
|
executor:
|
||||||
|
# 执行器AppName:执行器心跳注册分组依据;为空则关闭自动注册
|
||||||
|
appname: xxl-job-executor
|
||||||
|
# 28080 端口 随着主应用端口飘逸 避免集群冲突
|
||||||
|
port: 2${server.port}
|
||||||
|
# 执行器注册:默认IP:PORT
|
||||||
|
address:
|
||||||
|
# 执行器IP:默认自动获取IP
|
||||||
|
ip:
|
||||||
|
# 执行器运行日志文件存储磁盘路径
|
||||||
|
logpath: ./logs/xxl-job
|
||||||
|
# 执行器日志文件保存天数:大于3生效
|
||||||
|
logretentiondays: 30
|
||||||
|
|
||||||
|
--- # 数据源配置
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||||
|
dynamic:
|
||||||
|
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
||||||
|
p6spy: false
|
||||||
|
# 设置默认的数据源或者数据源组,默认值即为 master
|
||||||
|
primary: master
|
||||||
|
# 严格模式 匹配不到数据源则报错
|
||||||
|
strict: true
|
||||||
|
datasource:
|
||||||
|
# 主库数据源
|
||||||
|
master:
|
||||||
|
type: ${spring.datasource.type}
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||||
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||||
|
url: jdbc:mysql://127.0.0.1/ct?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||||
|
username: ct
|
||||||
|
password: K4edKweSkFKMPk68
|
||||||
|
# 从库数据源
|
||||||
|
slave:
|
||||||
|
lazy: true
|
||||||
|
type: ${spring.datasource.type}
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
# oracle:
|
||||||
|
# type: ${spring.datasource.type}
|
||||||
|
# driverClassName: oracle.jdbc.OracleDriver
|
||||||
|
# url: jdbc:oracle:thin:@//localhost:1521/XE
|
||||||
|
# username: ROOT
|
||||||
|
# password: root
|
||||||
|
# hikari:
|
||||||
|
# connectionTestQuery: SELECT 1 FROM DUAL
|
||||||
|
# postgres:
|
||||||
|
# type: ${spring.datasource.type}
|
||||||
|
# driverClassName: org.postgresql.Driver
|
||||||
|
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||||
|
# username: root
|
||||||
|
# password: root
|
||||||
|
# sqlserver:
|
||||||
|
# type: ${spring.datasource.type}
|
||||||
|
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
|
||||||
|
# username: SA
|
||||||
|
# password: root
|
||||||
|
hikari:
|
||||||
|
# 最大连接池数量
|
||||||
|
maxPoolSize: 20
|
||||||
|
# 最小空闲线程数量
|
||||||
|
minIdle: 10
|
||||||
|
# 配置获取连接等待超时的时间
|
||||||
|
connectionTimeout: 30000
|
||||||
|
# 校验超时时间
|
||||||
|
validationTimeout: 5000
|
||||||
|
# 空闲连接存活最大时间,默认10分钟
|
||||||
|
idleTimeout: 600000
|
||||||
|
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
|
||||||
|
maxLifetime: 1800000
|
||||||
|
# 连接测试query(配置检测连接是否有效)
|
||||||
|
connectionTestQuery: SELECT 1
|
||||||
|
# 多久检查一次连接的活性
|
||||||
|
keepaliveTime: 30000
|
||||||
|
|
||||||
|
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
|
||||||
|
spring:
|
||||||
|
redis:
|
||||||
|
# 地址
|
||||||
|
host: 127.0.0.1
|
||||||
|
# 端口,默认为6379
|
||||||
|
port: 6379
|
||||||
|
# 数据库索引
|
||||||
|
database: 1
|
||||||
|
# 密码(如没有密码请注释掉)
|
||||||
|
# password: qaRedisPass123.
|
||||||
|
# 连接超时时间
|
||||||
|
timeout: 10s
|
||||||
|
# 是否开启ssl
|
||||||
|
ssl: false
|
||||||
|
|
||||||
|
redisson:
|
||||||
|
# redis key前缀
|
||||||
|
keyPrefix:
|
||||||
|
# 线程池数量
|
||||||
|
threads: 16
|
||||||
|
# Netty线程池数量
|
||||||
|
nettyThreads: 32
|
||||||
|
# 单节点配置
|
||||||
|
singleServerConfig:
|
||||||
|
# 客户端名称
|
||||||
|
clientName: ${ruoyi.name}
|
||||||
|
# 最小空闲连接数
|
||||||
|
connectionMinimumIdleSize: 32
|
||||||
|
# 连接池大小
|
||||||
|
connectionPoolSize: 64
|
||||||
|
# 连接空闲超时,单位:毫秒
|
||||||
|
idleConnectionTimeout: 10000
|
||||||
|
# 命令等待超时,单位:毫秒
|
||||||
|
timeout: 3000
|
||||||
|
# 发布和订阅连接池大小
|
||||||
|
subscriptionConnectionPoolSize: 50
|
||||||
|
|
||||||
|
--- # mail 邮件发送
|
||||||
|
mail:
|
||||||
|
enabled: false
|
||||||
|
host: smtp.163.com
|
||||||
|
port: 465
|
||||||
|
# 是否需要用户名密码验证
|
||||||
|
auth: true
|
||||||
|
# 发送方,遵循RFC-822标准
|
||||||
|
from: xxx@163.com
|
||||||
|
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
|
||||||
|
user: xxx@163.com
|
||||||
|
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
|
||||||
|
pass: xxxxxxxxxx
|
||||||
|
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
|
||||||
|
starttlsEnable: true
|
||||||
|
# 使用SSL安全连接
|
||||||
|
sslEnable: true
|
||||||
|
# SMTP超时时长,单位毫秒,缺省值不超时
|
||||||
|
timeout: 0
|
||||||
|
# Socket连接超时值,单位毫秒,缺省值不超时
|
||||||
|
connectionTimeout: 0
|
||||||
|
|
||||||
|
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
|
||||||
|
# https://wind.kim/doc/start 文档地址 各个厂商可同时使用
|
||||||
|
sms:
|
||||||
|
# 阿里云 dysmsapi.aliyuncs.com
|
||||||
|
alibaba:
|
||||||
|
#请求地址 默认为 dysmsapi.aliyuncs.com 如无特殊改变可以不用设置
|
||||||
|
requestUrl: dysmsapi.aliyuncs.com
|
||||||
|
#阿里云的accessKey
|
||||||
|
accessKeyId: xxxxxxx
|
||||||
|
#阿里云的accessKeySecret
|
||||||
|
accessKeySecret: xxxxxxx
|
||||||
|
#短信签名
|
||||||
|
signature: 测试
|
||||||
|
tencent:
|
||||||
|
#请求地址默认为 sms.tencentcloudapi.com 如无特殊改变可不用设置
|
||||||
|
requestUrl: sms.tencentcloudapi.com
|
||||||
|
#腾讯云的accessKey
|
||||||
|
accessKeyId: xxxxxxx
|
||||||
|
#腾讯云的accessKeySecret
|
||||||
|
accessKeySecret: xxxxxxx
|
||||||
|
#短信签名
|
||||||
|
signature: 测试
|
||||||
|
#短信sdkAppId
|
||||||
|
sdkAppId: appid
|
||||||
|
#地域信息默认为 ap-guangzhou 如无特殊改变可不用设置
|
||||||
|
territory: ap-guangzhou
|
||||||
276
api/src/main/resources/application.yml
Normal file
276
api/src/main/resources/application.yml
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
# 项目相关配置
|
||||||
|
ruoyi:
|
||||||
|
# 名称
|
||||||
|
name: CT-API
|
||||||
|
# 版本
|
||||||
|
version: ${ruoyi-vue-plus.version}
|
||||||
|
# 版权年份
|
||||||
|
copyrightYear: 2023
|
||||||
|
# 缓存懒加载
|
||||||
|
cacheLazy: false
|
||||||
|
|
||||||
|
captcha:
|
||||||
|
# 页面 <参数设置> 可开启关闭 验证码校验
|
||||||
|
# 验证码类型 math 数组计算 char 字符验证
|
||||||
|
type: MATH
|
||||||
|
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
|
||||||
|
category: CIRCLE
|
||||||
|
# 数字验证码位数
|
||||||
|
numberLength: 1
|
||||||
|
# 字符验证码长度
|
||||||
|
charLength: 4
|
||||||
|
|
||||||
|
# 开发环境配置
|
||||||
|
server:
|
||||||
|
# 服务器的HTTP端口,默认为8080
|
||||||
|
port: 8181
|
||||||
|
servlet:
|
||||||
|
# 应用的访问路径
|
||||||
|
context-path: /
|
||||||
|
# undertow 配置
|
||||||
|
undertow:
|
||||||
|
# HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
|
||||||
|
max-http-post-size: -1
|
||||||
|
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
|
||||||
|
# 每块buffer的空间大小,越小的空间被利用越充分
|
||||||
|
buffer-size: 512
|
||||||
|
# 是否分配的直接内存
|
||||||
|
direct-buffers: true
|
||||||
|
threads:
|
||||||
|
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
|
||||||
|
io: 8
|
||||||
|
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
|
||||||
|
worker: 256
|
||||||
|
|
||||||
|
# 日志配置
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.ruoyi: @logging.level@
|
||||||
|
org.springframework: warn
|
||||||
|
config: classpath:logback-plus.xml
|
||||||
|
|
||||||
|
# 用户配置
|
||||||
|
user:
|
||||||
|
password:
|
||||||
|
# 密码最大错误次数
|
||||||
|
maxRetryCount: 5
|
||||||
|
# 密码锁定时间(默认10分钟)
|
||||||
|
lockTime: 10
|
||||||
|
|
||||||
|
# Spring配置
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: ${ruoyi.name}
|
||||||
|
# 资源信息
|
||||||
|
messages:
|
||||||
|
# 国际化资源文件路径
|
||||||
|
basename: i18n/messages
|
||||||
|
profiles:
|
||||||
|
active: @profiles.active@
|
||||||
|
# 文件上传
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
# 单个文件大小
|
||||||
|
max-file-size: 10MB
|
||||||
|
# 设置总上传的文件大小
|
||||||
|
max-request-size: 20MB
|
||||||
|
# 服务模块
|
||||||
|
devtools:
|
||||||
|
restart:
|
||||||
|
# 热部署开关
|
||||||
|
enabled: true
|
||||||
|
mvc:
|
||||||
|
throw-exception-if-no-handler-found: true
|
||||||
|
format:
|
||||||
|
date-time: yyyy-MM-dd HH:mm:ss
|
||||||
|
jackson:
|
||||||
|
# 日期格式化
|
||||||
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
serialization:
|
||||||
|
# 格式化输出
|
||||||
|
indent_output: false
|
||||||
|
# 忽略无法转换的对象
|
||||||
|
fail_on_empty_beans: false
|
||||||
|
deserialization:
|
||||||
|
# 允许对象忽略json中不存在的属性
|
||||||
|
fail_on_unknown_properties: false
|
||||||
|
|
||||||
|
# Sa-Token配置
|
||||||
|
sa-token:
|
||||||
|
# token名称 (同时也是cookie名称)
|
||||||
|
token-name: Authorization
|
||||||
|
# token有效期 设为一天 (必定过期) 单位: 秒
|
||||||
|
timeout: 86400
|
||||||
|
# 多端不同 token 有效期 可查看 LoginHelper.loginByDevice 方法自定义
|
||||||
|
# token最低活跃时间 (指定时间无操作就过期) 单位: 秒
|
||||||
|
active-timeout: 18000
|
||||||
|
# 允许动态设置 token 有效期
|
||||||
|
dynamic-active-timeout: true
|
||||||
|
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||||
|
is-concurrent: true
|
||||||
|
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||||
|
is-share: false
|
||||||
|
# 是否尝试从header里读取token
|
||||||
|
is-read-header: true
|
||||||
|
# 是否尝试从cookie里读取token
|
||||||
|
is-read-cookie: false
|
||||||
|
# token前缀
|
||||||
|
token-prefix: "Bearer"
|
||||||
|
# jwt秘钥
|
||||||
|
jwt-secret-key: abcdefghijklmnopqrstuvwxyz
|
||||||
|
|
||||||
|
# security配置
|
||||||
|
security:
|
||||||
|
# 排除路径
|
||||||
|
excludes:
|
||||||
|
# 静态资源
|
||||||
|
- /*.html
|
||||||
|
- /**/*.html
|
||||||
|
- /**/*.css
|
||||||
|
- /**/*.js
|
||||||
|
# 公共路径
|
||||||
|
- /favicon.ico
|
||||||
|
- /error
|
||||||
|
# swagger 文档配置
|
||||||
|
- /*/api-docs
|
||||||
|
- /*/api-docs/**
|
||||||
|
# actuator 监控配置
|
||||||
|
- /actuator
|
||||||
|
- /actuator/**
|
||||||
|
|
||||||
|
# MyBatisPlus配置
|
||||||
|
# https://baomidou.com/config/
|
||||||
|
mybatis-plus:
|
||||||
|
# 不支持多包, 如有需要可在注解配置 或 提升扫包等级
|
||||||
|
# 例如 com.**.**.mapper
|
||||||
|
mapperPackage: com.ruoyi.**.mapper
|
||||||
|
# 对应的 XML 文件位置
|
||||||
|
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
||||||
|
# 实体扫描,多个package用逗号或者分号分隔
|
||||||
|
typeAliasesPackage: com.ruoyi.**.domain
|
||||||
|
# 启动时是否检查 MyBatis XML 文件的存在,默认不检查
|
||||||
|
checkConfigLocation: false
|
||||||
|
configuration:
|
||||||
|
# 自动驼峰命名规则(camel case)映射
|
||||||
|
mapUnderscoreToCamelCase: true
|
||||||
|
# MyBatis 自动映射策略
|
||||||
|
# NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射
|
||||||
|
autoMappingBehavior: PARTIAL
|
||||||
|
# MyBatis 自动映射时未知列或未知属性处理策
|
||||||
|
# NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息
|
||||||
|
autoMappingUnknownColumnBehavior: NONE
|
||||||
|
# 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
# 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||||
|
# 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl
|
||||||
|
logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||||
|
global-config:
|
||||||
|
# 是否打印 Logo banner
|
||||||
|
banner: true
|
||||||
|
dbConfig:
|
||||||
|
# 主键类型
|
||||||
|
# AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
|
||||||
|
idType: AUTO
|
||||||
|
# 逻辑已删除值
|
||||||
|
logicDeleteValue: 2
|
||||||
|
# 逻辑未删除值
|
||||||
|
logicNotDeleteValue: 0
|
||||||
|
# 字段验证策略之 insert,在 insert 的时候的字段验证策略
|
||||||
|
# IGNORED 忽略 NOT_NULL 非NULL NOT_EMPTY 非空 DEFAULT 默认 NEVER 不加入 SQL
|
||||||
|
insertStrategy: NOT_NULL
|
||||||
|
# 字段验证策略之 update,在 update 的时候的字段验证策略
|
||||||
|
updateStrategy: NOT_NULL
|
||||||
|
# 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件
|
||||||
|
where-strategy: NOT_NULL
|
||||||
|
|
||||||
|
# 数据加密
|
||||||
|
mybatis-encryptor:
|
||||||
|
# 是否开启加密
|
||||||
|
enable: false
|
||||||
|
# 默认加密算法
|
||||||
|
algorithm: BASE64
|
||||||
|
# 编码方式 BASE64/HEX。默认BASE64
|
||||||
|
encode: BASE64
|
||||||
|
# 安全秘钥 对称算法的秘钥 如:AES,SM4
|
||||||
|
password:
|
||||||
|
# 公私钥 非对称算法的公私钥 如:SM2,RSA
|
||||||
|
publicKey:
|
||||||
|
privateKey:
|
||||||
|
|
||||||
|
springdoc:
|
||||||
|
api-docs:
|
||||||
|
# 是否开启接口文档
|
||||||
|
enabled: false
|
||||||
|
# swagger-ui:
|
||||||
|
# # 持久化认证数据
|
||||||
|
# persistAuthorization: true
|
||||||
|
info:
|
||||||
|
# 标题
|
||||||
|
title: '标题:${ruoyi.name}后台管理系统_接口文档'
|
||||||
|
# 描述
|
||||||
|
description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...'
|
||||||
|
# 版本
|
||||||
|
version: '版本号: ${ruoyi-vue-plus.version}'
|
||||||
|
# 作者信息
|
||||||
|
contact:
|
||||||
|
name: Lion Li
|
||||||
|
email: crazylionli@163.com
|
||||||
|
url: https://gitee.com/dromara/RuoYi-Vue-Plus
|
||||||
|
components:
|
||||||
|
# 鉴权方式配置
|
||||||
|
security-schemes:
|
||||||
|
apiKey:
|
||||||
|
type: APIKEY
|
||||||
|
in: HEADER
|
||||||
|
name: ${sa-token.token-name}
|
||||||
|
#这里定义了两个分组,可定义多个,也可以不定义
|
||||||
|
group-configs:
|
||||||
|
- group: 1.演示模块
|
||||||
|
packages-to-scan: com.ruoyi.demo
|
||||||
|
- group: 2.系统模块
|
||||||
|
packages-to-scan: com.ruoyi.web
|
||||||
|
- group: 3.代码生成模块
|
||||||
|
packages-to-scan: com.ruoyi.generator
|
||||||
|
|
||||||
|
# 防止XSS攻击
|
||||||
|
xss:
|
||||||
|
# 过滤开关
|
||||||
|
enabled: true
|
||||||
|
# 排除链接(多个用逗号分隔)
|
||||||
|
excludes: /system/notice
|
||||||
|
# 匹配链接
|
||||||
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||||
|
|
||||||
|
# 全局线程池相关配置
|
||||||
|
thread-pool:
|
||||||
|
# 是否开启线程池
|
||||||
|
enabled: true
|
||||||
|
# 队列最大长度
|
||||||
|
queueCapacity: 128
|
||||||
|
# 线程池维护线程所允许的空闲时间
|
||||||
|
keepAliveSeconds: 300
|
||||||
|
|
||||||
|
--- # 分布式锁 lock4j 全局配置
|
||||||
|
lock4j:
|
||||||
|
# 获取分布式锁超时时间,默认为 3000 毫秒
|
||||||
|
acquire-timeout: 3000
|
||||||
|
# 分布式锁的超时时间,默认为 30 秒
|
||||||
|
expire: 30000
|
||||||
|
|
||||||
|
--- # Actuator 监控端点的配置项
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: '*'
|
||||||
|
endpoint:
|
||||||
|
health:
|
||||||
|
show-details: ALWAYS
|
||||||
|
logfile:
|
||||||
|
external-file: ./logs/sys-console.log
|
||||||
|
|
||||||
|
api:
|
||||||
|
app-id: 1a8b2a5c-d51b-4b14-871b-080b1395fac0
|
||||||
|
host: http://101.95.48.44/
|
||||||
|
public-key: KEY657a695e0cf254f3bf10fe0a
|
||||||
|
local-ip: 120.26.168.65
|
||||||
|
token-key: CT-API-TOKEN
|
||||||
8
api/src/main/resources/banner.txt
Normal file
8
api/src/main/resources/banner.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Application Version: ${ruoyi-vue-plus.version}
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
__________ _____.___.__ ____ ____ __________.__
|
||||||
|
\______ \__ __ ____\__ | |__| \ \ / /_ __ ____ \______ \ | __ __ ______
|
||||||
|
| _/ | \/ _ \/ | | | ______ \ Y / | \_/ __ \ ______ | ___/ | | | \/ ___/
|
||||||
|
| | \ | ( <_> )____ | | /_____/ \ /| | /\ ___/ /_____/ | | | |_| | /\___ \
|
||||||
|
|____|_ /____/ \____// ______|__| \___/ |____/ \___ > |____| |____/____//____ >
|
||||||
|
\/ \/ \/ \/
|
||||||
BIN
api/src/main/resources/ip2region.xdb
Normal file
BIN
api/src/main/resources/ip2region.xdb
Normal file
Binary file not shown.
129
api/src/main/resources/logback-plus.xml
Normal file
129
api/src/main/resources/logback-plus.xml
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<property name="log.path" value="./logs"/>
|
||||||
|
<property name="console.log.pattern"
|
||||||
|
value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
|
||||||
|
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${console.log.pattern}</pattern>
|
||||||
|
<charset>utf-8</charset>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/api-console.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/api-console.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大 1天 -->
|
||||||
|
<maxHistory>1</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
<charset>utf-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/api-info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/api-info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/api-error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/api-error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- info异步输出 -->
|
||||||
|
<appender name="async_info" class="ch.qos.logback.classic.AsyncAppender">
|
||||||
|
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
|
||||||
|
<discardingThreshold>0</discardingThreshold>
|
||||||
|
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
|
||||||
|
<queueSize>512</queueSize>
|
||||||
|
<!-- 添加附加的appender,最多只能添加一个 -->
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- error异步输出 -->
|
||||||
|
<appender name="async_error" class="ch.qos.logback.classic.AsyncAppender">
|
||||||
|
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
|
||||||
|
<discardingThreshold>0</discardingThreshold>
|
||||||
|
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
|
||||||
|
<queueSize>512</queueSize>
|
||||||
|
<!-- 添加附加的appender,最多只能添加一个 -->
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 整合 skywalking 控制台输出 tid -->
|
||||||
|
<!-- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">-->
|
||||||
|
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
|
||||||
|
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
|
||||||
|
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
|
||||||
|
<!-- </layout>-->
|
||||||
|
<!-- <charset>utf-8</charset>-->
|
||||||
|
<!-- </encoder>-->
|
||||||
|
<!-- </appender>-->
|
||||||
|
|
||||||
|
<!-- 整合 skywalking 推送采集日志 -->
|
||||||
|
<!-- <appender name="sky_log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">-->
|
||||||
|
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
|
||||||
|
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
|
||||||
|
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
|
||||||
|
<!-- </layout>-->
|
||||||
|
<!-- <charset>utf-8</charset>-->
|
||||||
|
<!-- </encoder>-->
|
||||||
|
<!-- </appender>-->
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
<appender-ref ref="async_info" />
|
||||||
|
<appender-ref ref="async_error" />
|
||||||
|
<appender-ref ref="file_console" />
|
||||||
|
<!-- <appender-ref ref="sky_log"/>-->
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
28
api/src/main/resources/spy.properties
Normal file
28
api/src/main/resources/spy.properties
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# p6spy 性能分析插件配置文件
|
||||||
|
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
|
||||||
|
# 自定义日志打印
|
||||||
|
logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
|
||||||
|
#日志输出到控制台
|
||||||
|
appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
|
||||||
|
# 使用日志系统记录 sql
|
||||||
|
#appender=com.p6spy.engine.spy.appender.Slf4JLogger
|
||||||
|
# 设置 p6spy driver 代理
|
||||||
|
#deregisterdrivers=true
|
||||||
|
# 取消JDBC URL前缀
|
||||||
|
useprefix=true
|
||||||
|
# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset.
|
||||||
|
excludecategories=info,debug,result,commit,resultset
|
||||||
|
# 日期格式
|
||||||
|
dateformat=yyyy-MM-dd HH:mm:ss
|
||||||
|
# SQL语句打印时间格式
|
||||||
|
databaseDialectTimestampFormat=yyyy-MM-dd HH:mm:ss
|
||||||
|
# 实际驱动可多个
|
||||||
|
#driverlist=org.h2.Driver
|
||||||
|
# 是否开启慢SQL记录
|
||||||
|
outagedetection=true
|
||||||
|
# 慢SQL记录标准 2 秒
|
||||||
|
outagedetectioninterval=2
|
||||||
|
# 是否过滤 Log
|
||||||
|
filter=true
|
||||||
|
# 过滤 Log 时所排除的 sql 关键字,以逗号分隔
|
||||||
|
exclude=SELECT 1
|
||||||
28
ct/pom.xml
Normal file
28
ct/pom.xml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?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-vue-plus</artifactId>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<version>4.8.1</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>ct</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
CT
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- 通用工具-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
138
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountController.java
Executable file
138
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountController.java
Executable file
@@ -0,0 +1,138 @@
|
|||||||
|
package com.ruoyi.ct.controller;
|
||||||
|
|
||||||
|
import java.security.KeyPair;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.SecureUtil;
|
||||||
|
import cn.hutool.crypto.SmUtil;
|
||||||
|
import cn.hutool.crypto.asymmetric.SM2;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.ct.service.IAgentAccountGoodService;
|
||||||
|
import com.ruoyi.ct.service.IGoodService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.core.validate.QueryGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountBo;
|
||||||
|
import com.ruoyi.ct.service.IAgentAccountService;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商账号
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ct/agentAccount")
|
||||||
|
public class AgentAccountController extends BaseController {
|
||||||
|
|
||||||
|
private final IAgentAccountService iAgentAccountService;
|
||||||
|
private final IAgentAccountGoodService iAgentAccountGoodService;
|
||||||
|
private final IGoodService iGoodService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商账号列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccount:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<AgentAccountVo> list(AgentAccountBo bo, PageQuery pageQuery) {
|
||||||
|
TableDataInfo<AgentAccountVo> result = iAgentAccountService.queryPageList(bo, pageQuery);
|
||||||
|
for(AgentAccountVo vo: result.getRows()) {
|
||||||
|
AgentAccountGoodBo agentAccountGoodBo = new AgentAccountGoodBo();
|
||||||
|
agentAccountGoodBo.setAgentAccountId(vo.getId());
|
||||||
|
List<AgentAccountGoodVo> agentAccountGoodVoList = iAgentAccountGoodService.queryList(agentAccountGoodBo);
|
||||||
|
for (AgentAccountGoodVo agentAccountGoodVo: agentAccountGoodVoList){
|
||||||
|
agentAccountGoodVo.setTitle(iGoodService.queryById(agentAccountGoodVo.getGoodId()).getName());
|
||||||
|
}
|
||||||
|
vo.setAgentAccountGoodVoList(agentAccountGoodVoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出代理商账号列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccount:export")
|
||||||
|
@Log(title = "代理商账号", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(AgentAccountBo bo, HttpServletResponse response) {
|
||||||
|
List<AgentAccountVo> list = iAgentAccountService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "代理商账号", AgentAccountVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取代理商账号详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccount:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<AgentAccountVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
AgentAccountVo vo = iAgentAccountService.queryById(id);
|
||||||
|
AgentAccountGoodBo bo = new AgentAccountGoodBo();
|
||||||
|
bo.setAgentAccountId(vo.getId());
|
||||||
|
List<AgentAccountGoodVo> agentAccountGoodVoList = iAgentAccountGoodService.queryList(bo);
|
||||||
|
vo.setAgentAccountGoodVoList(agentAccountGoodVoList);
|
||||||
|
return R.ok(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理商账号
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccount:add")
|
||||||
|
@Log(title = "代理商账号", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentAccountBo bo) {
|
||||||
|
// if (iAgentAccountService.checkPersonnelId(bo)) {
|
||||||
|
// return R.fail("电信ID重复");
|
||||||
|
// }
|
||||||
|
return toAjax(iAgentAccountService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理商账号
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccount:edit")
|
||||||
|
@Log(title = "代理商账号", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentAccountBo bo) {
|
||||||
|
return toAjax(iAgentAccountService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除代理商账号
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccount:remove")
|
||||||
|
@Log(title = "代理商账号", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(iAgentAccountService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
114
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountGoodController.java
Executable file
114
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountGoodController.java
Executable file
@@ -0,0 +1,114 @@
|
|||||||
|
package com.ruoyi.ct.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.core.validate.QueryGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||||
|
import com.ruoyi.ct.service.IAgentAccountGoodService;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商商品
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ct/agentAccountGood")
|
||||||
|
public class AgentAccountGoodController extends BaseController {
|
||||||
|
|
||||||
|
private final IAgentAccountGoodService iAgentAccountGoodService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商商品列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGood:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<AgentAccountGoodVo> list(AgentAccountGoodBo bo, PageQuery pageQuery) {
|
||||||
|
return iAgentAccountGoodService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出代理商商品列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGood:export")
|
||||||
|
@Log(title = "代理商商品", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(AgentAccountGoodBo bo, HttpServletResponse response) {
|
||||||
|
List<AgentAccountGoodVo> list = iAgentAccountGoodService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "代理商商品", AgentAccountGoodVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取代理商商品详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGood:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<AgentAccountGoodVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(iAgentAccountGoodService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理商商品
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGood:add")
|
||||||
|
@Log(title = "代理商商品", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentAccountGoodBo bo) {
|
||||||
|
AgentAccountGoodBo agentAccountGoodBo = new AgentAccountGoodBo();
|
||||||
|
agentAccountGoodBo.setAgentAccountId(bo.getAgentAccountId());
|
||||||
|
agentAccountGoodBo.setGoodId(bo.getGoodId());
|
||||||
|
if (iAgentAccountGoodService.queryList(agentAccountGoodBo).size() > 0) {
|
||||||
|
return R.fail("已存在相同商品");
|
||||||
|
}
|
||||||
|
return toAjax(iAgentAccountGoodService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理商商品
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGood:edit")
|
||||||
|
@Log(title = "代理商商品", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentAccountGoodBo bo) {
|
||||||
|
return toAjax(iAgentAccountGoodService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除代理商商品
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGood:remove")
|
||||||
|
@Log(title = "代理商商品", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(iAgentAccountGoodService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
108
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountGoodUserController.java
Executable file
108
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountGoodUserController.java
Executable file
@@ -0,0 +1,108 @@
|
|||||||
|
package com.ruoyi.ct.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.core.validate.QueryGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodUserVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodUserBo;
|
||||||
|
import com.ruoyi.ct.service.IAgentAccountGoodUserService;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品预制用户
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2024-03-13
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ct/agentAccountGoodUser")
|
||||||
|
public class AgentAccountGoodUserController extends BaseController {
|
||||||
|
|
||||||
|
private final IAgentAccountGoodUserService iAgentAccountGoodUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品预制用户列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGoodUser:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<AgentAccountGoodUserVo> list(AgentAccountGoodUserBo bo, PageQuery pageQuery) {
|
||||||
|
return iAgentAccountGoodUserService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出商品预制用户列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGoodUser:export")
|
||||||
|
@Log(title = "商品预制用户", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(AgentAccountGoodUserBo bo, HttpServletResponse response) {
|
||||||
|
List<AgentAccountGoodUserVo> list = iAgentAccountGoodUserService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "商品预制用户", AgentAccountGoodUserVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品预制用户详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGoodUser:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<AgentAccountGoodUserVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(iAgentAccountGoodUserService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增商品预制用户
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGoodUser:add")
|
||||||
|
@Log(title = "商品预制用户", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentAccountGoodUserBo bo) {
|
||||||
|
return toAjax(iAgentAccountGoodUserService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品预制用户
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGoodUser:edit")
|
||||||
|
@Log(title = "商品预制用户", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentAccountGoodUserBo bo) {
|
||||||
|
return toAjax(iAgentAccountGoodUserService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除商品预制用户
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentAccountGoodUser:remove")
|
||||||
|
@Log(title = "商品预制用户", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(iAgentAccountGoodUserService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
108
ct/src/main/java/com/ruoyi/ct/controller/AgentController.java
Executable file
108
ct/src/main/java/com/ruoyi/ct/controller/AgentController.java
Executable file
@@ -0,0 +1,108 @@
|
|||||||
|
package com.ruoyi.ct.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.core.validate.QueryGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentBo;
|
||||||
|
import com.ruoyi.ct.service.IAgentService;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ct/agent")
|
||||||
|
public class AgentController extends BaseController {
|
||||||
|
|
||||||
|
private final IAgentService iAgentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agent:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<AgentVo> list(AgentBo bo, PageQuery pageQuery) {
|
||||||
|
return iAgentService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出代理商列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agent:export")
|
||||||
|
@Log(title = "代理商", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(AgentBo bo, HttpServletResponse response) {
|
||||||
|
List<AgentVo> list = iAgentService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "代理商", AgentVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取代理商详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agent:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<AgentVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(iAgentService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理商
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agent:add")
|
||||||
|
@Log(title = "代理商", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentBo bo) {
|
||||||
|
return toAjax(iAgentService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理商
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agent:edit")
|
||||||
|
@Log(title = "代理商", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentBo bo) {
|
||||||
|
return toAjax(iAgentService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除代理商
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agent:remove")
|
||||||
|
@Log(title = "代理商", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(iAgentService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
108
ct/src/main/java/com/ruoyi/ct/controller/AgentOrderController.java
Executable file
108
ct/src/main/java/com/ruoyi/ct/controller/AgentOrderController.java
Executable file
@@ -0,0 +1,108 @@
|
|||||||
|
package com.ruoyi.ct.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.core.validate.QueryGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||||
|
import com.ruoyi.ct.service.IAgentOrderService;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ct/agentOrder")
|
||||||
|
public class AgentOrderController extends BaseController {
|
||||||
|
|
||||||
|
private final IAgentOrderService iAgentOrderService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentOrder:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<AgentOrderVo> list(AgentOrderBo bo, PageQuery pageQuery) {
|
||||||
|
return iAgentOrderService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出订单列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentOrder:export")
|
||||||
|
@Log(title = "订单", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(AgentOrderBo bo, HttpServletResponse response) {
|
||||||
|
List<AgentOrderVo> list = iAgentOrderService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "订单", AgentOrderVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取订单详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentOrder:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<AgentOrderVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(iAgentOrderService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增订单
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentOrder:add")
|
||||||
|
@Log(title = "订单", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentOrderBo bo) {
|
||||||
|
return toAjax(iAgentOrderService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentOrder:edit")
|
||||||
|
@Log(title = "订单", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentOrderBo bo) {
|
||||||
|
return toAjax(iAgentOrderService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除订单
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:agentOrder:remove")
|
||||||
|
@Log(title = "订单", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(iAgentOrderService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
108
ct/src/main/java/com/ruoyi/ct/controller/ApiLogController.java
Executable file
108
ct/src/main/java/com/ruoyi/ct/controller/ApiLogController.java
Executable file
@@ -0,0 +1,108 @@
|
|||||||
|
package com.ruoyi.ct.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.core.validate.QueryGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.ct.domain.vo.ApiLogVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.ApiLogBo;
|
||||||
|
import com.ruoyi.ct.service.IApiLogService;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API调用日志
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ct/apiLog")
|
||||||
|
public class ApiLogController extends BaseController {
|
||||||
|
|
||||||
|
private final IApiLogService iApiLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询API调用日志列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:apiLog:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<ApiLogVo> list(ApiLogBo bo, PageQuery pageQuery) {
|
||||||
|
return iApiLogService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出API调用日志列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:apiLog:export")
|
||||||
|
@Log(title = "API调用日志", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(ApiLogBo bo, HttpServletResponse response) {
|
||||||
|
List<ApiLogVo> list = iApiLogService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "API调用日志", ApiLogVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取API调用日志详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:apiLog:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<ApiLogVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(iApiLogService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增API调用日志
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:apiLog:add")
|
||||||
|
@Log(title = "API调用日志", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody ApiLogBo bo) {
|
||||||
|
return toAjax(iApiLogService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改API调用日志
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:apiLog:edit")
|
||||||
|
@Log(title = "API调用日志", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ApiLogBo bo) {
|
||||||
|
return toAjax(iApiLogService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除API调用日志
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:apiLog:remove")
|
||||||
|
@Log(title = "API调用日志", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(iApiLogService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
108
ct/src/main/java/com/ruoyi/ct/controller/GoodController.java
Executable file
108
ct/src/main/java/com/ruoyi/ct/controller/GoodController.java
Executable file
@@ -0,0 +1,108 @@
|
|||||||
|
package com.ruoyi.ct.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.core.validate.QueryGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.GoodBo;
|
||||||
|
import com.ruoyi.ct.service.IGoodService;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信商品
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ct/good")
|
||||||
|
public class GoodController extends BaseController {
|
||||||
|
|
||||||
|
private final IGoodService iGoodService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询电信商品列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:good:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<GoodVo> list(GoodBo bo, PageQuery pageQuery) {
|
||||||
|
return iGoodService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出电信商品列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:good:export")
|
||||||
|
@Log(title = "电信商品", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(GoodBo bo, HttpServletResponse response) {
|
||||||
|
List<GoodVo> list = iGoodService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "电信商品", GoodVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取电信商品详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:good:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<GoodVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(iGoodService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增电信商品
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:good:add")
|
||||||
|
@Log(title = "电信商品", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody GoodBo bo) {
|
||||||
|
return toAjax(iGoodService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改电信商品
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:good:edit")
|
||||||
|
@Log(title = "电信商品", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GoodBo bo) {
|
||||||
|
return toAjax(iGoodService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除电信商品
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("ct:good:remove")
|
||||||
|
@Log(title = "电信商品", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(iGoodService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
ct/src/main/java/com/ruoyi/ct/domain/.DS_Store
vendored
Normal file
BIN
ct/src/main/java/com/ruoyi/ct/domain/.DS_Store
vendored
Normal file
Binary file not shown.
48
ct/src/main/java/com/ruoyi/ct/domain/Agent.java
Executable file
48
ct/src/main/java/com/ruoyi/ct/domain/Agent.java
Executable file
@@ -0,0 +1,48 @@
|
|||||||
|
package com.ruoyi.ct.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商对象 ct_agent
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ct_agent")
|
||||||
|
public class Agent extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private String delFlag;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
88
ct/src/main/java/com/ruoyi/ct/domain/AgentAccount.java
Executable file
88
ct/src/main/java/com/ruoyi/ct/domain/AgentAccount.java
Executable file
@@ -0,0 +1,88 @@
|
|||||||
|
package com.ruoyi.ct.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商账号对象 ct_agent_account
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ct_agent_account")
|
||||||
|
public class AgentAccount extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long agentId;
|
||||||
|
/**
|
||||||
|
* 代理商名称
|
||||||
|
*/
|
||||||
|
private String agentName;
|
||||||
|
/**
|
||||||
|
* 电信ID
|
||||||
|
*/
|
||||||
|
private String personnelId;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String appId;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String appSecret;
|
||||||
|
/**
|
||||||
|
* IP白名单
|
||||||
|
*/
|
||||||
|
private String ipList;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String verifyUrl;
|
||||||
|
/**
|
||||||
|
* 平台公钥
|
||||||
|
*/
|
||||||
|
private String platformPublicKey;
|
||||||
|
/**
|
||||||
|
* 平台私钥
|
||||||
|
*/
|
||||||
|
private String platformPrivateKey;
|
||||||
|
/**
|
||||||
|
* 代理商公钥
|
||||||
|
*/
|
||||||
|
private String agentPublicKey;
|
||||||
|
/**
|
||||||
|
* 代理商私钥
|
||||||
|
*/
|
||||||
|
private String agentPrivateKey;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private String delFlag;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
66
ct/src/main/java/com/ruoyi/ct/domain/AgentAccountGood.java
Executable file
66
ct/src/main/java/com/ruoyi/ct/domain/AgentAccountGood.java
Executable file
@@ -0,0 +1,66 @@
|
|||||||
|
package com.ruoyi.ct.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商商品对象 ct_agent_account_good
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ct_agent_account_good")
|
||||||
|
public class AgentAccountGood extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long agentId;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long agentAccountId;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String personnelId;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long goodId;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String saleId;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
private Integer isNeedVerify;
|
||||||
|
private Integer registerCount;
|
||||||
|
private Integer completeCount;
|
||||||
|
private Integer waitCount;
|
||||||
|
private Integer verifyCount;
|
||||||
|
private Integer verifiedCount;
|
||||||
|
private String tmpPassword;
|
||||||
|
private String images;
|
||||||
|
private String imageIds;
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
74
ct/src/main/java/com/ruoyi/ct/domain/AgentAccountGoodUser.java
Executable file
74
ct/src/main/java/com/ruoyi/ct/domain/AgentAccountGoodUser.java
Executable file
@@ -0,0 +1,74 @@
|
|||||||
|
package com.ruoyi.ct.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品预制用户对象 ct_agent_account_good_user
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2024-03-13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ct_agent_account_good_user")
|
||||||
|
public class AgentAccountGoodUser extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long agentAccountGoodId;
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
private String idCardNo;
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String mobile;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private String delFlag;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
178
ct/src/main/java/com/ruoyi/ct/domain/AgentOrder.java
Executable file
178
ct/src/main/java/com/ruoyi/ct/domain/AgentOrder.java
Executable file
@@ -0,0 +1,178 @@
|
|||||||
|
package com.ruoyi.ct.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单对象 ct_agent_order
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ct_agent_order")
|
||||||
|
public class AgentOrder extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 代理商ID
|
||||||
|
*/
|
||||||
|
private Long agentId;
|
||||||
|
/**
|
||||||
|
* 代理商名称
|
||||||
|
*/
|
||||||
|
private String agentName;
|
||||||
|
/**
|
||||||
|
* 代理商账号ID
|
||||||
|
*/
|
||||||
|
private Long agentAccountId;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private String saleId;
|
||||||
|
private String title;
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 厅店ID,默认13
|
||||||
|
*/
|
||||||
|
private String storeId;
|
||||||
|
/**
|
||||||
|
* 代理商电信ID
|
||||||
|
*/
|
||||||
|
private String personnelId;
|
||||||
|
/**
|
||||||
|
* 用户姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 用户身份证号
|
||||||
|
*/
|
||||||
|
private String idCard;
|
||||||
|
/**
|
||||||
|
* 用户联系电话
|
||||||
|
*/
|
||||||
|
private String contactMobile;
|
||||||
|
/**
|
||||||
|
* 收货地址
|
||||||
|
*/
|
||||||
|
private String installedAddress;
|
||||||
|
/**
|
||||||
|
* 省
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
/**
|
||||||
|
* 市
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
/**
|
||||||
|
* 区
|
||||||
|
*/
|
||||||
|
private String county;
|
||||||
|
/**
|
||||||
|
* 下单流水号
|
||||||
|
*/
|
||||||
|
private String serialNumber;
|
||||||
|
/**
|
||||||
|
* 入网号码
|
||||||
|
*/
|
||||||
|
private String number;
|
||||||
|
/**
|
||||||
|
* 物流备注
|
||||||
|
*/
|
||||||
|
private String logiRemark;
|
||||||
|
/**
|
||||||
|
* 业务办理页面url
|
||||||
|
*/
|
||||||
|
private String pageUrl;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 宽带安装地址
|
||||||
|
*/
|
||||||
|
private String installAddress;
|
||||||
|
/**
|
||||||
|
* 第二发展人工号
|
||||||
|
*/
|
||||||
|
private String ynumber2;
|
||||||
|
/**
|
||||||
|
* 上传过的站牌类型,逗号分隔
|
||||||
|
*/
|
||||||
|
private String images;
|
||||||
|
/**
|
||||||
|
* 电信订单号
|
||||||
|
*/
|
||||||
|
private String orderNum;
|
||||||
|
/**
|
||||||
|
* 电信订单状态
|
||||||
|
*/
|
||||||
|
private String orderStatus;
|
||||||
|
/**
|
||||||
|
* 平台订单状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 快递单号
|
||||||
|
*/
|
||||||
|
private String expressNum;
|
||||||
|
/**
|
||||||
|
* 快递公司
|
||||||
|
*/
|
||||||
|
private String expressVendor;
|
||||||
|
/**
|
||||||
|
* 物流信息
|
||||||
|
*/
|
||||||
|
private String expressRoutes;
|
||||||
|
/**
|
||||||
|
* 物流状态码
|
||||||
|
*/
|
||||||
|
private String statusCd;
|
||||||
|
/**
|
||||||
|
* 订单路由信息
|
||||||
|
*/
|
||||||
|
private String routeArr;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private String delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否首冲
|
||||||
|
*/
|
||||||
|
private Integer isRecharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首冲名称
|
||||||
|
*/
|
||||||
|
private String chargeTitle;
|
||||||
|
|
||||||
|
private Integer orderType;
|
||||||
|
|
||||||
|
private String apiVersion;
|
||||||
|
|
||||||
|
private Integer isExpress;
|
||||||
|
|
||||||
|
private Integer idCardFront;
|
||||||
|
|
||||||
|
private Integer idCardBack;
|
||||||
|
|
||||||
|
private Integer frontFace;
|
||||||
|
|
||||||
|
private String uploadMsgId;
|
||||||
|
|
||||||
|
}
|
||||||
67
ct/src/main/java/com/ruoyi/ct/domain/ApiLog.java
Executable file
67
ct/src/main/java/com/ruoyi/ct/domain/ApiLog.java
Executable file
@@ -0,0 +1,67 @@
|
|||||||
|
package com.ruoyi.ct.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API调用日志对象 ct_api_log
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ct_api_log")
|
||||||
|
public class ApiLog extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String personnelId;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String url;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String requestBody;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String requestHeader;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long isSuccess;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String errorMsg;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String response;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String ip;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
56
ct/src/main/java/com/ruoyi/ct/domain/Good.java
Executable file
56
ct/src/main/java/com/ruoyi/ct/domain/Good.java
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
package com.ruoyi.ct.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信商品对象 ct_good
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("ct_good")
|
||||||
|
public class Good extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 商品描述
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String saleId;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private String delFlag;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
98
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountBo.java
Executable file
98
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountBo.java
Executable file
@@ -0,0 +1,98 @@
|
|||||||
|
package com.ruoyi.ct.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商账号业务对象 ct_agent_account
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class AgentAccountBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long agentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商名称
|
||||||
|
*/
|
||||||
|
private String agentName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信ID
|
||||||
|
*/
|
||||||
|
private String personnelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String appId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String appSecret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IP白名单
|
||||||
|
*/
|
||||||
|
private String ipList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String verifyUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台公钥
|
||||||
|
*/
|
||||||
|
private String platformPublicKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台私钥
|
||||||
|
*/
|
||||||
|
private String platformPrivateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商公钥
|
||||||
|
*/
|
||||||
|
private String agentPublicKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商私钥
|
||||||
|
*/
|
||||||
|
private String agentPrivateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
private List<Long> goodsIds;
|
||||||
|
}
|
||||||
69
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountGoodBo.java
Executable file
69
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountGoodBo.java
Executable file
@@ -0,0 +1,69 @@
|
|||||||
|
package com.ruoyi.ct.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商商品业务对象 ct_agent_account_good
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class AgentAccountGoodBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long agentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long agentAccountId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String personnelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long goodId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String saleId;
|
||||||
|
|
||||||
|
private Integer isNeedVerify;
|
||||||
|
private Integer registerCount;
|
||||||
|
private Integer completeCount;
|
||||||
|
private Integer waitCount;
|
||||||
|
private Integer verifyCount;
|
||||||
|
private Integer verifiedCount;
|
||||||
|
private String tmpPassword;
|
||||||
|
private String images;
|
||||||
|
private String imageIds;
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
55
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountGoodUserBo.java
Executable file
55
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountGoodUserBo.java
Executable file
@@ -0,0 +1,55 @@
|
|||||||
|
package com.ruoyi.ct.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品预制用户业务对象 ct_agent_account_good_user
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2024-03-13
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class AgentAccountGoodUserBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long agentAccountGoodId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "身份证号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String idCardNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "手机号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String mobile;
|
||||||
|
}
|
||||||
47
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentBo.java
Executable file
47
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentBo.java
Executable file
@@ -0,0 +1,47 @@
|
|||||||
|
package com.ruoyi.ct.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商业务对象 ct_agent
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class AgentBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
218
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentOrderBo.java
Executable file
218
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentOrderBo.java
Executable file
@@ -0,0 +1,218 @@
|
|||||||
|
package com.ruoyi.ct.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单业务对象 ct_agent_order
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class AgentOrderBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "代理商ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long agentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "代理商名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String agentName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商账号ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "代理商账号ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long agentAccountId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "商品ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String saleId;
|
||||||
|
private String title;
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 厅店ID,默认13
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "厅店ID,默认13不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商电信ID
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "代理商电信ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String personnelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户姓名
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户身份证号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "身份证号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
@Pattern(regexp = "([1-9]\\d{5})(19\\d{2}|20\\d{2})(0[1-9]|1[0-2])(0[1-9]|[1-2]\\d|3[0-1])\\d{3}([0-9]|X|x)", message = "身份证号码错误", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户联系电话
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "联系电话不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
@Pattern(regexp = "1[3-9]\\d{9}", message = "联系电话错误", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String contactMobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货地址
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "收货地址不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String installedAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "省不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "市不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "区不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String county;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单流水号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "下单流水号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String serialNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入网号码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "入网号码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流备注
|
||||||
|
*/
|
||||||
|
private String logiRemark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务办理页面url
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "业务办理页面url不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String pageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 宽带安装地址
|
||||||
|
*/
|
||||||
|
private String installAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第二发展人工号
|
||||||
|
*/
|
||||||
|
private String ynumber2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传过的站牌类型,逗号分隔
|
||||||
|
*/
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信订单号
|
||||||
|
*/
|
||||||
|
private String orderNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信订单状态
|
||||||
|
*/
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台订单状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快递单号
|
||||||
|
*/
|
||||||
|
private String expressNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快递公司
|
||||||
|
*/
|
||||||
|
private String expressVendor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流信息
|
||||||
|
*/
|
||||||
|
private String expressRoutes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流状态码
|
||||||
|
*/
|
||||||
|
private String statusCd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单路由信息
|
||||||
|
*/
|
||||||
|
private String routeArr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否首冲
|
||||||
|
*/
|
||||||
|
private Integer isRecharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首冲名称
|
||||||
|
*/
|
||||||
|
private String chargeTitle;
|
||||||
|
|
||||||
|
private Integer orderType;
|
||||||
|
|
||||||
|
private String apiVersion;
|
||||||
|
|
||||||
|
private Integer isExpress;
|
||||||
|
|
||||||
|
private Integer idCardFront;
|
||||||
|
|
||||||
|
private Integer idCardBack;
|
||||||
|
|
||||||
|
private Integer frontFace;
|
||||||
|
|
||||||
|
private String uploadMsgId;
|
||||||
|
}
|
||||||
85
ct/src/main/java/com/ruoyi/ct/domain/bo/ApiLogBo.java
Executable file
85
ct/src/main/java/com/ruoyi/ct/domain/bo/ApiLogBo.java
Executable file
@@ -0,0 +1,85 @@
|
|||||||
|
package com.ruoyi.ct.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API调用日志业务对象 ct_api_log
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ApiLogBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String personnelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String requestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String requestHeader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long isSuccess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
58
ct/src/main/java/com/ruoyi/ct/domain/bo/GoodBo.java
Executable file
58
ct/src/main/java/com/ruoyi/ct/domain/bo/GoodBo.java
Executable file
@@ -0,0 +1,58 @@
|
|||||||
|
package com.ruoyi.ct.domain.bo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信商品业务对象 ct_good
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class GoodBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "名称不能为空", groups = { AddGroup.class })
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品描述
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String saleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
87
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountGoodUserVo.java
Executable file
87
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountGoodUserVo.java
Executable file
@@ -0,0 +1,87 @@
|
|||||||
|
package com.ruoyi.ct.domain.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品预制用户视图对象 ct_agent_account_good_user
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2024-03-13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class AgentAccountGoodUserVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long agentAccountGoodId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "身份证号")
|
||||||
|
private String idCardNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "手机号")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
77
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountGoodVo.java
Executable file
77
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountGoodVo.java
Executable file
@@ -0,0 +1,77 @@
|
|||||||
|
package com.ruoyi.ct.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商商品视图对象 ct_agent_account_good
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class AgentAccountGoodVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long agentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long agentAccountId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String personnelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long goodId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String saleId;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private Long gid;
|
||||||
|
|
||||||
|
private Integer isNeedVerify;
|
||||||
|
private Integer registerCount;
|
||||||
|
private Integer completeCount;
|
||||||
|
private Integer waitCount;
|
||||||
|
private Integer verifyCount;
|
||||||
|
private Integer verifiedCount;
|
||||||
|
private String tmpPassword;
|
||||||
|
private String images;
|
||||||
|
private String imageIds;
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
136
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountVo.java
Executable file
136
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountVo.java
Executable file
@@ -0,0 +1,136 @@
|
|||||||
|
package com.ruoyi.ct.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商账号视图对象 ct_agent_account
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class AgentAccountVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long agentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "代理商名称")
|
||||||
|
private String agentName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "电信ID")
|
||||||
|
private String personnelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String appId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String appSecret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IP白名单
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "IP白名单")
|
||||||
|
private String ipList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String verifyUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台公钥
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "平台公钥")
|
||||||
|
private String platformPublicKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台私钥
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "平台私钥")
|
||||||
|
private String platformPrivateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商公钥
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "代理商公钥")
|
||||||
|
private String agentPublicKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商私钥
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "代理商私钥")
|
||||||
|
private String agentPrivateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
private List<AgentAccountGoodVo> agentAccountGoodVoList;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
251
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentOrderVo.java
Executable file
251
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentOrderVo.java
Executable file
@@ -0,0 +1,251 @@
|
|||||||
|
package com.ruoyi.ct.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单视图对象 ct_agent_order
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class AgentOrderVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "代理商ID")
|
||||||
|
private Long agentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "代理商名称")
|
||||||
|
private String agentName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商账号ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "代理商账号ID")
|
||||||
|
private Long agentAccountId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "商品ID")
|
||||||
|
private String saleId;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "商品名称")
|
||||||
|
private String title;
|
||||||
|
@ExcelProperty(value = "商品介绍")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 厅店ID,默认13
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "厅店ID,默认13")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商电信ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "代理商电信ID")
|
||||||
|
private String personnelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户姓名
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "用户姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户身份证号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "用户身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户联系电话
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "用户联系电话")
|
||||||
|
private String contactMobile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货地址
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "收货地址")
|
||||||
|
private String installedAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "省")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "区")
|
||||||
|
private String county;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单流水号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "下单流水号")
|
||||||
|
private String serialNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入网号码
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "入网号码")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "物流备注")
|
||||||
|
private String logiRemark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务办理页面url
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "业务办理页面url")
|
||||||
|
private String pageUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 宽带安装地址
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "宽带安装地址")
|
||||||
|
private String installAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第二发展人工号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "第二发展人工号")
|
||||||
|
private String ynumber2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传过的站牌类型,逗号分隔
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "上传过的站牌类型,逗号分隔")
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信订单号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "电信订单号")
|
||||||
|
private String orderNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信订单状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "电信订单状态")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台订单状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "平台订单状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快递单号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "快递单号")
|
||||||
|
private String expressNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快递公司
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "快递公司")
|
||||||
|
private String expressVendor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流信息
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "物流信息")
|
||||||
|
private String expressRoutes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流状态码
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "物流状态码")
|
||||||
|
private String statusCd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单路由信息
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "订单路由信息")
|
||||||
|
private String routeArr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "下单时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "订单更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否首冲
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "是否首冲")
|
||||||
|
private Integer isRecharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首冲名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "首冲业务名称")
|
||||||
|
private String chargeTitle;
|
||||||
|
@ExcelProperty(value = "下单类型,0:api,1:h5")
|
||||||
|
private Integer orderType;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "API版本")
|
||||||
|
private String apiVersion;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "是否配送")
|
||||||
|
private Integer isExpress;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "身份证正面是否上传")
|
||||||
|
private Integer idCardFront;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "身份证北面是否上传")
|
||||||
|
private Integer idCardBack;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "正面免冠照是否上传")
|
||||||
|
private Integer frontFace;
|
||||||
|
|
||||||
|
private String uploadMsgId;
|
||||||
|
}
|
||||||
73
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentVo.java
Executable file
73
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentVo.java
Executable file
@@ -0,0 +1,73 @@
|
|||||||
|
package com.ruoyi.ct.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商视图对象 ct_agent
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class AgentVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
91
ct/src/main/java/com/ruoyi/ct/domain/vo/ApiLogVo.java
Executable file
91
ct/src/main/java/com/ruoyi/ct/domain/vo/ApiLogVo.java
Executable file
@@ -0,0 +1,91 @@
|
|||||||
|
package com.ruoyi.ct.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API调用日志视图对象 ct_api_log
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ApiLogVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String personnelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String requestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String requestHeader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long isSuccess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
85
ct/src/main/java/com/ruoyi/ct/domain/vo/GoodVo.java
Executable file
85
ct/src/main/java/com/ruoyi/ct/domain/vo/GoodVo.java
Executable file
@@ -0,0 +1,85 @@
|
|||||||
|
package com.ruoyi.ct.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信商品视图对象 ct_good
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class GoodVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品描述
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "商品描述")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String saleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
40
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountGoodMapper.java
Executable file
40
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountGoodMapper.java
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
package com.ruoyi.ct.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.ct.domain.AgentAccountGood;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商商品Mapper接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AgentAccountGoodMapper extends BaseMapperPlus<AgentAccountGoodMapper, AgentAccountGood, AgentAccountGoodVo> {
|
||||||
|
|
||||||
|
@Select("select a.sale_id as sale_id, cg.name as title, cg.content as content\n" +
|
||||||
|
"from ct_agent_account_good a\n" +
|
||||||
|
" left join ct_good cg on a.good_id = cg.id\n" +
|
||||||
|
"where a.del_flag = '0'\n" +
|
||||||
|
" and cg.del_flag = '0'\n" +
|
||||||
|
" and cg.status = 1\n" +
|
||||||
|
" and a.agent_account_id = #{agentAccountId}")
|
||||||
|
List<AgentAccountGoodVo> selectListFotAPI(IPage<AgentAccountGoodVo> page, @Param("agentAccountId") Long agentAccountId);
|
||||||
|
|
||||||
|
@Select("select a.*, cg.name as title, cg.content as content\n" +
|
||||||
|
"from ct_agent_account_good a\n" +
|
||||||
|
" left join ct_good cg on a.good_id = cg.id\n" +
|
||||||
|
"where a.del_flag = '0'\n" +
|
||||||
|
" and cg.del_flag = '0'\n" +
|
||||||
|
" and cg.status = 1\n" +
|
||||||
|
" and a.sale_id = #{saleId} and a.agent_account_id = #{agentAccountId} limit 1")
|
||||||
|
AgentAccountGoodVo getByGoodAndAccount(@Param("saleId") String saleId, @Param("agentAccountId") Long agentAccountId);
|
||||||
|
}
|
||||||
15
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountGoodUserMapper.java
Executable file
15
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountGoodUserMapper.java
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ruoyi.ct.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.AgentAccountGoodUser;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodUserVo;
|
||||||
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品预制用户Mapper接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2024-03-13
|
||||||
|
*/
|
||||||
|
public interface AgentAccountGoodUserMapper extends BaseMapperPlus<AgentAccountGoodUserMapper, AgentAccountGoodUser, AgentAccountGoodUserVo> {
|
||||||
|
|
||||||
|
}
|
||||||
25
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountMapper.java
Executable file
25
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountMapper.java
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
package com.ruoyi.ct.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.AgentAccount;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||||
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商账号Mapper接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AgentAccountMapper extends BaseMapperPlus<AgentAccountMapper, AgentAccount, AgentAccountVo> {
|
||||||
|
|
||||||
|
@Select("select a.*\n" +
|
||||||
|
" from ct_agent_account as a\n" +
|
||||||
|
" left join ct_agent ca on a.agent_id = ca.id\n" +
|
||||||
|
" where a.del_flag='0' and ca.del_flag='0'\n" +
|
||||||
|
" and a.status='1' and ca.status='1'\n" +
|
||||||
|
" and a.app_id=#{appId} limit 1")
|
||||||
|
AgentAccountVo getByAppId(String appId);
|
||||||
|
}
|
||||||
17
ct/src/main/java/com/ruoyi/ct/mapper/AgentMapper.java
Executable file
17
ct/src/main/java/com/ruoyi/ct/mapper/AgentMapper.java
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ruoyi.ct.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.Agent;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentVo;
|
||||||
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商Mapper接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AgentMapper extends BaseMapperPlus<AgentMapper, Agent, AgentVo> {
|
||||||
|
|
||||||
|
}
|
||||||
17
ct/src/main/java/com/ruoyi/ct/mapper/AgentOrderMapper.java
Executable file
17
ct/src/main/java/com/ruoyi/ct/mapper/AgentOrderMapper.java
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ruoyi.ct.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.AgentOrder;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||||
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单Mapper接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AgentOrderMapper extends BaseMapperPlus<AgentOrderMapper, AgentOrder, AgentOrderVo> {
|
||||||
|
|
||||||
|
}
|
||||||
17
ct/src/main/java/com/ruoyi/ct/mapper/ApiLogMapper.java
Executable file
17
ct/src/main/java/com/ruoyi/ct/mapper/ApiLogMapper.java
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ruoyi.ct.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.ApiLog;
|
||||||
|
import com.ruoyi.ct.domain.vo.ApiLogVo;
|
||||||
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API调用日志Mapper接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ApiLogMapper extends BaseMapperPlus<ApiLogMapper, ApiLog, ApiLogVo> {
|
||||||
|
|
||||||
|
}
|
||||||
17
ct/src/main/java/com/ruoyi/ct/mapper/GoodMapper.java
Executable file
17
ct/src/main/java/com/ruoyi/ct/mapper/GoodMapper.java
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.ruoyi.ct.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.Good;
|
||||||
|
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||||
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信商品Mapper接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface GoodMapper extends BaseMapperPlus<GoodMapper, Good, GoodVo> {
|
||||||
|
|
||||||
|
}
|
||||||
29
ct/src/main/java/com/ruoyi/ct/service/CTService.java
Normal file
29
ct/src/main/java/com/ruoyi/ct/service/CTService.java
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package com.ruoyi.ct.service;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONArray;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.ruoyi.common.core.domain.CTResponse;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CTService {
|
||||||
|
|
||||||
|
boolean getToken();
|
||||||
|
boolean checkToken();
|
||||||
|
List<JSONObject> selectNumber(String personnelId, String saleId, String page, String pageSize) throws Exception;
|
||||||
|
|
||||||
|
CTResponse<String> saveOrder(String name, String idCard, String contactMobile, String installedAddress,
|
||||||
|
String saleId, String storeId, String personnelId, String province, String city,
|
||||||
|
String county, String serialNumber, String number, String logiRemark, String pageUrl,
|
||||||
|
String remark, String installAddress, String ynumber2, String images) throws Exception;
|
||||||
|
|
||||||
|
CTResponse<String> uploadFile(String serialNumber, String name, String idCard, String type, String msgId, String img) throws Exception;
|
||||||
|
|
||||||
|
CTResponse<String> updateOrder(String name, String orderNum) throws Exception;
|
||||||
|
|
||||||
|
CTResponse<String> updateExpress(String orderNum) throws Exception;
|
||||||
|
|
||||||
|
CTResponse<JSONArray> syncOffer(String orderNum, String offerIds, String salesNumber) throws Exception;
|
||||||
|
}
|
||||||
55
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountGoodService.java
Executable file
55
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountGoodService.java
Executable file
@@ -0,0 +1,55 @@
|
|||||||
|
package com.ruoyi.ct.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.ct.domain.AgentAccountGood;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商商品Service接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
public interface IAgentAccountGoodService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商商品
|
||||||
|
*/
|
||||||
|
AgentAccountGoodVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商商品列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<AgentAccountGoodVo> queryPageList(AgentAccountGoodBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商商品列表
|
||||||
|
*/
|
||||||
|
List<AgentAccountGoodVo> queryList(AgentAccountGoodBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理商商品
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(AgentAccountGoodBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理商商品
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(AgentAccountGoodBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除代理商商品信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
Page<AgentAccountGoodVo> queryPage(AgentAccountGoodBo agentAccountGoodBo, Integer page, Integer pageSize);
|
||||||
|
|
||||||
|
AgentAccountGoodVo getByGoodAndAccount(String saleId, Long agentAccountId);
|
||||||
|
|
||||||
|
}
|
||||||
51
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountGoodUserService.java
Executable file
51
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountGoodUserService.java
Executable file
@@ -0,0 +1,51 @@
|
|||||||
|
package com.ruoyi.ct.service;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.AgentAccountGoodUser;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodUserVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodUserBo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品预制用户Service接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2024-03-13
|
||||||
|
*/
|
||||||
|
public interface IAgentAccountGoodUserService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品预制用户
|
||||||
|
*/
|
||||||
|
AgentAccountGoodUserVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品预制用户列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<AgentAccountGoodUserVo> queryPageList(AgentAccountGoodUserBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品预制用户列表
|
||||||
|
*/
|
||||||
|
List<AgentAccountGoodUserVo> queryList(AgentAccountGoodUserBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增商品预制用户
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(AgentAccountGoodUserBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品预制用户
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(AgentAccountGoodUserBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除商品预制用户信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
void deleteByBo(AgentAccountGoodUser agentAccountGoodUser);
|
||||||
|
}
|
||||||
53
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountService.java
Executable file
53
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountService.java
Executable file
@@ -0,0 +1,53 @@
|
|||||||
|
package com.ruoyi.ct.service;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.AgentAccount;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountBo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商账号Service接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
public interface IAgentAccountService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商账号
|
||||||
|
*/
|
||||||
|
AgentAccountVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商账号列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<AgentAccountVo> queryPageList(AgentAccountBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商账号列表
|
||||||
|
*/
|
||||||
|
List<AgentAccountVo> queryList(AgentAccountBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理商账号
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(AgentAccountBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理商账号
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(AgentAccountBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除代理商账号信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
boolean checkPersonnelId(AgentAccountBo bo);
|
||||||
|
|
||||||
|
AgentAccountVo getByAppId(String appId);
|
||||||
|
}
|
||||||
61
ct/src/main/java/com/ruoyi/ct/service/IAgentOrderService.java
Executable file
61
ct/src/main/java/com/ruoyi/ct/service/IAgentOrderService.java
Executable file
@@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.ct.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.ruoyi.ct.domain.AgentOrder;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单Service接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
public interface IAgentOrderService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单
|
||||||
|
*/
|
||||||
|
AgentOrderVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<AgentOrderVo> queryPageList(AgentOrderBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
TableDataInfo<AgentOrderVo> queryList(LambdaQueryWrapper<AgentOrder> lqw, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单列表
|
||||||
|
*/
|
||||||
|
List<AgentOrderVo> queryList(AgentOrderBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增订单
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(AgentOrderBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(AgentOrderBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除订单信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
List<AgentOrderVo> selectOrders();
|
||||||
|
|
||||||
|
List<AgentOrderVo> queryListByLQW(LambdaQueryWrapper<AgentOrder> lqw);
|
||||||
|
|
||||||
|
void updateCount(AgentAccountGoodVo agentAccountGoodVo);
|
||||||
|
|
||||||
|
AgentOrderVo queryBySerialNumber(String serialNumber);
|
||||||
|
}
|
||||||
49
ct/src/main/java/com/ruoyi/ct/service/IAgentService.java
Executable file
49
ct/src/main/java/com/ruoyi/ct/service/IAgentService.java
Executable file
@@ -0,0 +1,49 @@
|
|||||||
|
package com.ruoyi.ct.service;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.Agent;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentBo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商Service接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
public interface IAgentService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商
|
||||||
|
*/
|
||||||
|
AgentVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<AgentVo> queryPageList(AgentBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商列表
|
||||||
|
*/
|
||||||
|
List<AgentVo> queryList(AgentBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理商
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(AgentBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理商
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(AgentBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除代理商信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
49
ct/src/main/java/com/ruoyi/ct/service/IApiLogService.java
Executable file
49
ct/src/main/java/com/ruoyi/ct/service/IApiLogService.java
Executable file
@@ -0,0 +1,49 @@
|
|||||||
|
package com.ruoyi.ct.service;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.ApiLog;
|
||||||
|
import com.ruoyi.ct.domain.vo.ApiLogVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.ApiLogBo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API调用日志Service接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
public interface IApiLogService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询API调用日志
|
||||||
|
*/
|
||||||
|
ApiLogVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询API调用日志列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<ApiLogVo> queryPageList(ApiLogBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询API调用日志列表
|
||||||
|
*/
|
||||||
|
List<ApiLogVo> queryList(ApiLogBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增API调用日志
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(ApiLogBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改API调用日志
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(ApiLogBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除API调用日志信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
49
ct/src/main/java/com/ruoyi/ct/service/IGoodService.java
Executable file
49
ct/src/main/java/com/ruoyi/ct/service/IGoodService.java
Executable file
@@ -0,0 +1,49 @@
|
|||||||
|
package com.ruoyi.ct.service;
|
||||||
|
|
||||||
|
import com.ruoyi.ct.domain.Good;
|
||||||
|
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||||
|
import com.ruoyi.ct.domain.bo.GoodBo;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信商品Service接口
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
public interface IGoodService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询电信商品
|
||||||
|
*/
|
||||||
|
GoodVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询电信商品列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<GoodVo> queryPageList(GoodBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询电信商品列表
|
||||||
|
*/
|
||||||
|
List<GoodVo> queryList(GoodBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增电信商品
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(GoodBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改电信商品
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(GoodBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除电信商品信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
127
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountGoodServiceImpl.java
Executable file
127
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountGoodServiceImpl.java
Executable file
@@ -0,0 +1,127 @@
|
|||||||
|
package com.ruoyi.ct.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.ct.domain.AgentAccountGood;
|
||||||
|
import com.ruoyi.ct.mapper.AgentAccountGoodMapper;
|
||||||
|
import com.ruoyi.ct.service.IAgentAccountGoodService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商商品Service业务层处理
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class AgentAccountGoodServiceImpl implements IAgentAccountGoodService {
|
||||||
|
|
||||||
|
private final AgentAccountGoodMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商商品
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AgentAccountGoodVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商商品列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<AgentAccountGoodVo> queryPageList(AgentAccountGoodBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<AgentAccountGood> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<AgentAccountGoodVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商商品列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AgentAccountGoodVo> queryList(AgentAccountGoodBo bo) {
|
||||||
|
LambdaQueryWrapper<AgentAccountGood> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<AgentAccountGood> buildQueryWrapper(AgentAccountGoodBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<AgentAccountGood> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getAgentId() != null, AgentAccountGood::getAgentId, bo.getAgentId());
|
||||||
|
lqw.eq(bo.getAgentAccountId() != null, AgentAccountGood::getAgentAccountId, bo.getAgentAccountId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPersonnelId()), AgentAccountGood::getPersonnelId, bo.getPersonnelId());
|
||||||
|
lqw.eq(bo.getGoodId() != null, AgentAccountGood::getGoodId, bo.getGoodId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSaleId()), AgentAccountGood::getSaleId, bo.getSaleId());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理商商品
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(AgentAccountGoodBo bo) {
|
||||||
|
AgentAccountGood add = BeanUtil.toBean(bo, AgentAccountGood.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理商商品
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(AgentAccountGoodBo bo) {
|
||||||
|
AgentAccountGood update = BeanUtil.toBean(bo, AgentAccountGood.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(AgentAccountGood entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除代理商商品
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<AgentAccountGoodVo> queryPage(AgentAccountGoodBo agentAccountGoodBo, Integer page, Integer pageSize) {
|
||||||
|
Page<AgentAccountGoodVo> result = new Page<>(page, pageSize);
|
||||||
|
List<AgentAccountGoodVo> agentAccountGoodVoList = baseMapper.selectListFotAPI(result, agentAccountGoodBo.getAgentAccountId());
|
||||||
|
result.setRecords(agentAccountGoodVoList);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AgentAccountGoodVo getByGoodAndAccount(String saleId, Long agentAccountId) {
|
||||||
|
return baseMapper.getByGoodAndAccount(saleId, agentAccountId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
119
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountGoodUserServiceImpl.java
Executable file
119
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountGoodUserServiceImpl.java
Executable file
@@ -0,0 +1,119 @@
|
|||||||
|
package com.ruoyi.ct.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodUserBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodUserVo;
|
||||||
|
import com.ruoyi.ct.domain.AgentAccountGoodUser;
|
||||||
|
import com.ruoyi.ct.mapper.AgentAccountGoodUserMapper;
|
||||||
|
import com.ruoyi.ct.service.IAgentAccountGoodUserService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品预制用户Service业务层处理
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2024-03-13
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class AgentAccountGoodUserServiceImpl implements IAgentAccountGoodUserService {
|
||||||
|
|
||||||
|
private final AgentAccountGoodUserMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品预制用户
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AgentAccountGoodUserVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品预制用户列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<AgentAccountGoodUserVo> queryPageList(AgentAccountGoodUserBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<AgentAccountGoodUser> lqw = buildQueryWrapper(bo);
|
||||||
|
lqw.orderByDesc(AgentAccountGoodUser::getCreateTime);
|
||||||
|
Page<AgentAccountGoodUserVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品预制用户列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AgentAccountGoodUserVo> queryList(AgentAccountGoodUserBo bo) {
|
||||||
|
LambdaQueryWrapper<AgentAccountGoodUser> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<AgentAccountGoodUser> buildQueryWrapper(AgentAccountGoodUserBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<AgentAccountGoodUser> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getAgentAccountGoodId() != null, AgentAccountGoodUser::getAgentAccountGoodId, bo.getAgentAccountGoodId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getName()), AgentAccountGoodUser::getName, bo.getName());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getIdCardNo()), AgentAccountGoodUser::getIdCardNo, bo.getIdCardNo());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getMobile()), AgentAccountGoodUser::getMobile, bo.getMobile());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增商品预制用户
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(AgentAccountGoodUserBo bo) {
|
||||||
|
AgentAccountGoodUser add = BeanUtil.toBean(bo, AgentAccountGoodUser.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品预制用户
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(AgentAccountGoodUserBo bo) {
|
||||||
|
AgentAccountGoodUser update = BeanUtil.toBean(bo, AgentAccountGoodUser.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(AgentAccountGoodUser entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除商品预制用户
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteByBo(AgentAccountGoodUser agentAccountGoodUser) {
|
||||||
|
baseMapper.delete(new QueryWrapper<>(agentAccountGoodUser));
|
||||||
|
}
|
||||||
|
}
|
||||||
178
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountServiceImpl.java
Executable file
178
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountServiceImpl.java
Executable file
@@ -0,0 +1,178 @@
|
|||||||
|
package com.ruoyi.ct.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.crypto.SmUtil;
|
||||||
|
import cn.hutool.crypto.asymmetric.SM2;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.ruoyi.ct.domain.AgentAccountGood;
|
||||||
|
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||||
|
import com.ruoyi.ct.mapper.AgentAccountGoodMapper;
|
||||||
|
import com.ruoyi.ct.mapper.GoodMapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||||
|
import com.ruoyi.ct.domain.AgentAccount;
|
||||||
|
import com.ruoyi.ct.mapper.AgentAccountMapper;
|
||||||
|
import com.ruoyi.ct.service.IAgentAccountService;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商账号Service业务层处理
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class AgentAccountServiceImpl implements IAgentAccountService {
|
||||||
|
|
||||||
|
private final AgentAccountMapper baseMapper;
|
||||||
|
private final AgentAccountGoodMapper agentAccountGoodMapper;
|
||||||
|
private final GoodMapper goodMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商账号
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AgentAccountVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商账号列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<AgentAccountVo> queryPageList(AgentAccountBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<AgentAccount> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<AgentAccountVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商账号列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AgentAccountVo> queryList(AgentAccountBo bo) {
|
||||||
|
LambdaQueryWrapper<AgentAccount> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<AgentAccount> buildQueryWrapper(AgentAccountBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<AgentAccount> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getAgentId() != null, AgentAccount::getAgentId, bo.getAgentId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getAgentName()), AgentAccount::getAgentName, bo.getAgentName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPersonnelId()), AgentAccount::getPersonnelId, bo.getPersonnelId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getAppId()), AgentAccount::getAppId, bo.getAppId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getAppSecret()), AgentAccount::getAppSecret, bo.getAppSecret());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getIpList()), AgentAccount::getIpList, bo.getIpList());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getVerifyUrl()), AgentAccount::getVerifyUrl, bo.getVerifyUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPlatformPublicKey()), AgentAccount::getPlatformPublicKey, bo.getPlatformPublicKey());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPlatformPrivateKey()), AgentAccount::getPlatformPrivateKey, bo.getPlatformPrivateKey());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getAgentPublicKey()), AgentAccount::getAgentPublicKey, bo.getAgentPublicKey());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getAgentPrivateKey()), AgentAccount::getAgentPrivateKey, bo.getAgentPrivateKey());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), AgentAccount::getStatus, bo.getStatus());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理商账号
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(AgentAccountBo bo) {
|
||||||
|
SM2 sm2 = SmUtil.sm2();
|
||||||
|
bo.setAgentPrivateKey(sm2.getPrivateKeyBase64());
|
||||||
|
bo.setAgentPublicKey(sm2.getPublicKeyBase64());
|
||||||
|
sm2 = SmUtil.sm2();
|
||||||
|
bo.setPlatformPublicKey(sm2.getPublicKeyBase64());
|
||||||
|
bo.setPlatformPrivateKey(sm2.getPrivateKeyBase64());
|
||||||
|
bo.setAppId(UUID.randomUUID().toString());
|
||||||
|
bo.setAppSecret(UUID.randomUUID().toString());
|
||||||
|
bo.setStatus("1");
|
||||||
|
|
||||||
|
AgentAccount add = BeanUtil.toBean(bo, AgentAccount.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
// Collection<AgentAccountGood> agentAccountGoodCollection = new ArrayList<>();
|
||||||
|
// for (Long goodsId: bo.getGoodsIds()) {
|
||||||
|
// GoodVo goods = goodMapper.selectVoById(goodsId);
|
||||||
|
// AgentAccountGood agentAccountGood = new AgentAccountGood();
|
||||||
|
// agentAccountGood.setGoodId(goodsId);
|
||||||
|
// agentAccountGood.setAgentId(add.getAgentId());
|
||||||
|
// agentAccountGood.setPersonnelId(add.getPersonnelId());
|
||||||
|
// agentAccountGood.setAgentAccountId(add.getId());
|
||||||
|
// agentAccountGood.setSaleId(goods.getSaleId());
|
||||||
|
// agentAccountGoodCollection.add(agentAccountGood);
|
||||||
|
// }
|
||||||
|
// agentAccountGoodMapper.insertBatch(agentAccountGoodCollection);
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理商账号
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(AgentAccountBo bo) {
|
||||||
|
AgentAccount update = BeanUtil.toBean(bo, AgentAccount.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
boolean flag = baseMapper.updateById(update) > 0;
|
||||||
|
// agentAccountGoodMapper.delete(new LambdaQueryWrapper<AgentAccountGood>().eq(AgentAccountGood::getAgentAccountId, update.getId()));
|
||||||
|
// Collection<AgentAccountGood> agentAccountGoodCollection = new ArrayList<>();
|
||||||
|
// for (Long goodsId: bo.getGoodsIds()) {
|
||||||
|
// GoodVo goods = goodMapper.selectVoById(goodsId);
|
||||||
|
// AgentAccountGood agentAccountGood = new AgentAccountGood();
|
||||||
|
// agentAccountGood.setGoodId(goodsId);
|
||||||
|
// agentAccountGood.setAgentId(update.getAgentId());
|
||||||
|
// agentAccountGood.setPersonnelId(update.getPersonnelId());
|
||||||
|
// agentAccountGood.setAgentAccountId(update.getId());
|
||||||
|
// agentAccountGood.setSaleId(goods.getSaleId());
|
||||||
|
// agentAccountGoodCollection.add(agentAccountGood);
|
||||||
|
// }
|
||||||
|
// agentAccountGoodMapper.insertBatch(agentAccountGoodCollection);
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(AgentAccount entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除代理商账号
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkPersonnelId(AgentAccountBo bo) {
|
||||||
|
bo.setPersonnelId(bo.getPersonnelId());
|
||||||
|
bo.setStatus("1");
|
||||||
|
return ObjectUtils.isNotNull(baseMapper.selectVoOne(new QueryWrapper<AgentAccount>().lambda()
|
||||||
|
.eq(AgentAccount::getPersonnelId, bo.getPersonnelId())
|
||||||
|
.eq(AgentAccount::getStatus, "1")));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AgentAccountVo getByAppId(String appId) {
|
||||||
|
return baseMapper.getByAppId(appId);
|
||||||
|
}
|
||||||
|
}
|
||||||
193
ct/src/main/java/com/ruoyi/ct/service/impl/AgentOrderServiceImpl.java
Executable file
193
ct/src/main/java/com/ruoyi/ct/service/impl/AgentOrderServiceImpl.java
Executable file
@@ -0,0 +1,193 @@
|
|||||||
|
package com.ruoyi.ct.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.ruoyi.ct.domain.AgentAccountGood;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||||
|
import com.ruoyi.ct.mapper.AgentAccountGoodMapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||||
|
import com.ruoyi.ct.domain.AgentOrder;
|
||||||
|
import com.ruoyi.ct.mapper.AgentOrderMapper;
|
||||||
|
import com.ruoyi.ct.service.IAgentOrderService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单Service业务层处理
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class AgentOrderServiceImpl implements IAgentOrderService {
|
||||||
|
|
||||||
|
private final AgentOrderMapper baseMapper;
|
||||||
|
|
||||||
|
private final AgentAccountGoodMapper agentAccountGoodMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AgentOrderVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AgentOrderVo queryBySerialNumber(String serialNumber) {
|
||||||
|
LambdaQueryWrapper<AgentOrder> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(AgentOrder::getSerialNumber, serialNumber);
|
||||||
|
lqw.last("limit 1");
|
||||||
|
return baseMapper.selectVoOne(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<AgentOrderVo> queryPageList(AgentOrderBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<AgentOrder> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<AgentOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<AgentOrderVo> queryList(LambdaQueryWrapper<AgentOrder> lqw, PageQuery pageQuery) {
|
||||||
|
Page<AgentOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AgentOrderVo> queryList(AgentOrderBo bo) {
|
||||||
|
LambdaQueryWrapper<AgentOrder> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<AgentOrder> buildQueryWrapper(AgentOrderBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<AgentOrder> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getAgentId() != null, AgentOrder::getAgentId, bo.getAgentId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getAgentName()), AgentOrder::getAgentName, bo.getAgentName());
|
||||||
|
lqw.eq(bo.getAgentAccountId() != null, AgentOrder::getAgentAccountId, bo.getAgentAccountId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSaleId()), AgentOrder::getSaleId, bo.getSaleId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStoreId()), AgentOrder::getStoreId, bo.getStoreId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPersonnelId()), AgentOrder::getPersonnelId, bo.getPersonnelId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getName()), AgentOrder::getName, bo.getName());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getIdCard()), AgentOrder::getIdCard, bo.getIdCard());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getContactMobile()), AgentOrder::getContactMobile, bo.getContactMobile());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getInstalledAddress()), AgentOrder::getInstalledAddress, bo.getInstalledAddress());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getProvince()), AgentOrder::getProvince, bo.getProvince());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCity()), AgentOrder::getCity, bo.getCity());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCounty()), AgentOrder::getCounty, bo.getCounty());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getSerialNumber()), AgentOrder::getSerialNumber, bo.getSerialNumber());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getNumber()), AgentOrder::getNumber, bo.getNumber());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getLogiRemark()), AgentOrder::getLogiRemark, bo.getLogiRemark());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPageUrl()), AgentOrder::getPageUrl, bo.getPageUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getInstallAddress()), AgentOrder::getInstallAddress, bo.getInstallAddress());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getYnumber2()), AgentOrder::getYnumber2, bo.getYnumber2());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getImages()), AgentOrder::getImages, bo.getImages());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getOrderNum()), AgentOrder::getOrderNum, bo.getOrderNum());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getOrderStatus()), AgentOrder::getOrderStatus, bo.getOrderStatus());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), AgentOrder::getStatus, bo.getStatus());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getExpressNum()), AgentOrder::getExpressNum, bo.getExpressNum());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getExpressRoutes()), AgentOrder::getExpressRoutes, bo.getExpressRoutes());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatusCd()), AgentOrder::getStatusCd, bo.getStatusCd());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getRouteArr()), AgentOrder::getRouteArr, bo.getRouteArr());
|
||||||
|
lqw.eq(ObjectUtils.isNotNull(bo.getIsRecharge()), AgentOrder::getIsRecharge, bo.getIsRecharge());
|
||||||
|
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||||
|
AgentOrder::getCreateTime ,params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||||
|
lqw.orderByDesc(AgentOrder::getCreateTime);
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增订单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(AgentOrderBo bo) {
|
||||||
|
AgentOrder add = BeanUtil.toBean(bo, AgentOrder.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(AgentOrderBo bo) {
|
||||||
|
AgentOrder update = BeanUtil.toBean(bo, AgentOrder.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(AgentOrder entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除订单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AgentOrderVo> selectOrders() {
|
||||||
|
LambdaQueryWrapper<AgentOrder> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(AgentOrder::getStatus, "0");
|
||||||
|
return this.baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AgentOrderVo> queryListByLQW(LambdaQueryWrapper<AgentOrder> lqw) {
|
||||||
|
return this.baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateCount(AgentAccountGoodVo agentAccountGoodVo) {
|
||||||
|
Long waitCount = baseMapper.selectCount(new QueryWrapper<AgentOrder>().lambda()
|
||||||
|
.eq(AgentOrder::getAgentAccountId, agentAccountGoodVo.getAgentAccountId())
|
||||||
|
.eq(AgentOrder::getSaleId, agentAccountGoodVo.getSaleId())
|
||||||
|
.eq(AgentOrder::getStatus, 0));
|
||||||
|
Long completeCount = baseMapper.selectCount(new QueryWrapper<AgentOrder>().lambda()
|
||||||
|
.eq(AgentOrder::getAgentAccountId, agentAccountGoodVo.getAgentAccountId())
|
||||||
|
.eq(AgentOrder::getSaleId, agentAccountGoodVo.getSaleId())
|
||||||
|
.eq(AgentOrder::getStatus, 1));
|
||||||
|
|
||||||
|
AgentAccountGood agentAccountGood = new AgentAccountGood();
|
||||||
|
agentAccountGood.setId(agentAccountGoodVo.getId());
|
||||||
|
agentAccountGood.setWaitCount(Integer.valueOf(String.valueOf(waitCount)));
|
||||||
|
agentAccountGood.setCompleteCount(Integer.valueOf(String.valueOf(completeCount)));
|
||||||
|
agentAccountGood.setVerifiedCount(Integer.valueOf(String.valueOf(completeCount+waitCount)));
|
||||||
|
agentAccountGoodMapper.updateById(agentAccountGood);
|
||||||
|
}
|
||||||
|
}
|
||||||
110
ct/src/main/java/com/ruoyi/ct/service/impl/AgentServiceImpl.java
Executable file
110
ct/src/main/java/com/ruoyi/ct/service/impl/AgentServiceImpl.java
Executable file
@@ -0,0 +1,110 @@
|
|||||||
|
package com.ruoyi.ct.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.AgentVo;
|
||||||
|
import com.ruoyi.ct.domain.Agent;
|
||||||
|
import com.ruoyi.ct.mapper.AgentMapper;
|
||||||
|
import com.ruoyi.ct.service.IAgentService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理商Service业务层处理
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class AgentServiceImpl implements IAgentService {
|
||||||
|
|
||||||
|
private final AgentMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AgentVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<AgentVo> queryPageList(AgentBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<Agent> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<AgentVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理商列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AgentVo> queryList(AgentBo bo) {
|
||||||
|
LambdaQueryWrapper<Agent> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<Agent> buildQueryWrapper(AgentBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<Agent> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getName()), Agent::getName, bo.getName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), Agent::getStatus, bo.getStatus());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理商
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(AgentBo bo) {
|
||||||
|
Agent add = BeanUtil.toBean(bo, Agent.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理商
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(AgentBo bo) {
|
||||||
|
Agent update = BeanUtil.toBean(bo, Agent.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(Agent entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除代理商
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
116
ct/src/main/java/com/ruoyi/ct/service/impl/ApiLogServiceImpl.java
Executable file
116
ct/src/main/java/com/ruoyi/ct/service/impl/ApiLogServiceImpl.java
Executable file
@@ -0,0 +1,116 @@
|
|||||||
|
package com.ruoyi.ct.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.ct.domain.bo.ApiLogBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.ApiLogVo;
|
||||||
|
import com.ruoyi.ct.domain.ApiLog;
|
||||||
|
import com.ruoyi.ct.mapper.ApiLogMapper;
|
||||||
|
import com.ruoyi.ct.service.IApiLogService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API调用日志Service业务层处理
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class ApiLogServiceImpl implements IApiLogService {
|
||||||
|
|
||||||
|
private final ApiLogMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询API调用日志
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ApiLogVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询API调用日志列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<ApiLogVo> queryPageList(ApiLogBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<ApiLog> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<ApiLogVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询API调用日志列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ApiLogVo> queryList(ApiLogBo bo) {
|
||||||
|
LambdaQueryWrapper<ApiLog> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<ApiLog> buildQueryWrapper(ApiLogBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<ApiLog> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getPersonnelId()), ApiLog::getPersonnelId, bo.getPersonnelId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getUrl()), ApiLog::getUrl, bo.getUrl());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getRequestBody()), ApiLog::getRequestBody, bo.getRequestBody());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getRequestHeader()), ApiLog::getRequestHeader, bo.getRequestHeader());
|
||||||
|
lqw.eq(bo.getIsSuccess() != null, ApiLog::getIsSuccess, bo.getIsSuccess());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getErrorMsg()), ApiLog::getErrorMsg, bo.getErrorMsg());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getResponse()), ApiLog::getResponse, bo.getResponse());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getIp()), ApiLog::getIp, bo.getIp());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增API调用日志
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(ApiLogBo bo) {
|
||||||
|
ApiLog add = BeanUtil.toBean(bo, ApiLog.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改API调用日志
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(ApiLogBo bo) {
|
||||||
|
ApiLog update = BeanUtil.toBean(bo, ApiLog.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(ApiLog entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除API调用日志
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
445
ct/src/main/java/com/ruoyi/ct/service/impl/CTServiceImpl.java
Normal file
445
ct/src/main/java/com/ruoyi/ct/service/impl/CTServiceImpl.java
Normal file
@@ -0,0 +1,445 @@
|
|||||||
|
package com.ruoyi.ct.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import cn.hutool.json.JSONArray;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.ruoyi.common.core.domain.CTRequestBody;
|
||||||
|
import com.ruoyi.common.core.domain.CTResponse;
|
||||||
|
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||||
|
import com.ruoyi.ct.service.CTService;
|
||||||
|
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class CTServiceImpl implements CTService {
|
||||||
|
|
||||||
|
@Value("${api.app-id}")
|
||||||
|
private String appId;
|
||||||
|
|
||||||
|
@Value("${api.host}")
|
||||||
|
private String host;
|
||||||
|
|
||||||
|
@Value("${api.local-ip}")
|
||||||
|
private String localIp;
|
||||||
|
|
||||||
|
@Value("${api.token-key}")
|
||||||
|
private String tokenKey;
|
||||||
|
|
||||||
|
@Value("${api.public-key}")
|
||||||
|
private String publicKey;
|
||||||
|
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
private CTRequestBody requestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信返回:
|
||||||
|
* {
|
||||||
|
* 'isSuccess': 1,
|
||||||
|
* 'errorCode': None,
|
||||||
|
* 'errorMsg': None,
|
||||||
|
* 'details': None,
|
||||||
|
* 'needTerminate': False,
|
||||||
|
* 'executeType': None,
|
||||||
|
* 'result': '624eb07c-5488-476d-a7ff-c87f584daa1c',
|
||||||
|
* 'channelCode': '90010160'
|
||||||
|
* }
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean getToken() {
|
||||||
|
String res = HttpUtil.post(String.format("%sdqAuth/token_service_out/rs/token/%s", host, appId), new HashMap<>());
|
||||||
|
System.out.println("res = " + res);
|
||||||
|
JSONObject response = JSONUtil.parseObj(res);
|
||||||
|
if (response.getInt("isSuccess") == 1) {
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
LocalDate tomorrow = today.plusDays(1);
|
||||||
|
LocalDateTime tm = LocalDateTime.of(tomorrow.getYear(), tomorrow.getMonth(), tomorrow.getDayOfMonth(), 0 ,0 ,0);
|
||||||
|
System.out.println("距离明天的时间剩余:"+Duration.between(LocalDateTime.now(), tm));
|
||||||
|
token = response.getStr("result");
|
||||||
|
System.out.println("成功获取 token = " + token);
|
||||||
|
RedisUtils.setCacheObject(tokenKey, token, Duration.between(LocalDateTime.now(), tm));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
System.out.println("获取token失败");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信返回:
|
||||||
|
* {
|
||||||
|
* 'isSuccess': 0,
|
||||||
|
* 'errorCode': 'token cannot be null or empty !!',
|
||||||
|
* 'errorMsg': None,
|
||||||
|
* 'details': None,
|
||||||
|
* 'needTerminate': False,
|
||||||
|
* 'executeType': None,
|
||||||
|
* 'result': None,
|
||||||
|
* 'channelCode': None
|
||||||
|
* }
|
||||||
|
* {
|
||||||
|
* 'isSuccess': 1,
|
||||||
|
* 'errorCode': '0003',
|
||||||
|
* 'errorMsg': 'Success!',
|
||||||
|
* 'details': None,
|
||||||
|
* 'needTerminate': False,
|
||||||
|
* 'executeType': None,
|
||||||
|
* 'result': '150126',
|
||||||
|
* 'channelCode': '90010160'
|
||||||
|
* }
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean checkToken() {
|
||||||
|
try {
|
||||||
|
token = RedisUtils.getCacheObject(tokenKey);
|
||||||
|
System.out.println("token = " + token);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
// 缓存中没有token,需要重新获取
|
||||||
|
if (!getToken()) {
|
||||||
|
// 没有获取到token,提示稍后再试
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String res = HttpUtil.post(String.format("%sdqAuth/token_service/token/ckeckToken?ip=%s&token=%s", host, localIp, token), new HashMap<>());
|
||||||
|
System.out.println("res = " + res);
|
||||||
|
JSONObject response = JSONUtil.parseObj(res);
|
||||||
|
if (response.getInt("isSuccess") != 1) {
|
||||||
|
// token已过期,重新获取
|
||||||
|
// 缓存中没有token,需要重新获取
|
||||||
|
if (!getToken()) {
|
||||||
|
// 没有获取到token,提示稍后再试
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
url = String.format("%sdqServer/api_out/xt/v1/extInterface", host);
|
||||||
|
requestBody = new CTRequestBody();
|
||||||
|
requestBody.setAppId(appId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param personnelId 代理商销售员 ID Y
|
||||||
|
* @param saleId 销售品 ID
|
||||||
|
* @param page 页码
|
||||||
|
* @param pageSize 每页返回号码数量,默认 10
|
||||||
|
* @return
|
||||||
|
* number String 号码
|
||||||
|
* level String 号码等级
|
||||||
|
* minAmount String 每月最低消费
|
||||||
|
* prepay String 号码需预存款
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<JSONObject> selectNumber(String personnelId, String saleId, String page, String pageSize) throws Exception {
|
||||||
|
if (checkToken()) {
|
||||||
|
requestBody.setInterfaceName("SelectNumber");
|
||||||
|
Map<String, Object> body = new HashMap<>();
|
||||||
|
body.put("personnelId", personnelId);
|
||||||
|
body.put("saleId", saleId);
|
||||||
|
body.put("page", page);
|
||||||
|
body.put("pageSize", pageSize);
|
||||||
|
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||||
|
HttpResponse httpResponse = HttpRequest.post(url)
|
||||||
|
.header("token", token)
|
||||||
|
.form(requestBody.toMap())
|
||||||
|
.execute();
|
||||||
|
System.out.println("httpResponse.body() = " + httpResponse.body());
|
||||||
|
if (httpResponse.isOk()) {
|
||||||
|
CTResponse<List<JSONObject>> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
return response.getData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("response status:"+httpResponse.getStatus());
|
||||||
|
System.out.println("request error");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
System.out.println("token error");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CTResponse<String> saveOrder(String name, String idCard, String contactMobile,
|
||||||
|
String installedAddress, String saleId, String storeId,
|
||||||
|
String personnelId, String province, String city,
|
||||||
|
String county, String serialNumber, String number,
|
||||||
|
String logiRemark, String pageUrl, String remark,
|
||||||
|
String installAddress, String ynumber2, String images) throws Exception {
|
||||||
|
if (checkToken()) {
|
||||||
|
requestBody.setInterfaceName("SaveOrder");
|
||||||
|
Map<String, Object> body = new HashMap<>();
|
||||||
|
|
||||||
|
body.put("name", name);
|
||||||
|
body.put("idCard", idCard);
|
||||||
|
body.put("contactMobile", contactMobile);
|
||||||
|
if (ObjectUtil.isNotNull(installedAddress)) {
|
||||||
|
body.put("installedAddress", installedAddress);
|
||||||
|
}
|
||||||
|
body.put("saleId", saleId);
|
||||||
|
body.put("storeId", storeId);
|
||||||
|
body.put("personnelId", personnelId);
|
||||||
|
if (ObjectUtil.isNotNull(province)) {
|
||||||
|
body.put("province", province);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotNull(city)) {
|
||||||
|
body.put("city", city);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotNull(county)) {
|
||||||
|
body.put("county", county);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNull(installedAddress) || ObjectUtil.isNull(province) || ObjectUtil.isNull(city) || ObjectUtil.isNull(county)) {
|
||||||
|
body.put("deliveryMethod", "2");
|
||||||
|
} else {
|
||||||
|
body.put("deliveryMethod", "1");
|
||||||
|
}
|
||||||
|
body.put("serialNumber", serialNumber);
|
||||||
|
body.put("number", number);
|
||||||
|
body.put("logiRemark", logiRemark);
|
||||||
|
body.put("pageUrl", pageUrl);
|
||||||
|
body.put("remark", remark);
|
||||||
|
body.put("installAddress", installAddress);
|
||||||
|
// body.put("ynumber2", ynumber2);
|
||||||
|
// body.put("images", images);
|
||||||
|
log.info("body:" + body);
|
||||||
|
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||||
|
HttpResponse httpResponse = HttpRequest.post(url)
|
||||||
|
.header("token", token)
|
||||||
|
.form(requestBody.toMap())
|
||||||
|
.execute();
|
||||||
|
log.error("body:"+httpResponse.body());
|
||||||
|
if (httpResponse.isOk()) {
|
||||||
|
CTResponse<String> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
log.error("response status:"+httpResponse.getStatus());
|
||||||
|
log.error("request error");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
log.error("token error");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CTResponse<String> uploadFile(String serialNumber, String name, String idCard, String type, String msgId, String img) throws Exception {
|
||||||
|
if (checkToken()) {
|
||||||
|
requestBody.setInterfaceName("UploadFile");
|
||||||
|
requestBody.setFileBase64(img);
|
||||||
|
Map<String, Object> body = new HashMap<>();
|
||||||
|
|
||||||
|
body.put("name", name);
|
||||||
|
body.put("idCard", idCard);
|
||||||
|
body.put("type", type);
|
||||||
|
body.put("isV4", "1");
|
||||||
|
body.put("serialNumber", serialNumber);
|
||||||
|
if (ObjectUtil.isNotNull(msgId)) {
|
||||||
|
body.put("msgId", msgId);
|
||||||
|
}
|
||||||
|
log.info("body:" + body);
|
||||||
|
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||||
|
HttpResponse httpResponse = HttpRequest.post(url)
|
||||||
|
.header("token", token)
|
||||||
|
.form(requestBody.toMap())
|
||||||
|
.execute();
|
||||||
|
log.error("body:"+httpResponse.body());
|
||||||
|
if (httpResponse.isOk()) {
|
||||||
|
CTResponse<String> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
log.error("response status:"+httpResponse.getStatus());
|
||||||
|
log.error("request error");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
log.error("token error");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CTResponse<String> updateOrder(String name, String orderNum) throws Exception {
|
||||||
|
if (checkToken()) {
|
||||||
|
requestBody.setInterfaceName("QueryOrder");
|
||||||
|
Map<String, Object> body = new HashMap<>();
|
||||||
|
|
||||||
|
body.put("name", name);
|
||||||
|
body.put("orderNum", orderNum);
|
||||||
|
|
||||||
|
log.info("body:" + body);
|
||||||
|
System.out.println("body = " + body);
|
||||||
|
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||||
|
HttpResponse httpResponse = HttpRequest.post(url)
|
||||||
|
.header("token", token)
|
||||||
|
.form(requestBody.toMap())
|
||||||
|
.execute();
|
||||||
|
log.error("body:"+httpResponse.body());
|
||||||
|
System.out.println("httpResponse.body() = " + httpResponse.body());
|
||||||
|
if (httpResponse.isOk()) {
|
||||||
|
CTResponse<String> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||||
|
String data = response.getData();
|
||||||
|
try {
|
||||||
|
response.setDecryptData(JSONUtil.parseObj(decrypt(data, publicKey)));
|
||||||
|
return response;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("解密错误");
|
||||||
|
log.error(response.getData());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
log.error("response status:"+httpResponse.getStatus());
|
||||||
|
log.error("request error");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CTResponse<String> updateExpress(String orderNum) throws Exception {
|
||||||
|
if (checkToken()) {
|
||||||
|
requestBody.setInterfaceName("QueryOrderResult");
|
||||||
|
Map<String, Object> body = new HashMap<>();
|
||||||
|
|
||||||
|
body.put("orderNum", orderNum);
|
||||||
|
|
||||||
|
log.info("body:" + body);
|
||||||
|
System.out.println("body = " + body);
|
||||||
|
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||||
|
HttpResponse httpResponse = HttpRequest.post(url)
|
||||||
|
.header("token", token)
|
||||||
|
.form(requestBody.toMap())
|
||||||
|
.execute();
|
||||||
|
log.error("body:"+httpResponse.body());
|
||||||
|
System.out.println("httpResponse.body() = " + httpResponse.body());
|
||||||
|
if (httpResponse.isOk()) {
|
||||||
|
CTResponse<String> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||||
|
|
||||||
|
try {
|
||||||
|
String data = response.getData();
|
||||||
|
response.setDecryptData(JSONUtil.parseObj(decrypt(data, publicKey)));
|
||||||
|
return response;
|
||||||
|
} catch (Exception e) {
|
||||||
|
response.setDecryptData(JSONUtil.parseObj(httpResponse.body()).getJSONObject("data"));
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
log.error("response status:"+httpResponse.getStatus());
|
||||||
|
log.error("request error");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CTResponse<JSONArray> syncOffer(String orderNum, String offerIds, String salesNumber) throws Exception {
|
||||||
|
if (checkToken()) {
|
||||||
|
requestBody.setInterfaceName("QueryNumberOffer");
|
||||||
|
Map<String, Object> body = new HashMap<>();
|
||||||
|
|
||||||
|
body.put("orderNo", orderNum);
|
||||||
|
body.put("offerIds", offerIds);
|
||||||
|
body.put("salesNumber", salesNumber);
|
||||||
|
|
||||||
|
log.info("body:" + body);
|
||||||
|
System.out.println("body = " + body);
|
||||||
|
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||||
|
HttpResponse httpResponse = HttpRequest.post(url)
|
||||||
|
.header("token", token)
|
||||||
|
.form(requestBody.toMap())
|
||||||
|
.execute();
|
||||||
|
// log.error("body:"+httpResponse.body());
|
||||||
|
System.out.println("httpResponse.body() = " + httpResponse.body());
|
||||||
|
if (httpResponse.isOk()) {
|
||||||
|
CTResponse<JSONArray> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||||
|
response.setData(JSONUtil.parseObj(httpResponse.body()).getJSONArray("data"));
|
||||||
|
return response;
|
||||||
|
// try {
|
||||||
|
// JSONArray data = response.getData();
|
||||||
|
// response.setDecryptData(JSONUtil.parseObj(decrypt(data, publicKey)));
|
||||||
|
// return response;
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// response.setDecryptData(JSONUtil.parseObj(httpResponse.body()).getJSONObject("data"));
|
||||||
|
// return response;
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
log.error("response status:"+httpResponse.getStatus());
|
||||||
|
log.error("request error");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String DEFAULT_CODING = "utf-8";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解密
|
||||||
|
* @param encryptedText 需要解密的密文字符串
|
||||||
|
* @param key 密钥
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static String decrypt(String encryptedText, String key) throws Exception {
|
||||||
|
byte[] encryptedBytes = parseHexStr2Byte(encryptedText);
|
||||||
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||||
|
byte[] thedigest = md.digest(key.getBytes("utf-8"));
|
||||||
|
SecretKeySpec skc = new SecretKeySpec(thedigest, "AES");
|
||||||
|
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, skc);
|
||||||
|
byte[] decrypted = cipher.doFinal(encryptedBytes);
|
||||||
|
return new String(decrypted, "utf-8");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16 进制数组转字节数组
|
||||||
|
*
|
||||||
|
* @param hexStr 16 进制字符串
|
||||||
|
* @return 字节数组
|
||||||
|
*/
|
||||||
|
private static byte[] parseHexStr2Byte(String hexStr) {
|
||||||
|
if (hexStr.length() < 1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
byte[] result = new byte[hexStr.length() / 2];
|
||||||
|
for (int i = 0; i < hexStr.length() / 2; i++) {
|
||||||
|
int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16);
|
||||||
|
int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2), 16);
|
||||||
|
result[i] = (byte) (high * 16 + low);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try {
|
||||||
|
System.out.println(decrypt("ce3169c7e36ee03af8d18d953aea916292498fc580687cfac135906b267c2d855da0d68071acecae28c7914490ddfe6ffa9175729adc6c22651ffac30fe55d407492588b8b20ff57f96b882b73e2d7fcabbf60766c6da4bb434eb7daeb976826c88aa28051cb559af7ff0e182787347e74403caedea161917e5f4ec2c4e43e557560b1c60a9f88ac6d580722a0d239fb29df9f94afaa41bfd8b0b93018d63c52ac1fb9071c233df9142d757cfa67d7b4282fb620fb614f88868908965e314ad71ee96d8208c59d01370507d7b4f39d59527e69af53bbf315807ee30ef63b80bb2bed76c52b0018b616aba12047a65608", "KEY657a695e0cf254f3bf10fe0a"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
112
ct/src/main/java/com/ruoyi/ct/service/impl/GoodServiceImpl.java
Executable file
112
ct/src/main/java/com/ruoyi/ct/service/impl/GoodServiceImpl.java
Executable file
@@ -0,0 +1,112 @@
|
|||||||
|
package com.ruoyi.ct.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.ct.domain.bo.GoodBo;
|
||||||
|
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||||
|
import com.ruoyi.ct.domain.Good;
|
||||||
|
import com.ruoyi.ct.mapper.GoodMapper;
|
||||||
|
import com.ruoyi.ct.service.IGoodService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电信商品Service业务层处理
|
||||||
|
*
|
||||||
|
* @author isnail
|
||||||
|
* @date 2023-12-18
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class GoodServiceImpl implements IGoodService {
|
||||||
|
|
||||||
|
private final GoodMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询电信商品
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public GoodVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询电信商品列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<GoodVo> queryPageList(GoodBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<Good> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<GoodVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询电信商品列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<GoodVo> queryList(GoodBo bo) {
|
||||||
|
LambdaQueryWrapper<Good> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<Good> buildQueryWrapper(GoodBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<Good> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getName()), Good::getName, bo.getName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getContent()), Good::getContent, bo.getContent());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSaleId()), Good::getSaleId, bo.getSaleId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), Good::getStatus, bo.getStatus());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增电信商品
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(GoodBo bo) {
|
||||||
|
Good add = BeanUtil.toBean(bo, Good.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改电信商品
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(GoodBo bo) {
|
||||||
|
Good update = BeanUtil.toBean(bo, Good.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(Good entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除电信商品
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
logs/.DS_Store
vendored
Normal file
BIN
logs/.DS_Store
vendored
Normal file
Binary file not shown.
455
pom.xml
Normal file
455
pom.xml
Normal file
@@ -0,0 +1,455 @@
|
|||||||
|
<?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-vue-plus</artifactId>
|
||||||
|
<version>4.8.1</version>
|
||||||
|
|
||||||
|
<name>RuoYi-Vue-Plus</name>
|
||||||
|
<url>https://gitee.com/dromara/RuoYi-Vue-Plus</url>
|
||||||
|
<description>RuoYi-Vue-Plus后台管理系统</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<ruoyi-vue-plus.version>4.8.1</ruoyi-vue-plus.version>
|
||||||
|
<spring-boot.version>2.7.16</spring-boot.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.2.2</maven-jar-plugin.version>
|
||||||
|
<spring-boot.mybatis>2.2.2</spring-boot.mybatis>
|
||||||
|
<springdoc.version>1.6.15</springdoc.version>
|
||||||
|
<poi.version>5.2.3</poi.version>
|
||||||
|
<easyexcel.version>3.3.2</easyexcel.version>
|
||||||
|
<velocity.version>2.3</velocity.version>
|
||||||
|
<satoken.version>1.36.0</satoken.version>
|
||||||
|
<mybatis-plus.version>3.5.3.2</mybatis-plus.version>
|
||||||
|
<p6spy.version>3.9.1</p6spy.version>
|
||||||
|
<hutool.version>5.8.20</hutool.version>
|
||||||
|
<okhttp.version>4.10.0</okhttp.version>
|
||||||
|
<spring-boot-admin.version>2.7.11</spring-boot-admin.version>
|
||||||
|
<redisson.version>3.20.1</redisson.version>
|
||||||
|
<lock4j.version>2.2.3</lock4j.version>
|
||||||
|
<dynamic-ds.version>3.5.2</dynamic-ds.version>
|
||||||
|
<alibaba-ttl.version>2.14.2</alibaba-ttl.version>
|
||||||
|
<xxl-job.version>2.4.0</xxl-job.version>
|
||||||
|
<lombok.version>1.18.30</lombok.version>
|
||||||
|
<bouncycastle.version>1.72</bouncycastle.version>
|
||||||
|
<!-- 离线IP地址定位库 -->
|
||||||
|
<ip2region.version>2.7.0</ip2region.version>
|
||||||
|
|
||||||
|
<!-- 临时修复 snakeyaml 漏洞 -->
|
||||||
|
<snakeyaml.version>1.33</snakeyaml.version>
|
||||||
|
|
||||||
|
<!-- OSS 配置 -->
|
||||||
|
<aws-java-sdk-s3.version>1.12.400</aws-java-sdk-s3.version>
|
||||||
|
<!-- SMS 配置 -->
|
||||||
|
<sms4j.version>2.2.0</sms4j.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>local</id>
|
||||||
|
<properties>
|
||||||
|
<!-- 环境标识,需要与配置文件的名称相对应 -->
|
||||||
|
<profiles.active>local</profiles.active>
|
||||||
|
<logging.level>debug</logging.level>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>dev</id>
|
||||||
|
<properties>
|
||||||
|
<!-- 环境标识,需要与配置文件的名称相对应 -->
|
||||||
|
<profiles.active>dev</profiles.active>
|
||||||
|
<logging.level>debug</logging.level>
|
||||||
|
</properties>
|
||||||
|
<activation>
|
||||||
|
<!-- 默认环境 -->
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>prod</id>
|
||||||
|
<properties>
|
||||||
|
<profiles.active>prod</profiles.active>
|
||||||
|
<logging.level>warn</logging.level>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
<!-- 依赖声明 -->
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- SpringBoot的依赖配置-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-dependencies</artifactId>
|
||||||
|
<version>${spring-boot.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- hutool 的依赖配置-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-bom</artifactId>
|
||||||
|
<version>${hutool.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-webmvc-core</artifactId>
|
||||||
|
<version>${springdoc.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-javadoc</artifactId>
|
||||||
|
<version>${springdoc.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>${lombok.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi</artifactId>
|
||||||
|
<version>${poi.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi-ooxml</artifactId>
|
||||||
|
<version>${poi.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>easyexcel</artifactId>
|
||||||
|
<version>${easyexcel.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi-ooxml-schemas</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- velocity代码生成使用模板 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.velocity</groupId>
|
||||||
|
<artifactId>velocity-engine-core</artifactId>
|
||||||
|
<version>${velocity.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Sa-Token 权限认证, 在线文档:http://sa-token.dev33.cn/ -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.dev33</groupId>
|
||||||
|
<artifactId>sa-token-spring-boot-starter</artifactId>
|
||||||
|
<version>${satoken.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Sa-Token 整合 jwt -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.dev33</groupId>
|
||||||
|
<artifactId>sa-token-jwt</artifactId>
|
||||||
|
<version>${satoken.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- dynamic-datasource 多数据源-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||||
|
<version>${dynamic-ds.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>${mybatis-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- sql性能分析插件 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>p6spy</groupId>
|
||||||
|
<artifactId>p6spy</artifactId>
|
||||||
|
<version>${p6spy.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>okhttp</artifactId>
|
||||||
|
<version>${okhttp.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.amazonaws</groupId>
|
||||||
|
<artifactId>aws-java-sdk-s3</artifactId>
|
||||||
|
<version>${aws-java-sdk-s3.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--短信sms4j-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara.sms4j</groupId>
|
||||||
|
<artifactId>sms4j-spring-boot-starter</artifactId>
|
||||||
|
<version>${sms4j.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.codecentric</groupId>
|
||||||
|
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||||
|
<version>${spring-boot-admin.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.codecentric</groupId>
|
||||||
|
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||||
|
<version>${spring-boot-admin.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--redisson-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.redisson</groupId>
|
||||||
|
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||||
|
<version>${redisson.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.redisson</groupId>
|
||||||
|
<artifactId>redisson-spring-data-30</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.redisson</groupId>
|
||||||
|
<artifactId>redisson-spring-data-27</artifactId>
|
||||||
|
<version>${redisson.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>lock4j-redisson-spring-boot-starter</artifactId>
|
||||||
|
<version>${lock4j.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- xxl-job-core -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.xuxueli</groupId>
|
||||||
|
<artifactId>xxl-job-core</artifactId>
|
||||||
|
<version>${xxl-job.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>transmittable-thread-local</artifactId>
|
||||||
|
<version>${alibaba-ttl.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 离线IP地址定位库 ip2region -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.lionsoul</groupId>
|
||||||
|
<artifactId>ip2region</artifactId>
|
||||||
|
<version>${ip2region.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 临时修复 snakeyaml 漏洞 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.yaml</groupId>
|
||||||
|
<artifactId>snakeyaml</artifactId>
|
||||||
|
<version>${snakeyaml.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 加密包引入 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk15to18</artifactId>
|
||||||
|
<version>${bouncycastle.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 定时任务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-job</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 代码生成-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 核心模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-framework</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 系统模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-system</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 通用工具-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- OSS对象存储模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-oss</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SMS短信模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-sms</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-demo</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- ct -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ct</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>api</artifactId>
|
||||||
|
<version>${ruoyi-vue-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>ruoyi-admin</module>
|
||||||
|
<module>ruoyi-framework</module>
|
||||||
|
<module>ruoyi-system</module>
|
||||||
|
<module>ruoyi-job</module>
|
||||||
|
<module>ruoyi-generator</module>
|
||||||
|
<module>ruoyi-common</module>
|
||||||
|
<module>ruoyi-demo</module>
|
||||||
|
<module>ct</module>
|
||||||
|
<module>api</module>
|
||||||
|
<module>ruoyi-extend</module>
|
||||||
|
<module>ruoyi-oss</module>
|
||||||
|
<module>ruoyi-sms</module>
|
||||||
|
</modules>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.9.0</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
|
<annotationProcessorPaths>
|
||||||
|
<path>
|
||||||
|
<groupId>com.github.therapi</groupId>
|
||||||
|
<artifactId>therapi-runtime-javadoc-scribe</artifactId>
|
||||||
|
<version>0.15.0</version>
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>${lombok.version}</version>
|
||||||
|
</path>
|
||||||
|
<path>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<version>${spring-boot.version}</version>
|
||||||
|
</path>
|
||||||
|
</annotationProcessorPaths>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<!-- 单元测试使用 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
<configuration>
|
||||||
|
<argLine>-Dfile.encoding=UTF-8</argLine>
|
||||||
|
<!-- 根据打包环境执行对应的@Tag测试方法 -->
|
||||||
|
<groups>${profiles.active}</groups>
|
||||||
|
<!-- 排除标签 -->
|
||||||
|
<excludedGroups>exclude</excludedGroups>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<!-- 关闭过滤 -->
|
||||||
|
<filtering>false</filtering>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<!-- 引入所有 匹配文件进行过滤 -->
|
||||||
|
<includes>
|
||||||
|
<include>application*</include>
|
||||||
|
<include>bootstrap*</include>
|
||||||
|
<include>banner*</include>
|
||||||
|
</includes>
|
||||||
|
<!-- 启用过滤 即该资源中的变量将会被过滤器中的值替换 -->
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>public</id>
|
||||||
|
<name>huawei nexus</name>
|
||||||
|
<url>https://mirrors.huaweicloud.com/repository/maven/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>public</id>
|
||||||
|
<name>huawei nexus</name>
|
||||||
|
<url>https://mirrors.huaweicloud.com/repository/maven/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
||||||
|
|
||||||
23
ruoyi-admin/Dockerfile
Normal file
23
ruoyi-admin/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
FROM anapsix/alpine-java:8_server-jre_unlimited
|
||||||
|
|
||||||
|
MAINTAINER Lion Li
|
||||||
|
|
||||||
|
RUN mkdir -p /ruoyi/server/logs \
|
||||||
|
/ruoyi/server/temp \
|
||||||
|
/ruoyi/skywalking/agent
|
||||||
|
|
||||||
|
WORKDIR /ruoyi/server
|
||||||
|
|
||||||
|
ENV SERVER_PORT=8080
|
||||||
|
|
||||||
|
EXPOSE ${SERVER_PORT}
|
||||||
|
|
||||||
|
ADD ./target/ruoyi-admin.jar ./app.jar
|
||||||
|
|
||||||
|
ENTRYPOINT ["java", \
|
||||||
|
"-Djava.security.egd=file:/dev/./urandom", \
|
||||||
|
"-Dserver.port=${SERVER_PORT}", \
|
||||||
|
# 应用名称 如果想区分集群节点监控 改成不同的名称即可
|
||||||
|
# "-Dskywalking.agent.service_name=ruoyi-server", \
|
||||||
|
# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
|
||||||
|
"-jar", "app.jar"]
|
||||||
136
ruoyi-admin/pom.xml
Normal file
136
ruoyi-admin/pom.xml
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
<?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-vue-plus</artifactId>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<version>4.8.1</version>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<!-- Mysql驱动包 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- Oracle -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.database.jdbc</groupId>
|
||||||
|
<artifactId>ojdbc8</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- PostgreSql -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- SqlServer -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.microsoft.sqlserver</groupId>
|
||||||
|
<artifactId>mssql-jdbc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 核心模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-framework</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-system</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-job</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-oss</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 代码生成-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- demo模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-demo</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ct</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
|
<!-- <artifactId>spring-boot-starter-test</artifactId>-->
|
||||||
|
<!-- <scope>test</scope>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- skywalking 整合 logback -->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>org.apache.skywalking</groupId>-->
|
||||||
|
<!-- <artifactId>apm-toolkit-logback-1.x</artifactId>-->
|
||||||
|
<!-- <version>${与你的agent探针版本保持一致}</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>org.apache.skywalking</groupId>-->
|
||||||
|
<!-- <artifactId>apm-toolkit-trace</artifactId>-->
|
||||||
|
<!-- <version>${与你的agent探针版本保持一致}</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>${spring-boot.version}</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.2.2</version>
|
||||||
|
<configuration>
|
||||||
|
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||||
|
<warName>${project.artifactId}</warName>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
24
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
Normal file
24
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动程序
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class RuoYiApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.setProperty("spring.devtools.restart.enabled", "false");
|
||||||
|
SpringApplication application = new SpringApplication(RuoYiApplication.class);
|
||||||
|
application.setApplicationStartup(new BufferingApplicationStartup(2048));
|
||||||
|
application.run(args);
|
||||||
|
System.out.println("(♥◠‿◠)ノ゙ RuoYi-Vue-Plus启动成功 ლ(´ڡ`ლ)゙");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.ruoyi;
|
||||||
|
|
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web容器中进行部署
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class RuoYiServletInitializer extends SpringBootServletInitializer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||||
|
return application.sources(RuoYiApplication.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.ruoyi.web.controller.api;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.ruoyi.common.core.domain.CTResponse;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.ct.service.CTService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@SaIgnore
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("ct")
|
||||||
|
public class APIController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CTService ctService;
|
||||||
|
|
||||||
|
@GetMapping("/selectNumber")
|
||||||
|
public R<List<JSONObject>> selectNumber(String personnelId, String saleId, String page, String pageSize) throws Exception {
|
||||||
|
return R.ok(ctService.selectNumber(personnelId, saleId, page, pageSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/saveOrder")
|
||||||
|
public R<String> saveOrder() throws Exception {
|
||||||
|
CTResponse<String> response = ctService.saveOrder("", "", "", "", "", "",
|
||||||
|
"", "", "", "", "", "", "", "", "",
|
||||||
|
"", "", "");
|
||||||
|
return R.ok(response.getData());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryOrder")
|
||||||
|
public R<JSONObject> queryOrder(String name, String orderNum) throws Exception {
|
||||||
|
CTResponse<String> response = ctService.updateOrder(name, orderNum);
|
||||||
|
return R.ok(response.getDecryptData());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
package com.ruoyi.web.controller.common;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
import cn.hutool.captcha.AbstractCaptcha;
|
||||||
|
import cn.hutool.captcha.generator.CodeGenerator;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import com.ruoyi.common.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.enums.CaptchaType;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.email.MailUtils;
|
||||||
|
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||||
|
import com.ruoyi.common.utils.reflect.ReflectUtils;
|
||||||
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
|
import com.ruoyi.framework.config.properties.CaptchaProperties;
|
||||||
|
import com.ruoyi.framework.config.properties.MailProperties;
|
||||||
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.sms4j.api.SmsBlend;
|
||||||
|
import org.dromara.sms4j.api.entity.SmsResponse;
|
||||||
|
import org.dromara.sms4j.core.factory.SmsFactory;
|
||||||
|
import org.dromara.sms4j.provider.enumerate.SupplierType;
|
||||||
|
import org.springframework.expression.Expression;
|
||||||
|
import org.springframework.expression.ExpressionParser;
|
||||||
|
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证码操作处理
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@SaIgnore
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
public class CaptchaController {
|
||||||
|
|
||||||
|
private final CaptchaProperties captchaProperties;
|
||||||
|
private final ISysConfigService configService;
|
||||||
|
private final MailProperties mailProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短信验证码
|
||||||
|
*
|
||||||
|
* @param phonenumber 用户手机号
|
||||||
|
*/
|
||||||
|
@GetMapping("/captchaSms")
|
||||||
|
public R<Void> smsCaptcha(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) {
|
||||||
|
String key = CacheConstants.CAPTCHA_CODE_KEY + phonenumber;
|
||||||
|
String code = RandomUtil.randomNumbers(4);
|
||||||
|
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
||||||
|
// 验证码模板id 自行处理 (查数据库或写死均可)
|
||||||
|
String templateId = "";
|
||||||
|
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
|
||||||
|
map.put("code", code);
|
||||||
|
SmsBlend smsBlend = SmsFactory.createSmsBlend(SupplierType.ALIBABA);
|
||||||
|
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, templateId, map);
|
||||||
|
if (!"OK".equals(smsResponse.getCode())) {
|
||||||
|
log.error("验证码短信发送异常 => {}", smsResponse);
|
||||||
|
return R.fail(smsResponse.getMessage());
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邮箱验证码
|
||||||
|
*
|
||||||
|
* @param email 邮箱
|
||||||
|
*/
|
||||||
|
@GetMapping("/captchaEmail")
|
||||||
|
public R<Void> emailCode(@NotBlank(message = "{user.email.not.blank}") String email) {
|
||||||
|
if (!mailProperties.getEnabled()) {
|
||||||
|
return R.fail("当前系统没有开启邮箱功能!");
|
||||||
|
}
|
||||||
|
String key = CacheConstants.CAPTCHA_CODE_KEY + email;
|
||||||
|
String code = RandomUtil.randomNumbers(4);
|
||||||
|
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
||||||
|
try {
|
||||||
|
MailUtils.sendText(email, "登录验证码", "您本次验证码为:" + code + ",有效性为" + Constants.CAPTCHA_EXPIRATION + "分钟,请尽快填写。");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("验证码短信发送异常 => {}", e.getMessage());
|
||||||
|
return R.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成验证码
|
||||||
|
*/
|
||||||
|
@GetMapping("/captchaImage")
|
||||||
|
public R<Map<String, Object>> getCode() {
|
||||||
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
|
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||||
|
ajax.put("captchaEnabled", captchaEnabled);
|
||||||
|
if (!captchaEnabled) {
|
||||||
|
return R.ok(ajax);
|
||||||
|
}
|
||||||
|
// 保存验证码信息
|
||||||
|
String uuid = IdUtil.simpleUUID();
|
||||||
|
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
|
||||||
|
// 生成验证码
|
||||||
|
CaptchaType captchaType = captchaProperties.getType();
|
||||||
|
boolean isMath = CaptchaType.MATH == captchaType;
|
||||||
|
Integer length = isMath ? captchaProperties.getNumberLength() : captchaProperties.getCharLength();
|
||||||
|
CodeGenerator codeGenerator = ReflectUtils.newInstance(captchaType.getClazz(), length);
|
||||||
|
AbstractCaptcha captcha = SpringUtils.getBean(captchaProperties.getCategory().getClazz());
|
||||||
|
captcha.setGenerator(codeGenerator);
|
||||||
|
captcha.createCode();
|
||||||
|
String code = captcha.getCode();
|
||||||
|
if (isMath) {
|
||||||
|
ExpressionParser parser = new SpelExpressionParser();
|
||||||
|
Expression exp = parser.parseExpression(StringUtils.remove(code, "="));
|
||||||
|
code = exp.getValue(String.class);
|
||||||
|
}
|
||||||
|
RedisUtils.setCacheObject(verifyKey, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
||||||
|
ajax.put("uuid", uuid);
|
||||||
|
ajax.put("img", captcha.getImageBase64());
|
||||||
|
return R.ok(ajax);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.ruoyi.common.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.constant.CacheNames;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.utils.JsonUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.redis.CacheUtils;
|
||||||
|
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||||
|
import com.ruoyi.system.domain.SysCache;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.redisson.spring.data.connection.RedissonConnectionFactory;
|
||||||
|
import org.springframework.data.redis.connection.RedisConnection;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存监控
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/monitor/cache")
|
||||||
|
public class CacheController {
|
||||||
|
|
||||||
|
private final RedissonConnectionFactory connectionFactory;
|
||||||
|
|
||||||
|
private final static List<SysCache> CACHES = new ArrayList<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
CACHES.add(new SysCache(CacheConstants.ONLINE_TOKEN_KEY, "在线用户"));
|
||||||
|
CACHES.add(new SysCache(CacheNames.SYS_CONFIG, "配置信息"));
|
||||||
|
CACHES.add(new SysCache(CacheNames.SYS_DICT, "数据字典"));
|
||||||
|
CACHES.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
|
||||||
|
CACHES.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
|
||||||
|
CACHES.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
|
||||||
|
CACHES.add(new SysCache(CacheNames.SYS_OSS_CONFIG, "OSS配置"));
|
||||||
|
CACHES.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取缓存监控列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:cache:list")
|
||||||
|
@GetMapping()
|
||||||
|
public R<Map<String, Object>> getInfo() throws Exception {
|
||||||
|
RedisConnection connection = connectionFactory.getConnection();
|
||||||
|
Properties info = connection.info();
|
||||||
|
Properties commandStats = connection.info("commandstats");
|
||||||
|
Long dbSize = connection.dbSize();
|
||||||
|
|
||||||
|
Map<String, Object> result = new HashMap<>(3);
|
||||||
|
result.put("info", info);
|
||||||
|
result.put("dbSize", dbSize);
|
||||||
|
|
||||||
|
List<Map<String, String>> pieList = new ArrayList<>();
|
||||||
|
if (commandStats != null) {
|
||||||
|
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 R.ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取缓存监控缓存名列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:cache:list")
|
||||||
|
@GetMapping("/getNames")
|
||||||
|
public R<List<SysCache>> cache() {
|
||||||
|
return R.ok(CACHES);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取缓存监控Key列表
|
||||||
|
*
|
||||||
|
* @param cacheName 缓存名
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:cache:list")
|
||||||
|
@GetMapping("/getKeys/{cacheName}")
|
||||||
|
public R<Collection<String>> getCacheKeys(@PathVariable String cacheName) {
|
||||||
|
Collection<String> cacheKeys = new HashSet<>(0);
|
||||||
|
if (isCacheNames(cacheName)) {
|
||||||
|
Set<Object> keys = CacheUtils.keys(cacheName);
|
||||||
|
if (CollUtil.isNotEmpty(keys)) {
|
||||||
|
cacheKeys = keys.stream().map(Object::toString).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cacheKeys = RedisUtils.keys(cacheName + "*");
|
||||||
|
}
|
||||||
|
return R.ok(cacheKeys);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取缓存监控缓存值详情
|
||||||
|
*
|
||||||
|
* @param cacheName 缓存名
|
||||||
|
* @param cacheKey 缓存key
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:cache:list")
|
||||||
|
@GetMapping("/getValue/{cacheName}/{cacheKey}")
|
||||||
|
public R<SysCache> getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) {
|
||||||
|
Object cacheValue;
|
||||||
|
if (isCacheNames(cacheName)) {
|
||||||
|
cacheValue = CacheUtils.get(cacheName, cacheKey);
|
||||||
|
} else {
|
||||||
|
cacheValue = RedisUtils.getCacheObject(cacheKey);
|
||||||
|
}
|
||||||
|
SysCache sysCache = new SysCache(cacheName, cacheKey, JsonUtils.toJsonString(cacheValue));
|
||||||
|
return R.ok(sysCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理缓存监控缓存名
|
||||||
|
*
|
||||||
|
* @param cacheName 缓存名
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:cache:list")
|
||||||
|
@DeleteMapping("/clearCacheName/{cacheName}")
|
||||||
|
public R<Void> clearCacheName(@PathVariable String cacheName) {
|
||||||
|
if (isCacheNames(cacheName)) {
|
||||||
|
CacheUtils.clear(cacheName);
|
||||||
|
} else {
|
||||||
|
RedisUtils.deleteKeys(cacheName + "*");
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理缓存监控Key
|
||||||
|
*
|
||||||
|
* @param cacheKey key名
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:cache:list")
|
||||||
|
@DeleteMapping("/clearCacheKey/{cacheName}/{cacheKey}")
|
||||||
|
public R<Void> clearCacheKey(@PathVariable String cacheName, @PathVariable String cacheKey) {
|
||||||
|
if (isCacheNames(cacheName)) {
|
||||||
|
CacheUtils.evict(cacheName, cacheKey);
|
||||||
|
} else {
|
||||||
|
RedisUtils.deleteObject(cacheKey);
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理全部缓存监控
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:cache:list")
|
||||||
|
@DeleteMapping("/clearCacheAll")
|
||||||
|
public R<Void> clearCacheAll() {
|
||||||
|
RedisUtils.deleteKeys("*");
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isCacheNames(String cacheName) {
|
||||||
|
return !StringUtils.contains(cacheName, ":");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||||
|
import com.ruoyi.system.domain.SysLogininfor;
|
||||||
|
import com.ruoyi.system.service.ISysLogininforService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统访问记录
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/monitor/logininfor")
|
||||||
|
public class SysLogininforController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysLogininforService logininforService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统访问记录列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:logininfor:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SysLogininfor> list(SysLogininfor logininfor, PageQuery pageQuery) {
|
||||||
|
return logininforService.selectPageLogininforList(logininfor, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出系统访问记录列表
|
||||||
|
*/
|
||||||
|
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||||
|
@SaCheckPermission("monitor:logininfor:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(SysLogininfor logininfor, HttpServletResponse response) {
|
||||||
|
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||||
|
ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除登录日志
|
||||||
|
* @param infoIds 日志ids
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:logininfor:remove")
|
||||||
|
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{infoIds}")
|
||||||
|
public R<Void> remove(@PathVariable Long[] infoIds) {
|
||||||
|
return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理系统访问记录
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:logininfor:remove")
|
||||||
|
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
||||||
|
@DeleteMapping("/clean")
|
||||||
|
public R<Void> clean() {
|
||||||
|
logininforService.cleanLogininfor();
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SaCheckPermission("monitor:logininfor:unlock")
|
||||||
|
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
||||||
|
@GetMapping("/unlock/{userName}")
|
||||||
|
public R<Void> unlock(@PathVariable("userName") String userName) {
|
||||||
|
String loginName = CacheConstants.PWD_ERR_CNT_KEY + userName;
|
||||||
|
if (RedisUtils.hasKey(loginName)) {
|
||||||
|
RedisUtils.deleteObject(loginName);
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.system.domain.SysOperLog;
|
||||||
|
import com.ruoyi.system.service.ISysOperLogService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作日志记录
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/monitor/operlog")
|
||||||
|
public class SysOperlogController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysOperLogService operLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取操作日志记录列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:operlog:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SysOperLog> list(SysOperLog operLog, PageQuery pageQuery) {
|
||||||
|
return operLogService.selectPageOperLogList(operLog, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出操作日志记录列表
|
||||||
|
*/
|
||||||
|
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||||
|
@SaCheckPermission("monitor:operlog:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(SysOperLog operLog, HttpServletResponse response) {
|
||||||
|
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||||
|
ExcelUtil.exportExcel(list, "操作日志", SysOperLog.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除操作日志记录
|
||||||
|
* @param operIds 日志ids
|
||||||
|
*/
|
||||||
|
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
||||||
|
@SaCheckPermission("monitor:operlog:remove")
|
||||||
|
@DeleteMapping("/{operIds}")
|
||||||
|
public R<Void> remove(@PathVariable Long[] operIds) {
|
||||||
|
return toAjax(operLogService.deleteOperLogByIds(operIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理操作日志记录
|
||||||
|
*/
|
||||||
|
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||||
|
@SaCheckPermission("monitor:operlog:remove")
|
||||||
|
@DeleteMapping("/clean")
|
||||||
|
public R<Void> clean() {
|
||||||
|
operLogService.cleanOperLog();
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.dev33.satoken.exception.NotLoginException;
|
||||||
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.domain.dto.UserOnlineDTO;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.StreamUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||||
|
import com.ruoyi.system.domain.SysUserOnline;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线用户监控
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/monitor/online")
|
||||||
|
public class SysUserOnlineController extends BaseController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取在线用户监控列表
|
||||||
|
*
|
||||||
|
* @param ipaddr IP地址
|
||||||
|
* @param userName 用户名
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:online:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SysUserOnline> list(String ipaddr, String userName) {
|
||||||
|
// 获取所有未过期的 token
|
||||||
|
List<String> keys = StpUtil.searchTokenValue("", 0, -1, false);
|
||||||
|
List<UserOnlineDTO> userOnlineDTOList = new ArrayList<>();
|
||||||
|
for (String key : keys) {
|
||||||
|
String token = StringUtils.substringAfterLast(key, ":");
|
||||||
|
// 如果已经过期则跳过
|
||||||
|
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
userOnlineDTOList.add(RedisUtils.getCacheObject(CacheConstants.ONLINE_TOKEN_KEY + token));
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) {
|
||||||
|
userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline ->
|
||||||
|
StringUtils.equals(ipaddr, userOnline.getIpaddr()) &&
|
||||||
|
StringUtils.equals(userName, userOnline.getUserName())
|
||||||
|
);
|
||||||
|
} else if (StringUtils.isNotEmpty(ipaddr)) {
|
||||||
|
userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline ->
|
||||||
|
StringUtils.equals(ipaddr, userOnline.getIpaddr())
|
||||||
|
);
|
||||||
|
} else if (StringUtils.isNotEmpty(userName)) {
|
||||||
|
userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline ->
|
||||||
|
StringUtils.equals(userName, userOnline.getUserName())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Collections.reverse(userOnlineDTOList);
|
||||||
|
userOnlineDTOList.removeAll(Collections.singleton(null));
|
||||||
|
List<SysUserOnline> userOnlineList = BeanUtil.copyToList(userOnlineDTOList, SysUserOnline.class);
|
||||||
|
return TableDataInfo.build(userOnlineList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 强退用户
|
||||||
|
*
|
||||||
|
* @param tokenId token值
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("monitor:online:forceLogout")
|
||||||
|
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||||
|
@DeleteMapping("/{tokenId}")
|
||||||
|
public R<Void> forceLogout(@PathVariable String tokenId) {
|
||||||
|
try {
|
||||||
|
StpUtil.kickoutByTokenValue(tokenId);
|
||||||
|
} catch (NotLoginException ignored) {
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
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.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.system.domain.SysConfig;
|
||||||
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数配置 信息操作处理
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/config")
|
||||||
|
public class SysConfigController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysConfigService configService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取参数配置列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:config:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SysConfig> list(SysConfig config, PageQuery pageQuery) {
|
||||||
|
return configService.selectPageConfigList(config, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出参数配置列表
|
||||||
|
*/
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||||
|
@SaCheckPermission("system:config:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(SysConfig config, HttpServletResponse response) {
|
||||||
|
List<SysConfig> list = configService.selectConfigList(config);
|
||||||
|
ExcelUtil.exportExcel(list, "参数数据", SysConfig.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据参数编号获取详细信息
|
||||||
|
*
|
||||||
|
* @param configId 参数ID
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:config:query")
|
||||||
|
@GetMapping(value = "/{configId}")
|
||||||
|
public R<SysConfig> getInfo(@PathVariable Long configId) {
|
||||||
|
return R.ok(configService.selectConfigById(configId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据参数键名查询参数值
|
||||||
|
*
|
||||||
|
* @param configKey 参数Key
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/configKey/{configKey}")
|
||||||
|
public R<Void> getConfigKey(@PathVariable String configKey) {
|
||||||
|
return R.ok(configService.selectConfigByKey(configKey));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增参数配置
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:config:add")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public R<Void> add(@Validated @RequestBody SysConfig config) {
|
||||||
|
if (!configService.checkConfigKeyUnique(config)) {
|
||||||
|
return R.fail("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||||
|
}
|
||||||
|
configService.insertConfig(config);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改参数配置
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:config:edit")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public R<Void> edit(@Validated @RequestBody SysConfig config) {
|
||||||
|
if (!configService.checkConfigKeyUnique(config)) {
|
||||||
|
return R.fail("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||||
|
}
|
||||||
|
configService.updateConfig(config);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据参数键名修改参数配置
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:config:edit")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/updateByKey")
|
||||||
|
public R<Void> updateByKey(@RequestBody SysConfig config) {
|
||||||
|
configService.updateConfig(config);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除参数配置
|
||||||
|
*
|
||||||
|
* @param configIds 参数ID串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:config:remove")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{configIds}")
|
||||||
|
public R<Void> remove(@PathVariable Long[] configIds) {
|
||||||
|
configService.deleteConfigByIds(configIds);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新参数缓存
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:config:remove")
|
||||||
|
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||||
|
@DeleteMapping("/refreshCache")
|
||||||
|
public R<Void> refreshCache() {
|
||||||
|
configService.resetConfigCache();
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
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.R;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.system.service.ISysDeptService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门信息
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/dept")
|
||||||
|
public class SysDeptController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysDeptService deptService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:dept:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public R<List<SysDept>> list(SysDept dept) {
|
||||||
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||||
|
return R.ok(depts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询部门列表(排除节点)
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:dept:list")
|
||||||
|
@GetMapping("/list/exclude/{deptId}")
|
||||||
|
public R<List<SysDept>> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
|
||||||
|
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||||
|
depts.removeIf(d -> d.getDeptId().equals(deptId)
|
||||||
|
|| StringUtils.splitList(d.getAncestors()).contains(Convert.toStr(deptId)));
|
||||||
|
return R.ok(depts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门编号获取详细信息
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:dept:query")
|
||||||
|
@GetMapping(value = "/{deptId}")
|
||||||
|
public R<SysDept> getInfo(@PathVariable Long deptId) {
|
||||||
|
deptService.checkDeptDataScope(deptId);
|
||||||
|
return R.ok(deptService.selectDeptById(deptId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增部门
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:dept:add")
|
||||||
|
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public R<Void> add(@Validated @RequestBody SysDept dept) {
|
||||||
|
if (!deptService.checkDeptNameUnique(dept)) {
|
||||||
|
return R.fail("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
|
}
|
||||||
|
return toAjax(deptService.insertDept(dept));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改部门
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:dept:edit")
|
||||||
|
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public R<Void> edit(@Validated @RequestBody SysDept dept) {
|
||||||
|
Long deptId = dept.getDeptId();
|
||||||
|
deptService.checkDeptDataScope(deptId);
|
||||||
|
if (!deptService.checkDeptNameUnique(dept)) {
|
||||||
|
return R.fail("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
|
} else if (dept.getParentId().equals(deptId)) {
|
||||||
|
return R.fail("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||||
|
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())) {
|
||||||
|
if (deptService.selectNormalChildrenDeptById(deptId) > 0) {
|
||||||
|
return R.fail("该部门包含未停用的子部门!");
|
||||||
|
} else if (deptService.checkDeptExistUser(deptId)) {
|
||||||
|
return R.fail("该部门下存在已分配用户,不能禁用!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return toAjax(deptService.updateDept(dept));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除部门
|
||||||
|
*
|
||||||
|
* @param deptId 部门ID
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:dept:remove")
|
||||||
|
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{deptId}")
|
||||||
|
public R<Void> remove(@PathVariable Long deptId) {
|
||||||
|
if (deptService.hasChildByDeptId(deptId)) {
|
||||||
|
return R.warn("存在下级部门,不允许删除");
|
||||||
|
}
|
||||||
|
if (deptService.checkDeptExistUser(deptId)) {
|
||||||
|
return R.warn("部门存在用户,不允许删除");
|
||||||
|
}
|
||||||
|
deptService.checkDeptDataScope(deptId);
|
||||||
|
return toAjax(deptService.deleteDeptById(deptId));
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user