| | |
| | | <?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.6</version> |
| | | 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> |
| | | |
| | | <name>ruoyi</name> |
| | | <url>http://www.ruoyi.vip</url> |
| | | <description>若依管理系统</description> |
| | | |
| | | <properties> |
| | | <ruoyi.version>3.8.6</ruoyi.version> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <java.version>1.8</java.version> |
| | | <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> |
| | | <druid.version>1.2.16</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.6</pagehelper.boot.version> |
| | | <fastjson.version>2.0.39</fastjson.version> |
| | | <oshi.version>6.4.4</oshi.version> |
| | | <commons.io.version>2.13.0</commons.io.version> |
| | | <commons.collections.version>3.2.2</commons.collections.version> |
| | | <poi.version>4.1.2</poi.version> |
| | | <velocity.version>2.3</velocity.version> |
| | | <jwt.version>0.9.1</jwt.version> |
| | | <hutool.version>5.7.17</hutool.version> |
| | | </properties> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi</artifactId> |
| | | <version>3.8.6</version> |
| | | |
| | | <!-- 依赖声明 --> |
| | | <dependencyManagement> |
| | | <dependencies> |
| | | <name>ruoyi</name> |
| | | <url>http://www.ruoyi.vip</url> |
| | | <description>若依管理系统</description> |
| | | |
| | | <!-- SpringBoot的依赖配置--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-dependencies</artifactId> |
| | | <version>2.5.15</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | <properties> |
| | | <ruoyi.version>3.8.6</ruoyi.version> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <java.version>1.8</java.version> |
| | | <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> |
| | | <druid.version>1.2.16</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.6</pagehelper.boot.version> |
| | | <fastjson.version>2.0.39</fastjson.version> |
| | | <oshi.version>6.4.4</oshi.version> |
| | | <commons.io.version>2.13.0</commons.io.version> |
| | | <commons.collections.version>3.2.2</commons.collections.version> |
| | | <poi.version>4.1.2</poi.version> |
| | | <velocity.version>2.3</velocity.version> |
| | | <jwt.version>0.9.1</jwt.version> |
| | | <hutool.version>5.7.17</hutool.version> |
| | | </properties> |
| | | |
| | | <!-- 阿里数据库连接池 --> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | <version>${druid.version}</version> |
| | | </dependency> |
| | | <!-- 依赖声明 --> |
| | | <dependencyManagement> |
| | | <dependencies> |
| | | |
| | | <!-- 解析客户端操作系统、浏览器等 --> |
| | | <dependency> |
| | | <groupId>eu.bitwalker</groupId> |
| | | <artifactId>UserAgentUtils</artifactId> |
| | | <version>${bitwalker.version}</version> |
| | | </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> |
| | | |
| | | <!-- pagehelper 分页插件 --> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.pagehelper</groupId>--> |
| | | <!-- <artifactId>pagehelper-spring-boot-starter</artifactId>--> |
| | | <!-- <version>${pagehelper.boot.version}</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- 阿里数据库连接池 --> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | <version>${druid.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 获取系统信息 --> |
| | | <dependency> |
| | | <groupId>com.github.oshi</groupId> |
| | | <artifactId>oshi-core</artifactId> |
| | | <version>${oshi.version}</version> |
| | | </dependency> |
| | | <!-- 解析客户端操作系统、浏览器等 --> |
| | | <dependency> |
| | | <groupId>eu.bitwalker</groupId> |
| | | <artifactId>UserAgentUtils</artifactId> |
| | | <version>${bitwalker.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> |
| | | <!-- pagehelper 分页插件 --> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.pagehelper</groupId>--> |
| | | <!-- <artifactId>pagehelper-spring-boot-starter</artifactId>--> |
| | | <!-- <version>${pagehelper.boot.version}</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- excel工具 --> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.apache.poi</groupId>--> |
| | | <!-- <artifactId>poi-ooxml</artifactId>--> |
| | | <!-- <version>${poi.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>--> |
| | | |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.apache.poi</groupId>--> |
| | | <!-- <artifactId>poi</artifactId>--> |
| | | <!-- <version>${poi.version}</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.apache.poi</groupId>--> |
| | | <!-- <artifactId>poi</artifactId>--> |
| | | <!-- <version>${poi.version}</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.apache.poi</groupId>--> |
| | | <!-- <artifactId>poi-ooxml-schemas</artifactId>--> |
| | | <!-- <version>${poi.version}</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.apache.poi</groupId>--> |
| | | <!-- <artifactId>poi-ooxml-schemas</artifactId>--> |
| | | <!-- <version>${poi.version}</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- velocity代码生成使用模板 --> |
| | | <dependency> |
| | | <groupId>org.apache.velocity</groupId> |
| | | <artifactId>velocity-engine-core</artifactId> |
| | | <version>${velocity.version}</version> |
| | | </dependency> |
| | | <!-- velocity代码生成使用模板 --> |
| | | <dependency> |
| | | <groupId>org.apache.velocity</groupId> |
| | | <artifactId>velocity-engine-core</artifactId> |
| | | <version>${velocity.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- collections工具类 --> |
| | | <dependency> |
| | | <groupId>commons-collections</groupId> |
| | | <artifactId>commons-collections</artifactId> |
| | | <version>${commons.collections.version}</version> |
| | | </dependency> |
| | | <!-- collections工具类 --> |
| | | <dependency> |
| | | <groupId>commons-collections</groupId> |
| | | <artifactId>commons-collections</artifactId> |
| | | <version>${commons.collections.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 阿里JSON解析器 --> |
| | | <dependency> |
| | | <groupId>com.alibaba.fastjson2</groupId> |
| | | <artifactId>fastjson2</artifactId> |
| | | <version>${fastjson.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> |
| | | <!-- 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> |
| | | <!-- 验证码 --> |
| | | <dependency> |
| | | <groupId>pro.fessional</groupId> |
| | | <artifactId>kaptcha</artifactId> |
| | | <version>${kaptcha.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 定时任务--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-quartz</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | <!-- 定时任务--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-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-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-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-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-common</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!--hutool工具包--> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>${hutool.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | <!--hutool工具包--> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>${hutool.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-admin-dept</module> |
| | | <module>code-generator</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | <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-admin-dept</module> |
| | | <module>code-generator</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <version>3.1</version> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | <encoding>${project.build.sourceEncoding}</encoding> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <version>3.1</version> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | <encoding>${project.build.sourceEncoding}</encoding> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | <repositories> |
| | | <repository> |
| | | <id>public</id> |
| | | <name>aliyun nexus</name> |
| | | <url>https://maven.aliyun.com/repository/public</url> |
| | | <releases> |
| | | <enabled>true</enabled> |
| | | </releases> |
| | | </repository> |
| | | </repositories> |
| | | <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> |
| | | |
| | | <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> |
| | | <profiles> |
| | | <profile> |
| | | <id>dev</id> |
| | | <properties> |
| | | <!-- 环境标识,需要与配置文件的名称相对应 --> |
| | | <profiles.active>dev</profiles.active> |
| | | <logging.level>debug</logging.level> |
| | | </properties> |
| | | <activation> |
| | | <!-- 默认环境 --> |
| | | <activeByDefault>true</activeByDefault> |
| | | </activation> |
| | | </profile> |
| | | <profile> |
| | | <id>prod</id> |
| | | <properties> |
| | | <profiles.active>prod</profiles.active> |
| | | <logging.level>warn</logging.level> |
| | | </properties> |
| | | </profile> |
| | | </profiles> |
| | | </project> |
| | |
| | | /* |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | */ |
| | | /** |
| | | * 角色信息 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | * <p> |
| | | * 根据角色编号获取详细信息 |
| | | * <p> |
| | | * 新增角色 |
| | | * <p> |
| | | * 修改保存角色 |
| | | * <p> |
| | | * 修改保存数据权限 |
| | | * <p> |
| | | * 状态修改 |
| | | * <p> |
| | | * 删除角色 |
| | | * <p> |
| | | * 获取角色选择框列表 |
| | | * <p> |
| | | * 查询已分配用户角色列表 |
| | | * <p> |
| | | * 查询未分配用户角色列表 |
| | | * <p> |
| | | * 取消授权用户 |
| | | * <p> |
| | | * 批量取消授权用户 |
| | | * <p> |
| | | * 批量选择用户授权 |
| | | * <p> |
| | | * 获取对应角色部门树列表 |
| | | *//* |
| | | |
| | | @Api(tags = "角色信息") |
| | | @RestController |
| | | @RequestMapping("/system/role") |
| | |
| | | // util.exportExcel(response, list, "角色数据"); |
| | | // } |
| | | |
| | | /** |
| | | * 根据角色编号获取详细信息 |
| | | */ |
| | | */ |
| | | /** |
| | | * 根据角色编号获取详细信息 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/{roleId}") |
| | | public AjaxResult getInfo(@PathVariable Long roleId) |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增角色 |
| | | */ |
| | | */ |
| | | /** |
| | | * 新增角色 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:add')") |
| | | @ApiOperation(value = "新增角色") |
| | | @Log(title = "角色信息-新增角色", businessType = BusinessType.INSERT) |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 修改保存角色 |
| | | */ |
| | | */ |
| | | /** |
| | | * 修改保存角色 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @ApiOperation(value = "编辑角色") |
| | | @Log(title = "角色信息-编辑角色", businessType = BusinessType.UPDATE) |
| | |
| | | return error("修改角色'" + dto.getRoleName() + "'失败,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存数据权限 |
| | | */ |
| | | */ |
| | | /** |
| | | * 修改保存数据权限 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/dataScope") |
| | |
| | | return AjaxResult.success(roleService.authDataScope(role)); |
| | | } |
| | | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | */ |
| | | /** |
| | | * 状态修改 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @ApiOperation(value = "状态修改") |
| | | @Log(title = "角色信息-角色状态修改", businessType = BusinessType.UPDATE) |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 删除角色 |
| | | */ |
| | | */ |
| | | /** |
| | | * 删除角色 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:remove')") |
| | | @ApiOperation(value = "删除角色") |
| | | @Log(title = "角色信息-角色删除角色", businessType = BusinessType.DELETE) |
| | |
| | | return AjaxResult.success(roleService.deleteRoleByIds(id)); |
| | | } |
| | | |
| | | /** |
| | | * 获取角色选择框列表 |
| | | */ |
| | | */ |
| | | /** |
| | | * 获取角色选择框列表 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | |
| | | return AjaxResult.success(roleService.selectRoleAll()); |
| | | } |
| | | |
| | | /** |
| | | * 查询已分配用户角色列表 |
| | | */ |
| | | */ |
| | | /** |
| | | * 查询已分配用户角色列表 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) |
| | |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询未分配用户角色列表 |
| | | */ |
| | | */ |
| | | /** |
| | | * 查询未分配用户角色列表 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) |
| | |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 取消授权用户 |
| | | */ |
| | | */ |
| | | /** |
| | | * 取消授权用户 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancel") |
| | |
| | | return AjaxResult.success(roleService.deleteAuthUser(userRole)); |
| | | } |
| | | |
| | | /** |
| | | * 批量取消授权用户 |
| | | */ |
| | | */ |
| | | /** |
| | | * 批量取消授权用户 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancelAll") |
| | |
| | | return AjaxResult.success(roleService.deleteAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | /** |
| | | * 批量选择用户授权 |
| | | */ |
| | | */ |
| | | /** |
| | | * 批量选择用户授权 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/selectAll") |
| | |
| | | return AjaxResult.success(roleService.insertAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | /** |
| | | * 获取对应角色部门树列表 |
| | | */ |
| | | */ |
| | | /** |
| | | * 获取对应角色部门树列表 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId) |
| | |
| | | return ajax; |
| | | } |
| | | } |
| | | */ |
| | |
| | | /* |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | */ |
| | | /** |
| | | * 用户信息 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | * <p> |
| | | * 获取用户列表 |
| | | * <p> |
| | | * 获取用户黑名单列表 |
| | | * <p> |
| | | * 人员借用列表 |
| | | * <p> |
| | | * 获取用户详情 |
| | | * <p> |
| | | * 获取用户数量统计 |
| | | * <p> |
| | | * 移除黑名单 |
| | | * <p> |
| | | * 新增用户 |
| | | * <p> |
| | | * 修改用户 |
| | | * <p> |
| | | * 删除用户 |
| | | * <p> |
| | | * 重置密码 |
| | | * <p> |
| | | * 状态修改 |
| | | * <p> |
| | | * 根据用户编号获取授权角色 |
| | | * <p> |
| | | * 用户授权角色 |
| | | * <p> |
| | | * 获取部门树列表 |
| | | *//* |
| | | |
| | | @Api(tags = "用户信息") |
| | | @RestController |
| | | @RequestMapping("/system/user") |
| | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | | */ |
| | | /** |
| | | * 获取用户列表 |
| | | *//* |
| | | |
| | | @ApiOperation(value = "获取用户列表") |
| | | @PostMapping("/list") |
| | | public AjaxResult list(@RequestBody SysUserQuery query) |
| | |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户黑名单列表 |
| | | */ |
| | | */ |
| | | /** |
| | | * 获取用户黑名单列表 |
| | | *//* |
| | | |
| | | // @ApiOperation(value = "获取用户黑名单列表") |
| | | // @PostMapping("/blacklist") |
| | | // public AjaxResult blacklist(@RequestBody SysUserQuery query) |
| | |
| | | // return AjaxResult.success(getDataTable(list)); |
| | | // } |
| | | |
| | | /** |
| | | * 人员借用列表 |
| | | */ |
| | | */ |
| | | /** |
| | | * 人员借用列表 |
| | | *//* |
| | | |
| | | // @ApiOperation(value = "人员借用列表") |
| | | // @GetMapping("/userBorrowList") |
| | | // public AjaxResult userBorrowList(@RequestParam(required = false) String name, |
| | |
| | | // return AjaxResult.success(userAddListVO); |
| | | // } |
| | | |
| | | /** |
| | | * 获取用户详情 |
| | | */ |
| | | */ |
| | | /** |
| | | * 获取用户详情 |
| | | *//* |
| | | |
| | | @ApiOperation(value = "获取用户详情") |
| | | @GetMapping("/getDetail") |
| | | public AjaxResult getDetail(@RequestParam Long userId) |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户数量统计 |
| | | */ |
| | | */ |
| | | /** |
| | | * 获取用户数量统计 |
| | | *//* |
| | | |
| | | @ApiOperation(value = "获取用户数量统计") |
| | | @PostMapping("/getUserCount") |
| | | public AjaxResult getUserCount() |
| | |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | /** |
| | | * 移除黑名单 |
| | | */ |
| | | */ |
| | | /** |
| | | * 移除黑名单 |
| | | *//* |
| | | |
| | | @GetMapping("/removeBlackList") |
| | | public AjaxResult removeBlackList(@RequestParam String ids) |
| | | { |
| | |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 新增用户 |
| | | */ |
| | | */ |
| | | /** |
| | | * 新增用户 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:user:add')") |
| | | @ApiOperation(value = "新增用户管理") |
| | | @Log(title = "用户信息-新增用户", businessType = BusinessType.INSERT) |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | */ |
| | | /** |
| | | * 修改用户 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @ApiOperation(value = "修改用户管理") |
| | | @Log(title = "用户信息-修改用户", businessType = BusinessType.UPDATE) |
| | |
| | | return AjaxResult.success(userService.updateUser(user)); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户 |
| | | */ |
| | | */ |
| | | /** |
| | | * 删除用户 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:user:remove')") |
| | | @ApiOperation(value = "批量删除用户") |
| | | @Log(title = "用户信息-批量删除用户", businessType = BusinessType.DELETE) |
| | |
| | | return AjaxResult.success(userService.deleteUserByIds(userIds)); |
| | | } |
| | | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | */ |
| | | /** |
| | | * 重置密码 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | @ApiOperation(value = "重置密码") |
| | | @Log(title = "用户信息-重置密码", businessType = BusinessType.UPDATE) |
| | |
| | | return AjaxResult.success(userService.resetPwd(user)); |
| | | } |
| | | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | */ |
| | | /** |
| | | * 状态修改 |
| | | *//* |
| | | |
| | | @ApiOperation(value = "状态修改") |
| | | @Log(title = "用户信息-状态修改", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | |
| | | return AjaxResult.success(userService.updateUserStatus(user)); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户编号获取授权角色 |
| | | */ |
| | | */ |
| | | /** |
| | | * 根据用户编号获取授权角色 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping("/authRole/{userId}") |
| | | public AjaxResult authRole(@PathVariable("userId") Long userId) |
| | |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 用户授权角色 |
| | | */ |
| | | */ |
| | | /** |
| | | * 用户授权角色 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "用户管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authRole") |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取部门树列表 |
| | | */ |
| | | */ |
| | | /** |
| | | * 获取部门树列表 |
| | | *//* |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/deptTree") |
| | | public AjaxResult deptTree(SysDept dept) |
| | |
| | | return AjaxResult.success(deptService.selectDeptTreeList(dept)); |
| | | } |
| | | } |
| | | */ |
| | |
| | | # 数据源配置 |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://192.168.110.188:3306/financialdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | # url: jdbc:mysql://8.137.10.192:3306/sys_config?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 |
| | | # username: root |
| | | # password: shms#123~ |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # 初始连接数 |
| | | initialSize: 5 |
| | | # 最小连接池数量 |
| | | minIdle: 10 |
| | | # 最大连接池数量 |
| | | maxActive: 20 |
| | | # 配置获取连接等待超时的时间 |
| | | maxWait: 60000 |
| | | # 配置连接超时时间 |
| | | connectTimeout: 30000 |
| | | # 配置网络超时时间 |
| | | socketTimeout: 60000 |
| | | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # 配置一个连接在池中最小生存的时间,单位是毫秒 |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # 配置一个连接在池中最大生存的时间,单位是毫秒 |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # 配置检测连接是否有效 |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | 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 |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://localhost:3306/financialdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | # url: jdbc:mysql://8.137.10.192:3306/sys_config?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 |
| | | # username: root |
| | | # password: shms#123~ |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # 初始连接数 |
| | | initialSize: 5 |
| | | # 最小连接池数量 |
| | | minIdle: 10 |
| | | # 最大连接池数量 |
| | | maxActive: 20 |
| | | # 配置获取连接等待超时的时间 |
| | | maxWait: 60000 |
| | | # 配置连接超时时间 |
| | | connectTimeout: 30000 |
| | | # 配置网络超时时间 |
| | | socketTimeout: 60000 |
| | | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # 配置一个连接在池中最小生存的时间,单位是毫秒 |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # 配置一个连接在池中最大生存的时间,单位是毫秒 |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # 配置检测连接是否有效 |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | 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 |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param dto 基础数据分类传输对象 |
| | | * @return R<Void> |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto 基础数据分类更新传输对象 |
| | | * @return R<Void> |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id id |
| | | * @return R<Void> |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除") |
| | | public R<Void> delete(@RequestParam(value = "id") Integer id){ |
| | | public R<Void> delete(@RequestParam(value = "id") Long id) { |
| | | try { |
| | | tbBasicDataCategoryService.removeById(id); |
| | | } catch (Exception e) { |
| | |
| | | |
| | | /** |
| | | * 根据id获取详情 |
| | | * |
| | | * @param id id |
| | | * @return R<BasicDataCategoryVO> |
| | | */ |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("根据id获取详情") |
| | | public R<BasicDataCategoryVO> getDetails(@RequestParam(value = "id") Integer id){ |
| | | public R<BasicDataCategoryVO> getDetails(@RequestParam(value = "id") Long id) { |
| | | try { |
| | | TbBasicDataCategory basicDataCategory = tbBasicDataCategoryService.getById(id); |
| | | BasicDataCategoryVO vo = BeanUtils.copyBean(basicDataCategory, BasicDataCategoryVO.class); |
| | | BasicDataCategoryVO vo = BeanUtils.copyBean(basicDataCategory, |
| | | BasicDataCategoryVO.class); |
| | | return R.ok(vo); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | |
| | | |
| | | /** |
| | | * 隐藏显示操作 |
| | | * |
| | | * @param dto 显示隐藏操作数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页条件查询 |
| | | * |
| | | * @param query 基础数据分类条件查询对象 |
| | | * @return R<PageDTO<BasicDataCategoryVO>> |
| | | * @return R<PageDTO < BasicDataCategoryVO>> |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<BasicDataCategoryVO>> page(@Validated @RequestBody BasicDataCategoryQuery query) { |
| | | public R<PageDTO<BasicDataCategoryVO>> page( |
| | | @Validated @RequestBody BasicDataCategoryQuery query) { |
| | | try { |
| | | return R.ok(tbBasicDataCategoryService.queryPage(query)); |
| | | } catch (Exception e) { |
| | |
| | | import com.ruoyi.system.dto.ShowHideDTO; |
| | | import com.ruoyi.system.dto.update.BasicDataConfigUpdateDTO; |
| | | import com.ruoyi.system.query.BasicDataConfigQuery; |
| | | import com.ruoyi.system.query.FieldQuery; |
| | | import com.ruoyi.system.service.TbBasicDataCategoryService; |
| | | import com.ruoyi.system.service.TbBasicDataConfigService; |
| | | import com.ruoyi.system.service.TbFieldService; |
| | | import com.ruoyi.system.vo.BasicDataCategoryVO; |
| | | import com.ruoyi.system.vo.BasicDataConfigDetailVO; |
| | | import com.ruoyi.system.vo.BasicDataConfigVO; |
| | | import com.ruoyi.system.vo.FieldVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | private final TbBasicDataConfigService tbBasicDataConfigService; |
| | | private final TbBasicDataCategoryService tbBasicDataCategoryService; |
| | | private final TbFieldService tbFieldService; |
| | | |
| | | /** |
| | | * 获取分类列表 |
| | | * @return R<List<BasicDataCategoryVO>> |
| | | * |
| | | * @return R<List < BasicDataCategoryVO>> |
| | | */ |
| | | @GetMapping("/categories") |
| | | @ApiOperation(value = "获取分类列表") |
| | | public R<List<BasicDataCategoryVO>> queryBasicDataCategories() { |
| | | try { |
| | | List<TbBasicDataCategory> list = tbBasicDataCategoryService.lambdaQuery().eq(TbBasicDataCategory::getStatus, ShowStatusEnum.SHOW).list(); |
| | | List<TbBasicDataCategory> list = tbBasicDataCategoryService.lambdaQuery() |
| | | .eq(TbBasicDataCategory::getStatus, ShowStatusEnum.SHOW).list(); |
| | | return R.ok(BeanUtils.copyList(list, BasicDataCategoryVO.class)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 分页条件查询字段 |
| | | * |
| | | * @param query 字段条件查询对象 |
| | | * @return R<PageDTO < FieldVO>> |
| | | */ |
| | | @PostMapping("/page-fields") |
| | | @ApiOperation(value = "分页条件查询字段", notes = "基础数据配置、大屏数据配置") |
| | | public R<PageDTO<FieldVO>> page(@Validated @RequestBody FieldQuery query) { |
| | | try { |
| | | return R.ok(tbFieldService.queryShowPage(query)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 分页条件查询字段 |
| | | * |
| | | * @param query 字段条件查询对象 |
| | | * @return R<PageDTO < FieldVO>> |
| | | */ |
| | | @GetMapping("/list-fields") |
| | | @ApiOperation(value = "查询状态为展示中字段列表", notes = "基础数据配置、大屏数据配置") |
| | | public R<List<FieldVO>> listFields() { |
| | | try { |
| | | return R.ok(tbFieldService.listFields()); |
| | | } catch (Exception e) { |
| | | log.error("查询状态为展示中字段列表异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param dto 基础数据配置数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto 基础数据配置数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * |
| | | * @param id id |
| | | * @return R<BasicDataConfigDetailVO> |
| | | */ |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("获取详情") |
| | | public R<BasicDataConfigDetailVO> getDetails(Integer id) { |
| | | public R<BasicDataConfigDetailVO> getDetails(Long id) { |
| | | try { |
| | | BasicDataConfigDetailVO details = tbBasicDataConfigService.getDetails(id); |
| | | return R.ok(details); |
| | |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id id |
| | | * @return R<Void> |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除") |
| | | public R<Void> delete(Integer id) { |
| | | public R<Void> delete(Long id) { |
| | | try { |
| | | tbBasicDataConfigService.delete(id); |
| | | } catch (Exception e) { |
| | |
| | | |
| | | /** |
| | | * 隐藏显示操作 |
| | | * |
| | | * @param dto 显示隐藏操作数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页条件查询 |
| | | * |
| | | * @param query 基础数据条件查询对象 |
| | | * @return R<PageDTO<BasicDataConfigVO>> |
| | | * @return R<PageDTO < BasicDataConfigVO>> |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<BasicDataConfigVO>> page(@Validated @RequestBody BasicDataConfigQuery query) { |
| | | try { |
| | | PageDTO<BasicDataConfigVO> basicDataConfigVOPageDTO = tbBasicDataConfigService.queryPage(query); |
| | | PageDTO<BasicDataConfigVO> basicDataConfigVOPageDTO = tbBasicDataConfigService.queryPage( |
| | | query); |
| | | return R.ok(basicDataConfigVOPageDTO); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑字段") |
| | | public R<Void> add(@RequestBody @Validated FieldUpdateDTO dto) { |
| | | public R<Void> editField(@RequestBody @Validated FieldUpdateDTO dto) { |
| | | try { |
| | | tbFieldService.update(dto); |
| | | tbFieldService.editField(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.system.dto.SysRoleDTO; |
| | | import com.ruoyi.system.query.SysRoleQuery; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import com.ruoyi.system.vo.RoleInfoVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | 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.BeanUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.dto.SysRoleDTO; |
| | | import com.ruoyi.system.query.SysRoleQuery; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.vo.RoleInfoVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 角色信息 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(tags = "角色信息") |
| | | @RestController |
| | | @RequestMapping("/system/role") |
| | | public class SysRoleController extends BaseController |
| | | { |
| | | public class SysRoleController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @ApiOperation(value = "角色列表") |
| | | @PostMapping("/list") |
| | | public AjaxResult list(@RequestBody SysRoleQuery query) |
| | | { |
| | | PageInfo<SysRole> list = roleService.selectList(query); |
| | | return AjaxResult.success(list); |
| | | public R<PageDTO<RoleInfoVO>> list(@RequestBody SysRoleQuery query) { |
| | | PageDTO<RoleInfoVO> sysRolePageDTO = roleService.selectList(query); |
| | | return R.ok(sysRolePageDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "角色列表不分页") |
| | | @PostMapping("/listNotPage") |
| | | public AjaxResult list() |
| | | { |
| | | public R<List<RoleInfoVO>> list() { |
| | | List<SysRole> list = roleService.selectRoleList(new SysRole()); |
| | | return AjaxResult.success(list); |
| | | List<RoleInfoVO> vos = BeanUtils.copyList(list, RoleInfoVO.class); |
| | | return R.ok(vos); |
| | | } |
| | | |
| | | @ApiOperation(value = "角色数量统计") |
| | | // @ApiOperation(value = "角色数量统计") |
| | | @PostMapping("/roleCount") |
| | | public AjaxResult roleCount() |
| | | { |
| | | public AjaxResult roleCount() { |
| | | int all = roleService.selectCount(null); |
| | | int normal = roleService.selectCount(0); |
| | | int stop = roleService.selectCount(1); |
| | | |
| | | Map<String,Integer> map = new HashMap<>(); |
| | | map.put("all",all); |
| | | map.put("normal",normal); |
| | | map.put("stop",stop); |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | map.put("all", all); |
| | | map.put("normal", normal); |
| | | map.put("stop", stop); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/{roleId}") |
| | | public AjaxResult getInfo(@PathVariable Long roleId) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable Long roleId) { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return AjaxResult.success(roleService.selectRoleById(roleId)); |
| | | } |
| | |
| | | |
| | | @ApiOperation("角色详情") |
| | | @GetMapping("/roleInfo") |
| | | public AjaxResult roleInfo(@RequestParam Long roleId) |
| | | { |
| | | public R<RoleInfoVO> roleInfo(@RequestParam Long roleId) { |
| | | SysRole role = roleService.selectRoleById(roleId); |
| | | RoleInfoVO roleInfoVo = new RoleInfoVO(); |
| | | roleInfoVo.setRoleId(role.getRoleId()); |
| | |
| | | |
| | | // 获取当前角色的菜单列表 |
| | | List<SysMenu> menus = menuService.selectListByRoleId(roleId); |
| | | if(menus.size()==0){ |
| | | return AjaxResult.success(new ArrayList<>()); |
| | | if (menus.size() == 0) { |
| | | return R.ok(roleInfoVo); |
| | | } |
| | | List<Long> menusId = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList()); |
| | | |
| | |
| | | List<SysMenu> levelMenus = roleService.getMenuLevelList(menusId); |
| | | |
| | | roleInfoVo.setMenus(menusId); |
| | | return AjaxResult.success(roleInfoVo); |
| | | return R.ok(roleInfoVo); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("用户获取权限菜单") |
| | | @GetMapping("/roleInfoFromUserId") |
| | | public AjaxResult roleInfoFromUserId(@RequestParam Long userId) |
| | | { |
| | | public AjaxResult roleInfoFromUserId(@RequestParam Long userId) { |
| | | return AjaxResult.success(roleService.roleInfoFromUserId(userId)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "新增角色") |
| | | @Log(title = "角色信息-新增角色", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@Validated @RequestBody SysRoleDTO dto) |
| | | { |
| | | Boolean flag= roleService.isExit(dto.getRoleId(),dto.getRoleName()); |
| | | if(flag){ |
| | | public AjaxResult add(@Validated @RequestBody SysRoleDTO dto) { |
| | | Boolean flag = roleService.isExit(dto.getRoleId(), dto.getRoleName()); |
| | | if (flag) { |
| | | return error("新增角色'" + dto.getRoleName() + "'失败,角色名称已存在"); |
| | | } |
| | | roleService.saveRole(dto); |
| | |
| | | @ApiOperation(value = "编辑角色") |
| | | @Log(title = "角色信息-编辑角色", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysRoleDTO dto) |
| | | { |
| | | Boolean flag= roleService.isExit(dto.getRoleId(),dto.getRoleName()); |
| | | if (flag){ |
| | | public AjaxResult edit(@Validated @RequestBody SysRoleDTO dto) { |
| | | Boolean flag = roleService.isExit(dto.getRoleId(), dto.getRoleName()); |
| | | if (flag) { |
| | | return error("修改角色'" + dto.getRoleName() + "'失败,角色名称已存在"); |
| | | } |
| | | if (roleService.editRole(dto) > 0) |
| | | { |
| | | if (roleService.editRole(dto) > 0) { |
| | | // 更新缓存用户权限 |
| | | LoginUser loginUser = getLoginUser(); |
| | | if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) |
| | | { |
| | | if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) { |
| | | loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); |
| | | loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName())); |
| | | loginUser.setUser( |
| | | userService.selectUserByUserName(loginUser.getUser().getUserName())); |
| | | tokenService.setLoginUser(loginUser); |
| | | } |
| | | return AjaxResult.success(); |
| | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/dataScope") |
| | | public AjaxResult dataScope(@RequestBody SysRole role) |
| | | { |
| | | public AjaxResult dataScope(@RequestBody SysRole role) { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | return AjaxResult.success(roleService.authDataScope(role)); |
| | |
| | | * 状态修改 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @ApiOperation(value = "状态修改") |
| | | // @ApiOperation(value = "状态修改") |
| | | @Log(title = "角色信息-角色状态修改", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysRole role) |
| | | { |
| | | public AjaxResult changeStatus(@RequestBody SysRole role) { |
| | | role.setUpdateBy(getUsername()); |
| | | roleService.updateStatus(role); |
| | | return AjaxResult.success(); |
| | |
| | | @ApiOperation(value = "删除角色") |
| | | @Log(title = "角色信息-角色删除角色", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/deleteById/{ids}") |
| | | public AjaxResult remove(@PathVariable String ids) |
| | | { |
| | | public AjaxResult remove(@PathVariable String ids) { |
| | | String[] split = ids.split(","); |
| | | List<Long> id = new ArrayList<>(); |
| | | for (String s : split) { |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | public AjaxResult optionselect() { |
| | | return AjaxResult.success(roleService.selectRoleAll()); |
| | | } |
| | | |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) |
| | | { |
| | | 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) |
| | | { |
| | | 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) |
| | | { |
| | | public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) { |
| | | return AjaxResult.success(roleService.deleteAuthUser(userRole)); |
| | | } |
| | | |
| | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancelAll") |
| | | public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) { |
| | | return AjaxResult.success(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) |
| | | { |
| | | public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return AjaxResult.success(roleService.insertAuthUsers(roleId, userIds)); |
| | | } |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long 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())); |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.dto.SysUserDTO; |
| | | import com.ruoyi.system.dto.SysUserUpdateStatusDTO; |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | | import com.ruoyi.system.query.SysUserQuery; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | |
| | | import com.ruoyi.system.vo.SysUserVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 用户信息 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(tags = "用户信息") |
| | | @RestController |
| | | @RequestMapping("/system/user") |
| | | public class SysUserController extends BaseController |
| | | { |
| | | public class SysUserController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private SysUserRoleMapper userRoleMapper; |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | | @ApiOperation(value = "获取用户列表") |
| | | @PostMapping("/list") |
| | | public AjaxResult list(@RequestBody SysUserQuery query) |
| | | { |
| | | public AjaxResult list(@RequestBody SysUserQuery query) { |
| | | PageInfo<SysUserVO> list = userService.pageList(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取用户列表-不分页") |
| | | @PostMapping("/listNotPage") |
| | | public AjaxResult listNotPage() |
| | | { |
| | | public AjaxResult listNotPage() { |
| | | List<SysUser> list = userService.queryList(); |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "获取用户详情") |
| | | @GetMapping("/getDetail") |
| | | public AjaxResult getDetail(@RequestParam Long userId) |
| | | { |
| | | public AjaxResult getDetail(@RequestParam Long userId) { |
| | | SysUser sysUser = userService.selectUserById(userId); |
| | | SysUserVO sysUserVO = new SysUserVO(); |
| | | BeanUtils.copyProperties(sysUser,sysUserVO); |
| | | BeanUtils.copyProperties(sysUser, sysUserVO); |
| | | |
| | | return AjaxResult.success(sysUser); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "获取用户数量统计") |
| | | @PostMapping("/getUserCount") |
| | | public AjaxResult getUserCount() |
| | | { |
| | | Map<String,Integer> map = new HashMap<>(); |
| | | public AjaxResult getUserCount() { |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | |
| | | Integer userCountSum = userService.selectCount(null); |
| | | Integer normalCount = userService.selectCount(0);// 正常 |
| | | Integer stopCount = userService.selectCount(1);// 停用 |
| | | |
| | | map.put("all",userCountSum); |
| | | map.put("normal",normalCount); |
| | | map.put("stop",stopCount); |
| | | map.put("all", userCountSum); |
| | | map.put("normal", normalCount); |
| | | map.put("stop", stopCount); |
| | | |
| | | return AjaxResult.success(map); |
| | | } |
| | |
| | | * 移除黑名单 |
| | | */ |
| | | @GetMapping("/removeBlackList") |
| | | public AjaxResult removeBlackList(@RequestParam String ids) |
| | | { |
| | | public AjaxResult removeBlackList(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | List<Long> id = new ArrayList<>(); |
| | | for (String s : split) { |
| | |
| | | userService.updateUserIfBlack(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | // @Log(title = "用户管理", businessType = BusinessType.EXPORT) |
| | | //// // @PreAuthorize("@ss.hasPermi('system:user:export')") |
| | |
| | | @ApiOperation(value = "新增用户管理") |
| | | @Log(title = "用户信息-新增用户", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@Validated @RequestBody SysUser user) |
| | | { |
| | | user.setUserName(user.getPhoneNumber()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@Validated @RequestBody SysUserDTO dto) { |
| | | SysUser user = com.ruoyi.common.utils.BeanUtils.copyBean(dto, SysUser.class); |
| | | if (!userService.checkUserNameUnique(user)) { |
| | | return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getPhoneNumber()) && !userService.checkPhoneUnique(user)) |
| | | { |
| | | } else if (StringUtils.isNotEmpty(user.getPhoneNumber()) && !userService.checkPhoneUnique( |
| | | user)) { |
| | | return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | userService.insertUser(user); |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setUserId(user.getUserId()); |
| | | sysUserRole.setRoleId(dto.getRoleId()); |
| | | userRoleMapper.insertUserRole(sysUserRole); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "修改用户管理") |
| | | @Log(title = "用户信息-修改用户", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@Validated @RequestBody SysUser user) |
| | | { |
| | | public AjaxResult edit(@Validated @RequestBody SysUser user) { |
| | | user.setUserName(user.getPhoneNumber()); |
| | | // userService.checkUserAllowed(user); |
| | | // userService.checkUserDataScope(user.getUserId()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | if (!userService.checkUserNameUnique(user)) { |
| | | return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getPhoneNumber()) && !userService.checkPhoneUnique(user)) |
| | | { |
| | | } else if (StringUtils.isNotEmpty(user.getPhoneNumber()) && !userService.checkPhoneUnique( |
| | | user)) { |
| | | return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "批量删除用户") |
| | | @Log(title = "用户信息-批量删除用户", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/deleteById/{ids}") |
| | | public AjaxResult remove(@PathVariable String ids) |
| | | { |
| | | public AjaxResult remove(@PathVariable String ids) { |
| | | String[] split = ids.split(","); |
| | | List<Long> userIds = new ArrayList<>(); |
| | | for (String s : split) { |
| | | userIds.add(Long.valueOf(s)); |
| | | } |
| | | if (userIds.contains(getUserId())) |
| | | { |
| | | if (userIds.contains(getUserId())) { |
| | | return error("当前用户不能删除"); |
| | | } |
| | | return AjaxResult.success(userService.deleteUserByIds(userIds)); |
| | |
| | | @ApiOperation(value = "重置密码") |
| | | @Log(title = "用户信息-重置密码", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/resetPwd") |
| | | public AjaxResult resetPwd(@RequestBody SysUser user) |
| | | { |
| | | public AjaxResult resetPwd(@RequestBody SysUser user) { |
| | | userService.checkUserAllowed(user); |
| | | // userService.checkUserDataScope(user.getUserId()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | |
| | | @ApiOperation(value = "状态修改") |
| | | @Log(title = "用户信息-状态修改", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysUserUpdateStatusDTO dto) |
| | | { |
| | | public AjaxResult changeStatus(@RequestBody SysUserUpdateStatusDTO dto) { |
| | | SysUser user = new SysUser(); |
| | | user.setUserId(dto.getUserId()); |
| | | user.setStatus(String.valueOf(dto.getStatus())); |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping("/authRole/{userId}") |
| | | public AjaxResult authRole(@PathVariable("userId") Long 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())); |
| | | 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) |
| | | { |
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) { |
| | | userService.checkUserDataScope(userId); |
| | | userService.insertUserAuth(userId, roleIds); |
| | | return AjaxResult.success(); |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/deptTree") |
| | | public AjaxResult deptTree(SysDept dept) |
| | | { |
| | | public AjaxResult deptTree(SysDept dept) { |
| | | return AjaxResult.success(deptService.selectDeptTreeList(dept)); |
| | | } |
| | | } |
New file |
| | |
| | | # 项目相关配置 |
| | | ruoyi: |
| | | # 名称 |
| | | name: mitao |
| | | # 版本 |
| | | version: 3.8.6 |
| | | # 版权年份 |
| | | copyrightYear: 2023 |
| | | # 实例演示开关 |
| | | demoEnabled: true |
| | | # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) |
| | | profile: D:/ruoyi/uploadPath |
| | | # 获取ip地址开关 |
| | | addressEnabled: true |
| | | # 验证码类型 math 数字计算 char 字符验证 |
| | | captchaType: math |
| | | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8083 |
| | | 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: |
| | | main: |
| | | allow-bean-definition-overriding: true |
| | | # 资源信息 |
| | | messages: |
| | | # 国际化资源文件路径 |
| | | basename: i18n/messages |
| | | config: |
| | | activate: |
| | | on-profile: |
| | | - dev |
| | | # 文件上传 |
| | | servlet: |
| | | multipart: |
| | | # 单个文件大小 |
| | | max-file-size: 500MB |
| | | # 设置总上传的文件大小 |
| | | max-request-size: 2000MB |
| | | # 服务模块 |
| | | devtools: |
| | | restart: |
| | | # 热部署开关 |
| | | enabled: true |
| | | # redis 配置 |
| | | redis: |
| | | # 地址 |
| | | host: 127.0.0.1 |
| | | # 端口,默认为6379 |
| | | port: 6379 |
| | | # 数据库索引 |
| | | database: 0 |
| | | # 密码 |
| | | password: 123456 |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # 连接池中的最小空闲连接 |
| | | min-idle: 0 |
| | | # 连接池中的最大空闲连接 |
| | | max-idle: 8 |
| | | # 连接池的最大数据库连接数 |
| | | max-active: 8 |
| | | # #连接池最大阻塞等待时间(使用负值表示没有限制) |
| | | max-wait: -1ms |
| | | jackson: |
| | | default-property-inclusion: non_null |
| | | deserialization: |
| | | read-unknown-enum-values-as-null: true |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://192.168.110.188:3306/financialdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | # url: jdbc:mysql://8.137.10.192:3306/sys_config?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 |
| | | # username: root |
| | | # password: shms#123~ |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # 初始连接数 |
| | | initialSize: 5 |
| | | # 最小连接池数量 |
| | | minIdle: 10 |
| | | # 最大连接池数量 |
| | | maxActive: 20 |
| | | # 配置获取连接等待超时的时间 |
| | | maxWait: 60000 |
| | | # 配置连接超时时间 |
| | | connectTimeout: 30000 |
| | | # 配置网络超时时间 |
| | | socketTimeout: 60000 |
| | | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # 配置一个连接在池中最小生存的时间,单位是毫秒 |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # 配置一个连接在池中最大生存的时间,单位是毫秒 |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # 配置检测连接是否有效 |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | 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 |
| | | # token配置 |
| | | token: |
| | | # 令牌自定义标识 |
| | | header: Authorization |
| | | # 令牌密钥 |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # 令牌有效期(默认30分钟) |
| | | expireTime: 120 |
| | | |
| | | # MyBatis配置 |
| | | #mybatis: |
| | | # # 搜索指定包别名 |
| | | # typeAliasesPackage: com.ruoyi.**.domain |
| | | # # 配置mapper的扫描,找到所有的mapper.xml映射文件 |
| | | # mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # # 加载全局的配置文件 |
| | | # configLocation: classpath:mybatis/mybatis-config.xml |
| | | |
| | | # PageHelper分页插件 |
| | | #pagehelper: |
| | | # helperDialect: mysql |
| | | # supportMethodsArguments: true |
| | | # params: count=countSql |
| | | |
| | | mybatis-plus: |
| | | # 此处在多数据源中生效 |
| | | # config-location: classpath:/mybatis-config.xml |
| | | configuration: |
| | | map-underscore-to-camel-case: true |
| | | default-enum-type-handler: org.apache.ibatis.type.EnumOrdinalTypeHandler |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | cache-enabled: true |
| | | local-cache-scope: statement |
| | | global-config: |
| | | banner: false |
| | | db-config: |
| | | logic-not-delete-value: 0 |
| | | logic-delete-value: 1 |
| | | logic-delete-field: del_flag |
| | | type-aliases-package: com.ruoyi.**.domain,com.ruoyi.**.vo |
| | | # 指定Mapper文件位置 |
| | | mapper-locations: classpath*:mapper/**/*.xml |
| | | # Swagger配置 |
| | | swagger: |
| | | # 是否开启swagger |
| | | enabled: true |
| | | # 请求前缀 |
| | | pathMapping: / |
| | | |
| | | # 防止XSS攻击 |
| | | xss: |
| | | # 过滤开关 |
| | | enabled: true |
| | | # 排除链接(多个用逗号分隔) |
| | | excludes: /system/notice |
| | | # 匹配链接 |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | # file upload |
| | | file: |
| | | upload: |
| | | location: /file/ |
| | | qrLocation: /file/qrCode/ |
| | | accessPath: /file/ |
| | | allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF |
| | | wx: |
| | | config: |
| | | appId: wxc3985a05da7d86dc |
| | | secret: 5cca42633c25439613b328c08ef20cc9 |
| | | #OSS及短信配置 |
| | | code: |
| | | config: |
| | | templateCodeTest: "SMS_154950909" |
| | | signNameTest: "阿里云短信测试" |
| | | accessKeyId: LTAI5tAdba8HtT1C6UqtSxBt |
| | | accessKeySecret: 0SRb6XGkciQDPWn2rYqbJtq2qRMDY8 |
| | | signName: "四川金达通信工程" |
| | | templateCode: "SMS_293985284" |
| | | |
New file |
| | |
| | | # 项目相关配置 |
| | | ruoyi: |
| | | # 名称 |
| | | name: mitao |
| | | # 版本 |
| | | version: 3.8.6 |
| | | # 版权年份 |
| | | copyrightYear: 2023 |
| | | # 实例演示开关 |
| | | demoEnabled: true |
| | | # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) |
| | | profile: D:/ruoyi/uploadPath |
| | | # 获取ip地址开关 |
| | | addressEnabled: true |
| | | # 验证码类型 math 数字计算 char 字符验证 |
| | | captchaType: math |
| | | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8081 |
| | | 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: |
| | | main: |
| | | allow-bean-definition-overriding: true |
| | | # 资源信息 |
| | | messages: |
| | | # 国际化资源文件路径 |
| | | basename: i18n/messages |
| | | config: |
| | | activate: |
| | | on-profile: |
| | | - prod |
| | | # 文件上传 |
| | | servlet: |
| | | multipart: |
| | | # 单个文件大小 |
| | | max-file-size: 500MB |
| | | # 设置总上传的文件大小 |
| | | max-request-size: 2000MB |
| | | # 服务模块 |
| | | devtools: |
| | | restart: |
| | | # 热部署开关 |
| | | enabled: true |
| | | # redis 配置 |
| | | redis: |
| | | # 地址 |
| | | host: 127.0.0.1 |
| | | # 端口,默认为6379 |
| | | port: 6379 |
| | | # 数据库索引 |
| | | database: 0 |
| | | # 密码 |
| | | password: 123456 |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # 连接池中的最小空闲连接 |
| | | min-idle: 0 |
| | | # 连接池中的最大空闲连接 |
| | | max-idle: 8 |
| | | # 连接池的最大数据库连接数 |
| | | max-active: 8 |
| | | # #连接池最大阻塞等待时间(使用负值表示没有限制) |
| | | max-wait: -1ms |
| | | jackson: |
| | | default-property-inclusion: non_null |
| | | deserialization: |
| | | read-unknown-enum-values-as-null: true |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://localhost:3306/financialdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | # url: jdbc:mysql://8.137.10.192:3306/sys_config?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 |
| | | # username: root |
| | | # password: shms#123~ |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # 初始连接数 |
| | | initialSize: 5 |
| | | # 最小连接池数量 |
| | | minIdle: 10 |
| | | # 最大连接池数量 |
| | | maxActive: 20 |
| | | # 配置获取连接等待超时的时间 |
| | | maxWait: 60000 |
| | | # 配置连接超时时间 |
| | | connectTimeout: 30000 |
| | | # 配置网络超时时间 |
| | | socketTimeout: 60000 |
| | | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # 配置一个连接在池中最小生存的时间,单位是毫秒 |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # 配置一个连接在池中最大生存的时间,单位是毫秒 |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # 配置检测连接是否有效 |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | 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 |
| | | # token配置 |
| | | token: |
| | | # 令牌自定义标识 |
| | | header: Authorization |
| | | # 令牌密钥 |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # 令牌有效期(默认30分钟) |
| | | expireTime: 120 |
| | | |
| | | # MyBatis配置 |
| | | #mybatis: |
| | | # # 搜索指定包别名 |
| | | # typeAliasesPackage: com.ruoyi.**.domain |
| | | # # 配置mapper的扫描,找到所有的mapper.xml映射文件 |
| | | # mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # # 加载全局的配置文件 |
| | | # configLocation: classpath:mybatis/mybatis-config.xml |
| | | |
| | | # PageHelper分页插件 |
| | | #pagehelper: |
| | | # helperDialect: mysql |
| | | # supportMethodsArguments: true |
| | | # params: count=countSql |
| | | |
| | | mybatis-plus: |
| | | # 此处在多数据源中生效 |
| | | # config-location: classpath:/mybatis-config.xml |
| | | configuration: |
| | | map-underscore-to-camel-case: true |
| | | default-enum-type-handler: org.apache.ibatis.type.EnumOrdinalTypeHandler |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | cache-enabled: true |
| | | local-cache-scope: statement |
| | | global-config: |
| | | banner: false |
| | | db-config: |
| | | logic-not-delete-value: 0 |
| | | logic-delete-value: 1 |
| | | logic-delete-field: del_flag |
| | | type-aliases-package: com.ruoyi.**.domain,com.ruoyi.**.vo |
| | | # 指定Mapper文件位置 |
| | | mapper-locations: classpath*:mapper/**/*.xml |
| | | # Swagger配置 |
| | | swagger: |
| | | # 是否开启swagger |
| | | enabled: true |
| | | # 请求前缀 |
| | | pathMapping: / |
| | | |
| | | # 防止XSS攻击 |
| | | xss: |
| | | # 过滤开关 |
| | | enabled: true |
| | | # 排除链接(多个用逗号分隔) |
| | | excludes: /system/notice |
| | | # 匹配链接 |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | # file upload |
| | | file: |
| | | upload: |
| | | location: /file/ |
| | | qrLocation: /file/qrCode/ |
| | | accessPath: /file/ |
| | | allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF |
| | | wx: |
| | | config: |
| | | appId: wxc3985a05da7d86dc |
| | | secret: 5cca42633c25439613b328c08ef20cc9 |
| | | #OSS及短信配置 |
| | | code: |
| | | config: |
| | | templateCodeTest: "SMS_154950909" |
| | | signNameTest: "阿里云短信测试" |
| | | accessKeyId: LTAI5tAdba8HtT1C6UqtSxBt |
| | | accessKeySecret: 0SRb6XGkciQDPWn2rYqbJtq2qRMDY8 |
| | | signName: "四川金达通信工程" |
| | | templateCode: "SMS_293985284" |
| | |
| | | # 项目相关配置 |
| | | ruoyi: |
| | | # 名称 |
| | | name: mitao |
| | | # 版本 |
| | | version: 3.8.6 |
| | | # 版权年份 |
| | | copyrightYear: 2023 |
| | | # 实例演示开关 |
| | | demoEnabled: true |
| | | # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) |
| | | profile: D:/ruoyi/uploadPath |
| | | # 获取ip地址开关 |
| | | addressEnabled: true |
| | | # 验证码类型 math 数字计算 char 字符验证 |
| | | captchaType: math |
| | | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8081 |
| | | 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: |
| | | main: |
| | | allow-bean-definition-overriding: true |
| | | # 资源信息 |
| | | messages: |
| | | # 国际化资源文件路径 |
| | | basename: i18n/messages |
| | | profiles: |
| | | active: druid |
| | | # 文件上传 |
| | | servlet: |
| | | multipart: |
| | | # 单个文件大小 |
| | | max-file-size: 500MB |
| | | # 设置总上传的文件大小 |
| | | max-request-size: 2000MB |
| | | # 服务模块 |
| | | devtools: |
| | | restart: |
| | | # 热部署开关 |
| | | enabled: true |
| | | # redis 配置 |
| | | redis: |
| | | # 地址 |
| | | host: 127.0.0.1 |
| | | # 端口,默认为6379 |
| | | port: 6379 |
| | | # 数据库索引 |
| | | database: 0 |
| | | # 密码 |
| | | password: 123456 |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # 连接池中的最小空闲连接 |
| | | min-idle: 0 |
| | | # 连接池中的最大空闲连接 |
| | | max-idle: 8 |
| | | # 连接池的最大数据库连接数 |
| | | max-active: 8 |
| | | # #连接池最大阻塞等待时间(使用负值表示没有限制) |
| | | max-wait: -1ms |
| | | jackson: |
| | | default-property-inclusion: non_null |
| | | deserialization: |
| | | read-unknown-enum-values-as-null: true |
| | | |
| | | # token配置 |
| | | token: |
| | | # 令牌自定义标识 |
| | | header: Authorization |
| | | # 令牌密钥 |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # 令牌有效期(默认30分钟) |
| | | expireTime: 120 |
| | | |
| | | # MyBatis配置 |
| | | #mybatis: |
| | | # # 搜索指定包别名 |
| | | # typeAliasesPackage: com.ruoyi.**.domain |
| | | # # 配置mapper的扫描,找到所有的mapper.xml映射文件 |
| | | # mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # # 加载全局的配置文件 |
| | | # configLocation: classpath:mybatis/mybatis-config.xml |
| | | |
| | | # PageHelper分页插件 |
| | | #pagehelper: |
| | | # helperDialect: mysql |
| | | # supportMethodsArguments: true |
| | | # params: count=countSql |
| | | |
| | | mybatis-plus: |
| | | # 此处在多数据源中生效 |
| | | # config-location: classpath:/mybatis-config.xml |
| | | configuration: |
| | | map-underscore-to-camel-case: true |
| | | default-enum-type-handler: org.apache.ibatis.type.EnumOrdinalTypeHandler |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | cache-enabled: true |
| | | local-cache-scope: statement |
| | | global-config: |
| | | banner: false |
| | | db-config: |
| | | logic-not-delete-value: 0 |
| | | logic-delete-value: 1 |
| | | logic-delete-field: del_flag |
| | | type-aliases-package: com.ruoyi.**.domain,com.ruoyi.**.vo |
| | | # 指定Mapper文件位置 |
| | | mapper-locations: classpath*:mapper/**/*.xml |
| | | # Swagger配置 |
| | | swagger: |
| | | # 是否开启swagger |
| | | enabled: true |
| | | # 请求前缀 |
| | | pathMapping: / |
| | | |
| | | # 防止XSS攻击 |
| | | xss: |
| | | # 过滤开关 |
| | | enabled: true |
| | | # 排除链接(多个用逗号分隔) |
| | | excludes: /system/notice |
| | | # 匹配链接 |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | # file upload |
| | | file: |
| | | upload: |
| | | location: /file/ |
| | | qrLocation: /file/qrCode/ |
| | | accessPath: /file/ |
| | | allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF |
| | | wx: |
| | | config: |
| | | appId: wxc3985a05da7d86dc |
| | | secret: 5cca42633c25439613b328c08ef20cc9 |
| | | #OSS及短信配置 |
| | | code: |
| | | config: |
| | | templateCodeTest: "SMS_154950909" |
| | | signNameTest: "阿里云短信测试" |
| | | accessKeyId: LTAI5tAdba8HtT1C6UqtSxBt |
| | | accessKeySecret: 0SRb6XGkciQDPWn2rYqbJtq2qRMDY8 |
| | | signName: "四川金达通信工程" |
| | | templateCode: "SMS_293985284" |
| | | active: prod |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.data.annotation.CreatedBy; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import lombok.Data; |
| | | import org.springframework.data.annotation.CreatedBy; |
| | | |
| | | /** |
| | | * Entity基类 |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Data |
| | | public class BaseModel implements Serializable |
| | | { |
| | | public class BaseModel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 创建者 */ |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | @ApiModelProperty(value = "记录创建人,前端忽略") |
| | | @CreatedBy |
| | | @TableField(value = "create_by", fill = FieldFill.INSERT) |
| | | private String createBy; |
| | | |
| | | /** 创建时间 */ |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "记录创建时间,前端忽略") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** 更新者 */ |
| | | /** |
| | | * 更新者 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "记录修改人,前端忽略") |
| | | @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE) |
| | | private String updateBy; |
| | | |
| | | /** 更新时间 */ |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "记录修改时间,前端忽略") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | | /** 是否删除 0未删除 1已删除 */ |
| | | /** |
| | | * 是否删除 0未删除 1已删除 |
| | | */ |
| | | @ApiModelProperty(value = "是否删除 0未删除 1已删除") |
| | | @TableLogic |
| | | private Integer isDelete; |
| | | |
| | | |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.util.Set; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | |
| | | * 角色ID |
| | | */ |
| | | //@Excel(name = "角色序号", cellType = ColumnType.NUMERIC) |
| | | @ApiModelProperty("角色id") |
| | | private Long roleId; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | //@Excel(name = "角色名称") |
| | | @ApiModelProperty("角色名称") |
| | | private String roleName; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 菜单组 |
| | | */ |
| | | @ApiModelProperty("菜单权限id列表") |
| | | private Long[] menuIds; |
| | | |
| | | /** |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ValueTypeEnum { |
| | | FIELD(1, "字段"), |
| | | CHARACTER(2, "符号"), |
| | | NUMBER(3, "数字"); |
| | | @EnumValue |
| | | private final Integer code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static ValueTypeEnum getEnumByCode(Integer code) { |
| | | for (ValueTypeEnum e : ValueTypeEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | import org.apache.commons.jexl3.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import org.apache.commons.jexl3.JexlBuilder; |
| | | import org.apache.commons.jexl3.JexlContext; |
| | | import org.apache.commons.jexl3.JexlEngine; |
| | | import org.apache.commons.jexl3.JexlExpression; |
| | | import org.apache.commons.jexl3.MapContext; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/27 |
| | | */ |
| | | public class CalculateUtil { |
| | | |
| | | public static Map<String, Integer> getFieldsAndValue(String rule) { |
| | | // 正则表达式模式,匹配形如 "fieldName:value" 的字符串 |
| | | Pattern pattern = Pattern.compile("\\b(\\w+)_(\\d+)\\b"); |
| | |
| | | return Double.parseDouble(result.toString()); |
| | | } |
| | | |
| | | public static double calculate(String expression) { |
| | | // 创建 JEXL 引擎 |
| | | JexlEngine jexl = new JexlBuilder().create(); |
| | | |
| | | // 创建表达式对象 |
| | | JexlExpression exp = jexl.createExpression(expression); |
| | | // 创建上下文 |
| | | JexlContext context = new MapContext(); |
| | | // 执行计算 |
| | | Object result = exp.evaluate(context); |
| | | |
| | | // 输出结果 |
| | | System.out.println("Result: " + result); |
| | | return Double.parseDouble(result.toString()); |
| | | } |
| | | |
| | | public static String formatExpression(String expression) { |
| | | return expression |
| | | .replaceAll("×", "*") |
| | |
| | | .replaceAll("+", "+") |
| | | .replaceAll("-", "-"); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String string = "field_3 * field_2"; |
| | | System.out.println(getFieldsAndValue(string)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.exception.DemoModeException; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.security.access.AccessDeniedException; |
| | |
| | | import org.springframework.web.bind.annotation.RestControllerAdvice; |
| | | import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 全局异常处理器 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestControllerAdvice |
| | | public class GlobalExceptionHandler |
| | | { |
| | | public class GlobalExceptionHandler { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); |
| | | |
| | | /** |
| | | * 权限校验异常 |
| | | */ |
| | | @ExceptionHandler(AccessDeniedException.class) |
| | | public AjaxResult handleAccessDeniedException(AccessDeniedException e, HttpServletRequest request) |
| | | { |
| | | public AjaxResult handleAccessDeniedException(AccessDeniedException e, |
| | | HttpServletRequest request) { |
| | | String requestURI = request.getRequestURI(); |
| | | log.error("请求地址'{}',权限校验失败'{}'", requestURI, e.getMessage()); |
| | | return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权"); |
| | |
| | | */ |
| | | @ExceptionHandler(HttpRequestMethodNotSupportedException.class) |
| | | public AjaxResult handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e, |
| | | HttpServletRequest request) |
| | | { |
| | | HttpServletRequest request) { |
| | | String requestURI = request.getRequestURI(); |
| | | log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod()); |
| | | return AjaxResult.error(e.getMessage()); |
| | |
| | | * 业务异常 |
| | | */ |
| | | @ExceptionHandler(ServiceException.class) |
| | | public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) |
| | | { |
| | | public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) { |
| | | log.error(e.getMessage(), e); |
| | | Integer code = e.getCode(); |
| | | return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage()); |
| | | return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) |
| | | : AjaxResult.error(e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 请求路径中缺少必需的路径变量 |
| | | */ |
| | | @ExceptionHandler(MissingPathVariableException.class) |
| | | public AjaxResult handleMissingPathVariableException(MissingPathVariableException e, HttpServletRequest request) |
| | | { |
| | | public AjaxResult handleMissingPathVariableException(MissingPathVariableException e, |
| | | HttpServletRequest request) { |
| | | String requestURI = request.getRequestURI(); |
| | | log.error("请求路径中缺少必需的路径变量'{}',发生系统异常.", requestURI, e); |
| | | return AjaxResult.error(String.format("请求路径中缺少必需的路径变量[%s]", e.getVariableName())); |
| | | return AjaxResult.error( |
| | | String.format("请求路径中缺少必需的路径变量[%s]", e.getVariableName())); |
| | | } |
| | | |
| | | /** |
| | | * 请求参数类型不匹配 |
| | | */ |
| | | @ExceptionHandler(MethodArgumentTypeMismatchException.class) |
| | | public AjaxResult handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, HttpServletRequest request) |
| | | { |
| | | public AjaxResult handleMethodArgumentTypeMismatchException( |
| | | MethodArgumentTypeMismatchException e, HttpServletRequest request) { |
| | | String requestURI = request.getRequestURI(); |
| | | log.error("请求参数类型不匹配'{}',发生系统异常.", requestURI, e); |
| | | return AjaxResult.error(String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", e.getName(), e.getRequiredType().getName(), e.getValue())); |
| | | return AjaxResult.error( |
| | | String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", |
| | | e.getName(), e.getRequiredType().getName(), e.getValue())); |
| | | } |
| | | |
| | | /** |
| | | * 拦截未知的运行时异常 |
| | | */ |
| | | @ExceptionHandler(RuntimeException.class) |
| | | public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) |
| | | { |
| | | public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) { |
| | | String requestURI = request.getRequestURI(); |
| | | log.error("请求地址'{}',发生未知异常.", requestURI, e); |
| | | return AjaxResult.error(e.getMessage()); |
| | |
| | | * 系统异常 |
| | | */ |
| | | @ExceptionHandler(Exception.class) |
| | | public AjaxResult handleException(Exception e, HttpServletRequest request) |
| | | { |
| | | public AjaxResult handleException(Exception e, HttpServletRequest request) { |
| | | String requestURI = request.getRequestURI(); |
| | | log.error("请求地址'{}',发生系统异常.", requestURI, e); |
| | | return AjaxResult.error(e.getMessage()); |
| | |
| | | * 自定义验证异常 |
| | | */ |
| | | @ExceptionHandler(BindException.class) |
| | | public AjaxResult handleBindException(BindException e) |
| | | { |
| | | public AjaxResult handleBindException(BindException e) { |
| | | log.error(e.getMessage(), e); |
| | | String message = e.getAllErrors().get(0).getDefaultMessage(); |
| | | return AjaxResult.error(message); |
| | |
| | | * 自定义验证异常 |
| | | */ |
| | | @ExceptionHandler(MethodArgumentNotValidException.class) |
| | | public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e) |
| | | { |
| | | public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { |
| | | log.error(e.getMessage(), e); |
| | | String message = e.getBindingResult().getFieldError().getDefaultMessage(); |
| | | return AjaxResult.error(message); |
| | |
| | | * 演示模式异常 |
| | | */ |
| | | @ExceptionHandler(DemoModeException.class) |
| | | public AjaxResult handleDemoModeException(DemoModeException e) |
| | | { |
| | | public AjaxResult handleDemoModeException(DemoModeException e) { |
| | | return AjaxResult.error("演示模式,不允许操作"); |
| | | } |
| | | } |
| | |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>3.3.4</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-extension</artifactId> |
| | | <version>3.5.3.1</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.enums.CalculateTypeEnum; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("tb_basic_data_config") |
| | | @ApiModel(value="TbBasicDataConfig对象", description="基础数据配置表") |
| | | @ApiModel(value = "TbBasicDataConfig对象", description = "基础数据配置表") |
| | | public class TbBasicDataConfig implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | |
| | | @ApiModelProperty(value = "基础数据分类id") |
| | | @TableField("basic_data_category_id") |
| | | private Integer basicDataCategoryId; |
| | | private Long basicDataCategoryId; |
| | | |
| | | @ApiModelProperty(value = "类型名称") |
| | | @TableField("type_name") |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.enums.DataScreenConfigEnum; |
| | | import com.ruoyi.common.enums.SubTypeEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | |
| | | |
| | | @ApiModelProperty(value = "配置类型子类型(1=数据指标一/形式指标一 2=数据指标二/形式指标二 3=数据指标三/形式指标三 4=数据指标四/形式指标四)") |
| | | @TableField("sub_type") |
| | | private Integer subType; |
| | | private SubTypeEnum subType; |
| | | |
| | | @ApiModelProperty(value = "风险等级范围-高风险得分") |
| | | @TableField("high_risk") |
| | |
| | | import com.ruoyi.common.utils.CalculateUtil; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | @NotNull(message = "计算类型不能为空") |
| | | private CalculateTypeEnum calculateType; |
| | | |
| | | @ApiModelProperty(value = "字段id ",notes = "多个id使用 ',' 拼接") |
| | | @NotBlank(message = "字段id不能为空") |
| | | @ApiModelProperty(value = "字段id ", notes = "文本统计 和百分比统计的的字段id") |
| | | private String fieldIdStr; |
| | | |
| | | @ApiModelProperty(value = "计算公式",notes = "计算类型为数字计算,配置内容使用该字段接收;公式中字段的格式为:field_字段id,e.g:field_1,field_2等。") |
| | | private String numberCalculateFormula; |
| | | @ApiModelProperty(value = "计算公式") |
| | | private List<CalculateItemDTO> calculateItemList; |
| | | |
| | | @ApiModelProperty(value = "文本和百分比配置信息",notes = "当计算方式为 文本统计/百分比统计 " + |
| | | @ApiModelProperty(value = "文本和百分比配置信息", notes = "当计算方式为 文本统计/百分比统计 " + |
| | | "配置内容使用这个字段接收;key为键,value为得分;百分比统计 将百分比区间使用'_'拼接作为key,e.g: 10_20,20_30") |
| | | private List<CalculateDTO> dtoList; |
| | | |
| | |
| | | /* double calculate = CalculateUtil.calculate(expression, fieldsAndValue); |
| | | System.out.println(calculate);*/ |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.enums.ValueTypeEnum; |
| | | import com.ruoyi.common.utils.CalculateUtil; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/4/12 |
| | | */ |
| | | @Data |
| | | @ApiModel("计算规则配置值数据传输对象") |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class CalculateItemDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 7842483119802233747L; |
| | | |
| | | @ApiModelProperty(value = "值类型", notes = "字段;符号;数字") |
| | | private ValueTypeEnum valueType; |
| | | @ApiModelProperty("内容") |
| | | private String content; |
| | | |
| | | public static void main(String[] args) { |
| | | CalculateItemDTO dto1 = new CalculateItemDTO(ValueTypeEnum.FIELD, "1"); |
| | | CalculateItemDTO dto2 = new CalculateItemDTO(ValueTypeEnum.CHARACTER, "*"); |
| | | CalculateItemDTO dto3 = new CalculateItemDTO(ValueTypeEnum.NUMBER, "1"); |
| | | CalculateItemDTO dto4 = new CalculateItemDTO(ValueTypeEnum.CHARACTER, ")"); |
| | | CalculateItemDTO dto5 = new CalculateItemDTO(ValueTypeEnum.CHARACTER, "*"); |
| | | |
| | | List<CalculateItemDTO> list = Lists.newArrayList(dto1, dto2, dto3, dto4); |
| | | //将list转为jsonString |
| | | String jsonString = JSON.toJSONString(list); |
| | | System.out.println(jsonString); |
| | | List<CalculateItemDTO> calculateItemDTOS = JSONArray.parseArray(jsonString, |
| | | CalculateItemDTO.class); |
| | | System.out.println(calculateItemDTOS); |
| | | String numberCalculateFormulaStr = calculateItemDTOS.stream() |
| | | .map(CalculateItemDTO::getContent).collect(Collectors.joining()); |
| | | System.out.println(numberCalculateFormulaStr); |
| | | double calculate = CalculateUtil.calculate(numberCalculateFormulaStr); |
| | | System.out.println(calculate); |
| | | } |
| | | } |
| | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "角色新增DTO") |
| | | public class SysRoleDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 3461576838938557688L; |
| | | |
| | | @ApiModelProperty(value = "角色id") |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value = "角色名称") |
| | | @NotBlank(message = "角色名称不能为空") |
| | | private String roleName; |
| | | |
| | | @ApiModelProperty(value = "类型") |
| | | private Integer postType; |
| | | |
| | | @ApiModelProperty(value = "权限id集合") |
| | | @NotEmpty(message = "权限id集合不能为空") |
| | | private List<Long> menuIds; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/4/12 |
| | | */ |
| | | @Data |
| | | @ApiModel("系统账号传输实体对象") |
| | | public class SysUserDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -7745059921246754935L; |
| | | @ApiModelProperty("员工姓名") |
| | | private String userName; |
| | | @ApiModelProperty("联系电话") |
| | | private String phoneNumber; |
| | | @ApiModelProperty("登录密码") |
| | | private String password; |
| | | @ApiModelProperty("所属角色id") |
| | | private Long roleId; |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.enums.CalculateTypeEnum; |
| | | import com.ruoyi.system.dto.CalculateDTO; |
| | | import com.ruoyi.system.dto.CalculateItemDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "基础数据配置数据传输对象") |
| | |
| | | @NotBlank(message = "字段id不能为空") |
| | | private String fieldIdStr; |
| | | |
| | | @ApiModelProperty(value = "计算公式",notes = "计算类型为数字计算,配置内容使用该字段接收;公式中字段的格式为:field_字段id,e.g:field_1,field_2等。") |
| | | private String numberCalculateFormula; |
| | | @ApiModelProperty(value = "计算公式", notes = "计算类型为数字计算,配置内容使用该字段接收;公式中字段的格式为:field_字段id,e.g:field_1,field_2等。") |
| | | private List<CalculateItemDTO> calculateItemList; |
| | | |
| | | @ApiModelProperty(value = "文本和百分比配置信息",notes = "当计算方式为 文本统计/百分比统计 " + |
| | | @ApiModelProperty(value = "文本和百分比配置信息", notes = "当计算方式为 文本统计/百分比统计 " + |
| | | "配置内容使用这个字段接收;key为键,value为得分;百分比统计 将百分比区间使用'_'拼接作为key,e.g: 10_20,20_30") |
| | | private List<CalculateDTO> dtoList; |
| | | |
| | | } |
| | | } |
| | |
| | | * @date 2024/4/10 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "风险等级设置编辑数据传输对象") |
| | | @ApiModel(value = "数据指标设置编辑数据传输对象") |
| | | public class DataIndicatorsUpdDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -5866223907037261823L; |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | |
| | | @ApiModelProperty(value = "配置类型子类型(1=指标一 2=指标二 3=指标三 4=指标四)") |
| | | @NotNull(message = "配置类型子类型不能为空") |
| | | private SubTypeEnum subType; |
| | |
| | | package com.ruoyi.system.dto.update; |
| | | |
| | | import com.ruoyi.common.enums.FieldInputTypeEnum; |
| | | import com.ruoyi.common.enums.FieldTypeEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "字段名") |
| | | @NotBlank(message="字段名不能为空") |
| | | @NotBlank(message = "字段名不能为空") |
| | | private String fieldName; |
| | | |
| | | @ApiModelProperty(value = "字段类型(1=数字 2=文本 3=百分比)") |
| | | @NotNull(message="字段类型不能为空") |
| | | private Integer fieldType; |
| | | @NotNull(message = "字段类型不能为空") |
| | | private FieldTypeEnum fieldType; |
| | | |
| | | @ApiModelProperty(value = "一级分类id") |
| | | @NotNull(message="分类id不能为空") |
| | | @NotNull(message = "分类id不能为空") |
| | | private Long levelOneCategoryId; |
| | | |
| | | @ApiModelProperty(value = "二级分类id") |
| | |
| | | private Integer numMax; |
| | | |
| | | @ApiModelProperty(value = "文本输入类型(1=手动输入 2=固定内容)") |
| | | private Integer textInputType; |
| | | private FieldInputTypeEnum textInputType; |
| | | |
| | | @ApiModelProperty(value = "文本最少字数") |
| | | private Integer textMinNum; |
| | |
| | | * @date 2024/4/10 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "风险等级设置编辑数据传输对象") |
| | | @ApiModel(value = "形式指标设置编辑数据传输对象") |
| | | public class FormalIndicatorsUpdDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -4878457973955230627L; |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | |
| | | @ApiModelProperty(value = "配置类型子类型(1=指标一 2=指标二 3=指标三 4=指标四)") |
| | | private SubTypeEnum subType; |
| | | |
| | |
| | | |
| | | private static final long serialVersionUID = -4878457973955230627L; |
| | | |
| | | @ApiModelProperty(value = "id", notes = "如果返回了id,必传") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "计算规则", notes = "公式中字段的格式为:field_字段id,e.g:field_1,field_2等。") |
| | | @NotBlank(message = "计算规则不能为空") |
| | | private String calculateFormula; |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.system.query.SysRoleQuery; |
| | | import com.ruoyi.system.vo.RoleInfoVO; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 角色表 数据层 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Mapper |
| | | public interface SysRoleMapper |
| | | { |
| | | public interface SysRoleMapper { |
| | | |
| | | /** |
| | | * 根据条件分页查询角色数据 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 角色数据集合信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据用户ID查询角色 |
| | | * |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 角色列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询所有角色 |
| | | * |
| | | * |
| | | * @return 角色列表 |
| | | */ |
| | | public List<SysRole> selectRoleAll(); |
| | | |
| | | /** |
| | | * 根据用户ID获取角色选择框列表 |
| | | * |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 选中角色ID列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过角色ID查询角色 |
| | | * |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 角色对象信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据用户ID查询角色 |
| | | * |
| | | * |
| | | * @param userName 用户名 |
| | | * @return 角色列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 校验角色名称是否唯一 |
| | | * |
| | | * |
| | | * @param roleName 角色名称 |
| | | * @return 角色信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 校验角色权限是否唯一 |
| | | * |
| | | * |
| | | * @param roleKey 角色权限 |
| | | * @return 角色信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改角色信息 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增角色信息 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过角色ID删除角色 |
| | | * |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量删除角色信息 |
| | | * |
| | | * |
| | | * @param roleIds 需要删除的角色ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | // List<SysRole> selectList(@Param("query")SysRoleQuery query); |
| | | |
| | | int selectCount(@Param("status")Integer status); |
| | | int selectCount(@Param("status") Integer status); |
| | | |
| | | void updateStatus(SysRole role); |
| | | |
| | | List<SysRole> selectListByDelFlag(@Param("delFlag")Integer delFlag); |
| | | List<SysRole> selectListByDelFlag(@Param("delFlag") Integer delFlag); |
| | | |
| | | SysRole selectRoleByUserId(@Param("userId")Long userId); |
| | | SysRole selectRoleByUserId(@Param("userId") Long userId); |
| | | |
| | | String selectByUserId(@Param("userId") Long user_id); |
| | | |
| | | List<SysRole> selectList(@Param("query")SysRoleQuery query,@Param("pageInfo") PageInfo<SysRole> pageInfo); |
| | | Page<RoleInfoVO> selectList(@Param("query") SysRoleQuery query, |
| | | @Param("page") Page<RoleInfoVO> page); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.system.domain.TbBasicDataConfig; |
| | | import com.ruoyi.system.query.BasicDataConfigQuery; |
| | | import com.ruoyi.system.query.ScoreCalculateQuery; |
| | | import com.ruoyi.system.vo.BasicDataConfigVO; |
| | | import com.ruoyi.system.vo.ScoreCalculateVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | */ |
| | | public interface TbBasicDataConfigMapper extends BaseMapper<TbBasicDataConfig> { |
| | | |
| | | Page<ScoreCalculateVO> scoreCalculatePage(@Param("query") ScoreCalculateQuery query, @Param("page") Page<ScoreCalculateVO> page); |
| | | Page<ScoreCalculateVO> scoreCalculatePage(@Param("query") ScoreCalculateQuery query, |
| | | @Param("page") Page<ScoreCalculateVO> page); |
| | | |
| | | Page<BasicDataConfigVO> queryPage(@Param("page") Page<BasicDataConfigVO> page, |
| | | @Param("query") BasicDataConfigQuery query); |
| | | } |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private String fieldCategoryName; |
| | | |
| | | @ApiModelProperty(value = "状态(0=隐藏 1=显示 全部则不传)") |
| | | private Integer status; |
| | | private ShowStatusEnum status; |
| | | } |
| | |
| | | @ApiModelProperty(value = "三级分类") |
| | | private String levelThreeCategory; |
| | | |
| | | @ApiModelProperty(value = "状态 展示 隐藏") |
| | | @ApiModelProperty(value = "状态 0=展示中 1=已隐藏") |
| | | private ShowStatusEnum status; |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.dto.SysRoleDTO; |
| | | import com.ruoyi.system.query.SysRoleQuery; |
| | | import com.ruoyi.system.vo.RoleInfoVO; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 角色业务层 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysRoleService |
| | | { |
| | | public interface ISysRoleService { |
| | | |
| | | /** |
| | | * 根据条件分页查询角色数据 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 角色数据集合信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据用户ID查询角色列表 |
| | | * |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 角色列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据用户ID查询角色权限 |
| | | * |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 权限列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询所有角色 |
| | | * |
| | | * |
| | | * @return 角色列表 |
| | | */ |
| | | public List<SysRole> selectRoleAll(); |
| | | |
| | | /** |
| | | * 根据用户ID获取角色选择框列表 |
| | | * |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 选中角色ID列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过角色ID查询角色 |
| | | * |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 角色对象信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 校验角色名称是否唯一 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 校验角色权限是否唯一 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 校验角色是否允许操作 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | */ |
| | | public void checkRoleAllowed(SysRole role); |
| | | |
| | | /** |
| | | * 校验角色是否有数据权限 |
| | | * |
| | | * |
| | | * @param roleId 角色id |
| | | */ |
| | | public void checkRoleDataScope(Long roleId); |
| | | |
| | | /** |
| | | * 通过角色ID查询角色使用数量 |
| | | * |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增保存角色信息 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改保存角色信息 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改角色状态 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改数据权限信息 |
| | | * |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 通过角色ID删除角色 |
| | | * |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量删除角色信息 |
| | | * |
| | | * |
| | | * @param roleIds 需要删除的角色ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 取消授权用户角色 |
| | | * |
| | | * |
| | | * @param userRole 用户和角色关联信息 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量取消授权用户角色 |
| | | * |
| | | * @param roleId 角色ID |
| | | * |
| | | * @param roleId 角色ID |
| | | * @param userIds 需要取消授权的用户数据ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量选择授权用户角色 |
| | | * |
| | | * @param roleId 角色ID |
| | | * |
| | | * @param roleId 角色ID |
| | | * @param userIds 需要删除的用户数据ID |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 角色列表 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | List<SysRole> selectListByDelFlag(Integer delFlag); |
| | | |
| | | /** |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | void saveRole(SysRoleDTO dto); |
| | | |
| | | PageInfo<SysRole> selectList(SysRoleQuery query); |
| | | PageDTO<RoleInfoVO> selectList(SysRoleQuery query); |
| | | |
| | | /** |
| | | * 修改保存角色信息 |
| | |
| | | |
| | | void edit(BasicDataConfigUpdateDTO dto); |
| | | |
| | | BasicDataConfigDetailVO getDetails(Integer id); |
| | | BasicDataConfigDetailVO getDetails(Long id); |
| | | |
| | | void delete(Integer id); |
| | | void delete(Long id); |
| | | |
| | | PageDTO<BasicDataConfigVO> queryPage(BasicDataConfigQuery query); |
| | | |
| | | void showHide(ShowHideDTO dto); |
| | | |
| | | Page<ScoreCalculateVO> scoreCalculatePage(ScoreCalculateQuery query, Page<ScoreCalculateVO> page); |
| | | Page<ScoreCalculateVO> scoreCalculatePage(ScoreCalculateQuery query, |
| | | Page<ScoreCalculateVO> page); |
| | | |
| | | Page<BasicDataConfigVO> queryPage(Page<BasicDataConfigVO> objectPage, |
| | | BasicDataConfigQuery query); |
| | | } |
| | |
| | | import com.ruoyi.system.query.FieldQuery; |
| | | import com.ruoyi.system.vo.BasicDataFieldVO; |
| | | import com.ruoyi.system.vo.FieldVO; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | String influencedData(Long id); |
| | | |
| | | void update(FieldUpdateDTO dto); |
| | | void editField(FieldUpdateDTO dto); |
| | | |
| | | BasicDataFieldVO getHistoryFields(Long id); |
| | | |
| | | void downloadImportTemplate() throws Exception; |
| | | |
| | | PageDTO<FieldVO> queryShowPage(FieldQuery query); |
| | | |
| | | List<FieldVO> listFields(); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | | import com.ruoyi.system.query.SysRoleQuery; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.vo.RoleInfoVO; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashSet; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<SysRole> selectList(SysRoleQuery query) { |
| | | PageInfo<SysRole> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<SysRole> list = roleMapper.selectList(query, pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | public PageDTO<RoleInfoVO> selectList(SysRoleQuery query) { |
| | | Page<RoleInfoVO> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | Page<RoleInfoVO> pageVO = roleMapper.selectList(query, page); |
| | | return PageDTO.of(pageVO); |
| | | } |
| | | |
| | | @Override |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageDTO; |
| | | import com.ruoyi.common.enums.CalculateTypeEnum; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import com.ruoyi.common.enums.ValueTypeEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.BeanUtils; |
| | | import com.ruoyi.common.utils.CalculateUtil; |
| | | import com.ruoyi.common.utils.Checker; |
| | | import com.ruoyi.common.utils.CollUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | import com.ruoyi.system.domain.TbField; |
| | | import com.ruoyi.system.dto.BasicDataConfigDTO; |
| | | import com.ruoyi.system.dto.CalculateDTO; |
| | | import com.ruoyi.system.dto.CalculateItemDTO; |
| | | import com.ruoyi.system.dto.ShowHideDTO; |
| | | import com.ruoyi.system.dto.update.BasicDataConfigUpdateDTO; |
| | | import com.ruoyi.system.mapper.TbBasicDataConfigMapper; |
| | | import com.ruoyi.system.mapper.TbFieldMapper; |
| | | import com.ruoyi.system.query.BasicDataConfigQuery; |
| | | import com.ruoyi.system.query.ScoreCalculateQuery; |
| | | import com.ruoyi.system.service.TbBasicDataCategoryService; |
| | | import com.ruoyi.system.service.TbBasicDataConfigDetailService; |
| | | import com.ruoyi.system.service.TbBasicDataConfigService; |
| | | import com.ruoyi.system.vo.BasicDataConfigDetailVO; |
| | | import com.ruoyi.system.vo.BasicDataConfigVO; |
| | | import com.ruoyi.system.vo.CalculateVO; |
| | | import com.ruoyi.system.vo.ScoreCalculateVO; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.IntStream; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class TbBasicDataConfigServiceImpl extends ServiceImpl<TbBasicDataConfigMapper, TbBasicDataConfig> implements TbBasicDataConfigService { |
| | | public class TbBasicDataConfigServiceImpl extends |
| | | ServiceImpl<TbBasicDataConfigMapper, TbBasicDataConfig> implements |
| | | TbBasicDataConfigService { |
| | | |
| | | private final TbBasicDataConfigDetailService tbBasicDataConfigDetailService; |
| | | private final TbFieldMapper fieldMapper; |
| | | private final TbBasicDataCategoryService tbBasicDataCategoryService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void add(BasicDataConfigDTO dto) { |
| | | TbBasicDataConfig tbBasicDataConfig = BeanUtils.copyBean(dto, TbBasicDataConfig.class); |
| | | //参数校验 |
| | | List<CalculateItemDTO> calculateItemList = dto.getCalculateItemList(); |
| | | CalculateTypeEnum calculateType = tbBasicDataConfig.getCalculateType(); |
| | | List<CalculateDTO> dtoList = dto.getDtoList(); |
| | | if (CalculateTypeEnum.NUMBER.equals(calculateType) && StringUtils.isBlank(dto.getNumberCalculateFormula())) { |
| | | throw new ServiceException("计算公式不能为空"); |
| | | } |
| | | boolean verify = (CalculateTypeEnum.TEXT.equals(calculateType) || CalculateTypeEnum.PERCENTAGE.equals(calculateType)) && CollUtils.isNotEmpty(dtoList); |
| | | if (verify) { |
| | | CollUtils.check(dto.getDtoList(), new Checker<CalculateDTO>() { |
| | | @Override |
| | | public void check(CalculateDTO data) { |
| | | if (StringUtils.isBlank(data.getKey())) { |
| | | throw new ServiceException("基础数据配置key不能为空"); |
| | | } |
| | | if (StringUtils.isBlank(data.getValue())) { |
| | | throw new ServiceException("基础数据配置value不能为空"); |
| | | } |
| | | } |
| | | }); |
| | | if (CalculateTypeEnum.NUMBER.equals(calculateType)) { |
| | | String fieldIdStr = getFieldIdStr(calculateItemList, tbBasicDataConfig); |
| | | tbBasicDataConfig.setFieldIdStr(fieldIdStr); |
| | | } else { |
| | | throw new ServiceException("计算公式不能为空"); |
| | | if (CollUtils.isEmpty(dtoList)) { |
| | | throw new ServiceException("基础数据配置不能为空"); |
| | | } else { |
| | | CollUtils.check(dto.getDtoList(), new Checker<CalculateDTO>() { |
| | | @Override |
| | | public void check(CalculateDTO data) { |
| | | if (StringUtils.isBlank(data.getKey())) { |
| | | throw new ServiceException("基础数据配置key不能为空"); |
| | | } |
| | | if (StringUtils.isBlank(data.getValue())) { |
| | | throw new ServiceException("基础数据配置value不能为空"); |
| | | } |
| | | } |
| | | }); |
| | | if (StringUtils.isBlank(dto.getFieldIdStr())) { |
| | | throw new ServiceException("字段id不能为空"); |
| | | } |
| | | List<TbBasicDataConfigDetail> details = BeanUtils.copyList(dtoList, |
| | | TbBasicDataConfigDetail.class); |
| | | List<TbBasicDataConfigDetail> collect = details.stream() |
| | | .peek(item -> item.setBasicDataConfigId(tbBasicDataConfig.getId())) |
| | | .collect(Collectors.toList()); |
| | | tbBasicDataConfigDetailService.saveBatch(collect); |
| | | } |
| | | } |
| | | this.save(tbBasicDataConfig); |
| | | if (verify) { |
| | | List<TbBasicDataConfigDetail> details = BeanUtils.copyList(dtoList, TbBasicDataConfigDetail.class); |
| | | List<TbBasicDataConfigDetail> collect = details.stream().peek(item -> item.setBasicDataConfigId(tbBasicDataConfig.getId())).collect(Collectors.toList()); |
| | | tbBasicDataConfigDetailService.saveBatch(collect); |
| | | } |
| | | |
| | | public boolean hasConsecutiveDuplicates(List<CalculateItemDTO> calculateItemList) { |
| | | return IntStream.range(1, calculateItemList.size()) |
| | | .anyMatch(i -> calculateItemList.get(i - 1).getValueType() |
| | | .equals(calculateItemList.get(i).getValueType())); |
| | | } |
| | | |
| | | |
| | | @NotNull |
| | | private String getFieldIdStr(List<CalculateItemDTO> calculateItemList, |
| | | TbBasicDataConfig tbBasicDataConfig) { |
| | | if (CollUtils.isEmpty(calculateItemList)) { |
| | | throw new ServiceException("计算公式不能为空"); |
| | | } |
| | | CollUtils.check(calculateItemList, new Checker<CalculateItemDTO>() { |
| | | @Override |
| | | public void check(CalculateItemDTO data) { |
| | | if (Objects.isNull(data.getValueType())) { |
| | | throw new ServiceException("基础数据配置计算规则值类型不能为空"); |
| | | } |
| | | if (StringUtils.isBlank(data.getContent())) { |
| | | throw new ServiceException("基础数据配置计算规则值内容不能为空"); |
| | | } |
| | | } |
| | | }); |
| | | boolean result = hasConsecutiveDuplicates(calculateItemList); |
| | | if (result) { |
| | | throw new ServiceException("计算表达式有误,请修改"); |
| | | } |
| | | //参数校验 |
| | | String numberCalculateFormulaStr = calculateItemList.stream() |
| | | .map(CalculateItemDTO::getContent) |
| | | .collect(Collectors.joining()); |
| | | //校验表达式是否正确 |
| | | try { |
| | | CalculateUtil.calculate(numberCalculateFormulaStr); |
| | | } catch (Exception e) { |
| | | throw new ServiceException("计算表达式有误,请修改"); |
| | | } |
| | | String numberCalculateFormulaJsonStr = JSON.toJSONString(calculateItemList); |
| | | tbBasicDataConfig.setNumberCalculateFormula(numberCalculateFormulaJsonStr); |
| | | String fieldIdStr = calculateItemList.stream() |
| | | .filter(item -> ValueTypeEnum.FIELD.equals(item.getValueType())) |
| | | .map(CalculateItemDTO::getContent).collect( |
| | | Collectors.joining(",")); |
| | | return fieldIdStr; |
| | | } |
| | | |
| | | @Override |
| | |
| | | //参数校验 |
| | | CalculateTypeEnum calculateType = tbBasicDataConfig.getCalculateType(); |
| | | List<CalculateDTO> dtoList = dto.getDtoList(); |
| | | if (CalculateTypeEnum.NUMBER.equals(calculateType) && StringUtils.isBlank(dto.getNumberCalculateFormula())) { |
| | | throw new ServiceException("计算公式不能为空"); |
| | | } |
| | | boolean verify = CalculateTypeEnum.TEXT.equals(calculateType) || CalculateTypeEnum.PERCENTAGE.equals(calculateType); |
| | | if (verify && CollUtils.isEmpty(dtoList)) { |
| | | throw new ServiceException("计算公式不能为空"); |
| | | } |
| | | this.updateById(tbBasicDataConfig); |
| | | if (verify) { |
| | | if (CalculateTypeEnum.NUMBER.equals(calculateType)) { |
| | | tbBasicDataConfig.setFieldIdStr( |
| | | getFieldIdStr(dto.getCalculateItemList(), tbBasicDataConfig)); |
| | | } else { |
| | | if (CollUtils.isEmpty(dtoList)) { |
| | | throw new ServiceException("计算公式不能为空"); |
| | | } |
| | | //删除原来的配置信息,重新添加新的 |
| | | tbBasicDataConfigDetailService.lambdaUpdate().eq(TbBasicDataConfigDetail::getBasicDataConfigId, tbBasicDataConfig.getId()).remove(); |
| | | List<TbBasicDataConfigDetail> details = BeanUtils.copyList(dtoList, TbBasicDataConfigDetail.class); |
| | | List<TbBasicDataConfigDetail> collect = details.stream().peek(item -> item.setBasicDataConfigId(tbBasicDataConfig.getId())).collect(Collectors.toList()); |
| | | tbBasicDataConfigDetailService.lambdaUpdate() |
| | | .eq(TbBasicDataConfigDetail::getBasicDataConfigId, tbBasicDataConfig.getId()) |
| | | .remove(); |
| | | List<TbBasicDataConfigDetail> details = BeanUtils.copyList(dtoList, |
| | | TbBasicDataConfigDetail.class); |
| | | List<TbBasicDataConfigDetail> collect = details.stream() |
| | | .peek(item -> item.setBasicDataConfigId(tbBasicDataConfig.getId())) |
| | | .collect(Collectors.toList()); |
| | | tbBasicDataConfigDetailService.saveBatch(collect); |
| | | } |
| | | this.updateById(tbBasicDataConfig); |
| | | } |
| | | |
| | | @Override |
| | | public BasicDataConfigDetailVO getDetails(Integer id) { |
| | | public BasicDataConfigDetailVO getDetails(Long id) { |
| | | TbBasicDataConfig config = this.getById(id); |
| | | if (Objects.isNull(config)) { |
| | | throw new ServiceException("非法参数"); |
| | | } |
| | | BasicDataConfigDetailVO vo = BeanUtils.copyBean(config, BasicDataConfigDetailVO.class); |
| | | Integer code = vo.getCalculateType().getCode(); |
| | | if ((CalculateTypeEnum.TEXT.getCode().equals(code) || CalculateTypeEnum.PERCENTAGE.getCode().equals(code))) { |
| | | List<TbBasicDataConfigDetail> list = tbBasicDataConfigDetailService.lambdaQuery().eq(TbBasicDataConfigDetail::getBasicDataConfigId, config.getId()).list(); |
| | | |
| | | CalculateTypeEnum type = vo.getCalculateType(); |
| | | if (CalculateTypeEnum.NUMBER.equals(type)) { |
| | | List<CalculateItemDTO> calculateItemDTOS = JSONArray.parseArray( |
| | | config.getNumberCalculateFormula(), |
| | | CalculateItemDTO.class); |
| | | vo.setCalculateItemList(calculateItemDTOS); |
| | | } |
| | | if ((CalculateTypeEnum.TEXT.equals(type) || CalculateTypeEnum.PERCENTAGE.equals(type))) { |
| | | List<TbBasicDataConfigDetail> list = tbBasicDataConfigDetailService.lambdaQuery() |
| | | .eq(TbBasicDataConfigDetail::getBasicDataConfigId, config.getId()).list(); |
| | | List<CalculateVO> calculateVOS = BeanUtils.copyList(list, CalculateVO.class); |
| | | vo.setDtoList(calculateVOS); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Integer id) { |
| | | public void delete(Long id) { |
| | | TbBasicDataConfig config = this.getById(id); |
| | | if (Objects.isNull(config)) { |
| | | throw new ServiceException("非法参数"); |
| | |
| | | |
| | | @Override |
| | | public PageDTO<BasicDataConfigVO> queryPage(BasicDataConfigQuery query) { |
| | | Page<TbBasicDataConfig> page = this.lambdaQuery() |
| | | .like(StringUtils.isNotBlank(query.getBasicDataConfigName()), TbBasicDataConfig::getTypeName, query.getBasicDataConfigName()) |
| | | .eq(Objects.nonNull(query.getCalculateType()), TbBasicDataConfig::getCalculateType, query.getCalculateType()) |
| | | .eq(Objects.nonNull(query.getStatus()), TbBasicDataConfig::getStatus, query.getStatus()).page(new Page<>(query.getPageNum(), query.getPageSize())); |
| | | return PageDTO.of(page, BasicDataConfigVO.class); |
| | | Page<Object> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | Page<BasicDataConfigVO> pageVO = this.queryPage( |
| | | new Page<>(query.getPageNum(), query.getPageSize()), query); |
| | | return PageDTO.of(pageVO); |
| | | } |
| | | |
| | | @Override |
| | |
| | | //查询改配置所使用字段状态 |
| | | String fieldIdStr = config.getFieldIdStr(); |
| | | String[] split = fieldIdStr.split(","); |
| | | List<TbField> list = fieldMapper.selectList(Wrappers.<TbField>lambdaQuery().in(TbField::getId, Arrays.asList(split)).eq(TbField::getStatus, ShowStatusEnum.HIDE)); |
| | | List<TbField> list = fieldMapper.selectList( |
| | | Wrappers.<TbField>lambdaQuery().in(TbField::getId, Arrays.asList(split)) |
| | | .eq(TbField::getStatus, ShowStatusEnum.HIDE)); |
| | | if (CollUtils.isNotEmpty(list)) { |
| | | String fieldNames = list.stream().map(TbField::getFieldName).collect(Collectors.joining(",")); |
| | | throw new ServiceException(String.format("字段“%s”已被隐藏,请重新配置后再次操作!", fieldNames)); |
| | | String fieldNames = list.stream().map(TbField::getFieldName) |
| | | .collect(Collectors.joining(",")); |
| | | throw new ServiceException( |
| | | String.format("字段“%s”已被隐藏,请重新配置后再次操作!", fieldNames)); |
| | | } |
| | | } |
| | | this.lambdaUpdate().set(TbBasicDataConfig::getStatus, dto.getStatus()).eq(TbBasicDataConfig::getId, dto.getId()).update(); |
| | | this.lambdaUpdate().set(TbBasicDataConfig::getStatus, dto.getStatus()) |
| | | .eq(TbBasicDataConfig::getId, dto.getId()).update(); |
| | | } |
| | | |
| | | @Override |
| | | public Page<ScoreCalculateVO> scoreCalculatePage(ScoreCalculateQuery query, Page<ScoreCalculateVO> page) { |
| | | public Page<ScoreCalculateVO> scoreCalculatePage(ScoreCalculateQuery query, |
| | | Page<ScoreCalculateVO> page) { |
| | | return baseMapper.scoreCalculatePage(query, page); |
| | | } |
| | | |
| | | @Override |
| | | public Page<BasicDataConfigVO> queryPage(Page<BasicDataConfigVO> page, |
| | | BasicDataConfigQuery query) { |
| | | return baseMapper.queryPage(page, query); |
| | | } |
| | | } |
| | |
| | | if (quarterLocalDate.isAfter(dateLocalDate) || quarterLocalDate.equals(dateLocalDate)) { |
| | | throw new ServiceException("请导入过去季度的数据。"); |
| | | } |
| | | |
| | | EasyExcel.read( |
| | | file.getInputStream(), |
| | | new HistoryDataListener( |
| | |
| | | import com.ruoyi.system.service.TbDataScreenConfigService; |
| | | import com.ruoyi.system.vo.DataScreenConfigVO; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | TbDataScreenConfig tbDataScreenConfig = this.lambdaQuery() |
| | | .eq(TbDataScreenConfig::getType, DataScreenConfigEnum.RISK_LEVEL) |
| | | .one(); |
| | | return BeanUtils.copyBean(tbDataScreenConfig, DataScreenConfigVO.class); |
| | | return Objects.nonNull(tbDataScreenConfig) ? BeanUtils.copyBean(tbDataScreenConfig, |
| | | DataScreenConfigVO.class) : new DataScreenConfigVO(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public DataScreenConfigVO editRiskLevel(RiskLevelUpdDTO dto) { |
| | | TbDataScreenConfig tbDataScreenConfig = BeanUtils.copyBean(dto, |
| | | TbDataScreenConfig.class); |
| | | //查询是否有该指标配置 |
| | | TbDataScreenConfig tbDataScreenConfig = this.lambdaQuery() |
| | | .eq(TbDataScreenConfig::getType, DataScreenConfigEnum.RISK_LEVEL) |
| | | .oneOpt().orElseGet(() -> BeanUtils.copyBean(dto, |
| | | TbDataScreenConfig.class)); |
| | | tbDataScreenConfig.setType(DataScreenConfigEnum.RISK_LEVEL); |
| | | this.saveOrUpdate(tbDataScreenConfig); |
| | | return BeanUtils.copyBean(tbDataScreenConfig, DataScreenConfigVO.class); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public DataScreenConfigVO editDataIndicatorsConfig(DataIndicatorsUpdDTO dto) { |
| | | TbDataScreenConfig tbDataScreenConfig = BeanUtils.copyBean(dto, |
| | | TbDataScreenConfig.class); |
| | | //查询是否有该指标配置 |
| | | TbDataScreenConfig tbDataScreenConfig = this.lambdaQuery() |
| | | .eq(TbDataScreenConfig::getType, DataScreenConfigEnum.DATA_INDICATORS) |
| | | .eq(TbDataScreenConfig::getSubType, |
| | | dto.getSubType()).oneOpt().orElseGet(() -> BeanUtils.copyBean(dto, |
| | | TbDataScreenConfig.class)); |
| | | tbDataScreenConfig.setType(DataScreenConfigEnum.DATA_INDICATORS); |
| | | this.saveOrUpdate(tbDataScreenConfig); |
| | | return BeanUtils.copyBean(tbDataScreenConfig, DataScreenConfigVO.class); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public DataScreenConfigVO editFormalIndicatorsConfig(FormalIndicatorsUpdDTO dto) { |
| | | TbDataScreenConfig tbDataScreenConfig = BeanUtils.copyBean(dto, |
| | | TbDataScreenConfig.class); |
| | | //查询是否有该指标配置 |
| | | TbDataScreenConfig tbDataScreenConfig = this.lambdaQuery() |
| | | .eq(TbDataScreenConfig::getType, DataScreenConfigEnum.FORMAL_INDICATORS) |
| | | .eq(TbDataScreenConfig::getSubType, |
| | | dto.getSubType()).oneOpt().orElseGet(() -> BeanUtils.copyBean(dto, |
| | | TbDataScreenConfig.class)); |
| | | tbDataScreenConfig.setType(DataScreenConfigEnum.FORMAL_INDICATORS); |
| | | this.saveOrUpdate(tbDataScreenConfig); |
| | | return BeanUtils.copyBean(tbDataScreenConfig, DataScreenConfigVO.class); |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | |
| | | if (CollUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | List<TbField> collect = page.getRecords().stream().peek(item -> { |
| | | if (StringUtils.isBlank(item.getLevelTwoCategory())) { |
| | | item.setLevelTwoCategory("无"); |
| | | item.setLevelThreeCategory("无"); |
| | | } else { |
| | | item.setLevelThreeCategory("无"); |
| | | } |
| | | }).collect(Collectors.toList()); |
| | | page.setRecords(collect); |
| | | return PageDTO.of(page, FieldVO.class); |
| | | } |
| | | |
| | | @Override |
| | | public PageDTO<FieldVO> queryShowPage(FieldQuery query) { |
| | | Page<TbField> page = this.lambdaQuery() |
| | | .select(TbField::getId, TbField::getFieldName, TbField::getLevelOneCategory, |
| | | TbField::getLevelTwoCategory, TbField::getLevelThreeCategory) |
| | | .like(StringUtils.isNotEmpty(query.getFieldName()), TbField::getFieldName, |
| | | query.getFieldName()) |
| | | .like(StringUtils.isNotEmpty(query.getLevelOneCategory()), |
| | | TbField::getLevelOneCategory, query.getLevelOneCategory()) |
| | | .like(StringUtils.isNotEmpty(query.getLevelTwoCategory()), |
| | | TbField::getLevelTwoCategory, query.getLevelTwoCategory()) |
| | | .like(StringUtils.isNotEmpty(query.getLevelThreeCategory()), |
| | | TbField::getLevelThreeCategory, query.getLevelThreeCategory()) |
| | | .eq(TbField::getStatus, ShowStatusEnum.SHOW) |
| | | .eq(StringUtils.isNotNull(query.getFieldType()), TbField::getFieldType, |
| | | query.getFieldType()) |
| | | .orderByDesc(TbField::getCreateTime) |
| | | .page(new Page<>(query.getPageNum(), query.getPageSize())); |
| | | if (CollUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | List<TbField> collect = page.getRecords().stream().peek(item -> { |
| | | if (StringUtils.isBlank(item.getLevelTwoCategory())) { |
| | | item.setLevelTwoCategory("无"); |
| | | item.setLevelThreeCategory("无"); |
| | | } else { |
| | | item.setLevelThreeCategory("无"); |
| | | } |
| | | }).collect(Collectors.toList()); |
| | | page.setRecords(collect); |
| | | return PageDTO.of(page, FieldVO.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<FieldVO> listFields() { |
| | | List<TbField> list = this.list( |
| | | Wrappers.<TbField>lambdaQuery().eq(TbField::getStatus, ShowStatusEnum.SHOW)); |
| | | return BeanUtils.copyList(list, FieldVO.class); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void update(FieldUpdateDTO dto) { |
| | | public void editField(FieldUpdateDTO dto) { |
| | | TbField field = this.getById(dto.getId()); |
| | | if (Objects.isNull(field)) { |
| | | throw new ServiceException("参数异常"); |
| | |
| | | .eq(StringUtils.isNotBlank(dto.getQuarter()), TbQuestion::getQuarter, |
| | | dto.getQuarter()) |
| | | .like(StringUtils.isNotBlank(dto.getTitle()), TbQuestion::getTitle, dto.getTitle()) |
| | | .orderByDesc(TbQuestion::getCreateTime) |
| | | .page(new Page<>(dto.getPageNum(), dto.getPageSize())); |
| | | return PageDTO.of(page, QuestionVO.class); |
| | | } |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.common.enums.CalculateTypeEnum; |
| | | import com.ruoyi.system.dto.CalculateItemDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/18 |
| | | */ |
| | | @Data |
| | | @ApiModel(value="基础数据配置详情视图对象") |
| | | @ApiModel(value = "基础数据配置详情视图对象") |
| | | public class BasicDataConfigDetailVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 8789005070048058207L; |
| | |
| | | @NotBlank(message = "字段id不能为空") |
| | | private String fieldIdStr; |
| | | |
| | | @ApiModelProperty(value = "计算公式",notes = "计算类型为数字计算,配置内容使用该字段接收;公式中字段的格式为:field_字段id,e.g:field_1,field_2等。") |
| | | private String numberCalculateFormula; |
| | | @ApiModelProperty(value = "计算公式") |
| | | private List<CalculateItemDTO> CalculateItemList; |
| | | |
| | | @ApiModelProperty(value = "文本和百分比配置信息", notes = "当计算方式为 文本统计/百分比统计 " + |
| | | "配置内容使用这个字段接收;key为键,value为得分;百分比统计 将百分比区间使用'_'拼接作为key,e.g: 10_20,20_30") |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.common.enums.FieldInputTypeEnum; |
| | | import com.ruoyi.common.enums.FieldTypeEnum; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value="数据上报字段视图对象") |
| | | @ApiModel(value = "数据上报字段视图对象") |
| | | public class FieldReportingVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -7412686975187928384L; |
| | |
| | | private Integer numMax; |
| | | |
| | | @ApiModelProperty(value = "文本输入类型(1=手动输入 2=固定内容)") |
| | | private Integer textInputType; |
| | | private FieldInputTypeEnum textInputType; |
| | | |
| | | @ApiModelProperty(value = "文本最少字数") |
| | | private Integer textMinNum; |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.common.enums.FieldInputTypeEnum; |
| | | import com.ruoyi.common.enums.FieldTypeEnum; |
| | | import com.ruoyi.common.enums.ShowStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/15 |
| | | */ |
| | | @Data |
| | | @ApiModel(value="字段视图对象") |
| | | @ApiModel(value = "字段视图对象") |
| | | public class FieldVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -8474307057802966503L; |
| | |
| | | private Integer numMax; |
| | | |
| | | @ApiModelProperty(value = "文本输入类型(1=手动输入 2=固定内容)") |
| | | private Integer textInputType; |
| | | private FieldInputTypeEnum textInputType; |
| | | |
| | | @ApiModelProperty(value = "文本最少字数") |
| | | private Integer textMinNum; |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class RoleInfoVO { |
| | | |
| | | @ApiModelProperty(value = "角色id") |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value = "角色名称") |
| | | private String roleName; |
| | | |
| | | @ApiModelProperty("菜单id") |
| | | private List<Long> menus; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | } |
| | |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="removeDays" column="removeDays"/> |
| | | <result property="postType" column="postType"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectRoleVo"> |
| | |
| | | r.status, |
| | | r.del_flag, |
| | | r.create_time, |
| | | r.remark, |
| | | r.postType, |
| | | r.removeDays |
| | | r.remark |
| | | from sys_role r |
| | | left join sys_user_role ur on ur.role_id = r.role_id |
| | | left join sys_user u on u.user_id = ur.user_id |
| | |
| | | AND del_flag = 0 |
| | | </where> |
| | | </select> |
| | | <select id="selectList" resultType="com.ruoyi.common.core.domain.entity.SysRole"> |
| | | <select id="selectList" resultType="com.ruoyi.system.vo.RoleInfoVO"> |
| | | select role_id AS roleId, role_name AS roleName, role_key AS roleKey, role_sort AS roleSort, |
| | | data_scope AS dataScope, |
| | | menu_check_strictly AS menuCheckStrictly, dept_check_strictly AS deptCheckStrictly,status AS |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.TbBasicDataConfigMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.TbBasicDataConfig"> |
| | | <id column="id" property="id"/> |
| | | <result column="basic_data_category_id" property="basicDataCategoryId"/> |
| | | <result column="type_name" property="typeName"/> |
| | | <result column="field_description" property="fieldDescription"/> |
| | | <result column="calculate_type" property="calculateType"/> |
| | | <result column="number_calculate_formula" property="numberCalculateFormula"/> |
| | | <result column="field_id_str" property="fieldIdStr"/> |
| | | <result column="status" property="status"/> |
| | | <result column="del_flag" property="delFlag"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.TbBasicDataConfig"> |
| | | <id column="id" property="id"/> |
| | | <result column="basic_data_category_id" property="basicDataCategoryId"/> |
| | | <result column="type_name" property="typeName"/> |
| | | <result column="field_description" property="fieldDescription"/> |
| | | <result column="calculate_type" property="calculateType"/> |
| | | <result column="number_calculate_formula" property="numberCalculateFormula"/> |
| | | <result column="field_id_str" property="fieldIdStr"/> |
| | | <result column="status" property="status"/> |
| | | <result column="del_flag" property="delFlag"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, basic_data_category_id, type_name, field_description, calculate_type, number_calculate_formula, field_id_str, status, del_flag, create_by, create_time, update_by, update_time |
| | | </sql> |
| | | <select id="scoreCalculatePage" resultType="com.ruoyi.system.vo.ScoreCalculateVO"> |
| | | SELECT tdc.id, |
| | | tdc.type_name, |
| | | tdc.calculate_type |
| | | FROM tb_score ts |
| | | LEFT JOIN tb_basic_data tbd ON ts.basic_data_id = tbd.id |
| | | LEFT JOIN tb_basic_data_config tdc ON ts.basic_data_config_id = tdc.id |
| | | <where> |
| | | tbd.`quarter` = #{query.quarter} |
| | | <if test="query.typeName !=null and query.typeName != ''"> |
| | | AND tdc.type_name LIKE CONCAT('%',#{query.typeName},'%') |
| | | </if> |
| | | <if test="query.type !=null"> |
| | | AND tdc.calculate_type LIKE CONCAT('%',#{query.type},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY tdc.type_name |
| | | </select> |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, basic_data_category_id, type_name, field_description, calculate_type, number_calculate_formula, field_id_str, status, del_flag, create_by, create_time, update_by, update_time |
| | | </sql> |
| | | <select id="scoreCalculatePage" resultType="com.ruoyi.system.vo.ScoreCalculateVO"> |
| | | SELECT tdc.id, |
| | | tdc.type_name, |
| | | tdc.calculate_type |
| | | FROM tb_score ts |
| | | LEFT JOIN tb_basic_data tbd ON ts.basic_data_id = tbd.id |
| | | LEFT JOIN tb_basic_data_config tdc ON ts.basic_data_config_id = tdc.id |
| | | <where> |
| | | tbd.`quarter` = #{query.quarter} |
| | | <if test="query.typeName !=null and query.typeName != ''"> |
| | | AND tdc.type_name LIKE CONCAT('%',#{query.typeName},'%') |
| | | </if> |
| | | <if test="query.type !=null"> |
| | | AND tdc.calculate_type LIKE CONCAT('%',#{query.type},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY tdc.type_name |
| | | </select> |
| | | <select id="queryPage" resultType="com.ruoyi.system.vo.BasicDataConfigVO"> |
| | | SELECT tbdc.id,tbdc.type_name,tbdc.calculate_type,tbdc.status,tbdc2.basic_data_category_name AS |
| | | basicDataCategory |
| | | FROM tb_basic_data_config tbdc |
| | | LEFT JOIN tb_basic_data_category tbdc2 ON tbdc.basic_data_category_id = tbdc2.id |
| | | <where> |
| | | <if test="query.basicDataConfigName != null and query.basicDataConfigName !=''"> |
| | | AND bdc.type_name LIKE CONCAT('%',#{query.basicDataConfigName},'%') |
| | | </if> |
| | | <if test="query.status !=null"> |
| | | AND bdc.status = #{query.status} |
| | | </if> |
| | | <if test="query.calculateType !=null"> |
| | | AND bdc.calculate_type = #{query.calculateType} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |