first commit

This commit is contained in:
chenshaohua
2025-11-10 16:21:55 +08:00
commit 1940d893c8
609 changed files with 161822 additions and 0 deletions

BIN
2024财富中国500强.xlsx Normal file

Binary file not shown.

20
LICENSE Normal file
View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2018 RuoYi
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.

191
buildAndStart.sh Normal file
View File

@@ -0,0 +1,191 @@
#!/usr/bin/env bash
# 配置部分
BASE_PATH=/root/ks
DES_PATH=/root/ks
JAR_PATH=${DES_PATH}/ruoyi-admin/target/ruoyi-admin.jar
LOG_PATH=${DES_PATH}/logs
LOG_FILE=${LOG_PATH}/backend.log
BACK_LOG=${LOG_PATH}/back/backend-info.log
MODEL_NAME=${JAR_PATH}
PROFILE=dev
# JVM配置
JVM_MEMORY=" -Xms2048M -Xmx2048M -XX:MaxDirectMemorySize=2048M"
# 远程调试
JVM_DEBUG=""
# JVM_DEBUG=" -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6011"
JVM_OPTION="${JVM_MEMORY} ${JVM_DEBUG}"
_math() {
printf "%s" "$(($@))"
}
# 输出绿色文字
__green() {
printf '\33[1;32m%b\33[0m' "$1" "\n"
}
# 输出红色文字
__red() {
printf '\33[1;31m%b\33[0m' "$1" "\n"
}
__kill() {
local jar_path="$1"
local sleep_seconds=10
local cur_sleep_second=1
local pids=()
# 使用临时文件或直接遍历 jps 输出(避免进程替换)
jps -l 2>/dev/null | while read -r pid main_class; do
if [ "$main_class" = "$jar_path" ]; then
echo "$pid"
fi
done > /tmp/ruoyi_pids.$$
# 读取匹配的 PID 到数组(在当前 shell 中)
while IFS= read -r pid; do
[ -n "$pid" ] && pids+=("$pid")
done < /tmp/ruoyi_pids.$$
# 清理临时文件
rm -f /tmp/ruoyi_pids.$$
if [ ${#pids[@]} -eq 0 ]; then
__green "未找到运行中的进程: $jar_path"
return 0
fi
__green "找到 ${#pids[@]} 个匹配进程: ${pids[*]}"
# 发送 SIGTERM
for pid in "${pids[@]}"; do
__green "发送 SIGTERM 到 PID: $pid"
kill "$pid" >/dev/null 2>&1
done
# 等待退出
while [ $cur_sleep_second -le $sleep_seconds ]; do
remaining=()
for pid in "${pids[@]}"; do
if kill -0 "$pid" 2>/dev/null; then
remaining+=("$pid")
fi
done
if [ ${#remaining[@]} -eq 0 ]; then
__green "所有进程已成功停止"
return 0
fi
__green "等待进程退出... (${cur_sleep_second}/${sleep_seconds} 秒)"
sleep 1
cur_sleep_second=$((cur_sleep_second + 1))
done
# 强制 kill -9
__red "优雅关闭超时,强制终止剩余进程: ${remaining[*]}"
for pid in "${remaining[@]}"; do
kill -9 "$pid" 2>/dev/null
done
# 检查是否还有存活
still_alive=()
for pid in "${remaining[@]}"; do
if kill -0 "$pid" 2>/dev/null; then
still_alive+=("$pid")
fi
done
if [ ${#still_alive[@]} -gt 0 ]; then
__red "无法终止进程: ${still_alive[*]}"
return 1
else
__green "所有进程已强制终止"
return 0
fi
}
# 获取本机IP
__get_ip() {
local ip=$(ifconfig | grep "10.0.0" | awk '{print $2}' | cut -d ':' -f 2 | head -n 1)
if [[ -z "$ip" ]]; then
ip=$(ifconfig -a | grep -E '172.|10.|192.' | grep -E 'Bcast|broadcast' | grep -E 'Mask|netmask' | awk '{print $2}' | cut -d ':' -f 2 | head -n 1)
fi
echo "$ip"
}
# 创建日志目录
__create_log_dir() {
if [[ ! -d "$LOG_PATH" ]]; then
mkdir -p "$LOG_PATH"
__green "创建日志目录: $LOG_PATH"
fi
if [[ ! -d "$(dirname "$BACK_LOG")" ]]; then
mkdir -p "$(dirname "$BACK_LOG")"
__green "创建备份日志目录: $(dirname "$BACK_LOG")"
fi
}
# 主函数
main() {
# 加载环境变量
source /etc/profile
# 获取最新代码
__green "拉取最新代码..."
git --git-dir=${BASE_PATH}/.git --work-tree=${BASE_PATH} fetch origin main
git --git-dir=${BASE_PATH}/.git --work-tree=${BASE_PATH} reset --hard origin/main
git --git-dir=${BASE_PATH}/.git --work-tree=${BASE_PATH} pull origin main
# 构建项目
__green "开始构建项目..."
cd ${BASE_PATH} && mvn clean && mvn install -T 4
if [[ $? -ne 0 ]]; then
__red "Maven构建失败!"
exit 1
fi
# 检查JAR文件是否存在
if [[ ! -f "$JAR_PATH" ]]; then
__red "JAR文件不存在: $JAR_PATH"
exit 1
fi
# 停止现有进程
__green "停止现有进程..."
__kill "$MODEL_NAME"
# 创建日志目录
__create_log_dir
# 获取本机IP
SELF_IP=$(__get_ip)
__green "本机IP: $SELF_IP"
# 启动应用
__green "启动应用..."
nohup java ${JVM_OPTION} -jar ${JAR_PATH} --spring.profiles.active=${PROFILE} >> ${LOG_FILE} 2>&1 &
tail -f logs/backend.log
# 等待应用启动
sleep 3
# 检查进程是否启动成功
local new_pid=$(ps -ef | grep "${MODEL_NAME}.jar" | grep -v grep | awk '{print $2}')
if [[ -n "$new_pid" ]]; then
__green "应用启动成功! PID: $new_pid"
else
__red "应用启动失败!"
exit 1
fi
# 跟踪日志
__green "开始跟踪日志..."
tail -f ${LOG_FILE}
}
# 执行主函数
main "$@"

266
pom.xml Normal file
View File

@@ -0,0 +1,266 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.8.8</version>
<name>cms</name>
<description>管理系统</description>
<properties>
<ruoyi.version>3.8.8</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<spring-framework.version>5.3.33</spring-framework.version>
<spring-security.version>5.7.12</spring-security.version>
<druid.version>1.2.23</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.3</kaptcha.version>
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
<fastjson.version>2.0.43</fastjson.version>
<oshi.version>6.6.1</oshi.version>
<commons.io.version>2.13.0</commons.io.version>
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
<mybatis-plus.version>3.5.1</mybatis-plus.version>
<qiniu.version>[7.2.0, 7.2.99]</qiniu.version>
<aliyun.oss.version>2.5.0</aliyun.oss.version>
<qcloud.cos.version>5.5.9</qcloud.cos.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- SpringFramework的依赖配置-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring-framework.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- SpringSecurity的依赖配置-->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-bom</artifactId>
<version>${spring-security.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.5.15</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- 阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.boot.version}</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>
<!-- Swagger3依赖 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!-- velocity代码生成使用模板 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>${velocity.version}</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- 验证码 -->
<dependency>
<groupId>pro.fessional</groupId>
<artifactId>kaptcha</artifactId>
<version>${kaptcha.version}</version>
</dependency>
<!-- mybatis-plus 增强CRUD -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 业务模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-bussiness</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>ruoyi-admin</module>
<module>ruoyi-framework</module>
<module>ruoyi-system</module>
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
<module>ruoyi-bussiness</module>
</modules>
<packaging>pom</packaging>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

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

@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>ruoyi-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<!-- <dependency>-->
<!-- <groupId>mysql</groupId>-->
<!-- <groupId>mysql</groupId>-->
<!-- <artifactId>mysql-connector-java</artifactId>-->
<!-- </dependency>-->
<!--达梦驱动包-->
<!-- <dependency>-->
<!-- <groupId>com.dameng</groupId>-->
<!-- <artifactId>DmJdbcDriver18</artifactId>-->
<!-- <version>8.1.2.192</version>-->
<!-- </dependency>-->
<!-- 瀚高驱动包-->
<dependency>
<groupId>com.highgo</groupId>
<artifactId>HgdbJdbc</artifactId>
<version>6.2.2</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-bussiness</artifactId>
</dependency>
<!-- oss -->
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
<version>${qiniu.version}</version>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>${aliyun.oss.version}</version>
</dependency>
<dependency>
<groupId>com.qcloud</groupId>
<artifactId>cos_api</artifactId>
<version>${qcloud.cos.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.43</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.15</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>

View File

@@ -0,0 +1,32 @@
package com.ruoyi;
import org.dromara.easyes.starter.register.EsMapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
/**
* 启动程序
*
* @author ruoyi
*/
@EsMapperScan("com.ruoyi.cms.mapper.es")
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication
{
public static void main(String[] args)
{
SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}

View File

@@ -0,0 +1,18 @@
package com.ruoyi;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web容器中进行部署
*
* @author ruoyi
*/
public class RuoYiServletInitializer extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
return application.sources(RuoYiApplication.class);
}
}

View File

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

View File

@@ -0,0 +1,163 @@
package com.ruoyi.web.controller.common;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.ServerConfig;
/**
* 通用请求处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/common")
public class CommonController
{
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
@Autowired
private ServerConfig serverConfig;
private static final String FILE_DELIMETER = ",";
/**
* 通用下载请求
*
* @param fileName 文件名称
* @param delete 是否删除
*/
@GetMapping("/download")
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
{
try
{
if (!FileUtils.checkAllowDownload(fileName))
{
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
String filePath = RuoYiConfig.getDownloadPath() + fileName;
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName);
FileUtils.writeBytes(filePath, response.getOutputStream());
if (delete)
{
FileUtils.deleteFile(filePath);
}
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
/**
* 通用上传请求(单个)
*/
@PostMapping("/upload")
public AjaxResult uploadFile(MultipartFile file) throws Exception
{
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
* 通用上传请求(多个)
*/
@PostMapping("/uploads")
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
{
try
{
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
List<String> urls = new ArrayList<String>();
List<String> fileNames = new ArrayList<String>();
List<String> newFileNames = new ArrayList<String>();
List<String> originalFilenames = new ArrayList<String>();
for (MultipartFile file : files)
{
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
urls.add(url);
fileNames.add(fileName);
newFileNames.add(FileUtils.getName(fileName));
originalFilenames.add(file.getOriginalFilename());
}
AjaxResult ajax = AjaxResult.success();
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
/**
* 本地资源通用下载
*/
@GetMapping("/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception
{
try
{
if (!FileUtils.checkAllowDownload(resource))
{
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
}
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
// 数据库资源地址
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
// 下载名称
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, downloadName);
FileUtils.writeBytes(downloadPath, response.getOutputStream());
}
catch (Exception e)
{
log.error("下载文件失败", e);
}
}
}

View File

@@ -0,0 +1,121 @@
package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysCache;
/**
* 缓存监控
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/cache")
public class CacheController
{
@Autowired
private RedisTemplate<String, String> redisTemplate;
private final static List<SysCache> caches = new ArrayList<SysCache>();
{
caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
Map<String, Object> result = new HashMap<>(3);
result.put("info", info);
result.put("dbSize", dbSize);
List<Map<String, String>> pieList = new ArrayList<>();
commandStats.stringPropertyNames().forEach(key -> {
Map<String, String> data = new HashMap<>(2);
String property = commandStats.getProperty(key);
data.put("name", StringUtils.removeStart(key, "cmdstat_"));
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
pieList.add(data);
});
result.put("commandStats", pieList);
return AjaxResult.success(result);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getNames")
public AjaxResult cache()
{
return AjaxResult.success(caches);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getKeys/{cacheName}")
public AjaxResult getCacheKeys(@PathVariable String cacheName)
{
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
return AjaxResult.success(new TreeSet<>(cacheKeys));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@GetMapping("/getValue/{cacheName}/{cacheKey}")
public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
{
String cacheValue = redisTemplate.opsForValue().get(cacheKey);
SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
return AjaxResult.success(sysCache);
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheName/{cacheName}")
public AjaxResult clearCacheName(@PathVariable String cacheName)
{
Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheKey/{cacheKey}")
public AjaxResult clearCacheKey(@PathVariable String cacheKey)
{
redisTemplate.delete(cacheKey);
return AjaxResult.success();
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
@DeleteMapping("/clearCacheAll")
public AjaxResult clearCacheAll()
{
Collection<String> cacheKeys = redisTemplate.keys("*");
redisTemplate.delete(cacheKeys);
return AjaxResult.success();
}
}

View File

@@ -0,0 +1,27 @@
package com.ruoyi.web.controller.monitor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.web.domain.Server;
/**
* 服务器监控
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/server")
public class ServerController
{
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception
{
Server server = new Server();
server.copyTo();
return AjaxResult.success(server);
}
}

View File

@@ -0,0 +1,82 @@
package com.ruoyi.web.controller.monitor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.service.SysPasswordService;
import com.ruoyi.system.domain.SysLogininfor;
import com.ruoyi.system.service.ISysLogininforService;
/**
* 系统访问记录
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/logininfor")
public class SysLogininforController extends BaseController
{
@Autowired
private ISysLogininforService logininforService;
@Autowired
private SysPasswordService passwordService;
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
@GetMapping("/list")
public TableDataInfo list(SysLogininfor logininfor)
{
startPage();
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
return getDataTable(list);
}
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysLogininfor logininfor)
{
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
util.exportExcel(response, list, "登录日志");
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@Log(title = "登录日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{infoIds}")
public AjaxResult remove(@PathVariable Long[] infoIds)
{
return toAjax(logininforService.deleteLogininforByIds(infoIds));
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
@DeleteMapping("/clean")
public AjaxResult clean()
{
logininforService.cleanLogininfor();
return success();
}
@PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')")
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
@GetMapping("/unlock/{userName}")
public AjaxResult unlock(@PathVariable("userName") String userName)
{
passwordService.clearLoginRecordCache(userName);
return success();
}
}

View File

@@ -0,0 +1,69 @@
package com.ruoyi.web.controller.monitor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysOperLog;
import com.ruoyi.system.service.ISysOperLogService;
/**
* 操作日志记录
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/operlog")
public class SysOperlogController extends BaseController
{
@Autowired
private ISysOperLogService operLogService;
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
@GetMapping("/list")
public TableDataInfo list(SysOperLog operLog)
{
startPage();
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
return getDataTable(list);
}
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysOperLog operLog)
{
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
util.exportExcel(response, list, "操作日志");
}
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/{operIds}")
public AjaxResult remove(@PathVariable Long[] operIds)
{
return toAjax(operLogService.deleteOperLogByIds(operIds));
}
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/clean")
public AjaxResult clean()
{
operLogService.cleanOperLog();
return success();
}
}

View File

@@ -0,0 +1,83 @@
package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysUserOnline;
import com.ruoyi.system.service.ISysUserOnlineService;
/**
* 在线用户监控
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/online")
public class SysUserOnlineController extends BaseController
{
@Autowired
private ISysUserOnlineService userOnlineService;
@Autowired
private RedisCache redisCache;
@PreAuthorize("@ss.hasPermi('monitor:online:list')")
@GetMapping("/list")
public TableDataInfo list(String ipaddr, String userName)
{
Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
for (String key : keys)
{
LoginUser user = redisCache.getCacheObject(key);
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
{
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
}
else if (StringUtils.isNotEmpty(ipaddr))
{
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
}
else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
{
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
}
else
{
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
}
}
Collections.reverse(userOnlineList);
userOnlineList.removeAll(Collections.singleton(null));
return getDataTable(userOnlineList);
}
/**
* 强退用户
*/
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@DeleteMapping("/{tokenId}")
public AjaxResult forceLogout(@PathVariable String tokenId)
{
redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
return success();
}
}

View File

@@ -0,0 +1,133 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.service.ISysConfigService;
/**
* 参数配置 信息操作处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/config")
public class SysConfigController extends BaseController
{
@Autowired
private ISysConfigService configService;
/**
* 获取参数配置列表
*/
@PreAuthorize("@ss.hasPermi('system:config:list')")
@GetMapping("/list")
public TableDataInfo list(SysConfig config)
{
startPage();
List<SysConfig> list = configService.selectConfigList(config);
return getDataTable(list);
}
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:config:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysConfig config)
{
List<SysConfig> list = configService.selectConfigList(config);
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
util.exportExcel(response, list, "参数数据");
}
/**
* 根据参数编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:config:query')")
@GetMapping(value = "/{configId}")
public AjaxResult getInfo(@PathVariable Long configId)
{
return success(configService.selectConfigById(configId));
}
/**
* 根据参数键名查询参数值
*/
@GetMapping(value = "/configKey/{configKey}")
public AjaxResult getConfigKey(@PathVariable String configKey)
{
return success(configService.selectConfigByKey(configKey));
}
/**
* 新增参数配置
*/
@PreAuthorize("@ss.hasPermi('system:config:add')")
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysConfig config)
{
if (!configService.checkConfigKeyUnique(config))
{
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setCreateBy(getUsername());
return toAjax(configService.insertConfig(config));
}
/**
* 修改参数配置
*/
@PreAuthorize("@ss.hasPermi('system:config:edit')")
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysConfig config)
{
if (!configService.checkConfigKeyUnique(config))
{
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
}
config.setUpdateBy(getUsername());
return toAjax(configService.updateConfig(config));
}
/**
* 删除参数配置
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "参数管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{configIds}")
public AjaxResult remove(@PathVariable Long[] configIds)
{
configService.deleteConfigByIds(configIds);
return success();
}
/**
* 刷新参数缓存
*/
@PreAuthorize("@ss.hasPermi('system:config:remove')")
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
configService.resetConfigCache();
return success();
}
}

View File

@@ -0,0 +1,132 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
/**
* 部门信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/dept")
public class SysDeptController extends BaseController
{
@Autowired
private ISysDeptService deptService;
/**
* 获取部门列表
*/
@PreAuthorize("@ss.hasPermi('system:dept:list')")
@GetMapping("/list")
public AjaxResult list(SysDept dept)
{
List<SysDept> depts = deptService.selectDeptList(dept);
return success(depts);
}
/**
* 查询部门列表(排除节点)
*/
@PreAuthorize("@ss.hasPermi('system:dept:list')")
@GetMapping("/list/exclude/{deptId}")
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
{
List<SysDept> depts = deptService.selectDeptList(new SysDept());
depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
return success(depts);
}
/**
* 根据部门编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:dept:query')")
@GetMapping(value = "/{deptId}")
public AjaxResult getInfo(@PathVariable Long deptId)
{
deptService.checkDeptDataScope(deptId);
return success(deptService.selectDeptById(deptId));
}
/**
* 新增部门
*/
@PreAuthorize("@ss.hasPermi('system:dept:add')")
@Log(title = "部门管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDept dept)
{
if (!deptService.checkDeptNameUnique(dept))
{
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
dept.setCreateBy(getUsername());
return toAjax(deptService.insertDept(dept));
}
/**
* 修改部门
*/
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDept dept)
{
Long deptId = dept.getDeptId();
deptService.checkDeptDataScope(deptId);
if (!deptService.checkDeptNameUnique(dept))
{
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
else if (dept.getParentId().equals(deptId))
{
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
{
return error("该部门包含未停用的子部门!");
}
dept.setUpdateBy(getUsername());
return toAjax(deptService.updateDept(dept));
}
/**
* 删除部门
*/
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
@Log(title = "部门管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{deptId}")
public AjaxResult remove(@PathVariable Long deptId)
{
if (deptService.hasChildByDeptId(deptId))
{
return warn("存在下级部门,不允许删除");
}
if (deptService.checkDeptExistUser(deptId))
{
return warn("部门存在用户,不允许删除");
}
deptService.checkDeptDataScope(deptId);
return toAjax(deptService.deleteDeptById(deptId));
}
}

View File

@@ -0,0 +1,121 @@
package com.ruoyi.web.controller.system;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysDictTypeService;
/**
* 数据字典信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/dict/data")
public class SysDictDataController extends BaseController
{
@Autowired
private ISysDictDataService dictDataService;
@Autowired
private ISysDictTypeService dictTypeService;
@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public TableDataInfo list(SysDictData dictData)
{
startPage();
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
return getDataTable(list);
}
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysDictData dictData)
{
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
util.exportExcel(response, list, "字典数据");
}
/**
* 查询字典数据详细
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictCode}")
public AjaxResult getInfo(@PathVariable Long dictCode)
{
return success(dictDataService.selectDictDataById(dictCode));
}
/**
* 根据字典类型查询字典数据信息
*/
@GetMapping(value = "/type/{dictType}")
public AjaxResult dictType(@PathVariable String dictType)
{
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data))
{
data = new ArrayList<SysDictData>();
}
return success(data);
}
/**
* 新增字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@Log(title = "字典数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictData dict)
{
dict.setCreateBy(getUsername());
return toAjax(dictDataService.insertDictData(dict));
}
/**
* 修改保存字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
{
dict.setUpdateBy(getUsername());
return toAjax(dictDataService.updateDictData(dict));
}
/**
* 删除字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictCodes}")
public AjaxResult remove(@PathVariable Long[] dictCodes)
{
dictDataService.deleteDictDataByIds(dictCodes);
return success();
}
}

View File

@@ -0,0 +1,131 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictTypeService;
/**
* 数据字典信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/dict/type")
public class SysDictTypeController extends BaseController
{
@Autowired
private ISysDictTypeService dictTypeService;
@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public TableDataInfo list(SysDictType dictType)
{
startPage();
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
return getDataTable(list);
}
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysDictType dictType)
{
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
util.exportExcel(response, list, "字典类型");
}
/**
* 查询字典类型详细
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictId}")
public AjaxResult getInfo(@PathVariable Long dictId)
{
return success(dictTypeService.selectDictTypeById(dictId));
}
/**
* 新增字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@Log(title = "字典类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysDictType dict)
{
if (!dictTypeService.checkDictTypeUnique(dict))
{
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setCreateBy(getUsername());
return toAjax(dictTypeService.insertDictType(dict));
}
/**
* 修改字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
{
if (!dictTypeService.checkDictTypeUnique(dict))
{
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setUpdateBy(getUsername());
return toAjax(dictTypeService.updateDictType(dict));
}
/**
* 删除字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictIds}")
public AjaxResult remove(@PathVariable Long[] dictIds)
{
dictTypeService.deleteDictTypeByIds(dictIds);
return success();
}
/**
* 刷新字典缓存
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
dictTypeService.resetDictCache();
return success();
}
/**
* 获取字典选择框列表
*/
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
return success(dictTypes);
}
}

View File

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

View File

@@ -0,0 +1,126 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.Set;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.domain.model.RegisterBody;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.system.service.ISysMenuService;
/**
* 登录验证
*
* @author ruoyi
*/
@RestController
public class SysLoginController
{
@Autowired
private SysLoginService loginService;
@Autowired
private ISysMenuService menuService;
@Autowired
private SysPermissionService permissionService;
/**
* 登录方法
*
* @param loginBody 登录信息
* @return 结果
*/
@PostMapping("/login")
public AjaxResult login(@RequestBody LoginBody loginBody)
{
AjaxResult ajax = AjaxResult.success();
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
loginBody.getUuid());
ajax.put(Constants.TOKEN, token);
return ajax;
}
@PostMapping("/app/login")
public AjaxResult loginApp(@RequestBody LoginBody loginBody)
{
AjaxResult ajax = AjaxResult.success();
// 生成令牌
String token = loginService.loginApp("admin", "admin123");
ajax.put(Constants.TOKEN, token);
return ajax;
}
@PostMapping("/app/appLogin")
public AjaxResult appLogin(@RequestBody LoginBody loginBody)
{
AjaxResult ajax = AjaxResult.success();
ajax=loginService.appLogin(loginBody);
return ajax;
}
/**
* 获取用户信息
*
* @return 用户信息
*/
@GetMapping("getInfo")
public AjaxResult getInfo()
{
SysUser user = SecurityUtils.getLoginUser().getUser();
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合
Set<String> permissions = permissionService.getMenuPermission(user);
AjaxResult ajax = AjaxResult.success();
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
return ajax;
}
/**
* 获取路由信息
*
* @return 路由信息
*/
@GetMapping("getRouters")
public AjaxResult getRouters()
{
Long userId = SecurityUtils.getUserId();
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
return AjaxResult.success(menuService.buildMenus(menus));
}
@GetMapping("/sso/callback")
public String ssoCallback(@RequestParam("ticket") String ticket) {
String frontendIndexUrl = "http://domain.com";
String ruoyiJwtToken = loginService.loginOss(ticket);
String redirectUrl = frontendIndexUrl + "/index?token=" + ruoyiJwtToken;
// 返回 "redirect:" 即可触发 302 重定向
return "redirect:" + redirectUrl;
}
/**
* 保存简历-重新返回token
*/
@ApiOperation("保存注册信息")
@PostMapping("/registerUser")
public AjaxResult registerUser(@RequestBody RegisterBody registerBody)
{
String token=loginService.registerAppUser(registerBody);
return AjaxResult.success().put("token",token);
}
}

View File

@@ -0,0 +1,142 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysMenuService;
/**
* 菜单信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/menu")
public class SysMenuController extends BaseController
{
@Autowired
private ISysMenuService menuService;
/**
* 获取菜单列表
*/
@PreAuthorize("@ss.hasPermi('system:menu:list')")
@GetMapping("/list")
public AjaxResult list(SysMenu menu)
{
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return success(menus);
}
/**
* 根据菜单编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:menu:query')")
@GetMapping(value = "/{menuId}")
public AjaxResult getInfo(@PathVariable Long menuId)
{
return success(menuService.selectMenuById(menuId));
}
/**
* 获取菜单下拉树列表
*/
@GetMapping("/treeselect")
public AjaxResult treeselect(SysMenu menu)
{
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
return success(menuService.buildMenuTreeSelect(menus));
}
/**
* 加载对应角色菜单列表树
*/
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
{
List<SysMenu> menus = menuService.selectMenuList(getUserId());
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
return ajax;
}
/**
* 新增菜单
*/
@PreAuthorize("@ss.hasPermi('system:menu:add')")
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysMenu menu)
{
if (!menuService.checkMenuNameUnique(menu))
{
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return error("新增菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
menu.setCreateBy(getUsername());
return toAjax(menuService.insertMenu(menu));
}
/**
* 修改菜单
*/
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysMenu menu)
{
if (!menuService.checkMenuNameUnique(menu))
{
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
}
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
{
return error("修改菜单'" + menu.getMenuName() + "'失败地址必须以http(s)://开头");
}
else if (menu.getMenuId().equals(menu.getParentId()))
{
return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
}
menu.setUpdateBy(getUsername());
return toAjax(menuService.updateMenu(menu));
}
/**
* 删除菜单
*/
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{menuId}")
public AjaxResult remove(@PathVariable("menuId") Long menuId)
{
if (menuService.hasChildByMenuId(menuId))
{
return warn("存在子菜单,不允许删除");
}
if (menuService.checkMenuExistRole(menuId))
{
return warn("菜单已分配,不允许删除");
}
return toAjax(menuService.deleteMenuById(menuId));
}
}

View File

@@ -0,0 +1,91 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.service.ISysNoticeService;
/**
* 公告 信息操作处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/notice")
public class SysNoticeController extends BaseController
{
@Autowired
private ISysNoticeService noticeService;
/**
* 获取通知公告列表
*/
@PreAuthorize("@ss.hasPermi('system:notice:list')")
@GetMapping("/list")
public TableDataInfo list(SysNotice notice)
{
startPage();
List<SysNotice> list = noticeService.selectNoticeList(notice);
return getDataTable(list);
}
/**
* 根据通知公告编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:notice:query')")
@GetMapping(value = "/{noticeId}")
public AjaxResult getInfo(@PathVariable Long noticeId)
{
return success(noticeService.selectNoticeById(noticeId));
}
/**
* 新增通知公告
*/
@PreAuthorize("@ss.hasPermi('system:notice:add')")
@Log(title = "通知公告", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysNotice notice)
{
notice.setCreateBy(getUsername());
return toAjax(noticeService.insertNotice(notice));
}
/**
* 修改通知公告
*/
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
{
notice.setUpdateBy(getUsername());
return toAjax(noticeService.updateNotice(notice));
}
/**
* 删除通知公告
*/
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
@Log(title = "通知公告", businessType = BusinessType.DELETE)
@DeleteMapping("/{noticeIds}")
public AjaxResult remove(@PathVariable Long[] noticeIds)
{
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
}
}

