mirror of
https://gitee.com/mmsAdmin/mms
synced 2025-12-06 17:08:54 +08:00
Compare commits
11 Commits
94f19d5e9c
...
d183cbf39a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d183cbf39a | ||
|
|
21109d4a8b | ||
|
|
3305f2b479 | ||
|
|
d638c21791 | ||
|
|
0e91023fcb | ||
|
|
a7a4863db5 | ||
|
|
c8de1a0826 | ||
|
|
1a9f233704 | ||
|
|
53d0780fcf | ||
|
|
9bd352e335 | ||
|
|
04ba8d1539 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -103,4 +103,3 @@ pnpm-debug.log*
|
||||
*.sw?
|
||||
# 忽略mall模块
|
||||
|
||||
mms-docs
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "mms-docs"]
|
||||
path = mms-docs
|
||||
url = https://gitee.com/mmsAdmin/mms-docs.git
|
||||
@ -67,11 +67,11 @@
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
<!-- 文档Admin管理模块-->
|
||||
|
||||
<!--admin-doc模块-->
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-doc-admin</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ public class SysUserBo extends BaseEntity {
|
||||
* 用户账号
|
||||
*/
|
||||
@NotBlank(message = "账号不能为空", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
@Size(min = 3, max = 20, message = "账号长度在3到20之间", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
@Size(min = 4, max = 20, message = "账号长度在5到20之间", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
|
||||
@ -99,20 +99,20 @@ public class SysLoginServiceImpl implements SysLoginService {
|
||||
|
||||
if(sysConfigService.getIsOpenCaptcha()){
|
||||
if(StringUtil.isEmpty(code)){
|
||||
throw new MmsException("验证码不能为空");
|
||||
throw new MmsException("The verification code cannot be empty");
|
||||
}
|
||||
Map<String, Object> data = RedisUtil.getCacheObject(uuid);
|
||||
if (ObjectUtils.isEmpty(data)) {
|
||||
log.info("登录:验证码失效!");
|
||||
throw new LoginException("验证码失效");
|
||||
throw new LoginException("Verification code failure");
|
||||
}
|
||||
if (!codeKey.equals(data.get(CaptchaEntity.CODE.CAPTCHA_KEY.getValue()))) {
|
||||
log.info("登录:验证码与验证对象不匹配!");
|
||||
throw new LoginException("验证码与验证对象不匹配");
|
||||
throw new LoginException("Verification code does not match the verification object");
|
||||
}
|
||||
if (!code.equalsIgnoreCase((String) data.get(CaptchaEntity.CODE.CAPTCHA_VALUE.getValue()))) {
|
||||
log.info("登录:验证码不匹配!");
|
||||
throw new LoginException("验证码不匹配");
|
||||
throw new LoginException("Verification code does not match");
|
||||
}
|
||||
}
|
||||
return;
|
||||
@ -130,11 +130,11 @@ public class SysLoginServiceImpl implements SysLoginService {
|
||||
SysTenant sysTenant = sysTenantService.selectById(sysUser.getTenantId());
|
||||
if (ObjectUtils.isEmpty(sysTenant)) {
|
||||
log.info("登录用户ID:{} 租户不存在.", sysUser.getUserId());
|
||||
throw new TenantException("租户不存在");
|
||||
throw new TenantException("tenant.not.exists");
|
||||
}
|
||||
if (!sysTenant.getStatus().equals(SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue())) {
|
||||
log.info("登录用户ID:{} 租户状态为禁用.", sysUser.getUserId());
|
||||
throw new TenantException("租户状态为禁用");
|
||||
throw new TenantException("tenant off state");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.sxpcwlkj.system.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.common.enums.SystemCommonEnum;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
@ -98,6 +99,6 @@ public class SysNoticeServiceImpl extends BaseServiceImpl<SysNotice, SysNoticeVo
|
||||
|
||||
@Override
|
||||
public Long selectTool() {
|
||||
return baseMapper.selectCount(new LambdaQueryWrapper<SysNotice>().eq(SysNotice::getStatus,0));
|
||||
return baseMapper.selectCount(new LambdaQueryWrapper<SysNotice>().eq(SysNotice::getStatus, SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,6 +123,7 @@ public class SysOssConfigServiceImpl extends BaseServiceImpl<SysOssConfig, SysOs
|
||||
baseMapper.update(null, new LambdaUpdateWrapper<SysOssConfig>().set(SysOssConfig::getStatus, SystemCommonEnum.SYS_COMMON_STATE_CLOSE.getValue()).eq(SysOssConfig::getStatus, SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue()));
|
||||
}
|
||||
bo.setId(configVo.getId());
|
||||
bo.setRevision(configVo.getRevision());
|
||||
row = baseMapper.updateById(MapstructUtil.convert(bo, SysOssConfig.class));
|
||||
} else {
|
||||
if (bo.getStatus().toString().equals(SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue().toString()) ) {
|
||||
@ -141,7 +142,7 @@ public class SysOssConfigServiceImpl extends BaseServiceImpl<SysOssConfig, SysOs
|
||||
@Override
|
||||
public List<FileStorageConfig> getOss() {
|
||||
//
|
||||
List<SysOssConfigVo> vos = baseMapper.selectVoList(new LambdaQueryWrapper<SysOssConfig>().orderByAsc(SysOssConfig::getStatus));
|
||||
List<SysOssConfigVo> vos = baseMapper.selectVoList(new LambdaQueryWrapper<SysOssConfig>().orderByDesc(SysOssConfig::getStatus));
|
||||
List<FileStorageConfig> list = new ArrayList<>();
|
||||
for (SysOssConfigVo configVo : vos) {
|
||||
if (configVo != null) {
|
||||
|
||||
@ -450,7 +450,7 @@ public class SysUserServiceImpl implements SysUserService {
|
||||
|
||||
@Override
|
||||
public Long selectTool() {
|
||||
return baseMapper.selectCount(new LambdaQueryWrapper<SysUser>().eq(SysUser::getStatus, 0));
|
||||
return baseMapper.selectCount(new LambdaQueryWrapper<SysUser>().eq(SysUser::getStatus, SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -5,36 +5,36 @@
|
||||
|
||||
#菜单
|
||||
INSERT INTO `sys_function`(`parent_id`,`path`,`name`,`component`,`language_code`,`type`,`sort`,`icon`,`status`,`visible`,`is_iframe`,`is_open_link`,`is_link`,`keep_alive`,`always_show`,`tenant_id`,`created_time`,`updated_time`,`revision`)
|
||||
values (${menuId},'/${moduleName}/${functionName}','${tableComment}','${moduleName}/${functionName}/index','${tableComment}',1,1,'',0,-1,-1,-1,'',1,-1,'000000',${dbTime},${dbTime},1);
|
||||
values (${menuId},'/${moduleName}/${functionName}','${tableComment}','${moduleName}/${functionName}/index','${tableComment}',1,1,'',1,-1,-1,-1,'',1,-1,'000000',${dbTime},${dbTime},1);
|
||||
|
||||
#列表
|
||||
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-列表','${moduleName}:${functionName}:list',2,2,0,'000000',${dbTime},${dbTime},1);
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-列表','${moduleName}:${functionName}:list',2,2,1,'000000',${dbTime},${dbTime},1);
|
||||
|
||||
#新增
|
||||
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-新增','${moduleName}:${functionName}:insert',2,3,0,'000000',${dbTime},${dbTime},1);
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-新增','${moduleName}:${functionName}:insert',2,3,1,'000000',${dbTime},${dbTime},1);
|
||||
|
||||
#删除
|
||||
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-删除','${moduleName}:${functionName}:delete',2,4,0,'000000',${dbTime},${dbTime},1);
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-删除','${moduleName}:${functionName}:delete',2,4,1,'000000',${dbTime},${dbTime},1);
|
||||
|
||||
#编辑
|
||||
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-编辑','${moduleName}:${functionName}:edit',2,5,0,'000000',${dbTime},${dbTime},1);
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-编辑','${moduleName}:${functionName}:edit',2,5,1,'000000',${dbTime},${dbTime},1);
|
||||
|
||||
#查询
|
||||
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-查询','${moduleName}:${functionName}:query',2,6,0,'000000',${dbTime},${dbTime},1);
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-查询','${moduleName}:${functionName}:query',2,6,1,'000000',${dbTime},${dbTime},1);
|
||||
|
||||
#导入
|
||||
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-导入','${moduleName}:${functionName}:import',2,6,0,'000000',${dbTime},${dbTime},1);
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-导入','${moduleName}:${functionName}:import',2,7,1,'000000',${dbTime},${dbTime},1);
|
||||
|
||||
#导出
|
||||
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-导出','${moduleName}:${functionName}:export',2,6,0,'000000',${dbTime},${dbTime},1);
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-导出','${moduleName}:${functionName}:export',2,8,1,'000000',${dbTime},${dbTime},1);
|
||||
|
||||
#打印
|
||||
INSERT INTO `sys_function`(`parent_id`,`name`,`permission`,`type`,`sort`,`status`,`tenant_id`,`created_time`,`updated_time`,`revision`)
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-打印','${moduleName}:${functionName}:print',2,6,0,'000000',${dbTime},${dbTime},1);
|
||||
values ((SELECT `min_id` FROM (SELECT MAX(id) AS min_id FROM `sys_function` WHERE `name` = '${tableComment}') AS a),'${tableComment}-打印','${moduleName}:${functionName}:print',2,9,1,'000000',${dbTime},${dbTime},1);
|
||||
|
||||
@ -135,7 +135,12 @@
|
||||
<script setup lang="ts" name="${moduleName}${FunctionName}Dialog">
|
||||
import {nextTick, reactive, ref} from "vue";
|
||||
import {CURDEnum} from '/@/enums/CURDEnum';
|
||||
import {ElMessage} from "element-plus";
|
||||
import {${FunctionName}Bo, ${FunctionName}Vo} from '/@/views/${moduleName}/${functionName}/type';
|
||||
<#if formLayout==2 >
|
||||
import {${functionName}Api} from '/@/views/${moduleName}/${functionName}';
|
||||
const baseApi = ${functionName}Api();
|
||||
</#if>
|
||||
|
||||
const dialogWidth = ref('50vw');
|
||||
<#list fastList as field>
|
||||
@ -154,6 +159,9 @@
|
||||
import FastSwitch from "/@/components/fast-switch/src/fast-switch.vue";
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
|
||||
|
||||
// 定义子组件向父组件传值/事件
|
||||
const emit = defineEmits(['refresh']);
|
||||
const dialogFormRef = ref();
|
||||
@ -176,7 +184,9 @@
|
||||
<#list fieldList as field>
|
||||
<#if !field.baseField||field.attrName =='status'||field.attrName =='sort'||field.attrName =='remark'>
|
||||
<#if field.fieldType == 'int'>
|
||||
<#if field.attrName =='sort'>
|
||||
<#if field.attrName =='status'>
|
||||
${field.attrName}: 1<#sep>,
|
||||
<#elseif field.attrName =='sort'>
|
||||
${field.attrName}: 1<#sep>,
|
||||
<#else>
|
||||
${field.attrName}: 0<#sep>,
|
||||
@ -237,7 +247,7 @@
|
||||
}
|
||||
<#if formLayout==2 >
|
||||
// 选择监听
|
||||
const change = (arr: number[]) => {
|
||||
const change = (arr: string[]) => {
|
||||
state.ruleForm.${tableParentId} = arr[arr.length - 1];
|
||||
};
|
||||
</#if>
|
||||
|
||||
@ -227,7 +227,7 @@
|
||||
</#if>
|
||||
</#list>
|
||||
<#if formLayout==2 >
|
||||
,isAll:true,
|
||||
isAll:true,
|
||||
</#if>
|
||||
}
|
||||
}
|
||||
|
||||
1
mms-docs
1
mms-docs
@ -1 +0,0 @@
|
||||
Subproject commit 22d4b9294c29f5f4619989ce4d1b892a21c61bab
|
||||
105
mms-docs/.gitignore
vendored
Normal file
105
mms-docs/.gitignore
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# Eclipse & IntelliJ IDEA
|
||||
.classpath
|
||||
.settings/
|
||||
.idea
|
||||
.idea/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
.settings
|
||||
.project
|
||||
.flattened-pom.xml
|
||||
|
||||
# Maven
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
# Gradle
|
||||
.gradle
|
||||
.gradle/
|
||||
build/
|
||||
**/build/
|
||||
bin/
|
||||
!src/**/build/
|
||||
gradle-app.setting
|
||||
!gradle-wrapper.jar
|
||||
.gradletasknamecache
|
||||
gradle/wrapper/gradle-wrapper.properties
|
||||
|
||||
# VS Code
|
||||
.vscode/
|
||||
|
||||
# STS
|
||||
.apt_generated
|
||||
.factorypath
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
# NetBeans
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
# DB
|
||||
/script/db/.back_sxpcwlkj/
|
||||
/script/db/.version_sxpcwlkj/
|
||||
!/script/db/.back_sxpcwlkj/
|
||||
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
# 忽略mall模块
|
||||
|
||||
21
mms-docs/LICENSE
Normal file
21
mms-docs/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 mmsAdmin
|
||||
|
||||
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.
|
||||
184
mms-docs/db/mms-doc.sql
Normal file
184
mms-docs/db/mms-doc.sql
Normal file
@ -0,0 +1,184 @@
|
||||
-- MySQL dump 10.13 Distrib 8.0.41, for macos15.2 (arm64)
|
||||
--
|
||||
-- Host: 119.28.10.247 Database: mms
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 8.0.24
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `doc_config`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `doc_config`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `doc_config` (
|
||||
`id` varchar(255) NOT NULL COMMENT 'ID',
|
||||
`key` varchar(255) DEFAULT NULL COMMENT 'KEY',
|
||||
`value` varchar(255) DEFAULT NULL COMMENT '值',
|
||||
`ctime` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`mtime` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`status` int DEFAULT '0' COMMENT '状态',
|
||||
`sort` int DEFAULT '0' COMMENT '排序',
|
||||
`revision` varchar(32) DEFAULT '1' COMMENT '乐观锁',
|
||||
`tenant_id` varchar(32) DEFAULT '0' COMMENT '租户号',
|
||||
`created_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`created_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`updated_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`updated_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文档配置;';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `doc_config`
|
||||
--
|
||||
|
||||
LOCK TABLES `doc_config` WRITE;
|
||||
/*!40000 ALTER TABLE `doc_config` DISABLE KEYS */;
|
||||
INSERT INTO `doc_config` VALUES ('1','WEEK','7','2025-05-28 16:29:54','2025-05-28 16:30:03',1,1,'1','0',NULL,NULL,NULL,NULL,NULL),('2','MONTH','30','2025-05-28 16:29:59','2025-05-28 16:30:03',1,2,'1','0',NULL,NULL,NULL,NULL,NULL),('3','PERPETUAL','999999999','2025-05-28 16:30:03','2025-05-28 16:30:03',1,3,'1','0',NULL,NULL,NULL,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `doc_config` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `doc_order`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `doc_order`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `doc_order` (
|
||||
`order_id` varchar(32) NOT NULL COMMENT '订单编号',
|
||||
`uid` varchar(32) DEFAULT NULL COMMENT '用户编号',
|
||||
`txn_amt` decimal(24,2) DEFAULT NULL COMMENT '订单金额',
|
||||
`pay_mchid` varchar(255) DEFAULT NULL COMMENT '支付商户号',
|
||||
`pay_no` varchar(255) DEFAULT NULL COMMENT '支付平台流水号',
|
||||
`pay_timeout` varchar(255) DEFAULT NULL COMMENT '支付超时时间',
|
||||
`prod_id` varchar(255) DEFAULT NULL COMMENT '产品编号',
|
||||
`prod_name` varchar(255) DEFAULT NULL COMMENT '产品名称',
|
||||
`prod_price` decimal(24,2) DEFAULT NULL COMMENT '产品价格',
|
||||
`prod_type` varchar(255) DEFAULT NULL COMMENT '产品类型',
|
||||
`ctime` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`mtime` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`status` int DEFAULT '0' COMMENT '订单状态;unpaid:待支付 paysuc:已支付 refund:已退款 cancel:已取消 finish:已完成',
|
||||
`sort` int DEFAULT '0' COMMENT '排序',
|
||||
`revision` varchar(32) DEFAULT '1' COMMENT '乐观锁',
|
||||
`tenant_id` varchar(32) DEFAULT '0' COMMENT '租户号',
|
||||
`created_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`created_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`updated_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`updated_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`order_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文档订单;';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `doc_order`
|
||||
--
|
||||
|
||||
LOCK TABLES `doc_order` WRITE;
|
||||
/*!40000 ALTER TABLE `doc_order` DISABLE KEYS */;
|
||||
INSERT INTO `doc_order` VALUES ('1927764361010667522','1927763462003548162',990.00,NULL,'1748449813818','1748449993821','1','周卡',990.00,'新手体验者','2025-05-29 00:30:14','2025-05-29 00:30:28',1,0,'2',NULL,NULL,'2025-05-29 00:30:14',NULL,'2025-05-29 00:30:28',NULL),('1930657734985965569','1927763462003548162',2990.00,NULL,'1749139648123','1749139828123','2','月卡',2990.00,'使用MMS项目者','2025-06-06 00:07:29','2025-06-06 00:07:54',1,0,'2','default_tenant','1927763462003548162','2025-06-06 00:07:29','1927763462003548162','2025-06-06 00:07:54',NULL),('1930666662113239042','1927763462003548162',990.00,NULL,'1749141776504','1749141956504','1','周卡',990.00,'新手体验者','2025-06-06 00:42:57','2025-06-06 00:43:15',1,0,'2','default_tenant','1927763462003548162','2025-06-06 00:42:57','1927763462003548162','2025-06-06 00:43:15',NULL);
|
||||
/*!40000 ALTER TABLE `doc_order` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `doc_product`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `doc_product`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `doc_product` (
|
||||
`prod_id` varchar(255) NOT NULL COMMENT '产品编号',
|
||||
`prod_name` varchar(255) DEFAULT NULL COMMENT '产品名称',
|
||||
`unit_price` varchar(255) DEFAULT NULL COMMENT '销售单价',
|
||||
`mark_price` varchar(255) DEFAULT NULL COMMENT '市场价格',
|
||||
`type` varchar(255) DEFAULT NULL COMMENT '产品类型',
|
||||
`code` varchar(100) DEFAULT NULL COMMENT '商品编码',
|
||||
`ctime` varchar(255) DEFAULT NULL COMMENT '创建时间',
|
||||
`mtime` varchar(255) DEFAULT NULL COMMENT '更新时间',
|
||||
`status` int DEFAULT '0' COMMENT '商品状态;up:上架 un:下降 rm:删除',
|
||||
`sort` int DEFAULT '0' COMMENT '排序',
|
||||
`revision` varchar(32) DEFAULT '1' COMMENT '乐观锁',
|
||||
`tenant_id` varchar(32) DEFAULT '0' COMMENT '租户号',
|
||||
`created_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`created_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`updated_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`updated_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`prod_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文档商品;';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `doc_product`
|
||||
--
|
||||
|
||||
LOCK TABLES `doc_product` WRITE;
|
||||
/*!40000 ALTER TABLE `doc_product` DISABLE KEYS */;
|
||||
INSERT INTO `doc_product` VALUES ('1','周卡','990','1900','新手体验者','WEEK',NULL,NULL,1,0,'1','0',NULL,NULL,NULL,NULL,NULL),('2','月卡','2990','9900','使用MMS项目者','MONTH',NULL,NULL,1,0,'1','0',NULL,NULL,NULL,NULL,NULL),('3','终身卡','9900','19900','忠实的MMS粉丝','PERPETUAL',NULL,NULL,1,0,'1','0',NULL,NULL,NULL,NULL,NULL);
|
||||
/*!40000 ALTER TABLE `doc_product` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `doc_user`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `doc_user`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `doc_user` (
|
||||
`uid` varchar(32) NOT NULL COMMENT '用户编号',
|
||||
`nickname` varchar(255) DEFAULT NULL COMMENT '昵称',
|
||||
`avatar` varchar(255) DEFAULT NULL COMMENT '头像',
|
||||
`type` varchar(255) DEFAULT NULL COMMENT '用户类型;usr=普通用户 vip=会员用户',
|
||||
`open_id` varchar(100) DEFAULT NULL COMMENT '微信ID',
|
||||
`vip_date` datetime DEFAULT NULL COMMENT 'VIP到期时间',
|
||||
`ctime` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`mtime` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`status` int DEFAULT '0' COMMENT '状态',
|
||||
`sort` int DEFAULT '0' COMMENT '排序',
|
||||
`revision` varchar(32) DEFAULT '1' COMMENT '乐观锁',
|
||||
`tenant_id` varchar(32) DEFAULT '0' COMMENT '租户号',
|
||||
`created_by` varchar(32) DEFAULT NULL COMMENT '创建人',
|
||||
`created_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`updated_by` varchar(32) DEFAULT NULL COMMENT '更新人',
|
||||
`updated_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`uid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文档用户;';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `doc_user`
|
||||
--
|
||||
|
||||
LOCK TABLES `doc_user` WRITE;
|
||||
/*!40000 ALTER TABLE `doc_user` DISABLE KEYS */;
|
||||
INSERT INTO `doc_user` VALUES ('1927763462003548162','浪漫的狼86','https://picsum.photos/30/30','usr','oW-WO0Ve8-hrIY42Y8cywfDbD-nk',NULL,'2025-05-29 00:26:40','2025-05-29 00:26:40',0,0,'1',NULL,NULL,'2025-05-29 00:26:40',NULL,'2025-05-29 00:26:40',NULL),('1929438111712075777','冷静的狼36','https://picsum.photos/30/30','usr','oW-WO0Tt3NOzBm5JOyaU-e8Cu_ks',NULL,'2025-06-02 15:21:08','2025-06-02 15:21:08',0,0,'1',NULL,NULL,'2025-06-02 15:21:08',NULL,'2025-06-02 15:21:08',NULL),('1929719140427423745','冷静的狼','https://picsum.photos/30/30','usr','oW-WO0dTlbRAnPxUzYUlgokbsXK0',NULL,'2025-06-03 09:57:50','2025-06-03 09:57:50',0,0,'1',NULL,NULL,'2025-06-03 09:57:50',NULL,'2025-06-03 09:57:50',NULL),('1930451907675086849','神秘的飞鸟','https://picsum.photos/30/30','usr','oW-WO0cfKTtqm9AemJRRXJgS7nQc',NULL,'2025-06-05 10:29:36','2025-06-05 10:29:36',0,0,'1',NULL,NULL,'2025-06-05 10:29:36',NULL,'2025-06-05 10:29:36',NULL),('1930754299545182210','幽默的猎豹582','https://picsum.photos/30/30','usr','oW-WO0d0gtSZOR3U71eGsHq0xNaU',NULL,'2025-06-06 06:31:11','2025-06-06 06:31:11',0,0,'1',NULL,NULL,'2025-06-06 06:31:11',NULL,'2025-06-06 06:31:11',NULL),('1930806934159679489','威武的雄鹰32','https://picsum.photos/30/30','usr','oW-WO0XGxmGIjc8Mo_hpulOT618U',NULL,'2025-06-06 10:00:20','2025-06-06 10:00:20',0,0,'1',NULL,NULL,'2025-06-06 10:00:20',NULL,'2025-06-06 10:00:20',NULL);
|
||||
/*!40000 ALTER TABLE `doc_user` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-06-06 16:21:29
|
||||
103
mms-docs/mms-doc-admin/.gitignore
vendored
Normal file
103
mms-docs/mms-doc-admin/.gitignore
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# Eclipse & IntelliJ IDEA
|
||||
.classpath
|
||||
.settings/
|
||||
.idea
|
||||
.idea/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
.settings
|
||||
.project
|
||||
.flattened-pom.xml
|
||||
|
||||
# Maven
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
# Gradle
|
||||
.gradle
|
||||
.gradle/
|
||||
build/
|
||||
**/build/
|
||||
bin/
|
||||
!src/**/build/
|
||||
gradle-app.setting
|
||||
!gradle-wrapper.jar
|
||||
.gradletasknamecache
|
||||
gradle/wrapper/gradle-wrapper.properties
|
||||
|
||||
# VS Code
|
||||
.vscode/
|
||||
|
||||
# STS
|
||||
.apt_generated
|
||||
.factorypath
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
# NetBeans
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
# DB
|
||||
/script/db/.back_sxpcwlkj/
|
||||
/script/db/.version_sxpcwlkj/
|
||||
!/script/db/.back_sxpcwlkj/
|
||||
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
27
mms-docs/mms-doc-admin/pom.xml
Normal file
27
mms-docs/mms-doc-admin/pom.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?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>
|
||||
<parent>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-docs</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mms-doc-admin</artifactId>
|
||||
<description>文档Admin系统模块</description>
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-framework</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,145 @@
|
||||
package com.sxpcwlkj.docAdmin.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.sxpcwlkj.common.annotation.MssSafety;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.common.code.entity.PrintObject;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.framework.utils.ExcelUtil;
|
||||
import com.sxpcwlkj.common.code.entity.ThreeQueryBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocAuthorizeUserBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocAuthorizeUserVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocAuthorizeUserExport;
|
||||
import com.sxpcwlkj.docAdmin.service.DocAuthorizeUserService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档授权用户
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("docAdmin/docAuthorizeUser")
|
||||
public class DocAuthorizeUserController extends BaseController{
|
||||
private final DocAuthorizeUserService baseService;
|
||||
|
||||
/**
|
||||
* 分页列表-文档授权用户
|
||||
* @param bo 查询条件
|
||||
* @return 分页对象
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docAuthorizeUser:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<DocAuthorizeUserVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) DocAuthorizeUserBo bo){
|
||||
return baseService.selectListVoPage(bo, bo.getPageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询-文档授权用户
|
||||
* @param id ID
|
||||
* @return 对象
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docAuthorizeUser:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DocAuthorizeUserVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改-文档授权用户
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docAuthorizeUser:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@RequestBody @Validated(ValidatedGroupConfig.update.class) DocAuthorizeUserBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增-文档授权用户
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docAuthorizeUser:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@RequestBody @Validated(ValidatedGroupConfig.insert.class) DocAuthorizeUserBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除-文档授权用户
|
||||
* @param ids ID
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docAuthorizeUser:delete")
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Boolean> delete(@PathVariable String ids) {
|
||||
return success(baseService.deleteById(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 模版下载-文档授权用户
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docAuthorizeUser:import")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil.download(response, DocAuthorizeUserExport.class, "文档授权用户");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入-文档授权用户
|
||||
* @param file 模版文件
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docAuthorizeUser:import")
|
||||
@PostMapping("/import")
|
||||
public R<Boolean> imports(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
Set<DocAuthorizeUserExport> list= ExcelUtil.imports(file, DocAuthorizeUserExport.class);
|
||||
Boolean state= baseService.imports(list);
|
||||
return R.ok(state,state?"数据导入成功!":"数据导入失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出-文档授权用户
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docAuthorizeUser:export")
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated(ValidatedGroupConfig.query.class) DocAuthorizeUserBo bo,HttpServletResponse response) throws IOException {
|
||||
List<DocAuthorizeUserVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<DocAuthorizeUserExport> data= MapstructUtil.convert(list,DocAuthorizeUserExport.class);
|
||||
ExcelUtil.export(response, DocAuthorizeUserExport.class, "文档授权用户",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印-文档授权用户
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docAuthorizeUser:print")
|
||||
@PostMapping("/print")
|
||||
public R<PrintObject<DocAuthorizeUserExport>> print(@RequestBody @Validated(ValidatedGroupConfig.query.class) DocAuthorizeUserBo bo) throws Exception {
|
||||
List<DocAuthorizeUserVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<DocAuthorizeUserExport> data= MapstructUtil.convert(list,DocAuthorizeUserExport.class);
|
||||
PrintObject<DocAuthorizeUserExport> printObject= new PrintObject<DocAuthorizeUserExport>()
|
||||
.setTitle("文档授权用户")
|
||||
.setData(data);
|
||||
return R.response(Boolean.TRUE,printObject);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package com.sxpcwlkj.docAdmin.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.sxpcwlkj.common.annotation.MssSafety;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.common.code.entity.PrintObject;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.framework.utils.ExcelUtil;
|
||||
import com.sxpcwlkj.common.code.entity.ThreeQueryBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocConfigBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocConfigVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocConfigExport;
|
||||
import com.sxpcwlkj.docAdmin.service.DocConfigService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档配置
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("docAdmin/docConfig")
|
||||
public class DocConfigController extends BaseController{
|
||||
private final DocConfigService baseService;
|
||||
|
||||
/**
|
||||
* 分页列表-文档配置
|
||||
* @param bo 查询条件
|
||||
* @return 分页对象
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docConfig:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<DocConfigVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) DocConfigBo bo){
|
||||
return baseService.selectListVoPage(bo, bo.getPageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询-文档配置
|
||||
* @param id ID
|
||||
* @return 对象
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docConfig:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DocConfigVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改-文档配置
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docConfig:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@RequestBody @Validated(ValidatedGroupConfig.update.class) DocConfigBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增-文档配置
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docConfig:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@RequestBody @Validated(ValidatedGroupConfig.insert.class) DocConfigBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除-文档配置
|
||||
* @param ids ID
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docConfig:delete")
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Boolean> delete(@PathVariable String ids) {
|
||||
return success(baseService.deleteById(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 模版下载-文档配置
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docConfig:import")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil.download(response, DocConfigExport.class, "文档配置");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入-文档配置
|
||||
* @param file 模版文件
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docConfig:import")
|
||||
@PostMapping("/import")
|
||||
public R<Boolean> imports(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
Set<DocConfigExport> list= ExcelUtil.imports(file, DocConfigExport.class);
|
||||
Boolean state= baseService.imports(list);
|
||||
return R.ok(state,state?"数据导入成功!":"数据导入失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出-文档配置
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docConfig:export")
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated(ValidatedGroupConfig.query.class) DocConfigBo bo,HttpServletResponse response) throws IOException {
|
||||
List<DocConfigVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<DocConfigExport> data= MapstructUtil.convert(list,DocConfigExport.class);
|
||||
ExcelUtil.export(response, DocConfigExport.class, "文档配置",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印-文档配置
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docConfig:print")
|
||||
@PostMapping("/print")
|
||||
public R<PrintObject<DocConfigExport>> print(@RequestBody @Validated(ValidatedGroupConfig.query.class) DocConfigBo bo) throws Exception {
|
||||
List<DocConfigVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<DocConfigExport> data= MapstructUtil.convert(list,DocConfigExport.class);
|
||||
PrintObject<DocConfigExport> printObject= new PrintObject<DocConfigExport>()
|
||||
.setTitle("文档配置")
|
||||
.setData(data);
|
||||
return R.response(Boolean.TRUE,printObject);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package com.sxpcwlkj.docAdmin.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.sxpcwlkj.common.annotation.MssSafety;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.common.code.entity.PrintObject;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.framework.utils.ExcelUtil;
|
||||
import com.sxpcwlkj.common.code.entity.ThreeQueryBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocOrderBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocOrderVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocOrderExport;
|
||||
import com.sxpcwlkj.docAdmin.service.DocOrderService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档订单
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("docAdmin/docOrder")
|
||||
public class DocOrderController extends BaseController{
|
||||
private final DocOrderService baseService;
|
||||
|
||||
/**
|
||||
* 分页列表-文档订单
|
||||
* @param bo 查询条件
|
||||
* @return 分页对象
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docOrder:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<DocOrderVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) DocOrderBo bo){
|
||||
return baseService.selectListVoPage(bo, bo.getPageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询-文档订单
|
||||
* @param id ID
|
||||
* @return 对象
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docOrder:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DocOrderVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改-文档订单
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docOrder:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@RequestBody @Validated(ValidatedGroupConfig.update.class) DocOrderBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增-文档订单
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docOrder:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@RequestBody @Validated(ValidatedGroupConfig.insert.class) DocOrderBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除-文档订单
|
||||
* @param ids ID
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docOrder:delete")
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Boolean> delete(@PathVariable String ids) {
|
||||
return success(baseService.deleteById(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 模版下载-文档订单
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docOrder:import")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil.download(response, DocOrderExport.class, "文档订单");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入-文档订单
|
||||
* @param file 模版文件
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docOrder:import")
|
||||
@PostMapping("/import")
|
||||
public R<Boolean> imports(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
Set<DocOrderExport> list= ExcelUtil.imports(file, DocOrderExport.class);
|
||||
Boolean state= baseService.imports(list);
|
||||
return R.ok(state,state?"数据导入成功!":"数据导入失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出-文档订单
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docOrder:export")
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated(ValidatedGroupConfig.query.class) DocOrderBo bo,HttpServletResponse response) throws IOException {
|
||||
List<DocOrderVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<DocOrderExport> data= MapstructUtil.convert(list,DocOrderExport.class);
|
||||
ExcelUtil.export(response, DocOrderExport.class, "文档订单",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印-文档订单
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docOrder:print")
|
||||
@PostMapping("/print")
|
||||
public R<PrintObject<DocOrderExport>> print(@RequestBody @Validated(ValidatedGroupConfig.query.class) DocOrderBo bo) throws Exception {
|
||||
List<DocOrderVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<DocOrderExport> data= MapstructUtil.convert(list,DocOrderExport.class);
|
||||
PrintObject<DocOrderExport> printObject= new PrintObject<DocOrderExport>()
|
||||
.setTitle("文档订单")
|
||||
.setData(data);
|
||||
return R.response(Boolean.TRUE,printObject);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package com.sxpcwlkj.docAdmin.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.sxpcwlkj.common.annotation.MssSafety;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.common.code.entity.PrintObject;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.framework.utils.ExcelUtil;
|
||||
import com.sxpcwlkj.common.code.entity.ThreeQueryBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocProductBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocProductVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocProductExport;
|
||||
import com.sxpcwlkj.docAdmin.service.DocProductService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档商品
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("docAdmin/docProduct")
|
||||
public class DocProductController extends BaseController{
|
||||
private final DocProductService baseService;
|
||||
|
||||
/**
|
||||
* 分页列表-文档商品
|
||||
* @param bo 查询条件
|
||||
* @return 分页对象
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docProduct:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<DocProductVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) DocProductBo bo){
|
||||
return baseService.selectListVoPage(bo, bo.getPageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询-文档商品
|
||||
* @param id ID
|
||||
* @return 对象
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docProduct:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DocProductVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改-文档商品
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docProduct:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@RequestBody @Validated(ValidatedGroupConfig.update.class) DocProductBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增-文档商品
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docProduct:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@RequestBody @Validated(ValidatedGroupConfig.insert.class) DocProductBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除-文档商品
|
||||
* @param ids ID
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docProduct:delete")
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Boolean> delete(@PathVariable String ids) {
|
||||
return success(baseService.deleteById(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 模版下载-文档商品
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docProduct:import")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil.download(response, DocProductExport.class, "文档商品");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入-文档商品
|
||||
* @param file 模版文件
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docProduct:import")
|
||||
@PostMapping("/import")
|
||||
public R<Boolean> imports(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
Set<DocProductExport> list= ExcelUtil.imports(file, DocProductExport.class);
|
||||
Boolean state= baseService.imports(list);
|
||||
return R.ok(state,state?"数据导入成功!":"数据导入失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出-文档商品
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docProduct:export")
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated(ValidatedGroupConfig.query.class) DocProductBo bo,HttpServletResponse response) throws IOException {
|
||||
List<DocProductVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<DocProductExport> data= MapstructUtil.convert(list,DocProductExport.class);
|
||||
ExcelUtil.export(response, DocProductExport.class, "文档商品",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印-文档商品
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docProduct:print")
|
||||
@PostMapping("/print")
|
||||
public R<PrintObject<DocProductExport>> print(@RequestBody @Validated(ValidatedGroupConfig.query.class) DocProductBo bo) throws Exception {
|
||||
List<DocProductVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<DocProductExport> data= MapstructUtil.convert(list,DocProductExport.class);
|
||||
PrintObject<DocProductExport> printObject= new PrintObject<DocProductExport>()
|
||||
.setTitle("文档商品")
|
||||
.setData(data);
|
||||
return R.response(Boolean.TRUE,printObject);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package com.sxpcwlkj.docAdmin.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.sxpcwlkj.common.annotation.MssSafety;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.common.code.entity.PrintObject;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.framework.utils.ExcelUtil;
|
||||
import com.sxpcwlkj.common.code.entity.ThreeQueryBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocUserBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocUserVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocUserExport;
|
||||
import com.sxpcwlkj.docAdmin.service.DocUserService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档用户
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("docAdmin/docUser")
|
||||
public class DocUserController extends BaseController{
|
||||
private final DocUserService baseService;
|
||||
|
||||
/**
|
||||
* 分页列表-文档用户
|
||||
* @param bo 查询条件
|
||||
* @return 分页对象
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docUser:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<DocUserVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) DocUserBo bo){
|
||||
return baseService.selectListVoPage(bo, bo.getPageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询-文档用户
|
||||
* @param id ID
|
||||
* @return 对象
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docUser:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DocUserVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改-文档用户
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docUser:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@RequestBody @Validated(ValidatedGroupConfig.update.class) DocUserBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增-文档用户
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docUser:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@RequestBody @Validated(ValidatedGroupConfig.insert.class) DocUserBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除-文档用户
|
||||
* @param ids ID
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docUser:delete")
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Boolean> delete(@PathVariable String ids) {
|
||||
return success(baseService.deleteById(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 模版下载-文档用户
|
||||
*/
|
||||
@SaCheckPermission("docAdmin:docUser:import")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil.download(response, DocUserExport.class, "文档用户");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入-文档用户
|
||||
* @param file 模版文件
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docUser:import")
|
||||
@PostMapping("/import")
|
||||
public R<Boolean> imports(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
Set<DocUserExport> list= ExcelUtil.imports(file, DocUserExport.class);
|
||||
Boolean state= baseService.imports(list);
|
||||
return R.ok(state,state?"数据导入成功!":"数据导入失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出-文档用户
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docUser:export")
|
||||
@PostMapping("/export")
|
||||
public void export(@Validated(ValidatedGroupConfig.query.class) DocUserBo bo,HttpServletResponse response) throws IOException {
|
||||
List<DocUserVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<DocUserExport> data= MapstructUtil.convert(list,DocUserExport.class);
|
||||
ExcelUtil.export(response, DocUserExport.class, "文档用户",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印-文档用户
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("docAdmin:docUser:print")
|
||||
@PostMapping("/print")
|
||||
public R<PrintObject<DocUserExport>> print(@RequestBody @Validated(ValidatedGroupConfig.query.class) DocUserBo bo) throws Exception {
|
||||
List<DocUserVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<DocUserExport> data= MapstructUtil.convert(list,DocUserExport.class);
|
||||
PrintObject<DocUserExport> printObject= new PrintObject<DocUserExport>()
|
||||
.setTitle("文档用户")
|
||||
.setData(data);
|
||||
return R.response(Boolean.TRUE,printObject);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.sxpcwlkj.docAdmin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文档授权用户
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("doc_authorize_user")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DocAuthorizeUser extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String uid;
|
||||
/**
|
||||
* 授权平台
|
||||
*/
|
||||
private String chan;
|
||||
/**
|
||||
* 授权平台标识
|
||||
*/
|
||||
private String appid;
|
||||
/**
|
||||
* 授权平台用户ID
|
||||
*/
|
||||
private String openid;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.sxpcwlkj.docAdmin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文档配置
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("doc_config")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DocConfig extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* KEY
|
||||
*/
|
||||
@TableField("`key`")
|
||||
private String key;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private String value;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.sxpcwlkj.docAdmin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文档订单
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("doc_order")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DocOrder extends BaseEntity {
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@TableId
|
||||
private String orderId;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String uid;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal txnAmt;
|
||||
/**
|
||||
* 支付商户号
|
||||
*/
|
||||
private String payMchid;
|
||||
/**
|
||||
* 支付平台流水号
|
||||
*/
|
||||
private String payNo;
|
||||
/**
|
||||
* 支付超时时间
|
||||
*/
|
||||
private String payTimeout;
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 产品价格
|
||||
*/
|
||||
private BigDecimal prodPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
private String prodType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String mtime;
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.sxpcwlkj.docAdmin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文档商品
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("doc_product")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DocProduct extends BaseEntity {
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@TableId
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 销售单价
|
||||
*/
|
||||
private String unitPrice;
|
||||
/**
|
||||
* 市场价格
|
||||
*/
|
||||
private String markPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String mtime;
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.sxpcwlkj.docAdmin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文档用户
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("doc_user")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DocUser extends BaseEntity {
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@TableId
|
||||
private String uid;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocAuthorizeUser;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文档授权用户Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocAuthorizeUser.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocAuthorizeUserBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@NotBlank(message = "ID不能为空" ,groups = {ValidatedGroupConfig.update.class})
|
||||
private String id;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotBlank(message = "用户编号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String uid;
|
||||
/**
|
||||
* 授权平台
|
||||
*/
|
||||
@NotBlank(message = "授权平台不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String chan;
|
||||
/**
|
||||
* 授权平台标识
|
||||
*/
|
||||
@NotBlank(message = "授权平台标识不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String appid;
|
||||
/**
|
||||
* 授权平台用户ID
|
||||
*/
|
||||
@NotBlank(message = "授权平台用户ID不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String openid;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotNull(message = "创建时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotNull(message = "更新时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocConfig;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文档配置Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocConfig.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocConfigBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@NotBlank(message = "ID不能为空" ,groups = {ValidatedGroupConfig.update.class})
|
||||
private String id;
|
||||
/**
|
||||
* KEY
|
||||
*/
|
||||
@NotBlank(message = "KEY不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String key;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@NotBlank(message = "值不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String value;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotNull(message = "创建时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotNull(message = "更新时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocOrder;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文档订单Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocOrder.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocOrderBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@NotBlank(message = "订单编号不能为空" ,groups = {ValidatedGroupConfig.update.class})
|
||||
private String orderId;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotBlank(message = "用户编号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String uid;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
@NotNull(message = "订单金额不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private BigDecimal txnAmt;
|
||||
/**
|
||||
* 支付商户号
|
||||
*/
|
||||
@NotBlank(message = "支付商户号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String payMchid;
|
||||
/**
|
||||
* 支付平台流水号
|
||||
*/
|
||||
@NotBlank(message = "支付平台流水号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String payNo;
|
||||
/**
|
||||
* 支付超时时间
|
||||
*/
|
||||
@NotBlank(message = "支付超时时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String payTimeout;
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@NotBlank(message = "产品编号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@NotBlank(message = "产品名称不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String prodName;
|
||||
/**
|
||||
* 产品价格
|
||||
*/
|
||||
@NotNull(message = "产品价格不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private BigDecimal prodPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
@NotBlank(message = "产品类型不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String prodType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotBlank(message = "创建时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotBlank(message = "更新时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String mtime;
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocProduct;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文档商品Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocProduct.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocProductBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@NotBlank(message = "产品编号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@NotBlank(message = "产品名称不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String prodName;
|
||||
/**
|
||||
* 销售单价
|
||||
*/
|
||||
@NotBlank(message = "销售单价不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String unitPrice;
|
||||
/**
|
||||
* 市场价格
|
||||
*/
|
||||
@NotBlank(message = "市场价格不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String markPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
@NotBlank(message = "产品类型不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotBlank(message = "创建时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotBlank(message = "更新时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String mtime;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocUser;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 文档用户Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocUser.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocUserBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotBlank(message = "用户编号不能为空" ,groups = {ValidatedGroupConfig.update.class})
|
||||
private String uid;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@NotBlank(message = "昵称不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String nickname;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@NotBlank(message = "头像不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String avatar;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@NotBlank(message = "用户类型不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotNull(message = "创建时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotNull(message = "更新时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.export;
|
||||
|
||||
import com.sxpcwlkj.common.annotation.Dict;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.sxpcwlkj.common.annotation.PrintColumn;
|
||||
import com.sxpcwlkj.common.enums.PrintTypeEnum;
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocAuthorizeUserVo;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.sxpcwlkj.framework.interceptor.DictExcelConverter;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档授权用户Export
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocAuthorizeUserVo.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocAuthorizeUserExport extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ExcelIgnore
|
||||
@ExcelProperty("ID")
|
||||
@PrintColumn(title = "ID", type = PrintTypeEnum.TEXT)
|
||||
private String id;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@ExcelProperty("用户编号")
|
||||
@PrintColumn(title = "用户编号", type = PrintTypeEnum.TEXT)
|
||||
private String uid;
|
||||
/**
|
||||
* 授权平台
|
||||
*/
|
||||
@ExcelProperty("授权平台")
|
||||
@PrintColumn(title = "授权平台", type = PrintTypeEnum.TEXT)
|
||||
private String chan;
|
||||
/**
|
||||
* 授权平台标识
|
||||
*/
|
||||
@ExcelProperty("授权平台标识")
|
||||
@PrintColumn(title = "授权平台标识", type = PrintTypeEnum.TEXT)
|
||||
private String appid;
|
||||
/**
|
||||
* 授权平台用户ID
|
||||
*/
|
||||
@ExcelProperty("授权平台用户ID")
|
||||
@PrintColumn(title = "授权平台用户ID", type = PrintTypeEnum.TEXT)
|
||||
private String openid;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty("创建时间")
|
||||
@PrintColumn(title = "创建时间", type = PrintTypeEnum.TEXT)
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ExcelProperty("更新时间")
|
||||
@PrintColumn(title = "更新时间", type = PrintTypeEnum.TEXT)
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.export;
|
||||
|
||||
import com.sxpcwlkj.common.annotation.Dict;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.sxpcwlkj.common.annotation.PrintColumn;
|
||||
import com.sxpcwlkj.common.enums.PrintTypeEnum;
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocConfigVo;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.sxpcwlkj.framework.interceptor.DictExcelConverter;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档配置Export
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocConfigVo.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocConfigExport extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ExcelIgnore
|
||||
@ExcelProperty("ID")
|
||||
@PrintColumn(title = "ID", type = PrintTypeEnum.TEXT)
|
||||
private String id;
|
||||
/**
|
||||
* KEY
|
||||
*/
|
||||
@ExcelProperty("KEY")
|
||||
@PrintColumn(title = "KEY", type = PrintTypeEnum.TEXT)
|
||||
private String key;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@ExcelProperty("值")
|
||||
@PrintColumn(title = "值", type = PrintTypeEnum.TEXT)
|
||||
private String value;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty("创建时间")
|
||||
@PrintColumn(title = "创建时间", type = PrintTypeEnum.TEXT)
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ExcelProperty("更新时间")
|
||||
@PrintColumn(title = "更新时间", type = PrintTypeEnum.TEXT)
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.export;
|
||||
|
||||
import com.sxpcwlkj.common.annotation.Dict;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.sxpcwlkj.common.annotation.PrintColumn;
|
||||
import com.sxpcwlkj.common.enums.PrintTypeEnum;
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocOrderVo;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.sxpcwlkj.framework.interceptor.DictExcelConverter;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档订单Export
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocOrderVo.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocOrderExport extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@ExcelIgnore
|
||||
@ExcelProperty("订单编号")
|
||||
@PrintColumn(title = "订单编号", type = PrintTypeEnum.TEXT)
|
||||
private String orderId;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@ExcelProperty("用户编号")
|
||||
@PrintColumn(title = "用户编号", type = PrintTypeEnum.TEXT)
|
||||
private String uid;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
@ExcelProperty("订单金额")
|
||||
@PrintColumn(title = "订单金额", type = PrintTypeEnum.TEXT)
|
||||
private BigDecimal txnAmt;
|
||||
/**
|
||||
* 支付商户号
|
||||
*/
|
||||
@ExcelProperty("支付商户号")
|
||||
@PrintColumn(title = "支付商户号", type = PrintTypeEnum.TEXT)
|
||||
private String payMchid;
|
||||
/**
|
||||
* 支付平台流水号
|
||||
*/
|
||||
@ExcelProperty("支付平台流水号")
|
||||
@PrintColumn(title = "支付平台流水号", type = PrintTypeEnum.TEXT)
|
||||
private String payNo;
|
||||
/**
|
||||
* 支付超时时间
|
||||
*/
|
||||
@ExcelProperty("支付超时时间")
|
||||
@PrintColumn(title = "支付超时时间", type = PrintTypeEnum.TEXT)
|
||||
private String payTimeout;
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@ExcelProperty("产品编号")
|
||||
@PrintColumn(title = "产品编号", type = PrintTypeEnum.TEXT)
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@ExcelProperty("产品名称")
|
||||
@PrintColumn(title = "产品名称", type = PrintTypeEnum.TEXT)
|
||||
private String prodName;
|
||||
/**
|
||||
* 产品价格
|
||||
*/
|
||||
@ExcelProperty("产品价格")
|
||||
@PrintColumn(title = "产品价格", type = PrintTypeEnum.TEXT)
|
||||
private BigDecimal prodPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
@ExcelProperty("产品类型")
|
||||
@PrintColumn(title = "产品类型", type = PrintTypeEnum.TEXT)
|
||||
private String prodType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty("创建时间")
|
||||
@PrintColumn(title = "创建时间", type = PrintTypeEnum.TEXT)
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ExcelProperty("更新时间")
|
||||
@PrintColumn(title = "更新时间", type = PrintTypeEnum.TEXT)
|
||||
private String mtime;
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.export;
|
||||
|
||||
import com.sxpcwlkj.common.annotation.Dict;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.sxpcwlkj.common.annotation.PrintColumn;
|
||||
import com.sxpcwlkj.common.enums.PrintTypeEnum;
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocProductVo;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.sxpcwlkj.framework.interceptor.DictExcelConverter;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档商品Export
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocProductVo.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocProductExport extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@ExcelProperty("产品编号")
|
||||
@PrintColumn(title = "产品编号", type = PrintTypeEnum.TEXT)
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@ExcelProperty("产品名称")
|
||||
@PrintColumn(title = "产品名称", type = PrintTypeEnum.TEXT)
|
||||
private String prodName;
|
||||
/**
|
||||
* 销售单价
|
||||
*/
|
||||
@ExcelProperty("销售单价")
|
||||
@PrintColumn(title = "销售单价", type = PrintTypeEnum.TEXT)
|
||||
private String unitPrice;
|
||||
/**
|
||||
* 市场价格
|
||||
*/
|
||||
@ExcelProperty("市场价格")
|
||||
@PrintColumn(title = "市场价格", type = PrintTypeEnum.TEXT)
|
||||
private String markPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
@ExcelProperty("产品类型")
|
||||
@PrintColumn(title = "产品类型", type = PrintTypeEnum.TEXT)
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty("创建时间")
|
||||
@PrintColumn(title = "创建时间", type = PrintTypeEnum.TEXT)
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ExcelProperty("更新时间")
|
||||
@PrintColumn(title = "更新时间", type = PrintTypeEnum.TEXT)
|
||||
private String mtime;
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.export;
|
||||
|
||||
import com.sxpcwlkj.common.annotation.Dict;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.sxpcwlkj.common.annotation.PrintColumn;
|
||||
import com.sxpcwlkj.common.enums.PrintTypeEnum;
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocUserVo;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.sxpcwlkj.framework.interceptor.DictExcelConverter;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档用户Export
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocUserVo.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocUserExport extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@ExcelIgnore
|
||||
@ExcelProperty("用户编号")
|
||||
@PrintColumn(title = "用户编号", type = PrintTypeEnum.TEXT)
|
||||
private String uid;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@ExcelProperty("昵称")
|
||||
@PrintColumn(title = "昵称", type = PrintTypeEnum.TEXT)
|
||||
private String nickname;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@ExcelProperty("头像")
|
||||
@PrintColumn(title = "头像", type = PrintTypeEnum.TEXT)
|
||||
private String avatar;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@ExcelProperty("用户类型")
|
||||
@PrintColumn(title = "用户类型", type = PrintTypeEnum.TEXT)
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty("创建时间")
|
||||
@PrintColumn(title = "创建时间", type = PrintTypeEnum.TEXT)
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ExcelProperty("更新时间")
|
||||
@PrintColumn(title = "更新时间", type = PrintTypeEnum.TEXT)
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.vo;
|
||||
|
||||
|
||||
import java.io.Serial;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocAuthorizeUser;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档授权用户Vo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = DocAuthorizeUser.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocAuthorizeUserVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String uid;
|
||||
/**
|
||||
* 授权平台
|
||||
*/
|
||||
private String chan;
|
||||
/**
|
||||
* 授权平台标识
|
||||
*/
|
||||
private String appid;
|
||||
/**
|
||||
* 授权平台用户ID
|
||||
*/
|
||||
private String openid;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date mtime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.vo;
|
||||
|
||||
|
||||
import java.io.Serial;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocConfig;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档配置Vo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = DocConfig.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocConfigVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* KEY
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private String value;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date mtime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.vo;
|
||||
|
||||
|
||||
import java.io.Serial;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocOrder;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.List;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档订单Vo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = DocOrder.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocOrderVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String uid;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal txnAmt;
|
||||
/**
|
||||
* 支付商户号
|
||||
*/
|
||||
private String payMchid;
|
||||
/**
|
||||
* 支付平台流水号
|
||||
*/
|
||||
private String payNo;
|
||||
/**
|
||||
* 支付超时时间
|
||||
*/
|
||||
private String payTimeout;
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 产品价格
|
||||
*/
|
||||
private BigDecimal prodPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
private String prodType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String mtime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.vo;
|
||||
|
||||
|
||||
import java.io.Serial;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocProduct;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档商品Vo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = DocProduct.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocProductVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 销售单价
|
||||
*/
|
||||
private String unitPrice;
|
||||
/**
|
||||
* 市场价格
|
||||
*/
|
||||
private String markPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String mtime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.sxpcwlkj.docAdmin.entity.vo;
|
||||
|
||||
|
||||
import java.io.Serial;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocUser;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档用户Vo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = DocUser.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocUserVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String uid;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date mtime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.docAdmin.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocAuthorizeUser;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocAuthorizeUserVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 文档授权用户-Mapper
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DocAuthorizeUserMapper extends BaseMapperPlus<DocAuthorizeUser, DocAuthorizeUserVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.docAdmin.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocConfig;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocConfigVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 文档配置-Mapper
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DocConfigMapper extends BaseMapperPlus<DocConfig, DocConfigVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.docAdmin.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocOrder;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocOrderVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 文档订单-Mapper
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DocOrderMapper extends BaseMapperPlus<DocOrder, DocOrderVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.docAdmin.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocProduct;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocProductVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 文档商品-Mapper
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DocProductMapper extends BaseMapperPlus<DocProduct, DocProductVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.docAdmin.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocUser;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocUserVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 文档用户-Mapper
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DocUserMapper extends BaseMapperPlus<DocUser, DocUserVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.sxpcwlkj.docAdmin.service;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocAuthorizeUser;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocAuthorizeUserBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocAuthorizeUserVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocAuthorizeUserExport;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档授权用户-接口
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
* @describe 支持自定义扩展,已继承接口:{insert、deleteById、updateById、selectById、getByEntityListPage}(更多查看BaseService接口)
|
||||
*/
|
||||
public interface DocAuthorizeUserService extends BaseService<DocAuthorizeUser, DocAuthorizeUserVo, DocAuthorizeUserBo> {
|
||||
/**
|
||||
* 导出文档授权用户
|
||||
* @param list 文档授权用户列表
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean imports(Set<DocAuthorizeUserExport> list);
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.sxpcwlkj.docAdmin.service;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocConfig;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocConfigBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocConfigVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocConfigExport;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档配置-接口
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
* @describe 支持自定义扩展,已继承接口:{insert、deleteById、updateById、selectById、getByEntityListPage}(更多查看BaseService接口)
|
||||
*/
|
||||
public interface DocConfigService extends BaseService<DocConfig, DocConfigVo, DocConfigBo> {
|
||||
/**
|
||||
* 导出文档配置
|
||||
* @param list 文档配置列表
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean imports(Set<DocConfigExport> list);
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.sxpcwlkj.docAdmin.service;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocOrder;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocOrderBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocOrderVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocOrderExport;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档订单-接口
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
* @describe 支持自定义扩展,已继承接口:{insert、deleteById、updateById、selectById、getByEntityListPage}(更多查看BaseService接口)
|
||||
*/
|
||||
public interface DocOrderService extends BaseService<DocOrder, DocOrderVo, DocOrderBo> {
|
||||
/**
|
||||
* 导出文档订单
|
||||
* @param list 文档订单列表
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean imports(Set<DocOrderExport> list);
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.sxpcwlkj.docAdmin.service;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocProduct;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocProductBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocProductVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocProductExport;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档商品-接口
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
* @describe 支持自定义扩展,已继承接口:{insert、deleteById、updateById、selectById、getByEntityListPage}(更多查看BaseService接口)
|
||||
*/
|
||||
public interface DocProductService extends BaseService<DocProduct, DocProductVo, DocProductBo> {
|
||||
/**
|
||||
* 导出文档商品
|
||||
* @param list 文档商品列表
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean imports(Set<DocProductExport> list);
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.sxpcwlkj.docAdmin.service;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocUser;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocUserBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocUserVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocUserExport;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档用户-接口
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
* @describe 支持自定义扩展,已继承接口:{insert、deleteById、updateById、selectById、getByEntityListPage}(更多查看BaseService接口)
|
||||
*/
|
||||
public interface DocUserService extends BaseService<DocUser, DocUserVo, DocUserBo> {
|
||||
/**
|
||||
* 导出文档用户
|
||||
* @param list 文档用户列表
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean imports(Set<DocUserExport> list);
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package com.sxpcwlkj.docAdmin.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.common.enums.SystemCommonEnum;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocAuthorizeUser;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocAuthorizeUserBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocAuthorizeUserVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocAuthorizeUserExport;
|
||||
import com.sxpcwlkj.docAdmin.mapper.DocAuthorizeUserMapper;
|
||||
import com.sxpcwlkj.docAdmin.service.DocAuthorizeUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
/**
|
||||
* 文档授权用户-接口实现
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Transactional
|
||||
@Service("doc_authorize_user")
|
||||
@RequiredArgsConstructor
|
||||
public class DocAuthorizeUserServiceImpl extends BaseServiceImpl<DocAuthorizeUser, DocAuthorizeUserVo,DocAuthorizeUserBo> implements DocAuthorizeUserService {
|
||||
|
||||
private final DocAuthorizeUserMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<DocAuthorizeUser, DocAuthorizeUserVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(DocAuthorizeUserBo bo) {
|
||||
try {
|
||||
int row;
|
||||
bo.setId(null);
|
||||
DocAuthorizeUser obj = MapstructUtil.convert(bo, DocAuthorizeUser.class);
|
||||
assert obj != null;
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
bo.setId(obj.getId());
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档授权用户,insert 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable ids) {
|
||||
try {
|
||||
String[] array = DataUtil.getCatStr(ids.toString(), ",");
|
||||
return this.getBaseMapper().deleteByIds(new ArrayList<>(List.of(array)))>0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档授权用户,deleteById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(DocAuthorizeUserBo bo) {
|
||||
try {
|
||||
int row;
|
||||
DocAuthorizeUser obj = MapstructUtil.convert(bo, DocAuthorizeUser.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档授权用户,updateById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocAuthorizeUserVo selectVoById(Serializable id) {
|
||||
return this.getBaseMapper().selectVoById(id);
|
||||
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<DocAuthorizeUserVo> selectListVoPage(DocAuthorizeUserBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DocAuthorizeUser> lqw = buildQueryWrapper(bo);
|
||||
Page<DocAuthorizeUserVo> page = baseMapper.selectVoPage(pageQuery.build(),lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<DocAuthorizeUser> buildQueryWrapper(DocAuthorizeUserBo query){
|
||||
if(query==null){
|
||||
query=new DocAuthorizeUserBo();
|
||||
}
|
||||
LambdaQueryWrapper<DocAuthorizeUser> wrapper = Wrappers.lambdaQuery();
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean imports(Set<DocAuthorizeUserExport> list) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package com.sxpcwlkj.docAdmin.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.common.enums.SystemCommonEnum;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocConfig;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocConfigBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocConfigVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocConfigExport;
|
||||
import com.sxpcwlkj.docAdmin.mapper.DocConfigMapper;
|
||||
import com.sxpcwlkj.docAdmin.service.DocConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
/**
|
||||
* 文档配置-接口实现
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Transactional
|
||||
@Service("doc_config")
|
||||
@RequiredArgsConstructor
|
||||
public class DocConfigServiceImpl extends BaseServiceImpl<DocConfig, DocConfigVo,DocConfigBo> implements DocConfigService {
|
||||
|
||||
private final DocConfigMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<DocConfig, DocConfigVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(DocConfigBo bo) {
|
||||
try {
|
||||
int row;
|
||||
bo.setId(null);
|
||||
DocConfig obj = MapstructUtil.convert(bo, DocConfig.class);
|
||||
assert obj != null;
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
bo.setId(obj.getId());
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档配置,insert 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable ids) {
|
||||
try {
|
||||
String[] array = DataUtil.getCatStr(ids.toString(), ",");
|
||||
return this.getBaseMapper().deleteByIds(new ArrayList<>(List.of(array)))>0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档配置,deleteById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(DocConfigBo bo) {
|
||||
try {
|
||||
int row;
|
||||
DocConfig obj = MapstructUtil.convert(bo, DocConfig.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档配置,updateById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocConfigVo selectVoById(Serializable id) {
|
||||
return this.getBaseMapper().selectVoById(id);
|
||||
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<DocConfigVo> selectListVoPage(DocConfigBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DocConfig> lqw = buildQueryWrapper(bo);
|
||||
Page<DocConfigVo> page = baseMapper.selectVoPage(pageQuery.build(),lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<DocConfig> buildQueryWrapper(DocConfigBo query){
|
||||
if(query==null){
|
||||
query=new DocConfigBo();
|
||||
}
|
||||
LambdaQueryWrapper<DocConfig> wrapper = Wrappers.lambdaQuery();
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean imports(Set<DocConfigExport> list) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package com.sxpcwlkj.docAdmin.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.common.enums.SystemCommonEnum;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocOrder;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocOrderBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocOrderVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocOrderExport;
|
||||
import com.sxpcwlkj.docAdmin.mapper.DocOrderMapper;
|
||||
import com.sxpcwlkj.docAdmin.service.DocOrderService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
/**
|
||||
* 文档订单-接口实现
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Transactional
|
||||
@Service("doc_order")
|
||||
@RequiredArgsConstructor
|
||||
public class DocOrderServiceImpl extends BaseServiceImpl<DocOrder, DocOrderVo,DocOrderBo> implements DocOrderService {
|
||||
|
||||
private final DocOrderMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<DocOrder, DocOrderVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(DocOrderBo bo) {
|
||||
try {
|
||||
int row;
|
||||
bo.setOrderId(null);
|
||||
DocOrder obj = MapstructUtil.convert(bo, DocOrder.class);
|
||||
assert obj != null;
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
bo.setOrderId(obj.getOrderId());
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档订单,insert 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable ids) {
|
||||
try {
|
||||
String[] array = DataUtil.getCatStr(ids.toString(), ",");
|
||||
return this.getBaseMapper().deleteByIds(new ArrayList<>(List.of(array)))>0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档订单,deleteById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(DocOrderBo bo) {
|
||||
try {
|
||||
int row;
|
||||
DocOrder obj = MapstructUtil.convert(bo, DocOrder.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档订单,updateById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocOrderVo selectVoById(Serializable id) {
|
||||
return this.getBaseMapper().selectVoById(id);
|
||||
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<DocOrderVo> selectListVoPage(DocOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DocOrder> lqw = buildQueryWrapper(bo);
|
||||
Page<DocOrderVo> page = baseMapper.selectVoPage(pageQuery.build(),lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<DocOrder> buildQueryWrapper(DocOrderBo query){
|
||||
if(query==null){
|
||||
query=new DocOrderBo();
|
||||
}
|
||||
LambdaQueryWrapper<DocOrder> wrapper = Wrappers.lambdaQuery();
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean imports(Set<DocOrderExport> list) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package com.sxpcwlkj.docAdmin.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.common.enums.SystemCommonEnum;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocProduct;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocProductBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocProductVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocProductExport;
|
||||
import com.sxpcwlkj.docAdmin.mapper.DocProductMapper;
|
||||
import com.sxpcwlkj.docAdmin.service.DocProductService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
/**
|
||||
* 文档商品-接口实现
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Transactional
|
||||
@Service("doc_product")
|
||||
@RequiredArgsConstructor
|
||||
public class DocProductServiceImpl extends BaseServiceImpl<DocProduct, DocProductVo,DocProductBo> implements DocProductService {
|
||||
|
||||
private final DocProductMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<DocProduct, DocProductVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(DocProductBo bo) {
|
||||
try {
|
||||
int row;
|
||||
bo.setProdId(null);
|
||||
DocProduct obj = MapstructUtil.convert(bo, DocProduct.class);
|
||||
assert obj != null;
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
bo.setProdId(obj.getProdId());
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档商品,insert 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable ids) {
|
||||
try {
|
||||
String[] array = DataUtil.getCatStr(ids.toString(), ",");
|
||||
return this.getBaseMapper().deleteByIds(new ArrayList<>(List.of(array)))>0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档商品,deleteById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(DocProductBo bo) {
|
||||
try {
|
||||
int row;
|
||||
DocProduct obj = MapstructUtil.convert(bo, DocProduct.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档商品,updateById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocProductVo selectVoById(Serializable id) {
|
||||
return this.getBaseMapper().selectVoById(id);
|
||||
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<DocProductVo> selectListVoPage(DocProductBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DocProduct> lqw = buildQueryWrapper(bo);
|
||||
Page<DocProductVo> page = baseMapper.selectVoPage(pageQuery.build(),lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<DocProduct> buildQueryWrapper(DocProductBo query){
|
||||
if(query==null){
|
||||
query=new DocProductBo();
|
||||
}
|
||||
LambdaQueryWrapper<DocProduct> wrapper = Wrappers.lambdaQuery();
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean imports(Set<DocProductExport> list) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package com.sxpcwlkj.docAdmin.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.common.enums.SystemCommonEnum;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
import com.sxpcwlkj.docAdmin.entity.DocUser;
|
||||
import com.sxpcwlkj.docAdmin.entity.bo.DocUserBo;
|
||||
import com.sxpcwlkj.docAdmin.entity.vo.DocUserVo;
|
||||
import com.sxpcwlkj.docAdmin.entity.export.DocUserExport;
|
||||
import com.sxpcwlkj.docAdmin.mapper.DocUserMapper;
|
||||
import com.sxpcwlkj.docAdmin.service.DocUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
/**
|
||||
* 文档用户-接口实现
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Transactional
|
||||
@Service("doc_user")
|
||||
@RequiredArgsConstructor
|
||||
public class DocUserServiceImpl extends BaseServiceImpl<DocUser, DocUserVo,DocUserBo> implements DocUserService {
|
||||
|
||||
private final DocUserMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<DocUser, DocUserVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(DocUserBo bo) {
|
||||
try {
|
||||
int row;
|
||||
bo.setUid(null);
|
||||
DocUser obj = MapstructUtil.convert(bo, DocUser.class);
|
||||
assert obj != null;
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
bo.setUid(obj.getUid());
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档用户,insert 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable ids) {
|
||||
try {
|
||||
String[] array = DataUtil.getCatStr(ids.toString(), ",");
|
||||
return this.getBaseMapper().deleteByIds(new ArrayList<>(List.of(array)))>0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档用户,deleteById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(DocUserBo bo) {
|
||||
try {
|
||||
int row;
|
||||
DocUser obj = MapstructUtil.convert(bo, DocUser.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档用户,updateById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocUserVo selectVoById(Serializable id) {
|
||||
return this.getBaseMapper().selectVoById(id);
|
||||
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<DocUserVo> selectListVoPage(DocUserBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DocUser> lqw = buildQueryWrapper(bo);
|
||||
Page<DocUserVo> page = baseMapper.selectVoPage(pageQuery.build(),lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<DocUser> buildQueryWrapper(DocUserBo query){
|
||||
if(query==null){
|
||||
query=new DocUserBo();
|
||||
}
|
||||
LambdaQueryWrapper<DocUser> wrapper = Wrappers.lambdaQuery();
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean imports(Set<DocUserExport> list) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.docAdmin.mapper.DocAuthorizeUserMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.docAdmin.mapper.DocConfigMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.docAdmin.mapper.DocOrderMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.docAdmin.mapper.DocProductMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.docAdmin.mapper.DocUserMapper">
|
||||
|
||||
</mapper>
|
||||
103
mms-docs/mms-doc-api/.gitignore
vendored
Normal file
103
mms-docs/mms-doc-api/.gitignore
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# Eclipse & IntelliJ IDEA
|
||||
.classpath
|
||||
.settings/
|
||||
.idea
|
||||
.idea/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
.settings
|
||||
.project
|
||||
.flattened-pom.xml
|
||||
|
||||
# Maven
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
# Gradle
|
||||
.gradle
|
||||
.gradle/
|
||||
build/
|
||||
**/build/
|
||||
bin/
|
||||
!src/**/build/
|
||||
gradle-app.setting
|
||||
!gradle-wrapper.jar
|
||||
.gradletasknamecache
|
||||
gradle/wrapper/gradle-wrapper.properties
|
||||
|
||||
# VS Code
|
||||
.vscode/
|
||||
|
||||
# STS
|
||||
.apt_generated
|
||||
.factorypath
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
# NetBeans
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
# DB
|
||||
/script/db/.back_sxpcwlkj/
|
||||
/script/db/.version_sxpcwlkj/
|
||||
!/script/db/.back_sxpcwlkj/
|
||||
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
25
mms-docs/mms-doc-api/Dockerfile
Normal file
25
mms-docs/mms-doc-api/Dockerfile
Normal file
@ -0,0 +1,25 @@
|
||||
#FROM findepi/graalvm:java17-native
|
||||
FROM openjdk:17.0.2-oraclelinux8
|
||||
|
||||
MAINTAINER SXPCWLKJ
|
||||
|
||||
RUN mkdir -p /sxpcwlkj \
|
||||
/sxpcwlkj/mms-doc \
|
||||
/sxpcwlkj/mms-doc/logs \
|
||||
/sxpcwlkj/mms-doc/files
|
||||
|
||||
WORKDIR /sxpcwlkj/mms-doc
|
||||
|
||||
ENV SERVER_PORT=8070 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
|
||||
|
||||
EXPOSE ${SERVER_PORT}
|
||||
|
||||
ADD ./target/mms-doc-api.jar ./app.jar
|
||||
|
||||
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
|
||||
# 应用名称 如果想区分集群节点监控 改成不同的名称即可
|
||||
#-Dskywalking.agent.service_name=sxpcwlkj-mms \
|
||||
#-javaagent:/sxpcwlkj/mms/skywalking/agent/skywalking-agent.jar \
|
||||
-jar app.jar \
|
||||
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}
|
||||
|
||||
284
mms-docs/mms-doc-api/README.md
Normal file
284
mms-docs/mms-doc-api/README.md
Normal file
@ -0,0 +1,284 @@
|
||||
# 声明
|
||||
|
||||
本项目是用于 [[VitePress 会员主题]](https://vitepress.mosong.cc/) 的用户注册/登录,支付等接口服务。
|
||||
|
||||
> 详细文档大家请访问: 官方 [[VitePress 会员主题]](https://vitepress.mosong.cc/) 官方是Go语言服务接口工程 。
|
||||
|
||||
> 以下是用Java扩展 ‘会员主题’ 服务接口,具体看下面的接口列表:
|
||||
|
||||
|
||||
# 接口列表
|
||||
|
||||
## 一、用户信息
|
||||
|
||||
POST /vpapi/meb/userinfo
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称|位置|类型|必选| 值 |
|
||||
|---|---|---|---|------------|
|
||||
|cookie|header|string| 否 | mss= |
|
||||
|
||||
> 返回示例
|
||||
|
||||
未登录
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{},
|
||||
"errmsg":"会话过期",
|
||||
"errno":"99910",
|
||||
"host_time":"20250528093635"
|
||||
}
|
||||
```
|
||||
已登录
|
||||
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"uid": "674fe3bb2c8b61045f6eaff6",
|
||||
"nickname": "单先生-软件开发",
|
||||
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/gWYQezqOl40WauDqyA7c5HGPQQgUQmXg0aLJVhMwdAIxD2DHs19urHkzB5CJm12vraHGT9a1lQIBNyGYBzCJ4yJuib8bctnE9rS5CH9GY3NY/132",
|
||||
"ctime": "20241204130811",
|
||||
"type": "vip",
|
||||
"vip_date": "2025-05-28"
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528095709"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## 二、获取登录二维码
|
||||
|
||||
POST /vpapi/meb/oauth-authorize
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称|位置|类型|必选| 值 |
|
||||
|---|---|---|---|---|
|
||||
|cookie|header|string| 否 | mss= |
|
||||
|
||||
> 返回示例
|
||||
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"state": "68366991f2d7af56647fb645",
|
||||
"url": "https://vpapi.mosong.cc/vpapi/meb/weixin-authorize?scope=snsapi_userinfo&state=68366991f2d7af56647fb645"
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528094033"
|
||||
}
|
||||
```
|
||||
|
||||
## 三、微信授权跳转
|
||||
|
||||
GET /vpapi/meb/weixin-authorize?state=x&scope=x
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称|位置|类型|必选| 值 |
|
||||
|---|---|---|---|---|
|
||||
|cookie|header|string| 否 | mss= |
|
||||
|state| param |string| 是 | 68366991f2d7af56647fb645 |
|
||||
|scope| param |string| 是 | snsapi_userinfo |
|
||||
|
||||
> 返回示例
|
||||
> '状态 1=正常 0=重试'
|
||||
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"status":1
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528094033"
|
||||
}
|
||||
```
|
||||
|
||||
## 四、查询扫码状态
|
||||
|
||||
POST /vpapi/meb/oauth-polling
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称| 位置 |类型| 必选 | 值 |
|
||||
|---|--------|---|----|---|
|
||||
|cookie| header |string| 否 | mss= |
|
||||
|state| param |string| 是 | 68366991f2d7af56647fb645 |
|
||||
|
||||
|
||||
> 返回示例
|
||||
|
||||
未扫码
|
||||
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"status": "0",
|
||||
"token": ""
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528094039"
|
||||
}
|
||||
```
|
||||
扫码成功
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"status": "1",
|
||||
"token": "3092447f3f26snCUIBpCShl3_kRxkaJsephz_DfFtPWtrFNCz6IiMAjYYlU1bN1YbQ9Vs_3HFCUGYzRlSoE-eKGpPmFsTBlxIjGueCALtm3wkn9grjM6UPFC_C8W5sgCAZLIdOLvLYwu"
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528095709"
|
||||
}
|
||||
```
|
||||
|
||||
## 五、开通会员
|
||||
|
||||
POST /vpapi/meb/product-list
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称| 位置 |类型| 必选 | 值 |
|
||||
|---|--------|---|----|---------------------------------------------------------|
|
||||
|cookie| header |string| 是 | mss=3092447f3f26snCUIBpCShl3_kRxkaJsephz*************** |
|
||||
|
||||
|
||||
> 返回示例
|
||||
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"items": [
|
||||
{
|
||||
"prod_id": "240003",
|
||||
"prod_name": "天卡会员",
|
||||
"unit_price": 990,
|
||||
"mark_price": 990,
|
||||
"intro": "",
|
||||
"buy_url": "付款二维码Url"
|
||||
},
|
||||
{
|
||||
"prod_id": "240002",
|
||||
"prod_name": "月卡会员",
|
||||
"unit_price": 3000,
|
||||
"mark_price": 4900,
|
||||
"intro": "",
|
||||
"buy_url": "付款二维码Url"
|
||||
},
|
||||
{
|
||||
"prod_id": "240001",
|
||||
"prod_name": "年费会员",
|
||||
"unit_price": 9800,
|
||||
"mark_price": 36500,
|
||||
"intro": "",
|
||||
"buy_url": "付款二维码Url"
|
||||
}
|
||||
]
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528102206"
|
||||
}
|
||||
```
|
||||
|
||||
## 六、查询付款状态
|
||||
|
||||
POST /vpapi/meb/product-buy-qry
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称| 位置 |类型| 必选 | 值 |
|
||||
|---|--------|---|----|---------------------------------------------------------|
|
||||
|cookie| header |string| 是 | mss=3092447f3f26snCUIBpCShl3_kRxkaJsephz*************** |
|
||||
|prod_id| param |string| 是 | 240002 |
|
||||
|
||||
> 返回示例
|
||||
|
||||
未支付
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{},
|
||||
"errmsg":"没有查到订单",
|
||||
"errno":"ERROR",
|
||||
"host_time":"20250528102227"
|
||||
}
|
||||
```
|
||||
已支付
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{
|
||||
"status":"paysuc"
|
||||
},
|
||||
"errmsg":"没有查到订单",
|
||||
"errno":"ERROR",
|
||||
"host_time":"20250528102227"
|
||||
}
|
||||
```
|
||||
|
||||
## 七、查询付款状态
|
||||
|
||||
POST /vpapi/meb/product-buy-qry
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称| 位置 |类型| 必选 | 值 |
|
||||
|---|--------|---|----|---------------------------------------------------------|
|
||||
|cookie| header |string| 是 | mss=3092447f3f26snCUIBpCShl3_kRxkaJsephz*************** |
|
||||
|prod_id| param |string| 是 | 240002 |
|
||||
|
||||
> 返回示例
|
||||
|
||||
未支付
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{},
|
||||
"errmsg":"没有查到订单",
|
||||
"errno":"ERROR",
|
||||
"host_time":"20250528102227"
|
||||
}
|
||||
```
|
||||
已支付
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{
|
||||
"status":"paysuc"
|
||||
},
|
||||
"errmsg":"没有查到订单",
|
||||
"errno":"ERROR",
|
||||
"host_time":"20250528102227"
|
||||
}
|
||||
```
|
||||
|
||||
八、退出
|
||||
|
||||
POST /vpapi/meb/logout
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称| 位置 |类型| 必选 | 值 |
|
||||
|---|--------|---|----|---------------------------------------------------------|
|
||||
|cookie| header |string| 是 | mss=3092447f3f26snCUIBpCShl3_kRxkaJsephz*************** |
|
||||
|
||||
> 返回示例
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{},
|
||||
"errmsg":"ok",
|
||||
"errno":"00000",
|
||||
"host_time":"20250528104040"
|
||||
}
|
||||
|
||||
```
|
||||
81
mms-docs/mms-doc-api/pom.xml
Normal file
81
mms-docs/mms-doc-api/pom.xml
Normal file
@ -0,0 +1,81 @@
|
||||
<?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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<artifactId>mms-docs</artifactId>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>mms-doc-api</artifactId>
|
||||
<description>文档接口模块</description>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- 后台管理系统核心包 -->
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-framework</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-oss</artifactId>
|
||||
<exclusions>
|
||||
<!-- 解决slf4j冲突 -->
|
||||
<exclusion>
|
||||
<artifactId>slf4j-reload4j</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-sms</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-wx</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>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>${maven-jar-plugin.version}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>${maven-war-plugin.version}</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@ -0,0 +1,46 @@
|
||||
package com.sxpcwlkj;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.x.file.storage.spring.EnableFileStorage;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* @author 西决
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@Slf4j
|
||||
@EnableAspectJAutoProxy(exposeProxy = true)
|
||||
@MapperScan(basePackages = {"com.sxpcwlkj.**.mapper"})
|
||||
|
||||
@EnableFileStorage
|
||||
public class MmsDocApiApplication {
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(MmsDocApiApplication.class, args);
|
||||
Environment env = applicationContext.getEnvironment();
|
||||
System.out.println("文档API端: 系统启动成功,当前环境为: " + env.getProperty("spring.profiles.active"));
|
||||
log.info("\n----------------------------------------------------------\n\t" +
|
||||
"Application '{}' is running! Access URLs:\n\t" +
|
||||
"Local: \t\thttp://localhost:{}\n\t" +
|
||||
"External: \thttp://{}:{}\n\t" +
|
||||
"Doc: \t\t{}\n" +
|
||||
"----------------------------------------------------------",
|
||||
env.getProperty("sxpcwlkj.name"),
|
||||
env.getProperty("server.port"),
|
||||
InetAddress.getLocalHost().getHostAddress(),
|
||||
env.getProperty("server.port"),
|
||||
env.getProperty("sxpcwlkj.docUrl"));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.sxpcwlkj.docApi.config;
|
||||
|
||||
import com.typesafe.config.Config;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 西决
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class InitConfig {
|
||||
private final ApplicationContext applicationContext;
|
||||
/**
|
||||
* 初始化配置参数到缓存中
|
||||
*/
|
||||
@PostConstruct
|
||||
private void init() {
|
||||
Map<Long, Config> configMap = new HashMap<>();
|
||||
applicationContext.publishEvent(new ContextRefreshedEvent(applicationContext));
|
||||
log.info("项目初始化....");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,317 @@
|
||||
package com.sxpcwlkj.docApi.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
|
||||
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
|
||||
import com.ijpay.core.enums.TradeType;
|
||||
import com.ijpay.core.kit.WxPayKit;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.code.entity.WxCodeBo;
|
||||
import com.sxpcwlkj.common.enums.DeviceEnum;
|
||||
import com.sxpcwlkj.common.enums.WxCodeStatusEnum;
|
||||
import com.sxpcwlkj.common.utils.*;
|
||||
import com.sxpcwlkj.docApi.entity.DocOrder;
|
||||
import com.sxpcwlkj.docApi.entity.DocProduct;
|
||||
import com.sxpcwlkj.docApi.entity.DocUser;
|
||||
import com.sxpcwlkj.docApi.entity.bo.MyRequest;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocOrderVo;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocUserVo;
|
||||
import com.sxpcwlkj.docApi.mapper.DocConfigMapper;
|
||||
import com.sxpcwlkj.docApi.mapper.DocOrderMapper;
|
||||
import com.sxpcwlkj.docApi.mapper.DocProductMapper;
|
||||
import com.sxpcwlkj.docApi.service.DocOrderService;
|
||||
import com.sxpcwlkj.docApi.service.DocUserService;
|
||||
import com.sxpcwlkj.docApi.utils.DocR;
|
||||
import com.sxpcwlkj.framework.utils.AddressUtil;
|
||||
import com.sxpcwlkj.redis.RedisUtil;
|
||||
import com.sxpcwlkj.redis.constant.RedisConstant;
|
||||
import com.sxpcwlkj.wx.service.WxCodeService;
|
||||
import com.sxpcwlkj.wx.service.WxOrderService;
|
||||
import com.sxpcwlkj.wx.service.WxService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author shanpengnian
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/doc-api/meb/v1")
|
||||
public class DocUserController{
|
||||
|
||||
private final DocUserService docUserService;
|
||||
private final DocOrderMapper docOrderMapper;
|
||||
private final DocConfigMapper docConfigMapper;
|
||||
private final WxCodeService wxCodeService;
|
||||
private final DocProductMapper docProductMapper;
|
||||
private final WxOrderService wxOrderService;
|
||||
private final WxService wxService;
|
||||
private final DocOrderService docOrderService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
* @param request 请求
|
||||
* @param response 响应
|
||||
* @return 用户信息
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/userinfo")
|
||||
public R<DocUserVo> userinfo(HttpServletRequest request, HttpServletResponse response){
|
||||
DocUserVo docUserVo = LoginObject.getLoginObject(DocUserVo.class);
|
||||
if(docUserVo==null){
|
||||
return R.fail("会话过期");
|
||||
}
|
||||
docOrderMapper.delete(new LambdaQueryWrapper<DocOrder>().eq(DocOrder::getUid,docUserVo.getUid())
|
||||
.eq(DocOrder::getStatus,0)
|
||||
.le(DocOrder::getCtime,DateUtil.getAddDate(new Date(),0,0,0,1,0,0,0))
|
||||
);
|
||||
List<DocOrderVo> orderVos= docOrderMapper.selectVoList(new LambdaQueryWrapper<DocOrder>()
|
||||
.eq(DocOrder::getUid,docUserVo.getUid())
|
||||
.eq(DocOrder::getStatus, 1)
|
||||
.orderByAsc(DocOrder::getCtime));
|
||||
//根据付款时间,计算累计的VIP天数
|
||||
|
||||
Date expireTime=docUserVo.getCtime();
|
||||
for (DocOrderVo docOrderVo : orderVos) {
|
||||
//判断订单时间,是否大于 到期时间
|
||||
if(docOrderVo.getCtime().after(expireTime)){
|
||||
expireTime=docOrderVo.getCtime();
|
||||
}
|
||||
String day= docConfigMapper.selectByKey(docOrderVo.getProdId());
|
||||
if(day==null){
|
||||
day="0";
|
||||
}
|
||||
expireTime=DateUtil.getAddDate(expireTime,0,0, Integer.parseInt(day),0,0,0,0);
|
||||
}
|
||||
|
||||
if(!new Date().after(expireTime)){
|
||||
docUserVo.setType("vip");
|
||||
docUserVo.setVip_date(expireTime);
|
||||
}else {
|
||||
docUserVo.setVip_date(DateUtil.getStrToDate("2025-01-01 00:00:00"));
|
||||
docUserVo.setType("usr");
|
||||
}
|
||||
|
||||
return R.success(docUserVo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 登录二维码
|
||||
* @return 二维码
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/oauth-authorize")
|
||||
public R<Map<String,String>> oauthAuthorize(){
|
||||
Map<String,String> data= new HashMap<>();
|
||||
String state=RandomUtil.getRandomUUID();
|
||||
String codeUrl= wxCodeService.getCode(new WxCodeBo(state)
|
||||
.typeDocLogin()
|
||||
.expireTime(1000*60)
|
||||
.paramData(state));
|
||||
data.put("url",codeUrl);
|
||||
data.put("state",state);
|
||||
return R.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录二维码轮询
|
||||
* @param bo 请求
|
||||
* @return 登录状态
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/oauth-polling")
|
||||
public R<Map<String,String>> oauthPolling(@RequestBody MyRequest bo,HttpServletRequest request, HttpServletResponse response){
|
||||
String state = bo.getState();
|
||||
|
||||
Map<String,String> data= new HashMap<>();
|
||||
data.put("status","0");
|
||||
if(state==null){
|
||||
return R.fail("state不能为空!");
|
||||
}
|
||||
//登录二维码
|
||||
WxCodeBo wxCodeBo= wxCodeService.getCodeState(new WxCodeBo(state).typeDocLogin());
|
||||
if(Objects.equals(wxCodeBo.getState(), WxCodeStatusEnum.SUCCEED.getValue())){
|
||||
log.info(wxCodeBo.getOpenId());
|
||||
DocUser vo= docUserService.bindingOpenId(wxCodeBo.getOpenId());
|
||||
data.put("status","1");
|
||||
String address= AddressUtil.getCityInfo(IPUtil.getIp(request));
|
||||
docUserService.updateLoginById(vo.getOpenId(),address);
|
||||
String token = LoginObject.loginToken(vo.getUid(), DeviceEnum.PC.getType(), 10000000L, "id", vo.getUid());
|
||||
RedisUtil.setCacheObject(RedisConstant.PC_KEY+vo.getUid(),vo, Duration.ofSeconds(10000000L));
|
||||
//data.put("token",token);
|
||||
CookieUtil.setCookie(response,"docToken",token,1000*60*60*24*7);
|
||||
}
|
||||
return R.success(data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
* @param request 请求
|
||||
* @return 商品列表
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/product-list")
|
||||
public R<Map<String,Object>> productList(HttpServletRequest request){
|
||||
String uid= LoginObject.getLoginId();
|
||||
List<DocProduct> docProducts= docProductMapper.selectList(new LambdaQueryWrapper<DocProduct>().eq(DocProduct::getStatus,1).orderByAsc(DocProduct::getSort));
|
||||
Map<String,Object> endData= new HashMap<>();
|
||||
List<Map<String,String>> data= new ArrayList<>();
|
||||
for (DocProduct docProduct : docProducts) {
|
||||
Map<String,String> map= new HashMap<>();
|
||||
map.put("prod_id",docProduct.getProdId());
|
||||
map.put("prod_name",docProduct.getProdName());
|
||||
map.put("unit_price",docProduct.getUnitPrice());
|
||||
map.put("mark_price",docProduct.getMarkPrice());
|
||||
map.put("intro",docProduct.getType());
|
||||
|
||||
DocUserVo docUserVo= docUserService.selectVoById(uid);
|
||||
if(docUserVo==null){
|
||||
return R.fail("会话过期");
|
||||
}
|
||||
Map<String,Object> orderInfo= new HashMap<>();
|
||||
orderInfo.put("openId",docUserVo.getOpenId());
|
||||
orderInfo.put("orderNo",System.currentTimeMillis()+"");
|
||||
orderInfo.put("productTitle",docProduct.getProdName());
|
||||
orderInfo.put("productId",docProduct.getProdId());
|
||||
orderInfo.put("productType",docProduct.getType());
|
||||
orderInfo.put("payPrice",docProduct.getUnitPrice());
|
||||
orderInfo.put("ip",IPUtil.getIp(request));
|
||||
orderInfo.put("tradeType", TradeType.NATIVE.getTradeType());
|
||||
orderInfo.put("mchId","");
|
||||
orderInfo.put("expireTime",System.currentTimeMillis()+1000*60*3);
|
||||
//获取当前请求域名
|
||||
String url=request.getHeader("Host");
|
||||
System.out.println("回调:"+url);
|
||||
orderInfo.put("notifyUrl","https://mmsadmin.cn/doc-api/meb/v1/payNotify");
|
||||
R<Object> r= wxOrderService.createPay(orderInfo);
|
||||
map.put("orderNo",orderInfo.get("orderNo").toString());
|
||||
map.put("buy_url",r.getData().toString());
|
||||
|
||||
docOrderService.create(docUserVo,orderInfo);
|
||||
|
||||
data.add(map);
|
||||
}
|
||||
endData.put("items",data);
|
||||
|
||||
return R.success(endData);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 付款状态轮询
|
||||
* @param request 请求
|
||||
* @return 登录状态
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/product-buy-qry")
|
||||
public R<Map<String,String>> productBuyQry(@RequestBody MyRequest bo,HttpServletRequest request){
|
||||
String orderNo = bo.getOrderNo();
|
||||
|
||||
Map<String,String> data= new HashMap<>();
|
||||
data.put("status","0");
|
||||
if(orderNo==null){
|
||||
return R.fail("prodId不能为空!");
|
||||
}
|
||||
data.put("status",docOrderService.selectPayState(orderNo,LoginObject.getLoginId()));
|
||||
return R.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/logout")
|
||||
public R<String> logout(HttpServletResponse response){
|
||||
StpUtil.logout();
|
||||
CookieUtil.setCookie(response,"token","",0);
|
||||
return R.success("退出成功!");
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 支付回调-官方微信
|
||||
// * @param req 请求
|
||||
// * @param resp 响应
|
||||
// * @param body 请求体
|
||||
// * @return 响应
|
||||
// */
|
||||
// @SaIgnore
|
||||
// @PostMapping("/notify")
|
||||
// public String notify(HttpServletRequest req, HttpServletResponse resp, @RequestBody String body){
|
||||
// WxPayOrderNotifyResult result = null;
|
||||
// try {
|
||||
// System.out.println("X=:" + body);
|
||||
// result = wxService.getWxPayService(TradeType.NATIVE.getTradeType()).parseOrderNotifyResult(body,TradeType.NATIVE.getTradeType());
|
||||
// // 结果正确 outTradeNo
|
||||
// log.warn("交易单号:" + result.getTransactionId());
|
||||
// log.warn("订单号:" + result.getOutTradeNo());
|
||||
// log.warn("付款金额:" + BaseWxPayResult.fenToYuan(result.getTotalFee()));
|
||||
//
|
||||
// if ("SUCCESS".equals(result.getResultCode())) {
|
||||
// log.warn("支付回调进来了:付款成功");
|
||||
// // 更新订单状态
|
||||
// // 更新库存
|
||||
// // 发送通知
|
||||
// // 发送邮件
|
||||
// // 发送短信
|
||||
// // 发送微信消息
|
||||
// docOrderService.updateByOrderNo(result.getTransactionId());
|
||||
// return "SUCCESS";
|
||||
// } else {
|
||||
// log.warn("支付回调进来了:付款失败");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error("商品支付报错了",e);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 微信支付WxPay
|
||||
* 异步通知
|
||||
*/
|
||||
@RequestMapping(value = "/payNotify", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
@ResponseBody
|
||||
@SaIgnore
|
||||
public String payNotify(HttpServletRequest request,@RequestBody String body) {
|
||||
log.info("支付通知=" + body);
|
||||
Map<String, String> params = WxPayKit.xmlToMap(body);
|
||||
|
||||
String returnCode = params.get("return_code");
|
||||
|
||||
// 注意重复通知的情况,同一订单号可能收到多次通知,请注意一定先判断订单状态
|
||||
// 注意此处签名方式需与统一下单的签名类型一致
|
||||
if (wxOrderService.verifyNotify(params)) {
|
||||
if (WxPayKit.codeIsOk(returnCode)) {
|
||||
// 更新订单信息
|
||||
Boolean state= docOrderService.updateByOrderNo(params.get("out_trade_no"),params.get("transaction_id"),params.get("mch_id"));
|
||||
// 发送通知等
|
||||
Map<String, String> xml = new HashMap<String, String>(2);
|
||||
xml.put("return_code", state?"SUCCESS":"FAIL");
|
||||
xml.put("return_msg", "OK");
|
||||
return WxPayKit.toXml(xml);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package com.sxpcwlkj.docApi.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档授权用户
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("doc_authorize_user")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DocAuthorizeUser extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String uid;
|
||||
/**
|
||||
* 授权平台
|
||||
*/
|
||||
private String chan;
|
||||
/**
|
||||
* 授权平台标识
|
||||
*/
|
||||
private String appid;
|
||||
/**
|
||||
* 授权平台用户ID
|
||||
*/
|
||||
private String openid;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.sxpcwlkj.docApi.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档配置
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("doc_config")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DocConfig extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* KEY
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private String value;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.sxpcwlkj.docApi.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档订单
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("doc_order")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DocOrder extends BaseEntity {
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@TableId
|
||||
private String orderId;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String uid;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal txnAmt;
|
||||
/**
|
||||
* 支付商户号
|
||||
*/
|
||||
private String payMchid;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String payNo;
|
||||
/**
|
||||
* 支付平台流水号
|
||||
*/
|
||||
private String transactionId;
|
||||
/**
|
||||
* 支付超时时间
|
||||
*/
|
||||
private String payTimeout;
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 产品价格
|
||||
*/
|
||||
private BigDecimal prodPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
private String prodType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.sxpcwlkj.docApi.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文档商品
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("doc_product")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DocProduct extends BaseEntity {
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@TableId
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 销售单价
|
||||
*/
|
||||
private String unitPrice;
|
||||
/**
|
||||
* 市场价格
|
||||
*/
|
||||
private String markPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String mtime;
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.sxpcwlkj.docApi.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档用户
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("doc_user")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DocUser extends BaseEntity {
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@TableId
|
||||
private String uid;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date mtime;
|
||||
/**
|
||||
* 微信ID
|
||||
*/
|
||||
private String openId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.sxpcwlkj.docApi.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.docApi.entity.DocAuthorizeUser;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档授权用户Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocAuthorizeUser.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocAuthorizeUserBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@NotBlank(message = "ID不能为空" ,groups = {ValidatedGroupConfig.update.class})
|
||||
private String id;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotBlank(message = "用户编号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String uid;
|
||||
/**
|
||||
* 授权平台
|
||||
*/
|
||||
@NotBlank(message = "授权平台不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String chan;
|
||||
/**
|
||||
* 授权平台标识
|
||||
*/
|
||||
@NotBlank(message = "授权平台标识不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String appid;
|
||||
/**
|
||||
* 授权平台用户ID
|
||||
*/
|
||||
@NotBlank(message = "授权平台用户ID不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String openid;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotNull(message = "创建时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotNull(message = "更新时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.sxpcwlkj.docApi.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.docApi.entity.DocConfig;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档配置Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocConfig.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocConfigBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@NotBlank(message = "ID不能为空" ,groups = {ValidatedGroupConfig.update.class})
|
||||
private String id;
|
||||
/**
|
||||
* KEY
|
||||
*/
|
||||
@NotBlank(message = "KEY不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String key;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@NotBlank(message = "值不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String value;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotNull(message = "创建时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotNull(message = "更新时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package com.sxpcwlkj.docApi.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.docApi.entity.DocOrder;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档订单Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocOrder.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocOrderBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@NotBlank(message = "订单编号不能为空" ,groups = {ValidatedGroupConfig.update.class})
|
||||
private String orderId;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotBlank(message = "用户编号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String uid;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
@NotNull(message = "订单金额不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private BigDecimal txnAmt;
|
||||
/**
|
||||
* 支付商户号
|
||||
*/
|
||||
@NotBlank(message = "支付商户号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String payMchid;
|
||||
/**
|
||||
* 支付平台流水号
|
||||
*/
|
||||
@NotBlank(message = "支付平台流水号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String payNo;
|
||||
/**
|
||||
* 支付超时时间
|
||||
*/
|
||||
@NotBlank(message = "支付超时时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String payTimeout;
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@NotBlank(message = "产品编号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@NotBlank(message = "产品名称不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String prodName;
|
||||
/**
|
||||
* 产品价格
|
||||
*/
|
||||
@NotNull(message = "产品价格不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private BigDecimal prodPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
@NotBlank(message = "产品类型不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String prodType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotBlank(message = "创建时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotBlank(message = "更新时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.sxpcwlkj.docApi.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.docApi.entity.DocProduct;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 文档商品Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocProduct.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocProductBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@NotBlank(message = "产品编号不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@NotBlank(message = "产品名称不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String prodName;
|
||||
/**
|
||||
* 销售单价
|
||||
*/
|
||||
@NotBlank(message = "销售单价不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String unitPrice;
|
||||
/**
|
||||
* 市场价格
|
||||
*/
|
||||
@NotBlank(message = "市场价格不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String markPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
@NotBlank(message = "产品类型不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotBlank(message = "创建时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotBlank(message = "更新时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String mtime;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.sxpcwlkj.docApi.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.docApi.entity.DocUser;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档用户Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = DocUser.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocUserBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotBlank(message = "用户编号不能为空" ,groups = {ValidatedGroupConfig.update.class})
|
||||
private String uid;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@NotBlank(message = "昵称不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String nickname;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@NotBlank(message = "头像不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String avatar;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@NotBlank(message = "用户类型不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@NotNull(message = "创建时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@NotNull(message = "更新时间不能为空" ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Date mtime;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.sxpcwlkj.docApi.entity.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author xijue
|
||||
*/
|
||||
@Data
|
||||
public class MyRequest {
|
||||
|
||||
private String state;
|
||||
|
||||
private String orderNo;
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.sxpcwlkj.docApi.entity.vo;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import com.sxpcwlkj.docApi.entity.DocAuthorizeUser;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档授权用户Vo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = DocAuthorizeUser.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocAuthorizeUserVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String uid;
|
||||
/**
|
||||
* 授权平台
|
||||
*/
|
||||
private String chan;
|
||||
/**
|
||||
* 授权平台标识
|
||||
*/
|
||||
private String appid;
|
||||
/**
|
||||
* 授权平台用户ID
|
||||
*/
|
||||
private String openid;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date mtime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.sxpcwlkj.docApi.entity.vo;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import com.sxpcwlkj.docApi.entity.DocConfig;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档配置Vo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = DocConfig.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocConfigVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* KEY
|
||||
*/
|
||||
private String key;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private String value;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date mtime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package com.sxpcwlkj.docApi.entity.vo;
|
||||
|
||||
|
||||
import com.sxpcwlkj.docApi.entity.DocOrder;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档订单Vo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = DocOrder.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocOrderVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String uid;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal txnAmt;
|
||||
/**
|
||||
* 支付商户号
|
||||
*/
|
||||
private String payMchid;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String payNo;
|
||||
/**
|
||||
* 支付平台流水号
|
||||
*/
|
||||
private String transactionId;
|
||||
/**
|
||||
* 支付超时时间
|
||||
*/
|
||||
private String payTimeout;
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 产品价格
|
||||
*/
|
||||
private BigDecimal prodPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
private String prodType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date mtime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package com.sxpcwlkj.docApi.entity.vo;
|
||||
|
||||
|
||||
import com.sxpcwlkj.docApi.entity.DocProduct;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 文档商品Vo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = DocProduct.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocProductVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
private String prodId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String prodName;
|
||||
/**
|
||||
* 销售单价
|
||||
*/
|
||||
private String unitPrice;
|
||||
/**
|
||||
* 市场价格
|
||||
*/
|
||||
private String markPrice;
|
||||
/**
|
||||
* 产品类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String mtime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.sxpcwlkj.docApi.entity.vo;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sxpcwlkj.common.utils.DateUtil;
|
||||
import com.sxpcwlkj.docApi.entity.DocUser;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文档用户Vo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = DocUser.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DocUserVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String uid;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date ctime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = DateUtil.DATE_TIME_PATTERN)
|
||||
private Date mtime;
|
||||
|
||||
private Date vip_date;
|
||||
|
||||
private String openId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.sxpcwlkj.docApi.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 接口返回错误码枚举
|
||||
*/
|
||||
public enum DefStaticEnum implements IEnum {
|
||||
|
||||
/**
|
||||
* 会员默认注册头像
|
||||
*/
|
||||
MEMBER_DEF_HEADER_IMG("MEMBER_DEF_HEADER_IMG","https://picsum.photos/30/30"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
@Getter
|
||||
private String key;
|
||||
private String value;
|
||||
|
||||
DefStaticEnum(String key, String value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.docApi.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docApi.entity.DocAuthorizeUser;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocAuthorizeUserVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 文档授权用户-Mapper
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DocAuthorizeUserMapper extends BaseMapperPlus<DocAuthorizeUser, DocAuthorizeUserVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.sxpcwlkj.docApi.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docApi.entity.DocConfig;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocConfigVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 文档配置-Mapper
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DocConfigMapper extends BaseMapperPlus<DocConfig, DocConfigVo> {
|
||||
|
||||
@Select("select COALESCE(c.value, 0) AS value from doc_config c left join doc_product p on c.`key`=p.code where p.prod_id=#{prodId}")
|
||||
String selectByKey(@Param("prodId") String prodId);
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.docApi.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docApi.entity.DocOrder;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocOrderVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 文档订单-Mapper
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DocOrderMapper extends BaseMapperPlus<DocOrder, DocOrderVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.docApi.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docApi.entity.DocProduct;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocProductVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 文档商品-Mapper
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DocProductMapper extends BaseMapperPlus<DocProduct, DocProductVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.docApi.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docApi.entity.DocUser;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocUserVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 文档用户-Mapper
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DocUserMapper extends BaseMapperPlus<DocUser, DocUserVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.sxpcwlkj.docApi.service;
|
||||
|
||||
import com.sxpcwlkj.docApi.entity.DocOrder;
|
||||
import com.sxpcwlkj.docApi.entity.bo.DocOrderBo;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocOrderVo;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocUserVo;
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档订单-接口
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
* @describe 支持自定义扩展,已继承接口:{insert、deleteById、updateById、selectById、getByEntityListPage}(更多查看BaseService接口)
|
||||
*/
|
||||
public interface DocOrderService extends BaseService<DocOrder, DocOrderVo, DocOrderBo> {
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
* @param docUserVo 用户信息
|
||||
* @param orderInfo 订单信息
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean create(DocUserVo docUserVo, Map<String, Object> orderInfo);
|
||||
|
||||
/**
|
||||
* 查询支付状态
|
||||
* @param orderId 订单编号
|
||||
* @param uid 用户编号
|
||||
* @return 支付状态
|
||||
*/
|
||||
String selectPayState(String orderId,String uid);
|
||||
|
||||
/**
|
||||
* 更新订单状态
|
||||
* @param outTradeNo 订单编号
|
||||
* @param transactionId 支付平台流水号
|
||||
* @param mchId 商户号
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean updateByOrderNo(String outTradeNo,String transactionId,String mchId);
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.sxpcwlkj.docApi.service;
|
||||
|
||||
import com.sxpcwlkj.docApi.entity.DocUser;
|
||||
import com.sxpcwlkj.docApi.entity.bo.DocUserBo;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocUserVo;
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档用户-接口
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
* @describe 支持自定义扩展,已继承接口:{insert、deleteById、updateById、selectById、getByEntityListPage}(更多查看BaseService接口)
|
||||
*/
|
||||
public interface DocUserService extends BaseService<DocUser, DocUserVo, DocUserBo> {
|
||||
|
||||
/**
|
||||
* 绑定openId
|
||||
* @param openId openId
|
||||
* @return 用户
|
||||
*/
|
||||
DocUser bindingOpenId(String openId);
|
||||
|
||||
Boolean updateLoginById(String openId, String address);
|
||||
}
|
||||
@ -0,0 +1,153 @@
|
||||
package com.sxpcwlkj.docApi.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docApi.entity.DocOrder;
|
||||
import com.sxpcwlkj.docApi.entity.bo.DocOrderBo;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocOrderVo;
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocUserVo;
|
||||
import com.sxpcwlkj.docApi.mapper.DocOrderMapper;
|
||||
import com.sxpcwlkj.docApi.service.DocOrderService;
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author shanpengnian
|
||||
*/
|
||||
@Slf4j
|
||||
@Transactional
|
||||
@Service("doc_order")
|
||||
@RequiredArgsConstructor
|
||||
public class DocOrderServiceImpl extends BaseServiceImpl<DocOrder, DocOrderVo, DocOrderBo> implements DocOrderService {
|
||||
|
||||
private final DocOrderMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<DocOrder, DocOrderVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(DocOrderBo bo) {
|
||||
try {
|
||||
int row;
|
||||
bo.setOrderId(null);
|
||||
DocOrder obj = MapstructUtil.convert(bo, DocOrder.class);
|
||||
assert obj != null;
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
bo.setOrderId(obj.getOrderId());
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档订单,insert 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable ids) {
|
||||
try {
|
||||
String[] array = DataUtil.getCatStr(ids.toString(), ",");
|
||||
return this.getBaseMapper().deleteByIds(new ArrayList<>(List.of(array)))>0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档订单,deleteById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(DocOrderBo bo) {
|
||||
try {
|
||||
int row;
|
||||
DocOrder obj = MapstructUtil.convert(bo, DocOrder.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档订单,updateById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocOrderVo selectVoById(Serializable id) {
|
||||
return this.getBaseMapper().selectVoById(id);
|
||||
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<DocOrderVo> selectListVoPage(DocOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DocOrder> lqw = buildQueryWrapper(bo);
|
||||
Page<DocOrderVo> page = baseMapper.selectVoPage(pageQuery.build(),lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<DocOrder> buildQueryWrapper(DocOrderBo query){
|
||||
if(query==null){
|
||||
query=new DocOrderBo();
|
||||
}
|
||||
LambdaQueryWrapper<DocOrder> wrapper = Wrappers.lambdaQuery();
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean create(DocUserVo docUserVo, Map<String, Object> orderInfo) {
|
||||
DocOrderBo docOrderBo= new DocOrderBo();
|
||||
docOrderBo.setUid(docUserVo.getUid());
|
||||
docOrderBo.setTxnAmt(new BigDecimal(orderInfo.get("payPrice").toString()));
|
||||
docOrderBo.setProdId(orderInfo.get("productId").toString());
|
||||
docOrderBo.setProdName(orderInfo.get("productTitle").toString());
|
||||
docOrderBo.setProdPrice(new BigDecimal(orderInfo.get("payPrice").toString()));
|
||||
docOrderBo.setProdType(orderInfo.get("productType").toString());
|
||||
docOrderBo.setStatus(0);
|
||||
docOrderBo.setPayNo(orderInfo.get("orderNo").toString());
|
||||
docOrderBo.setPayTimeout(orderInfo.get("expireTime").toString());
|
||||
docOrderBo.setCtime(new Date());
|
||||
docOrderBo.setMtime(new Date());
|
||||
|
||||
return this.insert(docOrderBo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectPayState(String orderNo,String uid) {
|
||||
DocOrder docOrder= baseMapper.selectOne(new LambdaQueryWrapper<DocOrder>()
|
||||
.eq(DocOrder::getPayNo,orderNo).eq(DocOrder::getUid,uid)
|
||||
.eq(DocOrder::getStatus,1)
|
||||
.orderByDesc(DocOrder::getCtime)
|
||||
);
|
||||
if(docOrder!=null){
|
||||
return "finish";
|
||||
}
|
||||
return "unpaid";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByOrderNo(String outTradeNo,String transactionId,String mchId) {
|
||||
DocOrder docOrder= baseMapper.selectOne(new LambdaQueryWrapper<DocOrder>()
|
||||
.eq(DocOrder::getPayNo,outTradeNo));
|
||||
if(docOrder!=null){
|
||||
docOrder.setStatus(1);
|
||||
docOrder.setMtime(new Date());
|
||||
docOrder.setTransactionId(transactionId);
|
||||
docOrder.setPayMchid(mchId);
|
||||
return baseMapper.updateById(docOrder)>0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,138 @@
|
||||
package com.sxpcwlkj.docApi.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.docApi.entity.DocUser;
|
||||
import com.sxpcwlkj.docApi.entity.bo.DocUserBo;
|
||||
|
||||
import com.sxpcwlkj.docApi.entity.vo.DocUserVo;
|
||||
import com.sxpcwlkj.docApi.enums.DefStaticEnum;
|
||||
import com.sxpcwlkj.docApi.mapper.DocUserMapper;
|
||||
import com.sxpcwlkj.docApi.service.DocUserService;
|
||||
import com.sxpcwlkj.docApi.utils.NicknameGenerator;
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 文档用户-接口实现
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Transactional
|
||||
@Service("doc_user")
|
||||
@RequiredArgsConstructor
|
||||
public class DocUserServiceImpl extends BaseServiceImpl<DocUser, DocUserVo,DocUserBo> implements DocUserService {
|
||||
|
||||
private final DocUserMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<DocUser, DocUserVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(DocUserBo bo) {
|
||||
try {
|
||||
int row;
|
||||
bo.setUid(null);
|
||||
DocUser obj = MapstructUtil.convert(bo, DocUser.class);
|
||||
assert obj != null;
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
bo.setUid(obj.getUid());
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档用户,insert 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable ids) {
|
||||
try {
|
||||
String[] array = DataUtil.getCatStr(ids.toString(), ",");
|
||||
return this.getBaseMapper().deleteByIds(new ArrayList<>(List.of(array)))>0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档用户,deleteById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(DocUserBo bo) {
|
||||
try {
|
||||
int row;
|
||||
DocUser obj = MapstructUtil.convert(bo, DocUser.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
} catch (Exception e) {
|
||||
log.error("文档用户,updateById 操作失败", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocUserVo selectVoById(Serializable id) {
|
||||
return this.getBaseMapper().selectVoById(id);
|
||||
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<DocUserVo> selectListVoPage(DocUserBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DocUser> lqw = buildQueryWrapper(bo);
|
||||
Page<DocUserVo> page = baseMapper.selectVoPage(pageQuery.build(),lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<DocUser> buildQueryWrapper(DocUserBo query){
|
||||
if(query==null){
|
||||
query=new DocUserBo();
|
||||
}
|
||||
LambdaQueryWrapper<DocUser> wrapper = Wrappers.lambdaQuery();
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocUser bindingOpenId(String openId) {
|
||||
DocUser docUser= baseMapper.selectOne(new LambdaQueryWrapper<DocUser>().eq(DocUser::getOpenId,openId));
|
||||
if(docUser!=null){
|
||||
return docUser;
|
||||
}else {
|
||||
docUser= new DocUser();
|
||||
docUser.setNickname(NicknameGenerator.generateRandomNickname());
|
||||
docUser.setType("usr");
|
||||
docUser.setAvatar(DefStaticEnum.MEMBER_DEF_HEADER_IMG.getValue());
|
||||
docUser.setCtime(new Date());
|
||||
docUser.setMtime(new Date());
|
||||
docUser.setOpenId(openId);
|
||||
baseMapper.insert(docUser);
|
||||
}
|
||||
return docUser;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateLoginById(String openId, String address) {
|
||||
DocUser docUser= baseMapper.selectOne(new LambdaQueryWrapper<DocUser>().eq(DocUser::getOpenId,openId));
|
||||
docUser.setMtime(new Date());
|
||||
docUser.setRemark(address);
|
||||
return baseMapper.updateById(docUser)>0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,105 @@
|
||||
package com.sxpcwlkj.docApi.utils;
|
||||
|
||||
|
||||
import com.sxpcwlkj.common.enums.HttpStatusEnum;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
/**
|
||||
* 返回结果集
|
||||
*
|
||||
* @author javadog
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DocR<T> {
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
*/
|
||||
|
||||
private String errno;
|
||||
|
||||
|
||||
/**
|
||||
* 返回信息
|
||||
*/
|
||||
|
||||
private String errmsg;
|
||||
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
|
||||
private T body;
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
private String host_time;
|
||||
|
||||
/**
|
||||
* 全参数方法
|
||||
* @param errno 状态
|
||||
* @param body 数据
|
||||
* @return 返回结果
|
||||
* @param <T> 泛型
|
||||
*/
|
||||
public static <T> DocR<T> response(String errno, String errmsg, T body) {
|
||||
DocR<T> ajaxResult = new DocR<>();
|
||||
ajaxResult.setErrno(errno);
|
||||
ajaxResult.setErrmsg(errmsg);
|
||||
ajaxResult.setBody(body);
|
||||
ajaxResult.setHost_time(System.currentTimeMillis()+"");
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功
|
||||
* @param body 数据
|
||||
* @return 返回结果
|
||||
* @param <T> 泛型
|
||||
*/
|
||||
public static <T> DocR<T> success(String errmsg, T body) {
|
||||
DocR<T> ajaxResult = new DocR<>();
|
||||
ajaxResult.setErrno("00000");
|
||||
ajaxResult.setErrmsg(errmsg);
|
||||
ajaxResult.setBody(body);
|
||||
ajaxResult.setHost_time(System.currentTimeMillis()+"");
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功 + OK
|
||||
* @param body 数据
|
||||
* @return 返回结果
|
||||
* @param <T> 泛型
|
||||
*/
|
||||
public static <T> DocR<T> ok( T body) {
|
||||
DocR<T> ajaxResult = new DocR<>();
|
||||
ajaxResult.setErrno("00000");
|
||||
ajaxResult.setErrmsg("OK");
|
||||
ajaxResult.setBody(body);
|
||||
ajaxResult.setHost_time(System.currentTimeMillis()+"");
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
public static <T> DocR<T> error(String errno, String errmsg) {
|
||||
DocR<T> ajaxResult = new DocR<>();
|
||||
ajaxResult.setErrno(errno);
|
||||
ajaxResult.setErrmsg(errmsg);
|
||||
ajaxResult.setHost_time(System.currentTimeMillis()+"");
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,68 @@
|
||||
package com.sxpcwlkj.docApi.utils;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.jwt.JWT;
|
||||
import cn.hutool.jwt.JWTHeader;
|
||||
import cn.hutool.jwt.JWTUtil;
|
||||
import jakarta.servlet.http.Cookie;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.hutool.core.lang.Singleton.put;
|
||||
|
||||
/**
|
||||
* @author shanpengnian
|
||||
*/
|
||||
@Slf4j
|
||||
public class JwtUtil {
|
||||
|
||||
private final String KEY= "4548912314JKJ85HT==";
|
||||
|
||||
public String getId(HttpServletRequest request){
|
||||
String cookie = getCookieValue(request,"token");
|
||||
if(cookie!=null){
|
||||
if (StrUtil.isBlank(cookie) || cookie.split("\\.").length != 3) {
|
||||
log.error("无效的JWT格式: " + cookie);
|
||||
return "-1";
|
||||
}
|
||||
boolean verify = JWTUtil.verify(cookie, KEY.getBytes());
|
||||
if(verify){
|
||||
final JWT jwt = JWTUtil.parseToken(cookie);
|
||||
jwt.getHeader(JWTHeader.TYPE);
|
||||
return jwt.getPayload("id").toString();
|
||||
}
|
||||
}
|
||||
return "-1";
|
||||
}
|
||||
|
||||
public String createToken(String id){
|
||||
Map<String, Object> map = new HashMap<String, Object>() {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
{
|
||||
put("id", id);
|
||||
put("expire_time", System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 7);
|
||||
}
|
||||
};
|
||||
|
||||
return JWTUtil.createToken(map, KEY.getBytes());
|
||||
}
|
||||
|
||||
public String getCookieValue(HttpServletRequest request, String key) {
|
||||
Cookie[] cookies = request.getCookies();
|
||||
if (cookies != null) {
|
||||
for (Cookie cookie : cookies) {
|
||||
if (key.equals(cookie.getName())) {
|
||||
return cookie.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.sxpcwlkj.docApi.utils;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @author shanpengnian
|
||||
*/
|
||||
public class NicknameGenerator {
|
||||
// 形容词列表(可自行扩展)
|
||||
private static final String[] ADJECTIVES = {
|
||||
"快乐的", "神秘的", "勇敢的", "聪明的", "优雅的", "顽皮的", "阳光的", "冷静的",
|
||||
"热情的", "幽默的", "勤奋的", "温柔的", "机灵的", "威武的", "浪漫的", "潇洒的"
|
||||
};
|
||||
|
||||
// 名词列表(可自行扩展)
|
||||
private static final String[] NOUNS = {
|
||||
"熊猫", "狮子", "猎豹", "海豚", "雄鹰", "狐狸", "鲨鱼", "老虎",
|
||||
"飞鸟", "骏马", "天鹅", "鲸鱼", "蝴蝶", "狼", "孔雀", "凤凰"
|
||||
};
|
||||
|
||||
public static String generateRandomNickname() {
|
||||
Random random = new Random();
|
||||
|
||||
// 随机选择形容词和名词
|
||||
String adjective = ADJECTIVES[random.nextInt(ADJECTIVES.length)];
|
||||
String noun = NOUNS[random.nextInt(NOUNS.length)];
|
||||
|
||||
// 随机生成2-4位数字(可选部分)// 0-2的随机数决定是否添加数字
|
||||
int numberSuffix = random.nextInt(3);
|
||||
StringBuilder nickname = new StringBuilder(adjective + noun);
|
||||
// 50%概率添加数字
|
||||
if (numberSuffix > 0) {
|
||||
// 2-4位数字
|
||||
int digitCount = random.nextInt(3) + 2;
|
||||
for (int i = 0; i < digitCount; i++) {
|
||||
// 添加0-9的随机数字
|
||||
nickname.append(random.nextInt(10));
|
||||
}
|
||||
}
|
||||
|
||||
return nickname.toString();
|
||||
}
|
||||
|
||||
// 测试方法
|
||||
public static void main(String[] args) {
|
||||
// 生成10个示例昵称
|
||||
for (int i = 0; i < 10; i++) {
|
||||
System.out.println(generateRandomNickname());
|
||||
}
|
||||
}
|
||||
}
|
||||
139
mms-docs/mms-doc-api/src/main/resources/application-dev.yml
Normal file
139
mms-docs/mms-doc-api/src/main/resources/application-dev.yml
Normal file
@ -0,0 +1,139 @@
|
||||
--- # powerjob 配置
|
||||
powerjob:
|
||||
worker:
|
||||
# 如何开启调度中心请查看文档教程
|
||||
enabled: false
|
||||
# 需要先在 powerjob 登录页执行应用注册后才能使用
|
||||
app-name: mms
|
||||
max-appended-wf-context-length: 4096
|
||||
max-result-length: 4096
|
||||
# 28080 端口 随着主应用端口飘逸 避免集群冲突
|
||||
port: 2${server.port}
|
||||
protocol: http
|
||||
server-address: 127.0.0.1:7700
|
||||
store-strategy: disk
|
||||
|
||||
|
||||
--- # Spring Boot Admin
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
enabled: false #启用/禁用
|
||||
instance:
|
||||
service-host-type: IP
|
||||
# Spring Boot Admin
|
||||
url: http://localhost:9001 #监控服务器端地址
|
||||
username: admin #账号
|
||||
password: 123456 #密码
|
||||
|
||||
--- #配置项目的数据源 https://www.kancloud.cn/tracy5546/dynamic-datasource/2344619
|
||||
--- # 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
dynamic:
|
||||
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
||||
p6spy: true
|
||||
# 设置默认的数据源或者数据源组,默认值即为 master
|
||||
primary: master
|
||||
# 严格模式 匹配不到数据源则报错
|
||||
strict: true
|
||||
public-key: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJssgtfcBfc+d8Et0FBGQRBonRRQBD8jB1UHTRbk3diOliGlec9lJxbGR/qp7Jp8uYozCr96lvpnIIJM59fNoeUCAwEAAQ==
|
||||
# 账号密码
|
||||
datasource:
|
||||
# 主库数据源
|
||||
master:
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://119.28.10.247:3306/mms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
username: mms
|
||||
# 由GeneratePassword.java 生成, public-key 和 password 要匹配
|
||||
password: ENC(c6FYwkk1dtKxfAcOED4g4mAgzCoK6XTr6+VTXVfQYly9I02yiND8aK5vTeYJ+oJCGH4beQyZLl9H2kt1ZCXqJg==)
|
||||
|
||||
# 从库数据源
|
||||
slave:
|
||||
lazy: true
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://119.28.10.247:3306/mms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
username: mms
|
||||
# 由GeneratePassword.java 生成, public-key 和 password 要匹配
|
||||
password: ENC(c6FYwkk1dtKxfAcOED4g4mAgzCoK6XTr6+VTXVfQYly9I02yiND8aK5vTeYJ+oJCGH4beQyZLl9H2kt1ZCXqJg==)
|
||||
|
||||
# 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:
|
||||
data:
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
database: 0
|
||||
password: 123456
|
||||
timeout: 100s
|
||||
ssl:
|
||||
enabled: false
|
||||
|
||||
--- # Redis 扩展工具
|
||||
redisson:
|
||||
# redis key前缀
|
||||
keyPrefix:
|
||||
# 线程池数量
|
||||
threads: 4
|
||||
# Netty线程池数量
|
||||
nettyThreads: 8
|
||||
# 单节点配置
|
||||
singleServerConfig:
|
||||
# 客户端名称
|
||||
clientName: ${sxpcwlkj.name}
|
||||
# 最小空闲连接数
|
||||
connectionMinimumIdleSize: 8
|
||||
# 连接池大小
|
||||
connectionPoolSize: 32
|
||||
# 连接空闲超时,单位:毫秒
|
||||
idleConnectionTimeout: 10000
|
||||
# 命令等待超时,单位:毫秒
|
||||
timeout: 3000
|
||||
# 发布和订阅连接池大小
|
||||
subscriptionConnectionPoolSize: 50
|
||||
|
||||
wx:
|
||||
doc:
|
||||
payNotify: https://mmsadmin.cn/doc-api/meb/v1/payNotify
|
||||
133
mms-docs/mms-doc-api/src/main/resources/application-local.yml
Normal file
133
mms-docs/mms-doc-api/src/main/resources/application-local.yml
Normal file
@ -0,0 +1,133 @@
|
||||
--- # powerjob 配置
|
||||
powerjob:
|
||||
worker:
|
||||
# 如何开启调度中心请查看文档教程
|
||||
enabled: false
|
||||
# 需要先在 powerjob 登录页执行应用注册后才能使用
|
||||
app-name: mms
|
||||
max-appended-wf-context-length: 4096
|
||||
max-result-length: 4096
|
||||
# 28080 端口 随着主应用端口飘逸 避免集群冲突
|
||||
port: 2${server.port}
|
||||
protocol: http
|
||||
server-address: 127.0.0.1:7700
|
||||
store-strategy: disk
|
||||
|
||||
--- # Spring Boot Admin
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
enabled: false #启用/禁用
|
||||
instance:
|
||||
service-host-type: IP
|
||||
# Spring Boot Admin
|
||||
url: http://localhost:9001 #监控服务器端地址
|
||||
username: admin #账号
|
||||
password: 123456 #密码
|
||||
|
||||
--- #配置项目的数据源 https://www.kancloud.cn/tracy5546/dynamic-datasource/2344619
|
||||
--- # 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
dynamic:
|
||||
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
||||
p6spy: true
|
||||
# 设置默认的数据源或者数据源组,默认值即为 master
|
||||
primary: master
|
||||
# 严格模式 匹配不到数据源则报错
|
||||
strict: true
|
||||
datasource:
|
||||
# 主库数据源
|
||||
master:
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/mms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: 123456
|
||||
# 从库数据源
|
||||
slave:
|
||||
lazy: true
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/mms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: 123456
|
||||
# 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:
|
||||
data:
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
database: 0
|
||||
password: 123456
|
||||
timeout: 100s
|
||||
ssl:
|
||||
enabled: false
|
||||
|
||||
--- # Redis 扩展工具
|
||||
redisson:
|
||||
# redis key前缀
|
||||
keyPrefix:
|
||||
# 线程池数量
|
||||
threads: 4
|
||||
# Netty线程池数量
|
||||
nettyThreads: 8
|
||||
# 单节点配置
|
||||
singleServerConfig:
|
||||
# 客户端名称
|
||||
clientName: ${sxpcwlkj.name}
|
||||
# 最小空闲连接数
|
||||
connectionMinimumIdleSize: 8
|
||||
# 连接池大小
|
||||
connectionPoolSize: 32
|
||||
# 连接空闲超时,单位:毫秒
|
||||
idleConnectionTimeout: 10000
|
||||
# 命令等待超时,单位:毫秒
|
||||
timeout: 3000
|
||||
# 发布和订阅连接池大小
|
||||
subscriptionConnectionPoolSize: 50
|
||||
|
||||
|
||||
wx:
|
||||
doc:
|
||||
payNotify: https://mmsadmin.cn/doc-api/meb/v1/payNotify
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user