mirror of
https://gitee.com/mmsAdmin/mms
synced 2025-12-06 08:58:55 +08:00
优化
This commit is contained in:
parent
fc86e47a8f
commit
252a14d47d
103
mms-admin/.gitignore
vendored
Normal file
103
mms-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-admin/Dockerfile
Normal file
27
mms-admin/Dockerfile
Normal file
@ -0,0 +1,27 @@
|
||||
#FROM findepi/graalvm:java17-native
|
||||
FROM openjdk:17.0.2-oraclelinux8
|
||||
|
||||
MAINTAINER SXPCWLKJ
|
||||
|
||||
RUN mkdir -p /sxpcwlkj \
|
||||
/sxpcwlkj/mms-admin \
|
||||
/sxpcwlkj/mms-admin/logs \
|
||||
/sxpcwlkj/mms-admin/files \
|
||||
/sxpcwlkj/mms-admin/temp \
|
||||
/sxpcwlkj/mms-admin/skywalking/agent
|
||||
|
||||
WORKDIR /sxpcwlkj/mms-admin
|
||||
|
||||
ENV SERVER_PORT=8080 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
|
||||
|
||||
EXPOSE ${SERVER_PORT}
|
||||
|
||||
ADD ./target/mms-system.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}
|
||||
|
||||
21
mms-admin/LICENSE
Normal file
21
mms-admin/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.
|
||||
103
mms-admin/pom.xml
Normal file
103
mms-admin/pom.xml
Normal file
@ -0,0 +1,103 @@
|
||||
<?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</artifactId>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>mms-admin</artifactId>
|
||||
<description>后台系统模块</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 低代码生产 -->
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-gen</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-email</artifactId>
|
||||
</dependency>
|
||||
<!--redis模块-->
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-redis</artifactId>
|
||||
</dependency>
|
||||
<!--微信模块-->
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-wx</artifactId>
|
||||
</dependency>
|
||||
<!--阿里云模块-->
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-aliyun</artifactId>
|
||||
</dependency>
|
||||
<!--AI模块-->
|
||||
<dependency>
|
||||
<groupId>com.sxpcwlkj</groupId>
|
||||
<artifactId>mms-ai</artifactId>
|
||||
</dependency>
|
||||
<!-- adminMall模块-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.sxpcwlkj</groupId>-->
|
||||
<!-- <artifactId>mms-admin-mall</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 xijue
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@Slf4j
|
||||
@EnableAspectJAutoProxy(exposeProxy = true)
|
||||
@MapperScan(basePackages = {"com.sxpcwlkj.**.mapper"})
|
||||
@EnableFileStorage
|
||||
public class MmsAdminApplication {
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(MmsAdminApplication.class, args);
|
||||
Environment env = applicationContext.getEnvironment();
|
||||
System.out.println("后端: 系统启动成功,当前环境为: " + 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"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
22
mms-admin/src/main/java/com/sxpcwlkj/ServletInitializer.java
Normal file
22
mms-admin/src/main/java/com/sxpcwlkj/ServletInitializer.java
Normal file
@ -0,0 +1,22 @@
|
||||
package com.sxpcwlkj;
|
||||
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
/**
|
||||
* 自定义Web容器配置
|
||||
*
|
||||
* @name: ServletInitializer
|
||||
* @author: 西决
|
||||
* @date: 2022/12/01
|
||||
**/
|
||||
|
||||
public class ServletInitializer extends SpringBootServletInitializer {
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
|
||||
return application.sources(MmsAdminApplication.class);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.sxpcwlkj.system.config;
|
||||
|
||||
import cn.dev33.satoken.stp.StpInterface;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.system.entity.vo.SysRoleVo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysUserVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自定义权限加载接口实现类
|
||||
* 保证此类被 SpringBoot 扫描,完成 Sa-Token 的自定义权限验证扩展
|
||||
* @author xijue
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SaTokenStpInterfaceImpl implements StpInterface {
|
||||
|
||||
/**
|
||||
* 返回一个账号所拥有的权限码集合
|
||||
* @param loginId:账号id
|
||||
* @param loginType:账号体系标识
|
||||
*/
|
||||
@Override
|
||||
public List<String> getPermissionList(Object loginId, String loginType) {
|
||||
// 本 list 仅做模拟,实际项目中要根据具体业务逻辑来查询权限
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
SysUserVo sysUserVo = LoginObject.getLoginObject(SysUserVo.class);
|
||||
assert sysUserVo != null;
|
||||
List<SysRoleVo> roleVoList = sysUserVo.getRoleVoList();
|
||||
for (SysRoleVo r:roleVoList) {
|
||||
list.addAll(Arrays.asList(r.getPermissions()));
|
||||
}
|
||||
|
||||
Console.log(list.toString());
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回一个账号所拥有的角色标识集合 (权限与角色可分开校验)
|
||||
* @param loginId:账号id
|
||||
* @param loginType:账号体系标识
|
||||
*/
|
||||
@Override
|
||||
public List<String> getRoleList(Object loginId, String loginType) {
|
||||
// 本 list 仅做模拟,实际项目中要根据具体业务逻辑来查询角色
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
SysUserVo userVo = LoginObject.getLoginObject(SysUserVo.class);
|
||||
SysUserVo sysUserVo = MapstructUtil.convert(userVo, SysUserVo.class);
|
||||
assert sysUserVo != null;
|
||||
String[] roleCodes = sysUserVo.getRoleCodes();
|
||||
list= Arrays.asList(roleCodes);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,88 @@
|
||||
package com.sxpcwlkj.system.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
|
||||
import com.sxpcwlkj.common.constant.Constants;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.framework.sercice.SysSignService;
|
||||
import com.sxpcwlkj.redis.RedisUtil;
|
||||
import com.sxpcwlkj.redis.constant.RedisConstant;
|
||||
import com.sxpcwlkj.system.entity.bo.LoginBodyBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysUserVo;
|
||||
import com.sxpcwlkj.system.service.SysLoginService;
|
||||
import com.sxpcwlkj.system.service.SysUserService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
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 java.time.Duration;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 系统登录
|
||||
* @author xijue
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("system/auth")
|
||||
public class AuthController extends BaseController {
|
||||
|
||||
private final SysLoginService loginService;
|
||||
private final SysUserService sysUserService;
|
||||
private final SysSignService sysSignService;
|
||||
|
||||
|
||||
/**
|
||||
* 登录方法
|
||||
* @param loginBodyBo 登录参数
|
||||
* @return 登录结果
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/login")
|
||||
public R<Map<String, Object>> login(@Validated @RequestBody LoginBodyBo loginBodyBo,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Map<String, Object> ajax = new HashMap<>(16);
|
||||
// 生成令牌
|
||||
String token = loginService.login(request,loginBodyBo);
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
SysUserVo sysUser = sysUserService.getUserRoleAnfFunctionInfo(LoginObject.getLoginId());
|
||||
RedisUtil.setCacheObject(RedisConstant.ADMIN_TENANT_KEY+sysUser.getUserId(),sysUser.getTenantId(), Duration.ofHours(24));
|
||||
RedisUtil.setCacheObject(RedisConstant.ADMIN_KEY+sysUser.getUserId(),sysUser, Duration.ofHours(24));
|
||||
ajax.put(Constants.USERINFO, sysUserService.getUserInfo(sysUser));
|
||||
if(LoginObject.isLogin()){
|
||||
//给浏览器端设置一个 Cookie 的 clientKey值 3天
|
||||
sysSignService.loginSetCookie(request,response,1000*60*60*24*3);
|
||||
}
|
||||
return success(ajax);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
* @return 退出结果
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/logout")
|
||||
public R<String> logout() {
|
||||
loginService.logout();
|
||||
return success("退出成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.sxpcwlkj.system.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.code.entity.CaptchaEntity;
|
||||
import com.sxpcwlkj.common.properties.MsProperties;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.system.service.CaptchaService;
|
||||
import com.sxpcwlkj.system.service.SysTenantService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 验证码处理类
|
||||
* @author xijue
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("system/visitor")
|
||||
public class CaptchaController extends BaseController {
|
||||
private final SysTenantService sysTenantService;
|
||||
private final CaptchaService captchaService;
|
||||
private final MsProperties msProperties;
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/sysInfo")
|
||||
public R<Map<String,Object>> sysInfo() {
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("sysInfo",msProperties);
|
||||
map.put("tenantList",sysTenantService.selectOpenList());
|
||||
return success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录验证码
|
||||
*
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/{code}")
|
||||
public R<Object> captcha(@PathVariable String code) {
|
||||
|
||||
if(StringUtils.isEmpty(code)){
|
||||
return R.fail("缺少验证[code]参数");
|
||||
}
|
||||
Map<String, Object> ajax = captchaService.getCaptcha(CaptchaEntity.TYPE.系统登录.getValue(), code);
|
||||
DataUtil.getString(ajax.get(CaptchaEntity.CODE.CAPTCHA.getValue()));
|
||||
return R.success(ajax);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,350 @@
|
||||
package com.sxpcwlkj.system.controller;
|
||||
import com.sxpcwlkj.common.code.entity.WxCodeBo;
|
||||
import com.sxpcwlkj.common.constant.Constants;
|
||||
import com.sxpcwlkj.common.enums.DeviceEnum;
|
||||
import com.sxpcwlkj.common.enums.WxCodeStatusEnum;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.framework.sercice.SysSignService;
|
||||
import com.sxpcwlkj.redis.constant.RedisConstant;
|
||||
import com.sxpcwlkj.system.entity.SysUser;
|
||||
import com.sxpcwlkj.system.service.SysLoginService;
|
||||
import com.sxpcwlkj.wx.service.WxCodeService;
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.code.entity.ConfigEntity;
|
||||
import com.sxpcwlkj.common.enums.ConfigKeyNum;
|
||||
import com.sxpcwlkj.common.enums.SystemCommonEnum;
|
||||
import com.sxpcwlkj.common.exception.MmsException;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.email.service.EmailService;
|
||||
import com.sxpcwlkj.common.utils.IPUtil;
|
||||
import com.sxpcwlkj.redis.RedisUtil;
|
||||
import com.sxpcwlkj.sms.service.SmsService;
|
||||
import com.sxpcwlkj.system.entity.AdminMenuTree;
|
||||
import com.sxpcwlkj.system.entity.bo.EmailBo;
|
||||
import com.sxpcwlkj.system.entity.bo.SmsBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysUserVo;
|
||||
import com.sxpcwlkj.system.service.SysDictService;
|
||||
import com.sxpcwlkj.system.service.SysUserService;
|
||||
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.core.env.Environment;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* mms公共接口
|
||||
* @author xijue
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@RequestMapping("common")
|
||||
public class CommonController extends BaseController {
|
||||
private final SmsService smsService;
|
||||
private final EmailService emailService;
|
||||
private final SysUserService sysUserService;
|
||||
private final SysLoginService sysLoginService;
|
||||
private final Environment environment;
|
||||
private final SysDictService sysDictService;
|
||||
private final WxCodeService wxCodeService;
|
||||
private final SysSignService sysSignService;
|
||||
|
||||
@Value("${server.port}")
|
||||
private String port;
|
||||
/**
|
||||
* 获取系统基础配置
|
||||
*/
|
||||
@PostMapping("/startBase")
|
||||
@SaIgnore
|
||||
public R<Object> startBase(HttpServletRequest request, HttpServletResponse response,String key){
|
||||
List<ConfigEntity> convert = RedisUtil.getCacheList(ConfigKeyNum.config_base.getKey());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(convert.isEmpty()){
|
||||
List<String> list=new ArrayList<>();
|
||||
list.add("1");
|
||||
map.put("loginType",list);
|
||||
}
|
||||
convert.forEach(smsConfigEntity -> {
|
||||
if("sys_base_title".equals(smsConfigEntity.getConfigKey())){
|
||||
map.put("globalTitle",smsConfigEntity.getConfigValue());
|
||||
}
|
||||
if("sys_base_description".equals(smsConfigEntity.getConfigKey())){
|
||||
map.put("globalDescription",smsConfigEntity.getConfigValue());
|
||||
}
|
||||
if("sys_base_logo".equals(smsConfigEntity.getConfigKey())){
|
||||
map.put("logo",smsConfigEntity.getConfigValue());
|
||||
}
|
||||
if("sys_base_captcha_state".equals(smsConfigEntity.getConfigKey())){
|
||||
map.put("captchaState", Objects.equals(Convert.toInt(smsConfigEntity.getConfigValue()), SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue()));
|
||||
}
|
||||
if("sys_base_login_type".equals(smsConfigEntity.getConfigKey())){
|
||||
map.put("loginType", DataUtil.getStringToList(smsConfigEntity.getConfigValue()));
|
||||
}
|
||||
if("sys_base_tenant_state".equals(smsConfigEntity.getConfigKey())){
|
||||
map.put("tenantState", Convert.toInt(smsConfigEntity.getConfigValue()) == 1);
|
||||
}
|
||||
if("sys_base_login_bg".equals(smsConfigEntity.getConfigKey())){
|
||||
map.put("loginBg",smsConfigEntity.getConfigValue());
|
||||
}
|
||||
if("sys_base_tenant_exclusion_table".equals(smsConfigEntity.getConfigKey())){
|
||||
map.put("tenantExclusionTable", DataUtil.getStringToList(smsConfigEntity.getConfigValue()));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return R.success("base system config.",map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取二维码
|
||||
* @param key 二维码key
|
||||
* @return 二维码
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/getWxCode")
|
||||
public R<Object> getWxCode(String key) {
|
||||
if(key==null){
|
||||
return R.fail("key不能为空!");
|
||||
}
|
||||
//登录二维码
|
||||
String codeUrl= wxCodeService.getCode(new WxCodeBo(key)
|
||||
.typeLogin()
|
||||
.paramData(key));
|
||||
return success("二维码获取成功",codeUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询二维码状态
|
||||
* @param key 二维码key
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/queryWxCodeState")
|
||||
public R<Object> queryWxCodeState(String key,HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
if(key==null){
|
||||
return R.fail("key不能为空!");
|
||||
}
|
||||
//登录二维码
|
||||
WxCodeBo wxCodeBo= wxCodeService.getCodeState(new WxCodeBo(key).typeLogin());
|
||||
if(Objects.equals(wxCodeBo.getState(), WxCodeStatusEnum.WAITING.getValue())){
|
||||
return fail("等待扫码中...");
|
||||
}
|
||||
if(Objects.equals(wxCodeBo.getState(), WxCodeStatusEnum.SCANNED.getValue())){
|
||||
return okFail("二维码已被扫!");
|
||||
}
|
||||
if(Objects.equals(wxCodeBo.getState(), WxCodeStatusEnum.FAILING.getValue())){
|
||||
return okFail("扫码失败!");
|
||||
}
|
||||
if(Objects.equals(wxCodeBo.getState(), WxCodeStatusEnum.SUCCEED.getValue())){
|
||||
log.info(wxCodeBo.getOpenId());
|
||||
SysUserVo sysUserVo= sysUserService.selectOpenId(wxCodeBo.getOpenId());
|
||||
if(sysUserVo==null){
|
||||
return okFail("该微信未绑定账号!");
|
||||
}
|
||||
if(!Objects.equals(sysUserVo.getStatus(), SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue())){
|
||||
return okFail("该账号已被禁用!");
|
||||
}
|
||||
//进行登记登记
|
||||
SysUser user = MapstructUtil.convert(sysUserVo, SysUser.class);
|
||||
sysLoginService.updateSysUser(request,user);
|
||||
// 获取当前会话的token值
|
||||
assert user != null;
|
||||
String token = LoginObject.loginToken(user.getUserId(), DeviceEnum.ADMIN.getType(), 10000000L, "id", user.getUserId());
|
||||
Map<String, Object> ajax = new HashMap<>(16);
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
SysUserVo sysUser = sysUserService.getUserRoleAnfFunctionInfo(LoginObject.getLoginId());
|
||||
ajax.put(Constants.USERINFO, sysUserService.getUserInfo(sysUser));
|
||||
RedisUtil.setCacheObject(RedisConstant.ADMIN_KEY+sysUser.getUserId(),sysUser, Duration.ofHours(24));
|
||||
if(LoginObject.isLogin()){
|
||||
//给浏览器端设置一个 Cookie 的 clientKey值 3天
|
||||
sysSignService.loginSetCookie(request,response,1000*60*60*24*3);
|
||||
}
|
||||
return success(ajax);
|
||||
}
|
||||
return R.fail("系统异常!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
* @param bo 验证码业务对象
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/smsCode")
|
||||
public R<Object> smsCode(@RequestBody SmsBo bo, HttpServletRequest request) {
|
||||
|
||||
Integer type = bo.getType();
|
||||
String phone = bo.getPhone();
|
||||
|
||||
String keytype = "register:";
|
||||
if (type == 1) {
|
||||
keytype = "register:";
|
||||
}
|
||||
if (type == 2) {
|
||||
List<ConfigEntity> convert = RedisUtil.getCacheList(ConfigKeyNum.config_base.getKey());
|
||||
for (ConfigEntity smsConfigEntity : convert) {
|
||||
if("sys_base_login_type".equals(smsConfigEntity.getConfigKey())){
|
||||
List<String> toList = DataUtil.getStringToList(smsConfigEntity.getConfigValue());
|
||||
if(toList.contains("1")){
|
||||
return R.fail("当前系统不支持手机号登录!");
|
||||
}
|
||||
}
|
||||
}
|
||||
keytype = "login:";
|
||||
}
|
||||
if (type == 3) {
|
||||
keytype = "password:";
|
||||
}
|
||||
if (type == 4) {
|
||||
keytype = "passwordPay:";
|
||||
}
|
||||
if (type == 5) {
|
||||
keytype = "updatePhone:";
|
||||
}
|
||||
if (Objects.equals(environment.getProperty("spring.profiles.active"), "prod")) {
|
||||
try {
|
||||
String ip = null;
|
||||
ip = IPUtil.getIp(request);
|
||||
log.info("ips:" + ip);
|
||||
Object s = RedisUtil.getCacheObject("ip:phone:" + ip);
|
||||
int num = Convert.toInt(s == null ? 0 : Convert.toInt(s), 0);
|
||||
if (num >= 5) {
|
||||
log.info("ips>=5,拦截:" + ip);
|
||||
return R.fail("当前IP发送频繁,请一天后再发送哦!");
|
||||
}
|
||||
num++;
|
||||
RedisUtil.setCacheObject("ip:phone:" + ip, num);
|
||||
RedisUtil.setCacheObject("ip:phone:" + ip, num, Duration.ofDays(1));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
SysUserVo userVo=null;
|
||||
if (type == 1) {
|
||||
userVo = sysUserService.selectVoByPhone(phone);
|
||||
if (userVo != null) {
|
||||
return R.fail("该手机号已注册!");
|
||||
}
|
||||
}
|
||||
if (type == 2 || type == 3) {
|
||||
userVo = sysUserService.selectVoByPhone(phone);
|
||||
if (userVo == null) {
|
||||
return R.fail("该手机号账号不存在!");
|
||||
}
|
||||
}
|
||||
if(type==4||type==5){
|
||||
userVo=LoginObject.getLoginObject(SysUserVo.class);
|
||||
if (userVo == null) {
|
||||
return R.fail("登录失效请重新登录!");
|
||||
}
|
||||
if(type==5){
|
||||
userVo = sysUserService.selectVoByPhone(phone);
|
||||
if (userVo != null) {
|
||||
return R.fail("该手机号已被绑定!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(LoginObject.isLogin()){
|
||||
if (!Objects.equals(Convert.toInt(LoginObject.getLoginObject(SysUserVo.class).getStatus()), SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue())) {
|
||||
throw new MmsException("账号状态不正常!");
|
||||
}
|
||||
}
|
||||
|
||||
String key = RedisUtil.PHONE_CODES_KEY + keytype + phone;
|
||||
Object object = RedisUtil.getCacheObject(key);
|
||||
if (object != null) {
|
||||
RedisUtil.deleteObject(key);
|
||||
return R.fail("发送频繁,请稍后再发送哦!");
|
||||
}
|
||||
String code = RandomUtil.randomNumbers(6);
|
||||
R<Object> result = smsService.sendSms(phone, code);
|
||||
|
||||
if (result.getStatus()!=0) {
|
||||
log.error("验证码短信发送异常 => {}", result.getMsg());
|
||||
return result;
|
||||
}
|
||||
RedisUtil.setCacheObject(key, code);
|
||||
RedisUtil.expire(key, Duration.ofMinutes(1));
|
||||
return R.success("手机短信码已发送!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有字典列表
|
||||
* @return 字典列表
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/listDictAll")
|
||||
public R<Object> listDictAll() {
|
||||
return R.success(sysDictService.selectAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录用户系统菜单
|
||||
* @return 菜单列表
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/getMenu")
|
||||
public R<Object> getMenu() {
|
||||
List<AdminMenuTree> menuTree = sysUserService.getAdminMenuTree(LoginObject.getLoginId());
|
||||
return success(menuTree);
|
||||
}
|
||||
|
||||
|
||||
@SaCheckLogin
|
||||
@PostMapping("/emailCode")
|
||||
public R<Object> emailCode(@RequestBody EmailBo bo, HttpServletRequest request) {
|
||||
Integer type = bo.getType();
|
||||
String emali = bo.getEmail();
|
||||
String keytype = "updatePhone:";
|
||||
if (Objects.equals(environment.getProperty("spring.profiles.active"), "prod")) {
|
||||
try {
|
||||
String ip = null;
|
||||
ip = IPUtil.getIp(request);
|
||||
log.info("ips:" + ip);
|
||||
Object s = RedisUtil.getCacheObject("ip:email:" + ip);
|
||||
int num = Convert.toInt(s == null ? 0 : Convert.toInt(s), 0);
|
||||
if (num >= 5) {
|
||||
log.info("ips>=5,拦截:" + ip);
|
||||
return R.fail("当前IP发送频繁,请一天后再发送哦!");
|
||||
}
|
||||
num++;
|
||||
RedisUtil.setCacheObject("ip:email:" + ip, num);
|
||||
RedisUtil.setCacheObject("ip:email:" + ip, num, Duration.ofDays(1));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
String key = RedisUtil.EMAIL_CODES_KEY + keytype + emali;
|
||||
Object object = RedisUtil.getCacheObject(key);
|
||||
if (object != null) {
|
||||
RedisUtil.deleteObject(key);
|
||||
return R.fail("发送频繁,请稍后再发送哦!");
|
||||
}
|
||||
String code = RandomUtil.randomNumbers(6);
|
||||
R<Object> result = emailService.sendEmailCode(bo.getEmail(), code);
|
||||
|
||||
if (result.getStatus()!=0) {
|
||||
log.error("验证码发送异常 => {}", result.getMsg());
|
||||
return result;
|
||||
}
|
||||
RedisUtil.setCacheObject(key, code);
|
||||
RedisUtil.expire(key, Duration.ofMinutes(10));
|
||||
return R.success("邮箱验证码已发送!");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,272 @@
|
||||
package com.sxpcwlkj.system.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateRange;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 首页控制台
|
||||
* @author xijue
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("system/home")
|
||||
public class HomeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 会员类别
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/memberSex")
|
||||
public R<Object> memberSex() {
|
||||
List<Number> list = new ArrayList<>();
|
||||
Long count = 0L;
|
||||
list.add(count);
|
||||
Long count2 = 0L;
|
||||
list.add(count2);
|
||||
Long count3 = 0L;
|
||||
list.add(count3);
|
||||
return R.success(list);
|
||||
}
|
||||
|
||||
|
||||
//1:会员总人数 ,今日新增
|
||||
//2:代发货总数量 , 今日数量
|
||||
//3:待还机总数量 , 今到期数量
|
||||
//4:分期付款总订单 , 今日付款数量
|
||||
|
||||
|
||||
/**
|
||||
* 待处理任务
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/info")
|
||||
public R<Object> homeInfo() {
|
||||
String loginId = LoginObject.getLoginId();
|
||||
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//总人数
|
||||
Long memberCount = 0L;
|
||||
map.put("num1", memberCount);
|
||||
//今日数量
|
||||
Long todayMemberCount = 0L;
|
||||
map.put("num2", todayMemberCount);
|
||||
map.put("num3", "会员人数");
|
||||
//https://icones.js.org
|
||||
map.put("num4", "iconoir:accessibility");
|
||||
map.put("num5", "人");
|
||||
map.put("color1", "#FF6462");
|
||||
map.put("color2", "--next-color-primary-lighter");
|
||||
map.put("color3", "--el-color-primary");
|
||||
list.add(map);
|
||||
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
//待发货
|
||||
Long orderCount = 0L;
|
||||
map2.put("num1", orderCount);
|
||||
//今日数量
|
||||
Long todayOrderCount = 0L;
|
||||
map2.put("num2", todayOrderCount);
|
||||
map2.put("num3", "订单发货");
|
||||
map2.put("num4", "octicon:copilot-16");
|
||||
map2.put("num5", "件");
|
||||
map2.put("color1", "#6690F9");
|
||||
map2.put("color2", "--next-color-success-lighter");
|
||||
map2.put("color3", "--el-color-success");
|
||||
list.add(map2);
|
||||
|
||||
Map<String, Object> map3 = new HashMap<>();
|
||||
//待发货
|
||||
Long orderCountGuiHai = 0L;
|
||||
map3.put("num1", orderCountGuiHai);
|
||||
//今日数量
|
||||
Long todayOrderCountGuiHai = 0L;
|
||||
map3.put("num2", todayOrderCountGuiHai);
|
||||
map3.put("num3", "到期待还");
|
||||
map3.put("num4", "emojione-monotone:alembic");
|
||||
map3.put("num5", "件");
|
||||
map3.put("color1", "#6690F9");
|
||||
map3.put("color2", "--next-color-warning-lighter");
|
||||
map3.put("color3", "--el-color-warning");
|
||||
list.add(map3);
|
||||
|
||||
Map<String, Object> map4 = new HashMap<>();
|
||||
//待发货
|
||||
Long orderCountFenQi = 0L;
|
||||
map4.put("num1", orderCountFenQi);
|
||||
//今日数量
|
||||
Long todayOrderCountFenQi = 0L;
|
||||
map4.put("num2", todayOrderCountFenQi);
|
||||
map4.put("num3", "分期待付");
|
||||
map4.put("num4", "emojione-monotone:bear-face");
|
||||
map4.put("num5", "个");
|
||||
map4.put("color1", "#FF6462");
|
||||
map4.put("color2", "--next-color-danger-lighter");
|
||||
map4.put("color3", "--el-color-danger");
|
||||
list.add(map4);
|
||||
|
||||
return R.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 快捷菜单
|
||||
*
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/menu")
|
||||
public R<Object> homeMenu() {
|
||||
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("icon", "iconfont icon-yangan");
|
||||
map.put("label", "会员管理");
|
||||
map.put("path", "/sxpcwlkj/storeMember");
|
||||
map.put("iconColor", "#F72B3F");
|
||||
Map<String, Object> query = new HashMap<>();
|
||||
map.put("query", query);
|
||||
list.add(map);
|
||||
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
map2.put("icon", "iconfont icon-wendu");
|
||||
map2.put("label", "实名认证");
|
||||
map2.put("path", "/sxpcwlkj/storeMemberAuthentication");
|
||||
map2.put("iconColor", "#91BFF8");
|
||||
Map<String, Object> query2 = new HashMap<>();
|
||||
map2.put("query", query2);
|
||||
list.add(map2);
|
||||
|
||||
Map<String, Object> map3 = new HashMap<>();
|
||||
map3.put("icon", "iconfont icon-neiqianshujuchucun");
|
||||
map3.put("label", "商品列表");
|
||||
map3.put("path", "/sxpcwlkj/storeProduct");
|
||||
map3.put("iconColor", "#88D565");
|
||||
Map<String, Object> query3 = new HashMap<>();
|
||||
map3.put("query", query3);
|
||||
list.add(map3);
|
||||
|
||||
Map<String, Object> map4 = new HashMap<>();
|
||||
map4.put("icon", "iconfont icon-fuwenbenkuang");
|
||||
map4.put("label", "文章列表");
|
||||
map4.put("path", "/sxpcwlkj/storeArticle");
|
||||
map4.put("iconColor", "#88D565");
|
||||
Map<String, Object> query4 = new HashMap<>();
|
||||
map4.put("query", query4);
|
||||
list.add(map4);
|
||||
|
||||
Map<String, Object> map5 = new HashMap<>();
|
||||
map5.put("icon", "iconfont icon-yangan");
|
||||
map5.put("label", "待付款订单");
|
||||
map5.put("path", "/sxpcwlkj/storeOrder");
|
||||
map5.put("iconColor", "#FBD4A0");
|
||||
Map<String, Object> query5 = new HashMap<>();
|
||||
query5.put("status", 10);
|
||||
map5.put("query", query5);
|
||||
list.add(map5);
|
||||
|
||||
Map<String, Object> map6 = new HashMap<>();
|
||||
map6.put("icon", "iconfont icon-shouye_dongtaihui");
|
||||
map6.put("label", "待发货订单");
|
||||
map6.put("path", "/sxpcwlkj/storeOrder");
|
||||
map6.put("iconColor", "#FBD4A0");
|
||||
Map<String, Object> query6 = new HashMap<>();
|
||||
query6.put("status", 20);
|
||||
map6.put("query", query6);
|
||||
list.add(map6);
|
||||
|
||||
return R.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 订单数量
|
||||
*
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/orderNum")
|
||||
public R<Object> orderNum() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List<BigDecimal> list1 = new ArrayList<>();
|
||||
List<BigDecimal> list2 = new ArrayList<>();
|
||||
//月份集合
|
||||
// 创建日期范围生成器
|
||||
DateTime start = DateUtil.parse("2024-01-01");
|
||||
DateTime end = DateUtil.parse("2024-12-31");
|
||||
DateRange range = DateUtil.range(start, end, DateField.MONTH);
|
||||
|
||||
for (DateTime date : range) {
|
||||
BigDecimal num1 = new BigDecimal(0);
|
||||
list1.add(num1 == null ? new BigDecimal(0) : num1);
|
||||
BigDecimal num2 = new BigDecimal(0);
|
||||
list2.add(num2 == null ? new BigDecimal(0) : num2);
|
||||
}
|
||||
map.put("list1", list1);
|
||||
map.put("list2", list2);
|
||||
|
||||
return R.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单走势
|
||||
*
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/orderPrice")
|
||||
public R<Object> orderPrice() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List<Map<String, Object>> list1 = new ArrayList<>();
|
||||
List<Map<String, Object>> list2 = new ArrayList<>();
|
||||
List<Map<String, Object>> list3 = new ArrayList<>();
|
||||
//月份集合
|
||||
// 创建日期范围生成器
|
||||
DateTime start = DateUtil.parse("2024-01-01");
|
||||
DateTime end = DateUtil.parse("2024-12-31");
|
||||
DateRange range = DateUtil.range(start, end, DateField.MONTH);
|
||||
|
||||
int i = 1;
|
||||
for (DateTime date : range) {
|
||||
//{ value: 0, stationName: 's1' },
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
BigDecimal num1 = new BigDecimal(0);
|
||||
num1 = num1 == null ? new BigDecimal(0) : num1;
|
||||
map1.put("value", num1);
|
||||
map1.put("stationName", "s" + i);
|
||||
list1.add(map1);
|
||||
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
BigDecimal num2 = new BigDecimal(0);
|
||||
num2 = num2 == null ? new BigDecimal(0) : num2;
|
||||
map2.put("value", num2);
|
||||
map2.put("stationName", "s" + i);
|
||||
list2.add(map2);
|
||||
|
||||
Map<String, Object> map3 = new HashMap<>();
|
||||
map3.put("value", num1.add(num2));
|
||||
map3.put("stationName", "s" + i);
|
||||
list3.add(map3);
|
||||
|
||||
i++;
|
||||
}
|
||||
map.put("list1", list1);
|
||||
map.put("list2", list2);
|
||||
map.put("list3", list3);
|
||||
|
||||
return R.success(map);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,129 @@
|
||||
package com.sxpcwlkj.system.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaCheckRole;
|
||||
import com.sxpcwlkj.common.annotation.MssSafety;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.sms.service.SmsService;
|
||||
import com.sxpcwlkj.system.entity.bo.SysConfigBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysConfigVo;
|
||||
import com.sxpcwlkj.system.service.SysConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
* @author xijue
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("system/config")
|
||||
public class SysConfigController extends BaseController{
|
||||
|
||||
private final SysConfigService baseService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("system:config:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<SysConfigVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) SysConfigBo bo){
|
||||
return baseService.selectListVoPage(bo, bo.getPageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*
|
||||
* @param id 主键id
|
||||
* @return 查询结果
|
||||
*/
|
||||
@SaCheckPermission("system:config:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SysConfigVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param bo 更新实体
|
||||
* @return 更新结果
|
||||
*/
|
||||
@SaCheckPermission("system:config:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@Validated @RequestBody SysConfigBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param bo 新增实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@SaCheckPermission("system:config:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@Validated @RequestBody SysConfigBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param ids 主键id
|
||||
* @return 删除结果
|
||||
*/
|
||||
@SaCheckPermission("system:config:delete")
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Boolean> delete(@PathVariable String ids) {
|
||||
return success(baseService.deleteById(ids));
|
||||
}
|
||||
|
||||
|
||||
//========================系统配置扩展========================
|
||||
/**
|
||||
* 系统配置回显
|
||||
* @param bos 查询对象
|
||||
* @return 配置集合
|
||||
*/
|
||||
@SaCheckRole("super_admin")
|
||||
@PostMapping("/getConfigs")
|
||||
public R<List<SysConfigVo>> getConfigs(@Validated @RequestBody List<SysConfigBo> bos) {
|
||||
return success(baseService.selectByCodes(bos));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑系统配置
|
||||
* @param bos 配置集合
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@SaCheckRole("super_admin")
|
||||
@PostMapping("/configs")
|
||||
public R<Boolean> configs(@Validated @RequestBody(required = false) List<SysConfigBo> bos) {
|
||||
return success(baseService.updateByCodes(bos));
|
||||
}
|
||||
|
||||
private final SmsService smsService;
|
||||
|
||||
@SaCheckLogin
|
||||
@GetMapping("/sendSms/{phone}")
|
||||
public R<Object> sendSms(@PathVariable String phone) {
|
||||
return smsService.sendSms(phone, "123456");
|
||||
}
|
||||
}
|
||||
148
mms-admin/src/main/java/com/sxpcwlkj/system/controller/SysDeptController.java
Executable file
148
mms-admin/src/main/java/com/sxpcwlkj/system/controller/SysDeptController.java
Executable file
@ -0,0 +1,148 @@
|
||||
package com.sxpcwlkj.system.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.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.framework.utils.ExcelUtil;
|
||||
import com.sxpcwlkj.common.code.entity.ThreeQueryBo;
|
||||
import com.sxpcwlkj.system.entity.bo.SysDeptBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDeptVo;
|
||||
import com.sxpcwlkj.system.entity.export.SysDeptExport;
|
||||
import com.sxpcwlkj.system.service.SysDeptService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
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("system/dept")
|
||||
public class SysDeptController extends BaseController{
|
||||
private final SysDeptService baseService;
|
||||
|
||||
/**
|
||||
* 树结构列表
|
||||
* @param bo 查询参数
|
||||
* @return 树结构列表
|
||||
*/
|
||||
@SaCheckPermission("system:dept:list")
|
||||
@PostMapping("/list")
|
||||
public R<List<SysDeptVo>> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) ThreeQueryBo bo) {
|
||||
return success(baseService.queryTree(bo.getIsAll(),bo.getShowLevel()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
* @param id ID
|
||||
* @return 对象
|
||||
*/
|
||||
@SaCheckPermission("system:dept:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SysDeptVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("system:dept:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@RequestBody @Validated(ValidatedGroupConfig.update.class) SysDeptBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("system:dept:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@RequestBody @Validated(ValidatedGroupConfig.insert.class) SysDeptBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids ID
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("system:dept:delete")
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Boolean> delete(@PathVariable String ids) {
|
||||
return success(baseService.deleteById(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 模版下载
|
||||
*/
|
||||
@SaCheckPermission("system:dept:import")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil.download(response, SysDeptExport.class, "系统部门");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入系统用户
|
||||
* @param file 模版文件
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:dept:import")
|
||||
@PostMapping("/import")
|
||||
public R<Boolean> imports(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
Set<SysDeptExport> list= ExcelUtil.imports(file, SysDeptExport.class);
|
||||
Boolean state= baseService.imports(list);
|
||||
return R.ok(state,state?"数据导入成功!":"数据导入失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出系统用户
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:dept:export")
|
||||
@PostMapping("/export")
|
||||
public void export(@RequestBody @Validated(ValidatedGroupConfig.query.class) SysDeptBo bo,HttpServletResponse response) throws IOException {
|
||||
List<SysDeptVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<SysDeptExport> data= MapstructUtil.convert(list,SysDeptExport.class);
|
||||
ExcelUtil.export(response, SysDeptExport.class, "系统部门",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印系统用户
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:dept:print")
|
||||
@PostMapping("/print")
|
||||
public R<PrintObject<SysDeptExport>> print(@RequestBody @Validated(ValidatedGroupConfig.query.class) SysDeptBo bo) throws Exception {
|
||||
List<SysDeptVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<SysDeptExport> data= MapstructUtil.convert(list,SysDeptExport.class);
|
||||
PrintObject<SysDeptExport> printObject= new PrintObject<SysDeptExport>()
|
||||
.setTitle("系统部门")
|
||||
.setData(data);
|
||||
return R.response(Boolean.TRUE,printObject);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package com.sxpcwlkj.system.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.R;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.system.entity.bo.SysDictBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDictVo;
|
||||
import com.sxpcwlkj.system.service.SysDictService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 系统字典
|
||||
* @author xijue
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@RequestMapping("system/dict")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class SysDictController extends BaseController {
|
||||
|
||||
private final SysDictService baseService;
|
||||
|
||||
/**
|
||||
* 分页查询字典列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("system:dict:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<SysDictVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class)SysDictBo bo) {
|
||||
return baseService.selectPageList(bo, bo.getPageQuery());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取字典详细信息
|
||||
*
|
||||
* @return 字典详细信息
|
||||
*/
|
||||
@SaCheckPermission("system:dict:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SysDictVo> queryById(@PathVariable Long id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑字典
|
||||
* @param bo 字典信息
|
||||
* @return 成功、失败
|
||||
*/
|
||||
@SaCheckPermission("system:dict:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@Validated @RequestBody(required = false) SysDictBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典
|
||||
* @param bo 字典信息
|
||||
* @return 成功、失败
|
||||
*/
|
||||
@SaCheckPermission("system:dict:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@Validated @RequestBody(required = false) SysDictBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典
|
||||
* @param id 字典ID
|
||||
* @return vo
|
||||
*/
|
||||
@SaCheckPermission("system:dict:delete")
|
||||
@DeleteMapping("/{id}")
|
||||
public R<Boolean> delete(@PathVariable Long id) {
|
||||
return success(baseService.deleteById(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.sxpcwlkj.system.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.R;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.system.entity.AdminMenuTree;
|
||||
import com.sxpcwlkj.system.entity.bo.SysFunctionBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysFunctionVo;
|
||||
import com.sxpcwlkj.system.service.SysFunctionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统资源
|
||||
* @author xijue
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@RequestMapping("system/function")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class SysFunctionController extends BaseController {
|
||||
|
||||
private final SysFunctionService baseService;
|
||||
|
||||
/**
|
||||
* 获取资源列表
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("system:function:list")
|
||||
@PostMapping("/list")
|
||||
public R<List<SysFunctionVo>> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) SysFunctionBo bo) {
|
||||
return R.success(baseService.selectPageList(bo, bo.getPageQuery()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 所有菜单
|
||||
*/
|
||||
@SaCheckPermission("system:function:list")
|
||||
@PostMapping("/menuList")
|
||||
public R<List<AdminMenuTree>> menuList(){
|
||||
List<AdminMenuTree> functionTree = baseService.getAllMenuTree();
|
||||
return success(functionTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@SaCheckPermission("system:function:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SysFunctionVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑资源
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:function:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@Validated @RequestBody SysFunctionBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资源
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:function:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@Validated @RequestBody SysFunctionBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:function:delete")
|
||||
@DeleteMapping("/{id}")
|
||||
public R<Boolean> delete(@PathVariable String id) {
|
||||
return success(baseService.deleteById(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
148
mms-admin/src/main/java/com/sxpcwlkj/system/controller/SysNoticeController.java
Executable file
148
mms-admin/src/main/java/com/sxpcwlkj/system/controller/SysNoticeController.java
Executable file
@ -0,0 +1,148 @@
|
||||
package com.sxpcwlkj.system.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.system.entity.bo.SysNoticeBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysNoticeVo;
|
||||
import com.sxpcwlkj.system.entity.export.SysNoticeExport;
|
||||
import com.sxpcwlkj.system.service.SysNoticeService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
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("system/notice")
|
||||
public class SysNoticeController extends BaseController{
|
||||
private final SysNoticeService baseService;
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
* @param bo 查询条件
|
||||
* @return 分页对象
|
||||
*/
|
||||
@SaCheckPermission("system:notice:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<SysNoticeVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) SysNoticeBo bo){
|
||||
return baseService.selectListVoPage(bo, bo.getPageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
* @param id ID
|
||||
* @return 对象
|
||||
*/
|
||||
@SaCheckPermission("system:notice:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SysNoticeVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("system:notice:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@RequestBody @Validated(ValidatedGroupConfig.update.class) SysNoticeBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param bo 对象
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("system:notice:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@RequestBody @Validated(ValidatedGroupConfig.insert.class) SysNoticeBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids ID
|
||||
* @return true:成功 false:失败
|
||||
*/
|
||||
@SaCheckPermission("system:notice:delete")
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Boolean> delete(@PathVariable String ids) {
|
||||
return success(baseService.deleteById(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 模版下载
|
||||
*/
|
||||
@SaCheckPermission("system:notice:import")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil.download(response, SysNoticeExport.class, "系统公告");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入系统用户
|
||||
* @param file 模版文件
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:notice:import")
|
||||
@PostMapping("/import")
|
||||
public R<Boolean> imports(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
Set<SysNoticeExport> list= ExcelUtil.imports(file, SysNoticeExport.class);
|
||||
Boolean state= baseService.imports(list);
|
||||
return R.ok(state,state?"数据导入成功!":"数据导入失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出系统用户
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:notice:export")
|
||||
@PostMapping("/export")
|
||||
public void export(@RequestBody @Validated(ValidatedGroupConfig.query.class) SysNoticeBo bo,HttpServletResponse response) throws IOException {
|
||||
List<SysNoticeVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<SysNoticeExport> data= MapstructUtil.convert(list,SysNoticeExport.class);
|
||||
ExcelUtil.export(response, SysNoticeExport.class, "系统公告",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印系统用户
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:notice:print")
|
||||
@PostMapping("/print")
|
||||
public R<PrintObject<SysNoticeExport>> print(@RequestBody @Validated(ValidatedGroupConfig.query.class) SysNoticeBo bo) throws Exception {
|
||||
List<SysNoticeVo> list= baseService.selectListVoPage(bo, bo.getPageQuery()).getRows();
|
||||
List<SysNoticeExport> data= MapstructUtil.convert(list,SysNoticeExport.class);
|
||||
PrintObject<SysNoticeExport> printObject= new PrintObject<SysNoticeExport>()
|
||||
.setTitle("系统公告")
|
||||
.setData(data);
|
||||
return R.response(Boolean.TRUE,printObject);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,163 @@
|
||||
package com.sxpcwlkj.system.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaCheckRole;
|
||||
import com.sxpcwlkj.common.annotation.MssSafety;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.oss.service.OssService;
|
||||
import com.sxpcwlkj.system.entity.bo.SysOssBo;
|
||||
import com.sxpcwlkj.system.entity.bo.SysOssConfigBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysOssConfigVo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysOssVo;
|
||||
import com.sxpcwlkj.system.service.SysOssConfigService;
|
||||
import com.sxpcwlkj.system.service.SysOssService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.x.file.storage.core.FileInfo;
|
||||
import org.dromara.x.file.storage.core.FileStorageService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 对象存储
|
||||
* @author xijue
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@RequestMapping("system/oss")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class SysOssController extends BaseController {
|
||||
private final SysOssService baseService;
|
||||
private final FileStorageService fileStorageService;
|
||||
private final OssService ossService;
|
||||
private final SysOssConfigService sysOssConfigService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("system:oss:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<SysOssVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) SysOssBo bo) {
|
||||
return baseService.selectPageList(bo, bo.getPageQuery());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("system:oss:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SysOssVo> queryById(@PathVariable Long id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("system:oss:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@Validated @RequestBody SysOssBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@SaCheckPermission("system:oss:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(MultipartFile file) {
|
||||
FileInfo fileInfo=ossService.upload(file);
|
||||
SysOssBo sysOssBo = new SysOssBo();
|
||||
sysOssBo.setUrl(fileInfo.getUrl());
|
||||
sysOssBo.setFileName(fileInfo.getFilename());
|
||||
sysOssBo.setOriginalName(fileInfo.getOriginalFilename());
|
||||
sysOssBo.setFileSuffix(fileInfo.getExt());
|
||||
sysOssBo.setPlatform(fileInfo.getPlatform());
|
||||
sysOssBo.setContentType(fileInfo.getContentType());
|
||||
sysOssBo.setBasePath(fileInfo.getBasePath());
|
||||
sysOssBo.setStatus(0);
|
||||
sysOssBo.setSort(0);
|
||||
return success(baseService.insert(sysOssBo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@SaCheckPermission("system:oss:delete")
|
||||
@DeleteMapping("/{id}")
|
||||
public R<Boolean> delete(@PathVariable Long id) {
|
||||
SysOssVo vo = baseService.selectVoById(id);
|
||||
if (vo != null) {
|
||||
boolean delete = fileStorageService.delete(vo.getUrl());
|
||||
if (!delete) {
|
||||
return R.fail("桶删除失败");
|
||||
}
|
||||
}
|
||||
return success(baseService.deleteById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取OSS配置的默认启用项
|
||||
* @return 配置项明细
|
||||
*/
|
||||
@SaCheckRole("super_admin")
|
||||
@GetMapping("/config/queryDef")
|
||||
public R<String> queryDef() {
|
||||
return success("success",sysOssConfigService.queryDef());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取OSS配置详情
|
||||
* @param key 配置项key
|
||||
* @return 配置项明细
|
||||
*/
|
||||
@SaCheckRole("super_admin")
|
||||
@GetMapping("/config/{key}")
|
||||
public R<SysOssConfigVo> queryByKey(@PathVariable String key) {
|
||||
return success(sysOssConfigService.selectVoByKey(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑配置
|
||||
* @param bo 配置对象
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@SaCheckRole("super_admin")
|
||||
@PutMapping("/config/edit")
|
||||
public R<Boolean> edit(@Validated @RequestBody SysOssConfigBo bo) {
|
||||
return success(sysOssConfigService.updateByIdXml(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/elUpload")
|
||||
public R<FileInfo> elUpload(MultipartFile file) {
|
||||
return R.success(ossService.upload(file));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/wangEditor")
|
||||
public R<FileInfo> wangEditor(MultipartFile file) {
|
||||
return R.success(ossService.upload(file));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package com.sxpcwlkj.system.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.R;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.system.entity.bo.SysRoleBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysRoleVo;
|
||||
import com.sxpcwlkj.system.service.SysRoleService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 系统角色
|
||||
* @author xijue
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@RequestMapping("system/role")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class SysRoleController extends BaseController {
|
||||
|
||||
private final SysRoleService baseService;
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
@MssSafety
|
||||
@SaCheckPermission("system:role:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<SysRoleVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) SysRoleBo bo) {
|
||||
return baseService.selectPageUserList(bo, bo.getPageQuery());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
*/
|
||||
@SaCheckPermission("system:role:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SysRoleVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:role:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@Validated @RequestBody SysRoleBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:role:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@Validated @RequestBody SysRoleBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:role:delete")
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Boolean> delete(@PathVariable String ids) {
|
||||
return success(baseService.deleteById(ids));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,331 @@
|
||||
package com.sxpcwlkj.system.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.annotation.MssSafety;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.code.entity.PrintObject;
|
||||
import com.sxpcwlkj.common.code.entity.WxCodeBo;
|
||||
import com.sxpcwlkj.common.enums.WxCodeStatusEnum;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.framework.utils.ExcelUtil;
|
||||
import com.sxpcwlkj.redis.RedisUtil;
|
||||
import com.sxpcwlkj.system.entity.bo.*;
|
||||
import com.sxpcwlkj.system.entity.export.SysUserExportVo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysUserVo;
|
||||
import com.sxpcwlkj.system.service.SysUserService;
|
||||
import com.sxpcwlkj.wx.service.WxCodeService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
* @author xijue
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("system/user")
|
||||
public class SysUserController extends BaseController {
|
||||
|
||||
private final SysUserService baseService;
|
||||
private final WxCodeService wxCodeService;
|
||||
/**
|
||||
* 获取用户分页列表
|
||||
*
|
||||
* @return 用户列表
|
||||
*/
|
||||
@MssSafety(decryptRequest = true)
|
||||
@SaCheckPermission("system:user:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo<SysUserVo> listPage(@RequestBody @Validated(ValidatedGroupConfig.query.class) SysUserBo user) {
|
||||
return baseService.selectPageUserList(user, user.getPageQuery());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户详细信息
|
||||
*
|
||||
* @return PageDataInfo
|
||||
*/
|
||||
@SaCheckPermission("system:user:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SysUserVo> queryById(@PathVariable String id) {
|
||||
return success(baseService.selectVoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑用户
|
||||
*
|
||||
* @return true/false
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:user:edit")
|
||||
@PutMapping
|
||||
public R<Boolean> edit(@RequestBody @Validated(ValidatedGroupConfig.update.class) SysUserBo bo) {
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:user:insert")
|
||||
@PostMapping
|
||||
public R<Boolean> insert(@RequestBody @Validated(ValidatedGroupConfig.insert.class) SysUserBo bo) {
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:user:delete")
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Boolean> delete(@PathVariable String ids) {
|
||||
return success(baseService.deleteById(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 模版下载
|
||||
*/
|
||||
@SaCheckPermission("system:user:import")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil.download(response, SysUserExportVo.class, "系统用户");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入系统用户
|
||||
* @param file 模版文件
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:user:import")
|
||||
@PostMapping("/import")
|
||||
public R<Boolean> imports(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
Set<SysUserExportVo> list= ExcelUtil.imports(file, SysUserExportVo.class);
|
||||
Boolean state= baseService.imports(list);
|
||||
return R.ok(state,state?"数据导入成功!":"数据导入失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出系统用户
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:user:export")
|
||||
@PostMapping("/export")
|
||||
public void export(SysUserBo user, PageQuery pageQuery,HttpServletResponse response) throws IOException {
|
||||
List<SysUserVo> list= baseService.selectPageUserList(user, pageQuery).getRows();
|
||||
List<SysUserExportVo> data= MapstructUtil.convert(list,SysUserExportVo.class);
|
||||
ExcelUtil.export(response, SysUserExportVo.class, "系统用户",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印系统用户
|
||||
* @param user 查询条件
|
||||
* @param pageQuery 分页条件
|
||||
*/
|
||||
@MssSafety
|
||||
@Transactional
|
||||
@SaCheckPermission("system:user:print")
|
||||
@PostMapping("/print")
|
||||
public R<PrintObject<SysUserExportVo>> print(SysUserBo user, PageQuery pageQuery) throws Exception {
|
||||
List<SysUserVo> list= baseService.selectPageUserList(user, pageQuery).getRows();
|
||||
List<SysUserExportVo> data= MapstructUtil.convert(list,SysUserExportVo.class);
|
||||
PrintObject<SysUserExportVo> printObject= new PrintObject<SysUserExportVo>()
|
||||
.setTitle("系统用户")
|
||||
.setData(data);
|
||||
return R.response(Boolean.TRUE,printObject);
|
||||
}
|
||||
|
||||
//====================================个人信息=====================================
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/resetPwd")
|
||||
public R<Boolean> resetPwd(@Validated @RequestBody(required = false)ResetPwdBo bo) {
|
||||
return success(baseService.resetPwd(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 重置密码:管理员
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/resetPwdSuper")
|
||||
public R<Boolean> resetPwdSuper(@Validated @RequestBody ResetPwdSuperBo bo) {
|
||||
return success(baseService.resetPwdSuper(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改头像
|
||||
*
|
||||
* @param avatar 图片
|
||||
* @return true/false
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping(value = "/editHeaderImg")
|
||||
public R<Boolean> editHeaderImg(@Validated @NotBlank(message = "头像不能为空") String avatar) {
|
||||
return success("修改头像成功",baseService.updateHeaderImgById(avatar));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户角色
|
||||
* @param bo bo
|
||||
* @return true/false
|
||||
*/
|
||||
@PostMapping("/setUserRole")
|
||||
public R<Boolean> setUserRole(@Validated @RequestBody SetUserRoleSuperBo bo) {
|
||||
return success("设置用户角色成功",baseService.setUserRoleSuper(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑手机号 邮箱 微信
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/unbind")
|
||||
public R<Boolean> unbind(int type) {
|
||||
return success(baseService.unbind(type)?"解绑成功":"解绑失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定手机号
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/bindingPhone")
|
||||
public R<Boolean> bindingPhone(@Validated({ValidatedGroupConfig.update.class}) @RequestBody SmsBo bo) {
|
||||
String keyType = "updatePhone:";
|
||||
String phone = bo.getPhone();
|
||||
String key = RedisUtil.PHONE_CODES_KEY + keyType + phone;
|
||||
Object code = RedisUtil.getCacheObject(key);
|
||||
if (code == null) {
|
||||
return R.fail("验证码已过期!");
|
||||
}
|
||||
if (!bo.getCode().equals(code)) {
|
||||
return R.fail("验证码不正确!");
|
||||
}
|
||||
RedisUtil.deleteObject(key);
|
||||
return success(baseService.bindingPhone(phone)? "绑定手机号成功":"绑定手机号失败");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 绑定邮件
|
||||
*
|
||||
* @return vo
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/bindingEmail")
|
||||
public R<Boolean> bindingEmail(@Validated({ValidatedGroupConfig.update.class}) @RequestBody EmailBo bo) {
|
||||
String keyType = "updatePhone:";
|
||||
String email = bo.getEmail();
|
||||
String key = RedisUtil.EMAIL_CODES_KEY + keyType + email;
|
||||
Object code = RedisUtil.getCacheObject(key);
|
||||
if (code == null) {
|
||||
return R.fail("验证码已过期!");
|
||||
}
|
||||
if (!bo.getCode().equals(code)) {
|
||||
return R.fail("验证码不正确!");
|
||||
}
|
||||
RedisUtil.deleteObject(key);
|
||||
return success(baseService.bindingEmail(email)? "绑定邮箱成功":"绑定邮箱失败");
|
||||
}
|
||||
|
||||
|
||||
@SaCheckLogin
|
||||
@GetMapping("/getWxCode")
|
||||
public R<String> getWxCode(String uuid) {
|
||||
if(uuid==null){
|
||||
return R.fail("uuid不能为空!");
|
||||
}
|
||||
//获取微信绑定的二维码
|
||||
String codeUrl= wxCodeService.getCode(new WxCodeBo(uuid)
|
||||
.typeBinding()
|
||||
.expireTime(1000*60)
|
||||
.paramData(LoginObject.getLoginId()));
|
||||
return success("二维码获取成功",codeUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询二维码状态
|
||||
* @param uuid 二维码key
|
||||
* @return
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/queryWxCodeState")
|
||||
public R<Object> queryWxCodeState(String uuid) {
|
||||
if(uuid==null){
|
||||
return R.fail("key不能为空!");
|
||||
}
|
||||
//登录二维码
|
||||
WxCodeBo wxCodeBo= wxCodeService.getCodeState(new WxCodeBo(uuid).typeBinding());
|
||||
if(Objects.equals(wxCodeBo.getState(), WxCodeStatusEnum.WAITING.getValue())){
|
||||
return fail("等待扫码中...");
|
||||
}
|
||||
if(Objects.equals(wxCodeBo.getState(), WxCodeStatusEnum.SCANNED.getValue())){
|
||||
return okFail("二维码已被扫!");
|
||||
}
|
||||
if(Objects.equals(wxCodeBo.getState(), WxCodeStatusEnum.FAILING.getValue())){
|
||||
return okFail("扫码失败!");
|
||||
}
|
||||
if(Objects.equals(wxCodeBo.getState(), WxCodeStatusEnum.SUCCEED.getValue())){
|
||||
log.info(wxCodeBo.getOpenId());
|
||||
SysUserVo sysUserVo= baseService.selectOpenId(wxCodeBo.getOpenId());
|
||||
if(sysUserVo!=null){
|
||||
return okFail("该微信已绑定账号!");
|
||||
}
|
||||
return success(baseService.bindingOpenId(wxCodeBo.getOpenId())?"绑定微信成功":"绑定微信失败");
|
||||
}
|
||||
return R.fail("系统异常!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取最新登录对象信息
|
||||
* @return 登录对象
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/getUserInfo")
|
||||
public R<Map<String, Object>> getUserInfo(){
|
||||
SysUserVo sysUser = baseService.getUserRoleAnfFunctionInfo(LoginObject.getLoginId());
|
||||
return R.success(baseService.getUserInfo(sysUser));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.sxpcwlkj.system.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 后端菜单
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
public class AdminMenuTree {
|
||||
|
||||
// ID
|
||||
private String id;
|
||||
// 路由路径
|
||||
private String path;
|
||||
// 路由名称
|
||||
private String name;
|
||||
// 组件路径
|
||||
private String component;
|
||||
// 组件路径别名
|
||||
private String componentAlias;
|
||||
// 路由重定向,有子集 children 时
|
||||
private String redirect;
|
||||
// 菜单排序
|
||||
//private Integer menuSort;
|
||||
// 是否外链
|
||||
//private Boolean isLink;
|
||||
// 菜单类型为按钮时,权限标识
|
||||
//private String btnPower;
|
||||
|
||||
private Map<String,Object> meta;
|
||||
|
||||
private List<AdminMenuTree> children;
|
||||
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package com.sxpcwlkj.system.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.List;
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@TableName("sys_config")
|
||||
public class SysConfig extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 配置名称
|
||||
*/
|
||||
private String configName;
|
||||
/**
|
||||
* 配置键
|
||||
*/
|
||||
private String configKey;
|
||||
/**
|
||||
* 配置类型
|
||||
*/
|
||||
private Integer configType;
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
private String configValue;
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<String> configValues;
|
||||
/**
|
||||
* 配置类型
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String valueType;
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer index;
|
||||
|
||||
}
|
||||
51
mms-admin/src/main/java/com/sxpcwlkj/system/entity/SysDept.java
Executable file
51
mms-admin/src/main/java/com/sxpcwlkj/system/entity/SysDept.java
Executable file
@ -0,0 +1,51 @@
|
||||
package com.sxpcwlkj.system.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 系统部门
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_dept")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysDept extends BaseEntity {
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
@TableId
|
||||
private String deptId;
|
||||
/**
|
||||
* 父级编号
|
||||
*/
|
||||
private String parentId;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String leader;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.sxpcwlkj.system.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 lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 系统字典
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
||||
@TableName("sys_dict")
|
||||
public class SysDict extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 字典主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
private String fieldName;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.sxpcwlkj.system.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 lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 系统字典数据
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_dict_data")
|
||||
public class SysDictData extends BaseEntity {
|
||||
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
private String label;
|
||||
|
||||
private String fieldName;
|
||||
|
||||
private String value;
|
||||
|
||||
private String dictType;
|
||||
|
||||
|
||||
private String colorType;
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.sxpcwlkj.system.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 lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 系统功能资源
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
||||
@TableName("sys_function")
|
||||
public class SysFunction extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 菜单ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* i18n编码
|
||||
*/
|
||||
private String languageCode;
|
||||
/**
|
||||
* 权限标识
|
||||
*/
|
||||
private String permission;
|
||||
/**
|
||||
* 菜单类型
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
private Long parentId;
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String path;
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
private String component;
|
||||
/**
|
||||
* 组件名
|
||||
*/
|
||||
private String componentName;
|
||||
/**
|
||||
* 状态;0正常 1停用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 是否可见
|
||||
*/
|
||||
private Integer visible;
|
||||
/**
|
||||
* 是否缓存
|
||||
*/
|
||||
private Integer keepAlive;
|
||||
/**
|
||||
* 链接地址
|
||||
*/
|
||||
private String isLink;
|
||||
/**
|
||||
* 是否外链
|
||||
*/
|
||||
private Integer isOpenLink;
|
||||
/**
|
||||
* 是否内嵌 true
|
||||
* 外链path=内嵌url
|
||||
*/
|
||||
private Integer isIframe;
|
||||
/**
|
||||
* 是否总是显示
|
||||
*/
|
||||
private Integer alwaysShow;
|
||||
}
|
||||
41
mms-admin/src/main/java/com/sxpcwlkj/system/entity/SysNotice.java
Executable file
41
mms-admin/src/main/java/com/sxpcwlkj/system/entity/SysNotice.java
Executable file
@ -0,0 +1,41 @@
|
||||
package com.sxpcwlkj.system.entity;
|
||||
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 系统公告
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_notice")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysNotice extends BaseEntity {
|
||||
/**
|
||||
* 公告ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 公告标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 公告内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 公告类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package com.sxpcwlkj.system.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 lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 对象存储
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_oss")
|
||||
public class SysOss extends BaseEntity {
|
||||
@TableId(value = "oss_id")
|
||||
private String ossId;
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
private String fileName;
|
||||
/**
|
||||
* 原名
|
||||
*/
|
||||
private String originalName;
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
private String fileSuffix;
|
||||
/**
|
||||
* URL地址
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* MIME 类型
|
||||
*/
|
||||
private String contentType;
|
||||
/**
|
||||
* 基础存储路径
|
||||
*/
|
||||
private String basePath;
|
||||
/**
|
||||
* 存储平台
|
||||
*/
|
||||
private String platform;
|
||||
}
|
||||
67
mms-admin/src/main/java/com/sxpcwlkj/system/entity/SysOssConfig.java
Executable file
67
mms-admin/src/main/java/com/sxpcwlkj/system/entity/SysOssConfig.java
Executable file
@ -0,0 +1,67 @@
|
||||
package com.sxpcwlkj.system.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 xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@TableName("sys_oss_config")
|
||||
public class SysOssConfig extends BaseEntity {
|
||||
/**
|
||||
* 主建
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 配置key
|
||||
*/
|
||||
private String configKey;
|
||||
/**
|
||||
* accessKey
|
||||
*/
|
||||
private String accessKey;
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
private String secretKey;
|
||||
/**
|
||||
* 桶名称
|
||||
*/
|
||||
private String bucketName;
|
||||
/**
|
||||
* 前缀
|
||||
*/
|
||||
private String prefix;
|
||||
/**
|
||||
* 访问站点
|
||||
*/
|
||||
private String endpoint;
|
||||
/**
|
||||
* 自定义域名
|
||||
*/
|
||||
private String domain;
|
||||
/**
|
||||
* 是否https
|
||||
*/
|
||||
private String isHttps;
|
||||
/**
|
||||
* 域
|
||||
*/
|
||||
private String region;
|
||||
/**
|
||||
* 桶权限类型
|
||||
*/
|
||||
private String accessPolicy;
|
||||
/**
|
||||
* 扩展字段
|
||||
*/
|
||||
private String ext1;
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.sxpcwlkj.system.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 lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 系统岗位
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
||||
@TableName("sys_dept")
|
||||
public class SysPost extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
|
||||
private String code;
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
|
||||
private String name;
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态;0正常 1停用
|
||||
*/
|
||||
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.sxpcwlkj.system.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 lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 系统角色
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_role")
|
||||
public class SysRole extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色权限字符串
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
private Integer level;
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.sxpcwlkj.system.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 xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_role_function")
|
||||
|
||||
public class SysRoleFunction extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键编码
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String roleId;
|
||||
/**
|
||||
* 功能ID
|
||||
*/
|
||||
private String functionId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,121 @@
|
||||
package com.sxpcwlkj.system.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 系统租户
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
|
||||
@TableName("sys_tenant")
|
||||
public class SysTenant{
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@TableId(value = "tenant_id")
|
||||
private String tenantId;
|
||||
/**
|
||||
* 租户名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 联系人的用户编号
|
||||
*/
|
||||
private String contactUserId;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contactName;
|
||||
/**
|
||||
* 联系手机
|
||||
*/
|
||||
private String contactMobile;
|
||||
/**
|
||||
* 租户状态;0正常 1停用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 绑定域名
|
||||
*/
|
||||
private String domain;
|
||||
/**
|
||||
* 租户套餐编号
|
||||
*/
|
||||
private String packageId;
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private Date expireTime;
|
||||
/**
|
||||
* 账号数量
|
||||
*/
|
||||
private Integer accountCount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String revision;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createdTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updatedTime;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
private String searchValue;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.sxpcwlkj.system.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 lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 系统租户套餐
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
||||
@TableName("sys_tenant_package")
|
||||
public class SysTenantPackage extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 套餐编号
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
/**
|
||||
* 套餐名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 租户状态;0正常 1停用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 关联的菜单编号
|
||||
*/
|
||||
private String functionIds;
|
||||
|
||||
}
|
||||
126
mms-admin/src/main/java/com/sxpcwlkj/system/entity/SysUser.java
Normal file
126
mms-admin/src/main/java/com/sxpcwlkj/system/entity/SysUser.java
Normal file
@ -0,0 +1,126 @@
|
||||
package com.sxpcwlkj.system.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
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 lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_user")
|
||||
public class SysUser extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "user_id")
|
||||
private String userId;
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private String deptId;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String department;
|
||||
/**
|
||||
* 岗位编号数组
|
||||
*/
|
||||
private String postIds;
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String userType;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phoneNumber;
|
||||
/**
|
||||
* 微信id
|
||||
*/
|
||||
private String wxOpenid;
|
||||
/**
|
||||
* 微信开发者id
|
||||
*/
|
||||
private String wxUnOpenId;
|
||||
/**
|
||||
* 性别;0:保密 1:男2:女
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@TableField(
|
||||
insertStrategy = FieldStrategy.NOT_EMPTY,
|
||||
updateStrategy = FieldStrategy.NOT_EMPTY,
|
||||
whereStrategy = FieldStrategy.NOT_EMPTY
|
||||
)
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 密码强度
|
||||
*/
|
||||
private String passwordStrength;
|
||||
/**
|
||||
* 状态;0正常 1停用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 删除标志;0代表存在 2代表删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* 最后登录ip
|
||||
*/
|
||||
private String loginIp;
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
private Date loginDate;
|
||||
/**
|
||||
* 对称性秘钥
|
||||
*/
|
||||
@TableField("aes_key")
|
||||
private String aesKey;
|
||||
/**
|
||||
* 角色编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String[] roleCodes;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String roleName;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.sxpcwlkj.system.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 lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 系统用户角色
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
||||
@TableName("sys_user_role")
|
||||
public class SysUserRole extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键编码
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String roleId;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 发生邮件bo
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
public class EmailBo {
|
||||
|
||||
@NotBlank(message = "邮箱不能为空",groups = {ValidatedGroupConfig.query.class,ValidatedGroupConfig.del.class})
|
||||
private String email;
|
||||
/**
|
||||
* 1:注册 2:登录 3:修改密码 4:支付密码 5:更换手机号
|
||||
*/
|
||||
@NotBlank(message = "类型不能为空",groups = {ValidatedGroupConfig.insert.class})
|
||||
private Integer type;
|
||||
|
||||
@NotBlank(message = "验证码不能为空",groups = {ValidatedGroupConfig.update.class})
|
||||
private String code;
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 登录bo
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
public class LoginBodyBo {
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@Size(min = 3, max = 16, message = "账号长度在{min}到{max}个字符")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
@NotBlank(message = "密码不能为空")
|
||||
@Size(min = 6, max = 32, message = "密码长度在{min}到{max}个字符")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 验证码Key
|
||||
*/
|
||||
private String codeKey;
|
||||
/**
|
||||
* uuid
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 租户ID(改为租户由后端控制)
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 记住我
|
||||
*/
|
||||
private Boolean rememberMe=true;
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 重置密码bo
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
public class ResetPwdBo {
|
||||
@NotBlank(message = "旧密码不能为空")
|
||||
@Size(min = 4, max = 16, message = "旧密码长度在{min}到{max}个字符")
|
||||
private String oldPassword;
|
||||
|
||||
@NotBlank(message = "新密码不能为空")
|
||||
@Size(min = 4, max = 16, message = "新密码长度在{min}到{max}个字符")
|
||||
private String password;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.logging.log4j.core.config.plugins.validation.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* 重置用户密码bo
|
||||
*
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
public class ResetPwdSuperBo {
|
||||
|
||||
@NotBlank(message = "用户ID不能为空")
|
||||
private String userId;
|
||||
|
||||
@NotBlank(message = "新密码不能为空")
|
||||
@Length(min = 6, max = 16, message = "新密码长度在{min}到{max}个字符")
|
||||
private String password;
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
import org.apache.logging.log4j.core.config.plugins.validation.constraints.NotBlank;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 管理员重置用户密码
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
public class SetUserRoleSuperBo {
|
||||
|
||||
@NotBlank(message = "用户ID不能为空")
|
||||
private String userId;
|
||||
|
||||
@NotEmpty(message = "角色至少选择一个")
|
||||
private List<String> roleCodes;
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 发生短信bo
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
public class SmsBo {
|
||||
|
||||
@NotBlank(message = "手机号不能为空",groups = {ValidatedGroupConfig.query.class,ValidatedGroupConfig.del.class})
|
||||
private String phone;
|
||||
/**
|
||||
* 1:绑定邮箱
|
||||
*/
|
||||
@NotBlank(message = "类型不能为空",groups = {ValidatedGroupConfig.insert.class})
|
||||
private Integer type;
|
||||
|
||||
@NotBlank(message = "验证码不能为空",groups = {ValidatedGroupConfig.update.class})
|
||||
private String code;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.system.entity.SysConfig;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统配置bo
|
||||
*
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@AutoMapper(target = SysConfig.class)
|
||||
public class SysConfigBo extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 配置名称
|
||||
*/
|
||||
private String configName;
|
||||
/**
|
||||
* 配置键
|
||||
*/
|
||||
private String configKey;
|
||||
/**
|
||||
* 配置类型
|
||||
*/
|
||||
private Integer configType;
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
private String configValue;
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
private List<String> configValues;
|
||||
/**
|
||||
* 配置值类型
|
||||
*/
|
||||
private String valueType;
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
private Integer index;
|
||||
|
||||
}
|
||||
72
mms-admin/src/main/java/com/sxpcwlkj/system/entity/bo/SysDeptBo.java
Executable file
72
mms-admin/src/main/java/com/sxpcwlkj/system/entity/bo/SysDeptBo.java
Executable file
@ -0,0 +1,72 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.system.entity.SysDept;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 系统部门Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = SysDept.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class SysDeptBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
@NotBlank(message = "部门编号不能为空",groups = {ValidatedGroupConfig.update.class})
|
||||
private String deptId;
|
||||
|
||||
/**
|
||||
* 父级编号
|
||||
*/
|
||||
@NotBlank(message = "父级编号不能为空",groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@NotBlank(message = "部门名称不能为空",groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
@NotBlank(message = "负责人不能为空",groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String leader;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
@NotBlank(message = "联系方式不能为空",groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
@Pattern(regexp = "^1[3456789]\\d{9}$",message = "手机号格式不正确",groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@NotBlank(message = "邮箱不能为空",groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
@Email(message = "邮箱格式不正确",groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@NotBlank(message = "详细地址不能为空")
|
||||
private String address;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.system.entity.SysDict;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统字典bo
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AutoMapper(target = SysDict.class)
|
||||
public class SysDictBo extends BaseEntity {
|
||||
|
||||
private String id;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
private String fieldName;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
|
||||
private List<SysDictDataBo> list;
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.system.entity.SysDictData;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 系统字典数据
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AutoMapper(target = SysDictData.class)
|
||||
public class SysDictDataBo extends BaseEntity {
|
||||
|
||||
private String id;
|
||||
|
||||
private String label;
|
||||
|
||||
private String fieldName;
|
||||
|
||||
private String value;
|
||||
|
||||
private String dictType;
|
||||
|
||||
|
||||
|
||||
private String colorType;
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.system.entity.SysFunction;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 系统资源bo
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AutoMapper(target = SysFunction.class)
|
||||
public class SysFunctionBo extends BaseEntity {
|
||||
/**
|
||||
* 菜单ID
|
||||
* */
|
||||
@NotBlank(message = "主键ID不能为空",groups = {ValidatedGroupConfig.update.class})
|
||||
private String id;
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
@NotBlank(message = "主键ID不能为空",groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String parentId;
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
@NotBlank(message = "主键ID不能为空",groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private String name;
|
||||
/**
|
||||
* i18n编码
|
||||
*/
|
||||
private String languageCode;
|
||||
/**
|
||||
* 权限标识
|
||||
*/
|
||||
private String permission;
|
||||
/**
|
||||
* 菜单类型
|
||||
*/
|
||||
@NotBlank(message = "菜单类型不能为空",groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Integer type;
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@Min(message = "显示顺序小于1",value = 1 ,groups = {ValidatedGroupConfig.insert.class,ValidatedGroupConfig.update.class})
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String path;
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
private String component;
|
||||
/**
|
||||
* 组件名
|
||||
*/
|
||||
private String componentName;
|
||||
/**
|
||||
* 状态;0正常 1停用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 是否可见
|
||||
*/
|
||||
private Integer visible;
|
||||
/**
|
||||
* 是否缓存
|
||||
*/
|
||||
private Integer keepAlive;
|
||||
/**
|
||||
* 链接地址
|
||||
*/
|
||||
private String isLink;
|
||||
/**
|
||||
* 是否外链
|
||||
*/
|
||||
private Integer isOpenLink;
|
||||
/**
|
||||
* 是否内嵌 true
|
||||
* 外链path=内嵌url
|
||||
*/
|
||||
private Integer isIframe;
|
||||
/**
|
||||
* 是否总是显示
|
||||
*/
|
||||
private Integer alwaysShow;
|
||||
|
||||
private Integer level=0;
|
||||
}
|
||||
50
mms-admin/src/main/java/com/sxpcwlkj/system/entity/bo/SysNoticeBo.java
Executable file
50
mms-admin/src/main/java/com/sxpcwlkj/system/entity/bo/SysNoticeBo.java
Executable file
@ -0,0 +1,50 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.system.entity.SysNotice;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 系统公告Bo
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = SysNotice.class, reverseConvertGenerate = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class SysNoticeBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 公告ID
|
||||
*/
|
||||
@NotBlank(message = "公告ID不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 公告标题
|
||||
*/
|
||||
@NotBlank(message = "公告标题不能为空")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 公告内容
|
||||
*/
|
||||
@NotBlank(message = "公告内容不能为空")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 公告类型
|
||||
*/
|
||||
@NotNull(message = "公告类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.system.entity.SysOss;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 对象存储bo
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AutoMapper(target = SysOss.class)
|
||||
public class SysOssBo extends BaseEntity {
|
||||
private String ossId;
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
|
||||
private String fileName;
|
||||
/**
|
||||
* 原名
|
||||
*/
|
||||
|
||||
private String originalName;
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
|
||||
private String fileSuffix;
|
||||
/**
|
||||
* URL地址
|
||||
*/
|
||||
|
||||
private String url;
|
||||
/**
|
||||
* MIME 类型
|
||||
*/
|
||||
private String contentType;
|
||||
/**
|
||||
* 基础存储路径
|
||||
*/
|
||||
private String basePath;
|
||||
/**
|
||||
* 存储平台
|
||||
*/
|
||||
private String platform;
|
||||
|
||||
private Boolean lookImg;
|
||||
}
|
||||
97
mms-admin/src/main/java/com/sxpcwlkj/system/entity/bo/SysOssConfigBo.java
Executable file
97
mms-admin/src/main/java/com/sxpcwlkj/system/entity/bo/SysOssConfigBo.java
Executable file
@ -0,0 +1,97 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.system.entity.SysOssConfig;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 对象存储配置表bo
|
||||
*
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@AutoMapper(target = SysOssConfig.class)
|
||||
public class SysOssConfigBo extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主建
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 配置key
|
||||
*/
|
||||
@NotBlank(message = "配置key不能为空")
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* accessKey
|
||||
*/
|
||||
@NotBlank(message = "accessKey不能为空")
|
||||
private String accessKey;
|
||||
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
@NotBlank(message = "秘钥不能为空")
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* 桶名称
|
||||
*/
|
||||
@NotBlank(message = "桶名称不能为空")
|
||||
private String bucketName;
|
||||
|
||||
/**
|
||||
* 前缀
|
||||
*/
|
||||
|
||||
private String prefix;
|
||||
|
||||
/**
|
||||
* 访问站点
|
||||
*/
|
||||
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
* 自定义域名
|
||||
*/
|
||||
@NotBlank(message = "自定义域名不能为空")
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 是否https
|
||||
*/
|
||||
|
||||
private String isHttps;
|
||||
|
||||
/**
|
||||
* 域
|
||||
*/
|
||||
|
||||
private String region;
|
||||
|
||||
/**
|
||||
* 桶权限类型
|
||||
*/
|
||||
|
||||
private String accessPolicy;
|
||||
|
||||
/**
|
||||
* 扩展字段
|
||||
*/
|
||||
|
||||
private String ext1;
|
||||
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.system.entity.SysRole;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* 系统角色
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AutoMapper(target = SysRole.class)
|
||||
public class SysRoleBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
@Min(message = "级别不能小于1",value = 1)
|
||||
private Integer level;
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@NotBlank(message = "角色名称不能为空")
|
||||
@Length(message = "角色名称长度控制在{min}~{max}之间",min = 2, max = 20)
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色权限字符串
|
||||
*/
|
||||
@NotBlank(message = "角色权限字符串不能为空")
|
||||
@Length(message = "角色权限字符串长度控制在{min}~{max}之间",min = 4, max = 20)
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 默认选中的节点
|
||||
*/
|
||||
@NotNull(message = "权限节点不能为空")
|
||||
private String[] defChecked;
|
||||
}
|
||||
@ -0,0 +1,149 @@
|
||||
package com.sxpcwlkj.system.entity.bo;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import com.sxpcwlkj.framework.config.ValidatedGroupConfig;
|
||||
import com.sxpcwlkj.system.entity.SysUser;
|
||||
import com.sxpcwlkj.system.entity.vo.SysRoleVo;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统用户bo
|
||||
*
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AutoMapper(target = SysUser.class, reverseConvertGenerate = false)
|
||||
public class SysUserBo extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidatedGroupConfig.update.class})
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
@NotEmpty(message = "部门不能为空", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
private String[] deptIds;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String department;
|
||||
/**
|
||||
* 岗位编号数组
|
||||
*/
|
||||
private String postIds;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@NotBlank(message = "账号不能为空", 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;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@NotBlank(message = "账号昵称不能为空", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
@Size(min = 2, max = 20, message = "账号昵称长度在2到20之间", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@NotBlank(message = "账号类型不能为空", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@NotBlank(message = "邮箱不能为空", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
@Email(message = "请正确填写邮箱", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Length(min = 11, max = 11, message = "手机号格式不正确", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 微信id
|
||||
*/
|
||||
private String wxOpenid;
|
||||
|
||||
/**
|
||||
* 微信开发者id
|
||||
*/
|
||||
private String wxUnOpenId;
|
||||
|
||||
/**
|
||||
* 性别;0:保密 1:男2:女
|
||||
*/
|
||||
@NotBlank(message = "性别不能为空", groups = {ValidatedGroupConfig.insert.class, ValidatedGroupConfig.update.class})
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotBlank(message = "密码不能为空", groups = {ValidatedGroupConfig.insert.class})
|
||||
@Size(min = 6, max = 32, message = "密码长度在{min}-{max}位之间", groups = {ValidatedGroupConfig.insert.class})
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 删除标志;0代表存在 2代表删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 最后登录ip
|
||||
*/
|
||||
private String loginIp;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
private Date loginDate;
|
||||
/**
|
||||
* 对称性秘钥
|
||||
*/
|
||||
private String aesKey;
|
||||
|
||||
/**
|
||||
* 用户拥有角色
|
||||
*/
|
||||
private List<SysRoleVo> roleVoList;
|
||||
/**
|
||||
* 用户角色集合
|
||||
*/
|
||||
private String[] roleCodes;
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String roleId;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private String roleName;
|
||||
|
||||
}
|
||||
62
mms-admin/src/main/java/com/sxpcwlkj/system/entity/export/SysDeptExport.java
Executable file
62
mms-admin/src/main/java/com/sxpcwlkj/system/entity/export/SysDeptExport.java
Executable file
@ -0,0 +1,62 @@
|
||||
package com.sxpcwlkj.system.entity.export;
|
||||
|
||||
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.system.entity.SysDept;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 系统部门Export
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = SysDept.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class SysDeptExport extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
@ExcelProperty("部门编号")
|
||||
private String deptId;
|
||||
/**
|
||||
* 父级编号
|
||||
*/
|
||||
@ExcelProperty("父级编号")
|
||||
private String parentId;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ExcelProperty("部门名称")
|
||||
private String deptName;
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
@ExcelProperty("负责人")
|
||||
private String leader;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
@ExcelProperty("联系方式")
|
||||
private String phone;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ExcelProperty("邮箱")
|
||||
private String email;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@ExcelProperty("详细地址")
|
||||
private String address;
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.sxpcwlkj.system.entity.export;
|
||||
|
||||
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.system.entity.SysNotice;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 系统公告Export
|
||||
*
|
||||
* @author 西决
|
||||
* @Doc <a href='https://www.mmsadmin.com'>MMS文档</a>
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = SysNotice.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class SysNoticeExport extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 公告ID
|
||||
*/
|
||||
@ExcelProperty("公告ID")
|
||||
private String id;
|
||||
/**
|
||||
* 公告标题
|
||||
*/
|
||||
@ExcelProperty("公告标题")
|
||||
private String title;
|
||||
/**
|
||||
* 公告内容
|
||||
*/
|
||||
@ExcelProperty("公告内容")
|
||||
private String content;
|
||||
/**
|
||||
* 公告类型
|
||||
*/
|
||||
@ExcelProperty("公告类型")
|
||||
private Integer type;
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package com.sxpcwlkj.system.entity.export;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.sxpcwlkj.common.annotation.Dict;
|
||||
import com.sxpcwlkj.common.annotation.PrintColumn;
|
||||
import com.sxpcwlkj.common.annotation.SensitivityEncrypt;
|
||||
import com.sxpcwlkj.common.enums.PrintTypeEnum;
|
||||
import com.sxpcwlkj.common.enums.SensitivityTypeEnum;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.sxpcwlkj.framework.interceptor.DictExcelConverter;
|
||||
import com.sxpcwlkj.system.entity.vo.SysUserVo;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户导出VO
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AutoMapper(target = SysUserVo.class)
|
||||
public class SysUserExportVo extends BaseEntityVo {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty("用户ID")
|
||||
@PrintColumn(title = "用户ID", type = PrintTypeEnum.TEXT)
|
||||
private String userId;
|
||||
/**
|
||||
* 部门ID
|
||||
* 忽略这个字段
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private String deptId;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ExcelProperty("部门名称")
|
||||
private String department;
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@ExcelProperty("用户账号")
|
||||
@PrintColumn(title = "用户账号", type = PrintTypeEnum.TEXT)
|
||||
private String userName;
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@ExcelProperty(value = "用户昵称")
|
||||
@PrintColumn(title = "用户昵称", type = PrintTypeEnum.TEXT)
|
||||
private String nickName;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@ExcelProperty("用户类型")
|
||||
private String userType;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ExcelProperty("邮箱")
|
||||
@PrintColumn(title = "邮箱", type = PrintTypeEnum.TEXT)
|
||||
private String email;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@ExcelProperty("手机号")
|
||||
@SensitivityEncrypt(type = SensitivityTypeEnum.PHONE)
|
||||
@PrintColumn(title = "手机号", type = PrintTypeEnum.TEXT)
|
||||
private String phoneNumber;
|
||||
/**
|
||||
* 性别;0:保密 1:男2:女
|
||||
*/
|
||||
@ExcelProperty(value = "性别", converter = DictExcelConverter.class)
|
||||
@Dict(value="SYS_SEX")
|
||||
@PrintColumn(title = "性别", type = PrintTypeEnum.TEXT)
|
||||
private String sex;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@ExcelProperty("头像")
|
||||
@PrintColumn(title = "头像", type = PrintTypeEnum.IMAGE, width = "50", height = "50")
|
||||
private String avatar;
|
||||
/**
|
||||
* 最后登录ip
|
||||
*/
|
||||
@ExcelProperty("最后登录ip")
|
||||
private String loginIp;
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
@ExcelProperty("最后登录时间")
|
||||
@PrintColumn(title = "最后登录时间", type = PrintTypeEnum.TEXT)
|
||||
private Date loginDate;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态", converter = DictExcelConverter.class)
|
||||
@Dict("SYS_STATE")
|
||||
private Integer status;
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.sxpcwlkj.system.entity.SysConfig;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@AutoMapper(target = SysConfig.class)
|
||||
public class SysConfigVo extends BaseEntityVo {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 配置名称
|
||||
*/
|
||||
private String configName;
|
||||
/**
|
||||
* 配置键
|
||||
*/
|
||||
private String configKey;
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
private String configValue;
|
||||
/**
|
||||
* 配置类型
|
||||
*/
|
||||
private Integer configType;
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
private List<String> configValues;
|
||||
/**
|
||||
* 配置值类型
|
||||
*/
|
||||
private String valueType;
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
private Integer index;
|
||||
|
||||
private Integer status;
|
||||
}
|
||||
66
mms-admin/src/main/java/com/sxpcwlkj/system/entity/vo/SysDeptVo.java
Executable file
66
mms-admin/src/main/java/com/sxpcwlkj/system/entity/vo/SysDeptVo.java
Executable file
@ -0,0 +1,66 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.system.entity.SysDept;
|
||||
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 = SysDept.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class SysDeptVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
@ExcelProperty("部门编号")
|
||||
private String deptId;
|
||||
/**
|
||||
* 父级编号
|
||||
*/
|
||||
@ExcelProperty("父级编号")
|
||||
private String parentId;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ExcelProperty("部门名称")
|
||||
private String deptName;
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
@ExcelProperty("负责人")
|
||||
private String leader;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
@ExcelProperty("联系方式")
|
||||
private String phone;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ExcelProperty("邮箱")
|
||||
private String email;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@ExcelProperty("详细地址")
|
||||
private String address;
|
||||
private String[] deptIds;
|
||||
List<SysDeptVo> children;
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
import com.sxpcwlkj.system.entity.SysDictData;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 字典数据
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = SysDictData.class)
|
||||
public class SysDictDataVo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String label;
|
||||
|
||||
private String fieldName;
|
||||
|
||||
private String value;
|
||||
|
||||
private String dictType;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
private String status;
|
||||
|
||||
private String colorType;
|
||||
|
||||
private String revision;
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
import com.sxpcwlkj.system.entity.SysDict;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统字典
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = SysDict.class)
|
||||
public class SysDictVo {
|
||||
private String id;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 字段名
|
||||
*/
|
||||
private String fieldName;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 状态;0正常 1停用
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private Date createdTime;
|
||||
|
||||
private String revision;
|
||||
/**
|
||||
* 字典值
|
||||
*/
|
||||
private List<SysDictDataVo> list;
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
import com.sxpcwlkj.system.entity.SysFunction;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 系统资源
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = SysFunction.class)
|
||||
public class SysFunctionVo {
|
||||
|
||||
private String id;
|
||||
/**
|
||||
* 父菜单ID
|
||||
*/
|
||||
private String parentId;
|
||||
//上级菜单
|
||||
private String[] menuSuperior;
|
||||
/**
|
||||
* 路由名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* i18n编码
|
||||
*/
|
||||
private String languageCode;
|
||||
/**
|
||||
* 权限标识
|
||||
*/
|
||||
private String permission;
|
||||
/**
|
||||
* 菜单类型
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
// 路由重定向,有子集 children 时
|
||||
private String redirectPath;
|
||||
/**
|
||||
* 路由路径
|
||||
*/
|
||||
private String path;
|
||||
/**
|
||||
* 菜单图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
private String component;
|
||||
/**
|
||||
* 组件名
|
||||
*/
|
||||
private String componentName;
|
||||
/**
|
||||
* 状态;0正常 1停用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 是否可见
|
||||
*/
|
||||
private Integer visible;
|
||||
/**
|
||||
* 是否缓存
|
||||
*/
|
||||
private Integer keepAlive;
|
||||
/**
|
||||
* 链接地址
|
||||
*/
|
||||
private String isLink;
|
||||
/**
|
||||
* 是否外链
|
||||
*/
|
||||
private Integer isOpenLink;
|
||||
/**
|
||||
* 是否内嵌 true
|
||||
* isLink
|
||||
*/
|
||||
private Integer isIframe;
|
||||
/**
|
||||
* 是否总是显示
|
||||
*/
|
||||
private Integer alwaysShow;
|
||||
|
||||
|
||||
private String revision;
|
||||
|
||||
private Map<String,Object> meta;
|
||||
|
||||
private List<SysFunctionVo> children;
|
||||
}
|
||||
49
mms-admin/src/main/java/com/sxpcwlkj/system/entity/vo/SysNoticeVo.java
Executable file
49
mms-admin/src/main/java/com/sxpcwlkj/system/entity/vo/SysNoticeVo.java
Executable file
@ -0,0 +1,49 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
|
||||
import java.io.Serial;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.system.entity.SysNotice;
|
||||
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 = SysNotice.class)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class SysNoticeVo extends BaseEntityVo{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 公告ID
|
||||
*/
|
||||
@ExcelProperty("公告ID")
|
||||
private String id;
|
||||
/**
|
||||
* 公告标题
|
||||
*/
|
||||
@ExcelProperty("公告标题")
|
||||
private String title;
|
||||
/**
|
||||
* 公告内容
|
||||
*/
|
||||
@ExcelProperty("公告内容")
|
||||
private String content;
|
||||
/**
|
||||
* 公告类型
|
||||
*/
|
||||
@ExcelProperty("公告类型")
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
72
mms-admin/src/main/java/com/sxpcwlkj/system/entity/vo/SysOssConfigVo.java
Executable file
72
mms-admin/src/main/java/com/sxpcwlkj/system/entity/vo/SysOssConfigVo.java
Executable file
@ -0,0 +1,72 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.sxpcwlkj.system.entity.SysOssConfig;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 对象存储配置表
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@AutoMapper(target = SysOssConfig.class)
|
||||
public class SysOssConfigVo extends BaseEntityVo {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主建
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 配置key
|
||||
*/
|
||||
private String configKey;
|
||||
/**
|
||||
* accessKey
|
||||
*/
|
||||
private String accessKey;
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
private String secretKey;
|
||||
/**
|
||||
* 桶名称
|
||||
*/
|
||||
private String bucketName;
|
||||
/**
|
||||
* 前缀
|
||||
*/
|
||||
private String prefix;
|
||||
/**
|
||||
* 访问站点
|
||||
*/
|
||||
private String endpoint;
|
||||
/**
|
||||
* 自定义域名
|
||||
*/
|
||||
private String domain;
|
||||
/**
|
||||
* 是否https
|
||||
*/
|
||||
private String isHttps;
|
||||
/**
|
||||
* 域
|
||||
*/
|
||||
private String region;
|
||||
/**
|
||||
* 桶权限类型
|
||||
*/
|
||||
private String accessPolicy;
|
||||
/**
|
||||
* 扩展字段 storagePath
|
||||
*/
|
||||
private String ext1;
|
||||
|
||||
private Integer status;
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
import com.sxpcwlkj.system.entity.SysOss;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 对象存储
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = SysOss.class)
|
||||
public class SysOssVo {
|
||||
private String ossId;
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
|
||||
private String fileName;
|
||||
/**
|
||||
* 原名
|
||||
*/
|
||||
|
||||
private String originalName;
|
||||
/**
|
||||
* 文件后缀名
|
||||
*/
|
||||
|
||||
private String fileSuffix;
|
||||
/**
|
||||
* URL地址
|
||||
*/
|
||||
|
||||
private String url;
|
||||
/**
|
||||
* MIME 类型
|
||||
*/
|
||||
private String contentType;
|
||||
/**
|
||||
* 基础存储路径
|
||||
*/
|
||||
private String basePath;
|
||||
/**
|
||||
* 存储平台
|
||||
*/
|
||||
private String platform;
|
||||
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Date createdTime;
|
||||
|
||||
private String base64;
|
||||
|
||||
private String width;
|
||||
|
||||
private String height;
|
||||
|
||||
private String size;
|
||||
|
||||
private String revision;
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
import com.sxpcwlkj.system.entity.AdminMenuTree;
|
||||
import com.sxpcwlkj.system.entity.SysRole;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户角色
|
||||
*
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AutoMapper(target = SysRole.class)
|
||||
public class SysRoleVo {
|
||||
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色权限字符串
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 状态;0正常 1停用
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
|
||||
/**
|
||||
* 角色拥有的资源
|
||||
*/
|
||||
private List<SysFunctionVo> sysFunctionVoList;
|
||||
/**
|
||||
* 用户角色资源集合
|
||||
*/
|
||||
private String[] permissions;
|
||||
|
||||
private Date createdTime;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String revision;
|
||||
/**
|
||||
* 系统资源
|
||||
*/
|
||||
private List<AdminMenuTree> functionTree;
|
||||
/**
|
||||
* 默认选中的节点
|
||||
*/
|
||||
private String[] defChecked;
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
|
||||
import com.sxpcwlkj.common.properties.MsProperties;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 系统租户
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class SysTenantVo {
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
private String tenantId;
|
||||
/**
|
||||
* 租户名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
private MsProperties properties;
|
||||
|
||||
private String revision;
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sxpcwlkj.system.entity.SysUserRole;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户角色
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
@Data
|
||||
@AutoMapper(target = SysUserRole.class)
|
||||
public class SysUserRoleVo {
|
||||
|
||||
/**
|
||||
* 主键编码
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
private String revision;
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package com.sxpcwlkj.system.entity.vo;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.sxpcwlkj.common.annotation.Dict;
|
||||
import com.sxpcwlkj.common.annotation.SensitivityEncrypt;
|
||||
import com.sxpcwlkj.common.enums.SensitivityTypeEnum;
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.sxpcwlkj.system.entity.SysUser;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*
|
||||
* @author xijue
|
||||
* @Doc mmsadmin.cn
|
||||
*/
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AutoMapper(target = SysUser.class)
|
||||
public class SysUserVo extends BaseEntityVo {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty("用户ID")
|
||||
private String userId;
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private String deptId;
|
||||
private String[] deptIds;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ExcelProperty("部门名称")
|
||||
private String department;
|
||||
/**
|
||||
* 岗位编号数组
|
||||
*/
|
||||
private String postIds;
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String userType;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@SensitivityEncrypt(type = SensitivityTypeEnum.PHONE)
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 微信id
|
||||
*/
|
||||
|
||||
private String wxOpenid;
|
||||
|
||||
/**
|
||||
* 微信开发者id
|
||||
*/
|
||||
|
||||
private String wxUnOpenId;
|
||||
|
||||
/**
|
||||
* 性别;0:保密 1:男2:女
|
||||
*/
|
||||
|
||||
@Dict("SYS_SEX")
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 密码强度
|
||||
*/
|
||||
private String passwordStrength;
|
||||
|
||||
/**
|
||||
* 删除标志;0代表存在 2代表删除
|
||||
*/
|
||||
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 最后登录ip
|
||||
*/
|
||||
|
||||
private String loginIp;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
|
||||
private Date loginDate;
|
||||
/**
|
||||
* 对称性秘钥
|
||||
*/
|
||||
private String aesKey;
|
||||
|
||||
/**
|
||||
* 用户拥有角色
|
||||
*/
|
||||
private List<SysRoleVo> roleVoList;
|
||||
/**
|
||||
* 用户角色集合
|
||||
*/
|
||||
private String[] roleCodes;
|
||||
|
||||
private String[] butCodes;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private String roleName;
|
||||
/**
|
||||
* 用户状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysConfig;
|
||||
import com.sxpcwlkj.system.entity.vo.SysConfigVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-06-10
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysConfigMapper extends BaseMapperPlus<SysConfig, SysConfigVo> {
|
||||
|
||||
}
|
||||
19
mms-admin/src/main/java/com/sxpcwlkj/system/mapper/SysDeptMapper.java
Executable file
19
mms-admin/src/main/java/com/sxpcwlkj/system/mapper/SysDeptMapper.java
Executable file
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysDept;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDeptVo;
|
||||
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 SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysDictData;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDictDataVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysDictDataMapper extends BaseMapperPlus<SysDictData, SysDictDataVo> {
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
Page<SysDictDataVo> selectByPage(@Param("page") Page<SysDictData> page, @Param(Constants.WRAPPER) Wrapper<SysDictData> queryWrapper);
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysDict;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDictVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysDictMapper extends BaseMapperPlus<SysDict, SysDictVo> {
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
Page<SysDictVo> selectByPage(@Param("page") Page<SysDict> page, @Param(Constants.WRAPPER) Wrapper<SysDict> queryWrapper);
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysFunction;
|
||||
import com.sxpcwlkj.system.entity.vo.SysFunctionVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 系统资源
|
||||
* @Author sxpcwlkj
|
||||
* @Date 2024/1/2 17:37
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysFunctionMapper extends BaseMapperPlus<SysFunction, SysFunctionVo> {
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
@Select("SELECT f.* FROM `sys_role_function` rf RIGHT JOIN `sys_function` f ON rf.`function_id`=f.`id` WHERE rf.`role_id`=#{id} and rf.`status`=1 ORDER BY f.`parent_id` ASC , f.`sort` DESC")
|
||||
List<SysFunction> selectByRoleForIds(@Param("id") String id);
|
||||
}
|
||||
19
mms-admin/src/main/java/com/sxpcwlkj/system/mapper/SysNoticeMapper.java
Executable file
19
mms-admin/src/main/java/com/sxpcwlkj/system/mapper/SysNoticeMapper.java
Executable file
@ -0,0 +1,19 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysNotice;
|
||||
import com.sxpcwlkj.system.entity.vo.SysNoticeVo;
|
||||
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 SysNoticeMapper extends BaseMapperPlus<SysNotice, SysNoticeVo> {
|
||||
|
||||
}
|
||||
21
mms-admin/src/main/java/com/sxpcwlkj/system/mapper/SysOssConfigMapper.java
Executable file
21
mms-admin/src/main/java/com/sxpcwlkj/system/mapper/SysOssConfigMapper.java
Executable file
@ -0,0 +1,21 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysOssConfig;
|
||||
import com.sxpcwlkj.system.entity.vo.SysOssConfigVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
/**
|
||||
* 对象存储配置表
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-07-07
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysOssConfigMapper extends BaseMapperPlus<SysOssConfig, SysOssConfigVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysOss;
|
||||
import com.sxpcwlkj.system.entity.vo.SysOssVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
/**
|
||||
* @Description oss
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysOssMapper extends BaseMapperPlus<SysOss, SysOssVo> {
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
Page<SysOssVo> selectByPage(@Param("page") Page<SysOss> page, @Param(Constants.WRAPPER) Wrapper<SysOss> queryWrapper);
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sxpcwlkj.system.entity.SysFunction;
|
||||
import com.sxpcwlkj.system.entity.SysRoleFunction;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 角色资源
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysRoleFunctionMapper extends BaseMapper<SysRoleFunction> {
|
||||
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
@Select("SELECT f.* FROM `sys_function` f LEFT JOIN `sys_role_function` o ON f.`id`=o.`function_id` WHERE o.`role_id`=#{roldId} ORDER BY f.`sort` ")
|
||||
List<SysFunction> selectByRoleId(@Param("roldId") String roldId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysRole;
|
||||
import com.sxpcwlkj.system.entity.SysUser;
|
||||
import com.sxpcwlkj.system.entity.vo.SysRoleVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 系统角色
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysRoleMapper extends BaseMapperPlus<SysRole,SysRoleVo> {
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
Page<SysRoleVo> selectPageList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询用户的最高的一个角色
|
||||
* @param userId id
|
||||
* @return vo
|
||||
*/
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
SysRoleVo selectByUserId(@Param("userId") String userId);
|
||||
/**
|
||||
* 查询用户所有角色
|
||||
* @param userId id
|
||||
* @return vo
|
||||
*/
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
List<SysRoleVo> selectByUserIdList(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 根据角色编码查询
|
||||
* @param roleCode 编码
|
||||
* @return vo
|
||||
*/
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
SysRoleVo selectByCode(@Param("roleCode") String roleCode);
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sxpcwlkj.system.entity.SysTenant;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysTenantMapper extends BaseMapper<SysTenant> {
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysUser;
|
||||
import com.sxpcwlkj.system.entity.vo.SysUserVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
|
||||
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
Page<SysUserVo> selectPageUserList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
SysUser selectByUserName(@Param("userName") String userName);
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
SysUser selectByUserPhone(@Param("userPhone") String userPhone);
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
SysUser selectByUserEmail(@Param("userEmail") String userEmail);
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
int updateRsa(@Param("tenantId") String tenantId, @Param("userId") String userId, @Param("publicKey") String publicKey,@Param("priverKey") String priverKey);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.sxpcwlkj.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.system.entity.SysRole;
|
||||
import com.sxpcwlkj.system.entity.SysUserRole;
|
||||
import com.sxpcwlkj.system.entity.vo.SysUserRoleVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 用户角色
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface SysUserRoleMapper extends BaseMapperPlus<SysUserRole, SysUserRoleVo> {
|
||||
|
||||
/**
|
||||
* 用户的角色
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
@Select("SELECT r.* FROM `sys_user_role` ur LEFT JOIN `sys_role` r ON ur.`role_id`=r.`id` WHERE ur.`user_id`=#{userId} ORDER BY r.`sort` ")
|
||||
List<SysRole> roleList(@Param("userId") String userId);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.sxpcwlkj.system.runner;
|
||||
|
||||
|
||||
import com.sxpcwlkj.system.service.SysConfigService;
|
||||
import com.sxpcwlkj.system.service.SysDictService;
|
||||
import com.sxpcwlkj.system.service.SysOssConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xijue
|
||||
* @ClassName SystemRunner
|
||||
* @description: 项目初始化
|
||||
* @date 2024年03月29日
|
||||
* @version: 1.0
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Order(1) // 可以通过@Order注解指定执行顺序,数字越小越先执行
|
||||
public class SystemRunner implements CommandLineRunner {
|
||||
|
||||
private final ApplicationContext applicationContext;
|
||||
private final SysDictService sysDictService;
|
||||
private final SysOssConfigService sysOssConfigService;
|
||||
private final SysConfigService sysConfigService;
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
// 在这里执行启动时需要执行的操作
|
||||
|
||||
log.info("=== 1.字典已初始化:"+sysDictService.initSysDict(null)+"个: ===");
|
||||
|
||||
log.info("=== 2.Oss配置已初始化:"+sysOssConfigService.initOss()+ "===");
|
||||
|
||||
log.info("=== 3.Base配置已初始化:"+sysConfigService.initBase()+ "===");
|
||||
|
||||
log.info("=== 4.Sms配置已初始化:"+sysConfigService.initSms()+ "===");
|
||||
|
||||
log.info("=== 5.Email配置已初始化:"+sysConfigService.initEmail()+ "===");
|
||||
|
||||
log.info("=== 6.Wx配置已初始化:"+sysConfigService.initWx()+ "===");
|
||||
|
||||
applicationContext.publishEvent(new ContextRefreshedEvent(applicationContext));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface CaptchaService {
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
* @param type 0:注册 1:登录
|
||||
* @param code 对象唯一code
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getCaptcha(Integer type, String code);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.system.entity.SysConfig;
|
||||
import com.sxpcwlkj.system.entity.bo.SysConfigBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysConfigVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-06-10
|
||||
*/
|
||||
public interface SysConfigService extends BaseService<SysConfig, SysConfigVo, SysConfigBo> {
|
||||
Boolean updateByCodes(List<SysConfigBo> bos);
|
||||
|
||||
List<SysConfigVo> selectByCodes(List<SysConfigBo> bos);
|
||||
|
||||
Boolean initSms();
|
||||
|
||||
Boolean initBase();
|
||||
|
||||
Boolean getIsOpenCaptcha();
|
||||
|
||||
Boolean initEmail();
|
||||
|
||||
Boolean initWx();
|
||||
}
|
||||
40
mms-admin/src/main/java/com/sxpcwlkj/system/service/SysDeptService.java
Executable file
40
mms-admin/src/main/java/com/sxpcwlkj/system/service/SysDeptService.java
Executable file
@ -0,0 +1,40 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.system.entity.SysDept;
|
||||
import com.sxpcwlkj.system.entity.bo.SysDeptBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDeptVo;
|
||||
import com.sxpcwlkj.system.entity.export.SysDeptExport;
|
||||
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 SysDeptService extends BaseService<SysDept, SysDeptVo, SysDeptBo> {
|
||||
/**
|
||||
* 系统部门列表
|
||||
* @param isAll true:全部数据 false:有效数据(status=0)
|
||||
* @param showLevel 显示级别,0:全部 1:一级 2:二级 3:三级
|
||||
* @return 系统部门数结构列表
|
||||
*/
|
||||
List<SysDeptVo> queryTree(boolean isAll,int showLevel);
|
||||
|
||||
/**
|
||||
* 按照系统部门ID,查询下级所有系统部门
|
||||
*
|
||||
* @param id 系统部门ID
|
||||
* @param endList 最终的数据
|
||||
*/
|
||||
void queryListSon(String id, List<SysDeptVo> endList);
|
||||
/**
|
||||
* 导出系统部门
|
||||
* @param list 系统部门列表
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean imports(Set<SysDeptExport> list);
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.system.entity.bo.SysDictDataBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDictDataVo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
public interface SysDictDataService {
|
||||
TableDataInfo<SysDictDataVo> selectPageList(SysDictDataBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param id ID
|
||||
* @return vo
|
||||
*/
|
||||
SysDictDataVo selectVoById(Long id);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean updateById(SysDictDataBo bo);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean insert(SysDictDataBo bo);
|
||||
/**
|
||||
* 删除
|
||||
* @param
|
||||
* @return vo
|
||||
*/
|
||||
Boolean deleteById(Serializable id);
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.system.entity.bo.SysDictBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDictDataVo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDictVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
public interface SysDictService {
|
||||
TableDataInfo<SysDictVo> selectPageList(SysDictBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param id ID
|
||||
* @return vo
|
||||
*/
|
||||
SysDictVo selectVoById(Long id);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean updateById(SysDictBo bo);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean insert(SysDictBo bo);
|
||||
/**
|
||||
* 删除
|
||||
* @param
|
||||
* @return vo
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 初始化字典
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
Integer initSysDict(String code);
|
||||
|
||||
/**
|
||||
* 获取字典值列表
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
List<SysDictDataVo> getSysDictByCode(String code);
|
||||
|
||||
/**
|
||||
* 获取所有字典列表
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> selectAll();
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.system.entity.AdminMenuTree;
|
||||
import com.sxpcwlkj.system.entity.bo.SysFunctionBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysFunctionVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
public interface SysFunctionService {
|
||||
|
||||
List<SysFunctionVo> selectPageList(SysFunctionBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param id ID
|
||||
* @return vo
|
||||
*/
|
||||
SysFunctionVo selectVoById(String id);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean updateById(SysFunctionBo bo);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean insert(SysFunctionBo bo);
|
||||
/**
|
||||
* 删除
|
||||
* @param
|
||||
* @return vo
|
||||
*/
|
||||
Boolean deleteById(String id);
|
||||
|
||||
List<AdminMenuTree> getAllMenuTree();
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.system.entity.SysUser;
|
||||
import com.sxpcwlkj.system.entity.bo.LoginBodyBo;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @ClassName SysLoginService
|
||||
* @Description TODO
|
||||
* @Author 西决
|
||||
* @Date 2022/12/25 12:04
|
||||
*/
|
||||
public interface SysLoginService {
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
* @param loginBodyBo bo
|
||||
* @return vo
|
||||
*/
|
||||
String login(HttpServletRequest request,LoginBodyBo loginBodyBo);
|
||||
|
||||
/**
|
||||
* 用户注销
|
||||
*/
|
||||
void logout();
|
||||
|
||||
/**
|
||||
* 验证码验证
|
||||
* @param username
|
||||
* @param code
|
||||
* @param uuid
|
||||
*/
|
||||
void verfyCaptcha(String username,String codeKey, String code, String uuid);
|
||||
|
||||
/**
|
||||
* 租户验证
|
||||
* @param sysUser
|
||||
*/
|
||||
void verfyTenement(SysUser sysUser);
|
||||
|
||||
/**
|
||||
* 系统用户登录更新信息
|
||||
* @param sysUser
|
||||
*/
|
||||
void updateSysUser(HttpServletRequest request,SysUser sysUser);
|
||||
}
|
||||
25
mms-admin/src/main/java/com/sxpcwlkj/system/service/SysNoticeService.java
Executable file
25
mms-admin/src/main/java/com/sxpcwlkj/system/service/SysNoticeService.java
Executable file
@ -0,0 +1,25 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.system.entity.SysNotice;
|
||||
import com.sxpcwlkj.system.entity.bo.SysNoticeBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysNoticeVo;
|
||||
import com.sxpcwlkj.system.entity.export.SysNoticeExport;
|
||||
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 SysNoticeService extends BaseService<SysNotice, SysNoticeVo, SysNoticeBo> {
|
||||
/**
|
||||
* 导出系统公告
|
||||
* @param list 系统公告列表
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean imports(Set<SysNoticeExport> list);
|
||||
}
|
||||
51
mms-admin/src/main/java/com/sxpcwlkj/system/service/SysOssConfigService.java
Executable file
51
mms-admin/src/main/java/com/sxpcwlkj/system/service/SysOssConfigService.java
Executable file
@ -0,0 +1,51 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.common.code.entity.FileStorageConfig;
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.system.entity.SysOssConfig;
|
||||
import com.sxpcwlkj.system.entity.bo.SysOssConfigBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysOssConfigVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对象存储配置表
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-07-07
|
||||
*/
|
||||
public interface SysOssConfigService extends BaseService<SysOssConfig, SysOssConfigVo, SysOssConfigBo> {
|
||||
|
||||
/**
|
||||
* 查询默认存储
|
||||
* @return
|
||||
*/
|
||||
String queryDef();
|
||||
|
||||
/**
|
||||
* 根据 Key 查询配置
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
SysOssConfigVo selectVoByKey(String key);
|
||||
|
||||
/**
|
||||
* 设置配置
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
Boolean updateByIdXml(SysOssConfigBo bo);
|
||||
|
||||
/**
|
||||
* 查询配置列表
|
||||
* @return
|
||||
*/
|
||||
List<FileStorageConfig> getOss();
|
||||
|
||||
/**
|
||||
* 初始化配置
|
||||
* @return
|
||||
*/
|
||||
Boolean initOss();
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.system.entity.bo.SysOssBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysOssVo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
public interface SysOssService {
|
||||
TableDataInfo<SysOssVo> selectPageList(SysOssBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param id ID
|
||||
* @return vo
|
||||
*/
|
||||
SysOssVo selectVoById(Long id) ;
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean updateById(SysOssBo bo);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean insert(SysOssBo bo);
|
||||
/**
|
||||
* 删除
|
||||
* @param
|
||||
* @return vo
|
||||
*/
|
||||
Boolean deleteById(Serializable id);
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.system.entity.bo.SysRoleBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysRoleVo;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
|
||||
public interface SysRoleService {
|
||||
TableDataInfo<SysRoleVo> selectPageUserList(SysRoleBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param id ID
|
||||
* @return vo
|
||||
*/
|
||||
SysRoleVo selectVoById(String id);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean updateById(SysRoleBo bo);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean insert(SysRoleBo bo);
|
||||
/**
|
||||
* 删除
|
||||
* @param
|
||||
* @return vo
|
||||
*/
|
||||
Boolean deleteById(String id);
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.system.entity.SysTenant;
|
||||
import com.sxpcwlkj.system.entity.vo.SysTenantVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysTenantService {
|
||||
|
||||
/**
|
||||
* 查询出系统启用的租户列表
|
||||
* @return
|
||||
*/
|
||||
List<SysTenantVo> selectOpenList();
|
||||
|
||||
/**
|
||||
* 租户查询
|
||||
* @param tenantId
|
||||
* @return
|
||||
*/
|
||||
SysTenant selectById(String tenantId);
|
||||
}
|
||||
@ -0,0 +1,185 @@
|
||||
package com.sxpcwlkj.system.service;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.system.entity.AdminMenuTree;
|
||||
import com.sxpcwlkj.system.entity.SysUser;
|
||||
import com.sxpcwlkj.system.entity.bo.ResetPwdBo;
|
||||
import com.sxpcwlkj.system.entity.bo.ResetPwdSuperBo;
|
||||
import com.sxpcwlkj.system.entity.bo.SetUserRoleSuperBo;
|
||||
import com.sxpcwlkj.system.entity.bo.SysUserBo;
|
||||
import com.sxpcwlkj.system.entity.export.SysUserExportVo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysUserVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author XIjue
|
||||
*/
|
||||
public interface SysUserService {
|
||||
|
||||
/**
|
||||
* 分页查询用户列表
|
||||
* @param user 用户信息
|
||||
* @param pageQuery 分页参数
|
||||
* @return 用户列表
|
||||
*/
|
||||
TableDataInfo<SysUserVo> selectPageUserList(SysUserBo user, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
* @param bo 对象
|
||||
* @return vo
|
||||
*/
|
||||
Boolean insert(SysUserBo bo);
|
||||
|
||||
/**
|
||||
* 根据用户Id
|
||||
* @param userId 用户id
|
||||
* @return vo
|
||||
*/
|
||||
SysUserVo selectVoById(String userId);
|
||||
|
||||
/**
|
||||
* 编辑用户
|
||||
* @param bo 对象
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean updateById(SysUserBo bo);
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
* @param ids 用户id[]
|
||||
* @return vo
|
||||
*/
|
||||
Boolean deleteById(String ids);
|
||||
|
||||
/**
|
||||
* 导出用户
|
||||
* @param list 用户列表
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean imports(Set<SysUserExportVo> list);
|
||||
|
||||
/**
|
||||
* 根据用户名查询用户
|
||||
* @param tenantId 租户id
|
||||
* @param userName 用户名
|
||||
* @return 用户
|
||||
*/
|
||||
SysUser selectByUserName(String tenantId, String userName);
|
||||
|
||||
/**
|
||||
* 用户更新秘钥对
|
||||
* @param tenantId 租户id
|
||||
* @param userId 用户id
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean updateRsa(String tenantId, String userId);
|
||||
|
||||
/**
|
||||
* 获取用户的角色,权限,基本信息
|
||||
* @param userId 用户id
|
||||
* @return vo
|
||||
*/
|
||||
SysUserVo getUserRoleAnfFunctionInfo(String userId);
|
||||
|
||||
/**
|
||||
* 获取当前登录对象的菜单
|
||||
* @param userId 用户id
|
||||
* @return 菜单列表
|
||||
*/
|
||||
List<AdminMenuTree> getAdminMenuTree(String userId);
|
||||
|
||||
/**
|
||||
* 更新头像
|
||||
* @param headerImg 头像
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean updateHeaderImgById(String headerImg);
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
* @param bo 对象
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean resetPwd(ResetPwdBo bo);
|
||||
|
||||
/**
|
||||
* 根据手机号查询用户
|
||||
* @param phone 手机号
|
||||
* @return 用户
|
||||
*/
|
||||
SysUserVo selectVoByPhone(String phone);
|
||||
|
||||
/**
|
||||
* 根据手机号查询用户
|
||||
* @param email email
|
||||
* @return 用户
|
||||
*/
|
||||
SysUserVo selectVoByEmail(String email);
|
||||
|
||||
/**
|
||||
* 查询所有用户
|
||||
* @return 用户列表
|
||||
*/
|
||||
List<SysUserVo> selectAll();
|
||||
|
||||
/**
|
||||
* 超级管理员重置用户密码
|
||||
* @param bo 对象
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean resetPwdSuper(ResetPwdSuperBo bo);
|
||||
|
||||
/**
|
||||
* 设置用户角色
|
||||
* @param bo 对象
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean setUserRoleSuper(SetUserRoleSuperBo bo);
|
||||
|
||||
/**
|
||||
* 解绑手机号
|
||||
* @param 1:解绑手机号 2:解绑邮箱 3:解绑微信
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean unbind(int type);
|
||||
|
||||
/**
|
||||
* 绑定手机号
|
||||
* @param phone 绑定的新手机号
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean bindingPhone(String phone);
|
||||
|
||||
/**
|
||||
* 绑定手机号
|
||||
* @param email 绑定的email
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
Boolean bindingEmail(String email);
|
||||
|
||||
|
||||
/**
|
||||
* 获取登录对象信息
|
||||
* @return 用户信息
|
||||
*/
|
||||
Map<String,Object> getUserInfo(SysUserVo sysUser);
|
||||
|
||||
/**
|
||||
* 根据openId查询用户
|
||||
* @param openId 微信openId
|
||||
* @return 用户信息
|
||||
*/
|
||||
SysUserVo selectOpenId(String openId);
|
||||
|
||||
/**
|
||||
* 绑定微信openId
|
||||
* @param openId 微信openId
|
||||
* @return true:成功 false :失败
|
||||
*/
|
||||
boolean bindingOpenId(String openId);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,257 @@
|
||||
package com.sxpcwlkj.system.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
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.code.entity.ConfigEntity;
|
||||
import com.sxpcwlkj.common.constant.CacheConstants;
|
||||
import com.sxpcwlkj.common.enums.ConfigKeyNum;
|
||||
import com.sxpcwlkj.common.enums.SystemCommonEnum;
|
||||
import com.sxpcwlkj.common.exception.MmsException;
|
||||
import com.sxpcwlkj.common.utils.BeanCopyUtil;
|
||||
import com.sxpcwlkj.common.utils.DataUtil;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
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.redis.RedisUtil;
|
||||
import com.sxpcwlkj.system.entity.SysConfig;
|
||||
import com.sxpcwlkj.system.entity.bo.SysConfigBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysConfigVo;
|
||||
import com.sxpcwlkj.system.mapper.SysConfigMapper;
|
||||
import com.sxpcwlkj.system.service.SysConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*
|
||||
* @author XIjue
|
||||
* @since 1.0.0 2024-06-10
|
||||
*/
|
||||
@Slf4j
|
||||
@Service("sys_config")
|
||||
@RequiredArgsConstructor
|
||||
public class SysConfigServiceImpl extends BaseServiceImpl<SysConfig, SysConfigVo, SysConfigBo> implements SysConfigService {
|
||||
|
||||
private final SysConfigMapper baseMapper;
|
||||
private final ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<SysConfig, SysConfigVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean insert(SysConfigBo bo) {
|
||||
int row;
|
||||
SysConfig obj = MapstructUtil.convert(bo, SysConfig.class);
|
||||
if (obj != null && obj.getValueType() != null && !obj.getValueType().isEmpty()) {
|
||||
if ("Array".equals(obj.getValueType())) {
|
||||
List<String> list = bo.getConfigValues();
|
||||
String result = DataUtil.getListToString(list);
|
||||
obj.setConfigValue(result);
|
||||
}
|
||||
}
|
||||
assert obj != null;
|
||||
SysConfigVo sysConfigVo = this.getBaseMapper().selectVoOne(new LambdaQueryWrapper<SysConfig>().eq(SysConfig::getConfigKey, obj.getConfigKey()).last("LIMIT 1"));
|
||||
if(sysConfigVo!=null){
|
||||
throw new MmsException("配置key已存在");
|
||||
}
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable ids) {
|
||||
String[] array = DataUtil.getCatStr(ids.toString(), ",");
|
||||
return this.getBaseMapper().deleteByIds(new ArrayList<>(List.of(array)))>0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(SysConfigBo bo) {
|
||||
int row = 0;
|
||||
SysConfig obj = MapstructUtil.convert(bo, SysConfig.class);
|
||||
if (obj != null && obj.getValueType() != null && !obj.getValueType().isEmpty()) {
|
||||
if ("Array".equals(obj.getValueType())) {
|
||||
List<String> list = bo.getConfigValues();
|
||||
String result = DataUtil.getListToString(list);
|
||||
obj.setConfigValue(result);
|
||||
}
|
||||
}
|
||||
if (obj != null && obj.getConfigKey() != null && !obj.getConfigKey().isEmpty()) {
|
||||
SysConfig sysConfig = baseMapper.selectOne(new LambdaQueryWrapper<SysConfig>().eq(SysConfig::getConfigKey, obj.getConfigKey()).last("LIMIT 1"));
|
||||
if (sysConfig != null) {
|
||||
obj.setId(sysConfig.getId());
|
||||
obj.setRevision(sysConfig.getRevision());
|
||||
}
|
||||
}
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysConfigVo selectVoById(Serializable id) {
|
||||
SysConfigVo sysConfigVo = this.getBaseMapper().selectVoById(id);
|
||||
if (sysConfigVo != null && !sysConfigVo.getConfigValue().isEmpty()) {
|
||||
List<String> list = Arrays.asList(sysConfigVo.getConfigValue().split(","));
|
||||
sysConfigVo.setConfigValues(list);
|
||||
if (!list.isEmpty()) {
|
||||
sysConfigVo.setValueType("Array");
|
||||
} else {
|
||||
sysConfigVo.setValueType("String");
|
||||
}
|
||||
}
|
||||
return sysConfigVo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysConfigVo> selectListVoPage(SysConfigBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysConfig> lqw = buildQueryWrapper(bo);
|
||||
Page<SysConfigVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
|
||||
private LambdaQueryWrapper<SysConfig> buildQueryWrapper(SysConfigBo query) {
|
||||
if (query == null) {
|
||||
query = new SysConfigBo();
|
||||
}
|
||||
//Map<String, Object> params = query.getParams();
|
||||
LambdaQueryWrapper<SysConfig> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StringUtil.isNotEmpty(query.getConfigName()), SysConfig::getConfigName, query.getConfigName());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getConfigKey()), SysConfig::getConfigKey, query.getConfigKey());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getConfigType()), SysConfig::getConfigType, query.getConfigType());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getStatus()), SysConfig::getStatus, query.getStatus());
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean updateByCodes(List<SysConfigBo> bos) {
|
||||
if (bos != null && !bos.isEmpty()) {
|
||||
for (SysConfigBo bo : bos) {
|
||||
if (bo.getConfigKey() == null || bo.getConfigKey().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
this.updateById(bo);
|
||||
this.initBase();
|
||||
this.initSms();
|
||||
this.initEmail();
|
||||
applicationContext.publishEvent(new ContextRefreshedEvent(applicationContext));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysConfigVo> selectByCodes(List<SysConfigBo> bos) {
|
||||
List<SysConfigVo> endList = new ArrayList<>();
|
||||
for (SysConfigBo bo : bos) {
|
||||
SysConfigVo vo = baseMapper.selectVoOne(new LambdaQueryWrapper<SysConfig>().eq(SysConfig::getConfigKey, bo.getConfigKey()).last("LIMIT 1"));
|
||||
if (vo == null) {
|
||||
if (bo.getConfigKey() == null || bo.getConfigKey().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
bo.setStatus(0);
|
||||
bo.setConfigType(1);
|
||||
this.insert(bo);
|
||||
} else {
|
||||
bo.setConfigValue(vo.getConfigValue());
|
||||
if (bo.getValueType() != null && !bo.getValueType().isEmpty()) {
|
||||
List<String> list = Arrays.asList(vo.getConfigValue().split(","));
|
||||
if (!list.isEmpty()) {
|
||||
bo.setValueType("Array");
|
||||
//去除空字符串
|
||||
list = list.stream().filter(str -> !str.isEmpty()).collect(Collectors.toList());
|
||||
//去除空格
|
||||
list = list.stream().map(String::trim).collect(Collectors.toList());
|
||||
//去除重复
|
||||
list = list.stream().distinct().collect(Collectors.toList());
|
||||
} else {
|
||||
bo.setValueType("String");
|
||||
}
|
||||
bo.setConfigValues(list);
|
||||
}
|
||||
bo.setConfigName(vo.getConfigName());
|
||||
bo.setConfigType(vo.getConfigType());
|
||||
bo.setStatus(vo.getStatus());
|
||||
bo.setId(vo.getId());
|
||||
bo.setRevision(vo.getRevision());
|
||||
}
|
||||
SysConfigVo obj = MapstructUtil.convert(bo, SysConfigVo.class);
|
||||
endList.add(obj);
|
||||
}
|
||||
return endList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean initSms() {
|
||||
List<SysConfig> sysSms = baseMapper.selectList(new LambdaQueryWrapper<SysConfig>().likeRight(SysConfig::getConfigKey, "sys_sms_"));
|
||||
//转为Map集合
|
||||
List<ConfigEntity> convert = BeanCopyUtil.convert(sysSms, ConfigEntity.class);
|
||||
RedisUtil.deleteObject(ConfigKeyNum.config_sms.getKey());
|
||||
RedisUtil.setCacheList(ConfigKeyNum.config_sms.getKey(), convert);
|
||||
RedisUtil.expire(ConfigKeyNum.config_sms.getKey(), Duration.ofDays(99999999));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean initBase() {
|
||||
List<SysConfig> sysSms = baseMapper.selectList(new LambdaQueryWrapper<SysConfig>().likeRight(SysConfig::getConfigKey, "sys_base_"));
|
||||
//转为Map集合
|
||||
List<ConfigEntity> convert = BeanCopyUtil.convert(sysSms, ConfigEntity.class);
|
||||
RedisUtil.deleteObject(ConfigKeyNum.config_base.getKey());
|
||||
RedisUtil.setCacheList(ConfigKeyNum.config_base.getKey(), convert);
|
||||
RedisUtil.expire(ConfigKeyNum.config_base.getKey(), Duration.ofDays(99999999));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getIsOpenCaptcha() {
|
||||
SysConfigVo config = baseMapper.selectVoOne(new LambdaQueryWrapper<SysConfig>().eq(SysConfig::getConfigKey, "sys_base_captcha_state").last("limit 1"));
|
||||
return config != null && Objects.equals(Convert.toInt(config.getConfigValue()), SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean initEmail() {
|
||||
List<SysConfig> sysSms = baseMapper.selectList(new LambdaQueryWrapper<SysConfig>().likeRight(SysConfig::getConfigKey, "sys_email_"));
|
||||
//转为Map集合
|
||||
List<ConfigEntity> convert = BeanCopyUtil.convert(sysSms, ConfigEntity.class);
|
||||
RedisUtil.deleteObject(ConfigKeyNum.config_email.getKey());
|
||||
RedisUtil.setCacheList(ConfigKeyNum.config_email.getKey(), convert);
|
||||
RedisUtil.expire(ConfigKeyNum.config_email.getKey(), Duration.ofDays(99999999));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean initWx() {
|
||||
List<SysConfig> sysSms = baseMapper.selectList(new LambdaQueryWrapper<SysConfig>().likeRight(SysConfig::getConfigKey, "sys_wx_"));
|
||||
//转为Map集合
|
||||
List<ConfigEntity> convert = BeanCopyUtil.convert(sysSms, ConfigEntity.class);
|
||||
RedisUtil.deleteObject(ConfigKeyNum.config_wx.getKey());
|
||||
RedisUtil.setCacheList(ConfigKeyNum.config_wx.getKey(), convert);
|
||||
RedisUtil.expire(ConfigKeyNum.config_wx.getKey(), Duration.ofDays(99999999));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
140
mms-admin/src/main/java/com/sxpcwlkj/system/service/impl/SysDeptServiceImpl.java
Executable file
140
mms-admin/src/main/java/com/sxpcwlkj/system/service/impl/SysDeptServiceImpl.java
Executable file
@ -0,0 +1,140 @@
|
||||
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.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.system.entity.SysDept;
|
||||
import com.sxpcwlkj.system.entity.bo.SysDeptBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDeptVo;
|
||||
import com.sxpcwlkj.system.entity.export.SysDeptExport;
|
||||
import com.sxpcwlkj.system.mapper.SysDeptMapper;
|
||||
import com.sxpcwlkj.system.service.SysDeptService;
|
||||
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
|
||||
@Service("sys_dept")
|
||||
@RequiredArgsConstructor
|
||||
public class SysDeptServiceImpl extends BaseServiceImpl<SysDept, SysDeptVo,SysDeptBo> implements SysDeptService {
|
||||
|
||||
private final SysDeptMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<SysDept, SysDeptVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDeptVo> queryTree(boolean isAll,int showLevel) {
|
||||
List<SysDeptVo> queryTrees = baseMapper.selectVoList(new LambdaQueryWrapper<SysDept>()
|
||||
.eq(!isAll,SysDept::getStatus, SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue())
|
||||
.orderByAsc(SysDept::getSort));
|
||||
return formatTree(queryTrees, "0",showLevel,0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void queryListSon(String id, List<SysDeptVo> endList) {
|
||||
SysDeptVo vo = baseMapper.selectVoById(id);
|
||||
if (vo != null) {
|
||||
endList.add(vo);
|
||||
queryListSon(vo.getParentId(), endList);
|
||||
}
|
||||
}
|
||||
private List<SysDeptVo> formatTree(List<SysDeptVo> vos, String fid, int level,int currentLevel) {
|
||||
List<SysDeptVo> endList = new ArrayList<>();
|
||||
for (SysDeptVo s : vos) {
|
||||
if (fid.equals(s.getParentId())) {
|
||||
if(level > currentLevel||level==0) {
|
||||
List<SysDeptVo> vo = formatTree(vos, s.getDeptId(),level,currentLevel+1);
|
||||
s.setChildren(vo);
|
||||
endList.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
return endList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(SysDeptBo bo) {
|
||||
int row;
|
||||
bo.setDeptId(null);
|
||||
SysDept obj = MapstructUtil.convert(bo, SysDept.class);
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable ids) {
|
||||
String[] array = DataUtil.getCatStr(ids.toString(), ",");
|
||||
return this.getBaseMapper().deleteByIds(new ArrayList<>(List.of(array)))>0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(SysDeptBo bo) {
|
||||
int row;
|
||||
SysDept obj = MapstructUtil.convert(bo, SysDept.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysDeptVo selectVoById(Serializable id) {
|
||||
SysDeptVo vo= this.getBaseMapper().selectVoById(id);
|
||||
List<String> end= new ArrayList<>();
|
||||
getIds(end,vo.getDeptId());
|
||||
Collections.reverse(end);
|
||||
vo.setDeptIds(end.toArray(new String[]{}));
|
||||
return vo;
|
||||
|
||||
}
|
||||
private void getIds(List<String> end, String id) {
|
||||
SysDeptVo vo = baseMapper.selectVoById(id);
|
||||
if (vo != null) {
|
||||
end.add(vo.getDeptId());
|
||||
getIds(end, vo.getParentId());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<SysDeptVo> selectListVoPage(SysDeptBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysDept> lqw = buildQueryWrapper(bo);
|
||||
Page<SysDeptVo> page = baseMapper.selectVoPage(pageQuery.build(),lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<SysDept> buildQueryWrapper(SysDeptBo query){
|
||||
if(query==null){
|
||||
query=new SysDeptBo();
|
||||
}
|
||||
LambdaQueryWrapper<SysDept> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getDeptId()), SysDept::getDeptId, query.getDeptId());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getParentId()), SysDept::getParentId, query.getParentId());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getDeptName()), SysDept::getDeptName, query.getDeptName());
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean imports(Set<SysDeptExport> list) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package com.sxpcwlkj.system.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.system.entity.SysDictData;
|
||||
import com.sxpcwlkj.system.entity.bo.SysDictDataBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDictDataVo;
|
||||
import com.sxpcwlkj.system.mapper.SysDictDataMapper;
|
||||
import com.sxpcwlkj.system.service.SysDictDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 字典数据
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service("sysDictData")
|
||||
@Slf4j
|
||||
public class SysDictDataServiceImpl implements SysDictDataService {
|
||||
|
||||
private final SysDictDataMapper baseMapper;
|
||||
@Override
|
||||
public TableDataInfo<SysDictDataVo> selectPageList(SysDictDataBo bo, PageQuery pageQuery) {
|
||||
Page<SysDictDataVo> page = baseMapper.selectByPage(pageQuery.build(), this.buildQueryWrapper(bo));
|
||||
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private Wrapper<SysDictData> buildQueryWrapper(SysDictDataBo bo) {
|
||||
|
||||
QueryWrapper<SysDictData> wrapper = Wrappers.query();
|
||||
wrapper.eq(ObjectUtil.isNotNull(bo.getStatus()), "status", SystemCommonEnum.SYS_COMMON_STATE_OPEN.getValue());
|
||||
wrapper.like(ObjectUtil.isNotNull(bo.getFieldName()), "name", bo.getFieldName());
|
||||
|
||||
wrapper.orderByAsc("sort");
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SysDictDataVo selectVoById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(SysDictDataBo bo) {
|
||||
int row;
|
||||
SysDictData convert = MapstructUtil.convert(bo, SysDictData.class);
|
||||
return baseMapper.updateById(convert)>0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(SysDictDataBo bo) {
|
||||
SysDictData convert = MapstructUtil.convert(bo, SysDictData.class);
|
||||
return baseMapper.insert(convert)>0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Serializable ids) {
|
||||
String[] array = DataUtil.getCatStr(ids.toString(), ",");
|
||||
return baseMapper.deleteByIds(new ArrayList<>(List.of(array)))>0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,174 @@
|
||||
package com.sxpcwlkj.system.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.common.constant.CacheConstants;
|
||||
import com.sxpcwlkj.common.enums.SystemCommonEnum;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.redis.RedisUtil;
|
||||
import com.sxpcwlkj.system.entity.SysDict;
|
||||
import com.sxpcwlkj.system.entity.SysDictData;
|
||||
import com.sxpcwlkj.system.entity.bo.SysDictBo;
|
||||
import com.sxpcwlkj.system.entity.bo.SysDictDataBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDictDataVo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysDictVo;
|
||||
import com.sxpcwlkj.system.mapper.SysDictDataMapper;
|
||||
import com.sxpcwlkj.system.mapper.SysDictMapper;
|
||||
import com.sxpcwlkj.system.service.SysDictService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service("sysDict")
|
||||
@Slf4j
|
||||
public class SysDictServiceImpl implements SysDictService {
|
||||
|
||||
private final SysDictMapper baseMapper;
|
||||
private final SysDictDataMapper sysDictDataMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysDictVo> selectPageList(SysDictBo bo, PageQuery pageQuery) {
|
||||
Page<SysDictVo> page = baseMapper.selectByPage(pageQuery.build(), this.buildQueryWrapper(bo));
|
||||
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
private Wrapper<SysDict> buildQueryWrapper(SysDictBo bo) {
|
||||
//Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<SysDict> wrapper = Wrappers.query();
|
||||
wrapper.like(ObjectUtil.isNotNull(bo.getName()), "name", bo.getName());
|
||||
wrapper.orderByAsc("created_time");
|
||||
wrapper.orderByAsc("sort");
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysDictVo selectVoById(Long id) {
|
||||
SysDictVo sysDictVo = baseMapper.selectVoById(id);
|
||||
List<SysDictDataVo> vos = sysDictDataMapper.selectVoList(new LambdaQueryWrapper<SysDictData>().eq(SysDictData::getFieldName, sysDictVo.getFieldName()).orderByAsc(SysDictData::getSort));
|
||||
if (vos == null) {
|
||||
vos = new ArrayList<>();
|
||||
SysDictDataVo sysDictDataVo = new SysDictDataVo();
|
||||
sysDictDataVo.setDictType("0");
|
||||
sysDictDataVo.setStatus("0");
|
||||
vos.add(sysDictDataVo);
|
||||
}
|
||||
sysDictVo.setList(vos);
|
||||
return sysDictVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(SysDictBo bo) {
|
||||
int row;
|
||||
SysDict convert = MapstructUtil.convert(bo, SysDict.class);
|
||||
|
||||
// 字典值维护
|
||||
List<SysDictDataBo> list = bo.getList();
|
||||
if (list != null && !list.isEmpty()) {
|
||||
sysDictDataMapper.delete(new LambdaQueryWrapper<SysDictData>().eq(SysDictData::getFieldName, bo.getFieldName()));
|
||||
for (SysDictDataBo data : list) {
|
||||
SysDictData convertData = MapstructUtil.convert(data, SysDictData.class);
|
||||
assert convertData != null;
|
||||
convertData.setId(null);
|
||||
convertData.setFieldName(bo.getFieldName());
|
||||
sysDictDataMapper.insert(convertData);
|
||||
}
|
||||
}
|
||||
return baseMapper.updateById(convert) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(SysDictBo bo) {
|
||||
SysDict convert = MapstructUtil.convert(bo, SysDict.class);
|
||||
int row = baseMapper.insert(convert);
|
||||
// 字典值维护
|
||||
List<SysDictDataBo> list = bo.getList();
|
||||
if (list != null && !list.isEmpty()) {
|
||||
for (SysDictDataBo data : list) {
|
||||
SysDictData convertData = MapstructUtil.convert(data, SysDictData.class);
|
||||
assert convertData != null;
|
||||
convertData.setId(null);
|
||||
convertData.setFieldName(bo.getFieldName());
|
||||
sysDictDataMapper.insert(convertData);
|
||||
}
|
||||
}
|
||||
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
SysDict bo = baseMapper.selectById(id);
|
||||
sysDictDataMapper.delete(new LambdaQueryWrapper<SysDictData>().eq(SysDictData::getFieldName, bo.getFieldName()));
|
||||
return baseMapper.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer initSysDict(String code) {
|
||||
List<SysDict> dicts = baseMapper.selectList(new LambdaQueryWrapper<SysDict>().eq(SysDict::getStatus, 0).orderByAsc(SysDict::getSort));
|
||||
int i = 0;
|
||||
for (SysDict d : dicts) {
|
||||
List<SysDictData> data = sysDictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(SysDictData::getFieldName, d.getFieldName())
|
||||
.eq(SysDictData::getStatus, 0)
|
||||
.orderByAsc(SysDictData::getSort)
|
||||
);
|
||||
RedisUtil.deleteObject(CacheConstants.SYS_DICT_KEY + d.getFieldName());
|
||||
RedisUtil.setCacheObject(CacheConstants.SYS_DICT_KEY + d.getFieldName(), data);
|
||||
for (SysDictData v : data) {
|
||||
i++;
|
||||
RedisUtil.deleteObject(CacheConstants.SYS_DICT_KEY + v.getFieldName() + ":" + v.getValue());
|
||||
RedisUtil.setCacheObject(CacheConstants.SYS_DICT_KEY + v.getFieldName() + ":" + v.getValue(), v.getLabel());
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDictDataVo> getSysDictByCode(String code) {
|
||||
return sysDictDataMapper.selectVoList(new LambdaQueryWrapper<SysDictData>().eq(SysDictData::getFieldName, code)
|
||||
.eq(SysDictData::getStatus, 0).orderByAsc(SysDictData::getSort));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> selectAll() {
|
||||
List<SysDictVo> dataVos = baseMapper.selectVoList(new LambdaQueryWrapper<SysDict>().eq(SysDict::getStatus, 0).orderByAsc(SysDict::getSort));
|
||||
List<Map<String, Object>> end = new ArrayList<>();
|
||||
|
||||
for (SysDictVo dict : dataVos) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("dictType", dict.getFieldName());
|
||||
List<SysDictDataVo> dictData = getSysDictByCode(dict.getFieldName());
|
||||
List<Map<String, Object>> item = new ArrayList<>();
|
||||
for (SysDictDataVo vo : dictData) {
|
||||
Map<String, Object> itemMap = new HashMap<>();
|
||||
itemMap.put("dictLabel", vo.getLabel());
|
||||
itemMap.put("dictValue", vo.getValue());
|
||||
itemMap.put("labelClass", vo.getColorType());
|
||||
item.add(itemMap);
|
||||
}
|
||||
map.put("dataList", item);
|
||||
|
||||
end.add(map);
|
||||
}
|
||||
return end;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,176 @@
|
||||
package com.sxpcwlkj.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.system.entity.AdminMenuTree;
|
||||
import com.sxpcwlkj.system.entity.SysFunction;
|
||||
import com.sxpcwlkj.system.entity.bo.SysFunctionBo;
|
||||
import com.sxpcwlkj.system.entity.vo.SysFunctionVo;
|
||||
import com.sxpcwlkj.system.mapper.SysFunctionMapper;
|
||||
import com.sxpcwlkj.system.service.SysFunctionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service("sysFunction")
|
||||
@Slf4j
|
||||
public class SysFunctionServiceImpl implements SysFunctionService {
|
||||
|
||||
private final SysFunctionMapper baseMapper;
|
||||
|
||||
@Override
|
||||
public List<SysFunctionVo> selectPageList(SysFunctionBo bo, PageQuery pageQuery) {
|
||||
List<SysFunctionVo> functionVos = baseMapper.selectVoList(new LambdaQueryWrapper<SysFunction>().orderByAsc(SysFunction::getSort));
|
||||
return getSysFunctionVo(functionVos, "0",bo.getLevel(),0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysFunctionVo selectVoById(String id) {
|
||||
SysFunctionVo vo = baseMapper.selectVoById(id);
|
||||
List<SysFunctionVo> list = new ArrayList<>();
|
||||
if (vo != null) {
|
||||
getIds(list, vo.getParentId());
|
||||
}
|
||||
Collections.reverse(list);
|
||||
assert vo != null;
|
||||
vo.setMenuSuperior(list.stream().map(SysFunctionVo::getId).toArray(String[]::new));
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
||||
private List<SysFunctionVo> getIds(List<SysFunctionVo> end, String id) {
|
||||
SysFunctionVo vo = baseMapper.selectVoById(id);
|
||||
if (vo != null) {
|
||||
end.add(vo);
|
||||
getIds(end, vo.getParentId());
|
||||
}
|
||||
return end;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean updateById(SysFunctionBo bo) {
|
||||
SysFunction convert = MapstructUtil.convert(bo, SysFunction.class);
|
||||
return baseMapper.updateById(convert) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(SysFunctionBo bo) {
|
||||
bo.setId(null);
|
||||
SysFunction convert = MapstructUtil.convert(bo, SysFunction.class);
|
||||
return baseMapper.insert(convert) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(String id) {
|
||||
List<SysFunctionVo> functionVos = baseMapper.selectVoList(new LambdaQueryWrapper<SysFunction>().eq(SysFunction::getParentId, id));
|
||||
if (!functionVos.isEmpty()) {
|
||||
throw new RuntimeException("该资菜单存在子菜单,请先删除子菜单");
|
||||
}
|
||||
return baseMapper.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminMenuTree> getAllMenuTree() {
|
||||
List<SysFunctionVo> functionVos = baseMapper.selectVoList(new LambdaQueryWrapper<SysFunction>().orderByAsc(SysFunction::getSort));
|
||||
return getAdminMenuTree(functionVos, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 资源格式化
|
||||
*
|
||||
* @param functionVos 资源集合
|
||||
* @param funId 上级资源ID
|
||||
* @return AdminMenuTree
|
||||
*/
|
||||
private List<SysFunctionVo> getSysFunctionVo(List<SysFunctionVo> functionVos, String funId, int level,int currentLevel) {
|
||||
List<SysFunctionVo> endList = new ArrayList<>();
|
||||
for (SysFunctionVo f : functionVos) {
|
||||
//是否是属于funId
|
||||
if (f.getParentId() != null && funId.equals(f.getParentId())) {
|
||||
if(level > currentLevel||level==0) {
|
||||
List<SysFunctionVo> children = getSysFunctionVo(functionVos, f.getId(), level, currentLevel + 1);
|
||||
f.setChildren(children);
|
||||
endList.add(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return endList;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单格式化
|
||||
*
|
||||
* @param functionVos 资源集合
|
||||
* @param funId 上级资源ID
|
||||
* @return AdminMenuTree
|
||||
*/
|
||||
private List<AdminMenuTree> getAdminMenuTree(List<SysFunctionVo> functionVos, String funId) {
|
||||
|
||||
List<AdminMenuTree> endList = new ArrayList<>();
|
||||
for (SysFunctionVo f : functionVos) {
|
||||
//是否是属于funId
|
||||
if (f.getParentId() != null && funId.equals(f.getParentId())) {
|
||||
AdminMenuTree menu = new AdminMenuTree();
|
||||
menu.setId(f.getId());
|
||||
menu.setPath(f.getPath());
|
||||
menu.setName(f.getName());
|
||||
menu.setComponent(f.getComponent());
|
||||
menu.setRedirect(f.getComponentName());
|
||||
|
||||
// 菜单名称
|
||||
// private String title;
|
||||
// // 外链/内嵌时链接地址(http:xxx.com),开启外链条件,`1、isLink: 链接地址不为空`
|
||||
// private String isLink;
|
||||
// // 是否隐藏
|
||||
// private Boolean isHide;
|
||||
// // 是否缓存
|
||||
// private Boolean isKeepAlive;
|
||||
// // 是否固定
|
||||
// private Boolean isAffix;
|
||||
// // 是否内嵌,开启条件,`1、isIframe:true 2、isLink:链接地址不为空`
|
||||
// private Boolean isIframe;
|
||||
// // 权限标识,取角色管理
|
||||
// private String[] roles;
|
||||
// // 菜单图标
|
||||
// private String icon;
|
||||
|
||||
Map<String, Object> meta = new HashMap<>();
|
||||
|
||||
meta.put("title", f.getLanguageCode());
|
||||
meta.put("isLink", f.getIsLink());
|
||||
meta.put("isHide", f.getVisible().equals("true"));
|
||||
meta.put("isKeepAlive", f.getKeepAlive().equals("true"));
|
||||
meta.put("isAffix", f.getAlwaysShow().equals("true"));
|
||||
meta.put("isIframe", f.getIsIframe().equals("true"));
|
||||
if (!StringUtil.isEmpty(f.getPermission())) {
|
||||
meta.put("roles", f.getPermission().split(","));
|
||||
}
|
||||
|
||||
meta.put("icon", f.getIcon());
|
||||
menu.setMeta(meta);
|
||||
|
||||
List<AdminMenuTree> children = getAdminMenuTree(functionVos, f.getId());
|
||||
menu.setChildren(children);
|
||||
|
||||
endList.add(menu);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return endList;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,156 @@
|
||||
package com.sxpcwlkj.system.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.code.entity.CaptchaEntity;
|
||||
import com.sxpcwlkj.common.enums.DeviceEnum;
|
||||
import com.sxpcwlkj.common.exception.LoginException;
|
||||
import com.sxpcwlkj.common.exception.MmsException;
|
||||
import com.sxpcwlkj.common.exception.TenantException;
|
||||
import com.sxpcwlkj.common.properties.TenantProperties;
|
||||
import com.sxpcwlkj.common.utils.IPUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
import com.sxpcwlkj.framework.utils.SignUtil;
|
||||
import com.sxpcwlkj.redis.RedisUtil;
|
||||
import com.sxpcwlkj.redis.constant.RedisConstant;
|
||||
import com.sxpcwlkj.system.entity.SysTenant;
|
||||
import com.sxpcwlkj.system.entity.SysUser;
|
||||
import com.sxpcwlkj.system.entity.bo.LoginBodyBo;
|
||||
import com.sxpcwlkj.system.mapper.SysUserMapper;
|
||||
import com.sxpcwlkj.system.service.SysConfigService;
|
||||
import com.sxpcwlkj.system.service.SysLoginService;
|
||||
import com.sxpcwlkj.system.service.SysTenantService;
|
||||
import com.sxpcwlkj.system.service.SysUserService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName SysLoginServiceImpl
|
||||
* @Description TODO
|
||||
* @Author 西决
|
||||
* @Date 2022/12/25 12:06
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service("sysLogin")
|
||||
@Slf4j
|
||||
public class SysLoginServiceImpl implements SysLoginService {
|
||||
|
||||
private final SysTenantService sysTenantService;
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
|
||||
private final SysUserMapper sysUserMapper;
|
||||
|
||||
private final TenantProperties tenantProperties;
|
||||
|
||||
private final SysConfigService sysConfigService;
|
||||
|
||||
@Override
|
||||
public String login(HttpServletRequest request,LoginBodyBo loginBodyBo) {
|
||||
//验证验证码
|
||||
verfyCaptcha(loginBodyBo.getUsername(), loginBodyBo.getCodeKey(), loginBodyBo.getCode(), loginBodyBo.getUuid());
|
||||
|
||||
//用户名与密码验证
|
||||
SysUser sysUser = sysUserService.selectByUserName(loginBodyBo.getTenantId(), loginBodyBo.getUsername());
|
||||
// 效验
|
||||
if (null == sysUser) {
|
||||
throw new LoginException("账号不存在!");
|
||||
}
|
||||
// 账号是否禁用
|
||||
if (sysUser.getStatus() != 0) {
|
||||
throw new LoginException("账号已禁用!");
|
||||
}
|
||||
//解密数据库的密码
|
||||
String pressWord = SignUtil.pressWord(loginBodyBo.getPassword(), sysUser.getAesKey());
|
||||
try {
|
||||
Assert.equals(pressWord, sysUser.getPassword());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw new LoginException("账号与密码有误!");
|
||||
}
|
||||
//验证租户
|
||||
verfyTenement(sysUser);
|
||||
//进行登记登记
|
||||
updateSysUser(request,sysUser);
|
||||
//获取当前会话的token值
|
||||
return LoginObject.loginToken(sysUser.getUserId(), DeviceEnum.ADMIN.getType(), 10000000L, "id", sysUser.getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logout() {
|
||||
LoginObject.logout();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验证码验证
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param code 验证码
|
||||
* @param uuid uuid
|
||||
*/
|
||||
@Override
|
||||
public void verfyCaptcha(String username, String codeKey, String code, String uuid) {
|
||||
|
||||
if(sysConfigService.getIsOpenCaptcha()){
|
||||
if(StringUtil.isEmpty(code)){
|
||||
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("Verification code failure");
|
||||
}
|
||||
if (!codeKey.equals(data.get(CaptchaEntity.CODE.CAPTCHA_KEY.getValue()))) {
|
||||
log.info("登录:验证码与验证对象不匹配!");
|
||||
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("Verification code does not match");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证租户
|
||||
*
|
||||
* @param sysUser
|
||||
*/
|
||||
@Override
|
||||
public void verfyTenement(SysUser sysUser) {
|
||||
if (tenantProperties.getEnable()) {
|
||||
//租户
|
||||
SysTenant sysTenant = sysTenantService.selectById(sysUser.getTenantId());
|
||||
if (ObjectUtils.isEmpty(sysTenant)) {
|
||||
log.info("登录用户ID:{} 租户不存在.", sysUser.getUserId());
|
||||
throw new TenantException("tenant.not.exists");
|
||||
}
|
||||
if (sysTenant.getStatus() != 0) {
|
||||
log.info("登录用户ID:{} 租户状态为禁用.", sysUser.getUserId());
|
||||
throw new TenantException("tenant off state");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSysUser(HttpServletRequest request,SysUser sysUser) {
|
||||
sysUser.setLoginIp(IPUtil.getIp(request));
|
||||
sysUser.setLoginDate(new Date());
|
||||
sysUserMapper.updateById(sysUser);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
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