View File

@@ -0,0 +1,60 @@
package com.ruoyi.web.controller.system;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.web.exception.user.OssException;
import com.ruoyi.system.domain.SysOss;
import com.ruoyi.system.service.ISysOssService;
import com.ruoyi.web.controller.system.cloud.CloudStorageService;
import com.ruoyi.web.controller.system.cloud.OSSFactory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
/**
* 文件上传
*/
@Controller
@RequestMapping("/app/oss")
@Api(tags = "移动端:文件上传")
public class SysOssController extends BaseController
{
@Autowired
private ISysOssService sysOssService;
@ApiOperation("文件上传")
@PostMapping("/upload")
public AjaxResult upload(@RequestParam("file") MultipartFile file) throws Exception
{
LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
if (file.isEmpty())
{
throw new OssException("上传文件不能为空");
}
// 上传文件
String fileName = file.getOriginalFilename();
String suffix = fileName.substring(fileName.lastIndexOf("."));
CloudStorageService storage = OSSFactory.build();
String url = storage.uploadSuffix(file.getBytes(), suffix);
// 保存文件信息
SysOss ossEntity = new SysOss();
ossEntity.setUrl(url);
ossEntity.setFileSuffix(suffix);
ossEntity.setCreateBy(SecurityUtils.getUsername());
ossEntity.setFileName(fileName);
ossEntity.setCreateTime(formattedDate);
ossEntity.setService(storage.getService());
return toAjax(sysOssService.save(ossEntity)).put("url", ossEntity.getUrl()).put("fileName",ossEntity.getFileName());
}
}

View File

@@ -0,0 +1,129 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.service.ISysPostService;
/**
* 岗位信息操作处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/post")
public class SysPostController extends BaseController
{
@Autowired
private ISysPostService postService;
/**
* 获取岗位列表
*/
@PreAuthorize("@ss.hasPermi('system:post:list')")
@GetMapping("/list")
public TableDataInfo list(SysPost post)
{
startPage();
List<SysPost> list = postService.selectPostList(post);
return getDataTable(list);
}
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:post:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysPost post)
{
List<SysPost> list = postService.selectPostList(post);
ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
util.exportExcel(response, list, "岗位数据");
}
/**
* 根据岗位编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:post:query')")
@GetMapping(value = "/{postId}")
public AjaxResult getInfo(@PathVariable Long postId)
{
return success(postService.selectPostById(postId));
}
/**
* 新增岗位
*/
@PreAuthorize("@ss.hasPermi('system:post:add')")
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysPost post)
{
if (!postService.checkPostNameUnique(post))
{
return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
}
else if (!postService.checkPostCodeUnique(post))
{
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setCreateBy(getUsername());
return toAjax(postService.insertPost(post));
}
/**
* 修改岗位
*/
@PreAuthorize("@ss.hasPermi('system:post:edit')")
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysPost post)
{
if (!postService.checkPostNameUnique(post))
{
return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
}
else if (!postService.checkPostCodeUnique(post))
{
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
post.setUpdateBy(getUsername());
return toAjax(postService.updatePost(post));
}
/**
* 删除岗位
*/
@PreAuthorize("@ss.hasPermi('system:post:remove')")
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{postIds}")
public AjaxResult remove(@PathVariable Long[] postIds)
{
return toAjax(postService.deletePostByIds(postIds));
}
/**
* 获取岗位选择框列表
*/
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
List<SysPost> posts = postService.selectPostAll();
return success(posts);
}
}

View File

@@ -0,0 +1,137 @@
package com.ruoyi.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.MimeTypeUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.service.ISysUserService;
/**
* 个人信息 业务处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/user/profile")
public class SysProfileController extends BaseController
{
@Autowired
private ISysUserService userService;
@Autowired
private TokenService tokenService;
/**
* 个人信息
*/
@GetMapping
public AjaxResult profile()
{
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
AjaxResult ajax = AjaxResult.success(user);
ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
return ajax;
}
/**
* 修改用户
*/
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult updateProfile(@RequestBody SysUser user)
{
LoginUser loginUser = getLoginUser();
SysUser currentUser = loginUser.getUser();
currentUser.setNickName(user.getNickName());
currentUser.setEmail(user.getEmail());
currentUser.setPhonenumber(user.getPhonenumber());
currentUser.setSex(user.getSex());
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
{
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
}
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
{
return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在");
}
if (userService.updateUserProfile(currentUser) > 0)
{
// 更新缓存用户信息
tokenService.setLoginUser(loginUser);
return success();
}
return error("修改个人信息异常,请联系管理员");
}
/**
* 重置密码
*/
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping("/updatePwd")
public AjaxResult updatePwd(String oldPassword, String newPassword)
{
LoginUser loginUser = getLoginUser();
String userName = loginUser.getUsername();
String password = loginUser.getPassword();
if (!SecurityUtils.matchesPassword(oldPassword, password))
{
return error("修改密码失败,旧密码错误");
}
if (SecurityUtils.matchesPassword(newPassword, password))
{
return error("新密码不能与旧密码相同");
}
newPassword = SecurityUtils.encryptPassword(newPassword);
if (userService.resetUserPwd(userName, newPassword) > 0)
{
// 更新缓存用户密码
loginUser.getUser().setPassword(newPassword);
tokenService.setLoginUser(loginUser);
return success();
}
return error("修改密码异常,请联系管理员");
}
/**
* 头像上传
*/
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
@PostMapping("/avatar")
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
{
if (!file.isEmpty())
{
LoginUser loginUser = getLoginUser();
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
{
AjaxResult ajax = AjaxResult.success();
ajax.put("imgUrl", avatar);
// 更新缓存用户头像
loginUser.getUser().setAvatar(avatar);
tokenService.setLoginUser(loginUser);
return ajax;
}
}
return error("上传图片异常,请联系管理员");
}
}

View File

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

View File

@@ -0,0 +1,262 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
/**
* 角色信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/role")
public class SysRoleController extends BaseController
{
@Autowired
private ISysRoleService roleService;
@Autowired
private TokenService tokenService;
@Autowired
private SysPermissionService permissionService;
@Autowired
private ISysUserService userService;
@Autowired
private ISysDeptService deptService;
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/list")
public TableDataInfo list(SysRole role)
{
startPage();
List<SysRole> list = roleService.selectRoleList(role);
return getDataTable(list);
}
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:role:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysRole role)
{
List<SysRole> list = roleService.selectRoleList(role);
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
util.exportExcel(response, list, "角色数据");
}
/**
* 根据角色编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping(value = "/{roleId}")
public AjaxResult getInfo(@PathVariable Long roleId)
{
roleService.checkRoleDataScope(roleId);
return success(roleService.selectRoleById(roleId));
}
/**
* 新增角色
*/
@PreAuthorize("@ss.hasPermi('system:role:add')")
@Log(title = "角色管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysRole role)
{
if (!roleService.checkRoleNameUnique(role))
{
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (!roleService.checkRoleKeyUnique(role))
{
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setCreateBy(getUsername());
return toAjax(roleService.insertRole(role));
}
/**
* 修改保存角色
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
if (!roleService.checkRoleNameUnique(role))
{
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (!roleService.checkRoleKeyUnique(role))
{
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setUpdateBy(getUsername());
if (roleService.updateRole(role) > 0)
{
// 更新缓存用户权限
LoginUser loginUser = getLoginUser();
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
{
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
tokenService.setLoginUser(loginUser);
}
return success();
}
return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
}
/**
* 修改保存数据权限
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping("/dataScope")
public AjaxResult dataScope(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
return toAjax(roleService.authDataScope(role));
}
/**
* 状态修改
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody SysRole role)
{
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
role.setUpdateBy(getUsername());
return toAjax(roleService.updateRoleStatus(role));
}
/**
* 删除角色
*/
@PreAuthorize("@ss.hasPermi('system:role:remove')")
@Log(title = "角色管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{roleIds}")
public AjaxResult remove(@PathVariable Long[] roleIds)
{
return toAjax(roleService.deleteRoleByIds(roleIds));
}
/**
* 获取角色选择框列表
*/
@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
return success(roleService.selectRoleAll());
}
/**
* 查询已分配用户角色列表
*/
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/allocatedList")
public TableDataInfo allocatedList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectAllocatedList(user);
return getDataTable(list);
}
/**
* 查询未分配用户角色列表
*/
@PreAuthorize("@ss.hasPermi('system:role:list')")
@GetMapping("/authUser/unallocatedList")
public TableDataInfo unallocatedList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUnallocatedList(user);
return getDataTable(list);
}
/**
* 取消授权用户
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/cancel")
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
{
return toAjax(roleService.deleteAuthUser(userRole));
}
/**
* 批量取消授权用户
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/cancelAll")
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
{
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
}
/**
* 批量选择用户授权
*/
@PreAuthorize("@ss.hasPermi('system:role:edit')")
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PutMapping("/authUser/selectAll")
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
{
roleService.checkRoleDataScope(roleId);
return toAjax(roleService.insertAuthUsers(roleId, userIds));
}
/**
* 获取对应角色部门树列表
*/
@PreAuthorize("@ss.hasPermi('system:role:query')")
@GetMapping(value = "/deptTree/{roleId}")
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
{
AjaxResult ajax = AjaxResult.success();
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
return ajax;
}
}

View File

@@ -0,0 +1,292 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.entity.Company;
import com.ruoyi.cms.service.ICompanyService;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
/**
* 用户信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/user")
public class SysUserController extends BaseController
{
@Autowired
private ISysUserService userService;
@Autowired
private ISysRoleService roleService;
@Autowired
private ISysDeptService deptService;
@Autowired
private ISysPostService postService;
@Autowired
private ICompanyService companyService;
/**
* 获取用户列表
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/list")
public TableDataInfo list(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUserList(user);
return getDataTable(list);
}
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:user:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, SysUser user)
{
List<SysUser> list = userService.selectUserList(user);
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
util.exportExcel(response, list, "用户数据");
}
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:user:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
List<SysUser> userList = util.importExcel(file.getInputStream());
String operName = getUsername();
String message = userService.importUser(userList, updateSupport, operName);
return success(message);
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response)
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
util.importTemplateExcel(response, "用户数据");
}
/**
* 根据用户编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping(value = { "/", "/{userId}" })
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
{
userService.checkUserDataScope(userId);
AjaxResult ajax = AjaxResult.success();
List<SysRole> roles = roleService.selectRoleAll();
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
ajax.put("posts", postService.selectPostAll());
if (StringUtils.isNotNull(userId))
{
SysUser sysUser = userService.selectUserById(userId);
ajax.put(AjaxResult.DATA_TAG, sysUser);
ajax.put("postIds", postService.selectPostListByUserId(userId));
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
}
return ajax;
}
/**
* 新增用户
*/
@PreAuthorize("@ss.hasPermi('system:user:add')")
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody SysUser user)
{
deptService.checkDeptDataScope(user.getDeptId());
roleService.checkRoleDataScope(user.getRoleIds());
if (!userService.checkUserNameUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
}
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
}
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setCreateBy(getUsername());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
return toAjax(userService.insertUser(user));
}
/**
* 修改用户
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysUser user)
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
deptService.checkDeptDataScope(user.getDeptId());
roleService.checkRoleDataScope(user.getRoleIds());
if (!userService.checkUserNameUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
}
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
}
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setUpdateBy(getUsername());
return toAjax(userService.updateUser(user));
}
/**
* 删除用户
*/
@PreAuthorize("@ss.hasPermi('system:user:remove')")
@Log(title = "用户管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
if (ArrayUtils.contains(userIds, getUserId()))
{
return error("当前用户不能删除");
}
return toAjax(userService.deleteUserByIds(userIds));
}
/**
* 重置密码
*/
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/resetPwd")
public AjaxResult resetPwd(@RequestBody SysUser user)
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
user.setUpdateBy(getUsername());
return toAjax(userService.resetPwd(user));
}
/**
* 状态修改
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody SysUser user)
{
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
user.setUpdateBy(getUsername());
return toAjax(userService.updateUserStatus(user));
}
/**
* 根据用户编号获取授权角色
*/
@PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping("/authRole/{userId}")
public AjaxResult authRole(@PathVariable("userId") Long userId)
{
AjaxResult ajax = AjaxResult.success();
SysUser user = userService.selectUserById(userId);
List<SysRole> roles = roleService.selectRolesByUserId(userId);
ajax.put("user", user);
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
return ajax;
}
/**
* 用户授权角色
*/
@PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.GRANT)
@PutMapping("/authRole")
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
{
userService.checkUserDataScope(userId);
roleService.checkRoleDataScope(roleIds);
userService.insertUserAuth(userId, roleIds);
return success();
}
/**
* 获取部门树列表
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/deptTree")
public AjaxResult deptTree(SysDept dept)
{
return success(deptService.selectDeptTreeList(dept));
}
@ApiOperation("企业资质审核")
@PreAuthorize("@ss.hasPermi('app:company:approval:list')")
@PostMapping("/approval")
public AjaxResult approval(@RequestBody Company company)
{
Company company1 = companyService.approval(company);
SysUser sysUser = new SysUser();
sysUser.setNickName(company1.getContactPerson());
sysUser.setDeptId(101L);
String contactPersonPhone = company1.getContactPersonPhone();
if(StringUtils.isNotEmpty(contactPersonPhone)){
String lastSixDigits = contactPersonPhone.substring(contactPersonPhone.length() - 6);
sysUser.setPassword(lastSixDigits);
sysUser.setUserName(company1.getContactPersonPhone());
sysUser.setPhonenumber(company1.getContactPersonPhone());
sysUser.setNickName(company1.getContactPersonPhone());
}else{
sysUser.setPassword("123456");
sysUser.setUserName(company1.getName());
sysUser.setNickName(company1.getName());
}
sysUser.setPhonenumber(getUsername());
Long[] postIds = {1L};
Long[] roleIds = {100L};
sysUser.setPostIds(postIds);
sysUser.setRoleIds(roleIds);
userService.insertUser(sysUser);
return AjaxResult.success();
}
}

View File

@@ -0,0 +1,60 @@
package com.ruoyi.web.controller.system.cloud;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import com.aliyun.oss.OSSClient;
import com.ruoyi.framework.web.exception.user.OssException;
/**
* 阿里云存储
*/
public class AliyunCloudStorageService extends CloudStorageService
{
private OSSClient client;
public AliyunCloudStorageService(CloudStorageConfig config)
{
this.config = config;
// 初始化
init();
}
private void init()
{
client = new OSSClient(config.getAliyunEndPoint(), config.getAliyunAccessKeyId(),
config.getAliyunAccessKeySecret());
}
@Override
public String upload(byte[] data, String path)
{
return upload(new ByteArrayInputStream(data), path);
}
@Override
public String upload(InputStream inputStream, String path)
{
try
{
client.putObject(config.getAliyunBucketName(), path, inputStream);
}
catch (Exception e)
{
throw new OssException("上传文件失败,请检查配置信息");
}
return config.getAliyunDomain() + "/" + path;
}
@Override
public String uploadSuffix(byte[] data, String suffix)
{
return upload(data, getPath(config.getAliyunPrefix(), suffix));
}
@Override
public String uploadSuffix(InputStream inputStream, String suffix)
{
return upload(inputStream, getPath(config.getAliyunPrefix(), suffix));
}
}

View File

@@ -0,0 +1,39 @@
package com.ruoyi.web.controller.system.cloud;
public class CloudConstant
{
/**
* 云存储配置KEY
*/
public final static String CLOUD_STORAGE_CONFIG_KEY = "sys.oss.cloudStorage";
/**
* 云服务商
*/
public enum CloudService
{
/**
* 七牛云
*/
QINIU(1),
/**
* 阿里云
*/
ALIYUN(2),
/**
* 腾讯云
*/
QCLOUD(3);
private int value;
CloudService(int value)
{
this.value = value;
}
public int getValue()
{
return value;
}
}
}

View File

@@ -0,0 +1,290 @@
package com.ruoyi.web.controller.system.cloud;
import java.io.Serializable;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.Range;
import org.hibernate.validator.constraints.URL;
import com.ruoyi.web.controller.system.cloud.valdator.AliyunGroup;
import com.ruoyi.web.controller.system.cloud.valdator.QcloudGroup;
import com.ruoyi.web.controller.system.cloud.valdator.QiniuGroup;
/**
* 云存储配置信息
*/
public class CloudStorageConfig implements Serializable
{
//
private static final long serialVersionUID = 9035033846176792944L;
// 类型 1七牛 2阿里云 3腾讯云
@Range(min = 1, max = 3, message = "类型错误")
private Integer type;
// 七牛绑定的域名
@NotBlank(message = "七牛绑定的域名不能为空", groups = QiniuGroup.class)
@URL(message = "七牛绑定的域名格式不正确", groups = QiniuGroup.class)
private String qiniuDomain;
// 七牛路径前缀
private String qiniuPrefix;
// 七牛ACCESS_KEY
@NotBlank(message = "七牛AccessKey不能为空", groups = QiniuGroup.class)
private String qiniuAccessKey;
// 七牛SECRET_KEY
@NotBlank(message = "七牛SecretKey不能为空", groups = QiniuGroup.class)
private String qiniuSecretKey;
// 七牛存储空间名
@NotBlank(message = "七牛空间名不能为空", groups = QiniuGroup.class)
private String qiniuBucketName;
// 阿里云绑定的域名
@NotBlank(message = "阿里云绑定的域名不能为空", groups = AliyunGroup.class)
@URL(message = "阿里云绑定的域名格式不正确", groups = AliyunGroup.class)
private String aliyunDomain;
// 阿里云路径前缀
@Pattern(regexp="^[^(/|\\)](.*[^(/|\\)])?$",message="阿里云路径前缀不能'/'或者'\'开头或者结尾",groups = AliyunGroup.class)
private String aliyunPrefix;
// 阿里云EndPoint
@NotBlank(message = "阿里云EndPoint不能为空", groups = AliyunGroup.class)
private String aliyunEndPoint;
// 阿里云AccessKeyId
@NotBlank(message = "阿里云AccessKeyId不能为空", groups = AliyunGroup.class)
private String aliyunAccessKeyId;
// 阿里云AccessKeySecret
@NotBlank(message = "阿里云AccessKeySecret不能为空", groups = AliyunGroup.class)
private String aliyunAccessKeySecret;
// 阿里云BucketName
@NotBlank(message = "阿里云BucketName不能为空", groups = AliyunGroup.class)
private String aliyunBucketName;
// 腾讯云绑定的域名
@NotBlank(message = "腾讯云绑定的域名不能为空", groups = QcloudGroup.class)
@URL(message = "腾讯云绑定的域名格式不正确", groups = QcloudGroup.class)
private String qcloudDomain;
// 腾讯云路径前缀
private String qcloudPrefix;
// 腾讯云AppId
@NotNull(message = "腾讯云AppId不能为空", groups = QcloudGroup.class)
private Integer qcloudAppId;
// 腾讯云SecretId
@NotBlank(message = "腾讯云SecretId不能为空", groups = QcloudGroup.class)
private String qcloudSecretId;
// 腾讯云SecretKey
@NotBlank(message = "腾讯云SecretKey不能为空", groups = QcloudGroup.class)
private String qcloudSecretKey;
// 腾讯云BucketName
@NotBlank(message = "腾讯云BucketName不能为空", groups = QcloudGroup.class)
private String qcloudBucketName;
// 腾讯云COS所属地区
@NotBlank(message = "所属地区不能为空", groups = QcloudGroup.class)
private String qcloudRegion;
public Integer getType()
{
return type;
}
public void setType(Integer type)
{
this.type = type;
}
public String getQiniuDomain()
{
return qiniuDomain;
}
public void setQiniuDomain(String qiniuDomain)
{
this.qiniuDomain = qiniuDomain;
}
public String getQiniuAccessKey()
{
return qiniuAccessKey;
}
public void setQiniuAccessKey(String qiniuAccessKey)
{
this.qiniuAccessKey = qiniuAccessKey;
}
public String getQiniuSecretKey()
{
return qiniuSecretKey;
}
public void setQiniuSecretKey(String qiniuSecretKey)
{
this.qiniuSecretKey = qiniuSecretKey;
}
public String getQiniuBucketName()
{
return qiniuBucketName;
}
public void setQiniuBucketName(String qiniuBucketName)
{
this.qiniuBucketName = qiniuBucketName;
}
public String getQiniuPrefix()
{
return qiniuPrefix;
}
public void setQiniuPrefix(String qiniuPrefix)
{
this.qiniuPrefix = qiniuPrefix;
}
public String getAliyunDomain()
{
return aliyunDomain;
}
public void setAliyunDomain(String aliyunDomain)
{
this.aliyunDomain = aliyunDomain;
}
public String getAliyunPrefix()
{
return aliyunPrefix;
}
public void setAliyunPrefix(String aliyunPrefix)
{
this.aliyunPrefix = aliyunPrefix;
}
public String getAliyunEndPoint()
{
return aliyunEndPoint;
}
public void setAliyunEndPoint(String aliyunEndPoint)
{
this.aliyunEndPoint = aliyunEndPoint;
}
public String getAliyunAccessKeyId()
{
return aliyunAccessKeyId;
}
public void setAliyunAccessKeyId(String aliyunAccessKeyId)
{
this.aliyunAccessKeyId = aliyunAccessKeyId;
}
public String getAliyunAccessKeySecret()
{
return aliyunAccessKeySecret;
}
public void setAliyunAccessKeySecret(String aliyunAccessKeySecret)
{
this.aliyunAccessKeySecret = aliyunAccessKeySecret;
}
public String getAliyunBucketName()
{
return aliyunBucketName;
}
public void setAliyunBucketName(String aliyunBucketName)
{
this.aliyunBucketName = aliyunBucketName;
}
public String getQcloudDomain()
{
return qcloudDomain;
}
public void setQcloudDomain(String qcloudDomain)
{
this.qcloudDomain = qcloudDomain;
}
public String getQcloudPrefix()
{
return qcloudPrefix;
}
public void setQcloudPrefix(String qcloudPrefix)
{
this.qcloudPrefix = qcloudPrefix;
}
public Integer getQcloudAppId()
{
return qcloudAppId;
}
public void setQcloudAppId(Integer qcloudAppId)
{
this.qcloudAppId = qcloudAppId;
}
public String getQcloudSecretId()
{
return qcloudSecretId;
}
public void setQcloudSecretId(String qcloudSecretId)
{
this.qcloudSecretId = qcloudSecretId;
}
public String getQcloudSecretKey()
{
return qcloudSecretKey;
}
public void setQcloudSecretKey(String qcloudSecretKey)
{
this.qcloudSecretKey = qcloudSecretKey;
}
public String getQcloudBucketName()
{
return qcloudBucketName;
}
public void setQcloudBucketName(String qcloudBucketName)
{
this.qcloudBucketName = qcloudBucketName;
}
public String getQcloudRegion()
{
return qcloudRegion;
}
public void setQcloudRegion(String qcloudRegion)
{
this.qcloudRegion = qcloudRegion;
}
}

View File

@@ -0,0 +1,73 @@
package com.ruoyi.web.controller.system.cloud;
import java.io.InputStream;
import java.util.UUID;
import org.apache.commons.lang.StringUtils;
import com.ruoyi.common.utils.DateUtils;
/**
* 云存储(支持七牛、阿里云、腾讯云、又拍云)
*/
public abstract class CloudStorageService
{
/** 云存储配置信息 */
CloudStorageConfig config;
public int getService()
{
return config.getType();
}
/**
* 文件路径
* @param prefix 前缀
* @param suffix 后缀
* @return 返回上传路径
*/
public String getPath(String prefix, String suffix)
{
// 生成uuid
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
// 文件路径
String path = DateUtils.dateTime() + "/" + uuid;
if (StringUtils.isNotBlank(prefix))
{
path = prefix + "/" + path;
}
return path + suffix;
}
/**
* 文件上传
* @param data 文件字节数组
* @param path 文件路径,包含文件名
* @return 返回http地址
*/
public abstract String upload(byte[] data, String path);
/**
* 文件上传
* @param data 文件字节数组
* @param suffix 后缀
* @return 返回http地址
*/
public abstract String uploadSuffix(byte[] data, String suffix);
/**
* 文件上传
* @param inputStream 字节流
* @param path 文件路径,包含文件名
* @return 返回http地址
*/
public abstract String upload(InputStream inputStream, String path);
/**
* 文件上传
* @param inputStream 字节流
* @param suffix 后缀
* @return 返回http地址
*/
public abstract String uploadSuffix(InputStream inputStream, String suffix);
}

View File

@@ -0,0 +1,39 @@
package com.ruoyi.web.controller.system.cloud;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.web.controller.system.cloud.CloudConstant.CloudService;
/**
* 文件上传Factory
*/
public final class OSSFactory
{
private static ISysConfigService sysConfigService;
static
{
OSSFactory.sysConfigService = (ISysConfigService) SpringUtils.getBean(ISysConfigService.class);
}
public static CloudStorageService build()
{
String jsonconfig = sysConfigService.selectConfigByKey(CloudConstant.CLOUD_STORAGE_CONFIG_KEY);
// 获取云存储配置信息
CloudStorageConfig config = JSON.parseObject(jsonconfig, CloudStorageConfig.class);
if (config.getType() == CloudService.QINIU.getValue())
{
return new QiniuCloudStorageService(config);
}
else if (config.getType() == CloudService.ALIYUN.getValue())
{
return new AliyunCloudStorageService(config);
}
else if (config.getType() == CloudService.QCLOUD.getValue())
{
return new QcloudCloudStorageService(config);
}
return null;
}
}

View File

@@ -0,0 +1,97 @@
package com.ruoyi.web.controller.system.cloud;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import com.qcloud.cos.COSClient;
import com.qcloud.cos.ClientConfig;
import com.qcloud.cos.auth.BasicCOSCredentials;
import com.qcloud.cos.auth.COSCredentials;
import com.qcloud.cos.model.PutObjectRequest;
import com.qcloud.cos.model.PutObjectResult;
import com.qcloud.cos.region.Region;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.web.exception.user.OssException;
/**
* 腾讯云存储
*/
public class QcloudCloudStorageService extends CloudStorageService
{
private COSClient client;
public QcloudCloudStorageService(CloudStorageConfig config)
{
this.config = config;
// 初始化
init();
}
private void init()
{
COSCredentials credentials = new BasicCOSCredentials(config.getQcloudSecretId(),
config.getQcloudSecretKey());
// 设置bucket所在的区域最新sdk不再支持简写请填写完整
Region region = new Region(config.getQcloudRegion());
ClientConfig clientConfig = new ClientConfig(region);
client = new COSClient(credentials, clientConfig);
}
@Override
public String upload(byte[] data, String path)
{
if (!path.startsWith("/"))
{
path = "/" + path;
}
File file = null;
// 创建一个临时目录文件,结束后删除,腾讯云这个操作跟SB没区别用流上传麻烦更多权衡以后先这么做
try
{
file = FileUtils.createTempFile(path, data);
PutObjectRequest putObjectRequest = new PutObjectRequest(config.getQcloudBucketName(), path, file);
PutObjectResult putObjectResult = client.putObject(putObjectRequest);
}
catch (Exception e)
{
throw new OssException("文件上传失败," + e.getMessage());
}
finally
{
if (null != file) file.delete();
}
return config.getQcloudDomain() + path;
}
public static String getTemp()
{
return System.getProperty("java.io.tmpdir");
}
@Override
public String upload(InputStream inputStream, String path)
{
try
{
byte[] data = IOUtils.toByteArray(inputStream);
return this.upload(data, path);
}
catch (IOException e)
{
throw new OssException("上传文件失败");
}
}
@Override
public String uploadSuffix(byte[] data, String suffix)
{
return upload(data, getPath(config.getQcloudPrefix(), suffix));
}
@Override
public String uploadSuffix(InputStream inputStream, String suffix)
{
return upload(inputStream, getPath(config.getQcloudPrefix(), suffix));
}
}

View File

@@ -0,0 +1,81 @@
package com.ruoyi.web.controller.system.cloud;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import com.qiniu.http.Response;
import com.qiniu.storage.Configuration;
import com.qiniu.storage.Region;
import com.qiniu.storage.UploadManager;
import com.qiniu.util.Auth;
import com.ruoyi.framework.web.exception.user.OssException;
/**
* 七牛云存储
*/
public class QiniuCloudStorageService extends CloudStorageService
{
private UploadManager uploadManager;
private String token;
public QiniuCloudStorageService(CloudStorageConfig config)
{
this.config = config;
// 初始化
init();
}
private void init()
{
uploadManager = new UploadManager(new Configuration(Region.autoRegion()));
token = Auth.create(config.getQiniuAccessKey(), config.getQiniuSecretKey())
.uploadToken(config.getQiniuBucketName());
}
@Override
public String upload(byte[] data, String path)
{
try
{
Response res = uploadManager.put(data, path, token);
if (!res.isOK())
{
throw new RuntimeException("上传七牛出错:" + res.toString());
}
}
catch (Exception e)
{
throw new OssException("上传文件失败,请核对七牛配置信息");
}
return config.getQiniuDomain() + "/" + path;
}
@Override
public String upload(InputStream inputStream, String path)
{
try
{
byte[] data = IOUtils.toByteArray(inputStream);
return this.upload(data, path);
}
catch (IOException e)
{
throw new OssException("上传文件失败");
}
}
@Override
public String uploadSuffix(byte[] data, String suffix)
{
return upload(data, getPath(config.getQiniuPrefix(), suffix));
}
@Override
public String uploadSuffix(InputStream inputStream, String suffix)
{
return upload(inputStream, getPath(config.getQiniuPrefix(), suffix));
}
}

View File

@@ -0,0 +1,8 @@
package com.ruoyi.web.controller.system.cloud.valdator;
/**
* 阿里云
*/
public interface AliyunGroup
{
}

View File

@@ -0,0 +1,8 @@
package com.ruoyi.web.controller.system.cloud.valdator;
/**
* 腾讯云
*/
public interface QcloudGroup
{
}

View File

@@ -0,0 +1,8 @@
package com.ruoyi.web.controller.system.cloud.valdator;
/**
* 七牛
*/
public interface QiniuGroup
{
}

View File

@@ -0,0 +1,125 @@
package com.ruoyi.web.core.config;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.ruoyi.common.config.RuoYiConfig;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.ApiKey;
import springfox.documentation.service.AuthorizationScope;
import springfox.documentation.service.Contact;
import springfox.documentation.service.SecurityReference;
import springfox.documentation.service.SecurityScheme;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
/**
* Swagger2的接口配置
*
* @author ruoyi
*/
@Configuration
public class SwaggerConfig
{
/** 系统基础配置 */
@Autowired
private RuoYiConfig ruoyiConfig;
/** 是否开启swagger */
@Value("${swagger.enabled}")
private boolean enabled;
/** 设置请求的统一前缀 */
@Value("${swagger.pathMapping}")
private String pathMapping;
/**
* 创建API
*/
@Bean
public Docket createRestApi()
{
return new Docket(DocumentationType.OAS_30)
// 是否启用Swagger
.enable(enabled)
// 用来创建该API的基本信息展示在文档的页面中自定义展示的信息
.apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示
.select()
// 扫描所有有注解的api用这种方式更灵活
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
// 扫描指定包中的swagger注解
// .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
.apis(RequestHandlerSelectors.any())
// .paths(PathSelectors.any())
.build()
/* 设置安全模式swagger可以设置访问token */
.securitySchemes(securitySchemes())
.securityContexts(securityContexts())
.pathMapping(pathMapping);
}
/**
* 安全模式这里指定token通过Authorization头请求头传递
*/
private List<SecurityScheme> securitySchemes()
{
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
return apiKeyList;
}
/**
* 安全上下文
*/
private List<SecurityContext> securityContexts()
{
List<SecurityContext> securityContexts = new ArrayList<>();
securityContexts.add(
SecurityContext.builder()
.securityReferences(defaultAuth())
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
.build());
return securityContexts;
}
/**
* 默认的安全上引用
*/
private List<SecurityReference> defaultAuth()
{
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
List<SecurityReference> securityReferences = new ArrayList<>();
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
return securityReferences;
}
/**
* 添加摘要信息
*/
private ApiInfo apiInfo()
{
// 用ApiInfoBuilder进行定制
return new ApiInfoBuilder()
// 设置标题
.title("标题管理系统_接口文档")
// 描述
// .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
// 作者信息
.contact(new Contact(ruoyiConfig.getName(), null, null))
// 版本
.version("版本号:" + ruoyiConfig.getVersion())
.build();
}
}

View File

@@ -0,0 +1 @@
restart.include.json=/com.alibaba.fastjson2.*.jar

View File

@@ -0,0 +1,96 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.highgo.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:highgo://127.0.0.1:5866/highgo?useUnicode=true&characterEncoding=utf8&currentSchema=ks_db4&stringtype=unspecified
#username: syssso
username: sysdba
password: ZKR2024@comzkr
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 10
# 最小连接池数量
minIdle: 30
# 最大连接池数量
maxActive: 50
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT version()
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
redis:
# 地址
host: 127.0.0.1
# 端口默认为6379
port: 5379
# 数据库索引
database: 5
# 密码
password: ZKR2024@@.com
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# easy-es
easy-es:
enable: true
banner: false
address: 127.0.0.1:9200
global-config:
process-index-mode: manual
db-config:
refresh-policy: immediate
username: elastic
password: zkr2024@@.com

View File

@@ -0,0 +1,93 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.highgo.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:highgo://124.243.245.42:5866/highgo?useUnicode=true&characterEncoding=utf8&currentSchema=ks_db4&stringtype=unspecified
username: sysdba
password: ZKR2024@comzkr
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 10
# 最小连接池数量
minIdle: 30
# 最大连接池数量
maxActive: 50
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT version()
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
redis:
# 地址
host: 124.243.245.42
# 端口默认为6379
port: 5379
# 数据库索引
database: 5
# 密码
password: ZKR2024@@.com
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# easy-es
easy-es:
enable: true
banner: false
address: 124.243.245.42:9200
global-config:
process-index-mode: manual
db-config:
refresh-policy: immediate
username: elastic
password: zkr2024@@.com

View File

@@ -0,0 +1,184 @@
# 项目相关配置
ruoyi:
# 名称
name: RuoYi
# 版本
version: 3.8.8
# 版权年份
copyrightYear: 2024
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证
captchaType: math
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 9091
servlet:
# 应用的访问路径
context-path: /
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# 连接数满后的排队数默认为100
accept-count: 1000
threads:
# tomcat最大线程数默认为200
max: 800
# Tomcat启动初始化的线程数默认值10
min-spare: 100
# 日志配置
logging:
level:
com.ruoyi: debug
org.springframework: warn
# 用户配置
user:
password:
# 密码最大错误次数
maxRetryCount: 5
# 密码锁定时间默认10分钟
lockTime: 10
# Spring配置
spring:
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: local
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
# 服务模块
devtools:
restart:
# 热部署开关
enabled: true
# redis 配置
# token配置
token:
# 令牌自定义标识
header: Authorization
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟
expireTime: 30
## MyBatis配置
#mybatis:
# # 搜索指定包别名
# typeAliasesPackage: com.ruoyi.**.domain
# # 配置mapper的扫描找到所有的mapper.xml映射文件
# mapperLocations: classpath*:mapper/**/*Mapper.xml
# # 加载全局的配置文件
# configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper:
helperDialect: oracle
supportMethodsArguments: true
params: count=countSql
# Swagger配置
swagger:
# 是否开启swagger
enabled: true
# 请求前缀
pathMapping:
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
createSqlSessionFactory:
# 选择MyBatis配置方式mybatis / mybatis-plus
use: mybatis-plus
# MyBatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# MyBatis Plus配置
mybatis-plus:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
global-config:
db-config:
# 标识逻辑删除的数据库字段名称
logic-delete-field: delFlag
# 表示已逻辑删除的值(默认也是如此)
logic-delete-value: 2
# 表示未逻辑删除的值(默认也是如此)
logic-not-delete-value: 0
file:
upload-dir: /data/file
#微信小程序
wx:
appid: wx4aa34488b965a331
secret: 558780ecc2750f87e556b0e5496773c9
#统一门户认证
oauth:
#客户端的ID
appid: aa
#授权码
clientsecretkey: bb
#内网
usptnw:
#获取访问令牌
nwGatewayGetTokenUrl: http://ip:80/serviceAPI/getToken
#获取用户信息
nwGatewayGetUserInfoUrl: http://ip:80/serviceAPI/getUserInfo
#外网
usptww:
#门户注册
wwRegisterPostUrl: http://ip:80/whiteListServiceAPI/doWebRegister
#门户登录
wwTokenPostUrl: http://ip:80/whiteListServiceAPI/doWebLogon
#查询个人信息
wwQueryWebPersonalInfoPostUrl: http://ip:80/serviceAPI/queryWebPersonalInfo
#查询单位信息
wwQueryWebEnterpriseInfoPostUrl: http://ip:80/serviceAPI/queryWebEnterpriseInfo
#用户新增接口
tyAddUserUrl: http://ip:80/security/add_user
#获取当前用户有权系统列表
tyQueryUserSysListUrl: http://ip:80/security/get_effective_app_list
#获取当前用户有权角色列表
tyQueryUserRoleListUrl: http://ip:80/security/get_role_by_userid
#获取角色功能权限信息
tyQueryRoleInfoUrl: http://ip:80/security/get_path_by_role
#获取用户详细信息
tyQueryUserInfo: http://ip:80/security/get_user_by_userid
#获取机构详细信息
tyQueryUnitInfo: http://ip:80/security/get_organization_by_organizationid
connect-timeout: 10
read-timeout: 30
write-timeout: 30

View File

@@ -0,0 +1,24 @@
Application Version: ${ruoyi.version}
Spring Boot Version: ${spring-boot.version}
////////////////////////////////////////////////////////////////////
// _ooOoo_ //
// o8888888o //
// 88" . "88 //
// (| ^_^ |) //
// O\ = /O //
// ____/`---'\____ //
// .' \\| |// `. //
// / \\||| : |||// \ //
// / _||||| -:- |||||- \ //
// | | \\\ - /// | | //
// | \_| ''\---/'' | | //
// \ .-\__ `-` ___/-. / //
// ___`. .' /--.--\ `. . ___ //
// ."" '< `.___\_<|>_/___.' >'"". //
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
// \ \ `-. \_ __\ /__ _/ .-` / / //
// ========`-.____`-.___\_____/___.-`____.-'======== //
// `=---=' //
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
// 佛祖保佑 永不宕机 永无BUG //
////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,38 @@
#错误消息
not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.jcaptcha.expire=验证码已失效
user.not.exists=用户不存在/密码错误
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
user.password.delete=对不起,您的账号已被删除
user.blocked=用户已封禁,请联系管理员
role.blocked=角色已封禁,请联系管理员
login.blocked=很遗憾访问IP已被列入系统黑名单
user.logout.success=退出成功
length.not.valid=长度必须在{min}到{max}个字符之间
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成且必须以非数字开头
user.password.not.valid=* 5-50个字符
user.email.not.valid=邮箱格式错误
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
user.register.success=注册成功
user.notfound=请重新登录
user.forcelogout=管理员强制退出,请重新登录
user.unknown.error=未知错误,请重新登录
##文件上传消息
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB
upload.filename.exceed.length=上传的文件名最长{0}个字符
##权限
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/lapuda/logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
<!--系统用户操作日志-->
<logger name="sys-user" level="info">
<appender-ref ref="sys-user"/>
</logger>
</configuration>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 全局参数 -->
<settings>
<!-- 使全局的映射器启用或禁用缓存 -->
<setting name="cacheEnabled" value="true" />
<!-- 允许JDBC 支持自动生成主键 -->
<setting name="useGeneratedKeys" value="true" />
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
<setting name="defaultExecutorType" value="SIMPLE" />
<!-- 指定 MyBatis 所用日志的具体实现 -->
<setting name="logImpl" value="SLF4J" />
<!-- 使用驼峰命名法转换字段 -->
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
</settings>
</configuration>

121
ruoyi-bussiness/pom.xml Normal file
View File

@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-bussiness</artifactId>
<description>
bussiness系统模块
</description>
<dependencies>
<dependency>
<groupId>com.alibaba.nls</groupId>
<artifactId>nls-sdk-tts</artifactId>
<version>2.2.14</version>
</dependency>
<dependency>
<groupId>com.alibaba.nls</groupId>
<artifactId>nls-sdk-common</artifactId>
<version>2.2.14</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.nls</groupId>
<artifactId>nls-sdk-recognizer</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.6.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-spring-web</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.ruoyi</groupId>-->
<!-- <artifactId>ruoyi-framework</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>4.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.14.0</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>7.14.0</version>
</dependency>
<dependency>
<groupId>org.dromara.easy-es</groupId>
<artifactId>easy-es-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.22</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,17 @@
package com.ruoyi.cms.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
@Configuration
public class WebSocketConfig {
/**
* 注册 WebSocket 端点
*/
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}

View File

@@ -0,0 +1,10 @@
package com.ruoyi.cms.constant;
public class CommonConstant {
/**
* 地铁线路缓存
*/
public static final String SUBWAY_LINE_CACHE = "common_cache:subway";
public static final String COMMERICIAL_AREA = "common_cache:comericial_area";
public static final String JOB_TITLE = "common_cache:job_titile";
}

View File

@@ -0,0 +1,77 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.BussinessDictData;
import com.ruoyi.cms.domain.CommercialArea;
import com.ruoyi.cms.domain.SubwayLine;
import com.ruoyi.cms.service.*;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.TreeSelect;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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.List;
import java.util.Map;
@RestController
@RequestMapping("/app/common")
@Api(tags = "移动端:常用参数查询")
public class AppCommonController extends BaseController {
@Autowired
private ISubwayLineService iSubwayLineService;
@Autowired
private ICommercialAreaService iCommercialAreaService;
@Autowired
private IJobTitleService iJobTitleService;
@Autowired
private IIndustryService industryService;
@Autowired
private IBussinessDictTypeService iBussinessDictTypeService;
@ApiOperation("查询地铁")
@GetMapping("/subway")
public AjaxResult subway()
{
List<SubwayLine> list = iSubwayLineService.appSubway();
return success(list);
}
@ApiOperation("查询商圈")
@GetMapping("/commercialArea")
public AjaxResult commercialArea()
{
List<CommercialArea> list = iCommercialAreaService.appCommercialArea();
return success(list);
}
@ApiOperation("查询职业 树结构")
@GetMapping("/jobTitle/treeselect")
public AjaxResult jobTitle()
{
List<TreeSelect> jobTitleList = iJobTitleService.appJobTitle();
return success(jobTitleList);
}
@ApiOperation("查询行业 树结构")
@GetMapping("/industry/treeselect")
public AjaxResult industry()
{
List<TreeSelect> industryList = industryService.appIndustry();
return success(industryList);
}
@ApiOperation("查询字典")
@GetMapping("/dict/{dictType}")
public AjaxResult listDict(@PathVariable String dictType)
{
List<BussinessDictData> dictData = iBussinessDictTypeService.selectDictDataByType(dictType);
return success(dictData);
}
@ApiOperation("字段标准")
@GetMapping("/standar/filed")
public AjaxResult standarFiled()
{
Map<String,Object> filed = iBussinessDictTypeService.standarFiled();
return success(filed);
}
}

View File

@@ -0,0 +1,58 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.vo.CompanyContactVo;
import com.ruoyi.cms.service.CompanyContactService;
import com.ruoyi.cms.util.ListUtil;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.CompanyContact;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 公司联系人
*
* @author
* @email
* @date 2025-09-30 15:57:06
*/
@RestController
@RequestMapping("/app/companycontact")
@Api(tags = "移动端:公司联系人")
public class AppCompanyContactController extends BaseController {
@Autowired
private CompanyContactService companyContactService;
/**
* 列表
*/
@ApiOperation("公司联系人列表")
@GetMapping("/list")
public TableDataInfo list(CompanyContact companyContact){
List<CompanyContact> list=companyContactService.getSelectList(companyContact);
return getDataTable(list);
}
@BussinessLog(title = "移动端保存企业联系人")
@PostMapping("/batchInsertUpdate")
public AjaxResult batchInsertUpdate(@RequestBody CompanyContactVo contactVo)
{
if (contactVo == null) {
return AjaxResult.error("请求参数不能为空");
}
List<CompanyContact> contactList = contactVo.getCompanyContactList();
if (ListUtil.isListObjectEmptyOrNull(contactList)) { // 假设 ListUtil 工具类判断 null 或空集合
return AjaxResult.error("请至少填写一条联系人信息");
}
companyContactService.insertUpadteCompanyContact(contactList);
return success();
}
}

View File

@@ -0,0 +1,155 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.common.core.domain.entity.Company;
import com.ruoyi.cms.domain.CompanyCard;
import com.ruoyi.cms.domain.query.LabelQuery;
import com.ruoyi.cms.mapper.CompanyCardMapper;
import com.ruoyi.cms.service.ICompanyCardService;
import com.ruoyi.cms.service.ICompanyCollectionService;
import com.ruoyi.cms.service.ICompanyService;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 公司Controller
*
* @author lishundong
* @date 2024-09-04
*/
@RestController
@RequestMapping("/app/company")
@Api(tags = "移动端:公司")
public class AppCompanyController extends BaseController
{
@Autowired
private ICompanyService companyService;
@Autowired
private ICompanyCollectionService companyCollectionService;
@Autowired
private ICompanyCardService companyCardService;
@Autowired
private CompanyCardMapper companyCardMapper;
/**
* 获取公司详细信息
*/
@ApiOperation("获取公司详细信息")
@GetMapping(value = "/{companyId}")
public AjaxResult getInfo(@PathVariable("companyId") Long companyId)
{
return success(companyService.selectCompanyByCompanyId(companyId));
}
/**
* 用户收藏公司
*/
@BussinessLog(title = "用户收藏公司")
@PostMapping("/collection/{companyId}")
@ApiOperation("用户收藏公司")
public AjaxResult companyCollection(@PathVariable("companyId") Long companyId)
{
return toAjax(companyCollectionService.companyCollection(companyId));
}
/**
* 用户取消收藏公司
*/
@BussinessLog(title = "用户取消收藏公司")
@DeleteMapping("/collection/{companyId}")
@ApiOperation("用户取消收藏公司")
public AjaxResult companyCancel(@PathVariable("companyId") Long companyId)
{
return toAjax(companyCollectionService.companyCancel(companyId));
}
/**
* 公司下的岗位
*/
@GetMapping("/job/{companyId}")
@ApiOperation("公司下的岗位")
public TableDataInfo jobCompany(@ApiParam("公司id") @PathVariable Long companyId)
{
startPage();
return getDataTable(companyCollectionService.jobCompany(companyId));
}
@GetMapping("/card")
@ApiOperation("查看企业卡片")
public TableDataInfo card()
{
startPage();
return getDataTable(companyCardService.cardApp());
}
@BussinessLog(title = "收藏企业卡片")
@PutMapping("/card/collection/{companyCardId}")
@ApiOperation("收藏企业卡片")
public AjaxResult cardCollection(@PathVariable Long companyCardId)
{
companyCardService.cardCollection(companyCardId);
return success();
}
@BussinessLog(title = "取消收藏企业卡片")
@DeleteMapping("/card/collection/{companyCardId}")
@ApiOperation("取消收藏公司卡片")
public AjaxResult cardCancel(@PathVariable Long companyCardId)
{
companyCardService.cardCancel(companyCardId);
return success();
}
@GetMapping("/count/{companyId}")
@ApiOperation("公司招聘的岗位数量")
public AjaxResult count(@PathVariable Long companyId)
{
Integer count = companyService.count(companyId);
return success(count);
}
@GetMapping("/label")
@ApiOperation("公司标签下的公司")
public TableDataInfo label(LabelQuery labelQuery)
{
CompanyCard companyCard = companyCardMapper.selectById(labelQuery.getCardId());
startPage();
List<Company> companyList = companyService.label(companyCard,labelQuery);
return getDataTable(companyList);
}
@PostMapping("/register")
@ApiOperation("招聘企业登记")
@BussinessLog(title = "招聘企业登记")
public AjaxResult register(Company company)
{
companyService.register(company);
return AjaxResult.success();
}
@GetMapping("/register/status")
@ApiOperation("招聘企业登记进度查询")
public AjaxResult registerStatus()
{
Company status = companyService.registerStatus();
return AjaxResult.success(status);
}
@GetMapping("/queryCodeCompany")
@ApiOperation("根据社会信用代码查询企业")
public AjaxResult queryCodeCompany(@RequestParam("code") String code)
{
if (!StringUtils.hasText(code)) {
return AjaxResult.error("社会信用代码不能为空");
}
return AjaxResult.success(companyService.queryCodeCompany(code));
}
@ApiOperation("模糊查询公司列表")
@GetMapping("/likeList")
public TableDataInfo likeList(Company company)
{
List<Company> list = companyService.selectLikeCompanyList(company);
return getDataTable(list);
}
}

View File

@@ -0,0 +1,74 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.JobFair;
import com.ruoyi.cms.service.IFairCollectionService;
import com.ruoyi.cms.service.IJobFairService;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 招聘会Controller
*
* @author lishundong
* @date 2024-09-04
*/
@RestController
@RequestMapping("/app/fair")
@Api(tags = "移动端:招聘会")
public class AppFairController extends BaseController
{
@Autowired
private IJobFairService jobFairService;
@Autowired
private IFairCollectionService fairCollectionService;
/**
* 招聘会列表
*/
@BussinessLog(title = "招聘会列表")
@GetMapping
public TableDataInfo list(JobFair jobFair)
{
startPage();
List<JobFair> results = jobFairService.appList(jobFair);
return getDataTable(results);
}
/**
* 招聘会详情
*/
@BussinessLog(title = "招聘会详情")
@GetMapping("/{fairId}")
public AjaxResult appDetail(@ApiParam("招聘会id") @PathVariable Long fairId)
{
return success(jobFairService.appDetail(fairId));
}
/**
* 用户收藏招聘会
*/
@BussinessLog(title = "用户收藏招聘会")
@PostMapping("/collection/{fairId}")
public AjaxResult companyCollection(@ApiParam("招聘会id") @PathVariable Long fairId)
{
return toAjax(fairCollectionService.fairCollection(fairId));
}
/**
* 用户取消收藏招聘会
*/
@BussinessLog(title = "用户取消收藏招聘会")
@DeleteMapping("/collection/{fairId}")
public AjaxResult companyCancel(@ApiParam("招聘会id") @PathVariable Long fairId)
{
return toAjax(fairCollectionService.cancel(fairId));
}
}

View File

@@ -0,0 +1,33 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.common.core.domain.entity.File;
import com.ruoyi.cms.service.IFileService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@RestController
@RequestMapping("/app/file")
public class AppFileController extends BaseController {
@Autowired
private IFileService fileService;
@ApiOperation("上传文件")
@PostMapping("/upload")
public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "bussinessid",required = false) Long bussinessId) {
return fileService.uploadFile(file,bussinessId);
}
@ApiOperation("获取附件列表")
@GetMapping("/list")
public TableDataInfo list(File file)
{
List<File> results = fileService.selectFileList(file);
return getDataTable(results);
}
}

View File

@@ -0,0 +1,235 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.ESJobDocument;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.query.ESJobSearch;
import com.ruoyi.cms.service.ICompanyService;
import com.ruoyi.cms.service.IESJobSearchService;
import com.ruoyi.cms.service.IJobCollectionService;
import com.ruoyi.cms.service.IJobService;
import com.ruoyi.cms.util.RoleUtils;
import com.ruoyi.cms.util.sensitiveWord.SensitiveWordChecker;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.ArrayUtils;
import org.dromara.easyes.core.biz.EsPageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 岗位Controller
*
* @author lishundong
* @date 2024-09-03
*/
@RestController
@RequestMapping("/app/job")
@Api(tags = "移动端:岗位相关接口")
public class AppJobController extends BaseController
{
@Autowired
private IJobService jobService;
@Autowired
private IJobCollectionService jobCollectionService;
@Autowired
private IESJobSearchService esJobSearchService;
@Autowired
private SensitiveWordChecker sensitiveWordChecker;
/**
* 查询岗位列表
*/
@ApiOperation("查询岗位列表")
@GetMapping("/list")
public TableDataInfo list(ESJobSearch job)
{
EsPageInfo<ESJobDocument> list = jobService.appList(job);
return getTableDataInfo2(list,job);
}
private TableDataInfo getTableDataInfo2(EsPageInfo<ESJobDocument> list, ESJobSearch job) {
long total = list.getTotal();
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(200);
rspData.setRows(list.getList());
rspData.setTotal(total > 200 ? 200 : total);
job.setCompany(null);
rspData.setData(job);
return rspData;
}
/**
* 获取5条推荐岗位
*/
@ApiOperation("获取推荐岗位")
@GetMapping("/recommend")
public AjaxResult recommend(ESJobSearch esJobSearch)
{
if (RoleUtils.getAppCurrentUseridCard() != null) {
esJobSearch.setCode(RoleUtils.getAppCurrentUseridCard());
esJobSearch.setUserType(RoleUtils.getAppIscompanyUser());
}
List<ESJobDocument> jobList = jobService.recommend(esJobSearch);
return success(jobList);
}
@ApiOperation("获取短视频")
@GetMapping("/littleVideo")
public AjaxResult littleVideo(ESJobSearch esJobSearch)
{
List<ESJobDocument> jobList = jobService.littleVideo(esJobSearch);
return success(jobList);
}
@ApiOperation("随机获取短视频")
@GetMapping("/littleVideo/random")
public AjaxResult littleVideo(@RequestParam(required = true) String uuid,@RequestParam(required = false) Integer count,@RequestParam(required = false) String jobTitle)
{
List<ESJobDocument> jobList = jobService.littleVideoRandom(uuid,count,jobTitle);
return success(jobList);
}
/**
* 附件工作
*/
@ApiOperation("附近工作")
@PostMapping(value = "/nearJob")
public TableDataInfo nearJob(@RequestBody ESJobSearch jobQuery)
{
EsPageInfo<ESJobDocument> list = esJobSearchService.nearJob(jobQuery);
List<ESJobDocument> jobList = list.getList();
list.setList(jobList);
return getTableDataInfo(list);
}
/**
* 附件工作
*/
@ApiOperation("区县工作")
@PostMapping(value = "/countyJob")
public TableDataInfo countyJob(@RequestBody ESJobSearch job)
{
EsPageInfo<ESJobDocument> list = jobService.countyJobList(job);
List<ESJobDocument> jobList = list.getList();
list.setList(jobList);
return getTableDataInfo(list);
}
/**
* 地铁周边
*/
@ApiOperation("地铁周边")
@PostMapping(value = "/subway")
public TableDataInfo subway(@RequestBody ESJobSearch jobQuery)
{
EsPageInfo<ESJobDocument> list = jobService.subway(jobQuery);
List<ESJobDocument> jobList = list.getList();
list.setList(jobList);
return getTableDataInfo(list);
}
/**
* 商圈周边
*/
@ApiOperation("商圈周边")
@PostMapping(value = "/commercialArea")
public TableDataInfo commercialArea(@RequestBody ESJobSearch jobQuery)
{
EsPageInfo<ESJobDocument> list = jobService.commercialArea(jobQuery);
List<ESJobDocument> jobList = list.getList();
list.setList(jobList);
return getTableDataInfo(list);
}
/**
* 获取岗位详细信息
*/
@ApiOperation("获取岗位详细信息")
@GetMapping(value = "/{jobId}")
public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
{
Job job = jobService.selectJobByJobIdApp(jobId);
return success(job);
}
/**
* 用户收藏岗位
*/
@BussinessLog(title = "用户收藏岗位")
@PostMapping("/collection/{jobId}")
@ApiOperation("用户收藏")
public AjaxResult jobCollection(@ApiParam("岗位id") @PathVariable Long jobId)
{
return toAjax(jobCollectionService.jobCollection(jobId));
}
/**
* 用户取消收藏岗位
*/
@BussinessLog(title = "用户取消收藏岗位")
@DeleteMapping("/collection/{jobId}")
@ApiOperation("用户取消收藏岗位")
public AjaxResult cancel(@ApiParam("岗位id") @PathVariable Long jobId)
{
return toAjax(jobCollectionService.cancel(jobId));
}
/**
* 用户申请岗位
*/
@BussinessLog(title = "用户申请岗位")
@GetMapping("/apply/{jobId}")
@ApiOperation("用户申请岗位")
public AjaxResult apply(@ApiParam("岗位id") @PathVariable Long jobId)
{
return toAjax(jobCollectionService.apply(jobId));
}
@GetMapping("/competitiveness/{jobId}")
@ApiOperation("竞争力分析")
public AjaxResult competitiveness(@ApiParam("岗位id") @PathVariable Long jobId) {
return success(jobCollectionService.competitiveness(jobId));
}
private TableDataInfo getTableDataInfo(EsPageInfo<ESJobDocument> result){
long total = result.getTotal();
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(200);
rspData.setRows(result.getList());
rspData.setTotal(total > 200 ? 200 : total);
return rspData;
}
@BussinessLog(title = "移动端发布岗位")
@PostMapping("/publishJob")
public AjaxResult fix(@RequestBody Job job)
{
// 校验描述中的敏感词
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
if (!sensitiveWords.isEmpty()) {
String errorMsg = "描述中包含敏感词:" + String.join("", sensitiveWords);
return AjaxResult.error(errorMsg);
}
jobService.publishJob(job);
return success();
}
@GetMapping("/jobCompare")
@ApiOperation("根据多个岗位id查询岗位详情")
public AjaxResult jobCompare(@ApiParam("岗位ID数组") @RequestParam("jobIds") Long[] jobIds) {
if (ArrayUtils.isEmpty(jobIds)) {
return AjaxResult.error("请传递岗位ID参数jobIds多个ID用&分隔");
}
if (jobIds.length > 5) {
return AjaxResult.error("最多支持对比5个岗位请减少参数数量");
}
return success(esJobSearchService.selectByIds(jobIds));
}
@GetMapping("/applyJobList")
@ApiOperation("根据岗位id查询岗位申请人员")
public AjaxResult applyJobList(@ApiParam("岗位id") @RequestParam("jobId") Long jobId) {
if (jobId==null) {
return AjaxResult.error("请传递岗位ID");
}
return success(jobService.selectApplyJobUserList(jobId));
}
}

View File

@@ -0,0 +1,63 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.Notice;
import com.ruoyi.cms.service.IAppNoticeService;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/app/notice")
@Api(tags = "移动端:消息")
public class AppNoticeInfoController extends BaseController {
@Autowired
private IAppNoticeService appNoticeService;
@ApiOperation("消息列表")
@GetMapping("/info")
public AjaxResult listNotRead(@RequestParam(required = false) Integer isRead)
{
List<Notice> appNoticeVO = appNoticeService.listNotRead(isRead);
return AjaxResult.success(appNoticeVO);
}
@ApiOperation("推荐岗位列表")
@GetMapping("/recommend")
public TableDataInfo recommend(@RequestParam(required = false)String jobTitle)
{
startPage();
List<Job> list = appNoticeService.recommend(jobTitle);
return getDataTable(list);
}
@ApiOperation("系统通知已读")
@PostMapping("/read/sysNotice")
@BussinessLog(title = "系统通知标记已读")
public AjaxResult sysNotice(@RequestParam String id)
{
appNoticeService.sysNotice(id);
return AjaxResult.success();
}
@ApiOperation("岗位推荐、招聘会已读")
@PostMapping("/read")
@BussinessLog(title = "岗位推荐、招聘会已读标记已读")
public AjaxResult read(@RequestParam String id)
{
appNoticeService.read(id);
return AjaxResult.success();
}
@ApiOperation("系统通知列表")
@GetMapping("/sysNotice")
public TableDataInfo sysNoticeList()
{
startPage();
List<Notice> list = appNoticeService.sysNoticeList();
return getDataTable(list);
}
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.service.ICompanyService;
import com.ruoyi.cms.service.IJobService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 岗位Controller
*
* @author lishundong
* @date 2024-09-03
*/
@RestController
@RequestMapping("/app/script")
@Api(tags = "移动端:脚本")
public class AppScriptController extends BaseController
{
@Autowired
private IJobService jobService;
@Autowired
private ICompanyService companyService;
//更新经纬度
@GetMapping("/updateLon")
public void updateLon()
{
jobService.updateLon();
}
//导入数据
@GetMapping("/import")
public AjaxResult importData()
{
jobService.importData();
return success();
}
//导入原始数据
@GetMapping("/importRow")
public AjaxResult importRow(@RequestParam String path)
{
jobService.importRow(path);
return success();
}
// 导入500强
@GetMapping("/importLabel500")
public void importLabel()
{
companyService.importLabel();
}
// 随机导入3个公司到银行标签
@GetMapping("/importLabelBank")
public void importLabelBank()
{
companyService.importLabelBank();
}
}

View File

@@ -0,0 +1,81 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.service.AppSkillService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.AppSkill;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户技能信息
*
* @author
* @email
* @date 2025-10-21 12:22:09
*/
@RestController
@RequestMapping("/app/appskill")
@Api(tags = "移动端:用户技能")
public class AppSkillController extends BaseController {
@Autowired
private AppSkillService appSkillService;
/**
* 列表
*/
@ApiOperation("获取技能列表")
@GetMapping("/list")
public TableDataInfo list(AppSkill appSkill){
startPage();
List<AppSkill> list=appSkillService.getList(appSkill);
return getDataTable(list);
}
/**
* 信息
*/
@ApiOperation("获取技能详细信息")
@GetMapping(value = "/{id}")
public AjaxResult info(@PathVariable("id") Long id){
return success(appSkillService.getAppskillById(id));
}
/**
* 保存
*/
@ApiOperation("新增技能信息")
@PostMapping("/add")
public AjaxResult save(@RequestBody AppSkill appSkill){
return toAjax(appSkillService.insertAppskill(appSkill));
}
/**
* 修改
*/
@ApiOperation("修改技能详细信息")
@PutMapping("/edit")
public AjaxResult update(@RequestBody AppSkill appSkill){
return toAjax(appSkillService.updateAppskillById(appSkill));
}
/**
* 删除
*/
@ApiOperation("删除技能详细信息")
@DeleteMapping("/{id}")
public AjaxResult delete(@ApiParam("主键id") @PathVariable Long id){
return toAjax(appSkillService.removeAppskillIds(new Long[]{id}));
}
}

View File

@@ -0,0 +1,37 @@
package com.ruoyi.cms.controller.app;
import com.alibaba.nls.client.AccessToken;
import com.ruoyi.cms.handler.SpeechRecognizerAI;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* app语音Controller
*
* @author lishundong
* @date 2024-09-03
*/
@RestController
@RequestMapping("/app/speech")
@Api(tags = "移动端:用户相关")
public class AppSpeechController extends BaseController
{
private String appKey = "4lFYn2yPsQymwGu8";
private String id = "LTAI5t9hhSqdDHqwH3RjgyYj";
private String secret = "ni5aW3vxrWouMwcGqJPfh9Uu56PBuv";
private String url = System.getenv().getOrDefault("NLS_GATEWAY_URL", "wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1");
@ApiOperation("统计")
@GetMapping("/getToken")
public AjaxResult getToken()
{
SpeechRecognizerAI recognizerDemo = new SpeechRecognizerAI(appKey, id, secret, url);
AccessToken accessToken = recognizerDemo.getAccessToken();
String token = "wss://nls-gateway.cn-shanghai.aliyuncs.com/ws/v1?appkey="+appKey+"&token="+accessToken.getToken();
return AjaxResult.success(token);
}
}

View File

@@ -0,0 +1,171 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.cms.domain.AppReviewJob;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.common.core.domain.entity.Company;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.JobFair;
import com.ruoyi.cms.domain.query.MineJobQuery;
import com.ruoyi.cms.service.*;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.cms.domain.vo.AppUserLky;
import com.ruoyi.common.core.domain.model.RegisterBody;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SiteSecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* app用户Controller
*
* @author lishundong
* @date 2024-09-03
*/
@RestController
@RequestMapping("/app/user")
@Api(tags = "移动端:用户相关")
public class AppUserController extends BaseController
{
@Autowired
private IAppUserService appUserService;
@Autowired
private IAppReviewJobService appReviewJobService;
@Autowired
private IJobCollectionService jobCollectionService;
@Autowired
private ICompanyCollectionService companyCollectionService;
@Autowired
private IJobApplyService jobApplyService;
@Autowired
private IFairCollectionService fairCollectionService;
/**
* 查询岗位列表
*/
@ApiOperation("保存注册信息")
@PostMapping("/registerUser")
@BussinessLog(title = "保存简历")
public AjaxResult registerUser(@RequestBody RegisterBody registerBody)
{
appUserService.registerAppUser(registerBody);
return AjaxResult.success();
}
@ApiOperation("保存简历")
@PostMapping("/resume")
public AjaxResult saveResume(@RequestBody AppUser appUser)
{
appUser.setUserId(SiteSecurityUtils.getUserId());
appUserService.updateAppUser(appUser);
return AjaxResult.success();
}
@ApiOperation("查看简历")
@GetMapping("/resume")
public AjaxResult getResume()
{
AppUser appUser = appUserService.selectAppUserByUserId(SiteSecurityUtils.getUserId());
return AjaxResult.success(appUser);
}
@ApiOperation("我的浏览")
@GetMapping("/review")
public TableDataInfo review(MineJobQuery jobQuery)
{
startPage();
List<Job> jobs = appReviewJobService.review(jobQuery);
return getDataTable(jobs);
}
@ApiOperation("我的浏览-日期数组")
@GetMapping("/review/array")
public AjaxResult reviewArray(MineJobQuery jobQuery)
{
List<String> dateList = appReviewJobService.reviewArray();
return AjaxResult.success(dateList);
}
@ApiOperation("我的岗位收藏")
@GetMapping("/collection/job")
public TableDataInfo collectionJob()
{
startPage();
List<Job> jobs = jobCollectionService.collectionJob();
return getDataTable(jobs);
}
@ApiOperation("我的公司收藏")
@GetMapping("/collection/company")
public TableDataInfo collectionCompany()
{
startPage();
List<Company> jobs = companyCollectionService.collectionCompany();
return getDataTable(jobs);
}
@ApiOperation("我的招聘会收藏")
@GetMapping("/collection/fair")
public TableDataInfo collectionFair(@RequestParam(name = "type") Integer type)
{
startPage();
List<JobFair> jobs = fairCollectionService.appCollectionFair(type);
return getDataTable(jobs);
}
@ApiOperation("我申请的岗位")
@GetMapping("/apply/job")
public TableDataInfo applyJob()
{
startPage();
List<Job> jobs = jobApplyService.applyJob();
return getDataTable(jobs);
}
@ApiOperation("统计")
@GetMapping("/statistics")
public AjaxResult statistics()
{
HashMap<String,Integer> result = jobApplyService.statistics();
return AjaxResult.success(result);
}
@ApiOperation("根据条件查询用户信息")
@GetMapping("/list")
public AjaxResult getUserList(AppUser appUser)
{
List<AppUser> list = appUserService.selectAppUserList(appUser);
return AjaxResult.success(list);
}
@ApiOperation("返回求职者劳科院-当前职位名称、技能标签")
@GetMapping("/appUserInfo")
public AjaxResult appUserInfo(AppUser appUser)
{
if(!SiteSecurityUtils.isLogin()){
return AjaxResult.error("未登录!");
}
appUser.setUserId(SiteSecurityUtils.getUserId());
AppUserLky appUserLky = appUserService.selectAppUserInfo(appUser);
return AjaxResult.success(appUserLky);
}
@PostMapping("/browse")
@ApiOperation("用户浏览")
public AjaxResult browse(@RequestBody AppReviewJob appReviewJob)
{
if(appReviewJob.getJobId()==null){
return AjaxResult.error("岗位id为空");
}
if(!SiteSecurityUtils.isLogin()){
return AjaxResult.error("用户未登录!");
}
if(StringUtils.isEmpty(appReviewJob.getReviewDate())){
appReviewJob.setReviewDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,new Date()));
}
appReviewJob.setUserId(SiteSecurityUtils.getUserId());
return toAjax(appReviewJobService.insertAppReviewJob(appReviewJob));
}
}

View File

@@ -0,0 +1,88 @@
package com.ruoyi.cms.controller.app;
import com.ruoyi.common.core.domain.entity.UserWorkExperiences;
import com.ruoyi.cms.service.UserWorkExperiencesService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.SiteSecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户工作经历表
*
* @author
* @email
* @date 2025-10-10 16:26:26
*/
@RestController
@RequestMapping("/app/userworkexperiences")
@Api(tags = "移动端:用户工作经历")
public class AppUserWorkExperiencesController extends BaseController {
@Autowired
private UserWorkExperiencesService userWorkExperiencesService;
/**
* 列表
*/
@ApiOperation("工作经历列表信息")
@GetMapping("/list")
public TableDataInfo list(UserWorkExperiences userWorkExperiences){
if(userWorkExperiences.getUserId()==null){
userWorkExperiences.setUserId(SiteSecurityUtils.getUserId());
}
startPage();
List<UserWorkExperiences> list=userWorkExperiencesService.getWorkExperiencesList(userWorkExperiences);
return getDataTable(list);
}
/**
* 获取详细信息
*/
@ApiOperation("获取工作经历详细信息")
@GetMapping(value = "/{id}")
public AjaxResult query(@PathVariable("id") Long id){
return success(userWorkExperiencesService.getWorkExperiencesById(id));
}
/**
* 保存
*/
@ApiOperation("新增工作经历")
@PostMapping("/add")
public AjaxResult add(@RequestBody UserWorkExperiences userWorkExperiences){
if(userWorkExperiences.getUserId()==null){
userWorkExperiences.setUserId(SiteSecurityUtils.getUserId());
}
return toAjax(userWorkExperiencesService.insertWorkExperiences(userWorkExperiences));
}
/**
* 修改
*/
@ApiOperation("修改工作经历")
@PutMapping("/edit")
public AjaxResult update(@RequestBody UserWorkExperiences userWorkExperiences){
return toAjax(userWorkExperiencesService.updateWorkExperiencesById(userWorkExperiences));
}
/**
* 删除
*/
@ApiOperation("删除工作经历")
@DeleteMapping("/{id}")
public AjaxResult remove(@ApiParam("招聘会id") @PathVariable Long id){
return toAjax(userWorkExperiencesService.deleteWorkExperiencesIds(new Long[]{id}));
}
}

View File

@@ -0,0 +1,118 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.BussinessDictData;
import com.ruoyi.cms.service.IBussinessDictDataService;
import com.ruoyi.cms.service.IBussinessDictTypeService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* 数据字典信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/cms/dict/data")
public class BussinessDictDataController extends BaseController
{
@Autowired
private IBussinessDictDataService dictDataService;
@Autowired
private IBussinessDictTypeService dictTypeService;
@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public TableDataInfo list(BussinessDictData dictData)
{
startPage();
List<BussinessDictData> list = dictDataService.selectDictDataList(dictData);
return getDataTable(list);
}
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, BussinessDictData dictData)
{
List<BussinessDictData> list = dictDataService.selectDictDataList(dictData);
ExcelUtil<BussinessDictData> util = new ExcelUtil<BussinessDictData>(BussinessDictData.class);
util.exportExcel(response, list, "字典数据");
}
/**
* 查询字典数据详细
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictCode}")
public AjaxResult getInfo(@PathVariable Long dictCode)
{
return success(dictDataService.selectDictDataById(dictCode));
}
/**
* 根据字典类型查询字典数据信息
*/
@GetMapping(value = "/type/{dictType}")
public AjaxResult dictType(@PathVariable String dictType)
{
List<BussinessDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data))
{
data = new ArrayList<BussinessDictData>();
}
return success(data);
}
/**
* 新增字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@Log(title = "字典数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody BussinessDictData dict)
{
dict.setCreateBy(getUsername());
return toAjax(dictDataService.insertDictData(dict));
}
/**
* 修改保存字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody BussinessDictData dict)
{
dict.setUpdateBy(getUsername());
return toAjax(dictDataService.updateDictData(dict));
}
/**
* 删除字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictCodes}")
public AjaxResult remove(@PathVariable Long[] dictCodes)
{
dictDataService.deleteDictDataByIds(dictCodes);
return success();
}
}

View File

@@ -0,0 +1,52 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.service.BussinessDictJobCategoryService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.domain.entity.BussinessDictJobCategory;
/**
* 技能字典表
*
* @author
* @email
* @date 2025-10-30 19:25:48
*/
@RestController
@RequestMapping("/cms/dict")
@Anonymous
public class BussinessDictJobCategoryController {
@Autowired
private BussinessDictJobCategoryService bussinessDictJobCategoryService;
/**
* 列表
*/
@GetMapping("/jobCategory")
public AjaxResult jobCategory(BussinessDictJobCategory bussinessDictJobCategory){
if (!hasAnyQueryCondition(bussinessDictJobCategory)) {
return AjaxResult.error("请传递至少一个查询条件(大类、中类、小类、名称),避免数据量过大!");
}
return AjaxResult.success(bussinessDictJobCategoryService.getList(bussinessDictJobCategory));
}
/**
* 判断是否包含至少一个有效的查询条件
*/
private boolean hasAnyQueryCondition(BussinessDictJobCategory queryParam) {
// 避免空指针(若 queryParam 可能为 null需先判断
if (queryParam == null) {
return false;
}
// 检查四个字段中是否有非空值
return StringUtils.isNotEmpty(queryParam.getLabd())
|| StringUtils.isNotEmpty(queryParam.getLabz())
|| StringUtils.isNotEmpty(queryParam.getLabx())
|| StringUtils.isNotEmpty(queryParam.getName());
}
}

View File

@@ -0,0 +1,127 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.BussinessDictType;
import com.ruoyi.cms.service.IBussinessDictTypeService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 数据字典信息
*
* @author ruoyi
*/
@RestController
@RequestMapping("/cms/dict/type")
public class BussinessDictTypeController extends BaseController
{
@Autowired
private IBussinessDictTypeService dictTypeService;
@PreAuthorize("@ss.hasPermi('system:dict:list')")
@GetMapping("/list")
public TableDataInfo list(BussinessDictType dictType)
{
startPage();
List<BussinessDictType> list = dictTypeService.selectDictTypeList(dictType);
return getDataTable(list);
}
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, BussinessDictType dictType)
{
List<BussinessDictType> list = dictTypeService.selectDictTypeList(dictType);
ExcelUtil<BussinessDictType> util = new ExcelUtil<BussinessDictType>(BussinessDictType.class);
util.exportExcel(response, list, "字典类型");
}
/**
* 查询字典类型详细
*/
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictId}")
public AjaxResult getInfo(@PathVariable Long dictId)
{
return success(dictTypeService.selectDictTypeById(dictId));
}
/**
* 新增字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:add')")
@Log(title = "字典类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody BussinessDictType dict)
{
if (!dictTypeService.checkDictTypeUnique(dict))
{
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setCreateBy(getUsername());
return toAjax(dictTypeService.insertDictType(dict));
}
/**
* 修改字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody BussinessDictType dict)
{
if (!dictTypeService.checkDictTypeUnique(dict))
{
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setUpdateBy(getUsername());
return toAjax(dictTypeService.updateDictType(dict));
}
/**
* 删除字典类型
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictIds}")
public AjaxResult remove(@PathVariable Long[] dictIds)
{
dictTypeService.deleteDictTypeByIds(dictIds);
return success();
}
/**
* 刷新字典缓存
*/
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
@DeleteMapping("/refreshCache")
public AjaxResult refreshCache()
{
dictTypeService.resetDictCache();
return success();
}
/**
* 获取字典选择框列表
*/
@GetMapping("/optionselect")
public AjaxResult optionselect()
{
List<BussinessDictType> dictTypes = dictTypeService.selectDictTypeAll();
return success(dictTypes);
}
}

View File

@@ -0,0 +1,72 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.BussinessOperLog;
import com.ruoyi.cms.service.IBussinessOperLogService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 操作日志记录
*
* @author ruoyi
*/
@RestController
@RequestMapping("/cms/operlog")
@Api(tags = "后台App用户操作日志")
public class BussinessOperlogController extends BaseController
{
@Autowired
private IBussinessOperLogService operLogService;
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
@GetMapping("/list")
@ApiOperation("日志列表")
public TableDataInfo list(BussinessOperLog operLog)
{
startPage();
List<BussinessOperLog> list = operLogService.selectOperLogList(operLog);
return getDataTable(list);
}
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
@PostMapping("/export")
@ApiOperation("日志导出excel")
public void export(HttpServletResponse response, BussinessOperLog operLog)
{
List<BussinessOperLog> list = operLogService.selectOperLogList(operLog);
ExcelUtil<BussinessOperLog> util = new ExcelUtil<BussinessOperLog>(BussinessOperLog.class);
util.exportExcel(response, list, "操作日志");
}
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/{operIds}")
@ApiOperation("删除操作日志")
public AjaxResult remove(@PathVariable Long[] operIds)
{
return toAjax(operLogService.deleteOperLogByIds(operIds));
}
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
@DeleteMapping("/clean")
@ApiOperation("清空操作日志")
public AjaxResult clean()
{
operLogService.cleanOperLog();
return success();
}
}

View File

@@ -0,0 +1,174 @@
package com.ruoyi.cms.controller.cms;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.cms.util.RoleUtils;
import com.ruoyi.common.annotation.BussinessLog;
import com.ruoyi.common.core.domain.model.RegisterBody;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.cms.service.IAppUserService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* APP用户Controller
*
* @author lishundong
* @date 2024-09-03
*/
@RestController
@RequestMapping("/cms/appUser")
@Api(tags = "后台APP用户管理")
public class CmsAppUserController extends BaseController
{
@Autowired
private IAppUserService appUserService;
/**
* 查询APP用户列表
*/
@ApiOperation("查询APP用户列表")
// @PreAuthorize("@ss.hasPermi('cms:appUser:list')")
@GetMapping("/list")
public TableDataInfo list(AppUser appUser)
{
startPage();
List<AppUser> list = appUserService.selectAppUserList(appUser);
return getDataTable(list);
}
/**
* 导出APP用户列表
*/
@ApiOperation("导出APP用户列表")
@PreAuthorize("@ss.hasPermi('cms:appUser:export')")
@Log(title = "APP用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AppUser appUser)
{
List<AppUser> list = appUserService.selectAppUserList(appUser);
ExcelUtil<AppUser> util = new ExcelUtil<AppUser>(AppUser.class);
util.exportExcel(response, list, "APP用户数据");
}
/**
* 获取APP用户详细信息
*/
@ApiOperation("获取APP用户详细信息")
@PreAuthorize("@ss.hasPermi('bussiness:user:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return success(appUserService.selectAppUserByUserId(userId));
}
/**
* 新增APP用户
*/
@ApiOperation("新增APP用户")
@PreAuthorize("@ss.hasPermi('bussiness:user:add')")
@Log(title = "APP用户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AppUser appUser)
{
return toAjax(appUserService.insertAppUser(appUser));
}
/**
* 修改APP用户
*/
@ApiOperation("修改APP用户")
@Log(title = "APP用户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AppUser appUser)
{
if(appUser.getUserId()==null){
return AjaxResult.error("参数userId为空");
}
return toAjax(appUserService.updateAppUser(appUser));
}
/**
* 删除APP用户
*/
@ApiOperation("删除APP用户")
@PreAuthorize("@ss.hasPermi('bussiness:user:remove')")
@Log(title = "APP用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
return toAjax(appUserService.deleteAppUserByUserIds(userIds));
}
/**
* 获取APP用户详细信息pc端获取移动端简历信息
*/
@ApiOperation("pc端个人简历信息-获取APP用户详细信息")
@GetMapping(value = "/getUserInfo")
public AjaxResult getUserInfo()
{
if(!SecurityUtils.isLogin()){
return AjaxResult.error("未登录!");
}
return success(appUserService.getUserInfo());
}
/**
* 修改用户简历信息-(技能信息、经历信息)
*/
@ApiOperation("修改用户简历信息")
@PostMapping("/editRegisterUser")
@BussinessLog(title = "保存简历")
public AjaxResult editRegisterUser(@RequestBody RegisterBody registerBody)
{
if (registerBody == null) {
return AjaxResult.error("入参registerBody不能为空!");
}
if(registerBody.getAppUser()==null){
return AjaxResult.error("用户信息为空!");
}
return AjaxResult.success(appUserService.editRegisterUser(registerBody));
}
@ApiOperation("查询APP用户列表")
@GetMapping("/noTmlist")
public TableDataInfo noTmlist(AppUser appUser)
{
startPage();
List<AppUser> list = appUserService.selectNoTmAppUserList(appUser);
return getDataTable(list);
}
@ApiOperation("查询我的中(已经投递的,收藏的,足迹,预约)")
@GetMapping("/getMyTj")
public AjaxResult getMyTj()
{
if(!SecurityUtils.isLogin()){
return AjaxResult.error("未登录!");
}
if(StringUtils.isEmpty(RoleUtils.getCurrentUseridCard())){
return AjaxResult.error("用户信息为空!");
}
AppUser appUser=appUserService.selectAppuserByIdcard(RoleUtils.getCurrentUseridCard());
return AjaxResult.success(appUserService.getMyTj(appUser.getUserId()));
}
}

View File

@@ -0,0 +1,317 @@
package com.ruoyi.cms.controller.cms;
import com.alibaba.fastjson.JSON;
import com.ruoyi.cms.domain.*;
import com.ruoyi.cms.domain.query.ESJobSearch;
import com.ruoyi.cms.domain.vo.CandidateVO;
import com.ruoyi.cms.domain.vo.CompanyVo;
import com.ruoyi.cms.service.*;
import com.ruoyi.cms.util.RoleUtils;
import com.ruoyi.cms.util.StringUtil;
import com.ruoyi.cms.util.sensitiveWord.SensitiveWordChecker;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.common.core.domain.entity.Company;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* 岗位Controller
*
* @author lishundong
* @date 2024-09-03
*/
@RestController
@RequestMapping("/cms/job")
@Api(tags = "后台:岗位管理")
@Anonymous
public class CmsJobController extends BaseController
{
@Autowired
private IJobService jobService;
@Autowired
SensitiveWordChecker sensitiveWordChecker;
@Autowired
private ICompanyService companyService;
@Autowired
private IJobCollectionService jobCollectionService;
@Autowired
private IAppUserService appUserService;
@Autowired
private IJobApplyService iJobApplyService;
@Autowired
private IAppReviewJobService iAppReviewJobService;
/**
* 查询岗位列表
*/
@ApiOperation("查询岗位列表")
// @PreAuthorize("@ss.hasPermi('cms:job:list')")
@GetMapping("/list")
public TableDataInfo list(Job job)
{
if (RoleUtils.isCompanyAdmin()) {
Company company = companyService.queryCodeCompany(RoleUtils.getCurrentUseridCard());
job.setCompanyId(Objects.nonNull(company) ? company.getCompanyId() : null);
}
startPage();
List<Job> list = jobService.selectJobList(job);
return getDataTable(list);
}
/**
* 获取岗位详细信息
*/
@ApiOperation("获取岗位详细信息")
// @PreAuthorize("@ss.hasPermi('bussiness:job:query')")
@GetMapping(value = "/{jobId}")
public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
{
return success(jobService.selectJobByJobId(jobId));
}
/**
* 导出岗位列表
*/
@ApiOperation("导出岗位列表")
// @PreAuthorize("@ss.hasPermi('bussiness:job:export')")
@Log(title = "岗位", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Job job)
{
List<Job> list = jobService.selectJobList(job);
ExcelUtil<Job> util = new ExcelUtil<Job>(Job.class);
util.exportExcel(response, list, "岗位数据");
}
/**
* 新增岗位
*/
@ApiOperation("新增岗位")
// @PreAuthorize("@ss.hasPermi('bussiness:job:add')")
@Log(title = "岗位", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Job job)
{
// 校验描述中的敏感词
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
if (!sensitiveWords.isEmpty()) {
String errorMsg = "描述中包含敏感词:" + String.join("", sensitiveWords);
return AjaxResult.error(errorMsg);
}
// 无敏感词,执行插入
return toAjax(jobService.insertJob(job));
}
/**
* 修改岗位
*/
@ApiOperation("修改岗位")
// @PreAuthorize("@ss.hasPermi('bussiness:job:edit')")
@Log(title = "岗位", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Job job)
{
// 校验描述中的敏感词
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
if (!sensitiveWords.isEmpty()) {
String errorMsg = "描述中包含敏感词:" + String.join("", sensitiveWords);
return AjaxResult.error(errorMsg);
}
return toAjax(jobService.updateJob(job));
}
/**
* 删除岗位
*/
@ApiOperation("删除岗位")
// @PreAuthorize("@ss.hasPermi('bussiness:job:remove')")
@Log(title = "岗位", businessType = BusinessType.DELETE)
@DeleteMapping("/{jobIds}")
public AjaxResult remove(@PathVariable Long[] jobIds)
{
return toAjax(jobService.deleteJobByJobIds(jobIds));
}
@ApiOperation("候选人查询")
@Log(title = "岗位", businessType = BusinessType.DELETE)
@GetMapping("/candidates")
@PreAuthorize("@ss.hasPermi('bussiness:job:candidates')")
public TableDataInfo candidates(Long jobId)
{
startPage();
List<CandidateVO> list = jobService.candidates(jobId);
return getDataTable(list);
}
@ApiOperation("获取推荐岗位")
@GetMapping("/recommend")
public AjaxResult recommend(ESJobSearch esJobSearch)
{
if (RoleUtils.isCompanyAdmin()) {
esJobSearch.setCode(RoleUtils.getCurrentUseridCard());
esJobSearch.setUserType(StringUtil.IS_COMPANY_USER);
}
esJobSearch.setPageSize(20);
List<ESJobDocument> jobList = jobService.sysRecommend(esJobSearch);
List<Job> jobs=new ArrayList<>();
jobList.stream().forEach(it->{
Job job=new Job();
BeanUtils.copyBeanProp(job, it);
job.setCompanyVo(JSON.parseObject(it.getCompanyVoJson(), CompanyVo.class));
jobs.add(job);
});
return success(jobs);
}
@ApiOperation("获取所有岗位")
@GetMapping("/selectAllJob")
public AjaxResult selectAllJob()
{
List<Job> jobList = jobService.selectAllJob();
return success(jobList);
}
@PostMapping("/collection")
@ApiOperation("用户收藏")
public AjaxResult jobCollection(@RequestBody JobCollection jobCollection)
{
if(jobCollection.getJobId()==null){
return AjaxResult.error("岗位id为空");
}
if(!SecurityUtils.isLogin()){
return AjaxResult.error("用户未登录!");
}
if(jobCollection.getUserId()==null){
String idCard=RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
}else{
jobCollection.setUserId(appUser.getUserId());
}
}
return toAjax(jobCollectionService.pcJobCollection(jobCollection));
}
@ApiOperation("获取用户岗位收藏列表")
@GetMapping("/getAppUserYhsc")
public AjaxResult getAppUserYhsc(JobCollection jobCollection)
{
if(!SecurityUtils.isLogin()){
return AjaxResult.error("用户未登录!");
}
if(jobCollection.getUserId()==null){
String idCard=RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
}else{
jobCollection.setUserId(appUser.getUserId());
}
}
return success(jobCollectionService.selectJobCollectionListJob(jobCollection));
}
@ApiOperation("获取用户岗位申请列表")
@GetMapping("/getAppUserYhsq")
public AjaxResult getAppUserYhsq(JobApply jobApply)
{
if(!SecurityUtils.isLogin()){
return AjaxResult.error("用户未登录!");
}
if(jobApply.getUserId()==null){
String idCard=RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
}else{
jobApply.setUserId(appUser.getUserId());
}
}
return success(iJobApplyService.selectJobApplyListJob(jobApply));
}
@ApiOperation("获取用户岗位访问足迹列表")
@GetMapping("/getAppUserYhfwzj")
public AjaxResult getAppUserYhfwzj(AppReviewJob appReviewJob)
{
if(!SecurityUtils.isLogin()){
return AjaxResult.error("用户未登录!");
}
if(appReviewJob.getUserId()==null){
String idCard=RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
}else{
appReviewJob.setUserId(appUser.getUserId());
}
}
return success(iAppReviewJobService.selectAppReviewJobListJob(appReviewJob));
}
@PostMapping("/collectionCancel")
@ApiOperation("取消收藏")
public AjaxResult pcCancel(@RequestBody JobCollection jobCollection)
{
if(jobCollection.getJobId()==null){
return AjaxResult.error("岗位id为空");
}
if(!SecurityUtils.isLogin()){
return AjaxResult.error("用户未登录!");
}
if(jobCollection.getUserId()==null){
String idCard=RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
}else{
jobCollection.setUserId(appUser.getUserId());
}
}
return toAjax(jobCollectionService.pcCancel(jobCollection));
}
@PostMapping("/browse")
@ApiOperation("岗位浏览")
public AjaxResult browse(@RequestBody AppReviewJob appReviewJob)
{
if(appReviewJob.getJobId()==null){
return AjaxResult.error("岗位id为空");
}
if(!SecurityUtils.isLogin()){
return AjaxResult.error("用户未登录!");
}
if(StringUtils.isEmpty(appReviewJob.getReviewDate())){
appReviewJob.setReviewDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,new Date()));
}
if(appReviewJob.getUserId()==null){
String idCard=RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
}else{
appReviewJob.setUserId(appUser.getUserId());
}
}
return toAjax(iAppReviewJobService.insertAppReviewJob(appReviewJob));
}
}

View File

@@ -0,0 +1,211 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.AppNotice;
import com.ruoyi.cms.domain.Notice;
import com.ruoyi.cms.domain.vo.NoticeTotal;
import com.ruoyi.cms.service.IAppNoticeService;
import com.ruoyi.cms.service.IAppUserService;
import com.ruoyi.cms.util.notice.NoticeUtils;
import com.ruoyi.cms.util.RoleUtils;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 公告 信息操作处理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/cms/notice")
public class CmsNoticeController extends BaseController
{
@Autowired
private IAppNoticeService noticeService;
@Autowired
private IAppUserService appUserService;
/**
* 获取通知公告列表
*/
@PreAuthorize("@ss.hasPermi('system:notice:list')")
@GetMapping("/list")
public TableDataInfo list(AppNotice notice)
{
startPage();
List<AppNotice> list = noticeService.selectNoticeList(notice);
return getDataTable(list);
}
/**
* 根据通知公告编号获取详细信息
*/
@PreAuthorize("@ss.hasPermi('system:notice:query')")
@GetMapping(value = "/{noticeId}")
public AjaxResult getInfo(@PathVariable Long noticeId)
{
return success(noticeService.selectNoticeById(noticeId));
}
/**
* 新增通知公告
*/
@PreAuthorize("@ss.hasPermi('system:notice:add')")
@Log(title = "通知公告", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody AppNotice notice)
{
notice.setCreateBy(getUsername());
return toAjax(noticeService.insertNotice(notice));
}
/**
* 修改通知公告
*/
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody AppNotice notice)
{
notice.setUpdateBy(getUsername());
return toAjax(noticeService.updateNotice(notice));
}
/**
* 删除通知公告
*/
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
@Log(title = "通知公告", businessType = BusinessType.DELETE)
@DeleteMapping("/{noticeIds}")
public AjaxResult remove(@PathVariable Long[] noticeIds)
{
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
}
@ApiOperation("pc端获取消息列表")
@GetMapping("/appNoticList")
public TableDataInfo selectListAppNotics(Notice notice)
{
if(!SecurityUtils.isLogin()){
error(HttpStatus.ERROR,"未登录!");
}
if(notice.getUserId()==null){
String idCard= RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
error(HttpStatus.ERROR,"用户信息未完善,请完善身份证信息!");
}else{
notice.setUserId(appUser.getUserId());
}
}
startPage();
List<Notice> notices = noticeService.selectListAppNotics(notice);
return getDataTable(notices);
}
@ApiOperation("pc端获取未读消息列表")
@GetMapping("/appNoticReadList")
public TableDataInfo appNoticReadList(Notice notice)
{
if(!SecurityUtils.isLogin()){
error(HttpStatus.ERROR,"未登录!");
}
if(notice.getUserId()==null){
String idCard= RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
error(HttpStatus.ERROR,"用户信息未完善,请完善身份证信息!");
}else{
notice.setUserId(appUser.getUserId());
}
}
startPage();
List<Notice> notices = noticeService.selectListAppNotRead(notice);
return getDataTable(notices);
}
@ApiOperation("pc端获已读消息列表")
@GetMapping("/appNoticYdList")
public TableDataInfo appNoticYdList(Notice notice)
{
if(!SecurityUtils.isLogin()){
error(HttpStatus.ERROR,"未登录!");
}
if(notice.getUserId()==null){
String idCard= RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
error(HttpStatus.ERROR,"用户信息未完善,请完善身份证信息!");
}else{
notice.setUserId(appUser.getUserId());
}
}
startPage();
notice.setIsRead(NoticeUtils.NOTICE_YD);
notice.setRemark(NoticeUtils.NOTICE_REMARK);
List<Notice> notices = noticeService.selectListAppNotices(notice);
return getDataTable(notices);
}
@ApiOperation("系统通知标记已读")
@PostMapping("/read/sysNotice")
public AjaxResult sysNotice(@RequestParam String id)
{
Long userId=null;
if(!SecurityUtils.isLogin()){
return AjaxResult.error("未登录!");
}
if(userId==null){
String idCard= RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
}else{
userId=appUser.getUserId();
}
}
noticeService.readSysNotices(id,userId);
return AjaxResult.success();
}
/**
* 获取消息条数
*/
@ApiOperation("获取移动端用户消息条数")
@GetMapping("/noticTotal")
public AjaxResult getNoticTotal(Notice notice){
if(!SecurityUtils.isLogin()){
error(HttpStatus.ERROR,"未登录!");
}
if(notice.getUserId()==null){
String idCard= RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
error(HttpStatus.ERROR,"用户信息未完善,请完善身份证信息!");
}else{
notice.setUserId(appUser.getUserId());
}
}
startPage();
NoticeTotal notices = noticeService.noticTotal(notice);
return success(notices);
}
@ApiOperation("获取移动端用户消息条数")
@DeleteMapping("/deleteNotice/{ids}")
public AjaxResult deleteNotice(@PathVariable Long[] ids){
return success(noticeService.removeNotice(ids));
}
}

View File

@@ -0,0 +1,104 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.service.AppSkillService;
import com.ruoyi.cms.service.IAppUserService;
import com.ruoyi.cms.util.RoleUtils;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.AppSkill;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户技能信息
*
* @author
* @email
* @date 2025-10-21 12:22:09
*/
@RestController
@RequestMapping("/cms/appskill")
@Api(tags = "后台:用户技能")
public class CmsSkillController extends BaseController {
@Autowired
private AppSkillService appSkillService;
@Autowired
private IAppUserService appUserService;
/**
* 列表
*/
@ApiOperation("获取技能列表")
@GetMapping("/list")
public TableDataInfo list(AppSkill appSkill){
startPage();
List<AppSkill> list=appSkillService.getList(appSkill);
return getDataTable(list);
}
/**
* 信息
*/
@ApiOperation("获取技能详情")
@GetMapping(value = "/{id}")
public AjaxResult info(@PathVariable("id") Long id){
return success(appSkillService.getAppskillById(id));
}
/**
* 保存
*/
@ApiOperation("新增技能")
@Log(title = "技能", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult save(@RequestBody AppSkill appSkill){
if(!SecurityUtils.isLogin()){
AppUser appUser=appUserService.selectAppuserByIdcard(RoleUtils.getCurrentUseridCard());
if(appUser==null){
return AjaxResult.error("未传递userId!");
}
appSkill.setUserId(appUser.getUserId());
}
return toAjax(appSkillService.insertAppskill(appSkill));
}
/**
* 修改
*/
@ApiOperation("修改技能")
@Log(title = "技能", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult update(@RequestBody AppSkill appSkill){
if (appSkill.getId()==null){
return AjaxResult.error("参数id未传递!");
}
return toAjax(appSkillService.updateAppskillById(appSkill));
}
/**
* 删除
*/
@Log(title = "删除技能", businessType = BusinessType.DELETE)
@ApiOperation("技能")
@DeleteMapping("/{ids}")
public AjaxResult delete(@ApiParam("主键ids") @PathVariable Long[] ids){
if(ids==null){
return AjaxResult.error("参数ids未传递!");
}
return toAjax(appSkillService.removeAppskillIds(ids));
}
}

View File

@@ -0,0 +1,113 @@
package com.ruoyi.cms.controller.cms;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruoyi.cms.domain.CommercialArea;
import com.ruoyi.cms.service.ICommercialAreaService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 商圈Controller
*
* @author Lishundong
* @date 2024-11-12
*/
@RestController
@RequestMapping("/cms/area")
@Api(tags = "后台:商圈")
public class CommercialAreaController extends BaseController
{
@Autowired
private ICommercialAreaService commercialAreaService;
/**
* 查询商圈列表
*/
@ApiOperation("查询商圈列表")
@PreAuthorize("@ss.hasPermi('cms:area:list')")
@GetMapping("/list")
public TableDataInfo list(CommercialArea commercialArea)
{
startPage();
List<CommercialArea> list = commercialAreaService.selectCommercialAreaList(commercialArea);
return getDataTable(list);
}
/**
* 导出商圈列表
*/
@ApiOperation("导出商圈列表")
@PreAuthorize("@ss.hasPermi('cms:area:export')")
@Log(title = "商圈", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CommercialArea commercialArea)
{
List<CommercialArea> list = commercialAreaService.selectCommercialAreaList(commercialArea);
ExcelUtil<CommercialArea> util = new ExcelUtil<CommercialArea>(CommercialArea.class);
util.exportExcel(response, list, "商圈数据");
}
/**
* 获取商圈详细信息
*/
@ApiOperation("获取商圈详细信息")
@PreAuthorize("@ss.hasPermi('cms:area:query')")
@GetMapping(value = "/{commercialAreaId}")
public AjaxResult getInfo(@PathVariable("commercialAreaId") Long commercialAreaId)
{
return success(commercialAreaService.selectCommercialAreaByCommercialAreaId(commercialAreaId));
}
/**
* 新增商圈
*/
@ApiOperation("新增商圈")
@PreAuthorize("@ss.hasPermi('cms:area:add')")
@Log(title = "商圈", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CommercialArea commercialArea)
{
return toAjax(commercialAreaService.insertCommercialArea(commercialArea));
}
/**
* 修改商圈
*/
@ApiOperation("修改商圈")
@PreAuthorize("@ss.hasPermi('cms:area:edit')")
@Log(title = "商圈", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CommercialArea commercialArea)
{
return toAjax(commercialAreaService.updateCommercialArea(commercialArea));
}
/**
* 删除商圈
*/
@ApiOperation("删除商圈")
@PreAuthorize("@ss.hasPermi('cms:area:remove')")
@Log(title = "商圈", businessType = BusinessType.DELETE)
@DeleteMapping("/{commercialAreaIds}")
public AjaxResult remove(@PathVariable Long[] commercialAreaIds)
{
return toAjax(commercialAreaService.deleteCommercialAreaByCommercialAreaIds(commercialAreaIds));
}
}

View File

@@ -0,0 +1,116 @@
package com.ruoyi.cms.controller.cms;
import java.sql.Array;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruoyi.cms.domain.CompanyCard;
import com.ruoyi.cms.service.ICompanyCardService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 公司卡片Controller
*
* @author ${author}
* @date 2025-02-18
*/
@RestController
@RequestMapping("/cms/card")
@Api(tags = "公司卡片")
public class CompanyCardController extends BaseController
{
@Autowired
private ICompanyCardService companyCardService;
/**
* 查询公司卡片列表
*/
@ApiOperation("查询公司卡片列表")
@PreAuthorize("@ss.hasPermi('system:card:list')")
@GetMapping("/list")
public TableDataInfo list(CompanyCard companyCard)
{
startPage();
List<CompanyCard> list = companyCardService.selectCompanyCardList(companyCard);
return getDataTable(list);
}
/**
* 导出公司卡片列表
*/
@ApiOperation("导出公司卡片列表")
@PreAuthorize("@ss.hasPermi('system:card:export')")
@Log(title = "公司卡片", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CompanyCard companyCard)
{
List<CompanyCard> list = companyCardService.selectCompanyCardList(companyCard);
ExcelUtil<CompanyCard> util = new ExcelUtil<CompanyCard>(CompanyCard.class);
util.exportExcel(response, list, "公司卡片数据");
}
/**
* 获取公司卡片详细信息
*/
@ApiOperation("获取公司卡片详细信息")
@PreAuthorize("@ss.hasPermi('system:card:query')")
@GetMapping(value = "/{companyCardId}")
public AjaxResult getInfo(@PathVariable("companyCardId") Long companyCardId)
{
return success(companyCardService.selectCompanyCardByCompanyCardId(companyCardId));
}
/**
* 新增公司卡片
*/
@ApiOperation("新增公司卡片")
@PreAuthorize("@ss.hasPermi('system:card:add')")
@Log(title = "公司卡片", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CompanyCard companyCard)
{
return toAjax(companyCardService.insertCompanyCard(companyCard));
}
/**
* 修改公司卡片
*/
@ApiOperation("修改公司卡片")
@PreAuthorize("@ss.hasPermi('system:card:edit')")
@Log(title = "公司卡片", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CompanyCard companyCard)
{
return toAjax(companyCardService.updateCompanyCard(companyCard));
}
/**
* 删除公司卡片
*/
@ApiOperation("删除公司卡片")
@PreAuthorize("@ss.hasPermi('system:card:remove')")
@Log(title = "公司卡片", businessType = BusinessType.DELETE)
@DeleteMapping("/{companyCardIds}")
public AjaxResult remove(@PathVariable Long[] companyCardIds)
{
return toAjax(companyCardService.deleteCompanyCardByCompanyCardIds(companyCardIds));
}
}

View File

@@ -0,0 +1,42 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.common.core.domain.entity.CompanyContact;
import com.ruoyi.cms.service.CompanyContactService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 公司联系人
*
* @author
* @email
* @date 2025-09-30 15:57:06
*/
@RestController
@RequestMapping("/cms/companycontact")
@Api(tags = "后台:公司联系人")
public class CompanyContactController extends BaseController {
@Autowired
private CompanyContactService companyContactService;
/**
* 列表
*/
@ApiOperation("公司联系人列表")
@PreAuthorize("@ss.hasPermi('cms:companycontact:list')")
@RequestMapping("/list")
public TableDataInfo list(CompanyContact companyContact){
List<CompanyContact> list=companyContactService.getSelectList(companyContact);
return getDataTable(list);
}
}

View File

@@ -0,0 +1,141 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.util.RoleUtils;
import com.ruoyi.common.core.domain.entity.Company;
import com.ruoyi.cms.service.ICompanyService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 公司Controller
*
* @author lishundong
* @date 2024-09-04
*/
@RestController
@RequestMapping("/cms/company")
@Api(tags = "后台:公司管理")
public class CompanyController extends BaseController
{
@Autowired
private ICompanyService companyService;
/**
* 查询公司列表
*/
@ApiOperation("查询公司列表")
// @PreAuthorize("@ss.hasPermi('cms:company:list')")
@GetMapping("/list")
public TableDataInfo list(Company company)
{
if (RoleUtils.isCompanyAdmin()) {
company.setCode(RoleUtils.getCurrentUseridCard());
}
startPage();
List<Company> list = companyService.selectCompanyList(company);
return getDataTable(list);
}
/**
* 导出公司列表
*/
@ApiOperation("导出公司列表")
// @PreAuthorize("@ss.hasPermi('app:company:export')")
@Log(title = "公司", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Company company)
{
List<Company> list = companyService.selectCompanyList(company);
ExcelUtil<Company> util = new ExcelUtil<Company>(Company.class);
util.exportExcel(response, list, "公司数据");
}
/**
* 获取公司详细信息
*/
@ApiOperation("获取公司详细信息")
// @PreAuthorize("@ss.hasPermi('app:company:query')")
@GetMapping(value = "/{companyId}")
public AjaxResult getInfo(@PathVariable("companyId") Long companyId)
{
return success(companyService.selectCompanyByCompanyId(companyId));
}
/**
* 新增公司
*/
@ApiOperation("新增公司")
// @PreAuthorize("@ss.hasPermi('app:company:add')")
@Log(title = "公司", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Company company)
{
return toAjax(companyService.insertCompany(company));
}
/**
* 修改公司
*/
@ApiOperation("修改公司")
// @PreAuthorize("@ss.hasPermi('app:company:edit')")
@Log(title = "公司", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Company company)
{
return toAjax(companyService.updateCompany(company));
}
/**
* 删除公司
*/
@ApiOperation("删除公司")
// @PreAuthorize("@ss.hasPermi('app:company:remove')")
@Log(title = "公司", businessType = BusinessType.DELETE)
@DeleteMapping("/{companyIds}")
public AjaxResult remove(@PathVariable Long[] companyIds)
{
return toAjax(companyService.deleteCompanyByCompanyIds(companyIds));
}
@ApiOperation("企业资质审核列表")
@PreAuthorize("@ss.hasPermi('app:company:approval:list')")
@GetMapping("/approval/list")
public TableDataInfo approvalList(Company company)
{
startPage();
List<Company> list = companyService.approvalList(company);
return getDataTable(list);
}
@ApiOperation("企业资质修改")
// @PreAuthorize("@ss.hasPermi('app:company:approval:edit')")
@GetMapping("/approval/edit")
public AjaxResult approvalEdit(Company company)
{
startPage();
List<Company> list = companyService.approvalList(company);
return AjaxResult.success();
}
@ApiOperation("查询公司列表")
// @PreAuthorize("@ss.hasPermi('cms:company:list')")
@GetMapping("/listPage")
public TableDataInfo listPage(Company company)
{
startPage();
List<Company> list = companyService.selectCompanyList(company);
return getDataTable(list);
}
}

View File

@@ -0,0 +1,71 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.EmployeeConfirm;
import com.ruoyi.cms.service.EmployeeConfirmService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 新入职员工确认信息
*
* @author
* @email
* @date 2025-10-10 10:42:16
*/
@RestController
@RequestMapping("/cms/employeeConfirm")
@Api(tags = "后台:新入职员工确认信息")
public class EmployeeConfirmController extends BaseController {
@Autowired
private EmployeeConfirmService employeeConfirmService;
/**
* 列表
*/
@ApiOperation("新入职员工确认信息列表")
// @PreAuthorize("@ss.hasPermi('cms:employeeConfirm:list')")
@RequestMapping("/list")
public TableDataInfo list(EmployeeConfirm employeeConfirm){
List<EmployeeConfirm> list=employeeConfirmService.getEmployeeConfirmList(employeeConfirm);
return getDataTable(list);
}
/**
* 保存
*/
@ApiOperation("新增新入职员工确认信息")
// @PreAuthorize("@ss.hasPermi('cms:employeeConfirm:add')")
@Log(title = "职员工确认信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EmployeeConfirm employeeConfirm){
return toAjax(employeeConfirmService.insertEmployeeConfirm(employeeConfirm));
}
@ApiOperation("修改新入职员工确认信息")
// @PreAuthorize("@ss.hasPermi('cms:employeeConfirm:edit')")
@Log(title = "职员工确认信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EmployeeConfirm employeeConfirm){
return toAjax(employeeConfirmService.updateEmployeeConfirm(employeeConfirm));
}
@ApiOperation("删除新入职员工确认信息")
// @PreAuthorize("@ss.hasPermi('app:employeeConfirm:remove')")
@Log(title = "公司", businessType = BusinessType.DELETE)
@DeleteMapping("/{employeeConfirmIds}")
public AjaxResult remove(@PathVariable Long[] employeeConfirmIds)
{
return toAjax(employeeConfirmService.deleteEmployeeConfirmIds(employeeConfirmIds));
}
}

View File

@@ -0,0 +1,134 @@
package com.ruoyi.cms.controller.cms;
import java.util.List;
import com.ruoyi.common.core.domain.entity.Industry;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruoyi.cms.service.IIndustryService;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletResponse;
/**
* 行业Controller
*
* @author LishunDong
* @date 2024-11-12
*/
@RestController
@RequestMapping("/cms/industry")
@Api(tags = "后台:行业管理")
public class IndustryController extends BaseController
{
@Autowired
private IIndustryService industryService;
/**
* 查询行业列表
*/
@ApiOperation("查询行业列表")
@PreAuthorize("@ss.hasPermi('cms:industry:list')")
@GetMapping("/list")
public TableDataInfo list(Industry industry)
{
startPage();
List<Industry> list = industryService.selectIndustryList(industry);
return getDataTable(list);
}
@ApiOperation("行业树结构")
@PreAuthorize("@ss.hasPermi('cms:industry:list')")
@GetMapping("/treeselect")
public AjaxResult treeselect(Industry industry)
{
List<Industry> industryList = industryService.selectIndustryList(industry);
return success(industryService.buildIndustryTreeSelect(industryList));
}
/**
* 导出行业列表
*/
@ApiOperation("导出行业列表")
@PreAuthorize("@ss.hasPermi('cms:industry:export')")
@Log(title = "行业", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Industry industry)
{
List<Industry> list = industryService.selectIndustryList(industry);
ExcelUtil<Industry> util = new ExcelUtil<Industry>(Industry.class);
util.exportExcel(response, list, "行业数据");
}
/**
* 获取行业详细信息
*/
@ApiOperation("获取行业详细信息")
@PreAuthorize("@ss.hasPermi('cms:industry:query')")
@GetMapping(value = "/{industryId}")
public AjaxResult getInfo(@PathVariable("industryId") Long industryId)
{
return success(industryService.selectIndustryByIndustryId(industryId));
}
/**
* 新增行业
*/
@ApiOperation("新增行业")
@PreAuthorize("@ss.hasPermi('cms:industry:add')")
@Log(title = "行业", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Industry industry)
{
return toAjax(industryService.insertIndustry(industry));
}
/**
* 修改行业
*/
@ApiOperation("修改行业")
@PreAuthorize("@ss.hasPermi('cms:industry:edit')")
@Log(title = "行业", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Industry industry)
{
return toAjax(industryService.updateIndustry(industry));
}
/**
* 删除行业
*/
@ApiOperation("删除行业")
@PreAuthorize("@ss.hasPermi('cms:industry:remove')")
@Log(title = "行业", businessType = BusinessType.DELETE)
@DeleteMapping("/{industryId}")
public AjaxResult remove(@PathVariable Long industryId)
{
if (industryService.hasChildByIndustryId(industryId))
{
return warn("存在子行业,不允许删除");
}
Long[] industryIds = {industryId};
return toAjax(industryService.deleteIndustryByIndustryIds(industryIds));
}
@GetMapping("/import")
public AjaxResult importData()
{
industryService.importData();
return success();
}
}

View File

@@ -0,0 +1,95 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.Job;
import com.ruoyi.cms.domain.JobApply;
import com.ruoyi.cms.domain.vo.CandidateVO;
import com.ruoyi.cms.service.IAppUserService;
import com.ruoyi.cms.service.IJobApplyService;
import com.ruoyi.cms.util.RoleUtils;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.common.core.domain.entity.Company;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
@RestController
@RequestMapping("/cms/jobApply")
@Api(tags = "后台:岗位申请")
public class JobApplyController extends BaseController {
@Autowired
IJobApplyService iJobApplyService;
@Autowired
private IAppUserService appUserService;
@GetMapping("/trendChart")
public AjaxResult trendChart(JobApply jobApply)
{
HashMap<String,Integer> result = iJobApplyService.trendChart(jobApply);
return success(result);
}
/**
* 导出APP用户列表
*/
@ApiOperation("导出岗位申请APP用户")
@PreAuthorize("@ss.hasPermi('cms:jobApply:export')")
@Log(title = "APP用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Job job)
{
List<CandidateVO> list = iJobApplyService.selectAppUserList(job);
ExcelUtil<CandidateVO> util = new ExcelUtil<CandidateVO>(CandidateVO.class);
util.exportExcel(response, list, "APP用户数据");
}
@ApiOperation("获取求职者列表")
@PreAuthorize("@ss.hasPermi('cms:jobApply:applyJobUserList')")
@GetMapping("/applyJobUserList")
public TableDataInfo applyJobList(AppUser appUser)
{
if (RoleUtils.isCompanyAdmin()) {
Company company=new Company();
company.setCode(RoleUtils.getCurrentUseridCard());
}
startPage();
List<CandidateVO> list = iJobApplyService.selectApplyJobUserList(appUser);
return getDataTable(list);
}
@PutMapping
@Log(title = "岗位", businessType = BusinessType.UPDATE)
@ApiOperation("用户申请岗位")
public AjaxResult apply(@RequestBody JobApply jobApply)
{
if(jobApply.getJobId()==null){
return AjaxResult.error("岗位id为空");
}
if(!SecurityUtils.isLogin()){
return AjaxResult.error("用户未登录!");
}
if(jobApply.getUserId()==null){
String idCard=RoleUtils.getCurrentUseridCard();
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
if(appUser==null){
return AjaxResult.error("用户信息未完善,请完善身份证信息!");
}else{
jobApply.setUserId(appUser.getUserId());
}
}
return success(iJobApplyService.applyComJob(jobApply));
}
}

View File

@@ -0,0 +1,43 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.JobContact;
import com.ruoyi.cms.service.JobContactService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 岗位联系人
*
* @author
* @email
* @date 2025-09-30 15:57:06
*/
@RestController
@RequestMapping("/cms/jobcontact")
@Api(tags = "后台:岗位联系人")
public class JobContactController extends BaseController {
@Autowired
private JobContactService jobContactService;
/**
* 列表
*/
@ApiOperation("岗位联系人列表")
@PreAuthorize("@ss.hasPermi('cms:jobcontact:list')")
@RequestMapping("/list")
public TableDataInfo list(JobContact jobContact){
startPage();
List<JobContact> list = jobContactService.getSelectList(jobContact);
return getDataTable(list);
}
}

View File

@@ -0,0 +1,110 @@
package com.ruoyi.cms.controller.cms;
import java.util.List;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruoyi.cms.domain.JobFair;
import com.ruoyi.cms.service.IJobFairService;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletResponse;
/**
* 招聘会信息Controller
*
* @author lishundong
* @date 2024-09-04
*/
@RestController
@RequestMapping("/cms/fair")
@Api(tags = "后台:招聘会信息")
public class JobFairController extends BaseController
{
@Autowired
private IJobFairService jobFairService;
/**
* 查询招聘会信息列表
*/
@ApiOperation("查询招聘会信息列表")
@PreAuthorize("@ss.hasPermi('app:fair:list')")
@GetMapping("/list")
public TableDataInfo list(JobFair jobFair)
{
startPage();
List<JobFair> list = jobFairService.selectJobFairList(jobFair);
return getDataTable(list);
}
/**
* 导出招聘会信息列表
*/
@ApiOperation("导出招聘会信息列表")
@PreAuthorize("@ss.hasPermi('app:fair:export')")
@Log(title = "招聘会信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, JobFair jobFair)
{
List<JobFair> list = jobFairService.selectJobFairList(jobFair);
ExcelUtil<JobFair> util = new ExcelUtil<JobFair>(JobFair.class);
util.exportExcel(response, list, "招聘会信息数据");
}
/**
* 获取招聘会信息详细信息
*/
@ApiOperation("获取招聘会信息详细信息")
@PreAuthorize("@ss.hasPermi('app:fair:query')")
@GetMapping(value = "/{jobFairId}")
public AjaxResult getInfo(@PathVariable("jobFairId") Long jobFairId)
{
return success(jobFairService.selectJobFairByJobFairId(jobFairId));
}
/**
* 新增招聘会信息
*/
@ApiOperation("新增招聘会信息")
@PreAuthorize("@ss.hasPermi('app:fair:add')")
@Log(title = "招聘会信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody JobFair jobFair)
{
return toAjax(jobFairService.insertJobFair(jobFair));
}
/**
* 修改招聘会信息
*/
@ApiOperation("修改招聘会信息")
@PreAuthorize("@ss.hasPermi('app:fair:edit')")
@Log(title = "招聘会信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody JobFair jobFair)
{
return toAjax(jobFairService.updateJobFair(jobFair));
}
/**
* 删除招聘会信息
*/
@ApiOperation("删除招聘会信息")
@PreAuthorize("@ss.hasPermi('app:fair:remove')")
@Log(title = "招聘会信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{jobFairIds}")
public AjaxResult remove(@PathVariable Long[] jobFairIds)
{
return toAjax(jobFairService.deleteJobFairByJobFairIds(jobFairIds));
}
}

View File

@@ -0,0 +1,142 @@
package com.ruoyi.cms.controller.cms;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.cms.domain.BussinessDictData;
import com.ruoyi.common.core.domain.entity.Industry;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruoyi.common.core.domain.entity.JobTitle;
import com.ruoyi.cms.service.IJobTitleService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 岗位Controller
*
* @author Lishundong
* @date 2024-11-12
*/
@RestController
@RequestMapping("/cms/job/titile")
@Api(tags = "后台:职位接口")
public class JobTitleController extends BaseController
{
@Autowired
private IJobTitleService jobTitleService;
/**
* 查询岗位列表
*/
@ApiOperation("查询岗位列表")
@PreAuthorize("@ss.hasPermi('cms:title:list')")
@GetMapping("/list")
public TableDataInfo list(JobTitle jobTitle)
{
startPage();
List<JobTitle> list = jobTitleService.selectJobTitleList(jobTitle);
return getDataTable(list);
}
/**
* 导出岗位列表
*/
@ApiOperation("导出岗位列表")
@PreAuthorize("@ss.hasPermi('cms:title:export')")
@Log(title = "岗位", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, JobTitle jobTitle)
{
List<JobTitle> list = jobTitleService.selectJobTitleList(jobTitle);
ExcelUtil<JobTitle> util = new ExcelUtil<JobTitle>(JobTitle.class);
util.exportExcel(response, list, "岗位数据");
}
/**
* 获取岗位详细信息
*/
@ApiOperation("获取岗位详细信息")
@PreAuthorize("@ss.hasPermi('cms:title:query')")
@GetMapping(value = "/{jobId}")
public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
{
return success(jobTitleService.selectJobTitleByJobId(jobId));
}
/**
* 新增岗位
*/
@ApiOperation("新增岗位")
@PreAuthorize("@ss.hasPermi('cms:title:add')")
@Log(title = "岗位", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody JobTitle jobTitle)
{
return toAjax(jobTitleService.insertJobTitle(jobTitle));
}
/**
* 修改岗位
*/
@ApiOperation("修改岗位")
@PreAuthorize("@ss.hasPermi('cms:title:edit')")
@Log(title = "岗位", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody JobTitle jobTitle)
{
return toAjax(jobTitleService.updateJobTitle(jobTitle));
}
/**
* 删除岗位
*/
@ApiOperation("删除岗位")
@PreAuthorize("@ss.hasPermi('cms:title:remove')")
@Log(title = "岗位", businessType = BusinessType.DELETE)
@DeleteMapping("/{jobId}")
public AjaxResult remove(@PathVariable Long jobId)
{
if (jobTitleService.hasChildByJobId(jobId))
{
return warn("存在子岗位,不允许删除");
}
Long[] jobIds = {jobId};
return toAjax(jobTitleService.deleteJobTitleByJobIds(jobIds));
}
@ApiOperation("行业树结构")
@GetMapping("/treeselect")
public AjaxResult treeselect(JobTitle jobTitle)
{
List<JobTitle> jobTitleList = jobTitleService.selectJobTitleList(jobTitle);
return success(jobTitleService.buildJobTitleTreeSelect(jobTitleList));
}
@GetMapping("/import")
public AjaxResult importJobTitle()
{
jobTitleService.importJobTitle();
return success();
}
@GetMapping("/levelOne")
public AjaxResult levelOne()
{
List<JobTitle> result = jobTitleService.levelOne();
return success(result);
}
}

View File

@@ -0,0 +1,171 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.SensitiveWordData;
import com.ruoyi.cms.service.SensitiveWordDataService;
import com.ruoyi.cms.util.EasyExcelUtils;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.List;
/**
* 敏感词库
*
* @author
* @email
* @date 2025-10-10 10:42:16
*/
@RestController
@RequestMapping("/cms/sensitiveworddata")
@Api(tags = "后台:敏感词库")
@Anonymous
public class SensitiveWordDataController extends BaseController {
@Autowired
private SensitiveWordDataService sensitiveWordDataService;
/**
* 列表
*/
@ApiOperation("敏感词库详细信息")
@GetMapping("/list")
public TableDataInfo list(SensitiveWordData sensitiveWordData){
startPage();
List<SensitiveWordData> list = sensitiveWordDataService.selectSensitiveworddataList(sensitiveWordData);
return getDataTable(list);
}
/**
* 获取详细信息
*/
@ApiOperation("获取敏感词库详细信息")
@GetMapping(value = "/{id}")
public AjaxResult list(@PathVariable("id") Long id){
return success(sensitiveWordDataService.selectById(id));
}
/**
* 保存
*/
@ApiOperation("新增敏感词")
@Log(title = "敏感词", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult save(@RequestBody SensitiveWordData sensitiveWordData){
return toAjax(sensitiveWordDataService.insertSensitiveworddata(sensitiveWordData));
}
/**
* 修改
*/
@ApiOperation("修改敏感词")
@Log(title = "敏感词", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SensitiveWordData sensitiveWordData){
return toAjax(sensitiveWordDataService.updateSensitiveworddata(sensitiveWordData));
}
/**
* 删除敏感词
*/
@ApiOperation("删除敏感词")
@Log(title = "敏感词", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
if(ids.length==0){
return AjaxResult.error("请传递参数!");
}
return toAjax(sensitiveWordDataService.deleteSensitiveworddataIds(ids));
}
/**
* 通用上传请求(单个)
*/
@PostMapping("/exoprt")
public AjaxResult uploadFile(@RequestParam("file") MultipartFile file) throws Exception
{
// 参数校验
if (file.isEmpty()) {
return AjaxResult.error("上传文件不能为空");
}
String fileName = file.getOriginalFilename();
//类型验证
if (fileName == null || !fileName.endsWith(".xlsx") && !fileName.endsWith(".xls")) {
return AjaxResult.error("请上传Excel格式的文件");
}
//名称验证
if (fileName == null || !"mgc.xlsx".equals(fileName)) {
return AjaxResult.error("请上传正确的模板文件mgc.xlsx");
}
try
{
InputStream inputStream = file.getInputStream();
EasyExcelUtils.readExcelByBatch(inputStream, SensitiveWordData.class, 100, list -> {
// 处理逻辑:如批量保存到数据库
sensitiveWordDataService.batchInsert(list);
});
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
return AjaxResult.success();
}
@PostMapping("/downloadModel")
public void downloadModel(HttpServletRequest request, HttpServletResponse response)throws Exception{
String name = "mgc.xlsx";
String pathFile="/data/downloadmodel/"+name;
File url = new File(pathFile);
String resMsg = "";
try {
request.setCharacterEncoding("utf-8");
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
try {
name = new String(name.getBytes("gb2312"), "ISO8859-1");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
response.reset();
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment; filename="+ name);
response.setHeader("Pragma", "public");
response.setHeader("Cache-Control", "max-age=0");
InputStream in = null;
try {
in = new FileInputStream(url);
} catch (FileNotFoundException e1) {
resMsg = "文件未找到";
e1.printStackTrace();
response.getWriter().write(resMsg + ":" + name);
}
OutputStream ou = response.getOutputStream();
byte[] buffer = new byte[1024];
int i = -1;
while ((i = in.read(buffer)) != -1) {
ou.write(buffer, 0, i);
}
ou.flush();
ou.close();
in.close();
}
}

View File

@@ -0,0 +1,103 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.domain.BussinessDictType;
import com.ruoyi.cms.domain.query.Staticsquery;
import com.ruoyi.cms.service.StaticsqueryService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/cms/statics")
public class StaticsController extends BaseController {
@Autowired
private StaticsqueryService service;
//分行业趋势分析
@GetMapping("/industry")
public AjaxResult industry(Staticsquery staticsquery)
{
Map<String,Object> result = service.industry(staticsquery);
return success(result);
}
//分行业趋势分析
@GetMapping("/industryGen")
public AjaxResult industryGen()
{
service.industryGen();
return success();
}
//分行业趋势分析
@GetMapping("/industryAreaGen")
public AjaxResult industryAreaGen()
{
service.areaGen();
return success();
}
//分行业趋势分析
@GetMapping("/salaryGen")
public AjaxResult salarysalaryGen()
{
service.salarysalaryGen();
return success();
}
@GetMapping("/salary")
public AjaxResult salary(Staticsquery staticsquery)
{
Map<String,Object> result = service.salary(staticsquery);
return success(result);
}
@GetMapping("/industryArea")
public AjaxResult industryArea(Staticsquery staticsquery)
{
Map<String,Object> result = service.industryArea(staticsquery);
return success(result);
}
//分行业趋势分析
@GetMapping("/workYearGen")
public AjaxResult workYearGen()
{
service.workYearGen();
return success();
}
@GetMapping("/workYear")
public AjaxResult workYear(Staticsquery staticsquery)
{
Map<String,Object> result = service.workYear(staticsquery);
return success(result);
}
//分行业趋势分析
@GetMapping("/educationGen")
public AjaxResult educationGen()
{
service.educationGen();
return success();
}
@GetMapping("/education")
public AjaxResult education(Staticsquery staticsquery)
{
Map<String,Object> result = service.education(staticsquery);
return success(result);
}
//分学历-分薪资
@GetMapping("/educationSalaryGen")
public AjaxResult educationSalaryGen()
{
service.educationSalaryGen();
return success();
}
@GetMapping("/educationSalary")
public AjaxResult educationSalary(Staticsquery staticsquery)
{
Map<String,Object> result = service.educationSalary(staticsquery);
return success(result);
}
}

View File

@@ -0,0 +1,100 @@
package com.ruoyi.cms.controller.cms;
import java.util.List;
import com.ruoyi.common.annotation.BussinessLog;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruoyi.cms.domain.SubwayLine;
import com.ruoyi.cms.service.ISubwayLineService;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 地铁线路Controller
*
* @author Lishundong
* @date 2024-11-12
*/
@RestController
@RequestMapping("/cms/line")
@Api(tags = "后台:地铁线路")
public class SubwayLineController extends BaseController
{
@Autowired
private ISubwayLineService subwayLineService;
/**
* 查询地铁线路列表
*/
@ApiOperation("查询地铁线路列表")
@GetMapping("/list")
@BussinessLog(title = "查询地铁线路列表", businessType = BusinessType.CLEAN)
public TableDataInfo list(SubwayLine subwayLine)
{
startPage();
List<SubwayLine> list = subwayLineService.selectSubwayLineList(subwayLine);
return getDataTable(list);
}
/**
* 获取地铁线路详细信息
*/
@ApiOperation("获取地铁线路详细信息")
@PreAuthorize("@ss.hasPermi('system:line:query')")
@GetMapping(value = "/{lineId}")
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
{
return success(subwayLineService.selectSubwayLineByLineId(lineId));
}
/**
* 新增地铁线路
*/
@ApiOperation("新增地铁线路")
@PreAuthorize("@ss.hasPermi('system:line:add')")
@Log(title = "地铁线路", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SubwayLine subwayLine)
{
return toAjax(subwayLineService.insertSubwayLine(subwayLine));
}
/**
* 修改地铁线路
*/
@ApiOperation("修改地铁线路")
@PreAuthorize("@ss.hasPermi('system:line:edit')")
@Log(title = "地铁线路", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SubwayLine subwayLine)
{
return toAjax(subwayLineService.updateSubwayLine(subwayLine));
}
/**
* 删除地铁线路
*/
@ApiOperation("删除地铁线路")
@PreAuthorize("@ss.hasPermi('system:line:remove')")
@Log(title = "地铁线路", businessType = BusinessType.DELETE)
@DeleteMapping("/{lineId}")
public AjaxResult remove(@PathVariable Long lineId)
{
return toAjax(subwayLineService.deleteSubwayLineByLineIds(lineId));
}
}

View File

@@ -0,0 +1,103 @@
package com.ruoyi.cms.controller.cms;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruoyi.cms.domain.SubwayStation;
import com.ruoyi.cms.service.ISubwayStationService;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 地铁站点Controller
*
* @author Lishundong
* @date 2024-11-12
*/
@RestController
@RequestMapping("/cms/station")
@Api(tags = "后台:地铁站点")
public class SubwayStationController extends BaseController
{
@Autowired
private ISubwayStationService subwayStationService;
/**
* 查询地铁站点列表
*/
@ApiOperation("查询地铁站点列表")
@GetMapping("/list")
public TableDataInfo list(SubwayStation subwayStation)
{
startPage();
List<SubwayStation> list = subwayStationService.selectSubwayStationList(subwayStation);
return getDataTable(list);
}
/**
* 获取地铁站点详细信息
*/
@ApiOperation("获取地铁站点详细信息")
@PreAuthorize("@ss.hasPermi('system:station:query')")
@GetMapping(value = "/{stationId}")
public AjaxResult getInfo(@PathVariable("stationId") Long stationId)
{
return success(subwayStationService.selectSubwayStationByStationId(stationId));
}
/**
* 新增地铁站点
*/
@ApiOperation("新增地铁站点")
@PreAuthorize("@ss.hasPermi('system:station:add')")
@Log(title = "地铁站点", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SubwayStation subwayStation)
{
return toAjax(subwayStationService.insertSubwayStation(subwayStation));
}
/**
* 修改地铁站点
*/
@ApiOperation("修改地铁站点")
@PreAuthorize("@ss.hasPermi('system:station:edit')")
@Log(title = "地铁站点", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SubwayStation subwayStation)
{
return toAjax(subwayStationService.updateSubwayStation(subwayStation));
}
/**
* 删除地铁站点
*/
@ApiOperation("删除地铁站点")
@PreAuthorize("@ss.hasPermi('system:station:remove')")
@Log(title = "地铁站点", businessType = BusinessType.DELETE)
@DeleteMapping("/{stationIds}")
public AjaxResult remove(@PathVariable Long[] stationIds)
{
return toAjax(subwayStationService.deleteSubwayStationByStationIds(stationIds));
}
@GetMapping("/import")
public AjaxResult importStation(){
subwayStationService.importStation();
return success();
}
}

View File

@@ -0,0 +1,108 @@
package com.ruoyi.cms.controller.cms;
import com.ruoyi.cms.service.IAppUserService;
import com.ruoyi.cms.util.RoleUtils;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.common.core.domain.entity.UserWorkExperiences;
import com.ruoyi.cms.service.UserWorkExperiencesService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户工作经历表
*
* @author
* @email
* @date 2025-10-10 16:26:26
*/
@RestController
@RequestMapping("/cms/userworkexperiences")
@Api(tags = "后台:用户工作经历")
public class UserWorkExperiencesController extends BaseController {
@Autowired
private UserWorkExperiencesService userWorkExperiencesService;
@Autowired
private IAppUserService appUserService;
/**
* 列表
*/
@ApiOperation("工作经历列表信息")
@PreAuthorize("@ss.hasPermi('cms:userworkexperiences:list')")
@GetMapping("/list")
public TableDataInfo list(UserWorkExperiences userWorkExperiences){
startPage();
List<UserWorkExperiences> list=userWorkExperiencesService.getWorkExperiencesList(userWorkExperiences);
return getDataTable(list);
}
/**
* 信息
*/
/**
* 获取详细信息
*/
@ApiOperation("获取工作经历详细信息")
@PreAuthorize("@ss.hasPermi('cms:userworkexperiences:query')")
@GetMapping(value = "/{id}")
public AjaxResult query(@PathVariable("id") Long id){
return success(userWorkExperiencesService.getWorkExperiencesById(id));
}
/**
* 保存
*/
@ApiOperation("新增工作经历")
@Log(title = "工作经历", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody UserWorkExperiences userWorkExperiences){
if(userWorkExperiences.getUserId()==null){
AppUser appUser=appUserService.selectAppuserByIdcard(RoleUtils.getCurrentUseridCard());
if(appUser==null){
return AjaxResult.error("未传递userId!");
}
userWorkExperiences.setUserId(appUser.getUserId());
}
return toAjax(userWorkExperiencesService.insertWorkExperiences(userWorkExperiences));
}
/**
* 修改
*/
@ApiOperation("修改工作经历")
@Log(title = "工作经历", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult update(@RequestBody UserWorkExperiences userWorkExperiences){
if (userWorkExperiences.getId()==null){
return AjaxResult.error("参数id未传递!");
}
return toAjax(userWorkExperiencesService.updateWorkExperiencesById(userWorkExperiences));
}
/**
* 删除
*/
@ApiOperation("删除工作经历")
@Log(title = "工作经历", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids){
if(ids.length==0){
return AjaxResult.error("参数ids未传递!");
}
return toAjax(userWorkExperiencesService.deleteWorkExperiencesIds(ids));
}
}

View File

@@ -0,0 +1,29 @@
package com.ruoyi.cms.cron;
import com.ruoyi.cms.mapper.JobMapper;
import com.ruoyi.cms.service.IBussinessOperLogService;
import com.ruoyi.cms.service.ICompanyService;
import com.ruoyi.cms.service.IESJobSearchService;
import com.ruoyi.cms.service.IJobService;
import com.ruoyi.common.utils.spring.SpringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
public class JobCron {
public void isHot(){
SpringUtils.getBean(JobMapper.class).isHot();
}
public void resetEs(){
SpringUtils.getBean(IESJobSearchService.class).resetTextCache();
}
//查看索引是否存在,如果不存在,就更新
public void checkEsAndFix(){
SpringUtils.getBean(IESJobSearchService.class).checkEsAndFix();
}
//更新公司的招聘数量
public void updateJobCountOfCompany(){
SpringUtils.getBean(ICompanyService.class).updateJobCountOfCompany();
}
}

View File

@@ -0,0 +1,42 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
@Data
@ApiModel("APP通知")
@TableName(value = "app_notice")
public class AppNotice extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(value = "notice_id",type = IdType.AUTO)
@ApiModelProperty("公司id")
private Long noticeId;
@Xss(message = "消息标题不能包含脚本字符")
@NotBlank(message = "消息标题不能为空")
@Size(min = 0, max = 50, message = "消息标题不能超过50个字符")
private String noticeTitle;
@ApiModelProperty("消息类型")
private String noticeType;
@ApiModelProperty("消息内容")
private String noticeContent;
@ApiModelProperty("消息状态 0正常 1关闭")
private String status;
}

View File

@@ -0,0 +1,39 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 用户岗位浏览记录对象 app_review_job
* @author ${author}
* @date 2025-02-14
*/
@Data
@ApiModel("用户岗位浏览记录")
@TableName(value = "app_review_job")
public class AppReviewJob extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(value = "id",type = IdType.AUTO)
private Long id;
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("岗位id")
private Long jobId;
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "浏览日期", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("浏览日期")
private String reviewDate;
}

View File

@@ -0,0 +1,69 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
@Data
@ApiModel("业务数据表")
@TableName(value = "bussiness_dict_data")
public class BussinessDictData extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@ApiModelProperty("字典编码")
@Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
@TableId(value = "dict_code",type = IdType.AUTO)
private Long dictCode;
@ApiModelProperty("字典排序")
@Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
private Long dictSort;
@Excel(name = "字典标签")
@ApiModelProperty("字典标签")
@NotBlank(message = "字典标签不能为空")
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
private String dictLabel;
@Excel(name = "字典键值")
@ApiModelProperty("字典键值")
@NotBlank(message = "字典键值不能为空")
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
private String dictValue;
@ApiModelProperty("字典类型")
@Excel(name = "字典类型")
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
private String dictType;
@ApiModelProperty("样式属性(其他样式扩展)")
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
private String cssClass;
@ApiModelProperty("表格字典样式")
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
private String listClass;
@ApiModelProperty("是否默认Y是 N否")
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
private String isDefault;
@ApiModelProperty("状态 0=正常,1=停用 ")
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
}

View File

@@ -0,0 +1,43 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
@Data
@ApiModel("字典类型表")
@TableName(value = "bussiness_dict_type")
public class BussinessDictType extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 字典主键 */
@Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
private Long dictId;
/** 字典名称 */
@Excel(name = "字典名称")
@NotBlank(message = "字典名称不能为空")
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
private String dictName;
/** 字典类型 */
@Excel(name = "字典类型")
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
private String dictType;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
}

View File

@@ -0,0 +1,98 @@
package com.ruoyi.cms.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* app操作日志记录对象 bussiness_oper_log
* @author ${author}
* @date 2024-11-13
*/
@Data
@ApiModel("app操作日志记录")
@TableName(value = "bussiness_oper_log")
public class BussinessOperLog extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(value = "oper_id",type = IdType.AUTO)
@ApiModelProperty("日志主键")
private Long operId;
@Excel(name = "模块标题")
@ApiModelProperty("模块标题")
private String title;
@Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除")
@ApiModelProperty("业务类型0其它 1新增 2修改 3删除")
private Integer businessType;
@Excel(name = "方法名称")
@ApiModelProperty("方法名称")
private String method;
@Excel(name = "请求方式")
@ApiModelProperty("请求方式")
private String requestMethod;
@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
@ApiModelProperty("操作类别0其它 1后台用户 2手机端用户")
private Integer operatorType;
@Excel(name = "操作人员")
@ApiModelProperty("操作人员")
private String operName;
@Excel(name = "部门名称")
@ApiModelProperty("部门名称")
private String deptName;
@Excel(name = "请求URL")
@ApiModelProperty("请求URL")
private String operUrl;
@Excel(name = "主机地址")
@ApiModelProperty("主机地址")
private String operIp;
@Excel(name = "操作地点")
@ApiModelProperty("操作地点")
private String operLocation;
@Excel(name = "请求参数")
@ApiModelProperty("请求参数")
private String operParam;
@Excel(name = "返回参数")
@ApiModelProperty("返回参数")
private String jsonResult;
@Excel(name = "操作状态", readConverterExp = "0=正常,1=异常")
@ApiModelProperty("操作状态0正常 1异常")
private Integer status;
@Excel(name = "错误消息")
@ApiModelProperty("错误消息")
private String errorMsg;
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("操作时间")
private Date operTime;
@Excel(name = "消耗时间")
@ApiModelProperty("消耗时间")
private Long costTime;
@ApiModelProperty("业务类型数组")
private Integer[] businessTypes;
}

View File

@@ -0,0 +1,46 @@
package com.ruoyi.cms.domain;
import java.math.BigDecimal;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 商圈对象 commercial_area
* @author Lishundong
* @date 2024-11-12
*/
@Data
@ApiModel("商圈")
@TableName(value = "commercial_area")
public class CommercialArea extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(value = "commercial_area_id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long commercialAreaId;
@Excel(name = "商圈名称")
@ApiModelProperty("商圈名称")
private String commercialAreaName;
@Excel(name = "纬度")
@ApiModelProperty("纬度")
private BigDecimal latitude;
@Excel(name = "经度")
@ApiModelProperty("经度")
private BigDecimal longitude;
@Excel(name = "地址")
@ApiModelProperty("地址")
private String address;
}

View File

@@ -0,0 +1,54 @@
package com.ruoyi.cms.domain;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 公司卡片对象 company_card
* @author ${author}
* @date 2025-02-18
*/
@Data
@ApiModel("公司卡片")
@TableName(value = "company_card")
public class CompanyCard extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(value = "company_card_id",type = IdType.AUTO)
@ApiModelProperty("公司卡片id")
private Long companyCardId;
@Excel(name = "卡片名称")
@ApiModelProperty("卡片名称")
private String name;
@Excel(name = "标签,逗号分开")
@ApiModelProperty("标签,逗号分开")
private String targ;
@Excel(name = "企业性质")
@ApiModelProperty("企业性质,逗号分开")
private String companyNature;
@Excel(name = "背景色")
@ApiModelProperty("背景色")
private String backgroudColor;
@ApiModelProperty("状态 0未发布 1发布")
private Integer status;
@ApiModelProperty("排序")
private Integer cardOrder;
@ApiModelProperty("描述")
private String description;
}

View File

@@ -0,0 +1,37 @@
package com.ruoyi.cms.domain;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 公司卡片收藏对象 company_card_collection
* @author ${author}
* @date 2025-02-18
*/
@Data
@ApiModel("公司卡片收藏")
@TableName(value = "company_card_collection")
public class CompanyCardCollection extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(value = "company_card_collection_id",type = IdType.AUTO)
@ApiModelProperty("公司id")
private Long companyCardCollectionId;
@Excel(name = "用户id")
@ApiModelProperty("用户id")
private Long userId;
@Excel(name = "公司卡片id")
@ApiModelProperty("公司卡片id")
private Long companyCardId;
}

View File

@@ -0,0 +1,37 @@
package com.ruoyi.cms.domain;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 用户公司收藏对象 company_collection
* @author lishundong
* @date 2024-09-04
*/
@Data
@ApiModel("用户公司收藏")
@TableName(value = "company_collection")
public class CompanyCollection extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
@Excel(name = "公司id")
@ApiModelProperty("公司id")
private Long companyId;
@Excel(name = "App用户id")
@ApiModelProperty("App用户id")
private Long userId;
}

View File

@@ -0,0 +1,35 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 公司标签对象 company_label
* @author ${author}
* @date 2025-02-18
*/
@Data
@ApiModel("公司标签")
@TableName(value = "company_label")
public class CompanyLabel extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(value = "id",type = IdType.AUTO)
private Long id;
@ApiModelProperty("公司标签")
private String dictValue;
@ApiModelProperty("公司id")
private Long companyId;
}

View File

@@ -0,0 +1,156 @@
package com.ruoyi.cms.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.core.domain.entity.Company;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.IdType;
import java.math.BigDecimal;
import java.util.Date;
/**
* 全文索引 ES数据模型
**/
@IndexName("job_document")
@Data
public class ESJobDocument
{
@ApiModelProperty("es中的唯一id")
@IndexId(type = IdType.NONE)
@JsonIgnore
private String id;
@ApiModelProperty("岗位id")
private Long jobId;
@ApiModelProperty("公告标题")
@IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
private String jobTitle;
@ApiModelProperty("内容")
@IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
private String description;
@ApiModelProperty("最小薪资(元)")
private Long minSalary;
@ApiModelProperty("最大薪资(元)")
private Long maxSalary;
@ApiModelProperty("学历要求 对应字典education")
private String education;
@ApiModelProperty("工作经验要求 对应字典experience")
private String experience;
@ApiModelProperty("用人单位名称")
private String companyName;
@ApiModelProperty("工作地点")
private String jobLocation;
@ApiModelProperty("工作地点区县字典代码")
private Integer jobLocationAreaCode;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("发布时间")
private Date postingDate;
@ApiModelProperty("招聘人数")
private Long vacancies;
@ApiModelProperty("纬度")
private BigDecimal latitude;
@ApiModelProperty("经度")
private BigDecimal longitude;
@ApiModelProperty("浏览量")
private Long view;
@ApiModelProperty("公司id")
private Long companyId;
@ApiModelProperty("是否火")
private Integer isHot;
@ApiModelProperty("申请次数")
private Integer applyNum;
@JsonIgnore
@ApiModelProperty("公司")
private Company company;
@ApiModelProperty("是否申请 0为否 1为是")
private Integer isApply;
@ApiModelProperty("是否收藏 0为否 1为是")
private Integer isCollection;
@ApiModelProperty("数据来源")
private String dataSource;
@ApiModelProperty("岗位链接")
private String jobUrl;
@JsonIgnore
@IndexField(fieldType = FieldType.GEO_POINT)
@ApiModelProperty("经纬度")
private String latAndLon;
@JsonIgnore
@ApiModelProperty("公司规模")
private String scaleDictCode;
@ApiModelProperty("行业分类")
private String industry;
@ApiModelProperty("岗位分类")
private String jobCategory;
@JsonIgnore
@ApiModelProperty("学历要求 对应字典education int类型 es方便查询")
private Integer education_int;
@JsonIgnore
@ApiModelProperty("工作经验要求 对应字典experience int类型 es方便查询")
private Integer experience_int;
@ApiModelProperty("公司规模 int类型 es方便查询")
private Integer scale;
@ApiModelProperty("岗位链接 APP内")
private String appJobUrl;
@ApiModelProperty("公司性质")
private String companyNature;
@ApiModelProperty("是否有视频介绍")
private Integer isExplain;
@ApiModelProperty("视频介绍URL")
private String explainUrl;
@ApiModelProperty("视频封面URL")
private String cover;
@ApiModelProperty("岗位类型 0疆内 1疆外")
private String jobType;
@ApiModelProperty("类型 0常规岗位 1就业见习岗位 2实习实训岗位 3社区实践岗位 对应字段字典position_type")
private String type;
@ApiModelProperty("信用代码")
private String code;
@ApiModelProperty("公司信息")
@IndexField(fieldType = FieldType.TEXT)
private String companyVoJson;
}

View File

@@ -0,0 +1,74 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 新入职员工确认信息
*
* @author
* @email
* @date 2025-10-10 10:42:16
*/
@Data
@TableName("employee_confirm")
public class EmployeeConfirm extends BaseEntity {
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
/**
* 企业id
*/
@ApiModelProperty("企业id")
private Long companyId;
/**
* 姓名
*/
@ApiModelProperty("姓名")
private String contactPerson;
/**
* 身份证
*/
@ApiModelProperty("身份证")
private String idCard;
/**
* 入职日期
*/
@ApiModelProperty("入职日期")
private String entryDate;
/**
* 联系电话
*/
@ApiModelProperty("联系电话")
private String contactPersonPhone;
/**
* 劳动合同期限
*/
@ApiModelProperty("劳动合同期限")
private String contractTerm;
@ApiModelProperty("工作id")
private Long jobId;
@ApiModelProperty("移动端用户id")
private Long userId;
/**
* 申请id
*/
@TableField(exist = false)
private Long applyId;
}

View File

@@ -0,0 +1,38 @@
package com.ruoyi.cms.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 用户岗位收藏对象 job_collection
* @author lishundong
* @date 2024-09-03
*/
@Data
@ApiModel("用户和招聘会收藏")
@TableName(value = "fair_collection")
public class FairCollection extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
@Excel(name = "招聘会id")
@ApiModelProperty("招聘会id")
private Long fairId;
@Excel(name = "App用户id")
@ApiModelProperty("App用户id")
private Long userId;
}

View File

@@ -0,0 +1,37 @@
package com.ruoyi.cms.domain;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 公司招聘会关联对象 fair_company
* @author lishundong
* @date 2024-09-04
*/
@Data
@ApiModel("公司招聘会关联")
@TableName(value = "fair_company")
public class FairCompany extends BaseEntity
{
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty("id")
private Long id;
@Excel(name = "公司id")
@ApiModelProperty("公司id")
private Long companyId;
@Excel(name = "招聘会id")
@ApiModelProperty("招聘会id")
private Long jobFairId;
}

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