26 文件已重命名
577个文件已删除
577个文件已添加
2个文件已修改
| | |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi</artifactId> |
| | | <groupId>com.finance</groupId> |
| | | <artifactId>finance</artifactId> |
| | | <version>3.8.6</version> |
| | | </parent> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <groupId>com.finance</groupId> |
| | | <artifactId>finance</artifactId> |
| | | <version>3.8.6</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <packaging>jar</packaging> |
| | | <artifactId>finance-admin-dept</artifactId> |
| | | |
| | | <description> |
| | | 部门管理后台服务 |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | |
| | | <!-- spring-boot-devtools --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <optional>true</optional> <!-- 表示依赖不会传递 --> |
| | | </dependency> |
| | | |
| | | <!-- swagger3--> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.xiaoymin</groupId>--> |
| | | <!-- <artifactId>swagger-bootstrap-ui</artifactId>--> |
| | | <!-- <version>1.9.6</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | |
| | | <!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 --> |
| | | <dependency> |
| | | <groupId>io.swagger</groupId> |
| | | <artifactId>swagger-models</artifactId> |
| | | <version>1.6.2</version> |
| | | </dependency> |
| | | |
| | | <!-- Mysql驱动包 --> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 核心模块--> |
| | | <dependency> |
| | | <groupId>com.finance</groupId> |
| | | <artifactId>finance-framework</artifactId> |
| | | <!-- <exclusions>--> |
| | | <!-- <exclusion>--> |
| | | <!-- <groupId>com.github.pagehelper</groupId>--> |
| | | <!-- <artifactId>pagehelper-spring-boot-starter</artifactId>--> |
| | | <!-- </exclusion>--> |
| | | <!-- </exclusions>--> |
| | | </dependency> |
| | | |
| | | <!-- 定时任务--> |
| | | <dependency> |
| | | <groupId>com.finance</groupId> |
| | | <artifactId>finance-quartz</artifactId> |
| | | <!-- <exclusions>--> |
| | | <!-- <exclusion>--> |
| | | <!-- <groupId>com.github.pagehelper</groupId>--> |
| | | <!-- <artifactId>pagehelper-spring-boot-starter</artifactId>--> |
| | | <!-- </exclusion>--> |
| | | <!-- </exclusions>--> |
| | | </dependency> |
| | | |
| | | <!-- 代码生成--> |
| | | <dependency> |
| | | <groupId>com.finance</groupId> |
| | | <artifactId>finance-generator</artifactId> |
| | | <!-- <exclusions>--> |
| | | <!-- <exclusion>--> |
| | | <!-- <groupId>com.github.pagehelper</groupId>--> |
| | | <!-- <artifactId>pagehelper-spring-boot-starter</artifactId>--> |
| | | <!-- </exclusion>--> |
| | | <!-- </exclusions>--> |
| | | </dependency> |
| | | <!-- oos对象存储 --> |
| | | <dependency> |
| | | <groupId>com.aliyun</groupId> |
| | | <artifactId>oss20190517</artifactId> |
| | | <version>1.0.6</version> |
| | | </dependency> |
| | | <!-- Aliyun OSS SDK --> |
| | | <dependency> |
| | | <groupId>com.aliyun.oss</groupId> |
| | | <artifactId>aliyun-sdk-oss</artifactId> |
| | | <version>3.14.0</version> |
| | | </dependency> |
| | | <!--二维码开发工具集--> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- zxing生成二维码 --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>3.3.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>3.3.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-test</artifactId> |
| | | <version>5.1.3.RELEASE</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.apache.httpcomponents</groupId>--> |
| | | <!-- <artifactId>httpcore</artifactId>--> |
| | | <!-- <version>4.3.2</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>com.squareup.okhttp3</groupId> |
| | | <artifactId>okhttp</artifactId> |
| | | <version>4.9.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.78</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.aliyun</groupId> |
| | | <artifactId>dysmsapi20170525</artifactId> |
| | | <version>2.0.10</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>2.5.15</version> |
| | | <configuration> |
| | | <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 --> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-war-plugin</artifactId> |
| | | <version>3.1.0</version> |
| | | <configuration> |
| | | <failOnMissingWebXml>false</failOnMissingWebXml> |
| | | <warName>${project.artifactId}</warName> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | <finalName>${project.artifactId}</finalName> |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.finance; |
| | | |
| | | import java.net.InetAddress; |
| | | import java.net.UnknownHostException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.http.client.SimpleClientHttpRequestFactory; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 启动程序 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Slf4j |
| | | @EnableScheduling//开启定时任务 |
| | | @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) |
| | | public class FinanceAdminDeptApplication { |
| | | |
| | | public static void main(String[] args) throws UnknownHostException { |
| | | ConfigurableApplicationContext application = SpringApplication.run( |
| | | FinanceAdminDeptApplication.class, args); |
| | | Environment env = application.getEnvironment(); |
| | | log.info("\n----------------------------------------------------------\n\t" + |
| | | "应用 '{}' 运行成功! 访问连接:\n\t" + |
| | | "Swagger文档: \t\thttp://{}:{}/doc.html\n" + |
| | | "----------------------------------------------------------" , |
| | | env.getProperty("spring.application.name" , "后台"), |
| | | InetAddress.getLocalHost().getHostAddress(), |
| | | env.getProperty("server.port" , "8081")); |
| | | } |
| | | |
| | | /** |
| | | * 当不存在此 wxRestTemplate 使用此方法的bean注入 |
| | | * |
| | | * @return |
| | | */ |
| | | @Bean |
| | | @ConditionalOnMissingBean(name = "restTemplate") |
| | | public RestTemplate wxRestTemplate() { |
| | | //复杂构造函数的使用 |
| | | SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); |
| | | // 设置超时 |
| | | requestFactory.setConnectTimeout(6000); |
| | | requestFactory.setReadTimeout(6000); |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | restTemplate.setRequestFactory(requestFactory); |
| | | return restTemplate; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance; |
| | | |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | |
| | | /** |
| | | * web容器中进行部署 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FinanceServletInitializer extends SpringBootServletInitializer { |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { |
| | | return application.sources(FinanceAdminDeptApplication.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | import com.finance.common.annotation.FinancialLog; |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.system.dto.BasicDataDTO; |
| | | import com.finance.system.query.ScoreQuery; |
| | | import com.finance.system.service.TbBasicDataService; |
| | | import com.finance.system.service.TbFieldService; |
| | | import com.finance.system.vo.BasicDataReportingVO; |
| | | import com.finance.system.vo.ScoreVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestPart; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/19 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/current-quarter-dept") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "当前季度数据相关接口") |
| | | public class CurrentQuarterController { |
| | | |
| | | private final TbBasicDataService tbBasicDataService; |
| | | private final TbFieldService tbFieldService; |
| | | |
| | | /** |
| | | * 获取基础数据填报相关信息 |
| | | * |
| | | * @return R<BasicDataReportingVO> |
| | | */ |
| | | @ApiOperation("获取基础数据填报相关信息") |
| | | @GetMapping("/basic-fields") |
| | | public R<BasicDataReportingVO> getBasicFields() { |
| | | try { |
| | | return tbBasicDataService.getBasicFields(); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取基础数据填报相关信息异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存当前季度数据 |
| | | * |
| | | * @param dto 当前季度基础数据数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("/save-basic-data") |
| | | @ApiOperation("保存当前季度数据") |
| | | public R<Void> saveBasicData(@RequestBody BasicDataDTO dto) { |
| | | try { |
| | | tbBasicDataService.saveBasicData(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("保存当前季度数据异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 导入模板下载 |
| | | */ |
| | | @FinancialLog(title = "下载导入模板", businessType = BusinessType.OTHER) |
| | | @GetMapping("/download") |
| | | @ApiOperation("模板下载") |
| | | public void downloadImportTemplate() { |
| | | try { |
| | | tbFieldService.downloadImportTemplate(); |
| | | } catch (Exception e) { |
| | | log.error("模板下载异常", e); |
| | | throw new ServiceException("模板下载失败,请联系管理员!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 基础数据导入 |
| | | * |
| | | * @param file file |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("/import") |
| | | @ApiOperation("基础数据导入") |
| | | @FinancialLog(title = "导入数据", businessType = BusinessType.IMPORT) |
| | | public R<Void> importBasicData(@RequestPart("file") MultipartFile file) { |
| | | try { |
| | | tbBasicDataService.importBasicData(file); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("基础数据导入异常", e); |
| | | return R.fail("基础数据导入失败,请联系管理员!"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 得分计算分页查询 |
| | | * |
| | | * @param query 得分计算条件查询对象 |
| | | * @return R<PageDTO < ScoreVO>> |
| | | */ |
| | | @PostMapping("/page-score") |
| | | @ApiOperation("得分计算分页查询") |
| | | public R<PageDTO<ScoreVO>> pageScore(@Validated @RequestBody ScoreQuery query) { |
| | | try { |
| | | return R.ok(tbBasicDataService.pageScore(query)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("查询得分计算异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.enums.ReportingStatusEnum; |
| | | import com.finance.common.utils.SecurityUtils; |
| | | import com.finance.system.domain.TbBasicData; |
| | | import com.finance.system.query.HistoryDataQuery; |
| | | import com.finance.system.query.HistoryScoreQuery; |
| | | import com.finance.system.service.TbBasicDataService; |
| | | import com.finance.system.service.TbFieldService; |
| | | import com.finance.system.service.TbScoreService; |
| | | import com.finance.system.vo.BasicDataFieldVO; |
| | | import com.finance.system.vo.BasicDataVO; |
| | | import com.finance.system.vo.ScoreVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.Objects; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.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; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/4/1 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/history-data-dept") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "历史数据相关接口") |
| | | public class HistoryDataController { |
| | | |
| | | private final TbBasicDataService tbBasicDataService; |
| | | private final TbFieldService tbFieldService; |
| | | private final TbScoreService tbScoreService; |
| | | |
| | | /** |
| | | * 历史数据分页查询 |
| | | * |
| | | * @param dto 历史数据查询传输对象 |
| | | * @return R<PageDTO < BasicDataVO>> |
| | | */ |
| | | @PostMapping("/list") |
| | | @ApiOperation("历史数据分页查询") |
| | | public R<PageDTO<BasicDataVO>> list(@Validated @RequestBody HistoryDataQuery dto) { |
| | | String areaCode = SecurityUtils.getLoginUser().getUser().getAreaCode(); |
| | | Page<TbBasicData> page = tbBasicDataService.lambdaQuery() |
| | | .eq(TbBasicData::getDeptAreaCode, areaCode) |
| | | .eq(TbBasicData::getStatus, ReportingStatusEnum.FILLED) |
| | | .between(Objects.nonNull(dto.getStartTime()) && Objects.nonNull(dto.getEndTime()), |
| | | TbBasicData::getReportingTime, dto.getStartTime(), dto.getEndTime()) |
| | | .page(new Page<>(dto.getPageNum(), dto.getPageSize())); |
| | | return R.ok(PageDTO.of(page, BasicDataVO.class)); |
| | | } |
| | | |
| | | /** |
| | | * 字段查看 |
| | | * |
| | | * @param id 基础数据id |
| | | * @return R<BasicDataFieldVO> |
| | | */ |
| | | @GetMapping("/fields") |
| | | @ApiOperation("字段查看") |
| | | @ApiImplicitParam(name = "id", value = "基础数据id", required = true, dataType = "int", paramType = "query", dataTypeClass = Long.class) |
| | | public R<BasicDataFieldVO> getHistoryFields(@RequestParam("id") Long id) { |
| | | return R.ok(tbFieldService.getHistoryFields(id)); |
| | | } |
| | | |
| | | /** |
| | | * 得分计算 |
| | | * |
| | | * @param query 得分计算条件查询对象 |
| | | * @return R<PageDTO < ScoreVO>> |
| | | */ |
| | | @PostMapping("/score") |
| | | @ApiOperation("得分计算") |
| | | public R<PageDTO<ScoreVO>> getHistoryScore(@RequestBody HistoryScoreQuery query) { |
| | | return R.ok(tbScoreService.getHistoryScore(query)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.common; |
| | | |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.util.concurrent.TimeUnit; |
| | | import javax.annotation.Resource; |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.FastByteArrayOutputStream; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.google.code.kaptcha.Producer; |
| | | import com.finance.common.config.RuoYiConfig; |
| | | import com.finance.common.constant.CacheConstants; |
| | | import com.finance.common.constant.Constants; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.redis.RedisCache; |
| | | import com.finance.common.utils.sign.Base64; |
| | | import com.finance.common.utils.uuid.IdUtils; |
| | | import com.finance.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 验证码操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class CaptchaController |
| | | { |
| | | @Resource(name = "captchaProducer") |
| | | private Producer captchaProducer; |
| | | |
| | | @Resource(name = "captchaProducerMath") |
| | | private Producer captchaProducerMath; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | /** |
| | | * 生成验证码 |
| | | */ |
| | | @GetMapping("/captchaImage") |
| | | public AjaxResult getCode(HttpServletResponse response) throws IOException |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | boolean captchaEnabled = configService.selectCaptchaEnabled(); |
| | | ajax.put("captchaEnabled", captchaEnabled); |
| | | if (!captchaEnabled) |
| | | { |
| | | return ajax; |
| | | } |
| | | |
| | | // 保存验证码信息 |
| | | String uuid = IdUtils.simpleUUID(); |
| | | String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; |
| | | |
| | | String capStr = null, code = null; |
| | | BufferedImage image = null; |
| | | |
| | | // 生成验证码 |
| | | String captchaType = RuoYiConfig.getCaptchaType(); |
| | | if ("math".equals(captchaType)) |
| | | { |
| | | String capText = captchaProducerMath.createText(); |
| | | capStr = capText.substring(0, capText.lastIndexOf("@")); |
| | | code = capText.substring(capText.lastIndexOf("@") + 1); |
| | | image = captchaProducerMath.createImage(capStr); |
| | | } |
| | | else if ("char".equals(captchaType)) |
| | | { |
| | | capStr = code = captchaProducer.createText(); |
| | | image = captchaProducer.createImage(capStr); |
| | | } |
| | | |
| | | redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES); |
| | | // 转换流信息写出 |
| | | FastByteArrayOutputStream os = new FastByteArrayOutputStream(); |
| | | try |
| | | { |
| | | ImageIO.write(image, "jpg", os); |
| | | } |
| | | catch (IOException e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | |
| | | ajax.put("uuid", uuid); |
| | | ajax.put("img", Base64.encode(os.toByteArray())); |
| | | return ajax; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.common; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.finance.common.config.RuoYiConfig; |
| | | import com.finance.common.constant.Constants; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.common.utils.file.FileUploadUtils; |
| | | import com.finance.common.utils.file.FileUtils; |
| | | import com.finance.framework.config.ServerConfig; |
| | | |
| | | /** |
| | | * 通用请求处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/common") |
| | | public class CommonController |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(CommonController.class); |
| | | |
| | | @Autowired |
| | | private ServerConfig serverConfig; |
| | | |
| | | private static final String FILE_DELIMETER = ","; |
| | | |
| | | /** |
| | | * 通用下载请求 |
| | | * |
| | | * @param fileName 文件名称 |
| | | * @param delete 是否删除 |
| | | */ |
| | | @GetMapping("/download") |
| | | public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) |
| | | { |
| | | try |
| | | { |
| | | if (!FileUtils.checkAllowDownload(fileName)) |
| | | { |
| | | throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); |
| | | } |
| | | String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); |
| | | String filePath = RuoYiConfig.getDownloadPath() + fileName; |
| | | |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, realFileName); |
| | | FileUtils.writeBytes(filePath, response.getOutputStream()); |
| | | if (delete) |
| | | { |
| | | FileUtils.deleteFile(filePath); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("下载文件失败", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通用上传请求(单个) |
| | | */ |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file) throws Exception |
| | | { |
| | | try |
| | | { |
| | | // 上传文件路径 |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | // 上传并返回新文件名称 |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("url", url); |
| | | ajax.put("fileName", fileName); |
| | | ajax.put("newFileName", FileUtils.getName(fileName)); |
| | | ajax.put("originalFilename", file.getOriginalFilename()); |
| | | return ajax; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通用上传请求(多个) |
| | | */ |
| | | @PostMapping("/uploads") |
| | | public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception |
| | | { |
| | | try |
| | | { |
| | | // 上传文件路径 |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | List<String> urls = new ArrayList<String>(); |
| | | List<String> fileNames = new ArrayList<String>(); |
| | | List<String> newFileNames = new ArrayList<String>(); |
| | | List<String> originalFilenames = new ArrayList<String>(); |
| | | for (MultipartFile file : files) |
| | | { |
| | | // 上传并返回新文件名称 |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | urls.add(url); |
| | | fileNames.add(fileName); |
| | | newFileNames.add(FileUtils.getName(fileName)); |
| | | originalFilenames.add(file.getOriginalFilename()); |
| | | } |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); |
| | | ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | return ajax; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 本地资源通用下载 |
| | | */ |
| | | @GetMapping("/download/resource") |
| | | public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) |
| | | throws Exception |
| | | { |
| | | try |
| | | { |
| | | if (!FileUtils.checkAllowDownload(resource)) |
| | | { |
| | | throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource)); |
| | | } |
| | | // 本地资源路径 |
| | | String localPath = RuoYiConfig.getProfile(); |
| | | // 数据库资源地址 |
| | | String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX); |
| | | // 下载名称 |
| | | String downloadName = StringUtils.substringAfterLast(downloadPath, "/"); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, downloadName); |
| | | FileUtils.writeBytes(downloadPath, response.getOutputStream()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("下载文件失败", e); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.interceptor; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | public class MybatisConfiguration { |
| | | |
| | | /** |
| | | * 注册拦截器 |
| | | */ |
| | | @Bean |
| | | public MybatisInterceptor getMybatisInterceptor() { |
| | | return new MybatisInterceptor(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.interceptor; |
| | | |
| | | import com.finance.framework.web.service.TokenService; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Properties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.executor.Executor; |
| | | import org.apache.ibatis.mapping.MappedStatement; |
| | | import org.apache.ibatis.mapping.SqlCommandType; |
| | | import org.apache.ibatis.plugin.Interceptor; |
| | | import org.apache.ibatis.plugin.Intercepts; |
| | | import org.apache.ibatis.plugin.Invocation; |
| | | import org.apache.ibatis.plugin.Plugin; |
| | | import org.apache.ibatis.plugin.Signature; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @Intercepts({@Signature(type = Executor.class, method = "update" , args = {MappedStatement.class, |
| | | Object.class})}) |
| | | public class MybatisInterceptor implements Interceptor { |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Override |
| | | public Object intercept(Invocation invocation) throws Throwable { |
| | | MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0]; |
| | | log.debug("{}:" + mappedStatement); |
| | | log.debug("------sqlId------" + mappedStatement.getId()); |
| | | if ("com.finance.system.mapper.SysLogininforMapper.insertLogininfor".equals( |
| | | mappedStatement.getId())) { |
| | | return invocation.proceed(); |
| | | } |
| | | // sql类型:insert、update、select、delete |
| | | SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType(); |
| | | Object parameter = invocation.getArgs()[1]; |
| | | log.debug("------sqlCommandType------" + sqlCommandType); |
| | | |
| | | if (parameter == null) { |
| | | return invocation.proceed(); |
| | | } |
| | | |
| | | // 当sql为新增或更新类型时,自动填充操作人相关信息 |
| | | if (SqlCommandType.INSERT == sqlCommandType) { |
| | | |
| | | Field[] fields = getAllFields(parameter); |
| | | for (Field field : fields) { |
| | | try { |
| | | // 注入创建人 |
| | | /* if ("createBy".equals(field.getName())) { |
| | | // 获取当前登录用户信息 |
| | | if (Objects.nonNull(tokenService.getLoginUser())) { |
| | | String userName = tokenService.getLoginUser().getUser().getUserName(); |
| | | field.setAccessible(true); |
| | | field.set(parameter, userName); |
| | | field.setAccessible(false); |
| | | } |
| | | }*/ |
| | | //注入创建时间 |
| | | if ("createTime".equals(field.getName())) { |
| | | field.setAccessible(true); |
| | | field.set(parameter, new Date()); |
| | | field.setAccessible(false); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("failed to insert data, exception = " , e); |
| | | } |
| | | } |
| | | } |
| | | if (SqlCommandType.UPDATE == sqlCommandType) { |
| | | Field[] fields = getAllFields(parameter); |
| | | for (Field field : fields) { |
| | | try { |
| | | if ("updateBy".equals(field.getName())) { |
| | | // 获取当前登录用户信息 |
| | | if (Objects.nonNull(tokenService.getLoginUser())) { |
| | | String userName = tokenService.getLoginUser().getUser().getUserName(); |
| | | field.setAccessible(true); |
| | | field.set(parameter, userName); |
| | | field.setAccessible(false); |
| | | } |
| | | } |
| | | if ("updateTime".equals(field.getName())) { |
| | | field.setAccessible(true); |
| | | field.set(parameter, new Date()); |
| | | field.setAccessible(false); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("failed to update data, exception = " , e); |
| | | } |
| | | } |
| | | } |
| | | return invocation.proceed(); |
| | | } |
| | | |
| | | @Override |
| | | public Object plugin(Object target) { |
| | | return Plugin.wrap(target, this); |
| | | } |
| | | |
| | | @Override |
| | | public void setProperties(Properties properties) { |
| | | // TODO Auto-generated method stub |
| | | } |
| | | |
| | | /** |
| | | * 获取类的所有属性,包括父类 |
| | | * |
| | | * @param object |
| | | * @return |
| | | */ |
| | | private Field[] getAllFields(Object object) { |
| | | Class<?> clazz = object.getClass(); |
| | | List<Field> fieldList = new ArrayList<>(); |
| | | while (clazz != null) { |
| | | fieldList.addAll(new ArrayList<>(Arrays.asList(clazz.getDeclaredFields()))); |
| | | clazz = clazz.getSuperclass(); |
| | | } |
| | | Field[] fields = new Field[fieldList.size()]; |
| | | fieldList.toArray(fields); |
| | | return fields; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Properties; |
| | | import java.util.Set; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisCallback; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.constant.CacheConstants; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.system.domain.SysCache; |
| | | |
| | | /** |
| | | * 缓存监控 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/cache") |
| | | public class CacheController |
| | | { |
| | | @Autowired |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | |
| | | private final static List<SysCache> caches = new ArrayList<SysCache>(); |
| | | { |
| | | caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息")); |
| | | caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息")); |
| | | caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典")); |
| | | caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码")); |
| | | caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交")); |
| | | caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理")); |
| | | caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数")); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping() |
| | | public AjaxResult getInfo() throws Exception |
| | | { |
| | | Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info()); |
| | | Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats")); |
| | | Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize()); |
| | | |
| | | Map<String, Object> result = new HashMap<>(3); |
| | | result.put("info", info); |
| | | result.put("dbSize", dbSize); |
| | | |
| | | List<Map<String, String>> pieList = new ArrayList<>(); |
| | | commandStats.stringPropertyNames().forEach(key -> { |
| | | Map<String, String> data = new HashMap<>(2); |
| | | String property = commandStats.getProperty(key); |
| | | data.put("name", StringUtils.removeStart(key, "cmdstat_")); |
| | | data.put("value", StringUtils.substringBetween(property, "calls=", ",usec")); |
| | | pieList.add(data); |
| | | }); |
| | | result.put("commandStats", pieList); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getNames") |
| | | public AjaxResult cache() |
| | | { |
| | | return AjaxResult.success(caches); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getKeys/{cacheName}") |
| | | public AjaxResult getCacheKeys(@PathVariable String cacheName) |
| | | { |
| | | Set<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | return AjaxResult.success(cacheKeys); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getValue/{cacheName}/{cacheKey}") |
| | | public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) |
| | | { |
| | | String cacheValue = redisTemplate.opsForValue().get(cacheKey); |
| | | SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue); |
| | | return AjaxResult.success(sysCache); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheName/{cacheName}") |
| | | public AjaxResult clearCacheName(@PathVariable String cacheName) |
| | | { |
| | | Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | redisTemplate.delete(cacheKeys); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheKey/{cacheKey}") |
| | | public AjaxResult clearCacheKey(@PathVariable String cacheKey) |
| | | { |
| | | redisTemplate.delete(cacheKey); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheAll") |
| | | public AjaxResult clearCacheAll() |
| | | { |
| | | Collection<String> cacheKeys = redisTemplate.keys("*"); |
| | | redisTemplate.delete(cacheKeys); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.monitor; |
| | | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.framework.web.domain.Server; |
| | | |
| | | /** |
| | | * 服务器监控 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/server") |
| | | public class ServerController |
| | | { |
| | | @PreAuthorize("@ss.hasPermi('monitor:server:list')") |
| | | @GetMapping() |
| | | public AjaxResult getInfo() throws Exception |
| | | { |
| | | Server server = new Server(); |
| | | server.copyTo(); |
| | | return AjaxResult.success(server); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.monitor; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.poi.ExcelUtil; |
| | | import com.finance.framework.web.service.SysPasswordService; |
| | | import com.finance.system.domain.SysLogininfor; |
| | | import com.finance.system.service.ISysLogininforService; |
| | | |
| | | /** |
| | | * 系统访问记录 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/logininfor") |
| | | public class SysLogininforController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysLogininforService logininforService; |
| | | |
| | | @Autowired |
| | | private SysPasswordService passwordService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysLogininfor logininfor) |
| | | { |
| | | // startPage(); |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | // @Log(title = "登录日志", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysLogininfor logininfor) |
| | | // { |
| | | // List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | // ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); |
| | | // util.exportExcel(response, list, "登录日志"); |
| | | // } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "登录日志", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{infoIds}") |
| | | public AjaxResult remove(@PathVariable Long[] infoIds) |
| | | { |
| | | return toAjax(logininforService.deleteLogininforByIds(infoIds)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "登录日志", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() |
| | | { |
| | | logininforService.cleanLogininfor(); |
| | | return success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')") |
| | | @Log(title = "账户解锁", businessType = BusinessType.OTHER) |
| | | @GetMapping("/unlock/{userName}") |
| | | public AjaxResult unlock(@PathVariable("userName") String userName) |
| | | { |
| | | passwordService.clearLoginRecordCache(userName); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.monitor; |
| | | |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.system.service.ISysOperLogService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 操作日志记录 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "操作日志记录") |
| | | @RestController |
| | | @RequestMapping("/monitor/operlog") |
| | | public class SysOperlogController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysOperLogService operLogService; |
| | | |
| | | // @ApiOperation(value = "操作日志分页列表") |
| | | // @PostMapping("/list") |
| | | // public AjaxResult list(@RequestBody SysOperLogQuery query) |
| | | // { |
| | | // startPage(query.getPageNum(), query.getPageSize()); |
| | | // List<SysOperLogVO> list = operLogService.selectOperLogPageList(query); |
| | | // operLogService.getLogDetail(list); |
| | | // return AjaxResult.success(getDataTable(list)); |
| | | // } |
| | | |
| | | /** |
| | | * 查询操作日志列表导出 |
| | | */ |
| | | // @ApiOperation(value = "查询操作日志列表导出") |
| | | // @Log(title = "操作日志-查询操作日志列表导出", businessType = BusinessType.EXPORT) |
| | | // @PostMapping("/exportOperLog") |
| | | // public void exportOperLog(@RequestBody SysOperLogQuery query) |
| | | // { |
| | | // List<SysOperLogVO> list = operLogService.selectOperLogPageList(query); |
| | | // List<TOperLogExport> operLogExports = new ArrayList<>(); |
| | | // for (SysOperLogVO sysOperLogVO : list) { |
| | | // TOperLogExport operLogExport = new TOperLogExport(); |
| | | // BeanUtils.copyProperties(sysOperLogVO,operLogExport); |
| | | // operLogService.getLogDetail(list); |
| | | // operLogExports.add(operLogExport); |
| | | // } |
| | | // Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TOperLogExport.class, operLogExports); |
| | | // HttpServletResponse response = WebUtils.response(); |
| | | // response.setContentType("application/vnd.ms-excel"); |
| | | // response.setCharacterEncoding("utf-8"); |
| | | // ServletOutputStream outputStream = null; |
| | | // try { |
| | | // String fileName = URLEncoder.encode("操作日志信息.xls", "utf-8"); |
| | | // response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | // response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | // response.setHeader("Pragma", "no-cache"); |
| | | // response.setHeader("Cache-Control", "no-cache"); |
| | | // outputStream = response.getOutputStream(); |
| | | // workbook.write(outputStream); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // log.error("操作日志导出信息导出失败!"); |
| | | // } finally { |
| | | // try { |
| | | // outputStream.close(); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // @Log(title = "操作日志", businessType = BusinessType.EXPORT) |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysOperLog operLog) |
| | | // { |
| | | // List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | // ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class); |
| | | // util.exportExcel(response, list, "操作日志"); |
| | | // } |
| | | |
| | | @Log(title = "操作日志", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/deleteById/{operIds}") |
| | | public AjaxResult remove(@PathVariable String operIds) |
| | | { |
| | | String[] split = operIds.split(","); |
| | | List<Long> id = new ArrayList<>(); |
| | | for (String s : split) { |
| | | id.add(Long.valueOf(s)); |
| | | } |
| | | return AjaxResult.success(operLogService.deleteOperLogByIds(id)); |
| | | } |
| | | |
| | | @Log(title = "操作日志", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() |
| | | { |
| | | operLogService.cleanOperLog(); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.constant.CacheConstants; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.model.LoginUser; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.core.redis.RedisCache; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.system.domain.SysUserOnline; |
| | | import com.finance.system.service.ISysUserOnlineService; |
| | | |
| | | /** |
| | | * 在线用户监控 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/online") |
| | | public class SysUserOnlineController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysUserOnlineService userOnlineService; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(String ipaddr, String userName) |
| | | { |
| | | Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*"); |
| | | List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>(); |
| | | for (String key : keys) |
| | | { |
| | | LoginUser user = redisCache.getCacheObject(key); |
| | | if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(ipaddr)) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); |
| | | } |
| | | else |
| | | { |
| | | userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); |
| | | } |
| | | } |
| | | Collections.reverse(userOnlineList); |
| | | userOnlineList.removeAll(Collections.singleton(null)); |
| | | return getDataTable(userOnlineList); |
| | | } |
| | | |
| | | /** |
| | | * 强退用户 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')") |
| | | @Log(title = "在线用户", businessType = BusinessType.FORCE) |
| | | @DeleteMapping("/{tokenId}") |
| | | public AjaxResult forceLogout(@PathVariable String tokenId) |
| | | { |
| | | redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.poi.ExcelUtil; |
| | | import com.finance.system.domain.SysConfig; |
| | | import com.finance.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 参数配置 信息操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/config") |
| | | public class SysConfigController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | // @Log(title = "参数管理", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('system:config:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysConfig config) |
| | | // { |
| | | // List<SysConfig> list = configService.selectConfigList(config); |
| | | // ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); |
| | | // util.exportExcel(response, list, "参数数据"); |
| | | // } |
| | | |
| | | /** |
| | | * 根据参数编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:query')") |
| | | @GetMapping(value = "/{configId}") |
| | | public AjaxResult getInfo(@PathVariable Long configId) |
| | | { |
| | | return success(configService.selectConfigById(configId)); |
| | | } |
| | | |
| | | /** |
| | | * 根据参数键名查询参数值 |
| | | */ |
| | | @GetMapping(value = "/configKey/{configKey}") |
| | | public AjaxResult getConfigKey(@PathVariable String configKey) |
| | | { |
| | | return success(configService.selectConfigByKey(configKey)); |
| | | } |
| | | |
| | | /** |
| | | * 新增参数配置 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:add')") |
| | | @Log(title = "参数管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysConfig config) |
| | | { |
| | | if (!configService.checkConfigKeyUnique(config)) |
| | | { |
| | | return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| | | } |
| | | config.setCreateBy(getUsername()); |
| | | return toAjax(configService.insertConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 修改参数配置 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:edit')") |
| | | @Log(title = "参数管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config) |
| | | { |
| | | if (!configService.checkConfigKeyUnique(config)) |
| | | { |
| | | return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| | | } |
| | | config.setUpdateBy(getUsername()); |
| | | return toAjax(configService.updateConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 删除参数配置 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "参数管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{configIds}") |
| | | public AjaxResult remove(@PathVariable Long[] configIds) |
| | | { |
| | | configService.deleteConfigByIds(configIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 刷新参数缓存 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "参数管理", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() |
| | | { |
| | | configService.resetConfigCache(); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | 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.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.constant.UserConstants; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysDept; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.system.service.ISysDeptService; |
| | | |
| | | /** |
| | | * 部门信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dept") |
| | | public class SysDeptController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | /** |
| | | * 获取部门列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysDept dept) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | | return AjaxResult.success(depts); |
| | | } |
| | | |
| | | /** |
| | | * 查询部门列表(排除节点) |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list/exclude/{deptId}") |
| | | public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| | | depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); |
| | | return AjaxResult.success(depts); |
| | | } |
| | | |
| | | /** |
| | | * 根据部门编号获取详细信息 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:query')") |
| | | @GetMapping(value = "/{deptId}") |
| | | public AjaxResult getInfo(@PathVariable Long deptId) |
| | | { |
| | | deptService.checkDeptDataScope(deptId); |
| | | return AjaxResult.success(deptService.selectDeptById(deptId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增部门 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:add')") |
| | | @Log(title = "部门管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDept dept) |
| | | { |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } |
| | | dept.setCreateBy(getUsername()); |
| | | return AjaxResult.success(deptService.insertDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * 修改部门 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:edit')") |
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept) |
| | | { |
| | | Long deptId = dept.getDeptId(); |
| | | deptService.checkDeptDataScope(deptId); |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } |
| | | else if (dept.getParentId().equals(deptId)) |
| | | { |
| | | return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); |
| | | } |
| | | else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) |
| | | { |
| | | return error("该部门包含未停用的子部门!"); |
| | | } |
| | | dept.setUpdateBy(getUsername()); |
| | | return AjaxResult.success(deptService.updateDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * 删除部门 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:remove')") |
| | | @Log(title = "部门管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{deptId}") |
| | | public AjaxResult remove(@PathVariable Long deptId) |
| | | { |
| | | if (deptService.hasChildByDeptId(deptId)) |
| | | { |
| | | return warn("存在下级部门,不允许删除"); |
| | | } |
| | | if (deptService.checkDeptExistUser(deptId)) |
| | | { |
| | | return warn("部门存在用户,不允许删除"); |
| | | } |
| | | deptService.checkDeptDataScope(deptId); |
| | | return AjaxResult.success(deptService.deleteDeptById(deptId)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysDictData; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.common.utils.poi.ExcelUtil; |
| | | import com.finance.system.service.ISysDictDataService; |
| | | import com.finance.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * 数据字典信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/data") |
| | | public class SysDictDataController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictData dictData) |
| | | { |
| | | // startPage(); |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | // @Log(title = "字典数据", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysDictData dictData) |
| | | // { |
| | | // List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | // ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); |
| | | // util.exportExcel(response, list, "字典数据"); |
| | | // } |
| | | |
| | | /** |
| | | * 查询字典数据详细 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictCode}") |
| | | public AjaxResult getInfo(@PathVariable Long dictCode) |
| | | { |
| | | return success(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型查询字典数据信息 |
| | | */ |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public AjaxResult dictType(@PathVariable String dictType) |
| | | { |
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
| | | if (StringUtils.isNull(data)) |
| | | { |
| | | data = new ArrayList<SysDictData>(); |
| | | } |
| | | return success(data); |
| | | } |
| | | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "字典数据", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictDataService.insertDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "字典数据", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictDataService.updateDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public AjaxResult remove(@PathVariable Long[] dictCodes) |
| | | { |
| | | dictDataService.deleteDictDataByIds(dictCodes); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysDictType; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.poi.ExcelUtil; |
| | | import com.finance.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * 数据字典信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/type") |
| | | public class SysDictTypeController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictType dictType) |
| | | { |
| | | // startPage(); |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | // @Log(title = "字典类型", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysDictType dictType) |
| | | // { |
| | | // List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | // ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); |
| | | // util.exportExcel(response, list, "字典类型"); |
| | | // } |
| | | |
| | | /** |
| | | * 查询字典类型详细 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictId}") |
| | | public AjaxResult getInfo(@PathVariable Long dictId) |
| | | { |
| | | return success(dictTypeService.selectDictTypeById(dictId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "字典类型", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| | | } |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictTypeService.insertDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 修改字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "字典类型", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| | | } |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictTypeService.updateDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictIds}") |
| | | public AjaxResult remove(@PathVariable Long[] dictIds) |
| | | { |
| | | dictTypeService.deleteDictTypeByIds(dictIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 刷新字典缓存 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() |
| | | { |
| | | dictTypeService.resetDictCache(); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典选择框列表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); |
| | | return success(dictTypes); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.config.RuoYiConfig; |
| | | import com.finance.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 首页 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class SysIndexController |
| | | { |
| | | /** 系统基础配置 */ |
| | | @Autowired |
| | | private RuoYiConfig ruoyiConfig; |
| | | |
| | | /** |
| | | * 访问首页,提示语 |
| | | */ |
| | | @RequestMapping("/") |
| | | public String index() |
| | | { |
| | | return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import com.finance.common.constant.Constants; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysMenu; |
| | | import com.finance.common.core.domain.entity.SysRole; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.core.domain.model.LoginBody; |
| | | import com.finance.common.core.domain.model.LoginUser; |
| | | import com.finance.common.core.redis.RedisCache; |
| | | import com.finance.common.utils.SecurityUtils; |
| | | import com.finance.framework.web.service.SysLoginService; |
| | | import com.finance.framework.web.service.SysPermissionService; |
| | | import com.finance.framework.web.service.TokenService; |
| | | import com.finance.system.service.ISysMenuService; |
| | | import com.finance.system.service.ISysRoleService; |
| | | import com.finance.system.service.TbDeptService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 登录验证 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(tags = "登录") |
| | | @RestController |
| | | public class SysLoginController { |
| | | |
| | | @Autowired |
| | | private SysLoginService loginService; |
| | | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | @Autowired |
| | | private TbDeptService tbDeptService; |
| | | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | // @ApiOperation(value = "账号密码登录", notes = "账号密码登录") |
| | | @PostMapping("/login") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUser loginUser = loginService.login(loginBody.getUsername(), loginBody.getPassword(), |
| | | loginBody.getCode(), |
| | | loginBody.getUuid()); |
| | | ajax.put(Constants.TOKEN, tokenService.createToken(loginUser)); |
| | | List<SysRole> roles = loginUser.getUser().getRoles(); |
| | | if (CollectionUtils.isEmpty(roles)) { |
| | | return AjaxResult.error("请关联角色!"); |
| | | } |
| | | |
| | | List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | |
| | | ajax.put("menus", menus); |
| | | ajax.put("roleName", roles.get(0).getRoleName()); |
| | | ajax.put("userInfo", loginUser); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | // @ApiOperation(value = "短信登录", notes = "短信登录") |
| | | @PostMapping("/loginCode") |
| | | public AjaxResult loginCode(@RequestBody LoginBody loginBody) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUser loginUser = loginService.loginCode(loginBody.getUsername(), loginBody.getCode()); |
| | | ajax.put(Constants.TOKEN, tokenService.createToken(loginUser)); |
| | | List<SysRole> roles = loginUser.getUser().getRoles(); |
| | | if (CollectionUtils.isEmpty(roles)) { |
| | | return AjaxResult.error("请关联角色!"); |
| | | } |
| | | List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | |
| | | ajax.put("menus", menus); |
| | | ajax.put("roleName", roles.get(0).getRoleName()); |
| | | ajax.put("userInfo", loginUser); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param loginBody 部门管理后台登录 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "部门管理后台登录", notes = "部门管理后台登录") |
| | | @PostMapping("/loginPwd") |
| | | public AjaxResult loginPwd(@RequestBody LoginBody loginBody) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUser loginUser = loginService.loginPwd(loginBody.getUsername(), |
| | | loginBody.getPassword(), loginBody.getCode(), loginBody.getUuid()); |
| | | ajax.put(Constants.TOKEN, tokenService.createToken(loginUser)); |
| | | //List<SysRole> roles = loginUser.getUser().getRoles(); |
| | | //if(CollectionUtils.isEmpty(roles)){ |
| | | // return AjaxResult.error("请关联角色!"); |
| | | //} |
| | | //List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | |
| | | //ajax.put("menus",menus); |
| | | //ajax.put("roleName",roles.get(0).getRoleName()); |
| | | ajax.put("userInfo", loginUser); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 获取验证码 |
| | | * |
| | | * @param phone 手机号 |
| | | * @return 结果 |
| | | */ |
| | | // @ApiOperation(value = "获取验证码",notes = "获取验证码") |
| | | @GetMapping("/getCode") |
| | | public AjaxResult getCode(@RequestParam String phone) { |
| | | redisCache.setCacheObject(phone, "123456", 5, TimeUnit.MINUTES); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @return 用户信息 |
| | | */ |
| | | @GetMapping("getInfo") |
| | | public AjaxResult getInfo() { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // 权限集合 |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | | ajax.put("permissions", permissions); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 获取路由信息 |
| | | * |
| | | * @return 路由信息 |
| | | */ |
| | | @GetMapping("getRouters") |
| | | public AjaxResult getRouters() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
| | | return AjaxResult.success(menuService.buildMenus(menus)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | 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.finance.common.annotation.Log; |
| | | import com.finance.common.constant.UserConstants; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysMenu; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.system.service.ISysMenuService; |
| | | |
| | | /** |
| | | * 菜单信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(tags = "菜单信息") |
| | | @RestController |
| | | @RequestMapping("/system/menu") |
| | | public class SysMenuController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @ApiOperation("菜单权限(有层级)") |
| | | @GetMapping("/levelList") |
| | | public AjaxResult levelList() |
| | | { |
| | | // 获取当前角色的菜单列表 |
| | | List<SysMenu> menus = menuService.selectList(); |
| | | if(menus.size()==0){ |
| | | return AjaxResult.success(new ArrayList<>()); |
| | | } |
| | | // 第三级 |
| | | List<SysMenu> s3 = menus.stream().filter(e -> e.getMenuType().equals("F")).collect(Collectors.toList()); |
| | | // 第二级 |
| | | List<SysMenu> s2 = menus.stream().filter(e -> e.getMenuType().equals("C")).collect(Collectors.toList()); |
| | | // 第一级 |
| | | List<SysMenu> s1 = menus.stream().filter(e -> e.getMenuType().equals("M")).collect(Collectors.toList()); |
| | | |
| | | for (SysMenu menu : s2) { |
| | | List<SysMenu> collect = s3.stream().filter(e -> e.getParentId().equals(menu.getMenuId())).collect(Collectors.toList()); |
| | | menu.setChildren(collect); |
| | | } |
| | | for (SysMenu menu : s1) { |
| | | List<SysMenu> collect = s2.stream().filter(e -> e.getParentId().equals(menu.getMenuId())).collect(Collectors.toList()); |
| | | menu.setChildren(collect); |
| | | } |
| | | |
| | | return AjaxResult.success(s1); |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:menu:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysMenu menu) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return AjaxResult.success(menus); |
| | | } |
| | | |
| | | /** |
| | | * 根据菜单编号获取详细信息 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:menu:query')") |
| | | @GetMapping(value = "/{menuId}") |
| | | public AjaxResult getInfo(@PathVariable Long menuId) |
| | | { |
| | | return AjaxResult.success(menuService.selectMenuById(menuId)); |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单下拉树列表 |
| | | */ |
| | | @GetMapping("/treeselect") |
| | | public AjaxResult treeselect(SysMenu menu) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return AjaxResult.success(menuService.buildMenuTreeSelect(menus)); |
| | | } |
| | | |
| | | /** |
| | | * 加载对应角色菜单列表树 |
| | | */ |
| | | @GetMapping(value = "/roleMenuTreeselect/{roleId}") |
| | | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(getUserId()); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 新增菜单 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:menu:add')") |
| | | @Log(title = "菜单管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
| | | } |
| | | menu.setCreateBy(getUsername()); |
| | | return AjaxResult.success(menuService.insertMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * 修改菜单 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:menu:edit')") |
| | | @Log(title = "菜单管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
| | | } |
| | | else if (menu.getMenuId().equals(menu.getParentId())) |
| | | { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); |
| | | } |
| | | menu.setUpdateBy(getUsername()); |
| | | return AjaxResult.success(menuService.updateMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * 删除菜单 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:menu:remove')") |
| | | @Log(title = "菜单管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{menuId}") |
| | | public AjaxResult remove(@PathVariable("menuId") Long menuId) |
| | | { |
| | | if (menuService.hasChildByMenuId(menuId)) |
| | | { |
| | | return warn("存在子菜单,不允许删除"); |
| | | } |
| | | if (menuService.checkMenuExistRole(menuId)) |
| | | { |
| | | return warn("菜单已分配,不允许删除"); |
| | | } |
| | | return AjaxResult.success(menuService.deleteMenuById(menuId)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.system.domain.SysNotice; |
| | | import com.finance.system.service.ISysNoticeService; |
| | | |
| | | /** |
| | | * 公告 信息操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/notice") |
| | | public class SysNoticeController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysNoticeService noticeService; |
| | | |
| | | /** |
| | | * 获取通知公告列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysNotice notice) |
| | | { |
| | | // startPage(); |
| | | List<SysNotice> list = noticeService.selectNoticeList(notice); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据通知公告编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:query')") |
| | | @GetMapping(value = "/{noticeId}") |
| | | public AjaxResult getInfo(@PathVariable Long noticeId) |
| | | { |
| | | return success(noticeService.selectNoticeById(noticeId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增通知公告 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:add')") |
| | | @Log(title = "通知公告", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysNotice notice) |
| | | { |
| | | notice.setCreateBy(getUsername()); |
| | | return toAjax(noticeService.insertNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * 修改通知公告 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:edit')") |
| | | @Log(title = "通知公告", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysNotice notice) |
| | | { |
| | | notice.setUpdateBy(getUsername()); |
| | | return toAjax(noticeService.updateNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * 删除通知公告 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:remove')") |
| | | @Log(title = "通知公告", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{noticeIds}") |
| | | public AjaxResult remove(@PathVariable Long[] noticeIds) |
| | | { |
| | | return toAjax(noticeService.deleteNoticeByIds(noticeIds)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.poi.ExcelUtil; |
| | | import com.finance.system.domain.SysPost; |
| | | import com.finance.system.service.ISysPostService; |
| | | |
| | | /** |
| | | * 岗位信息操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/post") |
| | | public class SysPostController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | /** |
| | | * 获取岗位列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysPost post) |
| | | { |
| | | // startPage(); |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | // @Log(title = "岗位管理", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('system:post:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysPost post) |
| | | // { |
| | | // List<SysPost> list = postService.selectPostList(post); |
| | | // ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class); |
| | | // util.exportExcel(response, list, "岗位数据"); |
| | | // } |
| | | |
| | | /** |
| | | * 根据岗位编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:query')") |
| | | @GetMapping(value = "/{postId}") |
| | | public AjaxResult getInfo(@PathVariable Long postId) |
| | | { |
| | | return success(postService.selectPostById(postId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增岗位 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:add')") |
| | | @Log(title = "岗位管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
| | | } |
| | | post.setCreateBy(getUsername()); |
| | | return toAjax(postService.insertPost(post)); |
| | | } |
| | | |
| | | /** |
| | | * 修改岗位 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:edit')") |
| | | @Log(title = "岗位管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
| | | } |
| | | post.setUpdateBy(getUsername()); |
| | | return toAjax(postService.updatePost(post)); |
| | | } |
| | | |
| | | /** |
| | | * 删除岗位 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:remove')") |
| | | @Log(title = "岗位管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{postIds}") |
| | | public AjaxResult remove(@PathVariable Long[] postIds) |
| | | { |
| | | return toAjax(postService.deletePostByIds(postIds)); |
| | | } |
| | | |
| | | /** |
| | | * 获取岗位选择框列表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | List<SysPost> posts = postService.selectPostAll(); |
| | | return success(posts); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.config.RuoYiConfig; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.core.domain.model.LoginUser; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.SecurityUtils; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.common.utils.file.FileUploadUtils; |
| | | import com.finance.common.utils.file.MimeTypeUtils; |
| | | import com.finance.framework.web.service.TokenService; |
| | | import com.finance.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * 个人信息 业务处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/user/profile") |
| | | public class SysProfileController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 个人信息 |
| | | */ |
| | | @GetMapping |
| | | public AjaxResult profile() |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | AjaxResult ajax = AjaxResult.success(user); |
| | | ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername())); |
| | | ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | @Log(title = "个人信息", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult updateProfile(@RequestBody SysUser user) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser currentUser = loginUser.getUser(); |
| | | currentUser.setNickName(user.getNickName()); |
| | | currentUser.setEmail(user.getEmail()); |
| | | currentUser.setPhoneNumber(user.getPhoneNumber()); |
| | | currentUser.setSex(user.getSex()); |
| | | if (StringUtils.isNotEmpty(user.getPhoneNumber()) && !userService.checkPhoneUnique(currentUser)) |
| | | { |
| | | return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) |
| | | { |
| | | return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
| | | } |
| | | if (userService.updateUserProfile(currentUser) > 0) |
| | | { |
| | | // 更新缓存用户信息 |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | | return error("修改个人信息异常,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @Log(title = "个人信息", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/updatePwd") |
| | | public AjaxResult updatePwd(String oldPassword, String newPassword) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | String userName = loginUser.getUsername(); |
| | | String password = loginUser.getPassword(); |
| | | if (!SecurityUtils.matchesPassword(oldPassword, password)) |
| | | { |
| | | return error("修改密码失败,旧密码错误"); |
| | | } |
| | | if (SecurityUtils.matchesPassword(newPassword, password)) |
| | | { |
| | | return error("新密码不能与旧密码相同"); |
| | | } |
| | | if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) |
| | | { |
| | | // 更新缓存用户密码 |
| | | loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword)); |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | | return error("修改密码异常,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | | * 头像上传 |
| | | */ |
| | | @Log(title = "用户头像", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/avatar") |
| | | public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception |
| | | { |
| | | if (!file.isEmpty()) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION); |
| | | if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("imgUrl", avatar); |
| | | // 更新缓存用户头像 |
| | | loginUser.getUser().setAvatar(avatar); |
| | | tokenService.setLoginUser(loginUser); |
| | | return ajax; |
| | | } |
| | | } |
| | | return error("上传图片异常,请联系管理员"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.model.RegisterBody; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.framework.web.service.SysRegisterService; |
| | | import com.finance.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 注册验证 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class SysRegisterController extends BaseController |
| | | { |
| | | @Autowired |
| | | private SysRegisterService registerService; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @PostMapping("/register") |
| | | public AjaxResult register(@RequestBody RegisterBody user) |
| | | { |
| | | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) |
| | | { |
| | | return error("当前系统没有开启注册功能!"); |
| | | } |
| | | String msg = registerService.register(user); |
| | | return StringUtils.isEmpty(msg) ? success() : error(msg); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.finance.common.exception.ServiceException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import okhttp3.*; |
| | | |
| | | import java.io.*; |
| | | import java.net.URLEncoder; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.util.Base64; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 百度文字识别 |
| | | */ |
| | | @Slf4j |
| | | public class BaiDuApi { |
| | | |
| | | static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build(); |
| | | |
| | | public static void main(String []args) throws IOException{ |
| | | // String url = "C:\\Users\\Admin\\Desktop\\picture\\6fd629ac-3327-4bdc-9459-fcb5295384bc.jpg"; |
| | | String url = "C:\\Users\\Admin\\Desktop\\picture\\6fd629ac-3327-4bdc-9459-fcb5295384bc.jpg"; |
| | | MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |
| | | RequestBody body = RequestBody.create(mediaType, "image="+getFileContentAsBase64(url,true)); |
| | | Request request = new Request.Builder() |
| | | .url("https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token="+getAccessToken()) |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .addHeader("Accept", "application/json") |
| | | .build(); |
| | | Response response = HTTP_CLIENT.newCall(request).execute(); |
| | | |
| | | // System.err.println(response.body().string()); |
| | | |
| | | Map<String,Object> map = new HashMap<>(); |
| | | String string = response.body().string(); |
| | | String idCard = string.substring(string.lastIndexOf("单号:") + 3, string.lastIndexOf("单号:") + 27); |
| | | String time = string.substring(string.lastIndexOf("零时起") + 3, string.lastIndexOf("二十四时")-1); |
| | | time = time.replace(".","-"); |
| | | map.put("idCard",idCard); |
| | | map.put("time",time); |
| | | System.err.println(map); |
| | | } |
| | | |
| | | /** |
| | | * 资质证明证件识别 |
| | | * @param url |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static Map<String,Object> qualification(String url) throws IOException { |
| | | MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |
| | | RequestBody body = RequestBody.create(mediaType, "image="+getFileContentAsBase64(url,true)); |
| | | Request request = new Request.Builder() |
| | | .url("https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token="+getAccessToken()) |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .addHeader("Accept", "application/json") |
| | | .build(); |
| | | Response response = HTTP_CLIENT.newCall(request).execute(); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | try{ |
| | | String string = response.body().string(); |
| | | String idCard = string.substring(string.lastIndexOf("号:") + 2, string.lastIndexOf("号:") + 21); |
| | | String time = string.substring(string.lastIndexOf("至") + 1, string.lastIndexOf("至") + 11); |
| | | time = time.replace(".","-"); |
| | | map.put("idCard",idCard); |
| | | map.put("time",time); |
| | | }catch (Exception e){ |
| | | log.error("资质证明证件识别错误!"); |
| | | throw new ServiceException("资质证明证件识别错误!"); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 身份证识别 |
| | | * @param url |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static Map<String,Object> idCard(String url) throws IOException { |
| | | MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |
| | | RequestBody body = RequestBody.create(mediaType, "image="+getFileContentAsBase64(url,true)); |
| | | Request request = new Request.Builder() |
| | | .url("https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token="+getAccessToken()) |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .addHeader("Accept", "application/json") |
| | | .build(); |
| | | Response response = HTTP_CLIENT.newCall(request).execute(); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | try{ |
| | | JSONObject jsonObject = JSONObject.parseObject(response.body().string()); |
| | | JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("words_result")); |
| | | JSONObject obj1 = JSONObject.parseObject(jsonArray.get(0).toString()); |
| | | String name = obj1.getString("words"); |
| | | name = name.substring(2); |
| | | |
| | | JSONObject obj2 = JSONObject.parseObject(jsonArray.get(1).toString()); |
| | | String sexStr = obj2.getString("words"); |
| | | sexStr = sexStr.substring(2, 3); |
| | | int sex = "男".equals(sexStr)?0:1; |
| | | |
| | | JSONObject obj3 = JSONObject.parseObject(jsonArray.get(3).toString()); |
| | | JSONObject obj4 = JSONObject.parseObject(jsonArray.get(4).toString()); |
| | | String address = obj3.getString("words") + obj4.getString("words"); |
| | | address = address.substring(2); |
| | | |
| | | JSONObject obj5 = JSONObject.parseObject(jsonArray.get(5).toString()); |
| | | String idCard = obj5.getString("words"); |
| | | idCard = idCard.substring(6); |
| | | |
| | | map.put("name",name); |
| | | map.put("sex",sex); |
| | | map.put("address",address); |
| | | map.put("idCard",idCard); |
| | | }catch (Exception e){ |
| | | log.error("身份证件识别错误!"); |
| | | throw new ServiceException("身份证件识别错误!"); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 通用文字识别(标准版) |
| | | * @param url |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static JSONObject pictureOcr(String url) throws IOException { |
| | | MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |
| | | RequestBody body = RequestBody.create(mediaType, "image="+getFileContentAsBase64(url,true)); |
| | | Request request = new Request.Builder() |
| | | .url("https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token="+getAccessToken()) |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .addHeader("Accept", "application/json") |
| | | .build(); |
| | | Response response = HTTP_CLIENT.newCall(request).execute(); |
| | | return JSONObject.parseObject(response.body().string()); |
| | | } |
| | | |
| | | public static String getAccessToken() throws IOException { |
| | | MediaType mediaType = MediaType.parse("application/json"); |
| | | RequestBody body = RequestBody.create(mediaType, ""); |
| | | Request request = new Request.Builder() |
| | | .url("https://aip.baidubce.com/oauth/2.0/token?client_id=2RkKEqd0ltIHPvnIf3G0VpHE&client_secret=RBpPt3O64e3e4BK7pG3lP0o8I6SGgiUy&grant_type=client_credentials") |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/json") |
| | | .addHeader("Accept", "application/json") |
| | | .build(); |
| | | Response response = HTTP_CLIENT.newCall(request).execute(); |
| | | JSONObject jsonObject = JSONObject.parseObject(response.body().string()); |
| | | return jsonObject.getString("access_token"); |
| | | } |
| | | |
| | | /** |
| | | * 获取文件base64编码 |
| | | * |
| | | * @param path 文件路径 |
| | | * @param urlEncode 如果Content-Type是application/x-www-form-urlencoded时,传true |
| | | * @return base64编码信息,不带文件头 |
| | | * @throws IOException IO异常 |
| | | */ |
| | | static String getFileContentAsBase64(String path, boolean urlEncode) throws IOException { |
| | | byte[] b = Files.readAllBytes(Paths.get(path)); |
| | | String base64 = Base64.getEncoder().encodeToString(b); |
| | | if (urlEncode) { |
| | | base64 = URLEncoder.encode(base64, "utf-8"); |
| | | } |
| | | return base64; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.InputStream; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | |
| | | /** |
| | | * @author zhy |
| | | * @title: HttpClientUtil |
| | | * @projectName car_park |
| | | * @description: http连接工具类 |
| | | * @date 2019/10/2219:23 |
| | | */ |
| | | public class HttpClientUtil { |
| | | |
| | | |
| | | /** |
| | | * @param strUrl |
| | | * @return byte[] |
| | | * @throws |
| | | * @description: 获取网络图片转成字节流 |
| | | * @author zhy |
| | | * @date 2019/10/23 8:59 |
| | | */ |
| | | public static byte[] getImageFromNetByUrl(String strUrl) { |
| | | if (!isURL(strUrl)){ |
| | | return null; |
| | | } |
| | | try { |
| | | URL url = new URL(strUrl); |
| | | HttpURLConnection conn = (HttpURLConnection) url.openConnection(); |
| | | conn.setRequestMethod("GET"); |
| | | conn.setConnectTimeout(2 * 1000); |
| | | InputStream inStream = conn.getInputStream();// 通过输入流获取图片数据 |
| | | byte[] btImg = readInputStream(inStream);// 得到图片的二进制数据 |
| | | return btImg; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 从输入流中获取字节流数据 |
| | | * |
| | | * @param inStream 输入流 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] readInputStream(InputStream inStream) throws Exception { |
| | | ByteArrayOutputStream outStream = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[10240]; |
| | | int len = 0; |
| | | while ((len = inStream.read(buffer)) != -1) { |
| | | outStream.write(buffer, 0, len); |
| | | } |
| | | inStream.close(); |
| | | return outStream.toByteArray(); |
| | | } |
| | | |
| | | public static boolean isURL(String str) { |
| | | str = str.toLowerCase(); |
| | | String regex = "^((https|http|ftp|rtsp|mms)?://)" |
| | | + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" |
| | | + "(([0-9]{1,3}\\.){3}[0-9]{1,3}" |
| | | + "|" |
| | | + "([0-9a-z_!~*'()-]+\\.)*" |
| | | + "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\." |
| | | + "[a-z]{2,6})" |
| | | + "(:[0-9]{1,5})?" |
| | | + "((/?)|" |
| | | + "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$"; |
| | | return str.matches(regex); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.finance.common.core.domain.R; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 导出返回信息 |
| | | */ |
| | | @Slf4j |
| | | public class ImportExcelUtil { |
| | | |
| | | /** |
| | | * @param errorLines 错误行数 |
| | | * @param successLines 成功行数 |
| | | * @param errorMessage 错误信息 |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static R<String> importReturnMsg(int errorLines, int successLines, List<String> errorMessage) throws IOException { |
| | | if (errorLines == 0) { |
| | | return R.ok("共" + successLines + "行数据全部导入成功!"); |
| | | } else { |
| | | JSONObject result = new JSONObject(5); |
| | | int totalCount = successLines + errorLines; |
| | | result.put("totalCount", totalCount); |
| | | result.put("errorCount", errorLines); |
| | | result.put("errorMessage", errorMessage); |
| | | result.put("successCount", successLines); |
| | | result.put("msg", "总上传行数:" + totalCount + ",已导入行数:" + successLines + ",错误行数:" + errorLines); |
| | | return R.ok(JSON.toJSONString(result)); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.finance.system.code.SubmitTemplateReg; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.apache.commons.codec.binary.Hex; |
| | | |
| | | import java.io.Serializable; |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | /** |
| | | * 短信工具类 |
| | | */ |
| | | public class MsgCodeUtil implements Serializable { |
| | | |
| | | /**接口账号用户名*/ |
| | | private static final String AP_ID = ""; |
| | | /**企业名称*/ |
| | | private static final String EC_NAME = ""; |
| | | /**签名*/ |
| | | private static final String SECRET_KEY = ""; |
| | | /**签名编码*/ |
| | | private static final String SIGN = ""; |
| | | /**模板ID*/ |
| | | private static final String TEMPLATE_ID = ""; |
| | | |
| | | |
| | | /** |
| | | * 实体封装 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static SubmitTemplateReg getSubmitTemplateReg(String code,String mobiles) { |
| | | SubmitTemplateReg submitReg =new SubmitTemplateReg(); |
| | | String[] paramss = {code}; |
| | | submitReg.setApId(AP_ID); |
| | | submitReg.setEcName(EC_NAME); |
| | | submitReg.setSecretKey(SECRET_KEY); |
| | | submitReg.setParams(JSONObject.toJSONString(paramss)); |
| | | submitReg.setMobiles(mobiles); |
| | | submitReg.setAddSerial(""); |
| | | submitReg.setSign(SIGN); |
| | | submitReg.setTemplateId(TEMPLATE_ID); |
| | | submitReg.setMac(TEMPLATE_ID); |
| | | StringBuffer stringBuffer = new StringBuffer(); |
| | | stringBuffer.append(submitReg.getEcName( ));stringBuffer.append(submitReg.getApId()); |
| | | stringBuffer.append(submitReg.getSecretKey());stringBuffer.append(submitReg.getTemplateId());stringBuffer.append(submitReg.getMobiles()); |
| | | stringBuffer.append(submitReg.getParams());stringBuffer.append(submitReg.getSign());stringBuffer.append(submitReg.getAddSerial()); |
| | | submitReg.setMac(Hex.encodeHexString(stringBuffer.toString().getBytes(StandardCharsets.UTF_8))); |
| | | String regText = JSONObject.toJSONString(submitReg); |
| | | //加密 |
| | | String encode = Base64.encodeBase64String(regText.getBytes()); |
| | | System.err.println(encode); |
| | | return submitReg; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | getSubmitTemplateReg("123456","18398968484"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsRequest; |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsResponse; |
| | | import com.aliyun.tea.TeaException; |
| | | import com.aliyun.teaopenapi.models.Config; |
| | | import com.aliyun.teautil.models.RuntimeOptions; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class MsgUtils { |
| | | |
| | | @Value("${code.config.accessKeyId}") |
| | | private String accessKeyId; |
| | | @Value("${code.config.accessKeySecret}") |
| | | private String accessKeySecret; |
| | | @Value("${code.config.signName}") |
| | | private String signName; |
| | | @Value("${code.config.templateCode}") |
| | | private String templateCode; |
| | | @Value("${code.config.signNameTest}") |
| | | private String signNameTest; |
| | | @Value("${code.config.templateCodeTest}") |
| | | private String templateCodeTest; |
| | | |
| | | /** |
| | | * 使用AK&SK初始化账号Client |
| | | * @param accessKeyId |
| | | * @param accessKeySecret |
| | | * @return Client |
| | | * @throws Exception |
| | | */ |
| | | public static com.aliyun.dysmsapi20170525.Client createClient(String accessKeyId, String accessKeySecret) throws Exception { |
| | | Config config = new Config() |
| | | // 您的 AccessKey ID |
| | | .setAccessKeyId(accessKeyId) |
| | | // 您的 AccessKey Secret |
| | | .setAccessKeySecret(accessKeySecret); |
| | | // 访问的域名 |
| | | config.endpoint = "dysmsapi.aliyuncs.com"; |
| | | return new com.aliyun.dysmsapi20170525.Client(config); |
| | | } |
| | | |
| | | public void sendMsg(String phone,String code) throws Exception { |
| | | com.aliyun.dysmsapi20170525.Client client = MsgUtils.createClient(accessKeyId,accessKeySecret); |
| | | SendSmsRequest sendSmsRequest = new SendSmsRequest() |
| | | .setSignName(signName) |
| | | .setTemplateCode(templateCode) |
| | | .setPhoneNumbers(phone) |
| | | .setTemplateParam("{\"code\":\""+code+"\"}"); |
| | | RuntimeOptions runtime = new RuntimeOptions(); |
| | | try { |
| | | // 复制代码运行请自行打印 API 的返回值 |
| | | SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest, runtime); |
| | | log.info("短信发送成功:{},{}",sendSmsResponse.getBody().getMessage(),sendSmsResponse.getStatusCode()); |
| | | } catch (TeaException error) { |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } catch (Exception _error) { |
| | | TeaException error = new TeaException(_error.getMessage(), _error); |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.EncodeHintType; |
| | | import com.google.zxing.MultiFormatWriter; |
| | | import com.google.zxing.WriterException; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
| | | import com.finance.common.utils.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.swing.filechooser.FileSystemView; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.io.OutputStream; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 二维码工具 |
| | | * @Author:debug (SteadyJack) |
| | | * @Link: weixin-> debug0868 qq-> 1948831260 |
| | | * @Date: 2020/11/16 22:38 |
| | | **/ |
| | | public class QRCodeUtil { |
| | | private static final Logger log= LoggerFactory.getLogger(QRCodeUtil.class); |
| | | |
| | | //CODE_WIDTH:二维码宽度,单位像素 |
| | | private static final int CODE_WIDTH = 400; |
| | | //CODE_HEIGHT:二维码高度,单位像素 |
| | | private static final int CODE_HEIGHT = 400; |
| | | //FRONT_COLOR:二维码前景色,0x000000 表示黑色 |
| | | private static final int FRONT_COLOR = 0x000000; |
| | | //BACKGROUND_COLOR:二维码背景色,0xFFFFFF 表示白色 |
| | | //演示用 16 进制表示,和前端页面 CSS 的取色是一样的,注意前后景颜色应该对比明显,如常见的黑白 |
| | | private static final int BACKGROUND_COLOR = 0xFFFFFF; |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | createCodeToFile("5261548530",new File("C:\\Users\\Admin\\Desktop\\qrcode"),"5261548530.png"); |
| | | } |
| | | |
| | | public static void createCodeToFile(String content, File codeImgFileSaveDir, String fileName) { |
| | | try { |
| | | if (StringUtils.isBlank(content) || StringUtils.isBlank(fileName)) { |
| | | return; |
| | | } |
| | | content = content.trim(); |
| | | if (codeImgFileSaveDir==null || codeImgFileSaveDir.isFile()) { |
| | | //二维码图片存在目录为空,默认放在桌面... |
| | | codeImgFileSaveDir = FileSystemView.getFileSystemView().getHomeDirectory(); |
| | | } |
| | | if (!codeImgFileSaveDir.exists()) { |
| | | //二维码图片存在目录不存在,开始创建... |
| | | codeImgFileSaveDir.mkdirs(); |
| | | } |
| | | |
| | | //核心代码-生成二维码 |
| | | BufferedImage bufferedImage = getBufferedImage(content); |
| | | |
| | | File codeImgFile = new File(codeImgFileSaveDir, fileName); |
| | | ImageIO.write(bufferedImage, "png", codeImgFile); |
| | | |
| | | log.info("二维码图片生成成功:" + codeImgFile.getPath()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码并输出到输出流, 通常用于输出到网页上进行显示,输出到网页与输出到磁盘上的文件中,区别在于最后一句 ImageIO.write |
| | | * write(RenderedImage im,String formatName,File output):写到文件中 |
| | | * write(RenderedImage im,String formatName,OutputStream output):输出到输出流中 |
| | | * @param content :二维码内容 |
| | | * @param outputStream :输出流,比如 HttpServletResponse 的 getOutputStream |
| | | */ |
| | | public static void createCodeToOutputStream(String content, OutputStream outputStream) { |
| | | try { |
| | | if (StringUtils.isBlank(content)) { |
| | | return; |
| | | } |
| | | content = content.trim(); |
| | | //核心代码-生成二维码 |
| | | BufferedImage bufferedImage = getBufferedImage(content); |
| | | |
| | | //区别就是这一句,输出到输出流中,如果第三个参数是 File,则输出到文件中 |
| | | ImageIO.write(bufferedImage, "png", outputStream); |
| | | |
| | | log.info("二维码图片生成到输出流成功..."); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | //核心代码-生成二维码 |
| | | private static BufferedImage getBufferedImage(String content) throws WriterException { |
| | | |
| | | //com.google.zxing.EncodeHintType:编码提示类型,枚举类型 |
| | | Map<EncodeHintType, Object> hints = new HashMap(); |
| | | |
| | | //EncodeHintType.CHARACTER_SET:设置字符编码类型 |
| | | hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); |
| | | |
| | | //EncodeHintType.ERROR_CORRECTION:设置误差校正 |
| | | //ErrorCorrectionLevel:误差校正等级,L = ~7% correction、M = ~15% correction、Q = ~25% correction、H = ~30% correction |
| | | //不设置时,默认为 L 等级,等级不一样,生成的图案不同,但扫描的结果是一样的 |
| | | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); |
| | | |
| | | //EncodeHintType.MARGIN:设置二维码边距,单位像素,值越小,二维码距离四周越近 |
| | | hints.put(EncodeHintType.MARGIN, 1); |
| | | |
| | | MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); |
| | | BitMatrix bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, CODE_WIDTH, CODE_HEIGHT, hints); |
| | | BufferedImage bufferedImage = new BufferedImage(CODE_WIDTH, CODE_HEIGHT, BufferedImage.TYPE_INT_BGR); |
| | | for (int x = 0; x < CODE_WIDTH; x++) { |
| | | for (int y = 0; y < CODE_HEIGHT; y++) { |
| | | bufferedImage.setRGB(x, y, bitMatrix.get(x, y) ? FRONT_COLOR : BACKGROUND_COLOR); |
| | | } |
| | | } |
| | | return bufferedImage; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.finance.common.core.redis.RedisCache; |
| | | import com.finance.system.service.ISysRoleService; |
| | | import com.finance.system.service.ISysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 定时任务工具类 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void message() { |
| | | try { |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 每隔一分钟去处理的定时任务 |
| | | */ |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void taskMinute() { |
| | | try { |
| | | // List<Message> list = messageService.list(); |
| | | // Map<Integer,List<Message>> map = new LinkedHashMap<>(); |
| | | // for (Message message : list) { |
| | | // if (map.get(message.getUserId())==null){ |
| | | // List<Message> messages = new ArrayList<>(); |
| | | // messages.add(message); |
| | | // map.put(message.getUserId(),messages); |
| | | // System.err.println("为空"); |
| | | // }else { |
| | | // List<Message> messages = map.get(message.getUserId()); |
| | | // messages.add(message); |
| | | // map.put(message.getUserId(),messages); |
| | | // } |
| | | // } |
| | | // Object cacheObject = redisCache.getCacheObject("1"); |
| | | // Set<Integer> integers = map.keySet(); |
| | | // for (Integer integer : integers) { |
| | | // redisCache.deleteObject(String.valueOf(integer)); |
| | | // redisCache.setCacheList(String.valueOf(integer),map.get(integer)); |
| | | // List<Message> cacheList = redisCache.getCacheList(String.valueOf(integer)); |
| | | // System.err.println("====="+cacheList); |
| | | // } |
| | | // |
| | | // |
| | | // System.err.println("======="+map); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 每天的凌晨执行的任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * *") |
| | | public void taskDay() { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 每天的凌晨执行的任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ? ") |
| | | public void taskDayOne() { |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.utils.StringUtils; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * swagger 用户测试方法 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/test/user") |
| | | public class TestController extends BaseController |
| | | { |
| | | private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>(); |
| | | { |
| | | users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); |
| | | users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | public R<List<UserEntity>> userList() |
| | | { |
| | | List<UserEntity> userList = new ArrayList<UserEntity>(users.values()); |
| | | return R.ok(userList); |
| | | } |
| | | |
| | | @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) |
| | | @GetMapping("/{userId}") |
| | | public R<UserEntity> getUser(@PathVariable Integer userId) |
| | | { |
| | | if (!users.isEmpty() && users.containsKey(userId)) |
| | | { |
| | | return R.ok(users.get(userId)); |
| | | } |
| | | else |
| | | { |
| | | return R.fail("用户不存在"); |
| | | } |
| | | } |
| | | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class) |
| | | }) |
| | | @PostMapping("/save") |
| | | public R<String> save(UserEntity user) |
| | | { |
| | | if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) |
| | | { |
| | | return R.fail("用户ID不能为空"); |
| | | } |
| | | users.put(user.getUserId(), user); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | public R<String> update(@RequestBody UserEntity user) |
| | | { |
| | | if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) |
| | | { |
| | | return R.fail("用户ID不能为空"); |
| | | } |
| | | if (users.isEmpty() || !users.containsKey(user.getUserId())) |
| | | { |
| | | return R.fail("用户不存在"); |
| | | } |
| | | users.remove(user.getUserId()); |
| | | users.put(user.getUserId(), user); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) |
| | | @DeleteMapping("/{userId}") |
| | | public R<String> delete(@PathVariable Integer userId) |
| | | { |
| | | if (!users.isEmpty() && users.containsKey(userId)) |
| | | { |
| | | users.remove(userId); |
| | | return R.ok(); |
| | | } |
| | | else |
| | | { |
| | | return R.fail("用户不存在"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @ApiModel(value = "UserEntity", description = "用户实体") |
| | | class UserEntity |
| | | { |
| | | @ApiModelProperty("用户ID") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户名称") |
| | | private String username; |
| | | |
| | | @ApiModelProperty("用户密码") |
| | | private String password; |
| | | |
| | | @ApiModelProperty("用户手机") |
| | | private String mobile; |
| | | |
| | | public UserEntity() |
| | | { |
| | | |
| | | } |
| | | |
| | | public UserEntity(Integer userId, String username, String password, String mobile) |
| | | { |
| | | this.userId = userId; |
| | | this.username = username; |
| | | this.password = password; |
| | | this.mobile = mobile; |
| | | } |
| | | |
| | | public Integer getUserId() |
| | | { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getUsername() |
| | | { |
| | | return username; |
| | | } |
| | | |
| | | public void setUsername(String username) |
| | | { |
| | | this.username = username; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getMobile() |
| | | { |
| | | return mobile; |
| | | } |
| | | |
| | | public void setMobile(String mobile) |
| | | { |
| | | this.mobile = mobile; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.core.config; |
| | | |
| | | import com.finance.common.config.RuoYiConfig; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.service.*; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spi.service.contexts.SecurityContext; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Swagger2的接口配置 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Configuration |
| | | public class SwaggerConfig |
| | | { |
| | | /** 系统基础配置 */ |
| | | @Autowired |
| | | private RuoYiConfig ruoyiConfig; |
| | | |
| | | /** 是否开启swagger */ |
| | | @Value("${swagger.enabled}") |
| | | private boolean enabled; |
| | | |
| | | /** 设置请求的统一前缀 */ |
| | | @Value("${swagger.pathMapping}") |
| | | private String pathMapping; |
| | | |
| | | /** |
| | | * 创建API |
| | | */ |
| | | @Bean |
| | | public Docket createRestApi() |
| | | { |
| | | return new Docket(DocumentationType.OAS_30) |
| | | // 是否启用Swagger |
| | | .enable(enabled) |
| | | // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) |
| | | .apiInfo(apiInfo()) |
| | | // 设置哪些接口暴露给Swagger展示 |
| | | .select() |
| | | // 扫描所有有注解的api,用这种方式更灵活 |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| | | // 扫描指定包中的swagger注解 |
| | | // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) |
| | | // 扫描所有 .apis(RequestHandlerSelectors.any()) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | /* 设置安全模式,swagger可以设置访问token */ |
| | | .securitySchemes(securitySchemes()) |
| | | .securityContexts(securityContexts()) |
| | | .pathMapping(pathMapping); |
| | | } |
| | | |
| | | /** |
| | | * 安全模式,这里指定token通过Authorization头请求头传递 |
| | | */ |
| | | private List<SecurityScheme> securitySchemes() |
| | | { |
| | | List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>(); |
| | | apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue())); |
| | | return apiKeyList; |
| | | } |
| | | |
| | | /** |
| | | * 安全上下文 |
| | | */ |
| | | private List<SecurityContext> securityContexts() |
| | | { |
| | | List<SecurityContext> securityContexts = new ArrayList<>(); |
| | | securityContexts.add( |
| | | SecurityContext.builder() |
| | | .securityReferences(defaultAuth()) |
| | | .operationSelector(o -> o.requestMappingPattern().matches("/.*")) |
| | | .build()); |
| | | return securityContexts; |
| | | } |
| | | |
| | | /** |
| | | * 默认的安全上引用 |
| | | */ |
| | | private List<SecurityReference> defaultAuth() |
| | | { |
| | | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); |
| | | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; |
| | | authorizationScopes[0] = authorizationScope; |
| | | List<SecurityReference> securityReferences = new ArrayList<>(); |
| | | securityReferences.add(new SecurityReference("Authorization", authorizationScopes)); |
| | | return securityReferences; |
| | | } |
| | | |
| | | /** |
| | | * 添加摘要信息 |
| | | */ |
| | | private ApiInfo apiInfo() |
| | | { |
| | | // 用ApiInfoBuilder进行定制 |
| | | return new ApiInfoBuilder() |
| | | // 设置标题 |
| | | .title("财政运行分析评估系统部门端接口文档") |
| | | // 描述 |
| | | .description("财政运行分析评估系统部门端接口文档") |
| | | // 作者信息 |
| | | .contact(new Contact(ruoyiConfig.getName(), null, null)) |
| | | // 版本 |
| | | .version("版本号:" + ruoyiConfig.getVersion()) |
| | | .build(); |
| | | } |
| | | } |
New file |
| | |
| | | # 项目相关配置 |
| | | ruoyi: |
| | | # 名称 |
| | | name: RuoYi |
| | | # 版本 |
| | | version: 3.8.6 |
| | | # 版权年份 |
| | | copyrightYear: 2023 |
| | | # 实例演示开关 |
| | | demoEnabled: true |
| | | # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) |
| | | profile: D:/ruoyi/uploadPath |
| | | # 获取ip地址开关 |
| | | addressEnabled: false |
| | | # 验证码类型 math 数字计算 char 字符验证 |
| | | captchaType: math |
| | | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8082 |
| | | 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.finance: 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: false |
| | | # 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://1.95.13.179:3306/financialdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: Si8bnm5KPGSZkF3F |
| | | # 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 |
| | | global-config: |
| | | banner: false |
| | | db-config: |
| | | logic-not-delete-value: 0 |
| | | logic-delete-value: 1 |
| | | 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 |
| | | type-aliases-package: com.finance.**.domain,com.finance.**.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: |
| | | 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: RuoYi |
| | | # 版本 |
| | | version: 3.8.6 |
| | | # 版权年份 |
| | | copyrightYear: 2023 |
| | | # 实例演示开关 |
| | | demoEnabled: true |
| | | # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) |
| | | profile: D:/ruoyi/uploadPath |
| | | # 获取ip地址开关 |
| | | addressEnabled: false |
| | | # 验证码类型 math 数字计算 char 字符验证 |
| | | captchaType: math |
| | | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8002 |
| | | 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.finance: 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: 16379 |
| | | # 数据库索引 |
| | | database: 6 |
| | | # 密码 |
| | | password: mPMHThYzlT8DWgl8HLqwPEyPOiHDPPB5 |
| | | # 连接超时时间 |
| | | 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://1.95.13.179:3306/financialdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: Si8bnm5KPGSZkF3F |
| | | # 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 |
| | | global-config: |
| | | banner: false |
| | | db-config: |
| | | logic-not-delete-value: 0 |
| | | logic-delete-value: 1 |
| | | 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 |
| | | type-aliases-package: com.finance.**.domain,com.finance.**.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: |
| | | 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: RuoYi |
| | | # 版本 |
| | | version: 3.8.6 |
| | | # 版权年份 |
| | | copyrightYear: 2023 |
| | | # 实例演示开关 |
| | | demoEnabled: true |
| | | # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) |
| | | profile: D:/ruoyi/uploadPath |
| | | # 获取ip地址开关 |
| | | addressEnabled: false |
| | | # 验证码类型 math 数字计算 char 字符验证 |
| | | captchaType: math |
| | | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8082 |
| | | 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.finance: 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: 6 |
| | | # 密码 |
| | | password: mPMHThYzlT8DWgl8HLqwPEyPOiHDPPB5 |
| | | # 连接超时时间 |
| | | 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: Si8bnm5KPGSZkF3F |
| | | # 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 |
| | | global-config: |
| | | banner: false |
| | | db-config: |
| | | logic-not-delete-value: 0 |
| | | logic-delete-value: 1 |
| | | 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 |
| | | type-aliases-package: com.finance.**.domain,com.finance.**.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: |
| | | 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 |
| | |
| | | spring: |
| | | profiles: |
| | | active: dev |
New file |
| | |
| | | Application Version: ${ruoyi.version} |
| | | Spring Boot Version: ${spring-boot.version} |
| | | FFFFFFFFFFFFFFFFFFFFFFIIIIIIIIIINNNNNNNN NNNNNNNN AAA NNNNNNNN NNNNNNNN CCCCCCCCCCCCCEEEEEEEEEEEEEEEEEEEEEE |
| | | F::::::::::::::::::::FI::::::::IN:::::::N N::::::N A:::A N:::::::N N::::::N CCC::::::::::::CE::::::::::::::::::::E |
| | | F::::::::::::::::::::FI::::::::IN::::::::N N::::::N A:::::A N::::::::N N::::::N CC:::::::::::::::CE::::::::::::::::::::E |
| | | FF::::::FFFFFFFFF::::FII::::::IIN:::::::::N N::::::N A:::::::A N:::::::::N N::::::N C:::::CCCCCCCC::::CEE::::::EEEEEEEEE::::E |
| | | F:::::F FFFFFF I::::I N::::::::::N N::::::N A:::::::::A N::::::::::N N::::::N C:::::C CCCCCC E:::::E EEEEEE |
| | | F:::::F I::::I N:::::::::::N N::::::N A:::::A:::::A N:::::::::::N N::::::NC:::::C E:::::E |
| | | F::::::FFFFFFFFFF I::::I N:::::::N::::N N::::::N A:::::A A:::::A N:::::::N::::N N::::::NC:::::C E::::::EEEEEEEEEE |
| | | F:::::::::::::::F I::::I N::::::N N::::N N::::::N A:::::A A:::::A N::::::N N::::N N::::::NC:::::C E:::::::::::::::E |
| | | F:::::::::::::::F I::::I N::::::N N::::N:::::::N A:::::A A:::::A N::::::N N::::N:::::::NC:::::C E:::::::::::::::E |
| | | F::::::FFFFFFFFFF I::::I N::::::N N:::::::::::N A:::::AAAAAAAAA:::::A N::::::N N:::::::::::NC:::::C E::::::EEEEEEEEEE |
| | | F:::::F I::::I N::::::N N::::::::::N A:::::::::::::::::::::A N::::::N N::::::::::NC:::::C E:::::E |
| | | F:::::F I::::I N::::::N N:::::::::N A:::::AAAAAAAAAAAAA:::::A N::::::N N:::::::::N C:::::C CCCCCC E:::::E EEEEEE |
| | | FF:::::::FF II::::::IIN::::::N N::::::::N A:::::A A:::::A N::::::N N::::::::N C:::::CCCCCCCC::::CEE::::::EEEEEEEE:::::E |
| | | F::::::::FF I::::::::IN::::::N N:::::::N A:::::A A:::::A N::::::N N:::::::N CC:::::::::::::::CE::::::::::::::::::::E |
| | | F::::::::FF I::::::::IN::::::N N::::::N A:::::A A:::::A N::::::N N::::::N CCC::::::::::::CE::::::::::::::::::::E |
| | | FFFFFFFFFFF IIIIIIIIIINNNNNNNN NNNNNNNAAAAAAA AAAAAAANNNNNNNN NNNNNNN CCCCCCCCCCCCCEEEEEEEEEEEEEEEEEEEEEE |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="/home/ruoyi/logs" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | | <!-- 控制台输出 --> |
| | | <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- 系统日志输出 --> |
| | | <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-info.log</file> |
| | | <!-- 循环政策:基于时间创建日志文件 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志文件名格式 --> |
| | | <fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- 过滤的级别 --> |
| | | <level>INFO</level> |
| | | <!-- 匹配时的操作:接收(记录) --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- 不匹配时的操作:拒绝(不记录) --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-error.log</file> |
| | | <!-- 循环政策:基于时间创建日志文件 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志文件名格式 --> |
| | | <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- 过滤的级别 --> |
| | | <level>ERROR</level> |
| | | <!-- 匹配时的操作:接收(记录) --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- 不匹配时的操作:拒绝(不记录) --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- 用户访问日志输出 --> |
| | | <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-user.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 按天回滚 daily --> |
| | | <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- 系统模块日志级别控制 --> |
| | | <logger name="com.finance" level="info" /> |
| | | <!-- Spring日志级别控制 --> |
| | | <logger name="org.springframework" level="warn" /> |
| | | |
| | | <root level="info"> |
| | | <appender-ref ref="console" /> |
| | | </root> |
| | | |
| | | <!--系统操作日志--> |
| | | <root level="info"> |
| | | <appender-ref ref="file_info" /> |
| | | <appender-ref ref="file_error" /> |
| | | </root> |
| | | |
| | | <!--系统用户操作日志--> |
| | | <logger name="sys-user" level="info"> |
| | | <appender-ref ref="sys-user"/> |
| | | </logger> |
| | | </configuration> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <groupId>com.finance</groupId> |
| | | <artifactId>finance</artifactId> |
| | | <version>3.8.6</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <packaging>jar</packaging> |
| | | <artifactId>finance-admin</artifactId> |
| | | |
| | | <description> |
| | | web服务入口 |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>com.aliyun.oss</groupId> |
| | | <artifactId>aliyun-sdk-oss</artifactId> |
| | | <version>3.8.0</version> |
| | | </dependency> |
| | | <!-- spring-boot-devtools --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <optional>true</optional> <!-- 表示依赖不会传递 --> |
| | | </dependency> |
| | | |
| | | <!-- swagger3--> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.xiaoymin</groupId>--> |
| | | <!-- <artifactId>swagger-bootstrap-ui</artifactId>--> |
| | | <!-- <version>1.9.6</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | |
| | | <!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 --> |
| | | <dependency> |
| | | <groupId>io.swagger</groupId> |
| | | <artifactId>swagger-models</artifactId> |
| | | <version>1.6.2</version> |
| | | </dependency> |
| | | |
| | | <!-- Mysql驱动包 --> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 核心模块--> |
| | | <dependency> |
| | | <groupId>com.finance</groupId> |
| | | <artifactId>finance-framework</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 定时任务--> |
| | | <dependency> |
| | | <groupId>com.finance</groupId> |
| | | <artifactId>finance-quartz</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 代码生成--> |
| | | <dependency> |
| | | <groupId>com.finance</groupId> |
| | | <artifactId>finance-generator</artifactId> |
| | | </dependency> |
| | | |
| | | <!--二维码开发工具集--> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- zxing生成二维码 --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>3.3.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>3.3.3</version> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.apache.httpcomponents</groupId>--> |
| | | <!-- <artifactId>httpcore</artifactId>--> |
| | | <!-- <version>4.3.2</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>com.squareup.okhttp3</groupId> |
| | | <artifactId>okhttp</artifactId> |
| | | <version>4.9.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.78</version> |
| | | </dependency> |
| | | |
| | | <!-- 阿里云短信 --> |
| | | <dependency> |
| | | <groupId>com.aliyun</groupId> |
| | | <artifactId>dysmsapi20170525</artifactId> |
| | | <version>2.0.10</version> |
| | | </dependency> |
| | | |
| | | <!-- JSR 303 规范验证包 --> |
| | | <dependency> |
| | | <groupId>org.hibernate</groupId> |
| | | <artifactId>hibernate-validator</artifactId> |
| | | <version>5.2.4.Final</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>2.5.15</version> |
| | | <configuration> |
| | | <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 --> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-war-plugin</artifactId> |
| | | <version>3.1.0</version> |
| | | <configuration> |
| | | <failOnMissingWebXml>false</failOnMissingWebXml> |
| | | <warName>${project.artifactId}</warName> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | <finalName>${project.artifactId}</finalName> |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.finance; |
| | | |
| | | import java.net.InetAddress; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.http.client.SimpleClientHttpRequestFactory; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 启动程序 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Slf4j |
| | | @EnableAsync |
| | | @EnableScheduling//开启定时任务 |
| | | @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) |
| | | public class FinanceManageApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | ConfigurableApplicationContext application = SpringApplication.run( |
| | | FinanceManageApplication.class, args); |
| | | try { |
| | | |
| | | Environment env = application.getEnvironment(); |
| | | log.info("\n----------------------------------------------------------\n\t" + |
| | | "应用 '{}' 运行成功! 访问连接:\n\t" + |
| | | "Swagger文档: \t\thttp://{}:{}/doc.html\n" + |
| | | "----------------------------------------------------------" , |
| | | env.getProperty("spring.application.name" , "后台"), |
| | | InetAddress.getLocalHost().getHostAddress(), |
| | | env.getProperty("server.port" , "8081")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 当不存在此 wxRestTemplate 使用此方法的bean注入 |
| | | * |
| | | * @return |
| | | */ |
| | | @Bean |
| | | @ConditionalOnMissingBean(name = "restTemplate") |
| | | public RestTemplate wxRestTemplate() { |
| | | //复杂构造函数的使用 |
| | | SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); |
| | | // 设置超时 |
| | | requestFactory.setConnectTimeout(6000); |
| | | requestFactory.setReadTimeout(6000); |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | restTemplate.setRequestFactory(requestFactory); |
| | | return restTemplate; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance; |
| | | |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | |
| | | /** |
| | | * web容器中进行部署 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FinanceServletInitializer extends SpringBootServletInitializer { |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { |
| | | return application.sources(FinanceManageApplication.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.common.utils.DateUtils; |
| | | import com.finance.system.domain.TbQuestion; |
| | | import com.finance.system.dto.QuestionDTO; |
| | | import com.finance.system.dto.update.BasicDataUpdDTO; |
| | | import com.finance.system.dto.update.QuestionUpdDTO; |
| | | import com.finance.system.query.CurrentFieldsQuery; |
| | | import com.finance.system.query.QuestionQuery; |
| | | import com.finance.system.query.ScoreCalculateDetailQuery; |
| | | import com.finance.system.query.ScoreCalculateQuery; |
| | | import com.finance.system.service.TbBasicDataService; |
| | | import com.finance.system.service.TbQuestionService; |
| | | import com.finance.system.service.TbScoreService; |
| | | import com.finance.system.vo.CurrentFieldsAllVO; |
| | | import com.finance.system.vo.CurrentFieldsDetailVO; |
| | | import com.finance.system.vo.CurrentFieldsVO; |
| | | import com.finance.system.vo.QuestionVO; |
| | | import com.finance.system.vo.ScoreCalculateDetailVO; |
| | | import com.finance.system.vo.ScoreCalculateVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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.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; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/19 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/current-quarter") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "当前季度数据相关接口") |
| | | public class CurrentQuarterController { |
| | | |
| | | private final TbBasicDataService tbBasicDataService; |
| | | private final TbQuestionService tbQuestionService; |
| | | private final TbScoreService tbScoreService; |
| | | |
| | | /** |
| | | * 字段统计 |
| | | * |
| | | * @return R<PageDTO < CurrentFieldsVO>> |
| | | */ |
| | | @ApiOperation(value = "字段统计" , notes = "字段统计") |
| | | @PostMapping("/fields-statics") |
| | | public R<PageDTO<CurrentFieldsVO>> fieldsStatics( |
| | | @Validated @RequestBody CurrentFieldsQuery dto) { |
| | | try { |
| | | dto.setQuarter(DateUtils.getNowQuarter()); |
| | | return tbBasicDataService.fieldsStatics(dto); |
| | | } catch (Exception e) { |
| | | log.error("获取字段统计相关信息异常" , e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 字段统计查看详情 |
| | | * |
| | | * @param id 基础数据id |
| | | * @return R<CurrentFieldsDetailVO> |
| | | */ |
| | | @GetMapping("/fields-details") |
| | | @ApiOperation(value = "字段统计-查看详情" , notes = "字段统计") |
| | | @ApiImplicitParam(name = "id" , value = "基础数据id" , required = true, dataType = "int" , paramType = "query" , dataTypeClass = Long.class) |
| | | public R<CurrentFieldsDetailVO> fieldsDetails(@RequestParam("id") Long id) { |
| | | try { |
| | | return tbBasicDataService.fieldsDetails(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("保存当前季度数据异常" , e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 字段统计-保存数据 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/save-basic-data") |
| | | @ApiOperation("字段统计-保存数据") |
| | | public R<Void> editBasicData(@RequestBody BasicDataUpdDTO dto) { |
| | | try { |
| | | tbBasicDataService.editBasicData(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("保存数据异常" , e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 查看全部 |
| | | * |
| | | * @return R<CurrentFieldsAllVO> |
| | | */ |
| | | @GetMapping("/fields-statics-all") |
| | | @ApiOperation(value = "字段统计-查看全部" , notes = "字段统计") |
| | | public R<CurrentFieldsAllVO> fieldsStaticsAll() { |
| | | try { |
| | | return R.ok(tbBasicDataService.fieldsStaticsAll()); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("查看全部异常" , e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得分计算 |
| | | * |
| | | * @param query 当前季度/历史 数据 得分计算条件查询对象 |
| | | * @return R<PageDTO < ScoreCalculateVO>> |
| | | */ |
| | | @PostMapping("/score-calculate") |
| | | @ApiOperation("得分计算") |
| | | public R<PageDTO<ScoreCalculateVO>> scoreCalculate( |
| | | @Validated @RequestBody ScoreCalculateQuery query) { |
| | | try { |
| | | query.setQuarter(DateUtils.getNowQuarter()); |
| | | return R.ok(tbBasicDataService.scoreCalculatePage(query)); |
| | | } catch (Exception e) { |
| | | log.error("获取得分计算异常" , e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得分计算查看详情 |
| | | * |
| | | * @param query 得分计算详情条件查询对象 |
| | | * @return R<ScoreCalculateDetailVO> |
| | | */ |
| | | @PostMapping("/score-calculate-detail") |
| | | @ApiOperation("得分计算-查看详情") |
| | | @ApiImplicitParam(name = "areaName" , value = "部门名称" , required = false, dataType = "string" , paramType = "query" , dataTypeClass = String.class) |
| | | public R<ScoreCalculateDetailVO> scoreCalculateDetail( |
| | | @Validated @RequestBody ScoreCalculateDetailQuery query) { |
| | | return R.ok(tbScoreService.scoreCalculateDetail(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加问题 |
| | | * |
| | | * @param dto 发现问题数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("add-question") |
| | | @ApiOperation(value = "发现问题-添加问题" , notes = "发现问题") |
| | | public R<Void> addQuestion(@Validated @RequestBody QuestionDTO dto) { |
| | | try { |
| | | tbQuestionService.addQuestion(dto); |
| | | return R.ok(); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("添加问题异常" , e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 编辑问题 |
| | | * |
| | | * @param dto 发现问题编辑数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("/edit-question") |
| | | @ApiOperation(value = "发现问题-编辑问题" , notes = "发现问题") |
| | | public R<Void> editQuestion(@Validated @RequestBody QuestionUpdDTO dto) { |
| | | try { |
| | | tbQuestionService.editQuestion(dto); |
| | | return R.ok(); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑问题异常" , e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 分页查询问题 |
| | | * |
| | | * @param dto 发现问题分页数据传输对象 |
| | | * @return R<PageDTO < QuestionVO>> |
| | | */ |
| | | @PostMapping("/page-question") |
| | | @ApiOperation(value = "发现问题-分页查询问题" , notes = "发现问题") |
| | | public R<PageDTO<QuestionVO>> pageQuestion(@Validated @RequestBody QuestionQuery dto) { |
| | | return R.ok(tbQuestionService.pageQuestion(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 问题详情 |
| | | * |
| | | * @param id id |
| | | * @return R<QuestionDTO> |
| | | */ |
| | | @GetMapping("/detail-question") |
| | | @ApiOperation(value = "发现问题-问题详情" , notes = "发现问题") |
| | | public R<QuestionDTO> detailQuestion(@RequestParam("id") Long id) { |
| | | TbQuestion question = tbQuestionService.getById(id); |
| | | return R.ok(BeanUtils.copyBean(question, QuestionDTO.class)); |
| | | } |
| | | |
| | | /** |
| | | * 删除问题 |
| | | * |
| | | * @param id 问题id |
| | | * @return R<Void> |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation(value = "发现问题-删除问题" , notes = "发现问题") |
| | | public R<Void> delete(@RequestParam("id") Long id) { |
| | | tbQuestionService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.finance.common.annotation.FinancialLog; |
| | | import com.finance.common.annotation.HistoryGroup; |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.enums.ReportingStatusEnum; |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.system.domain.TbBasicData; |
| | | import com.finance.system.dto.update.BasicDataUpdDTO; |
| | | import com.finance.system.query.CurrentFieldsQuery; |
| | | import com.finance.system.query.HistoryDataQuery; |
| | | import com.finance.system.query.QuestionQuery; |
| | | import com.finance.system.query.ScoreCalculateDetailQuery; |
| | | import com.finance.system.query.ScoreCalculateQuery; |
| | | import com.finance.system.service.TbBasicDataService; |
| | | import com.finance.system.service.TbQuestionService; |
| | | import com.finance.system.service.TbScoreService; |
| | | import com.finance.system.vo.BasicDataVO; |
| | | import com.finance.system.vo.CurrentFieldsAllVO; |
| | | import com.finance.system.vo.CurrentFieldsDetailVO; |
| | | import com.finance.system.vo.CurrentFieldsVO; |
| | | import com.finance.system.vo.QuestionVO; |
| | | import com.finance.system.vo.ScoreCalculateDetailVO; |
| | | import com.finance.system.vo.ScoreCalculateVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.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.RequestPart; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/4/8 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/history-data") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "历史数据相关接口") |
| | | public class HistoryDataController { |
| | | |
| | | private final TbBasicDataService tbBasicDataService; |
| | | private final TbScoreService tbScoreService; |
| | | private final TbQuestionService tbQuestionService; |
| | | |
| | | /** |
| | | * 历史数据分页查询 |
| | | * |
| | | * @param dto 历史数据查询传输对象 |
| | | * @return R<PageDTO < BasicDataVO>> |
| | | */ |
| | | @PostMapping("/page-data") |
| | | @ApiOperation("历史数据分页查询") |
| | | public R<PageDTO<BasicDataVO>> pageData(@Validated @RequestBody HistoryDataQuery dto) { |
| | | Date startTime = dto.getStartTime(); |
| | | Date endTime = dto.getEndTime(); |
| | | boolean flag = Objects.nonNull(startTime) && Objects.nonNull(endTime); |
| | | Page<TbBasicData> page = |
| | | tbBasicDataService |
| | | .lambdaQuery() |
| | | .eq(TbBasicData::getStatus, ReportingStatusEnum.FILLED) |
| | | .between(flag, TbBasicData::getReportingTime, startTime, endTime) |
| | | .groupBy(TbBasicData::getQuarter) |
| | | .orderByDesc(TbBasicData::getReportingTime) |
| | | .page(new Page<>(dto.getPageNum(), dto.getPageSize())); |
| | | return R.ok(PageDTO.of(page, BasicDataVO.class)); |
| | | } |
| | | |
| | | /** |
| | | * 字段统计 |
| | | * |
| | | * @return R<PageDTO < CurrentFieldsVO>> |
| | | */ |
| | | @ApiOperation(value = "字段统计", notes = "字段统计") |
| | | @PostMapping("/fields-statics") |
| | | public R<PageDTO<CurrentFieldsVO>> historyFieldsStatics( |
| | | @Validated({HistoryGroup.class}) @RequestBody CurrentFieldsQuery dto) { |
| | | try { |
| | | return tbBasicDataService.historyFieldsStatics(dto); |
| | | } catch (Exception e) { |
| | | log.error("获取字段统计相关信息异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * |
| | | * @param id 基础数据id |
| | | * @return R<CurrentFieldsDetailVO> |
| | | */ |
| | | @GetMapping("/fields-details") |
| | | @ApiOperation(value = "字段统计-查看详情", notes = "字段统计") |
| | | @ApiImplicitParam( |
| | | name = "id", |
| | | value = "基础数据id", |
| | | required = true, |
| | | dataType = "int", |
| | | paramType = "query", |
| | | dataTypeClass = Long.class) |
| | | public R<CurrentFieldsDetailVO> fieldsDetails(@RequestParam("id") Long id) { |
| | | try { |
| | | return tbBasicDataService.fieldsDetails(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("保存当前季度数据异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/save-basic-data") |
| | | @ApiOperation("字段统计-保存数据") |
| | | public R<Void> editBasicData(@RequestBody BasicDataUpdDTO dto) { |
| | | try { |
| | | tbBasicDataService.editBasicData(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("保存数据异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 查看全部 |
| | | * |
| | | * @return R<CurrentFieldsAllVO> |
| | | */ |
| | | @GetMapping("/fields-statics-all") |
| | | @ApiOperation(value = "查看全部", notes = "字段统计") |
| | | @ApiImplicitParam( |
| | | name = "quarter", |
| | | value = "季度", |
| | | required = true, |
| | | dataType = "string", |
| | | paramType = "query", |
| | | dataTypeClass = String.class) |
| | | public R<CurrentFieldsAllVO> fieldsStaticsAll(@RequestParam("quarter") String quarter) { |
| | | try { |
| | | return R.ok(tbBasicDataService.fieldsStaticsAll(quarter)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("查看全部异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得分计算 |
| | | * |
| | | * @param query 得分计算条件查询对象 |
| | | * @return R<PageDTO < ScoreVO>> |
| | | */ |
| | | @PostMapping("/score-calculate") |
| | | @ApiOperation("得分计算") |
| | | public R<PageDTO<ScoreCalculateVO>> scoreCalculate( |
| | | @Validated({HistoryGroup.class}) @RequestBody ScoreCalculateQuery query) { |
| | | return R.ok(tbBasicDataService.scoreCalculatePage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 得分计算查看详情 |
| | | * |
| | | * @param query 得分计算详情条件查询对象 |
| | | * @return R<ScoreCalculateDetailVO> |
| | | */ |
| | | @PostMapping("/score-calculate-detail") |
| | | @ApiOperation("得分计算-查看详情") |
| | | public R<ScoreCalculateDetailVO> scoreCalculateDetail( |
| | | @Validated @RequestBody ScoreCalculateDetailQuery query) { |
| | | return R.ok(tbScoreService.scoreCalculateDetail(query)); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询问题 |
| | | * |
| | | * @param dto 发现问题分页数据传输对象 |
| | | * @return R<PageDTO < QuestionVO>> |
| | | */ |
| | | @PostMapping("/page-question") |
| | | @ApiOperation(value = "问题查看-分页查询问题", notes = "问题查看") |
| | | public R<PageDTO<QuestionVO>> pageQuestion( |
| | | @Validated({HistoryGroup.class}) @RequestBody QuestionQuery dto) { |
| | | return R.ok(tbQuestionService.pageQuestion(dto)); |
| | | } |
| | | |
| | | @PostMapping("/import") |
| | | @ApiOperation("导入历史数据") |
| | | @FinancialLog(title = "导入数据", businessType = BusinessType.IMPORT) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "file", value = "文件", required = true, dataType = "file", paramType = "form"), |
| | | @ApiImplicitParam(name = "quarter", value = "季度 e.g. 2024年一季度", required = true, dataType = "string", paramType = "query", dataTypeClass = String.class) |
| | | }) |
| | | public R<Void> importData(@RequestPart("file") MultipartFile file, |
| | | @RequestParam("quarter") String quarter) { |
| | | try { |
| | | tbBasicDataService.importData(file, quarter); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("导入历史数据异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | | @ApiOperation("导出") |
| | | @FinancialLog(title = "导出数据", businessType = BusinessType.EXPORT) |
| | | @ApiImplicitParam(name = "quarterList", value = "quarterList", allowMultiple = true, dataTypeClass = List.class, paramType = "query") |
| | | public void exportData(@RequestParam("quarterList") List<String> quarterList) { |
| | | try { |
| | | tbBasicDataService.exportData(quarterList); |
| | | } catch (Exception e) { |
| | | log.error("导出历史数据异常", e); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.system.domain.TbBasicDataCategory; |
| | | import com.finance.system.dto.BasicDataCategoryDTO; |
| | | import com.finance.system.dto.ShowHideDTO; |
| | | import com.finance.system.dto.update.BasicDataCategoryUpdateDTO; |
| | | import com.finance.system.query.BasicDataCategoryQuery; |
| | | import com.finance.system.service.TbBasicDataCategoryService; |
| | | import com.finance.system.vo.BasicDataCategoryVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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.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> |
| | | * 基础数据分类表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = {"基础数据分类相关接口"}) |
| | | @RequestMapping("/basic-data-category") |
| | | public class TbBasicDataCategoryController { |
| | | |
| | | private final TbBasicDataCategoryService tbBasicDataCategoryService; |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param dto 基础数据分类传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加") |
| | | public R<Void> add(@RequestBody @Validated BasicDataCategoryDTO dto) { |
| | | try { |
| | | tbBasicDataCategoryService.add(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("添加异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto 基础数据分类更新传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | public R<Void> add(@RequestBody @Validated BasicDataCategoryUpdateDTO dto) { |
| | | try { |
| | | tbBasicDataCategoryService.update(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id id |
| | | * @return R<Void> |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除") |
| | | public R<Void> delete(@RequestParam(value = "id") Long id) { |
| | | try { |
| | | tbBasicDataCategoryService.removeById(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("删除异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 根据id获取详情 |
| | | * |
| | | * @param id id |
| | | * @return R<BasicDataCategoryVO> |
| | | */ |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("根据id获取详情") |
| | | public R<BasicDataCategoryVO> getDetails(@RequestParam(value = "id") Long id) { |
| | | try { |
| | | TbBasicDataCategory basicDataCategory = tbBasicDataCategoryService.getById(id); |
| | | BasicDataCategoryVO vo = BeanUtils.copyBean(basicDataCategory, |
| | | BasicDataCategoryVO.class); |
| | | return R.ok(vo); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("根据id获取详情异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 隐藏显示操作 |
| | | * |
| | | * @param dto 显示隐藏操作数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("/show-hide") |
| | | @ApiOperation("隐藏显示操作") |
| | | public R<Void> showHide(@RequestBody ShowHideDTO dto) { |
| | | try { |
| | | tbBasicDataCategoryService.showHide(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("隐藏显示操作异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 分页条件查询 |
| | | * |
| | | * @param query 基础数据分类条件查询对象 |
| | | * @return R<PageDTO < BasicDataCategoryVO>> |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<BasicDataCategoryVO>> page( |
| | | @Validated @RequestBody BasicDataCategoryQuery query) { |
| | | try { |
| | | return R.ok(tbBasicDataCategoryService.queryPage(query)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.enums.ShowStatusEnum; |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.system.domain.TbBasicDataCategory; |
| | | import com.finance.system.dto.BasicDataConfigDTO; |
| | | import com.finance.system.dto.ShowHideDTO; |
| | | import com.finance.system.dto.update.BasicDataConfigUpdateDTO; |
| | | import com.finance.system.query.BasicDataConfigQuery; |
| | | import com.finance.system.query.FieldQuery; |
| | | import com.finance.system.service.TbBasicDataCategoryService; |
| | | import com.finance.system.service.TbBasicDataConfigService; |
| | | import com.finance.system.service.TbFieldService; |
| | | import com.finance.system.vo.BasicDataCategoryVO; |
| | | import com.finance.system.vo.BasicDataConfigDetailVO; |
| | | import com.finance.system.vo.BasicDataConfigVO; |
| | | import com.finance.system.vo.FieldVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | 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.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> |
| | | * 基础数据配置表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-18 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = {"基础数据配置相关接口"}) |
| | | @RequestMapping("/basic-data-config") |
| | | public class TbBasicDataConfigController { |
| | | |
| | | private final TbBasicDataConfigService tbBasicDataConfigService; |
| | | private final TbBasicDataCategoryService tbBasicDataCategoryService; |
| | | private final TbFieldService tbFieldService; |
| | | |
| | | /** |
| | | * 获取分类列表 |
| | | * |
| | | * @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(); |
| | | return R.ok(BeanUtils.copyList(list, BasicDataCategoryVO.class)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取分类列表异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 分页条件查询字段 |
| | | * |
| | | * @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 type |
| | | * @return |
| | | */ |
| | | @GetMapping("/list-fields") |
| | | @ApiOperation(value = "查询状态为展示中的字段列表", notes = "基础数据配置、大屏数据配置") |
| | | @ApiImplicitParam(name = "type", value = "数字、文本、百分比", required = false, dataType = "string", paramType = "query", dataTypeClass = String.class) |
| | | public R<List<FieldVO>> listFields(String type) { |
| | | try { |
| | | return R.ok(tbFieldService.listFields(type)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("查询状态为展示中字段列表异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param dto 基础数据配置数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加") |
| | | public R<Void> add(@RequestBody @Validated BasicDataConfigDTO dto) { |
| | | try { |
| | | tbBasicDataConfigService.add(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("添加异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto 基础数据配置数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | public R<Void> edit(@RequestBody @Validated BasicDataConfigUpdateDTO dto) { |
| | | try { |
| | | tbBasicDataConfigService.edit(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * |
| | | * @param id id |
| | | * @return R<BasicDataConfigDetailVO> |
| | | */ |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("获取详情") |
| | | public R<BasicDataConfigDetailVO> getDetails(Long id) { |
| | | try { |
| | | BasicDataConfigDetailVO details = tbBasicDataConfigService.getDetails(id); |
| | | return R.ok(details); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取详情异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id id |
| | | * @return R<Void> |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除") |
| | | public R<Void> delete(Long id) { |
| | | try { |
| | | tbBasicDataConfigService.delete(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("删除异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 隐藏显示操作 |
| | | * |
| | | * @param dto 显示隐藏操作数据传输对象 |
| | | * @return R<Void> |
| | | */ |
| | | @PostMapping("show-hide") |
| | | @ApiOperation("隐藏显示操作") |
| | | public R<Void> showHide(@RequestBody ShowHideDTO dto) { |
| | | try { |
| | | tbBasicDataConfigService.showHide(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("隐藏显示操作异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 分页条件查询 |
| | | * |
| | | * @param query 基础数据条件查询对象 |
| | | * @return R<PageDTO < BasicDataConfigVO>> |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<BasicDataConfigVO>> page(@Validated @RequestBody BasicDataConfigQuery query) { |
| | | try { |
| | | PageDTO<BasicDataConfigVO> basicDataConfigVOPageDTO = tbBasicDataConfigService.queryPage( |
| | | query); |
| | | return R.ok(basicDataConfigVOPageDTO); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 基础数据配置详情表(存储文本和百分比的配置) 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/tb-basic-data-config-detail") |
| | | public class TbBasicDataConfigDetailController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 基础数据表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/tb-basic-data") |
| | | public class TbBasicDataController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 基础数据非固定字段表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/tb-basic-data-field") |
| | | public class TbBasicDataFieldController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.system.dto.update.DataIndicatorsUpdDTO; |
| | | import com.finance.system.dto.update.FormalIndicatorsUpdDTO; |
| | | import com.finance.system.dto.update.RiskLevelUpdDTO; |
| | | import com.finance.system.query.DataScreenConfigQuery; |
| | | import com.finance.system.service.TbDataScreenConfigService; |
| | | import com.finance.system.vo.DataScreenConfigVO; |
| | | 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.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 大屏数据配置表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/data-screen-config") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = {"大屏数据配置相关接口"}) |
| | | public class TbDataScreenConfigController { |
| | | |
| | | private final TbDataScreenConfigService tbDataScreenConfigService; |
| | | |
| | | @PostMapping("/get-risk-level") |
| | | @ApiOperation("获取风险等级设置") |
| | | public R<DataScreenConfigVO> getRiskLevel() { |
| | | try { |
| | | return R.ok(tbDataScreenConfigService.getRiskLevel()); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/edit-risk-level") |
| | | @ApiOperation("编辑风险等级设置") |
| | | public R<DataScreenConfigVO> editRiskLevel( |
| | | @Validated @RequestBody RiskLevelUpdDTO dto) { |
| | | try { |
| | | return R.ok(tbDataScreenConfigService.editRiskLevel(dto)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/get-indicators") |
| | | @ApiOperation("获取数据指标/形式指标级配置") |
| | | public R<List<DataScreenConfigVO>> getIndicatorsConfig( |
| | | @Validated @RequestBody DataScreenConfigQuery query) { |
| | | try { |
| | | return R.ok(tbDataScreenConfigService.getIndicatorsConfig(query.getType())); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/edit-data-indicators") |
| | | @ApiOperation("编辑数据指标标级配置") |
| | | public R<List<DataScreenConfigVO>> editDataIndicatorsConfig( |
| | | @Validated @RequestBody List<DataIndicatorsUpdDTO> dtoList) { |
| | | try { |
| | | return R.ok(tbDataScreenConfigService.editDataIndicatorsConfig(dtoList)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/edit-formal-indicators") |
| | | @ApiOperation("编辑形式指标标级配置") |
| | | public R<List<DataScreenConfigVO>> editFormalIndicatorsConfig( |
| | | @Validated @RequestBody List<FormalIndicatorsUpdDTO> dtoList) { |
| | | try { |
| | | return R.ok(tbDataScreenConfigService.editFormalIndicatorsConfig(dtoList)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.common.utils.CollUtils; |
| | | import com.finance.common.utils.EasyExcelUtil; |
| | | import com.finance.common.utils.SecurityUtils; |
| | | import com.finance.system.dto.update.DeptFocusDTO; |
| | | import com.finance.system.dto.update.DeptUpdateDTO; |
| | | import com.finance.system.handler.CustomCellWriteHandler; |
| | | import com.finance.system.handler.TitleHandler; |
| | | import com.finance.system.query.DeptQuery; |
| | | import com.finance.system.service.ISysUserService; |
| | | import com.finance.system.service.TbDeptService; |
| | | import com.finance.system.vo.DeptVO; |
| | | import com.finance.web.controller.excel.DeptExcel; |
| | | import com.finance.web.controller.lisenter.DeptImportListener; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.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.RequestPart; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * <p> |
| | | * 部门管理表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/dept") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "部门管理相关接口") |
| | | public class TbDeptController { |
| | | |
| | | private final HttpServletResponse response; |
| | | private final TbDeptService tbDeptService; |
| | | private final ISysUserService sysUserService; |
| | | |
| | | /** |
| | | * 导入模板下载 |
| | | */ |
| | | @GetMapping("/download") |
| | | @ApiOperation("模板下载") |
| | | public void download() { |
| | | try { |
| | | //ArrayList<TbDept> list = new ArrayList<>(); |
| | | //ExcelUtil.exportExcel(list, "部门导入模板", "部门导入模板", TbDept.class, "部门导入模板", response); |
| | | // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 |
| | | String fileName = URLEncoder.encode("部门导入模板", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | Map<Integer, String[]> selectedMap = new HashMap<>(); |
| | | selectedMap.put(3, new String[]{"省本级", "市", "开发区", "县"}); |
| | | selectedMap.put(4, new String[]{"是", "否"}); |
| | | EasyExcel.write(response.getOutputStream(), DeptExcel.class).sheet("模板") |
| | | .registerWriteHandler(EasyExcelUtil.getStyleStrategy()) |
| | | .registerWriteHandler(new CustomCellWriteHandler()) |
| | | .registerWriteHandler(new TitleHandler(selectedMap)) |
| | | .doWrite(CollUtils.emptyList()); |
| | | } catch (Exception e) { |
| | | log.error("模板下载异常", e); |
| | | throw new ServiceException("模板下载失败,请联系管理员!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导入 |
| | | * |
| | | * @param file 文件 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/import") |
| | | @ApiOperation("导入") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Void> importExcel(@RequestPart("file") MultipartFile file) { |
| | | try { |
| | | //tbDeptService.importExcel(file); |
| | | InputStream inputStream = file.getInputStream(); |
| | | EasyExcel.read(inputStream, DeptExcel.class, new DeptImportListener(sysUserService)) |
| | | .sheet().doRead(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("导入失败", e); |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 分页条件查询 |
| | | * |
| | | * @param query 查询条件 |
| | | * @return R<PageVO < DeptVO>> |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<DeptVO>> page(@Validated @RequestBody DeptQuery query) { |
| | | try { |
| | | return R.ok(tbDeptService.queryPage(query)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询部门详情 |
| | | * |
| | | * @param userId 部门id |
| | | * @return DeptVO |
| | | */ |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("根据id查询部门详情") |
| | | public R<DeptVO> getDetails(@RequestParam Long userId) { |
| | | try { |
| | | Optional<SysUser> sysUser = sysUserService.lambdaQuery().eq(SysUser::getUserId, userId) |
| | | .oneOpt(); |
| | | if (sysUser.isPresent()) { |
| | | return R.ok(BeanUtils.copyBean(sysUser.get(), DeptVO.class)); |
| | | } |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("根据id查询部门详情异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(new DeptVO()); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto 部门更新实体 |
| | | * @return 响应成功 |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | public R<Void> edit(@RequestBody DeptUpdateDTO dto) { |
| | | try { |
| | | dto.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | sysUserService.lambdaUpdate().set(SysUser::getAreaAlias, dto.getAreaAlias()) |
| | | .set(SysUser::getPersonInCharge, dto.getPersonInCharge()) |
| | | .set(SysUser::getPhoneNumber, dto.getPhoneNumber()) |
| | | .set(SysUser::getUserName, dto.getUserName()) |
| | | .set(SysUser::getPassword, dto.getPassword()) |
| | | .eq(SysUser::getUserId, dto.getUserId()) |
| | | .update(); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 重点关注 |
| | | * |
| | | * @param dto 部门更新实体 |
| | | * @return 响应成功 |
| | | */ |
| | | @PostMapping("/focus") |
| | | @ApiOperation("重点关注") |
| | | public R<Object> focus(@RequestBody DeptFocusDTO dto) { |
| | | tbDeptService.focus(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 部门未上传季度数据提示 |
| | | * |
| | | * @return Void |
| | | */ |
| | | @PostMapping("/reporting-message") |
| | | @ApiOperation(value = "部门未上传季度数据提示", notes = "code=200不展示,code=500 展示返回的msg") |
| | | public R<Void> reportingMessage() { |
| | | return tbDeptService.reportingMessage(); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.system.dto.FieldCategoryDTO; |
| | | import com.finance.system.dto.ShowHideDTO; |
| | | import com.finance.system.dto.update.FieldCategoryUpdateDTO; |
| | | import com.finance.system.query.FieldCategoryQuery; |
| | | import com.finance.system.service.TbFieldCategoryService; |
| | | import com.finance.system.vo.FieldCategoryDetailVO; |
| | | import com.finance.system.vo.FieldCategoryVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * 字段分类表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/field-category") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "字段分类管理相关接口") |
| | | public class TbFieldCategoryController { |
| | | |
| | | private final TbFieldCategoryService tbFieldCategoryService; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param dto 字段分类数据传输对象 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加") |
| | | public R<Object> add(@RequestBody @Validated FieldCategoryDTO dto) { |
| | | try { |
| | | tbFieldCategoryService.add(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("添加异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 根据id获取字段分类详情 |
| | | * @param id 字段分类id |
| | | * @return R |
| | | */ |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("根据id获取字段分类详情") |
| | | public R<FieldCategoryDetailVO> getById(@RequestParam(value = "id") Long id) { |
| | | try { |
| | | FieldCategoryDetailVO vo = tbFieldCategoryService.getDetailsById(id); |
| | | return R.ok(vo); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("根据id获取字段分类详情异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 分页条件查询 |
| | | * @param query 部门条件查询对象 |
| | | * @return PageVO<FieldCategoryDetailVO> |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<FieldCategoryVO>> page(@Validated @RequestBody FieldCategoryQuery query) { |
| | | try { |
| | | return R.ok(tbFieldCategoryService.queryPage(query)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 隐藏显示操作 |
| | | * @param dto 显示隐藏操作数据传输对象 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/show-hide") |
| | | @ApiOperation("隐藏显示操作") |
| | | public R<Void> showHide(@RequestBody ShowHideDTO dto) { |
| | | try { |
| | | tbFieldCategoryService.showHide(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("隐藏显示操作异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除分类子节点 |
| | | * @param id id |
| | | * @return R |
| | | */ |
| | | @DeleteMapping("/delete-children") |
| | | @ApiOperation("编辑页面删除子字段分类") |
| | | public R<Object> deleteChildren(@RequestParam(value = "id") Long id){ |
| | | try { |
| | | tbFieldCategoryService.deleteChildren(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑页面删除子字段分类异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除分类 |
| | | * @param id id |
| | | * @return R |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("列表页面删除分类") |
| | | public R<Void> delete(@RequestParam(value = "id") Long id){ |
| | | try { |
| | | tbFieldCategoryService.delete(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("列表页面删除分类异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑分类 |
| | | * @param dto 字段分类更新数据传输对象 |
| | | * @return R |
| | | */ |
| | | @PutMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | public R<Object> edit(@RequestBody FieldCategoryUpdateDTO dto) { |
| | | try { |
| | | tbFieldCategoryService.edit(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.system.domain.TbField; |
| | | import com.finance.system.dto.FieldDTO; |
| | | import com.finance.system.dto.ShowHideDTO; |
| | | import com.finance.system.dto.update.FieldUpdateDTO; |
| | | import com.finance.system.query.FieldQuery; |
| | | import com.finance.system.service.TbFieldCategoryService; |
| | | import com.finance.system.service.TbFieldService; |
| | | import com.finance.system.vo.FieldCategoryVO; |
| | | import com.finance.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.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> |
| | | * 字段表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/field") |
| | | @Api(tags = "字段管理相关接口") |
| | | public class TbFieldController { |
| | | |
| | | private final TbFieldService tbFieldService; |
| | | private final TbFieldCategoryService tbFieldCategoryService; |
| | | |
| | | /** |
| | | * 获取分类列表 |
| | | * |
| | | * @param id 分类id |
| | | * @return 分类列表 |
| | | */ |
| | | @GetMapping("/categories") |
| | | @ApiOperation(value = "获取分类列表", notes = "一级分类id传0,二级分类传一级分类id,三级分类同理") |
| | | public R<List<FieldCategoryVO>> queryFieldCategories(@RequestParam Long id) { |
| | | try { |
| | | return R.ok(tbFieldCategoryService.queryFieldCategories(id)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取分类列表异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加字段 |
| | | * |
| | | * @param dto 字段数据传输对象 |
| | | * @return 响应状态 |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加字段") |
| | | public R<Void> add(@RequestBody @Validated FieldDTO dto) { |
| | | try { |
| | | tbFieldService.add(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("添加字段异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/influenced-data") |
| | | @ApiOperation("隐藏字段,获取同步隐藏的基础数据") |
| | | public R<String> influencedData(@RequestParam Long id) { |
| | | try { |
| | | return R.ok(tbFieldService.influencedData(id)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取同步隐藏的基础数据异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 隐藏显示操作 |
| | | * |
| | | * @param dto 显示隐藏操作数据传输对象 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/show-hide") |
| | | @ApiOperation("隐藏显示操作") |
| | | public R<Void> showHide(@RequestBody ShowHideDTO dto) { |
| | | try { |
| | | tbFieldService.showHide(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("隐藏显示操作异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 编辑字段 |
| | | * |
| | | * @param dto 字段数据传输对象 |
| | | * @return 响应状态 |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑字段") |
| | | public R<Void> editField(@RequestBody @Validated FieldUpdateDTO dto) { |
| | | try { |
| | | tbFieldService.editField(dto); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("编辑字段异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 分页条件查询 |
| | | * |
| | | * @param query 部门条件查询对象 |
| | | * @return PageVO<FieldCategoryDetailVO> |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("分页条件查询") |
| | | public R<PageDTO<FieldVO>> page(@Validated @RequestBody FieldQuery query) { |
| | | try { |
| | | return R.ok(tbFieldService.queryPage(query)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("分页条件查询异常", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * |
| | | * @param id id |
| | | * @return FieldVO |
| | | */ |
| | | @GetMapping("/get-details") |
| | | @ApiOperation("获取详情") |
| | | public R<FieldVO> getDetails(@RequestParam Long id) { |
| | | try { |
| | | TbField field = tbFieldService.getById(id); |
| | | return R.ok(BeanUtils.copyBean(field, FieldVO.class)); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取详情", e); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id id |
| | | * @return 响应状态 |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除") |
| | | public R<Void> delete(@RequestParam Long id) { |
| | | try { |
| | | tbFieldService.removeById(id); |
| | | } catch (Exception e) { |
| | | if (e instanceof ServiceException) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | log.error("获取详情", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 模板下载 |
| | | */ |
| | | @GetMapping("/download") |
| | | @ApiOperation("模板下载") |
| | | public void downloadImportTemplate() { |
| | | try { |
| | | tbFieldService.downloadImportTemplate(); |
| | | } catch (Exception e) { |
| | | log.error("模板下载异常", e); |
| | | throw new ServiceException("模板下载失败,请联系管理员!"); |
| | | } |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.system.query.OperLogQuery; |
| | | import com.finance.system.service.TbOperLogService; |
| | | import com.finance.system.vo.OperLogVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-04-15 |
| | | */ |
| | | @Api(tags = {"操作日志"}) |
| | | @RestController |
| | | @RequestMapping("/oper-log") |
| | | @RequiredArgsConstructor |
| | | public class TbOperLogController { |
| | | |
| | | private final TbOperLogService tbOperLogService; |
| | | |
| | | @ApiOperation("查询日志列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<OperLogVO>> queryPage(@Validated @RequestBody OperLogQuery query) { |
| | | return R.ok(tbOperLogService.queryPage(query)); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 发现问题表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/tb-question") |
| | | public class TbQuestionController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 得分表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/tb-score") |
| | | public class TbScoreController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.api.screen; |
| | | |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.system.query.TransferPaymentScaleQuery; |
| | | import com.finance.system.service.ISysUserService; |
| | | import com.finance.system.vo.BasicDataVO; |
| | | import com.finance.system.vo.ProvinceStaticsVO; |
| | | import com.finance.system.vo.RiskAndTransferVO; |
| | | import com.finance.system.vo.RiskRankingVO; |
| | | import com.finance.system.vo.TransferPaymentScaleVO; |
| | | import com.finance.web.controller.service.ScreenService; |
| | | 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.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; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/4/15 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/screen") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "大屏财政运行总体接口") |
| | | public class ScreenGeneralController { |
| | | |
| | | private final ISysUserService sysUserService; |
| | | private final ScreenService screenService; |
| | | |
| | | @ApiOperation("全省统计数") |
| | | @GetMapping("/province-statics") |
| | | public R<ProvinceStaticsVO> provinceStatics() { |
| | | ProvinceStaticsVO vo = screenService.provinceStatics(); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | @ApiOperation(value = "风险等级分布占比/得分分布/转移支付规模") |
| | | @GetMapping("/risk-and-payment-scale") |
| | | public R<RiskAndTransferVO> getRiskAndTransfer() { |
| | | RiskAndTransferVO vo = null; |
| | | try { |
| | | vo = screenService.getRiskAndTransfer(); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | @ApiOperation("转移支付规模季度列表") |
| | | @GetMapping("/quarter-list") |
| | | public R<List<BasicDataVO>> quarterList() { |
| | | return R.ok(screenService.quarterList()); |
| | | } |
| | | |
| | | @ApiOperation("转移支付规模分页查询") |
| | | @PostMapping("/transfer-payment-scale-page") |
| | | public R<PageDTO<TransferPaymentScaleVO>> transferPaymentScalePage(@Validated |
| | | @RequestBody TransferPaymentScaleQuery query) { |
| | | PageDTO<TransferPaymentScaleVO> page = screenService.transferPaymentScalePage(query); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation("区/县风险排名前十") |
| | | @GetMapping("/risk-ranking") |
| | | public R<List<RiskRankingVO>> riskRanking() { |
| | | try { |
| | | return R.ok(screenService.riskRanking()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.api.screen; |
| | | |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.system.query.CalculateDetailQuery; |
| | | import com.finance.system.query.DeptCalculateDetailQuery; |
| | | import com.finance.system.service.ISysUserService; |
| | | import com.finance.system.service.TbScoreService; |
| | | import com.finance.system.vo.CurrentFieldsDetailVO; |
| | | import com.finance.system.vo.DataAnalysisVO; |
| | | import com.finance.system.vo.DeptCalculateDetailVO; |
| | | import com.finance.system.vo.DeptVO; |
| | | import com.finance.system.vo.QuestionVO; |
| | | import com.finance.system.vo.ScoreCalculateDetailVO; |
| | | import com.finance.web.controller.service.ScreenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | 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.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; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/4/15 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/screen") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "大屏分析评估系统接口") |
| | | public class ScreenInnerController { |
| | | |
| | | private final ISysUserService sysUserService; |
| | | private final ScreenService screenService; |
| | | private final TbScoreService tbScoreService; |
| | | |
| | | @ApiOperation("部门列表-区县下拉框") |
| | | @GetMapping("/dept-list") |
| | | @ApiImplicitParam(name = "areaCode", value = "市级区划代码", dataType = "String", dataTypeClass = String.class) |
| | | public R<List<DeptVO>> deptList(String areaCode) { |
| | | List<SysUser> list = screenService.getCountyList(areaCode); |
| | | return R.ok(BeanUtils.copyList(list, DeptVO.class)); |
| | | } |
| | | |
| | | // @ApiOperation(value = "监管发现问题") |
| | | @GetMapping("/questions") |
| | | public R<List<QuestionVO>> queryQuestions() { |
| | | try { |
| | | return R.ok(screenService.queryQuestions()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("数据分析系统页面数据") |
| | | @GetMapping("/data") |
| | | public R<DataAnalysisVO> getDataAnalysis(@RequestParam("areaCode") String areaCode) { |
| | | try { |
| | | return R.ok(screenService.getDataAnalysis(areaCode)); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("获取点击字段弹窗数据") |
| | | @PostMapping("/fields-detail") |
| | | public R<ScoreCalculateDetailVO> fieldsDetail( |
| | | @Validated @RequestBody CalculateDetailQuery query) { |
| | | return R.ok(screenService.fieldsDetail(query)); |
| | | } |
| | | |
| | | @ApiOperation("获取点击部门得分弹窗数据") |
| | | @PostMapping("/dept-detail") |
| | | public R<List<DeptCalculateDetailVO>> deptDetail( |
| | | @Validated @RequestBody DeptCalculateDetailQuery query) { |
| | | try { |
| | | return R.ok(screenService.deptCalculateDetail(query)); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("查看原始数据") |
| | | @GetMapping("/view-raw-data") |
| | | public R<CurrentFieldsDetailVO> viewRawData(@RequestParam("areaCode") String areaCode) { |
| | | try { |
| | | return R.ok(screenService.viewRawData(areaCode)); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.common; |
| | | |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.util.concurrent.TimeUnit; |
| | | import javax.annotation.Resource; |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.FastByteArrayOutputStream; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.google.code.kaptcha.Producer; |
| | | import com.finance.common.config.RuoYiConfig; |
| | | import com.finance.common.constant.CacheConstants; |
| | | import com.finance.common.constant.Constants; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.redis.RedisCache; |
| | | import com.finance.common.utils.sign.Base64; |
| | | import com.finance.common.utils.uuid.IdUtils; |
| | | import com.finance.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 验证码操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class CaptchaController |
| | | { |
| | | @Resource(name = "captchaProducer") |
| | | private Producer captchaProducer; |
| | | |
| | | @Resource(name = "captchaProducerMath") |
| | | private Producer captchaProducerMath; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | /** |
| | | * 生成验证码 |
| | | */ |
| | | @GetMapping("/captchaImage") |
| | | public AjaxResult getCode(HttpServletResponse response) throws IOException |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | boolean captchaEnabled = configService.selectCaptchaEnabled(); |
| | | ajax.put("captchaEnabled", captchaEnabled); |
| | | if (!captchaEnabled) |
| | | { |
| | | return ajax; |
| | | } |
| | | |
| | | // 保存验证码信息 |
| | | String uuid = IdUtils.simpleUUID(); |
| | | String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; |
| | | |
| | | String capStr = null, code = null; |
| | | BufferedImage image = null; |
| | | |
| | | // 生成验证码 |
| | | String captchaType = RuoYiConfig.getCaptchaType(); |
| | | if ("math".equals(captchaType)) |
| | | { |
| | | String capText = captchaProducerMath.createText(); |
| | | capStr = capText.substring(0, capText.lastIndexOf("@")); |
| | | code = capText.substring(capText.lastIndexOf("@") + 1); |
| | | image = captchaProducerMath.createImage(capStr); |
| | | } |
| | | else if ("char".equals(captchaType)) |
| | | { |
| | | capStr = code = captchaProducer.createText(); |
| | | image = captchaProducer.createImage(capStr); |
| | | } |
| | | |
| | | redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES); |
| | | // 转换流信息写出 |
| | | FastByteArrayOutputStream os = new FastByteArrayOutputStream(); |
| | | try |
| | | { |
| | | ImageIO.write(image, "jpg", os); |
| | | } |
| | | catch (IOException e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | |
| | | ajax.put("uuid", uuid); |
| | | ajax.put("img", Base64.encode(os.toByteArray())); |
| | | return ajax; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.common; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.finance.common.config.RuoYiConfig; |
| | | import com.finance.common.constant.Constants; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.common.utils.file.FileUploadUtils; |
| | | import com.finance.common.utils.file.FileUtils; |
| | | import com.finance.framework.config.ServerConfig; |
| | | |
| | | /** |
| | | * 通用请求处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/common") |
| | | public class CommonController |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(CommonController.class); |
| | | |
| | | @Autowired |
| | | private ServerConfig serverConfig; |
| | | |
| | | private static final String FILE_DELIMETER = ","; |
| | | |
| | | /** |
| | | * 通用下载请求 |
| | | * |
| | | * @param fileName 文件名称 |
| | | * @param delete 是否删除 |
| | | */ |
| | | @GetMapping("/download") |
| | | public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) |
| | | { |
| | | try |
| | | { |
| | | if (!FileUtils.checkAllowDownload(fileName)) |
| | | { |
| | | throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); |
| | | } |
| | | String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); |
| | | String filePath = RuoYiConfig.getDownloadPath() + fileName; |
| | | |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, realFileName); |
| | | FileUtils.writeBytes(filePath, response.getOutputStream()); |
| | | if (delete) |
| | | { |
| | | FileUtils.deleteFile(filePath); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("下载文件失败", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通用上传请求(单个) |
| | | */ |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file) throws Exception |
| | | { |
| | | try |
| | | { |
| | | // 上传文件路径 |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | // 上传并返回新文件名称 |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("url", url); |
| | | ajax.put("fileName", fileName); |
| | | ajax.put("newFileName", FileUtils.getName(fileName)); |
| | | ajax.put("originalFilename", file.getOriginalFilename()); |
| | | return ajax; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通用上传请求(多个) |
| | | */ |
| | | @PostMapping("/uploads") |
| | | public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception |
| | | { |
| | | try |
| | | { |
| | | // 上传文件路径 |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | List<String> urls = new ArrayList<String>(); |
| | | List<String> fileNames = new ArrayList<String>(); |
| | | List<String> newFileNames = new ArrayList<String>(); |
| | | List<String> originalFilenames = new ArrayList<String>(); |
| | | for (MultipartFile file : files) |
| | | { |
| | | // 上传并返回新文件名称 |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | urls.add(url); |
| | | fileNames.add(fileName); |
| | | newFileNames.add(FileUtils.getName(fileName)); |
| | | originalFilenames.add(file.getOriginalFilename()); |
| | | } |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); |
| | | ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | return ajax; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 本地资源通用下载 |
| | | */ |
| | | @GetMapping("/download/resource") |
| | | public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) |
| | | throws Exception |
| | | { |
| | | try |
| | | { |
| | | if (!FileUtils.checkAllowDownload(resource)) |
| | | { |
| | | throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource)); |
| | | } |
| | | // 本地资源路径 |
| | | String localPath = RuoYiConfig.getProfile(); |
| | | // 数据库资源地址 |
| | | String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX); |
| | | // 下载名称 |
| | | String downloadName = StringUtils.substringAfterLast(downloadPath, "/"); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, downloadName); |
| | | FileUtils.writeBytes(downloadPath, response.getOutputStream()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("下载文件失败", e); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.conveter; |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.GlobalConfiguration; |
| | | import com.alibaba.excel.metadata.data.ReadCellData; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | import com.alibaba.excel.metadata.property.ExcelContentProperty; |
| | | import com.finance.common.enums.DisabledEnum; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/28 |
| | | */ |
| | | public class CountyFlagConverter implements Converter<DisabledEnum> { |
| | | @Override |
| | | public Class<?> supportJavaTypeKey() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public DisabledEnum convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | if (cellData.toString().equals("是")) { |
| | | return DisabledEnum.YES; |
| | | } else { |
| | | return DisabledEnum.NO; |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public WriteCellData<?> convertToExcelData(DisabledEnum value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | return Converter.super.convertToExcelData(value, contentProperty, globalConfiguration); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.excel; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.finance.common.enums.DisabledEnum; |
| | | import com.finance.web.controller.conveter.CountyFlagConverter; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 部门管理表 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-03-13 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="部门导入Excel对象") |
| | | public class DeptExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "部门地区") |
| | | @Excel(name = "部门地区") |
| | | @ExcelProperty(value = "部门地区",index = 0) |
| | | private String areaName; |
| | | |
| | | @ApiModelProperty(value = "别名") |
| | | @Excel(name = "别名") |
| | | @ExcelProperty(value = "别名",index = 1) |
| | | private String areaAlias; |
| | | |
| | | @ApiModelProperty(value = "区划代码") |
| | | @Excel(name = "区划代码") |
| | | @ExcelProperty(value = "区划代码",index = 2) |
| | | private String areaCode; |
| | | |
| | | @ApiModelProperty(value = "级次(省、市、县)") |
| | | @Excel(name = "级次(省、市、县)") |
| | | @ExcelProperty(value = "级次 (省、市、县)",index = 3) |
| | | private String areaLevel; |
| | | |
| | | @ApiModelProperty(value = "县级标志(不包含直辖市的区 0:否 1:是)") |
| | | @Excel(name = "县级标志 是/否",enumImportMethod = "getByDesc") |
| | | @ExcelProperty(value = "县级标志 是/否",index = 4,converter = CountyFlagConverter.class) |
| | | private DisabledEnum countyFlag; |
| | | |
| | | @ApiModelProperty(value = "登录账号") |
| | | @Excel(name = "登录账号") |
| | | @ExcelProperty(value = "登录账号",index = 6) |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "负责人姓名") |
| | | @ExcelProperty(value = "负责人姓名",index = 5) |
| | | private String personInCharge; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @Excel(name = "联系电话") |
| | | @ExcelProperty(value = "联系电话",index = 7) |
| | | private String phoneNumber; |
| | | |
| | | @ApiModelProperty(value = "登录密码") |
| | | @Excel(name = "登录密码") |
| | | @ExcelProperty(value = "登录密码",index = 8) |
| | | private String password; |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.interceptor; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | public class MybatisConfiguration { |
| | | |
| | | /** |
| | | * 注册拦截器 |
| | | */ |
| | | @Bean |
| | | public MybatisInterceptor getMybatisInterceptor() { |
| | | return new MybatisInterceptor(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.interceptor; |
| | | |
| | | import com.finance.framework.web.service.TokenService; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Properties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.executor.Executor; |
| | | import org.apache.ibatis.mapping.MappedStatement; |
| | | import org.apache.ibatis.mapping.SqlCommandType; |
| | | import org.apache.ibatis.plugin.Interceptor; |
| | | import org.apache.ibatis.plugin.Intercepts; |
| | | import org.apache.ibatis.plugin.Invocation; |
| | | import org.apache.ibatis.plugin.Plugin; |
| | | import org.apache.ibatis.plugin.Signature; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @Intercepts({@Signature(type = Executor.class, method = "update" , args = {MappedStatement.class, |
| | | Object.class})}) |
| | | public class MybatisInterceptor implements Interceptor { |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Override |
| | | public Object intercept(Invocation invocation) throws Throwable { |
| | | MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0]; |
| | | log.debug("{}:" + mappedStatement); |
| | | log.debug("------sqlId------" + mappedStatement.getId()); |
| | | if ("com.finance.system.mapper.SysLogininforMapper.insertLogininfor".equals( |
| | | mappedStatement.getId())) { |
| | | return invocation.proceed(); |
| | | } |
| | | // sql类型:insert、update、select、delete |
| | | SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType(); |
| | | Object parameter = invocation.getArgs()[1]; |
| | | log.debug("------sqlCommandType------" + sqlCommandType); |
| | | |
| | | if (parameter == null) { |
| | | return invocation.proceed(); |
| | | } |
| | | |
| | | // 当sql为新增或更新类型时,自动填充操作人相关信息 |
| | | if (SqlCommandType.INSERT == sqlCommandType) { |
| | | |
| | | Field[] fields = getAllFields(parameter); |
| | | for (Field field : fields) { |
| | | try { |
| | | // 注入创建人 |
| | | if ("createBy".equals(field.getName())) { |
| | | // 获取当前登录用户信息 |
| | | if (Objects.nonNull(tokenService.getLoginUser())) { |
| | | String userName = tokenService.getLoginUser().getUser().getUserName(); |
| | | field.setAccessible(true); |
| | | field.set(parameter, userName); |
| | | field.setAccessible(false); |
| | | } |
| | | } |
| | | //注入创建时间 |
| | | if ("createTime".equals(field.getName())) { |
| | | field.setAccessible(true); |
| | | field.set(parameter, new Date()); |
| | | field.setAccessible(false); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("failed to insert data, exception = " , e); |
| | | } |
| | | } |
| | | } |
| | | if (SqlCommandType.UPDATE == sqlCommandType) { |
| | | Field[] fields = getAllFields(parameter); |
| | | for (Field field : fields) { |
| | | try { |
| | | if ("updateBy".equals(field.getName())) { |
| | | // 获取当前登录用户信息 |
| | | if (Objects.nonNull(tokenService.getLoginUser())) { |
| | | String userName = tokenService.getLoginUser().getUser().getUserName(); |
| | | field.setAccessible(true); |
| | | field.set(parameter, userName); |
| | | field.setAccessible(false); |
| | | } |
| | | } |
| | | if ("updateTime".equals(field.getName())) { |
| | | field.setAccessible(true); |
| | | field.set(parameter, new Date()); |
| | | field.setAccessible(false); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("failed to update data, exception = " , e); |
| | | } |
| | | } |
| | | } |
| | | return invocation.proceed(); |
| | | } |
| | | |
| | | @Override |
| | | public Object plugin(Object target) { |
| | | return Plugin.wrap(target, this); |
| | | } |
| | | |
| | | @Override |
| | | public void setProperties(Properties properties) { |
| | | // TODO Auto-generated method stub |
| | | } |
| | | |
| | | /** |
| | | * 获取类的所有属性,包括父类 |
| | | * |
| | | * @param object |
| | | * @return |
| | | */ |
| | | private Field[] getAllFields(Object object) { |
| | | Class<?> clazz = object.getClass(); |
| | | List<Field> fieldList = new ArrayList<>(); |
| | | while (clazz != null) { |
| | | fieldList.addAll(new ArrayList<>(Arrays.asList(clazz.getDeclaredFields()))); |
| | | clazz = clazz.getSuperclass(); |
| | | } |
| | | Field[] fields = new Field[fieldList.size()]; |
| | | fieldList.toArray(fields); |
| | | return fields; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.lisenter; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.read.listener.ReadListener; |
| | | import com.alibaba.excel.util.ListUtils; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.enums.UserTypeEnum; |
| | | import com.finance.common.exception.ServiceException; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.common.utils.SecurityUtils; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.system.service.ISysUserService; |
| | | import com.finance.web.controller.excel.DeptExcel; |
| | | import java.util.List; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/3/28 |
| | | */ |
| | | @Slf4j |
| | | public class DeptImportListener implements ReadListener<DeptExcel> { |
| | | |
| | | /** |
| | | * 每隔5条存储数据库,实际使用中可以100条,然后清理list ,方便内存回收 |
| | | */ |
| | | private static final int BATCH_COUNT = 2000; |
| | | |
| | | /** |
| | | * 缓存的数据 |
| | | */ |
| | | private List<DeptExcel> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); |
| | | |
| | | public ISysUserService sysUserService; |
| | | |
| | | public DeptImportListener() { |
| | | } |
| | | |
| | | public DeptImportListener(ISysUserService sysUserService) { |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | @Override |
| | | public void invoke(DeptExcel data, AnalysisContext context) { |
| | | log.info("解析到一条数据:{}", JSON.toJSONString(data)); |
| | | if (StringUtils.isEmpty(data.getAreaName()) || StringUtils.isEmpty(data.getAreaCode()) || |
| | | StringUtils.isEmpty(data.getAreaLevel()) || StringUtils.isNull(data.getCountyFlag()) |
| | | || |
| | | StringUtils.isEmpty(data.getPersonInCharge()) || StringUtils.isEmpty( |
| | | data.getUserName()) || |
| | | StringUtils.isEmpty(data.getPhoneNumber()) || StringUtils.isEmpty( |
| | | data.getPassword())) { |
| | | throw new ServiceException(String.format("数据校验失败,请检查第%d行内容填写是否完整", |
| | | cachedDataList.size() + 1)); |
| | | } |
| | | boolean flag = sysUserService.lambdaQuery() |
| | | .eq(SysUser::getUserType, UserTypeEnum.PLATFORM.getCode()) |
| | | .eq(SysUser::getUserName, data.getUserName()).oneOpt().isPresent(); |
| | | if (flag) { |
| | | throw new ServiceException(String.format("数据校验失败,第%d行的登录账号:%s已存在", |
| | | cachedDataList.size() + 1, data.getUserName())); |
| | | } |
| | | flag = cachedDataList.stream() |
| | | .anyMatch(item -> item.getAreaCode().equals(data.getAreaCode())); |
| | | if (flag) { |
| | | throw new ServiceException( |
| | | String.format("数据校验失败,第%d行区划代码%s重复", cachedDataList.size() + 1, |
| | | data.getAreaCode())); |
| | | } |
| | | flag = cachedDataList.stream() |
| | | .anyMatch(item -> item.getUserName().equals(data.getUserName())); |
| | | if (flag) { |
| | | throw new ServiceException( |
| | | String.format("数据校验失败,第%d行登录账号%s重复", cachedDataList.size() + 1, |
| | | data.getAreaCode())); |
| | | } |
| | | cachedDataList.add(data); |
| | | // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM |
| | | if (cachedDataList.size() >= BATCH_COUNT) { |
| | | saveData(); |
| | | // 存储完成清理 list |
| | | cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | log.info("所有数据解析完成!"); |
| | | saveData(); |
| | | } |
| | | |
| | | private void saveData() { |
| | | log.info("{}条数据,开始存储数据库!", cachedDataList.size()); |
| | | List<SysUser> sysUsers = BeanUtils.copyList(cachedDataList, SysUser.class); |
| | | sysUsers.forEach(item -> { |
| | | item.setPassword(SecurityUtils.encryptPassword(item.getPassword())); |
| | | item.setNickName(item.getAreaName()); |
| | | item.setUserType(UserTypeEnum.DEPARTMENT); |
| | | }); |
| | | sysUserService.remove(Wrappers.<SysUser>lambdaQuery() |
| | | .eq(SysUser::getUserType, UserTypeEnum.DEPARTMENT.getCode())); |
| | | sysUserService.saveBatch(sysUsers); |
| | | log.info("{}条数据,导入成功!", cachedDataList.size()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Properties; |
| | | import java.util.Set; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisCallback; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.constant.CacheConstants; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.system.domain.SysCache; |
| | | |
| | | /** |
| | | * 缓存监控 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/cache") |
| | | public class CacheController |
| | | { |
| | | @Autowired |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | |
| | | private final static List<SysCache> caches = new ArrayList<SysCache>(); |
| | | { |
| | | caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息")); |
| | | caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息")); |
| | | caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典")); |
| | | caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码")); |
| | | caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交")); |
| | | caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理")); |
| | | caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数")); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping() |
| | | public AjaxResult getInfo() throws Exception |
| | | { |
| | | Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info()); |
| | | Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats")); |
| | | Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize()); |
| | | |
| | | Map<String, Object> result = new HashMap<>(3); |
| | | result.put("info", info); |
| | | result.put("dbSize", dbSize); |
| | | |
| | | List<Map<String, String>> pieList = new ArrayList<>(); |
| | | commandStats.stringPropertyNames().forEach(key -> { |
| | | Map<String, String> data = new HashMap<>(2); |
| | | String property = commandStats.getProperty(key); |
| | | data.put("name", StringUtils.removeStart(key, "cmdstat_")); |
| | | data.put("value", StringUtils.substringBetween(property, "calls=", ",usec")); |
| | | pieList.add(data); |
| | | }); |
| | | result.put("commandStats", pieList); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getNames") |
| | | public AjaxResult cache() |
| | | { |
| | | return AjaxResult.success(caches); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getKeys/{cacheName}") |
| | | public AjaxResult getCacheKeys(@PathVariable String cacheName) |
| | | { |
| | | Set<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | return AjaxResult.success(cacheKeys); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getValue/{cacheName}/{cacheKey}") |
| | | public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) |
| | | { |
| | | String cacheValue = redisTemplate.opsForValue().get(cacheKey); |
| | | SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue); |
| | | return AjaxResult.success(sysCache); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheName/{cacheName}") |
| | | public AjaxResult clearCacheName(@PathVariable String cacheName) |
| | | { |
| | | Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | redisTemplate.delete(cacheKeys); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheKey/{cacheKey}") |
| | | public AjaxResult clearCacheKey(@PathVariable String cacheKey) |
| | | { |
| | | redisTemplate.delete(cacheKey); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheAll") |
| | | public AjaxResult clearCacheAll() |
| | | { |
| | | Collection<String> cacheKeys = redisTemplate.keys("*"); |
| | | redisTemplate.delete(cacheKeys); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.monitor; |
| | | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.framework.web.domain.Server; |
| | | |
| | | /** |
| | | * 服务器监控 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/server") |
| | | public class ServerController |
| | | { |
| | | @PreAuthorize("@ss.hasPermi('monitor:server:list')") |
| | | @GetMapping() |
| | | public AjaxResult getInfo() throws Exception |
| | | { |
| | | Server server = new Server(); |
| | | server.copyTo(); |
| | | return AjaxResult.success(server); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.monitor; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.poi.ExcelUtil; |
| | | import com.finance.framework.web.service.SysPasswordService; |
| | | import com.finance.system.domain.SysLogininfor; |
| | | import com.finance.system.service.ISysLogininforService; |
| | | |
| | | /** |
| | | * 系统访问记录 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/logininfor") |
| | | public class SysLogininforController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysLogininforService logininforService; |
| | | |
| | | @Autowired |
| | | private SysPasswordService passwordService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysLogininfor logininfor) |
| | | { |
| | | // startPage(); |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | // @Log(title = "登录日志", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysLogininfor logininfor) |
| | | // { |
| | | // List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | // ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); |
| | | // util.exportExcel(response, list, "登录日志"); |
| | | // } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "登录日志", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{infoIds}") |
| | | public AjaxResult remove(@PathVariable Long[] infoIds) |
| | | { |
| | | return toAjax(logininforService.deleteLogininforByIds(infoIds)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "登录日志", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() |
| | | { |
| | | logininforService.cleanLogininfor(); |
| | | return success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')") |
| | | @Log(title = "账户解锁", businessType = BusinessType.OTHER) |
| | | @GetMapping("/unlock/{userName}") |
| | | public AjaxResult unlock(@PathVariable("userName") String userName) |
| | | { |
| | | passwordService.clearLoginRecordCache(userName); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.monitor; |
| | | |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.system.service.ISysOperLogService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 操作日志记录 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "操作日志记录") |
| | | @RestController |
| | | @RequestMapping("/monitor/operlog") |
| | | public class SysOperlogController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysOperLogService operLogService; |
| | | |
| | | // @ApiOperation(value = "操作日志分页列表") |
| | | // @PostMapping("/list") |
| | | // public AjaxResult list(@RequestBody SysOperLogQuery query) |
| | | // { |
| | | // startPage(query.getPageNum(), query.getPageSize()); |
| | | // List<SysOperLogVO> list = operLogService.selectOperLogPageList(query); |
| | | // operLogService.getLogDetail(list); |
| | | // return AjaxResult.success(getDataTable(list)); |
| | | // } |
| | | |
| | | /** |
| | | * 查询操作日志列表导出 |
| | | */ |
| | | // @ApiOperation(value = "查询操作日志列表导出") |
| | | // @Log(title = "操作日志-查询操作日志列表导出", businessType = BusinessType.EXPORT) |
| | | // @PostMapping("/exportOperLog") |
| | | // public void exportOperLog(@RequestBody SysOperLogQuery query) |
| | | // { |
| | | // List<SysOperLogVO> list = operLogService.selectOperLogPageList(query); |
| | | // List<TOperLogExport> operLogExports = new ArrayList<>(); |
| | | // for (SysOperLogVO sysOperLogVO : list) { |
| | | // TOperLogExport operLogExport = new TOperLogExport(); |
| | | // BeanUtils.copyProperties(sysOperLogVO,operLogExport); |
| | | // operLogService.getLogDetail(list); |
| | | // operLogExports.add(operLogExport); |
| | | // } |
| | | // Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TOperLogExport.class, operLogExports); |
| | | // HttpServletResponse response = WebUtils.response(); |
| | | // response.setContentType("application/vnd.ms-excel"); |
| | | // response.setCharacterEncoding("utf-8"); |
| | | // ServletOutputStream outputStream = null; |
| | | // try { |
| | | // String fileName = URLEncoder.encode("操作日志信息.xls", "utf-8"); |
| | | // response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | // response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | // response.setHeader("Pragma", "no-cache"); |
| | | // response.setHeader("Cache-Control", "no-cache"); |
| | | // outputStream = response.getOutputStream(); |
| | | // workbook.write(outputStream); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // log.error("操作日志导出信息导出失败!"); |
| | | // } finally { |
| | | // try { |
| | | // outputStream.close(); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // @Log(title = "操作日志", businessType = BusinessType.EXPORT) |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysOperLog operLog) |
| | | // { |
| | | // List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | // ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class); |
| | | // util.exportExcel(response, list, "操作日志"); |
| | | // } |
| | | |
| | | @Log(title = "操作日志", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/deleteById/{operIds}") |
| | | public AjaxResult remove(@PathVariable String operIds) |
| | | { |
| | | String[] split = operIds.split(","); |
| | | List<Long> id = new ArrayList<>(); |
| | | for (String s : split) { |
| | | id.add(Long.valueOf(s)); |
| | | } |
| | | return AjaxResult.success(operLogService.deleteOperLogByIds(id)); |
| | | } |
| | | |
| | | @Log(title = "操作日志", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() |
| | | { |
| | | operLogService.cleanOperLog(); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.constant.CacheConstants; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.model.LoginUser; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.core.redis.RedisCache; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.system.domain.SysUserOnline; |
| | | import com.finance.system.service.ISysUserOnlineService; |
| | | |
| | | /** |
| | | * 在线用户监控 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/online") |
| | | public class SysUserOnlineController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysUserOnlineService userOnlineService; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(String ipaddr, String userName) |
| | | { |
| | | Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*"); |
| | | List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>(); |
| | | for (String key : keys) |
| | | { |
| | | LoginUser user = redisCache.getCacheObject(key); |
| | | if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(ipaddr)) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); |
| | | } |
| | | else |
| | | { |
| | | userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); |
| | | } |
| | | } |
| | | Collections.reverse(userOnlineList); |
| | | userOnlineList.removeAll(Collections.singleton(null)); |
| | | return getDataTable(userOnlineList); |
| | | } |
| | | |
| | | /** |
| | | * 强退用户 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')") |
| | | @Log(title = "在线用户", businessType = BusinessType.FORCE) |
| | | @DeleteMapping("/{tokenId}") |
| | | public AjaxResult forceLogout(@PathVariable String tokenId) |
| | | { |
| | | redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.service; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class DepartmentRanking { |
| | | |
| | | public static final String TOTAL_SCORE_RANKING_KEY = "total_score_department_ranking"; |
| | | public static final String DATA_ONE_SCORE_RANKING_KEY = "data_one_score_department_ranking"; |
| | | public static final String DATA_TWO_SCORE_RANKING_KEY = "data_two_score_department_ranking"; |
| | | public static final String DATA_THREE_SCORE_RANKING_KEY = "data_three_score_department_ranking"; |
| | | public static final String DATA_FOUR_SCORE_RANKING_KEY = "data_four_score_department_ranking"; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | |
| | | public void addToScoreRanking(String key, String areaCode, double score) { |
| | | redisTemplate.opsForZSet().add(key, areaCode, score); |
| | | } |
| | | |
| | | public Long getScoreRankByAreaCode(String key, String areaCode) { |
| | | return redisTemplate.opsForZSet() |
| | | .reverseRank(key, areaCode); // 0-based ranking |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.enums.AreaLevelEnum; |
| | | import com.finance.common.enums.DataScreenConfigEnum; |
| | | import com.finance.common.enums.ReportingStatusEnum; |
| | | import com.finance.common.enums.RiskLevelEnum; |
| | | import com.finance.common.enums.ShowStatusEnum; |
| | | import com.finance.common.enums.SubTypeEnum; |
| | | import com.finance.common.enums.UserTypeEnum; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.common.utils.CollUtils; |
| | | import com.finance.common.utils.DateUtils; |
| | | import com.finance.system.domain.TbBasicData; |
| | | import com.finance.system.domain.TbBasicDataCategory; |
| | | import com.finance.system.domain.TbDataScreenScore; |
| | | import com.finance.system.domain.TbQuestion; |
| | | import com.finance.system.query.CalculateDetailQuery; |
| | | import com.finance.system.query.DeptCalculateDetailQuery; |
| | | import com.finance.system.query.TransferPaymentScaleQuery; |
| | | import com.finance.system.service.ISysUserService; |
| | | import com.finance.system.service.TbBasicDataCategoryService; |
| | | import com.finance.system.service.TbBasicDataConfigService; |
| | | import com.finance.system.service.TbBasicDataService; |
| | | import com.finance.system.service.TbDataScreenConfigService; |
| | | import com.finance.system.service.TbDataScreenScoreService; |
| | | import com.finance.system.service.TbQuestionService; |
| | | import com.finance.system.service.TbScoreService; |
| | | import com.finance.system.vo.BasicDataVO; |
| | | import com.finance.system.vo.CurrentFieldsDetailVO; |
| | | import com.finance.system.vo.DataAnalysisVO; |
| | | import com.finance.system.vo.DataScreenConfigVO; |
| | | import com.finance.system.vo.DataScreenScoreVO; |
| | | import com.finance.system.vo.DeptCalculateDetailVO; |
| | | import com.finance.system.vo.FieldAndScoreDataVO; |
| | | import com.finance.system.vo.ProvinceStaticsVO; |
| | | import com.finance.system.vo.QuestionVO; |
| | | import com.finance.system.vo.RiskAndTransferVO; |
| | | import com.finance.system.vo.RiskCountVO; |
| | | import com.finance.system.vo.RiskLevelVO; |
| | | import com.finance.system.vo.RiskMapVO; |
| | | import com.finance.system.vo.RiskRankingVO; |
| | | import com.finance.system.vo.ScoreCalculateDetailVO; |
| | | import com.finance.system.vo.ScoreDataVO; |
| | | import com.finance.system.vo.ScoreRankVO; |
| | | import com.finance.system.vo.ScoreRateDataVO; |
| | | import com.finance.system.vo.TransferPaymentScaleVO; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/4/16 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | @RequiredArgsConstructor |
| | | public class ScreenService { |
| | | |
| | | private final ISysUserService sysUserService; |
| | | private final TbBasicDataService tbBasicDataService; |
| | | private final TbDataScreenScoreService tbDataScreenScoreService; |
| | | private final TbDataScreenConfigService tbDataScreenConfigService; |
| | | private final TbQuestionService tbQuestionService; |
| | | private final TbScoreService tbScoreService; |
| | | private final TbBasicDataConfigService tbBasicDataConfigService; |
| | | private final TbBasicDataCategoryService tbBasicDataCategoryService; |
| | | |
| | | public ProvinceStaticsVO provinceStatics() { |
| | | ProvinceStaticsVO vo = new ProvinceStaticsVO(); |
| | | int provinceCount = getCount("省本级"); |
| | | int cityCount = getCount("市"); |
| | | int developmentZonesCount = getCount("开发区"); |
| | | int countyCount = getCount("县"); |
| | | |
| | | vo.setProvinceCount(provinceCount); |
| | | vo.setCityCount(cityCount); |
| | | vo.setDevelopmentZonesCount(developmentZonesCount); |
| | | vo.setCountyCount(countyCount); |
| | | return vo; |
| | | } |
| | | |
| | | private int getCount(String level) { |
| | | return (int) sysUserService.count( |
| | | Wrappers.<SysUser>lambdaQuery().eq(SysUser::getUserType, UserTypeEnum.DEPARTMENT) |
| | | .eq(SysUser::getAreaLevel, level)); |
| | | } |
| | | |
| | | public PageDTO<TransferPaymentScaleVO> transferPaymentScalePage( |
| | | TransferPaymentScaleQuery query) { |
| | | Page<TransferPaymentScaleVO> pageVO = tbBasicDataService.transferPaymentScalePage( |
| | | new Page<TransferPaymentScaleVO>(query.getPageNum(), query.getPageSize()), |
| | | query.getQuarter()); |
| | | return PageDTO.of(pageVO); |
| | | } |
| | | |
| | | public List<BasicDataVO> quarterList() { |
| | | List<TbBasicData> list = tbBasicDataService.lambdaQuery().select(TbBasicData::getQuarter) |
| | | .groupBy(TbBasicData::getQuarter) |
| | | .eq(TbBasicData::getStatus, ReportingStatusEnum.FILLED).list(); |
| | | return BeanUtils.copyList(list, BasicDataVO.class); |
| | | } |
| | | |
| | | public RiskAndTransferVO getRiskAndTransfer() throws Exception { |
| | | String nowQuarter = DateUtils.getNowQuarter(); |
| | | RiskAndTransferVO riskAndTransferVO = new RiskAndTransferVO(); |
| | | //查询转移支付规模总额 |
| | | List<TbBasicData> list = tbBasicDataService.lambdaQuery() |
| | | .select(TbBasicData::getTransferPaymentScale) |
| | | .eq(TbBasicData::getQuarter, nowQuarter) |
| | | .eq(TbBasicData::getStatus, ReportingStatusEnum.FILLED) |
| | | .list(); |
| | | Optional<Double> reduce = list.stream() |
| | | .map(tbBasicData -> Double.parseDouble(tbBasicData.getTransferPaymentScale())) |
| | | .reduce(Double::sum); |
| | | riskAndTransferVO.setTransferPaymentScale(reduce.orElse(0D)); |
| | | //查询风险等级设置 |
| | | DataScreenConfigVO riskLevel = tbDataScreenConfigService.getRiskLevel(); |
| | | List<RiskLevelVO> riskLevelVOList = formatRiskLevel(riskLevel); |
| | | riskAndTransferVO.setRiskLevelVOList(riskLevelVOList); |
| | | RiskCountVO riskCountVO = new RiskCountVO(); |
| | | |
| | | List<TbDataScreenScore> dataScreenScoreList = tbDataScreenScoreService.selectRiskByQuarter( |
| | | nowQuarter, riskLevel.getId(), null); |
| | | for (RiskLevelVO vo : riskLevelVOList) { |
| | | long count = dataScreenScoreList.stream() |
| | | .filter(item -> item.getScore() >= vo.getMin() |
| | | && item.getScore() <= vo.getMax()).count(); |
| | | if (vo.getRiskLevel().equals(RiskLevelEnum.L1)) { |
| | | riskCountVO.setNoRiskCount((int) count); |
| | | } else if (vo.getRiskLevel().equals(RiskLevelEnum.L2)) { |
| | | riskCountVO.setLowRiskCount((int) count); |
| | | } else if (vo.getRiskLevel().equals(RiskLevelEnum.L3)) { |
| | | riskCountVO.setMediumRiskCount((int) count); |
| | | } else if (vo.getRiskLevel().equals(RiskLevelEnum.L4)) { |
| | | riskCountVO.setHighRiskCount((int) count); |
| | | } |
| | | } |
| | | //TODO |
| | | riskCountVO.setNoRiskCount(50); |
| | | riskCountVO.setLowRiskCount(45); |
| | | riskCountVO.setMediumRiskCount(30); |
| | | riskCountVO.setHighRiskCount(80); |
| | | riskAndTransferVO.setRiskCountVO(riskCountVO); |
| | | //查询风险配置对应得分 |
| | | List<RiskMapVO> riskMapVOList = tbDataScreenScoreService.queryScore4Map(nowQuarter, |
| | | riskLevel.getId()); |
| | | riskAndTransferVO.setRiskMapVOList(riskMapVOList); |
| | | return riskAndTransferVO; |
| | | } |
| | | |
| | | private List<RiskLevelVO> formatRiskLevel(DataScreenConfigVO riskLevel) { |
| | | String[] noRiskArr = riskLevel.getNoRisk().split("_"); |
| | | String[] lowRiskArr = riskLevel.getLowRisk().split("_"); |
| | | String[] mediumRiskArr = riskLevel.getMediumRisk().split("_"); |
| | | String[] highRiskArr = riskLevel.getHighRisk().split("_"); |
| | | return handleRiskLevel(noRiskArr, lowRiskArr, mediumRiskArr, |
| | | highRiskArr); |
| | | } |
| | | |
| | | private List<RiskLevelVO> handleRiskLevel(String[] noRiskArr, String[] lowRiskArr, |
| | | String[] mediumRiskArr, String[] highRiskArr) { |
| | | List<RiskLevelVO> list = new ArrayList<>(); |
| | | String min = noRiskArr[0]; |
| | | String max = noRiskArr[1]; |
| | | RiskLevelVO vo1 = new RiskLevelVO(); |
| | | vo1.setRiskLevel(RiskLevelEnum.L1); |
| | | vo1.setMin(Double.parseDouble(min)); |
| | | vo1.setMax(Double.parseDouble(max)); |
| | | list.add(vo1); |
| | | min = lowRiskArr[0]; |
| | | max = lowRiskArr[1]; |
| | | RiskLevelVO vo2 = new RiskLevelVO(); |
| | | vo2.setRiskLevel(RiskLevelEnum.L2); |
| | | vo2.setMin(Double.parseDouble(min)); |
| | | vo2.setMax(Double.parseDouble(max)); |
| | | list.add(vo2); |
| | | min = mediumRiskArr[0]; |
| | | max = mediumRiskArr[1]; |
| | | RiskLevelVO vo3 = new RiskLevelVO(); |
| | | vo3.setRiskLevel(RiskLevelEnum.L3); |
| | | vo3.setMin(Double.parseDouble(min)); |
| | | vo3.setMax(Double.parseDouble(max)); |
| | | list.add(vo3); |
| | | min = highRiskArr[0]; |
| | | max = highRiskArr[1]; |
| | | RiskLevelVO vo4 = new RiskLevelVO(); |
| | | vo4.setRiskLevel(RiskLevelEnum.L4); |
| | | vo4.setMin(Double.parseDouble(min)); |
| | | vo4.setMax(Double.parseDouble(max)); |
| | | list.add(vo4); |
| | | return list; |
| | | } |
| | | |
| | | public List<RiskRankingVO> riskRanking() throws Exception { |
| | | DataScreenConfigVO riskLevel = tbDataScreenConfigService.getRiskLevel(); |
| | | List<RiskLevelVO> riskLevelVOList = formatRiskLevel(riskLevel); |
| | | List<RiskRankingVO> voList = tbDataScreenScoreService.queryRiskRanking(riskLevel.getId(), |
| | | DateUtils.getNowQuarter(), AreaLevelEnum.COUNTY); |
| | | int rank = 1; |
| | | for (RiskRankingVO riskRankingVO : voList) { |
| | | riskRankingVO.setRank(rank++); |
| | | for (RiskLevelVO vo : riskLevelVOList) { |
| | | if (vo.getRiskLevel().equals(RiskLevelEnum.L1) |
| | | && riskRankingVO.getScore() <= vo.getMin()) { |
| | | riskRankingVO.setRiskLevel(vo.getRiskLevel().getCode()); |
| | | } |
| | | if (riskRankingVO.getScore() >= vo.getMin() |
| | | && riskRankingVO.getScore() <= vo.getMax()) { |
| | | riskRankingVO.setRiskLevel(vo.getRiskLevel().getCode()); |
| | | } |
| | | if (vo.getRiskLevel().equals(RiskLevelEnum.L4) |
| | | && riskRankingVO.getScore() >= vo.getMax()) { |
| | | riskRankingVO.setRiskLevel(vo.getRiskLevel().getCode()); |
| | | } |
| | | } |
| | | } |
| | | return voList; |
| | | } |
| | | |
| | | public List<QuestionVO> queryQuestions() throws Exception { |
| | | List<TbQuestion> list = tbQuestionService.lambdaQuery() |
| | | .eq(TbQuestion::getQuarter, DateUtils.getNowQuarter()).list(); |
| | | return BeanUtils.copyList(list, QuestionVO.class); |
| | | } |
| | | |
| | | public DataAnalysisVO getDataAnalysis(String areaCode) throws Exception { |
| | | DataAnalysisVO dataAnalysisVO = new DataAnalysisVO(); |
| | | //查询得分排名 |
| | | ScoreRankVO scoreRankVO = tbScoreService.queryRankAndScoreByAreaCode(areaCode); |
| | | if (Objects.isNull(scoreRankVO)) { |
| | | return dataAnalysisVO; |
| | | } |
| | | dataAnalysisVO.setRank(scoreRankVO.getRank()); |
| | | dataAnalysisVO.setScore(scoreRankVO.getScore()); |
| | | String nowQuarter = DateUtils.getNowQuarter(); |
| | | //查询问题 |
| | | List<TbQuestion> list = tbQuestionService.lambdaQuery() |
| | | .eq(TbQuestion::getQuarter, nowQuarter).list(); |
| | | List<QuestionVO> questionVOS = BeanUtils.copyList(list, QuestionVO.class); |
| | | dataAnalysisVO.setQuestions(questionVOS); |
| | | SysUser user = sysUserService.lambdaQuery() |
| | | .eq(SysUser::getUserType, UserTypeEnum.DEPARTMENT) |
| | | .eq(SysUser::getAreaCode, areaCode).one(); |
| | | if (Objects.isNull(user)) { |
| | | return dataAnalysisVO; |
| | | } |
| | | dataAnalysisVO.setAreaName(user.getDeptName()); |
| | | //查询风险得分 |
| | | DataScreenConfigVO riskLevel = tbDataScreenConfigService.getRiskLevel(); |
| | | List<RiskLevelVO> riskLevelVOList = formatRiskLevel(riskLevel); |
| | | List<DataScreenScoreVO> thisYearScore = tbDataScreenScoreService.queryScoreByAreaAndYear( |
| | | areaCode, riskLevel.getId(), 1); |
| | | Optional<Double> thisYear = thisYearScore.stream().map(DataScreenScoreVO::getScore) |
| | | .reduce(Double::sum); |
| | | dataAnalysisVO.setYearScore(thisYear.orElse(0D)); |
| | | List<DataScreenScoreVO> lastYearScore = tbDataScreenScoreService.queryScoreByAreaAndYear( |
| | | areaCode, riskLevel.getId(), 2); |
| | | Optional<Double> lastYear = lastYearScore.stream().map(DataScreenScoreVO::getScore) |
| | | .reduce(Double::sum); |
| | | dataAnalysisVO.setLastYearScore(lastYear.orElse(0D)); |
| | | //查询风险等级 |
| | | List<TbDataScreenScore> dataScreenScoreList = tbDataScreenScoreService.selectRiskByQuarter( |
| | | nowQuarter, |
| | | riskLevel.getId(), areaCode); |
| | | for (TbDataScreenScore tbDataScreenScore : dataScreenScoreList) { |
| | | for (RiskLevelVO vo : riskLevelVOList) { |
| | | if (vo.getRiskLevel().equals(RiskLevelEnum.L1) |
| | | && tbDataScreenScore.getScore() <= vo.getMin()) { |
| | | dataAnalysisVO.setRiskLevel(vo.getRiskLevel().getCode()); |
| | | } |
| | | if (tbDataScreenScore.getScore() >= vo.getMin() |
| | | && tbDataScreenScore.getScore() <= vo.getMax()) { |
| | | dataAnalysisVO.setRiskLevel(vo.getRiskLevel().getCode()); |
| | | } |
| | | if (vo.getRiskLevel().equals(RiskLevelEnum.L4) |
| | | && tbDataScreenScore.getScore() >= vo.getMax()) { |
| | | dataAnalysisVO.setRiskLevel(vo.getRiskLevel().getCode()); |
| | | } |
| | | } |
| | | } |
| | | //查询形式指标得分 |
| | | List<ScoreDataVO> scoreDataVOList = new ArrayList<>(); |
| | | handleDataIndicators(areaCode, scoreDataVOList); |
| | | dataAnalysisVO.setScoreDataList(scoreDataVOList); |
| | | //查询数据指标得分 |
| | | List<ScoreRateDataVO> scoreRateDataVOList = new ArrayList<>(); |
| | | handleDataIndicators(areaCode, scoreRateDataVOList, nowQuarter); |
| | | dataAnalysisVO.setScoreRateDataList(scoreRateDataVOList); |
| | | //查询大屏下方字段列表 |
| | | List<TbBasicDataCategory> categoryList = tbBasicDataCategoryService.lambdaQuery() |
| | | .eq(TbBasicDataCategory::getStatus, ShowStatusEnum.SHOW).last("limit 4").list(); |
| | | List<FieldAndScoreDataVO> voList = tbBasicDataService.selectBasicDataFieldsConfig(areaCode, |
| | | nowQuarter); |
| | | if (categoryList.isEmpty()) { |
| | | dataAnalysisVO.setScoreRateDataListOne(CollUtils.emptyList()); |
| | | dataAnalysisVO.setScoreRateDataListTwo(CollUtils.emptyList()); |
| | | dataAnalysisVO.setScoreRateDataListThree(CollUtils.emptyList()); |
| | | dataAnalysisVO.setScoreRateDataListFour(CollUtils.emptyList()); |
| | | } else { |
| | | int size = categoryList.size(); |
| | | for (int i = 0; i < 4; i++) { |
| | | List<FieldAndScoreDataVO> dataList; |
| | | if (i < size) { |
| | | dataList = getFieldAndScoreData(voList, |
| | | categoryList.get(i).getBasicDataCategoryName()); |
| | | } else { |
| | | dataList = CollUtils.emptyList(); |
| | | } |
| | | switch (i) { |
| | | case 0: |
| | | dataAnalysisVO.setScoreRateDataListOne(dataList); |
| | | break; |
| | | case 1: |
| | | dataAnalysisVO.setScoreRateDataListTwo(dataList); |
| | | break; |
| | | case 2: |
| | | dataAnalysisVO.setScoreRateDataListThree(dataList); |
| | | break; |
| | | case 3: |
| | | dataAnalysisVO.setScoreRateDataListFour(dataList); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return dataAnalysisVO; |
| | | } |
| | | |
| | | private void handleDataIndicators(String areaCode, List<ScoreDataVO> scoreDataVOList) { |
| | | List<DataScreenScoreVO> formalIndicatorsYear = tbDataScreenScoreService.selectIndicators( |
| | | areaCode, null, DataScreenConfigEnum.FORMAL_INDICATORS, 1); |
| | | if (CollUtils.isNotEmpty(formalIndicatorsYear)) { |
| | | //形式指标一 |
| | | for (SubTypeEnum value : SubTypeEnum.values()) { |
| | | ScoreDataVO scoreDataVO = new ScoreDataVO(); |
| | | scoreDataVO.setSubType(value); |
| | | List<DataScreenScoreVO> formalIndicators = formalIndicatorsYear.stream() |
| | | .filter(item -> item.getSubType().equals(value)).collect( |
| | | Collectors.toList()); |
| | | scoreDataVO.setMaxScore(formalIndicators.get(0).getMaxScore()); |
| | | Optional<Double> formalIndicatorsYearScore = formalIndicators.stream() |
| | | .map(DataScreenScoreVO::getScore) |
| | | .reduce(Double::sum); |
| | | scoreDataVO.setScore(formalIndicatorsYearScore.orElse(0D)); |
| | | List<DataScreenScoreVO> formalIndicatorsListYear = tbDataScreenScoreService.selectIndicators( |
| | | areaCode, null, DataScreenConfigEnum.FORMAL_INDICATORS, 2); |
| | | List<DataScreenScoreVO> formalIndicatorsLastYear = formalIndicatorsListYear.stream() |
| | | .filter(item -> item.getSubType().equals(value)).collect( |
| | | Collectors.toList()); |
| | | Optional<Double> formalIndicatorsListYearScore = formalIndicatorsLastYear.stream() |
| | | .map(DataScreenScoreVO::getScore) |
| | | .reduce(Double::sum); |
| | | scoreDataVO.setLastScore(formalIndicatorsListYearScore.orElse(0D)); |
| | | scoreDataVOList.add(scoreDataVO); |
| | | } |
| | | } else { |
| | | for (SubTypeEnum value : SubTypeEnum.values()) { |
| | | ScoreDataVO scoreDataVO = new ScoreDataVO(); |
| | | scoreDataVO.setScore(0D); |
| | | scoreDataVO.setLastScore(0D); |
| | | scoreDataVO.setSubType(value); |
| | | scoreDataVOList.add(scoreDataVO); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private void handleDataIndicators(String areaCode, List<ScoreRateDataVO> scoreRateDataVOList, |
| | | String nowQuarter) { |
| | | List<DataScreenScoreVO> dataIndicatorsListYear = tbDataScreenScoreService.selectIndicators( |
| | | areaCode, nowQuarter, DataScreenConfigEnum.DATA_INDICATORS, null); |
| | | if (CollUtils.isNotEmpty(dataIndicatorsListYear)) { |
| | | for (SubTypeEnum value : SubTypeEnum.values()) { |
| | | ScoreRateDataVO scoreRateDataVO = new ScoreRateDataVO(); |
| | | List<DataScreenScoreVO> formalIndicators = dataIndicatorsListYear.stream() |
| | | .filter(item -> item.getSubType().equals(value)).collect( |
| | | Collectors.toList()); |
| | | if (CollUtils.isNotEmpty(formalIndicators)) { |
| | | DataScreenScoreVO dataScreenScoreVO = formalIndicators.get(0); |
| | | scoreRateDataVO.setScore(dataScreenScoreVO.getScore()); |
| | | scoreRateDataVO.setScoreRate(dataScreenScoreVO.getScoreRate()); |
| | | scoreRateDataVO.setSubType(value); |
| | | Integer rank = tbDataScreenScoreService.getRankByScore( |
| | | dataScreenScoreVO.getScore(), |
| | | dataScreenScoreVO.getSubType(), areaCode, nowQuarter, |
| | | DataScreenConfigEnum.DATA_INDICATORS); |
| | | scoreRateDataVO.setRank(rank); |
| | | scoreRateDataVOList.add(scoreRateDataVO); |
| | | } else { |
| | | scoreRateDataVO.setScore(0D); |
| | | scoreRateDataVO.setScoreRate(0D); |
| | | scoreRateDataVO.setSubType(value); |
| | | scoreRateDataVO.setRank(0); |
| | | scoreRateDataVOList.add(scoreRateDataVO); |
| | | } |
| | | } |
| | | } else { |
| | | for (SubTypeEnum value : SubTypeEnum.values()) { |
| | | ScoreRateDataVO scoreRateDataVO = new ScoreRateDataVO(); |
| | | scoreRateDataVO.setScore(0D); |
| | | scoreRateDataVO.setScoreRate(0D); |
| | | scoreRateDataVO.setSubType(value); |
| | | scoreRateDataVO.setRank(0); |
| | | scoreRateDataVOList.add(scoreRateDataVO); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private List<FieldAndScoreDataVO> getFieldAndScoreData(List<FieldAndScoreDataVO> voList, |
| | | String basicDataCategoryName) { |
| | | return voList.stream() |
| | | .filter(item -> item.getBasicDataCategoryName() |
| | | .equals(basicDataCategoryName)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | public List<DeptCalculateDetailVO> deptCalculateDetail(DeptCalculateDetailQuery query) |
| | | throws Exception { |
| | | return tbScoreService.deptCalculateDetail(query, DateUtils.getNowQuarter()); |
| | | } |
| | | |
| | | public CurrentFieldsDetailVO viewRawData(String areaCode) throws Exception { |
| | | Optional<TbBasicData> basicDataOptional = tbBasicDataService.lambdaQuery() |
| | | .eq(TbBasicData::getDeptAreaCode, areaCode) |
| | | .eq(TbBasicData::getStatus, ReportingStatusEnum.FILLED) |
| | | .eq(TbBasicData::getQuarter, DateUtils.getNowQuarter()).oneOpt(); |
| | | if (basicDataOptional.isPresent()) { |
| | | return tbBasicDataService.fieldsDetails(basicDataOptional.get().getId()).getData(); |
| | | } else { |
| | | return new CurrentFieldsDetailVO(); |
| | | } |
| | | } |
| | | |
| | | public ScoreCalculateDetailVO fieldsDetail(CalculateDetailQuery query) { |
| | | List<SysUser> countyList = getCountyList(query.getCityAreaCode()); |
| | | return tbScoreService.fieldsDetail(query, countyList); |
| | | } |
| | | |
| | | public List<SysUser> getCountyList(String areaCode) { |
| | | String cityCode = areaCode.substring(0, 4); |
| | | List<SysUser> list = sysUserService.lambdaQuery() |
| | | .select(SysUser::getAreaCode, SysUser::getAreaName, SysUser::getAreaAlias, |
| | | SysUser::getUserId).eq(SysUser::getUserType, |
| | | UserTypeEnum.DEPARTMENT) |
| | | .ne(SysUser::getAreaCode, areaCode) |
| | | .likeRight(SysUser::getAreaCode, cityCode).list(); |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.poi.ExcelUtil; |
| | | import com.finance.system.domain.SysConfig; |
| | | import com.finance.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 参数配置 信息操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/config") |
| | | public class SysConfigController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | // @Log(title = "参数管理", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('system:config:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysConfig config) |
| | | // { |
| | | // List<SysConfig> list = configService.selectConfigList(config); |
| | | // ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); |
| | | // util.exportExcel(response, list, "参数数据"); |
| | | // } |
| | | |
| | | /** |
| | | * 根据参数编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:query')") |
| | | @GetMapping(value = "/{configId}") |
| | | public AjaxResult getInfo(@PathVariable Long configId) |
| | | { |
| | | return success(configService.selectConfigById(configId)); |
| | | } |
| | | |
| | | /** |
| | | * 根据参数键名查询参数值 |
| | | */ |
| | | @GetMapping(value = "/configKey/{configKey}") |
| | | public AjaxResult getConfigKey(@PathVariable String configKey) |
| | | { |
| | | return success(configService.selectConfigByKey(configKey)); |
| | | } |
| | | |
| | | /** |
| | | * 新增参数配置 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:add')") |
| | | @Log(title = "参数管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysConfig config) |
| | | { |
| | | if (!configService.checkConfigKeyUnique(config)) |
| | | { |
| | | return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| | | } |
| | | config.setCreateBy(getUsername()); |
| | | return toAjax(configService.insertConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 修改参数配置 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:edit')") |
| | | @Log(title = "参数管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config) |
| | | { |
| | | if (!configService.checkConfigKeyUnique(config)) |
| | | { |
| | | return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| | | } |
| | | config.setUpdateBy(getUsername()); |
| | | return toAjax(configService.updateConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 删除参数配置 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "参数管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{configIds}") |
| | | public AjaxResult remove(@PathVariable Long[] configIds) |
| | | { |
| | | configService.deleteConfigByIds(configIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 刷新参数缓存 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "参数管理", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() |
| | | { |
| | | configService.resetConfigCache(); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | 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.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.constant.UserConstants; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysDept; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.system.service.ISysDeptService; |
| | | |
| | | /** |
| | | * 部门信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dept") |
| | | public class SysDeptController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | /** |
| | | * 获取部门列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysDept dept) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | | return AjaxResult.success(depts); |
| | | } |
| | | |
| | | /** |
| | | * 查询部门列表(排除节点) |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list/exclude/{deptId}") |
| | | public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| | | depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); |
| | | return AjaxResult.success(depts); |
| | | } |
| | | |
| | | /** |
| | | * 根据部门编号获取详细信息 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:query')") |
| | | @GetMapping(value = "/{deptId}") |
| | | public AjaxResult getInfo(@PathVariable Long deptId) |
| | | { |
| | | deptService.checkDeptDataScope(deptId); |
| | | return AjaxResult.success(deptService.selectDeptById(deptId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增部门 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:add')") |
| | | @Log(title = "部门管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDept dept) |
| | | { |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } |
| | | dept.setCreateBy(getUsername()); |
| | | return AjaxResult.success(deptService.insertDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * 修改部门 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:edit')") |
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept) |
| | | { |
| | | Long deptId = dept.getDeptId(); |
| | | deptService.checkDeptDataScope(deptId); |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } |
| | | else if (dept.getParentId().equals(deptId)) |
| | | { |
| | | return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); |
| | | } |
| | | else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) |
| | | { |
| | | return error("该部门包含未停用的子部门!"); |
| | | } |
| | | dept.setUpdateBy(getUsername()); |
| | | return AjaxResult.success(deptService.updateDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * 删除部门 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:remove')") |
| | | @Log(title = "部门管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{deptId}") |
| | | public AjaxResult remove(@PathVariable Long deptId) |
| | | { |
| | | if (deptService.hasChildByDeptId(deptId)) |
| | | { |
| | | return warn("存在下级部门,不允许删除"); |
| | | } |
| | | if (deptService.checkDeptExistUser(deptId)) |
| | | { |
| | | return warn("部门存在用户,不允许删除"); |
| | | } |
| | | deptService.checkDeptDataScope(deptId); |
| | | return AjaxResult.success(deptService.deleteDeptById(deptId)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysDictData; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.common.utils.poi.ExcelUtil; |
| | | import com.finance.system.service.ISysDictDataService; |
| | | import com.finance.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * 数据字典信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/data") |
| | | public class SysDictDataController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictData dictData) |
| | | { |
| | | // startPage(); |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | // @Log(title = "字典数据", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysDictData dictData) |
| | | // { |
| | | // List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | // ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); |
| | | // util.exportExcel(response, list, "字典数据"); |
| | | // } |
| | | |
| | | /** |
| | | * 查询字典数据详细 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictCode}") |
| | | public AjaxResult getInfo(@PathVariable Long dictCode) |
| | | { |
| | | return success(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型查询字典数据信息 |
| | | */ |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public AjaxResult dictType(@PathVariable String dictType) |
| | | { |
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
| | | if (StringUtils.isNull(data)) |
| | | { |
| | | data = new ArrayList<SysDictData>(); |
| | | } |
| | | return success(data); |
| | | } |
| | | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "字典数据", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictDataService.insertDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "字典数据", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictDataService.updateDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public AjaxResult remove(@PathVariable Long[] dictCodes) |
| | | { |
| | | dictDataService.deleteDictDataByIds(dictCodes); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysDictType; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.poi.ExcelUtil; |
| | | import com.finance.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * 数据字典信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/type") |
| | | public class SysDictTypeController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictType dictType) |
| | | { |
| | | // startPage(); |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | // @Log(title = "字典类型", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysDictType dictType) |
| | | // { |
| | | // List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | // ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); |
| | | // util.exportExcel(response, list, "字典类型"); |
| | | // } |
| | | |
| | | /** |
| | | * 查询字典类型详细 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictId}") |
| | | public AjaxResult getInfo(@PathVariable Long dictId) |
| | | { |
| | | return success(dictTypeService.selectDictTypeById(dictId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "字典类型", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| | | } |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictTypeService.insertDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 修改字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "字典类型", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| | | } |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictTypeService.updateDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictIds}") |
| | | public AjaxResult remove(@PathVariable Long[] dictIds) |
| | | { |
| | | dictTypeService.deleteDictTypeByIds(dictIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 刷新字典缓存 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() |
| | | { |
| | | dictTypeService.resetDictCache(); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典选择框列表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); |
| | | return success(dictTypes); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.config.RuoYiConfig; |
| | | import com.finance.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 首页 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class SysIndexController |
| | | { |
| | | /** 系统基础配置 */ |
| | | @Autowired |
| | | private RuoYiConfig ruoyiConfig; |
| | | |
| | | /** |
| | | * 访问首页,提示语 |
| | | */ |
| | | @RequestMapping("/") |
| | | public String index() |
| | | { |
| | | return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.core.domain.entity.SysRole; |
| | | import com.finance.common.core.domain.model.LoginUser; |
| | | import com.finance.common.core.redis.RedisCache; |
| | | import com.finance.framework.web.service.TokenService; |
| | | import com.finance.system.service.ISysRoleService; |
| | | import com.finance.web.controller.tool.MsgUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.finance.common.constant.Constants; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysMenu; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.core.domain.model.LoginBody; |
| | | import com.finance.common.utils.SecurityUtils; |
| | | import com.finance.framework.web.service.SysLoginService; |
| | | import com.finance.framework.web.service.SysPermissionService; |
| | | import com.finance.system.service.ISysMenuService; |
| | | |
| | | /** |
| | | * 登录验证 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(tags = "登录") |
| | | @RestController |
| | | public class SysLoginController |
| | | { |
| | | @Autowired |
| | | private SysLoginService loginService; |
| | | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | @Autowired |
| | | private MsgUtils msgUtils; |
| | | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "账号密码登录",notes = "账号密码登录") |
| | | @PostMapping("/login") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUser loginUser = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), |
| | | loginBody.getUuid()); |
| | | ajax.put(Constants.TOKEN, tokenService.createToken(loginUser)); |
| | | List<SysRole> roles = loginUser.getUser().getRoles(); |
| | | if(CollectionUtils.isEmpty(roles)){ |
| | | return AjaxResult.error("请关联角色!"); |
| | | } |
| | | if(roles.get(0).getStatus() == 1){ |
| | | return AjaxResult.error("该账号角色已被禁用!"); |
| | | } |
| | | |
| | | List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | |
| | | ajax.put("menus",menus); |
| | | ajax.put("roleName",roles.get(0).getRoleName()); |
| | | ajax.put("userInfo",loginUser); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "短信登录",notes = "短信登录") |
| | | @PostMapping("/loginCode") |
| | | public AjaxResult loginCode(@RequestBody LoginBody loginBody) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUser loginUser = loginService.loginCode(loginBody.getUsername(), loginBody.getCode()); |
| | | ajax.put(Constants.TOKEN, tokenService.createToken(loginUser)); |
| | | List<SysRole> roles = loginUser.getUser().getRoles(); |
| | | if(CollectionUtils.isEmpty(roles)){ |
| | | return AjaxResult.error("请关联角色!"); |
| | | } |
| | | List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | |
| | | ajax.put("menus",menus); |
| | | ajax.put("roleName",roles.get(0).getRoleName()); |
| | | ajax.put("userInfo",loginUser); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 获取验证码 |
| | | * |
| | | * @param phone 手机号 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "获取验证码",notes = "获取验证码") |
| | | @GetMapping("/getCode") |
| | | public AjaxResult getCode(@RequestParam String phone) |
| | | { |
| | | // 发送验证码并存储到redis |
| | | if (StringUtils.hasLength(phone)) { |
| | | String code = String.valueOf((int) (Math.random() * 1000000)); |
| | | redisCache.setCacheObject(phone, code,5*60,TimeUnit.SECONDS); |
| | | try { |
| | | msgUtils.sendMsg(phone, code); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return AjaxResult.success("发送短信验证码成功!5分钟内有效"); |
| | | } |
| | | return AjaxResult.error(500, "发送短信验证码失败,请确认手机号码!"); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @return 用户信息 |
| | | */ |
| | | @GetMapping("getInfo") |
| | | public AjaxResult getInfo() |
| | | { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // 权限集合 |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | | ajax.put("permissions", permissions); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 获取路由信息 |
| | | * |
| | | * @return 路由信息 |
| | | */ |
| | | @GetMapping("getRouters") |
| | | public AjaxResult getRouters() |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
| | | return AjaxResult.success(menuService.buildMenus(menus)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | 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.finance.common.annotation.Log; |
| | | import com.finance.common.constant.UserConstants; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysMenu; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.system.service.ISysMenuService; |
| | | |
| | | /** |
| | | * 菜单信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(tags = "菜单信息") |
| | | @RestController |
| | | @RequestMapping("/system/menu") |
| | | public class SysMenuController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @ApiOperation("菜单权限(有层级)") |
| | | @GetMapping("/levelList") |
| | | public AjaxResult levelList() |
| | | { |
| | | // 获取当前角色的菜单列表 |
| | | List<SysMenu> menus = menuService.selectList(); |
| | | if(menus.size()==0){ |
| | | return AjaxResult.success(new ArrayList<>()); |
| | | } |
| | | // 第三级 |
| | | List<SysMenu> s3 = menus.stream().filter(e -> e.getMenuType().equals("F")).collect(Collectors.toList()); |
| | | // 第二级 |
| | | List<SysMenu> s2 = menus.stream().filter(e -> e.getMenuType().equals("C")).collect(Collectors.toList()); |
| | | // 第一级 |
| | | List<SysMenu> s1 = menus.stream().filter(e -> e.getMenuType().equals("M")).collect(Collectors.toList()); |
| | | |
| | | for (SysMenu menu : s2) { |
| | | List<SysMenu> collect = s3.stream().filter(e -> e.getParentId().equals(menu.getMenuId())).collect(Collectors.toList()); |
| | | menu.setChildren(collect); |
| | | } |
| | | for (SysMenu menu : s1) { |
| | | List<SysMenu> collect = s2.stream().filter(e -> e.getParentId().equals(menu.getMenuId())).collect(Collectors.toList()); |
| | | menu.setChildren(collect); |
| | | } |
| | | |
| | | return AjaxResult.success(s1); |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:menu:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysMenu menu) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return AjaxResult.success(menus); |
| | | } |
| | | |
| | | /** |
| | | * 根据菜单编号获取详细信息 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:menu:query')") |
| | | @GetMapping(value = "/{menuId}") |
| | | public AjaxResult getInfo(@PathVariable Long menuId) |
| | | { |
| | | return AjaxResult.success(menuService.selectMenuById(menuId)); |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单下拉树列表 |
| | | */ |
| | | @GetMapping("/treeselect") |
| | | public AjaxResult treeselect(SysMenu menu) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return AjaxResult.success(menuService.buildMenuTreeSelect(menus)); |
| | | } |
| | | |
| | | /** |
| | | * 加载对应角色菜单列表树 |
| | | */ |
| | | @GetMapping(value = "/roleMenuTreeselect/{roleId}") |
| | | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(getUserId()); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 新增菜单 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:menu:add')") |
| | | @Log(title = "菜单管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
| | | } |
| | | menu.setCreateBy(getUsername()); |
| | | return AjaxResult.success(menuService.insertMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * 修改菜单 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:menu:edit')") |
| | | @Log(title = "菜单管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
| | | } |
| | | else if (menu.getMenuId().equals(menu.getParentId())) |
| | | { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); |
| | | } |
| | | menu.setUpdateBy(getUsername()); |
| | | return AjaxResult.success(menuService.updateMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * 删除菜单 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:menu:remove')") |
| | | @Log(title = "菜单管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{menuId}") |
| | | public AjaxResult remove(@PathVariable("menuId") Long menuId) |
| | | { |
| | | if (menuService.hasChildByMenuId(menuId)) |
| | | { |
| | | return warn("存在子菜单,不允许删除"); |
| | | } |
| | | if (menuService.checkMenuExistRole(menuId)) |
| | | { |
| | | return warn("菜单已分配,不允许删除"); |
| | | } |
| | | return AjaxResult.success(menuService.deleteMenuById(menuId)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.system.domain.SysNotice; |
| | | import com.finance.system.service.ISysNoticeService; |
| | | |
| | | /** |
| | | * 公告 信息操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/notice") |
| | | public class SysNoticeController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysNoticeService noticeService; |
| | | |
| | | /** |
| | | * 获取通知公告列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysNotice notice) |
| | | { |
| | | // startPage(); |
| | | List<SysNotice> list = noticeService.selectNoticeList(notice); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据通知公告编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:query')") |
| | | @GetMapping(value = "/{noticeId}") |
| | | public AjaxResult getInfo(@PathVariable Long noticeId) |
| | | { |
| | | return success(noticeService.selectNoticeById(noticeId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增通知公告 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:add')") |
| | | @Log(title = "通知公告", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysNotice notice) |
| | | { |
| | | notice.setCreateBy(getUsername()); |
| | | return toAjax(noticeService.insertNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * 修改通知公告 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:edit')") |
| | | @Log(title = "通知公告", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysNotice notice) |
| | | { |
| | | notice.setUpdateBy(getUsername()); |
| | | return toAjax(noticeService.updateNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * 删除通知公告 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:remove')") |
| | | @Log(title = "通知公告", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{noticeIds}") |
| | | public AjaxResult remove(@PathVariable Long[] noticeIds) |
| | | { |
| | | return toAjax(noticeService.deleteNoticeByIds(noticeIds)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.poi.ExcelUtil; |
| | | import com.finance.system.domain.SysPost; |
| | | import com.finance.system.service.ISysPostService; |
| | | |
| | | /** |
| | | * 岗位信息操作处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/post") |
| | | public class SysPostController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | /** |
| | | * 获取岗位列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysPost post) |
| | | { |
| | | // startPage(); |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | // @Log(title = "岗位管理", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('system:post:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysPost post) |
| | | // { |
| | | // List<SysPost> list = postService.selectPostList(post); |
| | | // ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class); |
| | | // util.exportExcel(response, list, "岗位数据"); |
| | | // } |
| | | |
| | | /** |
| | | * 根据岗位编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:query')") |
| | | @GetMapping(value = "/{postId}") |
| | | public AjaxResult getInfo(@PathVariable Long postId) |
| | | { |
| | | return success(postService.selectPostById(postId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增岗位 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:add')") |
| | | @Log(title = "岗位管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
| | | } |
| | | post.setCreateBy(getUsername()); |
| | | return toAjax(postService.insertPost(post)); |
| | | } |
| | | |
| | | /** |
| | | * 修改岗位 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:edit')") |
| | | @Log(title = "岗位管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
| | | } |
| | | post.setUpdateBy(getUsername()); |
| | | return toAjax(postService.updatePost(post)); |
| | | } |
| | | |
| | | /** |
| | | * 删除岗位 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:remove')") |
| | | @Log(title = "岗位管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{postIds}") |
| | | public AjaxResult remove(@PathVariable Long[] postIds) |
| | | { |
| | | return toAjax(postService.deletePostByIds(postIds)); |
| | | } |
| | | |
| | | /** |
| | | * 获取岗位选择框列表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | List<SysPost> posts = postService.selectPostAll(); |
| | | return success(posts); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.config.RuoYiConfig; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.core.domain.model.LoginUser; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.SecurityUtils; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.common.utils.file.FileUploadUtils; |
| | | import com.finance.common.utils.file.MimeTypeUtils; |
| | | import com.finance.framework.web.service.TokenService; |
| | | import com.finance.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * 个人信息 业务处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/user/profile") |
| | | public class SysProfileController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 个人信息 |
| | | */ |
| | | @GetMapping |
| | | public AjaxResult profile() |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | AjaxResult ajax = AjaxResult.success(user); |
| | | ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername())); |
| | | ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | @Log(title = "个人信息", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult updateProfile(@RequestBody SysUser user) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser currentUser = loginUser.getUser(); |
| | | currentUser.setNickName(user.getNickName()); |
| | | currentUser.setEmail(user.getEmail()); |
| | | currentUser.setPhoneNumber(user.getPhoneNumber()); |
| | | currentUser.setSex(user.getSex()); |
| | | if (StringUtils.isNotEmpty(user.getPhoneNumber()) && !userService.checkPhoneUnique(currentUser)) |
| | | { |
| | | return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) |
| | | { |
| | | return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
| | | } |
| | | if (userService.updateUserProfile(currentUser) > 0) |
| | | { |
| | | // 更新缓存用户信息 |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | | return error("修改个人信息异常,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @Log(title = "个人信息", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/updatePwd") |
| | | public AjaxResult updatePwd(String oldPassword, String newPassword) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | String userName = loginUser.getUsername(); |
| | | String password = loginUser.getPassword(); |
| | | if (!SecurityUtils.matchesPassword(oldPassword, password)) |
| | | { |
| | | return error("修改密码失败,旧密码错误"); |
| | | } |
| | | if (SecurityUtils.matchesPassword(newPassword, password)) |
| | | { |
| | | return error("新密码不能与旧密码相同"); |
| | | } |
| | | if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) |
| | | { |
| | | // 更新缓存用户密码 |
| | | loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword)); |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | | return error("修改密码异常,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | | * 头像上传 |
| | | */ |
| | | @Log(title = "用户头像", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/avatar") |
| | | public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception |
| | | { |
| | | if (!file.isEmpty()) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION); |
| | | if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("imgUrl", avatar); |
| | | // 更新缓存用户头像 |
| | | loginUser.getUser().setAvatar(avatar); |
| | | tokenService.setLoginUser(loginUser); |
| | | return ajax; |
| | | } |
| | | } |
| | | return error("上传图片异常,请联系管理员"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.model.RegisterBody; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.framework.web.service.SysRegisterService; |
| | | import com.finance.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 注册验证 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class SysRegisterController extends BaseController |
| | | { |
| | | @Autowired |
| | | private SysRegisterService registerService; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @PostMapping("/register") |
| | | public AjaxResult register(@RequestBody RegisterBody user) |
| | | { |
| | | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) |
| | | { |
| | | return error("当前系统没有开启注册功能!"); |
| | | } |
| | | String msg = registerService.register(user); |
| | | return StringUtils.isEmpty(msg) ? success() : error(msg); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.core.domain.entity.SysDept; |
| | | import com.finance.common.core.domain.entity.SysMenu; |
| | | import com.finance.common.core.domain.entity.SysRole; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.core.domain.model.LoginUser; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.framework.web.service.SysPermissionService; |
| | | import com.finance.framework.web.service.TokenService; |
| | | import com.finance.system.domain.SysUserRole; |
| | | import com.finance.system.dto.SysRoleDTO; |
| | | import com.finance.system.query.SysRoleQuery; |
| | | import com.finance.system.service.ISysDeptService; |
| | | import com.finance.system.service.ISysMenuService; |
| | | import com.finance.system.service.ISysRoleService; |
| | | import com.finance.system.service.ISysUserService; |
| | | import com.finance.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.Objects; |
| | | 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 { |
| | | |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @ApiOperation(value = "角色列表") |
| | | @PostMapping("/list") |
| | | public R<PageDTO<RoleInfoVO>> list(@RequestBody SysRoleQuery query) { |
| | | PageDTO<RoleInfoVO> sysRolePageDTO = roleService.selectList(query); |
| | | return R.ok(sysRolePageDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "角色列表不分页") |
| | | @PostMapping("/listNotPage") |
| | | public R<List<RoleInfoVO>> list() { |
| | | List<SysRole> list = roleService.selectRoleList(new SysRole()); |
| | | List<RoleInfoVO> vos = BeanUtils.copyList(list, RoleInfoVO.class); |
| | | return R.ok(vos); |
| | | } |
| | | |
| | | // @ApiOperation(value = "角色数量统计") |
| | | @PostMapping("/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); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | // @Log(title = "角色管理", businessType = BusinessType.EXPORT) |
| | | // // @PreAuthorize("@ss.hasPermi('system:role:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysRole role) |
| | | // { |
| | | // List<SysRole> list = roleService.selectRoleList(role); |
| | | // ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class); |
| | | // util.exportExcel(response, list, "角色数据"); |
| | | // } |
| | | |
| | | /** |
| | | * 根据角色编号获取详细信息 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/{roleId}") |
| | | public AjaxResult getInfo(@PathVariable Long roleId) { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return AjaxResult.success(roleService.selectRoleById(roleId)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("角色详情") |
| | | @GetMapping("/roleInfo") |
| | | public R<RoleInfoVO> roleInfo(@RequestParam Long roleId) { |
| | | SysRole role = roleService.selectRoleById(roleId); |
| | | if (Objects.isNull(role)) { |
| | | return R.ok(new RoleInfoVO()); |
| | | } |
| | | RoleInfoVO roleInfoVo = new RoleInfoVO(); |
| | | roleInfoVo.setRoleId(role.getRoleId()); |
| | | roleInfoVo.setRoleName(role.getRoleName()); |
| | | |
| | | // 获取当前角色的菜单列表 |
| | | List<SysMenu> menus = menuService.selectListByRoleId(roleId); |
| | | 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 R.ok(roleInfoVo); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("用户获取权限菜单") |
| | | @GetMapping("/roleInfoFromUserId") |
| | | public AjaxResult roleInfoFromUserId(@RequestParam Long userId) { |
| | | return AjaxResult.success(roleService.roleInfoFromUserId(userId)); |
| | | } |
| | | |
| | | @ApiOperation("角色获取权限菜单") |
| | | @GetMapping("/getMenuByRoleId") |
| | | public AjaxResult getMenuByRoleId(@RequestParam Long roleId) { |
| | | return AjaxResult.success(roleService.getMenuByRoleId(roleId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增角色 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:add')") |
| | | @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) { |
| | | return error("新增角色'" + dto.getRoleName() + "'失败,角色名称已存在"); |
| | | } |
| | | roleService.saveRole(dto); |
| | | return AjaxResult.success(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 修改保存角色 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @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) { |
| | | return error("修改角色'" + dto.getRoleName() + "'失败,角色名称已存在"); |
| | | } |
| | | if (roleService.editRole(dto) > 0) { |
| | | // 更新缓存用户权限 |
| | | LoginUser loginUser = getLoginUser(); |
| | | if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) { |
| | | loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); |
| | | loginUser.setUser( |
| | | userService.selectUserByUserName(loginUser.getUser().getUserName())); |
| | | tokenService.setLoginUser(loginUser); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | return error("修改角色'" + dto.getRoleName() + "'失败,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存数据权限 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/dataScope") |
| | | public AjaxResult dataScope(@RequestBody SysRole role) { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | return AjaxResult.success(roleService.authDataScope(role)); |
| | | } |
| | | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | // @ApiOperation(value = "状态修改") |
| | | @Log(title = "角色信息-角色状态修改", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysRole role) { |
| | | role.setUpdateBy(getUsername()); |
| | | roleService.updateStatus(role); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 删除角色 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:remove')") |
| | | @ApiOperation(value = "删除角色") |
| | | @Log(title = "角色信息-角色删除角色", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/deleteById/{ids}") |
| | | public AjaxResult remove(@PathVariable String ids) { |
| | | String[] split = ids.split(","); |
| | | List<Long> id = new ArrayList<>(); |
| | | for (String s : split) { |
| | | id.add(Long.valueOf(s)); |
| | | } |
| | | 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) { |
| | | // startPage(); |
| | | List<SysUser> list = userService.selectAllocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询未分配用户角色列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) { |
| | | // startPage(); |
| | | List<SysUser> list = userService.selectUnallocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 取消授权用户 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancel") |
| | | public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) { |
| | | return 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) { |
| | | 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) { |
| | | 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) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); |
| | | ajax.put("depts", deptService.selectDeptTreeList(new SysDept())); |
| | | return ajax; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.system; |
| | | |
| | | import com.finance.common.annotation.Log; |
| | | import com.finance.common.basic.PageDTO; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.entity.SysDept; |
| | | import com.finance.common.core.domain.entity.SysRole; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.utils.SecurityUtils; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.framework.web.service.TokenService; |
| | | import com.finance.system.dto.SysUserDTO; |
| | | import com.finance.system.dto.SysUserUpdateStatusDTO; |
| | | import com.finance.system.dto.update.SysUserPwdUpdDTO; |
| | | import com.finance.system.dto.update.SysUserUpdDTO; |
| | | import com.finance.system.mapper.SysUserRoleMapper; |
| | | import com.finance.system.query.SysUserQuery; |
| | | import com.finance.system.service.ISysDeptService; |
| | | import com.finance.system.service.ISysRoleService; |
| | | import com.finance.system.service.ISysUserService; |
| | | import com.finance.system.vo.SysUserVO; |
| | | 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.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 { |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private SysUserRoleMapper userRoleMapper; |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | | @ApiOperation(value = "获取用户列表") |
| | | @PostMapping("/list") |
| | | public AjaxResult list(@RequestBody SysUserQuery query) { |
| | | PageDTO<SysUserVO> page = userService.pageList(query); |
| | | return AjaxResult.success(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取用户列表-不分页") |
| | | @PostMapping("/listNotPage") |
| | | public AjaxResult listNotPage() { |
| | | List<SysUser> list = userService.queryList(); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户黑名单列表 |
| | | */ |
| | | // @ApiOperation(value = "获取用户黑名单列表") |
| | | // @PostMapping("/blacklist") |
| | | // public AjaxResult blacklist(@RequestBody SysUserQuery query) |
| | | // { |
| | | // startPage(query.getPageNum(), query.getPageSize()); |
| | | // List<SysUserVO> list = userService.selectBlackPageList(query); |
| | | // return AjaxResult.success(getDataTable(list)); |
| | | // } |
| | | |
| | | /** |
| | | * 人员借用列表 |
| | | */ |
| | | // @ApiOperation(value = "人员借用列表") |
| | | // @GetMapping("/userBorrowList") |
| | | // public AjaxResult userBorrowList(@RequestParam(required = false) String name, |
| | | // @RequestParam(required = false) Integer type) |
| | | // { |
| | | // |
| | | // UserAddListVO userAddListVO = new UserAddListVO(); |
| | | // |
| | | // Long companyId = tokenService.getLoginUser().getUser().getCompanyId(); |
| | | // |
| | | // List<TCompany> companyList = new ArrayList<>(); |
| | | // List<TDept> deptList = new ArrayList<>(); |
| | | // List<SysUser> userList = new ArrayList<>(); |
| | | // // 查询公司 |
| | | // if(Objects.nonNull(type) && type == 1){ |
| | | // companyList = companyService.userAddListByCompanyName(name); |
| | | // } |
| | | // // 查询部门 |
| | | // if(Objects.nonNull(type) && type == 2){ |
| | | // deptList = tDeptService.userAddListByDeptName(name); |
| | | // } |
| | | // // 查询用户 |
| | | // if(Objects.nonNull(type) && type == 3){ |
| | | // userList = userService.selectListByNamePhone(name); |
| | | // } |
| | | // |
| | | // if(Objects.isNull(type)){ |
| | | // companyList = companyService.userAddListByCompanyName(name); |
| | | // deptList = tDeptService.userAddListByDeptName(name); |
| | | // userList = userService.selectListByNamePhone(name); |
| | | // } |
| | | // |
| | | // List<Long> companyIds = companyList.stream().map(TCompany::getId).collect(Collectors.toList()); |
| | | // List<Long> deptCompanyIds = deptList.stream().map(TDept::getCompanyId).collect(Collectors.toList()); |
| | | // List<Long> userCompanyIds = userList.stream().map(SysUser::getCompanyId).collect(Collectors.toList()); |
| | | // companyIds.addAll(deptCompanyIds); |
| | | // companyIds.addAll(userCompanyIds); |
| | | // |
| | | // companyIds = companyIds.stream().distinct().collect(Collectors.toList()); |
| | | // |
| | | // if(CollectionUtils.isEmpty(companyIds)){ |
| | | // return AjaxResult.success(userAddListVO); |
| | | // } |
| | | // SysUser user1 = tokenService.getLoginUser().getUser(); |
| | | // if(!user1.isAdmin()){ |
| | | // companyIds = companyIds.stream().filter(e->!e.equals(companyId)).collect(Collectors.toList()); |
| | | // } |
| | | // |
| | | // // 查询符合要求的公司 |
| | | // List<UserLevelVO> parent = companyService.userAddListByCompanyIds(companyIds); |
| | | // |
| | | // List<TDept> depts = tDeptService.selectList(); |
| | | // |
| | | // List<SysUser> sysUsers = userService.selectList(); |
| | | // |
| | | // for (UserLevelVO userLevelVO : parent) { |
| | | // |
| | | // // 找到公司下的部门 |
| | | // List<TDept> tDepts = depts.stream().filter(e -> userLevelVO.getKey().equals(e.getCompanyId())).collect(Collectors.toList()); |
| | | // List<UserLevelVO> children = new ArrayList<>(); |
| | | // // 封装部门 |
| | | // for (TDept dept : tDepts) { |
| | | // userLevelVO.setChildren(children); |
| | | // UserLevelVO userLevelVO1 = new UserLevelVO(); |
| | | // userLevelVO1.setKey(dept.getId()); |
| | | // userLevelVO1.setTitle(dept.getDeptName()); |
| | | // // 找到部门下的人员 |
| | | // List<SysUser> users; |
| | | // if(StringUtils.isNotEmpty(name) && type == 3){ |
| | | // users = sysUsers.stream().filter(e -> userLevelVO1.getKey().equals(e.getDeptId()) |
| | | // && ((StringUtils.isNotEmpty(e.getNickName()) && e.getNickName().contains(name))) |
| | | // || (StringUtils.isNotEmpty(e.getPhoneNumber()) && e.getPhoneNumber().contains(name))).collect(Collectors.toList()); |
| | | // }else { |
| | | // users = sysUsers.stream().filter(e -> userLevelVO1.getKey().equals(e.getDeptId())).collect(Collectors.toList()); |
| | | // } |
| | | // List<UserLevelVO> children1 = new ArrayList<>(); |
| | | // // 封装人员 |
| | | // for (SysUser user : users) { |
| | | // UserLevelVO userLevelVO2 = new UserLevelVO(); |
| | | // userLevelVO2.setKey(user.getUserId()); |
| | | // userLevelVO2.setTitle(user.getNickName()); |
| | | // userLevelVO2.setAvatar(user.getAvatar()); |
| | | // userLevelVO2.setFlag(true); |
| | | // children1.add(userLevelVO2); |
| | | // } |
| | | // userLevelVO1.setChildren(children1); |
| | | // |
| | | // children.add(userLevelVO1); |
| | | // } |
| | | // userLevelVO.setChildren(children); |
| | | // } |
| | | // userAddListVO.setUserLevelVOS(parent); |
| | | // userAddListVO.setUserList(sysUsers); |
| | | // return AjaxResult.success(userAddListVO); |
| | | // } |
| | | |
| | | /** |
| | | * 获取用户详情 |
| | | */ |
| | | @ApiOperation(value = "获取用户详情") |
| | | @GetMapping("/getDetail") |
| | | public AjaxResult getDetail(@RequestParam Long userId) { |
| | | SysUser sysUser = userService.selectUserById(userId); |
| | | SysUserVO sysUserVO = new SysUserVO(); |
| | | BeanUtils.copyProperties(sysUser, sysUserVO); |
| | | |
| | | return AjaxResult.success(sysUser); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户数量统计 |
| | | */ |
| | | // @ApiOperation(value = "获取用户数量统计") |
| | | @PostMapping("/getUserCount") |
| | | public AjaxResult getUserCount() { |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | |
| | | Integer userCountSum = userService.selectCountByStatus(null); |
| | | Integer normalCount = userService.selectCountByStatus(0);// 正常 |
| | | Integer stopCount = userService.selectCountByStatus(1);// 停用 |
| | | |
| | | map.put("all", userCountSum); |
| | | map.put("normal", normalCount); |
| | | map.put("stop", stopCount); |
| | | |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | /** |
| | | * 移除黑名单 |
| | | */ |
| | | @GetMapping("/removeBlackList") |
| | | public AjaxResult removeBlackList(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | List<Long> id = new ArrayList<>(); |
| | | for (String s : split) { |
| | | id.add(Long.valueOf(s)); |
| | | } |
| | | userService.updateUserIfBlack(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | // @Log(title = "用户管理", businessType = BusinessType.EXPORT) |
| | | //// // @PreAuthorize("@ss.hasPermi('system:user:export')") |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, SysUser user) |
| | | // { |
| | | // List<SysUser> list = userService.selectUserList(user); |
| | | // ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | // util.exportExcel(response, list, "用户数据"); |
| | | // } |
| | | |
| | | // @Log(title = "用户管理", businessType = BusinessType.IMPORT) |
| | | //// // @PreAuthorize("@ss.hasPermi('system:user:import')") |
| | | // @PostMapping("/importData") |
| | | // public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception |
| | | // { |
| | | // ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | // List<SysUser> userList = util.importExcel(file.getInputStream()); |
| | | // String operName = getUsername(); |
| | | // String message = userService.importUser(userList, updateSupport, operName); |
| | | // return AjaxResult.success(message); |
| | | // } |
| | | |
| | | // @PostMapping("/importTemplate") |
| | | // public void importTemplate(HttpServletResponse response) |
| | | // { |
| | | // ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | // util.importTemplateExcel(response, "用户数据"); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 新增用户 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:add')") |
| | | @ApiOperation(value = "新增用户管理") |
| | | @Log(title = "用户信息-新增用户", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@Validated @RequestBody SysUserDTO dto) { |
| | | SysUser user = com.finance.common.utils.BeanUtils.copyBean(dto, SysUser.class); |
| | | if (!userService.checkUserNameUnique(user)) { |
| | | return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | | } else if (StringUtils.isNotEmpty(user.getPhoneNumber()) && !userService.checkPhoneUnique( |
| | | user)) { |
| | | return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setNickName(user.getUserName()); |
| | | userService.insertUser(user); |
| | | /* SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setUserId(user.getUserId()); |
| | | sysUserRole.setRoleId(dto.getRoleId()); |
| | | userRoleMapper.insertUserRole(sysUserRole);*/ |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @ApiOperation(value = "修改用户管理") |
| | | @Log(title = "用户信息-修改用户", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@Validated @RequestBody SysUserUpdDTO dto) { |
| | | SysUser user = this.userService.selectUserById(dto.getUserId()); |
| | | user.setUserName(dto.getUserName()); |
| | | user.setNickName(dto.getUserName()); |
| | | user.setPhoneNumber(dto.getPhoneNumber()); |
| | | user.setRoleId(dto.getRoleId()); |
| | | // userService.checkUserAllowed(user); |
| | | // userService.checkUserDataScope(user.getUserId()); |
| | | /*if (!userService.checkUserNameUnique(user)) { |
| | | return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | | } else*/ |
| | | if (StringUtils.isNotEmpty(user.getPhoneNumber()) && !userService.checkPhoneUnique( |
| | | user)) { |
| | | return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | |
| | | user.setUpdateBy(getUsername()); |
| | | return AjaxResult.success(userService.updateUser(user)); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改密码") |
| | | @Log(title = "用户信息-修改密码", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit-password") |
| | | public AjaxResult editPassword(@Validated @RequestBody SysUserPwdUpdDTO dto) { |
| | | SysUser user = this.userService.getById(dto.getUserId()); |
| | | user.setUpdateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | return AjaxResult.success(userService.updateById(user)); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:remove')") |
| | | @ApiOperation(value = "批量删除用户") |
| | | @Log(title = "用户信息-批量删除用户", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/deleteById/{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())) { |
| | | return error("当前用户不能删除"); |
| | | } |
| | | return AjaxResult.success(userService.deleteUserByIds(userIds)); |
| | | } |
| | | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | // @ApiOperation(value = "重置密码") |
| | | @Log(title = "用户信息-重置密码", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/resetPwd") |
| | | public AjaxResult resetPwd(@RequestBody SysUser user) { |
| | | userService.checkUserAllowed(user); |
| | | // userService.checkUserDataScope(user.getUserId()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setUpdateBy(getUsername()); |
| | | return AjaxResult.success(userService.resetPwd(user)); |
| | | } |
| | | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | @ApiOperation(value = "状态修改") |
| | | @Log(title = "用户信息-状态修改", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysUserUpdateStatusDTO dto) { |
| | | SysUser user = new SysUser(); |
| | | user.setUserId(dto.getUserId()); |
| | | user.setStatus(String.valueOf(dto.getStatus())); |
| | | user.setRemark(dto.getRemark()); |
| | | user.setUpdateBy(getUsername()); |
| | | return AjaxResult.success(userService.updateUserStatus(user)); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户编号获取授权角色 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping("/authRole/{userId}") |
| | | public AjaxResult authRole(@PathVariable("userId") Long userId) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | SysUser user = userService.selectUserById(userId); |
| | | List<SysRole> roles = roleService.selectRolesByUserId(userId); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles |
| | | : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 用户授权角色 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "用户管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authRole") |
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) { |
| | | userService.checkUserDataScope(userId); |
| | | userService.insertUserAuth(userId, roleIds); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取部门树列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/deptTree") |
| | | public AjaxResult deptTree(SysDept dept) { |
| | | return AjaxResult.success(deptService.selectDeptTreeList(dept)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.finance.common.exception.ServiceException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import okhttp3.*; |
| | | |
| | | import java.io.*; |
| | | import java.net.URLEncoder; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.util.Base64; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 百度文字识别 |
| | | */ |
| | | @Slf4j |
| | | public class BaiDuApi { |
| | | |
| | | static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build(); |
| | | |
| | | public static void main(String []args) throws IOException{ |
| | | // String url = "C:\\Users\\Admin\\Desktop\\picture\\6fd629ac-3327-4bdc-9459-fcb5295384bc.jpg"; |
| | | String url = "C:\\Users\\Admin\\Desktop\\picture\\6fd629ac-3327-4bdc-9459-fcb5295384bc.jpg"; |
| | | MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |
| | | RequestBody body = RequestBody.create(mediaType, "image="+getFileContentAsBase64(url,true)); |
| | | Request request = new Request.Builder() |
| | | .url("https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token="+getAccessToken()) |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .addHeader("Accept", "application/json") |
| | | .build(); |
| | | Response response = HTTP_CLIENT.newCall(request).execute(); |
| | | |
| | | // System.err.println(response.body().string()); |
| | | |
| | | Map<String,Object> map = new HashMap<>(); |
| | | String string = response.body().string(); |
| | | String idCard = string.substring(string.lastIndexOf("单号:") + 3, string.lastIndexOf("单号:") + 27); |
| | | String time = string.substring(string.lastIndexOf("零时起") + 3, string.lastIndexOf("二十四时")-1); |
| | | time = time.replace(".","-"); |
| | | map.put("idCard",idCard); |
| | | map.put("time",time); |
| | | System.err.println(map); |
| | | } |
| | | |
| | | /** |
| | | * 资质证明证件识别 |
| | | * @param url |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static Map<String,Object> qualification(String url) throws IOException { |
| | | MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |
| | | RequestBody body = RequestBody.create(mediaType, "image="+getFileContentAsBase64(url,true)); |
| | | Request request = new Request.Builder() |
| | | .url("https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token="+getAccessToken()) |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .addHeader("Accept", "application/json") |
| | | .build(); |
| | | Response response = HTTP_CLIENT.newCall(request).execute(); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | try{ |
| | | String string = response.body().string(); |
| | | String idCard = string.substring(string.lastIndexOf("号:") + 2, string.lastIndexOf("号:") + 21); |
| | | String time = string.substring(string.lastIndexOf("至") + 1, string.lastIndexOf("至") + 11); |
| | | time = time.replace(".","-"); |
| | | map.put("idCard",idCard); |
| | | map.put("time",time); |
| | | }catch (Exception e){ |
| | | log.error("资质证明证件识别错误!"); |
| | | throw new ServiceException("资质证明证件识别错误!"); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 身份证识别 |
| | | * @param url |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static Map<String,Object> idCard(String url) throws IOException { |
| | | MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |
| | | RequestBody body = RequestBody.create(mediaType, "image="+getFileContentAsBase64(url,true)); |
| | | Request request = new Request.Builder() |
| | | .url("https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token="+getAccessToken()) |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .addHeader("Accept", "application/json") |
| | | .build(); |
| | | Response response = HTTP_CLIENT.newCall(request).execute(); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | try{ |
| | | JSONObject jsonObject = JSONObject.parseObject(response.body().string()); |
| | | JSONArray jsonArray = JSONObject.parseArray(jsonObject.getString("words_result")); |
| | | JSONObject obj1 = JSONObject.parseObject(jsonArray.get(0).toString()); |
| | | String name = obj1.getString("words"); |
| | | name = name.substring(2); |
| | | |
| | | JSONObject obj2 = JSONObject.parseObject(jsonArray.get(1).toString()); |
| | | String sexStr = obj2.getString("words"); |
| | | sexStr = sexStr.substring(2, 3); |
| | | int sex = "男".equals(sexStr)?0:1; |
| | | |
| | | JSONObject obj3 = JSONObject.parseObject(jsonArray.get(3).toString()); |
| | | JSONObject obj4 = JSONObject.parseObject(jsonArray.get(4).toString()); |
| | | String address = obj3.getString("words") + obj4.getString("words"); |
| | | address = address.substring(2); |
| | | |
| | | JSONObject obj5 = JSONObject.parseObject(jsonArray.get(5).toString()); |
| | | String idCard = obj5.getString("words"); |
| | | idCard = idCard.substring(6); |
| | | |
| | | map.put("name",name); |
| | | map.put("sex",sex); |
| | | map.put("address",address); |
| | | map.put("idCard",idCard); |
| | | }catch (Exception e){ |
| | | log.error("身份证件识别错误!"); |
| | | throw new ServiceException("身份证件识别错误!"); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 通用文字识别(标准版) |
| | | * @param url |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static JSONObject pictureOcr(String url) throws IOException { |
| | | MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |
| | | RequestBody body = RequestBody.create(mediaType, "image="+getFileContentAsBase64(url,true)); |
| | | Request request = new Request.Builder() |
| | | .url("https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token="+getAccessToken()) |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .addHeader("Accept", "application/json") |
| | | .build(); |
| | | Response response = HTTP_CLIENT.newCall(request).execute(); |
| | | return JSONObject.parseObject(response.body().string()); |
| | | } |
| | | |
| | | public static String getAccessToken() throws IOException { |
| | | MediaType mediaType = MediaType.parse("application/json"); |
| | | RequestBody body = RequestBody.create(mediaType, ""); |
| | | Request request = new Request.Builder() |
| | | .url("https://aip.baidubce.com/oauth/2.0/token?client_id=2RkKEqd0ltIHPvnIf3G0VpHE&client_secret=RBpPt3O64e3e4BK7pG3lP0o8I6SGgiUy&grant_type=client_credentials") |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/json") |
| | | .addHeader("Accept", "application/json") |
| | | .build(); |
| | | Response response = HTTP_CLIENT.newCall(request).execute(); |
| | | JSONObject jsonObject = JSONObject.parseObject(response.body().string()); |
| | | return jsonObject.getString("access_token"); |
| | | } |
| | | |
| | | /** |
| | | * 获取文件base64编码 |
| | | * |
| | | * @param path 文件路径 |
| | | * @param urlEncode 如果Content-Type是application/x-www-form-urlencoded时,传true |
| | | * @return base64编码信息,不带文件头 |
| | | * @throws IOException IO异常 |
| | | */ |
| | | static String getFileContentAsBase64(String path, boolean urlEncode) throws IOException { |
| | | byte[] b = Files.readAllBytes(Paths.get(path)); |
| | | String base64 = Base64.getEncoder().encodeToString(b); |
| | | if (urlEncode) { |
| | | base64 = URLEncoder.encode(base64, "utf-8"); |
| | | } |
| | | return base64; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.InputStream; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | |
| | | /** |
| | | * @author zhy |
| | | * @title: HttpClientUtil |
| | | * @projectName car_park |
| | | * @description: http连接工具类 |
| | | * @date 2019/10/2219:23 |
| | | */ |
| | | public class HttpClientUtil { |
| | | |
| | | |
| | | /** |
| | | * @param strUrl |
| | | * @return byte[] |
| | | * @throws |
| | | * @description: 获取网络图片转成字节流 |
| | | * @author zhy |
| | | * @date 2019/10/23 8:59 |
| | | */ |
| | | public static byte[] getImageFromNetByUrl(String strUrl) { |
| | | if (!isURL(strUrl)){ |
| | | return null; |
| | | } |
| | | try { |
| | | URL url = new URL(strUrl); |
| | | HttpURLConnection conn = (HttpURLConnection) url.openConnection(); |
| | | conn.setRequestMethod("GET"); |
| | | conn.setConnectTimeout(2 * 1000); |
| | | InputStream inStream = conn.getInputStream();// 通过输入流获取图片数据 |
| | | byte[] btImg = readInputStream(inStream);// 得到图片的二进制数据 |
| | | return btImg; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 从输入流中获取字节流数据 |
| | | * |
| | | * @param inStream 输入流 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] readInputStream(InputStream inStream) throws Exception { |
| | | ByteArrayOutputStream outStream = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[10240]; |
| | | int len = 0; |
| | | while ((len = inStream.read(buffer)) != -1) { |
| | | outStream.write(buffer, 0, len); |
| | | } |
| | | inStream.close(); |
| | | return outStream.toByteArray(); |
| | | } |
| | | |
| | | public static boolean isURL(String str) { |
| | | str = str.toLowerCase(); |
| | | String regex = "^((https|http|ftp|rtsp|mms)?://)" |
| | | + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" |
| | | + "(([0-9]{1,3}\\.){3}[0-9]{1,3}" |
| | | + "|" |
| | | + "([0-9a-z_!~*'()-]+\\.)*" |
| | | + "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\." |
| | | + "[a-z]{2,6})" |
| | | + "(:[0-9]{1,5})?" |
| | | + "((/?)|" |
| | | + "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$"; |
| | | return str.matches(regex); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.finance.common.core.domain.R; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 导出返回信息 |
| | | */ |
| | | @Slf4j |
| | | public class ImportExcelUtil { |
| | | |
| | | /** |
| | | * @param errorLines 错误行数 |
| | | * @param successLines 成功行数 |
| | | * @param errorMessage 错误信息 |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static R<String> importReturnMsg(int errorLines, int successLines, List<String> errorMessage) throws IOException { |
| | | if (errorLines == 0) { |
| | | return R.ok("共" + successLines + "行数据全部导入成功!"); |
| | | } else { |
| | | JSONObject result = new JSONObject(5); |
| | | int totalCount = successLines + errorLines; |
| | | result.put("totalCount", totalCount); |
| | | result.put("errorCount", errorLines); |
| | | result.put("errorMessage", errorMessage); |
| | | result.put("successCount", successLines); |
| | | result.put("msg", "总上传行数:" + totalCount + ",已导入行数:" + successLines + ",错误行数:" + errorLines); |
| | | return R.ok(JSON.toJSONString(result)); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.finance.system.code.SubmitTemplateReg; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.apache.commons.codec.binary.Hex; |
| | | |
| | | import java.io.Serializable; |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | /** |
| | | * 短信工具类 |
| | | */ |
| | | public class MsgCodeUtil implements Serializable { |
| | | |
| | | /**接口账号用户名*/ |
| | | private static final String AP_ID = ""; |
| | | /**企业名称*/ |
| | | private static final String EC_NAME = ""; |
| | | /**签名*/ |
| | | private static final String SECRET_KEY = ""; |
| | | /**签名编码*/ |
| | | private static final String SIGN = ""; |
| | | /**模板ID*/ |
| | | private static final String TEMPLATE_ID = ""; |
| | | |
| | | |
| | | /** |
| | | * 实体封装 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static SubmitTemplateReg getSubmitTemplateReg(String code,String mobiles) { |
| | | SubmitTemplateReg submitReg =new SubmitTemplateReg(); |
| | | String[] paramss = {code}; |
| | | submitReg.setApId(AP_ID); |
| | | submitReg.setEcName(EC_NAME); |
| | | submitReg.setSecretKey(SECRET_KEY); |
| | | submitReg.setParams(JSONObject.toJSONString(paramss)); |
| | | submitReg.setMobiles(mobiles); |
| | | submitReg.setAddSerial(""); |
| | | submitReg.setSign(SIGN); |
| | | submitReg.setTemplateId(TEMPLATE_ID); |
| | | submitReg.setMac(TEMPLATE_ID); |
| | | StringBuffer stringBuffer = new StringBuffer(); |
| | | stringBuffer.append(submitReg.getEcName( ));stringBuffer.append(submitReg.getApId()); |
| | | stringBuffer.append(submitReg.getSecretKey());stringBuffer.append(submitReg.getTemplateId());stringBuffer.append(submitReg.getMobiles()); |
| | | stringBuffer.append(submitReg.getParams());stringBuffer.append(submitReg.getSign());stringBuffer.append(submitReg.getAddSerial()); |
| | | submitReg.setMac(Hex.encodeHexString(stringBuffer.toString().getBytes(StandardCharsets.UTF_8))); |
| | | String regText = JSONObject.toJSONString(submitReg); |
| | | //加密 |
| | | String encode = Base64.encodeBase64String(regText.getBytes()); |
| | | System.err.println(encode); |
| | | return submitReg; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | getSubmitTemplateReg("123456","18398968484"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsRequest; |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsResponse; |
| | | import com.aliyun.tea.TeaException; |
| | | import com.aliyun.teaopenapi.models.Config; |
| | | import com.aliyun.teautil.models.RuntimeOptions; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class MsgUtils { |
| | | |
| | | @Value("${code.config.accessKeyId}") |
| | | private String accessKeyId; |
| | | @Value("${code.config.accessKeySecret}") |
| | | private String accessKeySecret; |
| | | @Value("${code.config.signName}") |
| | | private String signName; |
| | | @Value("${code.config.templateCode}") |
| | | private String templateCode; |
| | | @Value("${code.config.signNameTest}") |
| | | private String signNameTest; |
| | | @Value("${code.config.templateCodeTest}") |
| | | private String templateCodeTest; |
| | | |
| | | /** |
| | | * 使用AK&SK初始化账号Client |
| | | * @param accessKeyId |
| | | * @param accessKeySecret |
| | | * @return Client |
| | | * @throws Exception |
| | | */ |
| | | public static com.aliyun.dysmsapi20170525.Client createClient(String accessKeyId, String accessKeySecret) throws Exception { |
| | | Config config = new Config() |
| | | // 您的 AccessKey ID |
| | | .setAccessKeyId(accessKeyId) |
| | | // 您的 AccessKey Secret |
| | | .setAccessKeySecret(accessKeySecret); |
| | | // 访问的域名 |
| | | config.endpoint = "dysmsapi.aliyuncs.com"; |
| | | return new com.aliyun.dysmsapi20170525.Client(config); |
| | | } |
| | | |
| | | public void sendMsg(String phone,String code) throws Exception { |
| | | com.aliyun.dysmsapi20170525.Client client = MsgUtils.createClient(accessKeyId,accessKeySecret); |
| | | SendSmsRequest sendSmsRequest = new SendSmsRequest() |
| | | .setSignName(signName) |
| | | .setTemplateCode(templateCode) |
| | | .setPhoneNumbers(phone) |
| | | .setTemplateParam("{\"code\":\""+code+"\"}"); |
| | | RuntimeOptions runtime = new RuntimeOptions(); |
| | | try { |
| | | // 复制代码运行请自行打印 API 的返回值 |
| | | SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest, runtime); |
| | | log.info("短信发送成功:{},{}",sendSmsResponse.getBody().getMessage(),sendSmsResponse.getStatusCode()); |
| | | } catch (TeaException error) { |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } catch (Exception _error) { |
| | | TeaException error = new TeaException(_error.getMessage(), _error); |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.EncodeHintType; |
| | | import com.google.zxing.MultiFormatWriter; |
| | | import com.google.zxing.WriterException; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
| | | import com.finance.common.utils.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.swing.filechooser.FileSystemView; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.io.OutputStream; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 二维码工具 |
| | | * @Author:debug (SteadyJack) |
| | | * @Link: weixin-> debug0868 qq-> 1948831260 |
| | | * @Date: 2020/11/16 22:38 |
| | | **/ |
| | | public class QRCodeUtil { |
| | | private static final Logger log= LoggerFactory.getLogger(QRCodeUtil.class); |
| | | |
| | | //CODE_WIDTH:二维码宽度,单位像素 |
| | | private static final int CODE_WIDTH = 400; |
| | | //CODE_HEIGHT:二维码高度,单位像素 |
| | | private static final int CODE_HEIGHT = 400; |
| | | //FRONT_COLOR:二维码前景色,0x000000 表示黑色 |
| | | private static final int FRONT_COLOR = 0x000000; |
| | | //BACKGROUND_COLOR:二维码背景色,0xFFFFFF 表示白色 |
| | | //演示用 16 进制表示,和前端页面 CSS 的取色是一样的,注意前后景颜色应该对比明显,如常见的黑白 |
| | | private static final int BACKGROUND_COLOR = 0xFFFFFF; |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | createCodeToFile("5261548530",new File("C:\\Users\\Admin\\Desktop\\qrcode"),"5261548530.png"); |
| | | } |
| | | |
| | | public static void createCodeToFile(String content, File codeImgFileSaveDir, String fileName) { |
| | | try { |
| | | if (StringUtils.isBlank(content) || StringUtils.isBlank(fileName)) { |
| | | return; |
| | | } |
| | | content = content.trim(); |
| | | if (codeImgFileSaveDir==null || codeImgFileSaveDir.isFile()) { |
| | | //二维码图片存在目录为空,默认放在桌面... |
| | | codeImgFileSaveDir = FileSystemView.getFileSystemView().getHomeDirectory(); |
| | | } |
| | | if (!codeImgFileSaveDir.exists()) { |
| | | //二维码图片存在目录不存在,开始创建... |
| | | codeImgFileSaveDir.mkdirs(); |
| | | } |
| | | |
| | | //核心代码-生成二维码 |
| | | BufferedImage bufferedImage = getBufferedImage(content); |
| | | |
| | | File codeImgFile = new File(codeImgFileSaveDir, fileName); |
| | | ImageIO.write(bufferedImage, "png", codeImgFile); |
| | | |
| | | log.info("二维码图片生成成功:" + codeImgFile.getPath()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码并输出到输出流, 通常用于输出到网页上进行显示,输出到网页与输出到磁盘上的文件中,区别在于最后一句 ImageIO.write |
| | | * write(RenderedImage im,String formatName,File output):写到文件中 |
| | | * write(RenderedImage im,String formatName,OutputStream output):输出到输出流中 |
| | | * @param content :二维码内容 |
| | | * @param outputStream :输出流,比如 HttpServletResponse 的 getOutputStream |
| | | */ |
| | | public static void createCodeToOutputStream(String content, OutputStream outputStream) { |
| | | try { |
| | | if (StringUtils.isBlank(content)) { |
| | | return; |
| | | } |
| | | content = content.trim(); |
| | | //核心代码-生成二维码 |
| | | BufferedImage bufferedImage = getBufferedImage(content); |
| | | |
| | | //区别就是这一句,输出到输出流中,如果第三个参数是 File,则输出到文件中 |
| | | ImageIO.write(bufferedImage, "png", outputStream); |
| | | |
| | | log.info("二维码图片生成到输出流成功..."); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | //核心代码-生成二维码 |
| | | private static BufferedImage getBufferedImage(String content) throws WriterException { |
| | | |
| | | //com.google.zxing.EncodeHintType:编码提示类型,枚举类型 |
| | | Map<EncodeHintType, Object> hints = new HashMap(); |
| | | |
| | | //EncodeHintType.CHARACTER_SET:设置字符编码类型 |
| | | hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); |
| | | |
| | | //EncodeHintType.ERROR_CORRECTION:设置误差校正 |
| | | //ErrorCorrectionLevel:误差校正等级,L = ~7% correction、M = ~15% correction、Q = ~25% correction、H = ~30% correction |
| | | //不设置时,默认为 L 等级,等级不一样,生成的图案不同,但扫描的结果是一样的 |
| | | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); |
| | | |
| | | //EncodeHintType.MARGIN:设置二维码边距,单位像素,值越小,二维码距离四周越近 |
| | | hints.put(EncodeHintType.MARGIN, 1); |
| | | |
| | | MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); |
| | | BitMatrix bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, CODE_WIDTH, CODE_HEIGHT, hints); |
| | | BufferedImage bufferedImage = new BufferedImage(CODE_WIDTH, CODE_HEIGHT, BufferedImage.TYPE_INT_BGR); |
| | | for (int x = 0; x < CODE_WIDTH; x++) { |
| | | for (int y = 0; y < CODE_HEIGHT; y++) { |
| | | bufferedImage.setRGB(x, y, bitMatrix.get(x, y) ? FRONT_COLOR : BACKGROUND_COLOR); |
| | | } |
| | | } |
| | | return bufferedImage; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import com.finance.common.core.redis.RedisCache; |
| | | import com.finance.system.service.ISysUserService; |
| | | import com.finance.system.service.TbBasicDataService; |
| | | import com.finance.system.service.TbDataScreenConfigService; |
| | | import com.finance.system.service.TbDataScreenScoreService; |
| | | import com.finance.system.service.TbQuestionService; |
| | | import com.finance.system.service.TbScoreService; |
| | | import com.finance.system.vo.ScoreRankVO; |
| | | import com.finance.web.controller.service.DepartmentRanking; |
| | | import java.util.List; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 定时任务工具类 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | public class TaskUtil { |
| | | |
| | | private final RedisCache redisCache; |
| | | private final DepartmentRanking departmentRanking; |
| | | private final ISysUserService sysUserService; |
| | | private final TbBasicDataService tbBasicDataService; |
| | | private final TbDataScreenScoreService tbDataScreenScoreService; |
| | | private final TbDataScreenConfigService tbDataScreenConfigService; |
| | | private final TbQuestionService tbQuestionService; |
| | | private final TbScoreService tbScoreService; |
| | | |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void message() { |
| | | try { |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 每隔一分钟去处理的定时任务 |
| | | */ |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void taskMinute() { |
| | | try { |
| | | // List<Message> list = messageService.list(); |
| | | // Map<Integer,List<Message>> map = new LinkedHashMap<>(); |
| | | // for (Message message : list) { |
| | | // if (map.get(message.getUserId())==null){ |
| | | // List<Message> messages = new ArrayList<>(); |
| | | // messages.add(message); |
| | | // map.put(message.getUserId(),messages); |
| | | // System.err.println("为空"); |
| | | // }else { |
| | | // List<Message> messages = map.get(message.getUserId()); |
| | | // messages.add(message); |
| | | // map.put(message.getUserId(),messages); |
| | | // } |
| | | // } |
| | | // Object cacheObject = redisCache.getCacheObject("1"); |
| | | // Set<Integer> integers = map.keySet(); |
| | | // for (Integer integer : integers) { |
| | | // redisCache.deleteObject(String.valueOf(integer)); |
| | | // redisCache.setCacheList(String.valueOf(integer),map.get(integer)); |
| | | // List<Message> cacheList = redisCache.getCacheList(String.valueOf(integer)); |
| | | // System.err.println("====="+cacheList); |
| | | // } |
| | | // |
| | | // |
| | | // System.err.println("======="+map); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 每天的凌晨执行的任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * *") |
| | | public void taskDay() { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 每天的凌晨执行的任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ? ") |
| | | public void taskDayOne() { |
| | | } |
| | | |
| | | /** |
| | | * 更新排行榜数据 |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ? ") |
| | | public void ranking() { |
| | | List<ScoreRankVO> list = tbScoreService.queryTotalScoreList(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.controller.tool; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.finance.common.core.controller.BaseController; |
| | | import com.finance.common.core.domain.R; |
| | | import com.finance.common.utils.StringUtils; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * swagger 用户测试方法 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/test/user") |
| | | public class TestController extends BaseController |
| | | { |
| | | private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>(); |
| | | { |
| | | users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); |
| | | users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | public R<List<UserEntity>> userList() |
| | | { |
| | | List<UserEntity> userList = new ArrayList<UserEntity>(users.values()); |
| | | return R.ok(userList); |
| | | } |
| | | |
| | | @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) |
| | | @GetMapping("/{userId}") |
| | | public R<UserEntity> getUser(@PathVariable Integer userId) |
| | | { |
| | | if (!users.isEmpty() && users.containsKey(userId)) |
| | | { |
| | | return R.ok(users.get(userId)); |
| | | } |
| | | else |
| | | { |
| | | return R.fail("用户不存在"); |
| | | } |
| | | } |
| | | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class) |
| | | }) |
| | | @PostMapping("/save") |
| | | public R<String> save(UserEntity user) |
| | | { |
| | | if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) |
| | | { |
| | | return R.fail("用户ID不能为空"); |
| | | } |
| | | users.put(user.getUserId(), user); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | public R<String> update(@RequestBody UserEntity user) |
| | | { |
| | | if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) |
| | | { |
| | | return R.fail("用户ID不能为空"); |
| | | } |
| | | if (users.isEmpty() || !users.containsKey(user.getUserId())) |
| | | { |
| | | return R.fail("用户不存在"); |
| | | } |
| | | users.remove(user.getUserId()); |
| | | users.put(user.getUserId(), user); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) |
| | | @DeleteMapping("/{userId}") |
| | | public R<String> delete(@PathVariable Integer userId) |
| | | { |
| | | if (!users.isEmpty() && users.containsKey(userId)) |
| | | { |
| | | users.remove(userId); |
| | | return R.ok(); |
| | | } |
| | | else |
| | | { |
| | | return R.fail("用户不存在"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @ApiModel(value = "UserEntity", description = "用户实体") |
| | | class UserEntity |
| | | { |
| | | @ApiModelProperty("用户ID") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户名称") |
| | | private String username; |
| | | |
| | | @ApiModelProperty("用户密码") |
| | | private String password; |
| | | |
| | | @ApiModelProperty("用户手机") |
| | | private String mobile; |
| | | |
| | | public UserEntity() |
| | | { |
| | | |
| | | } |
| | | |
| | | public UserEntity(Integer userId, String username, String password, String mobile) |
| | | { |
| | | this.userId = userId; |
| | | this.username = username; |
| | | this.password = password; |
| | | this.mobile = mobile; |
| | | } |
| | | |
| | | public Integer getUserId() |
| | | { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getUsername() |
| | | { |
| | | return username; |
| | | } |
| | | |
| | | public void setUsername(String username) |
| | | { |
| | | this.username = username; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getMobile() |
| | | { |
| | | return mobile; |
| | | } |
| | | |
| | | public void setMobile(String mobile) |
| | | { |
| | | this.mobile = mobile; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.web.core.config; |
| | | |
| | | import com.finance.common.config.RuoYiConfig; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.service.*; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spi.service.contexts.SecurityContext; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Swagger2的接口配置 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Configuration |
| | | public class SwaggerConfig |
| | | { |
| | | /** 系统基础配置 */ |
| | | @Autowired |
| | | private RuoYiConfig ruoyiConfig; |
| | | |
| | | /** 是否开启swagger */ |
| | | @Value("${swagger.enabled}") |
| | | private boolean enabled; |
| | | |
| | | /** 设置请求的统一前缀 */ |
| | | @Value("${swagger.pathMapping}") |
| | | private String pathMapping; |
| | | |
| | | /** |
| | | * 创建API |
| | | */ |
| | | @Bean |
| | | public Docket createRestApi() |
| | | { |
| | | return new Docket(DocumentationType.OAS_30) |
| | | // 是否启用Swagger |
| | | .enable(enabled) |
| | | // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) |
| | | .apiInfo(apiInfo()) |
| | | // 设置哪些接口暴露给Swagger展示 |
| | | .select() |
| | | // 扫描所有有注解的api,用这种方式更灵活 |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| | | // 扫描指定包中的swagger注解 |
| | | // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) |
| | | // 扫描所有 .apis(RequestHandlerSelectors.any()) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | /* 设置安全模式,swagger可以设置访问token */ |
| | | .securitySchemes(securitySchemes()) |
| | | .securityContexts(securityContexts()) |
| | | .pathMapping(pathMapping); |
| | | } |
| | | |
| | | /** |
| | | * 安全模式,这里指定token通过Authorization头请求头传递 |
| | | */ |
| | | private List<SecurityScheme> securitySchemes() |
| | | { |
| | | List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>(); |
| | | apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue())); |
| | | return apiKeyList; |
| | | } |
| | | |
| | | /** |
| | | * 安全上下文 |
| | | */ |
| | | private List<SecurityContext> securityContexts() |
| | | { |
| | | List<SecurityContext> securityContexts = new ArrayList<>(); |
| | | securityContexts.add( |
| | | SecurityContext.builder() |
| | | .securityReferences(defaultAuth()) |
| | | .operationSelector(o -> o.requestMappingPattern().matches("/.*")) |
| | | .build()); |
| | | return securityContexts; |
| | | } |
| | | |
| | | /** |
| | | * 默认的安全上引用 |
| | | */ |
| | | private List<SecurityReference> defaultAuth() |
| | | { |
| | | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); |
| | | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; |
| | | authorizationScopes[0] = authorizationScope; |
| | | List<SecurityReference> securityReferences = new ArrayList<>(); |
| | | securityReferences.add(new SecurityReference("Authorization", authorizationScopes)); |
| | | return securityReferences; |
| | | } |
| | | |
| | | /** |
| | | * 添加摘要信息 |
| | | */ |
| | | private ApiInfo apiInfo() |
| | | { |
| | | // 用ApiInfoBuilder进行定制 |
| | | return new ApiInfoBuilder() |
| | | // 设置标题 |
| | | .title("财政运行分析评估系统接口文档") |
| | | // 描述 |
| | | .description("财政运行分析评估系统接口文档") |
| | | // 作者信息 |
| | | .contact(new Contact(ruoyiConfig.getName(), null, null)) |
| | | // 版本 |
| | | .version("版本号:" + ruoyiConfig.getVersion()) |
| | | .build(); |
| | | } |
| | | } |
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.finance: 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: false |
| | | # 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://1.95.13.179:3306/financialdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true |
| | | username: root |
| | | password: Si8bnm5KPGSZkF3F |
| | | # 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.finance.**.domain,com.finance.**.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: 8001 |
| | | 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.finance: 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: 16379 |
| | | # 数据库索引 |
| | | database: 6 |
| | | # 密码 |
| | | password: mPMHThYzlT8DWgl8HLqwPEyPOiHDPPB5 |
| | | # 连接超时时间 |
| | | 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://1.95.13.179:3306/financialdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true |
| | | username: root |
| | | password: Si8bnm5KPGSZkF3F |
| | | # 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.finance.**.domain,com.finance.**.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: 8001 |
| | | 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.finance: 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: 6 |
| | | # 密码 |
| | | password: mPMHThYzlT8DWgl8HLqwPEyPOiHDPPB5 |
| | | # 连接超时时间 |
| | | 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&allowMultiQueries=true |
| | | 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.finance.**.domain,com.finance.**.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 |
| | |
| | | spring: |
| | | profiles: |
| | | active: dev |
New file |
| | |
| | | Application Version: ${ruoyi.version} |
| | | Spring Boot Version: ${spring-boot.version} |
| | | FFFFFFFFFFFFFFFFFFFFFFIIIIIIIIIINNNNNNNN NNNNNNNN AAA NNNNNNNN NNNNNNNN CCCCCCCCCCCCCEEEEEEEEEEEEEEEEEEEEEE |
| | | F::::::::::::::::::::FI::::::::IN:::::::N N::::::N A:::A N:::::::N N::::::N CCC::::::::::::CE::::::::::::::::::::E |
| | | F::::::::::::::::::::FI::::::::IN::::::::N N::::::N A:::::A N::::::::N N::::::N CC:::::::::::::::CE::::::::::::::::::::E |
| | | FF::::::FFFFFFFFF::::FII::::::IIN:::::::::N N::::::N A:::::::A N:::::::::N N::::::N C:::::CCCCCCCC::::CEE::::::EEEEEEEEE::::E |
| | | F:::::F FFFFFF I::::I N::::::::::N N::::::N A:::::::::A N::::::::::N N::::::N C:::::C CCCCCC E:::::E EEEEEE |
| | | F:::::F I::::I N:::::::::::N N::::::N A:::::A:::::A N:::::::::::N N::::::NC:::::C E:::::E |
| | | F::::::FFFFFFFFFF I::::I N:::::::N::::N N::::::N A:::::A A:::::A N:::::::N::::N N::::::NC:::::C E::::::EEEEEEEEEE |
| | | F:::::::::::::::F I::::I N::::::N N::::N N::::::N A:::::A A:::::A N::::::N N::::N N::::::NC:::::C E:::::::::::::::E |
| | | F:::::::::::::::F I::::I N::::::N N::::N:::::::N A:::::A A:::::A N::::::N N::::N:::::::NC:::::C E:::::::::::::::E |
| | | F::::::FFFFFFFFFF I::::I N::::::N N:::::::::::N A:::::AAAAAAAAA:::::A N::::::N N:::::::::::NC:::::C E::::::EEEEEEEEEE |
| | | F:::::F I::::I N::::::N N::::::::::N A:::::::::::::::::::::A N::::::N N::::::::::NC:::::C E:::::E |
| | | F:::::F I::::I N::::::N N:::::::::N A:::::AAAAAAAAAAAAA:::::A N::::::N N:::::::::N C:::::C CCCCCC E:::::E EEEEEE |
| | | FF:::::::FF II::::::IIN::::::N N::::::::N A:::::A A:::::A N::::::N N::::::::N C:::::CCCCCCCC::::CEE::::::EEEEEEEE:::::E |
| | | F::::::::FF I::::::::IN::::::N N:::::::N A:::::A A:::::A N::::::N N:::::::N CC:::::::::::::::CE::::::::::::::::::::E |
| | | F::::::::FF I::::::::IN::::::N N::::::N A:::::A A:::::A N::::::N N::::::N CCC::::::::::::CE::::::::::::::::::::E |
| | | FFFFFFFFFFF IIIIIIIIIINNNNNNNN NNNNNNNAAAAAAA AAAAAAANNNNNNNN NNNNNNN CCCCCCCCCCCCCEEEEEEEEEEEEEEEEEEEEEE |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="/home/ruoyi/logs" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | | <!-- 控制台输出 --> |
| | | <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- 系统日志输出 --> |
| | | <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-info.log</file> |
| | | <!-- 循环政策:基于时间创建日志文件 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志文件名格式 --> |
| | | <fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- 过滤的级别 --> |
| | | <level>INFO</level> |
| | | <!-- 匹配时的操作:接收(记录) --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- 不匹配时的操作:拒绝(不记录) --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-error.log</file> |
| | | <!-- 循环政策:基于时间创建日志文件 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志文件名格式 --> |
| | | <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- 过滤的级别 --> |
| | | <level>ERROR</level> |
| | | <!-- 匹配时的操作:接收(记录) --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- 不匹配时的操作:拒绝(不记录) --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- 用户访问日志输出 --> |
| | | <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-user.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 按天回滚 daily --> |
| | | <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- 系统模块日志级别控制 --> |
| | | <logger name="com.finance" level="info" /> |
| | | <!-- Spring日志级别控制 --> |
| | | <logger name="org.springframework" level="warn" /> |
| | | |
| | | <root level="info"> |
| | | <appender-ref ref="console" /> |
| | | </root> |
| | | |
| | | <!--系统操作日志--> |
| | | <root level="info"> |
| | | <appender-ref ref="file_info" /> |
| | | <appender-ref ref="file_error" /> |
| | | </root> |
| | | |
| | | <!--系统用户操作日志--> |
| | | <logger name="sys-user" level="info"> |
| | | <appender-ref ref="sys-user"/> |
| | | </logger> |
| | | </configuration> |
New file |
| | |
| | | package com.finance; |
| | | |
| | | import static com.finance.web.controller.service.DepartmentRanking.DATA_ONE_SCORE_RANKING_KEY; |
| | | import static com.finance.web.controller.service.DepartmentRanking.TOTAL_SCORE_RANKING_KEY; |
| | | |
| | | import com.finance.web.controller.service.DepartmentRanking; |
| | | import javax.annotation.Resource; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/4/17 |
| | | */ |
| | | @SpringBootTest(classes = FinanceManageApplication.class) |
| | | public class FinanceManageApplicationTest { |
| | | |
| | | @Resource |
| | | private DepartmentRanking departmentRanking; |
| | | |
| | | @Test |
| | | public void test() { |
| | | departmentRanking.addToScoreRanking(TOTAL_SCORE_RANKING_KEY, "area1" , 50); |
| | | departmentRanking.addToScoreRanking(TOTAL_SCORE_RANKING_KEY, "area2" , 50); |
| | | departmentRanking.addToScoreRanking(TOTAL_SCORE_RANKING_KEY, "area3" , 50); |
| | | |
| | | departmentRanking.addToScoreRanking(DATA_ONE_SCORE_RANKING_KEY, "area1" , 50); |
| | | departmentRanking.addToScoreRanking(DATA_ONE_SCORE_RANKING_KEY, "area2" , 80); |
| | | departmentRanking.addToScoreRanking(DATA_ONE_SCORE_RANKING_KEY, "area3" , 90); |
| | | |
| | | Long score1Rank1 = departmentRanking.getScoreRankByAreaCode(TOTAL_SCORE_RANKING_KEY, |
| | | "area1"); |
| | | Long score1Rank2 = departmentRanking.getScoreRankByAreaCode(TOTAL_SCORE_RANKING_KEY, |
| | | "area2"); |
| | | Long score1Rank3 = departmentRanking.getScoreRankByAreaCode(TOTAL_SCORE_RANKING_KEY, |
| | | "area3"); |
| | | Long score2Rank1 = departmentRanking.getScoreRankByAreaCode(DATA_ONE_SCORE_RANKING_KEY, |
| | | "area1"); |
| | | Long score2Rank2 = departmentRanking.getScoreRankByAreaCode(DATA_ONE_SCORE_RANKING_KEY, |
| | | "area2"); |
| | | Long score2Rank3 = departmentRanking.getScoreRankByAreaCode(DATA_ONE_SCORE_RANKING_KEY, |
| | | "area3"); |
| | | |
| | | if (score1Rank1 != null && score2Rank1 != null) { |
| | | System.out.println("Area2's score2 rank: " + (score1Rank1 |
| | | + 1)); // Convert 0-based to 1-based ranking |
| | | System.out.println("Area2's score2 rank: " + (score1Rank2 |
| | | + 1)); // Convert 0-based to 1-based ranking |
| | | System.out.println("Area2's score2 rank: " + (score1Rank3 |
| | | + 1)); // Convert 0-based to 1-based ranking |
| | | System.out.println("Area2's score2 rank: " + (score2Rank1 |
| | | + 1)); // Convert 0-based to 1-based ranking |
| | | System.out.println("Area2's score2 rank: " + (score2Rank2 |
| | | + 1)); // Convert 0-based to 1-based ranking |
| | | System.out.println("Area2's score2 rank: " + (score2Rank3 |
| | | + 1)); // Convert 0-based to 1-based ranking |
| | | } else { |
| | | System.out.println("Area2 not found in the ranking."); |
| | | } |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <groupId>com.finance</groupId> |
| | | <artifactId>finance</artifactId> |
| | | <version>3.8.6</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>finance-common</artifactId> |
| | | |
| | | <description> |
| | | common通用工具 |
| | | </description> |
| | | <properties> |
| | | <swagger.fox.version>3.0.0</swagger.fox.version> |
| | | <swagger.core.version>1.6.2</swagger.core.version> |
| | | </properties> |
| | | <dependencies> |
| | | |
| | | |
| | | <!-- Spring框架基本的核心工具 --> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-context-support</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- SpringWeb模块 --> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-web</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- spring security 安全认证 --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-security</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- pagehelper 分页插件 --> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.pagehelper</groupId>--> |
| | | <!-- <artifactId>pagehelper-spring-boot-starter</artifactId>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- 自定义验证注解 --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-validation</artifactId> |
| | | </dependency> |
| | | |
| | | <!--常用工具类 --> |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-lang3</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- JSON工具类 --> |
| | | <dependency> |
| | | <groupId>com.fasterxml.jackson.core</groupId> |
| | | <artifactId>jackson-databind</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 动态数据源 --> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> |
| | | <version>3.5.2</version> |
| | | </dependency> |
| | | |
| | | <!-- 阿里JSON解析器 --> |
| | | <dependency> |
| | | <groupId>com.alibaba.fastjson2</groupId> |
| | | <artifactId>fastjson2</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- io常用工具类 --> |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- excel工具 --> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.apache.poi</groupId>--> |
| | | <!-- <artifactId>poi-ooxml</artifactId>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- yml解析器 --> |
| | | <dependency> |
| | | <groupId>org.yaml</groupId> |
| | | <artifactId>snakeyaml</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- Token生成与解析--> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- Jaxb --> |
| | | <dependency> |
| | | <groupId>javax.xml.bind</groupId> |
| | | <artifactId>jaxb-api</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- redis 缓存操作 --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- pool 对象池 --> |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-pool2</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 解析客户端操作系统、浏览器等 --> |
| | | <dependency> |
| | | <groupId>eu.bitwalker</groupId> |
| | | <artifactId>UserAgentUtils</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- servlet包 --> |
| | | <dependency> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>javax.servlet-api</artifactId> |
| | | </dependency> |
| | | <!--mybatis-plus--> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | <version>3.5.2</version> |
| | | </dependency> |
| | | <!--lombok--> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>3.0.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>knife4j-spring-boot-starter</artifactId> |
| | | <version>3.0.3</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>io.swagger</groupId>--> |
| | | <!-- <artifactId>swagger-models</artifactId>--> |
| | | <!-- <version>${swagger.core.version}</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>io.swagger</groupId>--> |
| | | <!-- <artifactId>swagger-annotations</artifactId>--> |
| | | <!-- <version>${swagger.core.version}</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>ws.schild</groupId> |
| | | <artifactId>jave-all-deps</artifactId> |
| | | <version>2.5.1</version> |
| | | </dependency> |
| | | <!--easy-poi--> |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-spring-boot-starter</artifactId> |
| | | <version>4.4.0</version> |
| | | </dependency> |
| | | |
| | | <!--hutool工具包--> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | </dependency> |
| | | |
| | | <!--jexl3--> |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-jexl3</artifactId> |
| | | <version>3.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>3.3.4</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.finance.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 匿名访问不鉴权注解 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target({ ElementType.METHOD, ElementType.TYPE }) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface Anonymous |
| | | { |
| | | } |
New file |
| | |
| | | package com.finance.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 数据权限过滤注解 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface DataScope |
| | | { |
| | | /** |
| | | * 部门表的别名 |
| | | */ |
| | | public String deptAlias() default ""; |
| | | |
| | | /** |
| | | * 用户表的别名 |
| | | */ |
| | | public String userAlias() default ""; |
| | | |
| | | /** |
| | | * 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@ss获取,多个权限用逗号分隔开来 |
| | | */ |
| | | public String permission() default ""; |
| | | } |
New file |
| | |
| | | package com.finance.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Inherited; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.finance.common.enums.DataSourceType; |
| | | |
| | | /** |
| | | * 自定义多数据源切换注解 |
| | | * |
| | | * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target({ ElementType.METHOD, ElementType.TYPE }) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | @Inherited |
| | | public @interface DataSource |
| | | { |
| | | /** |
| | | * 切换数据源名称 |
| | | */ |
| | | public DataSourceType value() default DataSourceType.MASTER; |
| | | } |
New file |
| | |
| | | package com.finance.common.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * Excel注解集 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target(ElementType.FIELD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface Excels |
| | | { |
| | | // public Excel[] value(); |
| | | } |
New file |
| | |
| | | package com.finance.common.annotation; |
| | | |
| | | import com.finance.common.enums.BusinessType; |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 自定义操作日志记录注解 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target({ElementType.PARAMETER, ElementType.METHOD}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface FinancialLog { |
| | | |
| | | /** |
| | | * 模块 |
| | | */ |
| | | public String title() default ""; |
| | | |
| | | /** |
| | | * 功能 |
| | | */ |
| | | public BusinessType businessType() default BusinessType.OTHER; |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/4/8 |
| | | */ |
| | | @Target({ElementType.TYPE, ElementType.FIELD, ElementType.ANNOTATION_TYPE}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface HistoryGroup { |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.finance.common.enums.BusinessType; |
| | | import com.finance.common.enums.OperatorType; |
| | | |
| | | /** |
| | | * 自定义操作日志记录注解 |
| | | * |
| | | * @author ruoyi |
| | | * |
| | | */ |
| | | @Target({ ElementType.PARAMETER, ElementType.METHOD }) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface Log |
| | | { |
| | | /** |
| | | * 模块 |
| | | */ |
| | | public String title() default ""; |
| | | |
| | | /** |
| | | * 功能 |
| | | */ |
| | | public BusinessType businessType() default BusinessType.OTHER; |
| | | |
| | | /** |
| | | * 操作人类别 |
| | | */ |
| | | public OperatorType operatorType() default OperatorType.MANAGE; |
| | | |
| | | /** |
| | | * 是否保存请求的参数 |
| | | */ |
| | | public boolean isSaveRequestData() default true; |
| | | |
| | | /** |
| | | * 是否保存响应的参数 |
| | | */ |
| | | public boolean isSaveResponseData() default true; |
| | | |
| | | /** |
| | | * 排除指定的请求参数 |
| | | */ |
| | | public String[] excludeParamNames() default {}; |
| | | } |
New file |
| | |
| | | package com.finance.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.finance.common.constant.CacheConstants; |
| | | import com.finance.common.enums.LimitType; |
| | | |
| | | /** |
| | | * 限流注解 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface RateLimiter |
| | | { |
| | | /** |
| | | * 限流key |
| | | */ |
| | | public String key() default CacheConstants.RATE_LIMIT_KEY; |
| | | |
| | | /** |
| | | * 限流时间,单位秒 |
| | | */ |
| | | public int time() default 60; |
| | | |
| | | /** |
| | | * 限流次数 |
| | | */ |
| | | public int count() default 100; |
| | | |
| | | /** |
| | | * 限流类型 |
| | | */ |
| | | public LimitType limitType() default LimitType.DEFAULT; |
| | | } |
New file |
| | |
| | | package com.finance.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Inherited; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 自定义注解防止表单重复提交 |
| | | * |
| | | * @author ruoyi |
| | | * |
| | | */ |
| | | @Inherited |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface RepeatSubmit |
| | | { |
| | | /** |
| | | * 间隔时间(ms),小于此时间视为重复提交 |
| | | */ |
| | | public int interval() default 5000; |
| | | |
| | | /** |
| | | * 提示消息 |
| | | */ |
| | | public String message() default "不允许重复提交,请稍候再试"; |
| | | } |
New file |
| | |
| | | package com.finance.common.basic; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.finance.common.utils.BeanUtils; |
| | | import com.finance.common.utils.CollUtils; |
| | | import com.finance.common.utils.Convert; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @ApiModel(description = "分页结果") |
| | | public class PageDTO<T> { |
| | | @ApiModelProperty("总条数") |
| | | protected Long total; |
| | | @ApiModelProperty("总页码数") |
| | | protected Long pages; |
| | | @ApiModelProperty("当前页数据") |
| | | protected List<T> list; |
| | | |
| | | public static <T> PageDTO<T> empty(Long total, Long pages) { |
| | | return new PageDTO<>(total, pages, CollUtils.emptyList()); |
| | | } |
| | | public static <T> PageDTO<T> empty(Page<?> page) { |
| | | return new PageDTO<>(page.getTotal(), page.getPages(), CollUtils.emptyList()); |
| | | } |
| | | |
| | | public static <T> PageDTO<T> of(Page<T> page) { |
| | | if(page == null){ |
| | | return new PageDTO<>(); |
| | | } |
| | | if (CollUtils.isEmpty(page.getRecords())) { |
| | | return empty(page); |
| | | } |
| | | return new PageDTO<>(page.getTotal(), page.getPages(), page.getRecords()); |
| | | } |
| | | public static <T,R> PageDTO<T> of(Page<R> page, Function<R, T> mapper) { |
| | | if(page == null){ |
| | | return new PageDTO<>(); |
| | | } |
| | | if (CollUtils.isEmpty(page.getRecords())) { |
| | | return empty(page); |
| | | } |
| | | return new PageDTO<>(page.getTotal(), page.getPages(), |
| | | page.getRecords().stream().map(mapper).collect(Collectors.toList())); |
| | | } |
| | | public static <T> PageDTO<T> of(Page<?> page, List<T> list) { |
| | | return new PageDTO<>(page.getTotal(), page.getPages(), list); |
| | | } |
| | | |
| | | public static <T, R> PageDTO<T> of(Page<R> page, Class<T> clazz) { |
| | | return new PageDTO<>(page.getTotal(), page.getPages(), BeanUtils.copyList(page.getRecords(), clazz)); |
| | | } |
| | | |
| | | public static <T, R> PageDTO<T> of(Page<R> page, Class<T> clazz, Convert<R, T> convert) { |
| | | return new PageDTO<>(page.getTotal(), page.getPages(), BeanUtils.copyList(page.getRecords(), clazz, convert)); |
| | | } |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | @JsonIgnore |
| | | public boolean isEmpty(){ |
| | | return list == null || list.size() == 0; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.basic; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author liheng |
| | | * @Date 2019/08/26 10:28 AM |
| | | * @Description |
| | | */ |
| | | @JsonIgnoreProperties({"orders", "optimizeCountSql", "hitCount", "countId", "maxLimit", "searchCount"}) |
| | | public class PageInfo<T> extends Page<T> implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | private boolean hasNextPage; |
| | | private boolean hasPrevPage; |
| | | private long startIndex; |
| | | |
| | | public PageInfo(long currentPage, long pageShowCount) { |
| | | super(currentPage, pageShowCount); |
| | | this.startIndex = super.offset(); |
| | | } |
| | | |
| | | public PageInfo() { |
| | | super(); |
| | | } |
| | | |
| | | private static boolean hasPrevPage(long currentPage) { |
| | | return currentPage != 1; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<T> setRecords(List<T> records) { |
| | | super.setRecords(records); |
| | | this.hasNextPage = super.hasNext(); |
| | | this.hasPrevPage = super.hasPrevious(); |
| | | return this; |
| | | } |
| | | |
| | | public boolean getHasNextPage() { |
| | | return hasNextPage; |
| | | } |
| | | |
| | | public void setHasNextPage(boolean hasNextPage) { |
| | | this.hasNextPage = hasNextPage; |
| | | } |
| | | |
| | | public boolean getHasPrevPage() { |
| | | return hasPrevPage; |
| | | } |
| | | |
| | | public void setHasPrevPage(boolean hasPrevPage) { |
| | | this.hasPrevPage = hasPrevPage; |
| | | } |
| | | |
| | | private boolean hasNextPage(long currentPage, long totalPage) { |
| | | return currentPage < totalPage && totalPage != 0; |
| | | } |
| | | |
| | | public long getStartIndex() { |
| | | return startIndex; |
| | | } |
| | | |
| | | public void setStartIndex(long startIndex) { |
| | | this.startIndex = startIndex; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.config; |
| | | |
| | | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.reflection.MetaObject; |
| | | |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName DataUpdateInterceptor |
| | | * @Description 数据更新操作处理 |
| | | * @date 2021-12-15 |
| | | * <p> |
| | | * 注意,之前在此处注入了 JwtTokenUtils |
| | | * <p> |
| | | * 造成spring循环依赖,项目支棱不起来 |
| | | */ |
| | | @Slf4j |
| | | //@Configuration |
| | | public class DataUpdateHandlerConfig implements MetaObjectHandler { |
| | | |
| | | /** |
| | | * 新增数据执行 |
| | | * |
| | | * @param metaObject |
| | | */ |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 获取登录信息 |
| | | /* String userName = JwtTokenUtils.getUsername(); |
| | | if (StringUtils.isNotBlank(userName)) { |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } else { |
| | | this.setFieldValByName("createBy", "", metaObject); |
| | | this.setFieldValByName("updateBy", "", metaObject); |
| | | }*/ |
| | | } |
| | | |
| | | /** |
| | | * 修改数据执行 |
| | | * |
| | | * @param metaObject |
| | | */ |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 获取登录信息 |
| | | /*String userName = JwtTokenUtils.getUsername(); |
| | | if (StringUtils.isNotBlank(userName)) { |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } else { |
| | | this.setFieldValByName("createBy", "", metaObject); |
| | | this.setFieldValByName("updateBy", "", metaObject); |
| | | }*/ |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * <p>文件上传配置</p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/10/13 16:10 |
| | | */ |
| | | @Data |
| | | @Component |
| | | @ConfigurationProperties(prefix = "file.upload") |
| | | public class FileUploadConfig { |
| | | private String accessPath; |
| | | private String allowExt; |
| | | private String location; |
| | | private String qrLocation; |
| | | } |
New file |
| | |
| | | package com.finance.common.config; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @author liheng |
| | | * @ClassName MybatisPlusConfig |
| | | * @Description MybatisPlus相关配置 |
| | | * @date 2020-09-22 11:22、 直接以实现类作为bean的注入(有事务管理的类) |
| | | * @EnableTransactionManagement(proxyTargetClass = true) |
| | | */ |
| | | @Configuration |
| | | public class MybatisPlusConfig { |
| | | /* private final DataUpdateHandlerConfig dataUpdateHandler; |
| | | |
| | | @Autowired |
| | | public MybatisPlusConfig(DataUpdateHandlerConfig dataUpdateHandler) { |
| | | this.dataUpdateHandler = dataUpdateHandler; |
| | | }*/ |
| | | |
| | | /** |
| | | * 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题 |
| | | */ |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); |
| | | return interceptor; |
| | | } |
| | | |
| | | /** |
| | | * 自动填充功能 |
| | | * |
| | | * @return |
| | | */ |
| | | /* @Bean |
| | | public GlobalConfig globalConfig() { |
| | | GlobalConfig globalConfig = new GlobalConfig(); |
| | | globalConfig.setMetaObjectHandler(dataUpdateHandler); |
| | | return globalConfig; |
| | | }*/ |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.config; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 读取项目相关配置 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | @ConfigurationProperties(prefix = "ruoyi") |
| | | public class RuoYiConfig |
| | | { |
| | | /** 项目名称 */ |
| | | private String name; |
| | | |
| | | /** 版本 */ |
| | | private String version; |
| | | |
| | | /** 版权年份 */ |
| | | private String copyrightYear; |
| | | |
| | | /** 实例演示开关 */ |
| | | private boolean demoEnabled; |
| | | |
| | | /** 上传路径 */ |
| | | private static String profile; |
| | | |
| | | /** 获取地址开关 */ |
| | | private static boolean addressEnabled; |
| | | |
| | | /** 验证码类型 */ |
| | | private static String captchaType; |
| | | |
| | | public String getName() |
| | | { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) |
| | | { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getVersion() |
| | | { |
| | | return version; |
| | | } |
| | | |
| | | public void setVersion(String version) |
| | | { |
| | | this.version = version; |
| | | } |
| | | |
| | | public String getCopyrightYear() |
| | | { |
| | | return copyrightYear; |
| | | } |
| | | |
| | | public void setCopyrightYear(String copyrightYear) |
| | | { |
| | | this.copyrightYear = copyrightYear; |
| | | } |
| | | |
| | | public boolean isDemoEnabled() |
| | | { |
| | | return demoEnabled; |
| | | } |
| | | |
| | | public void setDemoEnabled(boolean demoEnabled) |
| | | { |
| | | this.demoEnabled = demoEnabled; |
| | | } |
| | | |
| | | public static String getProfile() |
| | | { |
| | | return profile; |
| | | } |
| | | |
| | | public void setProfile(String profile) |
| | | { |
| | | RuoYiConfig.profile = profile; |
| | | } |
| | | |
| | | public static boolean isAddressEnabled() |
| | | { |
| | | return addressEnabled; |
| | | } |
| | | |
| | | public void setAddressEnabled(boolean addressEnabled) |
| | | { |
| | | RuoYiConfig.addressEnabled = addressEnabled; |
| | | } |
| | | |
| | | public static String getCaptchaType() { |
| | | return captchaType; |
| | | } |
| | | |
| | | public void setCaptchaType(String captchaType) { |
| | | RuoYiConfig.captchaType = captchaType; |
| | | } |
| | | |
| | | /** |
| | | * 获取导入上传路径 |
| | | */ |
| | | public static String getImportPath() |
| | | { |
| | | return getProfile() + "/import"; |
| | | } |
| | | |
| | | /** |
| | | * 获取头像上传路径 |
| | | */ |
| | | public static String getAvatarPath() |
| | | { |
| | | return getProfile() + "/avatar"; |
| | | } |
| | | |
| | | /** |
| | | * 获取下载路径 |
| | | */ |
| | | public static String getDownloadPath() |
| | | { |
| | | return getProfile() + "/download/"; |
| | | } |
| | | |
| | | /** |
| | | * 获取上传路径 |
| | | */ |
| | | public static String getUploadPath() |
| | | { |
| | | return getProfile() + "/upload"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.config; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 项目中需继承此类 |
| | | * |
| | | * @author lihen |
| | | */ |
| | | @Data |
| | | @Component |
| | | @ConfigurationProperties(prefix = "wx.config") |
| | | public class WxConfig { |
| | | |
| | | /** |
| | | * 获取 App ID |
| | | * |
| | | * @return App ID |
| | | */ |
| | | @JsonProperty("appId") |
| | | private String appId; |
| | | |
| | | /** |
| | | * 获取 Secret |
| | | * |
| | | * @return Secret |
| | | */ |
| | | @JsonProperty("secret") |
| | | private String secret; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.constant; |
| | | |
| | | /** |
| | | * 缓存的key 常量 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class CacheConstants |
| | | { |
| | | /** |
| | | * 登录用户 redis key |
| | | */ |
| | | public static final String LOGIN_TOKEN_KEY = "login_tokens:"; |
| | | |
| | | /** |
| | | * 验证码 redis key |
| | | */ |
| | | public static final String CAPTCHA_CODE_KEY = "captcha_codes:"; |
| | | |
| | | /** |
| | | * 参数管理 cache key |
| | | */ |
| | | public static final String SYS_CONFIG_KEY = "sys_config:"; |
| | | |
| | | /** |
| | | * 字典管理 cache key |
| | | */ |
| | | public static final String SYS_DICT_KEY = "sys_dict:"; |
| | | |
| | | /** |
| | | * 防重提交 redis key |
| | | */ |
| | | public static final String REPEAT_SUBMIT_KEY = "repeat_submit:"; |
| | | |
| | | /** |
| | | * 限流 redis key |
| | | */ |
| | | public static final String RATE_LIMIT_KEY = "rate_limit:"; |
| | | |
| | | /** |
| | | * 登录账户密码错误次数 redis key |
| | | */ |
| | | public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:"; |
| | | } |
New file |
| | |
| | | package com.finance.common.constant; |
| | | |
| | | import io.jsonwebtoken.Claims; |
| | | |
| | | /** |
| | | * 通用常量信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class Constants { |
| | | |
| | | /** |
| | | * UTF-8 字符集 |
| | | */ |
| | | public static final String UTF8 = "UTF-8"; |
| | | |
| | | /** |
| | | * GBK 字符集 |
| | | */ |
| | | public static final String GBK = "GBK"; |
| | | |
| | | /** |
| | | * www主域 |
| | | */ |
| | | public static final String WWW = "www."; |
| | | |
| | | /** |
| | | * http请求 |
| | | */ |
| | | public static final String HTTP = "http://"; |
| | | |
| | | /** |
| | | * https请求 |
| | | */ |
| | | public static final String HTTPS = "https://"; |
| | | |
| | | /** |
| | | * 通用成功标识 |
| | | */ |
| | | public static final String SUCCESS = "0"; |
| | | |
| | | /** |
| | | * 通用失败标识 |
| | | */ |
| | | public static final String FAIL = "1"; |
| | | |
| | | /** |
| | | * 登录成功 |
| | | */ |
| | | public static final String LOGIN_SUCCESS = "Success"; |
| | | |
| | | /** |
| | | * 注销 |
| | | */ |
| | | public static final String LOGOUT = "Logout"; |
| | | |
| | | /** |
| | | * 注册 |
| | | */ |
| | | public static final String REGISTER = "Register"; |
| | | |
| | | /** |
| | | * 登录失败 |
| | | */ |
| | | public static final String LOGIN_FAIL = "Error"; |
| | | |
| | | /** |
| | | * 验证码有效期(分钟) |
| | | */ |
| | | public static final Integer CAPTCHA_EXPIRATION = 2; |
| | | |
| | | /** |
| | | * 令牌 |
| | | */ |
| | | public static final String TOKEN = "token"; |
| | | |
| | | /** |
| | | * 令牌前缀 |
| | | */ |
| | | public static final String TOKEN_PREFIX = "Bearer "; |
| | | |
| | | /** |
| | | * 令牌前缀 |
| | | */ |
| | | public static final String LOGIN_USER_KEY = "login_user_key"; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | public static final String JWT_USERID = "userid"; |
| | | |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | public static final String JWT_USERNAME = Claims.SUBJECT; |
| | | |
| | | /** |
| | | * 用户头像 |
| | | */ |
| | | public static final String JWT_AVATAR = "avatar"; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | public static final String JWT_CREATED = "created"; |
| | | |
| | | /** |
| | | * 用户权限 |
| | | */ |
| | | public static final String JWT_AUTHORITIES = "authorities"; |
| | | |
| | | /** |
| | | * 资源映射路径 前缀 |
| | | */ |
| | | public static final String RESOURCE_PREFIX = "/profile"; |
| | | |
| | | /** |
| | | * RMI 远程方法调用 |
| | | */ |
| | | public static final String LOOKUP_RMI = "rmi:"; |
| | | |
| | | /** |
| | | * LDAP 远程方法调用 |
| | | */ |
| | | public static final String LOOKUP_LDAP = "ldap:"; |
| | | |
| | | /** |
| | | * LDAPS 远程方法调用 |
| | | */ |
| | | public static final String LOOKUP_LDAPS = "ldaps:"; |
| | | |
| | | /** |
| | | * 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全) |
| | | */ |
| | | public static final String[] JSON_WHITELIST_STR = {"org.springframework" , "com.finance"}; |
| | | |
| | | /** |
| | | * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) |
| | | */ |
| | | public static final String[] JOB_WHITELIST_STR = {"com.finance"}; |
| | | |
| | | /** |
| | | * 定时任务违规的字符 |
| | | */ |
| | | public static final String[] JOB_ERROR_STR = {"java.net.URL" , "javax.naming.InitialContext" , |
| | | "org.yaml.snakeyaml" , |
| | | "org.springframework" , "org.apache" , "com.finance.common.utils.file" , |
| | | "com.finance.common.config"}; |
| | | |
| | | /** |
| | | * 时间格式化 |
| | | */ |
| | | public static final String DATE_FORMATTER_TIME = "yyyy-MM-dd HH:mm:ss"; |
| | | |
| | | /** |
| | | * 用户类型 |
| | | */ |
| | | public static final String USER_TYPE = "用户类型"; |
| | | } |
New file |
| | |
| | | package com.finance.common.constant; |
| | | |
| | | /** |
| | | * 代码生成通用常量 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class GenConstants |
| | | { |
| | | /** 单表(增删改查) */ |
| | | public static final String TPL_CRUD = "crud"; |
| | | |
| | | /** 树表(增删改查) */ |
| | | public static final String TPL_TREE = "tree"; |
| | | |
| | | /** 主子表(增删改查) */ |
| | | public static final String TPL_SUB = "sub"; |
| | | |
| | | /** 树编码字段 */ |
| | | public static final String TREE_CODE = "treeCode"; |
| | | |
| | | /** 树父编码字段 */ |
| | | public static final String TREE_PARENT_CODE = "treeParentCode"; |
| | | |
| | | /** 树名称字段 */ |
| | | public static final String TREE_NAME = "treeName"; |
| | | |
| | | /** 上级菜单ID字段 */ |
| | | public static final String PARENT_MENU_ID = "parentMenuId"; |
| | | |
| | | /** 上级菜单名称字段 */ |
| | | public static final String PARENT_MENU_NAME = "parentMenuName"; |
| | | |
| | | /** 数据库字符串类型 */ |
| | | public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" }; |
| | | |
| | | /** 数据库文本类型 */ |
| | | public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" }; |
| | | |
| | | /** 数据库时间类型 */ |
| | | public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" }; |
| | | |
| | | /** 数据库数字类型 */ |
| | | public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer", |
| | | "bit", "bigint", "float", "double", "decimal" }; |
| | | |
| | | /** 页面不需要编辑字段 */ |
| | | public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" }; |
| | | |
| | | /** 页面不需要显示的列表字段 */ |
| | | public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by", |
| | | "update_time" }; |
| | | |
| | | /** 页面不需要查询字段 */ |
| | | public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by", |
| | | "update_time", "remark" }; |
| | | |
| | | /** Entity基类字段 */ |
| | | public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" }; |
| | | |
| | | /** Tree基类字段 */ |
| | | public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" }; |
| | | |
| | | /** 文本框 */ |
| | | public static final String HTML_INPUT = "input"; |
| | | |
| | | /** 文本域 */ |
| | | public static final String HTML_TEXTAREA = "textarea"; |
| | | |
| | | /** 下拉框 */ |
| | | public static final String HTML_SELECT = "select"; |
| | | |
| | | /** 单选框 */ |
| | | public static final String HTML_RADIO = "radio"; |
| | | |
| | | /** 复选框 */ |
| | | public static final String HTML_CHECKBOX = "checkbox"; |
| | | |
| | | /** 日期控件 */ |
| | | public static final String HTML_DATETIME = "datetime"; |
| | | |
| | | /** 图片上传控件 */ |
| | | public static final String HTML_IMAGE_UPLOAD = "imageUpload"; |
| | | |
| | | /** 文件上传控件 */ |
| | | public static final String HTML_FILE_UPLOAD = "fileUpload"; |
| | | |
| | | /** 富文本控件 */ |
| | | public static final String HTML_EDITOR = "editor"; |
| | | |
| | | /** 字符串类型 */ |
| | | public static final String TYPE_STRING = "String"; |
| | | |
| | | /** 整型 */ |
| | | public static final String TYPE_INTEGER = "Integer"; |
| | | |
| | | /** 长整型 */ |
| | | public static final String TYPE_LONG = "Long"; |
| | | |
| | | /** 浮点型 */ |
| | | public static final String TYPE_DOUBLE = "Double"; |
| | | |
| | | /** 高精度计算类型 */ |
| | | public static final String TYPE_BIGDECIMAL = "BigDecimal"; |
| | | |
| | | /** 时间类型 */ |
| | | public static final String TYPE_DATE = "Date"; |
| | | |
| | | /** 模糊查询 */ |
| | | public static final String QUERY_LIKE = "LIKE"; |
| | | |
| | | /** 相等查询 */ |
| | | public static final String QUERY_EQ = "EQ"; |
| | | |
| | | /** 需要 */ |
| | | public static final String REQUIRE = "1"; |
| | | } |
New file |
| | |
| | | package com.finance.common.constant; |
| | | |
| | | /** |
| | | * 返回状态码 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class HttpStatus |
| | | { |
| | | /** |
| | | * 操作成功 |
| | | */ |
| | | public static final int SUCCESS = 200; |
| | | |
| | | /** |
| | | * 对象创建成功 |
| | | */ |
| | | public static final int CREATED = 201; |
| | | |
| | | /** |
| | | * 请求已经被接受 |
| | | */ |
| | | public static final int ACCEPTED = 202; |
| | | |
| | | /** |
| | | * 操作已经执行成功,但是没有返回数据 |
| | | */ |
| | | public static final int NO_CONTENT = 204; |
| | | |
| | | /** |
| | | * 资源已被移除 |
| | | */ |
| | | public static final int MOVED_PERM = 301; |
| | | |
| | | /** |
| | | * 重定向 |
| | | */ |
| | | public static final int SEE_OTHER = 303; |
| | | |
| | | /** |
| | | * 资源没有被修改 |
| | | */ |
| | | public static final int NOT_MODIFIED = 304; |
| | | |
| | | /** |
| | | * 参数列表错误(缺少,格式不匹配) |
| | | */ |
| | | public static final int BAD_REQUEST = 400; |
| | | |
| | | /** |
| | | * 未授权 |
| | | */ |
| | | public static final int UNAUTHORIZED = 401; |
| | | |
| | | /** |
| | | * 访问受限,授权过期 |
| | | */ |
| | | public static final int FORBIDDEN = 403; |
| | | |
| | | /** |
| | | * 资源,服务未找到 |
| | | */ |
| | | public static final int NOT_FOUND = 404; |
| | | |
| | | /** |
| | | * 不允许的http方法 |
| | | */ |
| | | public static final int BAD_METHOD = 405; |
| | | |
| | | /** |
| | | * 资源冲突,或者资源被锁 |
| | | */ |
| | | public static final int CONFLICT = 409; |
| | | |
| | | /** |
| | | * 不支持的数据,媒体类型 |
| | | */ |
| | | public static final int UNSUPPORTED_TYPE = 415; |
| | | |
| | | /** |
| | | * 系统内部错误 |
| | | */ |
| | | public static final int ERROR = 500; |
| | | |
| | | /** |
| | | * 接口未实现 |
| | | */ |
| | | public static final int NOT_IMPLEMENTED = 501; |
| | | |
| | | /** |
| | | * 系统警告消息 |
| | | */ |
| | | public static final int WARN = 601; |
| | | } |
New file |
| | |
| | | package com.finance.common.constant; |
| | | |
| | | /** |
| | | * 任务调度通用常量 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class ScheduleConstants |
| | | { |
| | | public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME"; |
| | | |
| | | /** 执行目标key */ |
| | | public static final String TASK_PROPERTIES = "TASK_PROPERTIES"; |
| | | |
| | | /** 默认 */ |
| | | public static final String MISFIRE_DEFAULT = "0"; |
| | | |
| | | /** 立即触发执行 */ |
| | | public static final String MISFIRE_IGNORE_MISFIRES = "1"; |
| | | |
| | | /** 触发一次执行 */ |
| | | public static final String MISFIRE_FIRE_AND_PROCEED = "2"; |
| | | |
| | | /** 不触发立即执行 */ |
| | | public static final String MISFIRE_DO_NOTHING = "3"; |
| | | |
| | | public enum Status |
| | | { |
| | | /** |
| | | * 正常 |
| | | */ |
| | | NORMAL("0"), |
| | | /** |
| | | * 暂停 |
| | | */ |
| | | PAUSE("1"); |
| | | |
| | | private String value; |
| | | |
| | | private Status(String value) |
| | | { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getValue() |
| | | { |
| | | return value; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.constant; |
| | | |
| | | /** |
| | | * 用户常量信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserConstants |
| | | { |
| | | /** |
| | | * 平台内系统用户的唯一标志 |
| | | */ |
| | | public static final String SYS_USER = "SYS_USER"; |
| | | |
| | | /** 正常状态 */ |
| | | public static final String NORMAL = "0"; |
| | | |
| | | /** 异常状态 */ |
| | | public static final String EXCEPTION = "1"; |
| | | |
| | | /** 用户封禁状态 */ |
| | | public static final String USER_DISABLE = "1"; |
| | | |
| | | /** 角色封禁状态 */ |
| | | public static final String ROLE_DISABLE = "1"; |
| | | |
| | | /** 部门正常状态 */ |
| | | public static final String DEPT_NORMAL = "0"; |
| | | |
| | | /** 部门停用状态 */ |
| | | public static final String DEPT_DISABLE = "1"; |
| | | |
| | | /** 字典正常状态 */ |
| | | public static final String DICT_NORMAL = "0"; |
| | | |
| | | /** 是否为系统默认(是) */ |
| | | public static final String YES = "Y"; |
| | | |
| | | /** 是否菜单外链(是) */ |
| | | public static final String YES_FRAME = "0"; |
| | | |
| | | /** 是否菜单外链(否) */ |
| | | public static final String NO_FRAME = "1"; |
| | | |
| | | /** 菜单类型(目录) */ |
| | | public static final String TYPE_DIR = "M"; |
| | | |
| | | /** 菜单类型(菜单) */ |
| | | public static final String TYPE_MENU = "C"; |
| | | |
| | | /** 菜单类型(按钮) */ |
| | | public static final String TYPE_BUTTON = "F"; |
| | | |
| | | /** Layout组件标识 */ |
| | | public final static String LAYOUT = "Layout"; |
| | | |
| | | /** ParentView组件标识 */ |
| | | public final static String PARENT_VIEW = "ParentView"; |
| | | |
| | | /** InnerLink组件标识 */ |
| | | public final static String INNER_LINK = "InnerLink"; |
| | | |
| | | /** 校验是否唯一的返回标识 */ |
| | | public final static boolean UNIQUE = true; |
| | | public final static boolean NOT_UNIQUE = false; |
| | | |
| | | /** |
| | | * 用户名长度限制 |
| | | */ |
| | | public static final int USERNAME_MIN_LENGTH = 2; |
| | | public static final int USERNAME_MAX_LENGTH = 20; |
| | | |
| | | /** |
| | | * 密码长度限制 |
| | | */ |
| | | public static final int PASSWORD_MIN_LENGTH = 5; |
| | | public static final int PASSWORD_MAX_LENGTH = 40; |
| | | } |
New file |
| | |
| | | package com.finance.common.constant; |
| | | |
| | | /** |
| | | * @Description 对接微信小程序的常量 |
| | | * @Author xiaochen |
| | | * @Date 2021/10/19/01914:01 |
| | | */ |
| | | public class WxConstant { |
| | | |
| | | /** |
| | | * 生成小程序码地址 |
| | | */ |
| | | public static final String CREATE_CODE_URL = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=ACCESS_TOKEN"; |
| | | |
| | | /** |
| | | * 高德地图坐标转换 |
| | | */ |
| | | public static final String ADDRESS_CONVERT_TO_COORDINATE = "https://restapi.amap.com/v3/geocode/geo?key=KEY&address=ADDRESS"; |
| | | } |
New file |
| | |
| | | package com.finance.common.core.controller; |
| | | |
| | | import com.finance.common.constant.HttpStatus; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import com.finance.common.core.domain.model.LoginUser; |
| | | import com.finance.common.core.page.TableDataInfo; |
| | | import com.finance.common.utils.DateUtils; |
| | | import com.finance.common.utils.SecurityUtils; |
| | | import com.finance.common.utils.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.WebDataBinder; |
| | | import org.springframework.web.bind.annotation.InitBinder; |
| | | |
| | | import java.beans.PropertyEditorSupport; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * web层通用数据处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BaseController |
| | | { |
| | | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | /** |
| | | * 将前台传递过来的日期格式的字符串,自动转化为Date类型 |
| | | */ |
| | | @InitBinder |
| | | public void initBinder(WebDataBinder binder) |
| | | { |
| | | // Date 类型转换 |
| | | binder.registerCustomEditor(Date.class, new PropertyEditorSupport() |
| | | { |
| | | @Override |
| | | public void setAsText(String text) |
| | | { |
| | | setValue(DateUtils.parseDate(text)); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 设置请求分页数据 |
| | | */ |
| | | // protected void startPage() |
| | | // { |
| | | // PageUtils.startPage(); |
| | | // } |
| | | |
| | | /** |
| | | * 设置请求分页数据 |
| | | */ |
| | | // protected void startPage(Integer pageNum,Integer pageSize) |
| | | // { |
| | | // PageUtils.startPage(pageNum,pageSize); |
| | | // } |
| | | |
| | | /** |
| | | * 设置请求排序数据 |
| | | */ |
| | | protected void startOrderBy() |
| | | { |
| | | // PageDomain pageDomain = TableSupport.buildPageRequest(); |
| | | // if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) |
| | | // { |
| | | // String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); |
| | | // PageHelper.orderBy(orderBy); |
| | | // } |
| | | } |
| | | |
| | | /** |
| | | * 清理分页的线程变量 |
| | | */ |
| | | // protected void clearPage() |
| | | // { |
| | | // PageUtils.clearPage(); |
| | | // } |
| | | |
| | | /** |
| | | * 响应请求分页数据 |
| | | */ |
| | | @SuppressWarnings({ "rawtypes", "unchecked" }) |
| | | protected TableDataInfo getDataTable(List<?> list) |
| | | { |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setMsg("查询成功"); |
| | | rspData.setRecords(list); |
| | | // rspData.setTotal(new PageInfo(list).getTotal()); |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * 返回成功 |
| | | */ |
| | | public AjaxResult success() |
| | | { |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 返回失败消息 |
| | | */ |
| | | public AjaxResult error() |
| | | { |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | */ |
| | | public AjaxResult success(String message) |
| | | { |
| | | return AjaxResult.success(message); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | */ |
| | | public AjaxResult success(Object data) |
| | | { |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | /** |
| | | * 返回失败消息 |
| | | */ |
| | | public AjaxResult error(String message) |
| | | { |
| | | return AjaxResult.error(message); |
| | | } |
| | | |
| | | /** |
| | | * 返回警告消息 |
| | | */ |
| | | public AjaxResult warn(String message) |
| | | { |
| | | return AjaxResult.warn(message); |
| | | } |
| | | |
| | | /** |
| | | * 响应返回结果 |
| | | * |
| | | * @param rows 影响行数 |
| | | * @return 操作结果 |
| | | */ |
| | | protected AjaxResult toAjax(int rows) |
| | | { |
| | | return rows > 0 ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * 响应返回结果 |
| | | * |
| | | * @param result 结果 |
| | | * @return 操作结果 |
| | | */ |
| | | protected AjaxResult toAjax(boolean result) |
| | | { |
| | | return result ? success() : error(); |
| | | } |
| | | |
| | | /** |
| | | * 页面跳转 |
| | | */ |
| | | public String redirect(String url) |
| | | { |
| | | return StringUtils.format("redirect:{}", url); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户缓存信息 |
| | | */ |
| | | public LoginUser getLoginUser() |
| | | { |
| | | return SecurityUtils.getLoginUser(); |
| | | } |
| | | |
| | | /** |
| | | * 获取登录用户id |
| | | */ |
| | | public Long getUserId() |
| | | { |
| | | return getLoginUser().getUserId(); |
| | | } |
| | | |
| | | /** |
| | | * 获取登录部门id |
| | | */ |
| | | public Long getDeptId() |
| | | { |
| | | return getLoginUser().getDeptId(); |
| | | } |
| | | |
| | | /** |
| | | * 获取登录用户名 |
| | | */ |
| | | public String getUsername() |
| | | { |
| | | return getLoginUser().getUsername(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.controller; |
| | | |
| | | import com.finance.common.config.FileUploadConfig; |
| | | import com.finance.common.core.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 文件上传控制类 |
| | | * |
| | | * @author junelee |
| | | * @date 2020/3/20 20:21 |
| | | */ |
| | | @Api(tags = "服务器文件上传") |
| | | @RestController |
| | | @CrossOrigin |
| | | @RequestMapping("/file/") |
| | | public class FileController { |
| | | |
| | | @Autowired |
| | | private FileUploadConfig fileUploadConfig; |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "单文件上传", notes = "单文件上传,rename 默认不重命名") |
| | | @PostMapping(value = "upload", headers = "content-type=multipart/form-data") |
| | | public AjaxResult uploadImageMany(@RequestParam(value = "file") MultipartFile mf) throws IOException { |
| | | if (mf.isEmpty()) { |
| | | return AjaxResult.error("请传入文件!"); |
| | | } |
| | | String TimeDir =new SimpleDateFormat("yyyy-MM-dd").format(new Date()); |
| | | // String realPath = fileUploadConfig.getLocation() + TimeDir; |
| | | String realPath = "C:\\Users\\Admin\\Desktop\\qrcode\\" + TimeDir; |
| | | File file = new File(realPath); |
| | | // 没有目录就创建 |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | // 获取文件名称 |
| | | String filename = mf.getOriginalFilename(); |
| | | // 获取文件后缀 |
| | | String ext = filename.substring(filename.lastIndexOf("."), filename.length()); |
| | | // 检查文件类型 |
| | | if (!fileUploadConfig.getAllowExt().contains(ext)) { |
| | | return AjaxResult.error("上传文件格式不正确,仅支持" + fileUploadConfig.getAllowExt()); |
| | | } |
| | | File targetFile = new File(realPath, filename);//目标文件 |
| | | //开始从源文件拷贝到目标文件 |
| | | //传图片一步到位 |
| | | mf.transferTo(targetFile); |
| | | //拼接数据 |
| | | // String imgstr = fileUploadConfig.getAccessPath() + TimeDir +"\\"+ filename; |
| | | String imgstr = TimeDir +"/"+ filename; |
| | | return AjaxResult.success(imgstr); |
| | | } |
| | | |
| | | |
| | | // @ApiOperation(value = "单文件上传", notes = "单文件上传,rename 默认不重命名") |
| | | // @PostMapping(value = "strUpload", headers = "content-type=multipart/form-data") |
| | | // public String strUpload(@RequestParam(value = "file") MultipartFile mf,@RequestParam(value = "fileName")String fileName) throws IOException { |
| | | // if (mf.isEmpty()) { |
| | | // return "请传入文件!"; |
| | | // } |
| | | // String TimeDir =new SimpleDateFormat("yyyy-MM-dd").format(new Date()); |
| | | // String realPath = fileUploadConfig.getQrLocation() + TimeDir; |
| | | // File file = new File(realPath); |
| | | // // 没有目录就创建 |
| | | // if (!file.exists()) { |
| | | // file.mkdirs(); |
| | | // } |
| | | // File targetFile = new File(realPath, fileName);//目标文件 |
| | | // //开始从源文件拷贝到目标文件 |
| | | // //传图片一步到位 |
| | | // mf.transferTo(targetFile); |
| | | // //拼接数据 |
| | | // return fileUploadConfig.getQrLocation() + TimeDir +"\\"+ fileName; |
| | | // } |
| | | |
| | | @ApiOperation(value = "单文件上传", notes = "单文件上传,rename 默认不重命名") |
| | | @PostMapping(value = "strUpload", headers = "content-type=multipart/form-data") |
| | | public String strUpload(@RequestParam(value = "file") MultipartFile mf,@RequestParam(value = "fileName")String fileName) throws IOException { |
| | | if (mf.isEmpty()) { |
| | | return "请传入文件!"; |
| | | } |
| | | String TimeDir =new SimpleDateFormat("yyyy-MM-dd").format(new Date()); |
| | | String realPath = "C:\\Users\\Admin\\Desktop\\qrcode\\" + TimeDir; |
| | | File file = new File(realPath); |
| | | // 没有目录就创建 |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | File targetFile = new File(realPath, fileName);//目标文件 |
| | | //开始从源文件拷贝到目标文件 |
| | | //传图片一步到位 |
| | | mf.transferTo(targetFile); |
| | | //拼接数据 |
| | | return TimeDir +"/"+ fileName; |
| | | } |
| | | |
| | | @ApiOperation(value = "单文件上传(覆盖服务器原文件)", notes = "单文件上传,rename 默认不重命名") |
| | | @PostMapping(value = "test/upload", headers = "content-type=multipart/form-data") |
| | | public AjaxResult uploadTest(@RequestParam(value = "file") MultipartFile mf) throws IOException { |
| | | if (mf.isEmpty()) { |
| | | return AjaxResult.error("请传入文件!"); |
| | | } |
| | | String TimeDir = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); |
| | | String realPath = fileUploadConfig.getLocation() + "2021-11-17"; |
| | | File file = new File(realPath); |
| | | // 没有目录就创建 |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | // 判断文件大小 |
| | | String filename = "6u2mGlqHkeE75e2ab51b4a03c6982ff7d68f4c024d43.jpg"; |
| | | // 获取文件后缀 |
| | | String ext = filename.substring(filename.lastIndexOf("."), filename.length()); |
| | | // 检查文件类型 |
| | | if (!fileUploadConfig.getAllowExt().contains(ext)) { |
| | | return AjaxResult.error("上传文件格式不正确,仅支持" + fileUploadConfig.getAllowExt()); |
| | | } |
| | | File targetFile = new File(realPath, filename);//目标文件 |
| | | //开始从源文件拷贝到目标文件 |
| | | //传图片一步到位 |
| | | mf.transferTo(targetFile); |
| | | //拼接数据 |
| | | String imgstr = fileUploadConfig.getAccessPath() + "2021-11-17" + "/" + filename; |
| | | return AjaxResult.success(imgstr); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Objects; |
| | | import com.finance.common.constant.HttpStatus; |
| | | import com.finance.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 操作消息提醒 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class AjaxResult<T> extends HashMap<String, Object> |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 状态码 */ |
| | | public static final String CODE_TAG = "code"; |
| | | |
| | | /** 返回内容 */ |
| | | public static final String MSG_TAG = "msg"; |
| | | |
| | | /** 数据对象 */ |
| | | public static final String DATA_TAG = "data"; |
| | | |
| | | /** |
| | | * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 |
| | | */ |
| | | public AjaxResult() |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * 初始化一个新创建的 AjaxResult 对象 |
| | | * |
| | | * @param code 状态码 |
| | | * @param msg 返回内容 |
| | | */ |
| | | public AjaxResult(int code, String msg) |
| | | { |
| | | super.put(CODE_TAG, code); |
| | | super.put(MSG_TAG, msg); |
| | | } |
| | | |
| | | /** |
| | | * 初始化一个新创建的 AjaxResult 对象 |
| | | * |
| | | * @param code 状态码 |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | */ |
| | | public AjaxResult(int code, String msg, Object data) |
| | | { |
| | | super.put(CODE_TAG, code); |
| | | super.put(MSG_TAG, msg); |
| | | if (StringUtils.isNotNull(data)) |
| | | { |
| | | super.put(DATA_TAG, data); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | * |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success() |
| | | { |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功数据 |
| | | * |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success(Object data) |
| | | { |
| | | return AjaxResult.success("操作成功", data); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success(String msg) |
| | | { |
| | | return AjaxResult.success(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 返回成功消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | * @return 成功消息 |
| | | */ |
| | | public static AjaxResult success(String msg, Object data) |
| | | { |
| | | return new AjaxResult(HttpStatus.SUCCESS, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * 返回警告消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @return 警告消息 |
| | | */ |
| | | public static AjaxResult warn(String msg) |
| | | { |
| | | return AjaxResult.warn(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 返回警告消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | * @return 警告消息 |
| | | */ |
| | | public static AjaxResult warn(String msg, Object data) |
| | | { |
| | | return new AjaxResult(HttpStatus.WARN, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @return 错误消息 |
| | | */ |
| | | public static AjaxResult error() |
| | | { |
| | | return AjaxResult.error("操作失败"); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @return 错误消息 |
| | | */ |
| | | public static AjaxResult error(String msg) |
| | | { |
| | | return AjaxResult.error(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @param msg 返回内容 |
| | | * @param data 数据对象 |
| | | * @return 错误消息 |
| | | */ |
| | | public static AjaxResult error(String msg, Object data) |
| | | { |
| | | return new AjaxResult(HttpStatus.ERROR, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * 返回错误消息 |
| | | * |
| | | * @param code 状态码 |
| | | * @param msg 返回内容 |
| | | * @return 错误消息 |
| | | */ |
| | | public static AjaxResult error(int code, String msg) |
| | | { |
| | | return new AjaxResult(code, msg, null); |
| | | } |
| | | |
| | | /** |
| | | * 是否为成功消息 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | public boolean isSuccess() |
| | | { |
| | | return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG)); |
| | | } |
| | | |
| | | /** |
| | | * 是否为警告消息 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | public boolean isWarn() |
| | | { |
| | | return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG)); |
| | | } |
| | | |
| | | /** |
| | | * 是否为错误消息 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | public boolean isError() |
| | | { |
| | | return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG)); |
| | | } |
| | | |
| | | /** |
| | | * 方便链式调用 |
| | | * |
| | | * @param key 键 |
| | | * @param value 值 |
| | | * @return 数据对象 |
| | | */ |
| | | @Override |
| | | public AjaxResult put(String key, Object value) |
| | | { |
| | | super.put(key, value); |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Entity基类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BaseEntity implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 搜索值 */ |
| | | @JsonIgnore |
| | | @TableField(exist = false) |
| | | private String searchValue; |
| | | |
| | | /** 创建者 */ |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | /** 创建时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | |
| | | /** 更新者 */ |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | /** 更新时间 */ |
| | | @TableField("update_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** 备注 */ |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | /** 请求参数 */ |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | @TableField(exist = false) |
| | | private Map<String, Object> params; |
| | | |
| | | public String getSearchValue() |
| | | { |
| | | return searchValue; |
| | | } |
| | | |
| | | public void setSearchValue(String searchValue) |
| | | { |
| | | this.searchValue = searchValue; |
| | | } |
| | | |
| | | public String getCreateBy() |
| | | { |
| | | return createBy; |
| | | } |
| | | |
| | | public void setCreateBy(String createBy) |
| | | { |
| | | this.createBy = createBy; |
| | | } |
| | | |
| | | public Date getCreateTime() |
| | | { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) |
| | | { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getUpdateBy() |
| | | { |
| | | return updateBy; |
| | | } |
| | | |
| | | public void setUpdateBy(String updateBy) |
| | | { |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | public Date getUpdateTime() |
| | | { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) |
| | | { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getRemark() |
| | | { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) |
| | | { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public Map<String, Object> getParams() |
| | | { |
| | | if (params == null) |
| | | { |
| | | params = new HashMap<>(); |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | public void setParams(Map<String, Object> params) |
| | | { |
| | | this.params = params; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | 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 { |
| | | |
| | | 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已删除 |
| | | */ |
| | | @ApiModelProperty(value = "是否删除 0未删除 1已删除") |
| | | private Integer isDelete; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import javax.validation.constraints.DecimalMin; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p></p> |
| | | * |
| | | * @author mouseyCat |
| | | * @date 2020/8/24 16:39 |
| | | */ |
| | | @ApiModel(value = "基础查询列表dto") |
| | | public class BasePage implements Serializable { |
| | | /** |
| | | * 分页参数,当前页码 |
| | | */ |
| | | @ApiModelProperty(value = "分页参数,当前页码") |
| | | @DecimalMin(value = "1", message = "当前页码最小为1") |
| | | private Integer pageNum = 1; |
| | | /** |
| | | * 分页参数,每页数量 |
| | | */ |
| | | @ApiModelProperty(value = "分页参数,每页数量,默认为10") |
| | | @DecimalMin(value = "1", message = "每页数量最低为1") |
| | | private Integer pageSize = 10; |
| | | |
| | | public Integer getPageNum() { |
| | | return pageNum; |
| | | } |
| | | |
| | | public void setPageNum(Integer pageNum) { |
| | | this.pageNum = pageNum; |
| | | } |
| | | |
| | | public Integer getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(Integer pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "BasePage{" + |
| | | "pageNum=" + pageNum + |
| | | ", pageSize=" + pageSize + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain; |
| | | |
| | | import com.finance.common.constant.HttpStatus; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 响应信息主体 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class R<T> implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 成功 */ |
| | | public static final int SUCCESS = HttpStatus.SUCCESS; |
| | | |
| | | /** 失败 */ |
| | | public static final int FAIL = HttpStatus.ERROR; |
| | | @ApiModelProperty(value = "业务状态码,200-成功,其它-失败") |
| | | private int code; |
| | | @ApiModelProperty(value = "响应消息", example = "操作成功") |
| | | private String msg; |
| | | @ApiModelProperty(value = "响应数据") |
| | | private T data; |
| | | |
| | | public static <T> R<T> ok() |
| | | { |
| | | return restResult(null, SUCCESS, "操作成功"); |
| | | } |
| | | |
| | | public static <T> R<T> ok(T data) |
| | | { |
| | | return restResult(data, SUCCESS, "操作成功"); |
| | | } |
| | | |
| | | public static <T> R<T> ok(T data, String msg) |
| | | { |
| | | return restResult(data, SUCCESS, msg); |
| | | } |
| | | |
| | | public static <T> R<T> fail() |
| | | { |
| | | return restResult(null, FAIL, "操作失败"); |
| | | } |
| | | |
| | | public static <T> R<T> fail(String msg) |
| | | { |
| | | return restResult(null, FAIL, msg); |
| | | } |
| | | |
| | | public static <T> R<T> fail(T data) |
| | | { |
| | | return restResult(data, FAIL, "操作失败"); |
| | | } |
| | | |
| | | public static <T> R<T> fail(T data, String msg) |
| | | { |
| | | return restResult(data, FAIL, msg); |
| | | } |
| | | |
| | | public static <T> R<T> fail(int code, String msg) |
| | | { |
| | | return restResult(null, code, msg); |
| | | } |
| | | |
| | | private static <T> R<T> restResult(T data, int code, String msg) |
| | | { |
| | | R<T> apiResult = new R<>(); |
| | | apiResult.setCode(code); |
| | | apiResult.setData(data); |
| | | apiResult.setMsg(msg); |
| | | return apiResult; |
| | | } |
| | | |
| | | public int getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) |
| | | { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() |
| | | { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) |
| | | { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public T getData() |
| | | { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(T data) |
| | | { |
| | | this.data = data; |
| | | } |
| | | |
| | | public static <T> Boolean isError(R<T> ret) |
| | | { |
| | | return !isSuccess(ret); |
| | | } |
| | | |
| | | public static <T> Boolean isSuccess(R<T> ret) |
| | | { |
| | | return R.SUCCESS == ret.getCode(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Tree基类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TreeEntity extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 父菜单名称 */ |
| | | private String parentName; |
| | | |
| | | /** 父菜单ID */ |
| | | private Long parentId; |
| | | |
| | | /** 显示顺序 */ |
| | | private Integer orderNum; |
| | | |
| | | /** 祖级列表 */ |
| | | private String ancestors; |
| | | |
| | | /** 子部门 */ |
| | | private List<?> children = new ArrayList<>(); |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public Integer getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public String getAncestors() |
| | | { |
| | | return ancestors; |
| | | } |
| | | |
| | | public void setAncestors(String ancestors) |
| | | { |
| | | this.ancestors = ancestors; |
| | | } |
| | | |
| | | public List<?> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<?> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.finance.common.core.domain.entity.SysDept; |
| | | import com.finance.common.core.domain.entity.SysMenu; |
| | | |
| | | /** |
| | | * Treeselect树结构实体类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TreeSelect implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 节点ID */ |
| | | private Long id; |
| | | |
| | | /** 节点名称 */ |
| | | private String label; |
| | | |
| | | /** 子节点 */ |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | private List<TreeSelect> children; |
| | | |
| | | public TreeSelect() |
| | | { |
| | | |
| | | } |
| | | |
| | | public TreeSelect(SysDept dept) |
| | | { |
| | | this.id = dept.getDeptId(); |
| | | this.label = dept.getDeptName(); |
| | | this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public TreeSelect(SysMenu menu) |
| | | { |
| | | this.id = menu.getMenuId(); |
| | | this.label = menu.getMenuName(); |
| | | this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getLabel() |
| | | { |
| | | return label; |
| | | } |
| | | |
| | | public void setLabel(String label) |
| | | { |
| | | this.label = label; |
| | | } |
| | | |
| | | public List<TreeSelect> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<TreeSelect> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain.entity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.finance.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 部门表 sys_dept |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDept extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 部门ID */ |
| | | private Long deptId; |
| | | |
| | | /** 父部门ID */ |
| | | private Long parentId; |
| | | |
| | | /** 祖级列表 */ |
| | | private String ancestors; |
| | | |
| | | /** 部门名称 */ |
| | | private String deptName; |
| | | |
| | | /** 显示顺序 */ |
| | | private Integer orderNum; |
| | | |
| | | /** 负责人 */ |
| | | private String leader; |
| | | |
| | | /** 联系电话 */ |
| | | private String phone; |
| | | |
| | | /** 邮箱 */ |
| | | private String email; |
| | | |
| | | /** 部门状态:0正常,1停用 */ |
| | | private String status; |
| | | |
| | | /** 删除标志(0代表存在 2代表删除) */ |
| | | private String delFlag; |
| | | |
| | | /** 父部门名称 */ |
| | | private String parentName; |
| | | |
| | | /** 子部门 */ |
| | | private List<SysDept> children = new ArrayList<SysDept>(); |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) |
| | | { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public String getAncestors() |
| | | { |
| | | return ancestors; |
| | | } |
| | | |
| | | public void setAncestors(String ancestors) |
| | | { |
| | | this.ancestors = ancestors; |
| | | } |
| | | |
| | | @NotBlank(message = "部门名称不能为空") |
| | | @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符") |
| | | public String getDeptName() |
| | | { |
| | | return deptName; |
| | | } |
| | | |
| | | public void setDeptName(String deptName) |
| | | { |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | @NotNull(message = "显示顺序不能为空") |
| | | public Integer getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public String getLeader() |
| | | { |
| | | return leader; |
| | | } |
| | | |
| | | public void setLeader(String leader) |
| | | { |
| | | this.leader = leader; |
| | | } |
| | | |
| | | @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符") |
| | | public String getPhone() |
| | | { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) |
| | | { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | @Email(message = "邮箱格式不正确") |
| | | @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") |
| | | public String getEmail() |
| | | { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) |
| | | { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public List<SysDept> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<SysDept> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("deptId", getDeptId()) |
| | | .append("parentId", getParentId()) |
| | | .append("ancestors", getAncestors()) |
| | | .append("deptName", getDeptName()) |
| | | .append("orderNum", getOrderNum()) |
| | | .append("leader", getLeader()) |
| | | .append("phone", getPhone()) |
| | | .append("email", getEmail()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain.entity; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.finance.common.constant.UserConstants; |
| | | import com.finance.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 字典数据表 sys_dict_data |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDictData extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 字典编码 */ |
| | | //@Excel(name = "字典编码", cellType = ColumnType.NUMERIC) |
| | | private Long dictCode; |
| | | |
| | | /** 字典排序 */ |
| | | //@Excel(name = "字典排序", cellType = ColumnType.NUMERIC) |
| | | private Long dictSort; |
| | | |
| | | /** 字典标签 */ |
| | | //@Excel(name = "字典标签") |
| | | private String dictLabel; |
| | | |
| | | /** 字典键值 */ |
| | | //@Excel(name = "字典键值") |
| | | private String dictValue; |
| | | |
| | | /** 字典类型 */ |
| | | //@Excel(name = "字典类型") |
| | | private String dictType; |
| | | |
| | | /** 样式属性(其他样式扩展) */ |
| | | private String cssClass; |
| | | |
| | | /** 表格字典样式 */ |
| | | private String listClass; |
| | | |
| | | /** 是否默认(Y是 N否) */ |
| | | //@Excel(name = "是否默认", readConverterExp = "Y=是,N=否") |
| | | private String isDefault; |
| | | |
| | | /** 状态(0正常 1停用) */ |
| | | //@Excel(name = "状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | public Long getDictCode() |
| | | { |
| | | return dictCode; |
| | | } |
| | | |
| | | public void setDictCode(Long dictCode) |
| | | { |
| | | this.dictCode = dictCode; |
| | | } |
| | | |
| | | public Long getDictSort() |
| | | { |
| | | return dictSort; |
| | | } |
| | | |
| | | public void setDictSort(Long dictSort) |
| | | { |
| | | this.dictSort = dictSort; |
| | | } |
| | | |
| | | @NotBlank(message = "字典标签不能为空") |
| | | @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符") |
| | | public String getDictLabel() |
| | | { |
| | | return dictLabel; |
| | | } |
| | | |
| | | public void setDictLabel(String dictLabel) |
| | | { |
| | | this.dictLabel = dictLabel; |
| | | } |
| | | |
| | | @NotBlank(message = "字典键值不能为空") |
| | | @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符") |
| | | public String getDictValue() |
| | | { |
| | | return dictValue; |
| | | } |
| | | |
| | | public void setDictValue(String dictValue) |
| | | { |
| | | this.dictValue = dictValue; |
| | | } |
| | | |
| | | @NotBlank(message = "字典类型不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符") |
| | | public String getDictType() |
| | | { |
| | | return dictType; |
| | | } |
| | | |
| | | public void setDictType(String dictType) |
| | | { |
| | | this.dictType = dictType; |
| | | } |
| | | |
| | | @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符") |
| | | public String getCssClass() |
| | | { |
| | | return cssClass; |
| | | } |
| | | |
| | | public void setCssClass(String cssClass) |
| | | { |
| | | this.cssClass = cssClass; |
| | | } |
| | | |
| | | public String getListClass() |
| | | { |
| | | return listClass; |
| | | } |
| | | |
| | | public void setListClass(String listClass) |
| | | { |
| | | this.listClass = listClass; |
| | | } |
| | | |
| | | public boolean getDefault() |
| | | { |
| | | return UserConstants.YES.equals(this.isDefault); |
| | | } |
| | | |
| | | public String getIsDefault() |
| | | { |
| | | return isDefault; |
| | | } |
| | | |
| | | public void setIsDefault(String isDefault) |
| | | { |
| | | this.isDefault = isDefault; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("dictCode", getDictCode()) |
| | | .append("dictSort", getDictSort()) |
| | | .append("dictLabel", getDictLabel()) |
| | | .append("dictValue", getDictValue()) |
| | | .append("dictType", getDictType()) |
| | | .append("cssClass", getCssClass()) |
| | | .append("listClass", getListClass()) |
| | | .append("isDefault", getIsDefault()) |
| | | .append("status", getStatus()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain.entity; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Pattern; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.finance.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 字典类型表 sys_dict_type |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDictType extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 字典主键 */ |
| | | //@Excel(name = "字典主键", cellType = ColumnType.NUMERIC) |
| | | private Long dictId; |
| | | |
| | | /** 字典名称 */ |
| | | //@Excel(name = "字典名称") |
| | | private String dictName; |
| | | |
| | | /** 字典类型 */ |
| | | //@Excel(name = "字典类型") |
| | | private String dictType; |
| | | |
| | | /** 状态(0正常 1停用) */ |
| | | //@Excel(name = "状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | public Long getDictId() |
| | | { |
| | | return dictId; |
| | | } |
| | | |
| | | public void setDictId(Long dictId) |
| | | { |
| | | this.dictId = dictId; |
| | | } |
| | | |
| | | @NotBlank(message = "字典名称不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符") |
| | | public String getDictName() |
| | | { |
| | | return dictName; |
| | | } |
| | | |
| | | public void setDictName(String dictName) |
| | | { |
| | | this.dictName = dictName; |
| | | } |
| | | |
| | | @NotBlank(message = "字典类型不能为空") |
| | | @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") |
| | | @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)") |
| | | public String getDictType() |
| | | { |
| | | return dictType; |
| | | } |
| | | |
| | | public void setDictType(String dictType) |
| | | { |
| | | this.dictType = dictType; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("dictId", getDictId()) |
| | | .append("dictName", getDictName()) |
| | | .append("dictType", getDictType()) |
| | | .append("status", getStatus()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain.entity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.finance.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 菜单权限表 sys_menu |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysMenu extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 菜单ID */ |
| | | private Long menuId; |
| | | |
| | | /** 菜单名称 */ |
| | | private String menuName; |
| | | |
| | | /** 父菜单名称 */ |
| | | private String parentName; |
| | | |
| | | /** 父菜单ID */ |
| | | private Long parentId; |
| | | |
| | | /** 显示顺序 */ |
| | | private Integer orderNum; |
| | | |
| | | /** 路由地址 */ |
| | | private String path; |
| | | |
| | | /** 组件路径 */ |
| | | private String component; |
| | | |
| | | /** 路由参数 */ |
| | | private String query; |
| | | |
| | | /** 是否为外链(0是 1否) */ |
| | | private String isFrame; |
| | | |
| | | /** 是否缓存(0缓存 1不缓存) */ |
| | | private String isCache; |
| | | |
| | | /** 类型(M目录 C菜单 F按钮) */ |
| | | private String menuType; |
| | | |
| | | /** 显示状态(0显示 1隐藏) */ |
| | | private String visible; |
| | | |
| | | /** 菜单状态(0正常 1停用) */ |
| | | private String status; |
| | | |
| | | /** 权限字符串 */ |
| | | private String perms; |
| | | |
| | | /** 菜单图标 */ |
| | | private String icon; |
| | | |
| | | /** 子菜单 */ |
| | | private List<SysMenu> children = new ArrayList<SysMenu>(); |
| | | |
| | | public Long getMenuId() |
| | | { |
| | | return menuId; |
| | | } |
| | | |
| | | public void setMenuId(Long menuId) |
| | | { |
| | | this.menuId = menuId; |
| | | } |
| | | |
| | | @NotBlank(message = "菜单名称不能为空") |
| | | @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") |
| | | public String getMenuName() |
| | | { |
| | | return menuName; |
| | | } |
| | | |
| | | public void setMenuName(String menuName) |
| | | { |
| | | this.menuName = menuName; |
| | | } |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | @NotNull(message = "显示顺序不能为空") |
| | | public Integer getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") |
| | | public String getPath() |
| | | { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) |
| | | { |
| | | this.path = path; |
| | | } |
| | | |
| | | @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") |
| | | public String getComponent() |
| | | { |
| | | return component; |
| | | } |
| | | |
| | | public void setComponent(String component) |
| | | { |
| | | this.component = component; |
| | | } |
| | | |
| | | public String getQuery() |
| | | { |
| | | return query; |
| | | } |
| | | |
| | | public void setQuery(String query) |
| | | { |
| | | this.query = query; |
| | | } |
| | | |
| | | public String getIsFrame() |
| | | { |
| | | return isFrame; |
| | | } |
| | | |
| | | public void setIsFrame(String isFrame) |
| | | { |
| | | this.isFrame = isFrame; |
| | | } |
| | | |
| | | public String getIsCache() |
| | | { |
| | | return isCache; |
| | | } |
| | | |
| | | public void setIsCache(String isCache) |
| | | { |
| | | this.isCache = isCache; |
| | | } |
| | | |
| | | @NotBlank(message = "菜单类型不能为空") |
| | | public String getMenuType() |
| | | { |
| | | return menuType; |
| | | } |
| | | |
| | | public void setMenuType(String menuType) |
| | | { |
| | | this.menuType = menuType; |
| | | } |
| | | |
| | | public String getVisible() |
| | | { |
| | | return visible; |
| | | } |
| | | |
| | | public void setVisible(String visible) |
| | | { |
| | | this.visible = visible; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") |
| | | public String getPerms() |
| | | { |
| | | return perms; |
| | | } |
| | | |
| | | public void setPerms(String perms) |
| | | { |
| | | this.perms = perms; |
| | | } |
| | | |
| | | public String getIcon() |
| | | { |
| | | return icon; |
| | | } |
| | | |
| | | public void setIcon(String icon) |
| | | { |
| | | this.icon = icon; |
| | | } |
| | | |
| | | public List<SysMenu> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<SysMenu> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("menuId", getMenuId()) |
| | | .append("menuName", getMenuName()) |
| | | .append("parentId", getParentId()) |
| | | .append("orderNum", getOrderNum()) |
| | | .append("path", getPath()) |
| | | .append("component", getComponent()) |
| | | .append("isFrame", getIsFrame()) |
| | | .append("IsCache", getIsCache()) |
| | | .append("menuType", getMenuType()) |
| | | .append("visible", getVisible()) |
| | | .append("status ", getStatus()) |
| | | .append("perms", getPerms()) |
| | | .append("icon", getIcon()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.finance.common.core.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.util.Set; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | /** |
| | | * 角色表 sys_role |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Data |
| | | public class SysRole extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 角色ID |
| | | */ |
| | | //@Excel(name = "角色序号", cellType = ColumnType.NUMERIC) |
| | | @ApiModelProperty("角色id") |
| | | private Long roleId; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | //@Excel(name = "角色名称") |
| | | @ApiModelProperty("角色名称") |
| | | private String roleName; |
| | | |
| | | /** |
| | | * 角色权限 |
| | | */ |
| | | //@Excel(name = "角色权限") |
| | | private String roleKey; |
| | | |
| | | /** |
| | | * 角色排序 |
| | | */ |
| | | //@Excel(name = "角色排序") |
| | | private Integer roleSort; |
| | | |
| | | /** |
| | | * 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) |
| | | */ |
| | | //@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") |
| | | private String dataScope; |
| | | |
| | | /** |
| | | * 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) |
| | | */ |
| | | private boolean menuCheckStrictly; |
| | | |
| | | /** |
| | | * 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) |
| | | */ |
| | | private boolean deptCheckStrictly; |
| | | |
| | | /** |
| | | * 角色状态(0正常 1停用) |
| | | */ |
| | | //@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 删除标志(0代表存在 1代表删除) |
| | | */ |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | /** |
| | | * 用户是否存在此角色标识 默认不存在 |
| | | */ |
| | | private boolean flag = false; |
| | | |
| | | /** |
| | | * 菜单组 |
| | | */ |
| | | @ApiModelProperty("菜单权限id列表") |
| | | private Long[] menuIds; |
| | | |
| | | /** |
| | | * 部门组(数据权限) |
| | | */ |
| | | private Long[] deptIds; |
| | | |
| | | /** |
| | | * 角色菜单权限 |
| | | */ |
| | | private Set<String> permissions; |
| | | |
| | | private String remark; |
| | | |
| | | |
| | | public SysRole() { |
| | | |
| | | } |
| | | |
| | | public SysRole(Long roleId) { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public Long getRoleId() { |
| | | return roleId; |
| | | } |
| | | |
| | | public void setRoleId(Long roleId) { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public boolean isAdmin() { |
| | | return isAdmin(this.roleId); |
| | | } |
| | | |
| | | public static boolean isAdmin(Long roleId) { |
| | | return roleId != null && 1L == roleId; |
| | | } |
| | | |
| | | @NotBlank(message = "角色名称不能为空") |
| | | @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") |
| | | public String getRoleName() { |
| | | return roleName; |
| | | } |
| | | |
| | | public void setRoleName(String roleName) { |
| | | this.roleName = roleName; |
| | | } |
| | | |
| | | @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") |
| | | public String getRoleKey() { |
| | | return roleKey; |
| | | } |
| | | |
| | | public void setRoleKey(String roleKey) { |
| | | this.roleKey = roleKey; |
| | | } |
| | | |
| | | public Integer getRoleSort() { |
| | | return roleSort; |
| | | } |
| | | |
| | | public void setRoleSort(Integer roleSort) { |
| | | this.roleSort = roleSort; |
| | | } |
| | | |
| | | public String getDataScope() { |
| | | return dataScope; |
| | | } |
| | | |
| | | public void setDataScope(String dataScope) { |
| | | this.dataScope = dataScope; |
| | | } |
| | | |
| | | public boolean isMenuCheckStrictly() { |
| | | return menuCheckStrictly; |
| | | } |
| | | |
| | | public void setMenuCheckStrictly(boolean menuCheckStrictly) { |
| | | this.menuCheckStrictly = menuCheckStrictly; |
| | | } |
| | | |
| | | public boolean isDeptCheckStrictly() { |
| | | return deptCheckStrictly; |
| | | } |
| | | |
| | | public void setDeptCheckStrictly(boolean deptCheckStrictly) { |
| | | this.deptCheckStrictly = deptCheckStrictly; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Integer getDelFlag() { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(Integer delFlag) { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public boolean isFlag() { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(boolean flag) { |
| | | this.flag = flag; |
| | | } |
| | | |
| | | public Long[] getMenuIds() { |
| | | return menuIds; |
| | | } |
| | | |
| | | public void setMenuIds(Long[] menuIds) { |
| | | this.menuIds = menuIds; |
| | | } |
| | | |
| | | public Long[] getDeptIds() { |
| | | return deptIds; |
| | | } |
| | | |
| | | public void setDeptIds(Long[] deptIds) { |
| | | this.deptIds = deptIds; |
| | | } |
| | | |
| | | public Set<String> getPermissions() { |
| | | return permissions; |
| | | } |
| | | |
| | | public void setPermissions(Set<String> permissions) { |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("roleId", getRoleId()) |
| | | .append("roleName", getRoleName()) |
| | | .append("roleKey", getRoleKey()) |
| | | .append("roleSort", getRoleSort()) |
| | | .append("dataScope", getDataScope()) |
| | | .append("menuCheckStrictly", isMenuCheckStrictly()) |
| | | .append("deptCheckStrictly", isDeptCheckStrictly()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.finance.common.core.domain.BaseEntity; |
| | | import com.finance.common.enums.DisabledEnum; |
| | | import com.finance.common.enums.UserTypeEnum; |
| | | import com.finance.common.xss.Xss; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.Size; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | /** |
| | | * 用户对象 sys_user |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Data |
| | | @TableName("sys_user") |
| | | public class SysUser extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | //@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableId(value = "user_id", type = IdType.AUTO) |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 部门ID |
| | | */ |
| | | //@Excel(name = "部门编号", type = Type.IMPORT) |
| | | @ApiModelProperty(value = "部门id") |
| | | @TableField("dept_id") |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty(value = "用户类型") |
| | | @TableField("user_type") |
| | | private UserTypeEnum userType; |
| | | |
| | | /** |
| | | * 用户账号 |
| | | */ |
| | | //@Excel(name = "登录名称") |
| | | @ApiModelProperty(value = "登录名称") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 用户昵称 |
| | | */ |
| | | //@Excel(name = "用户名称") |
| | | @ApiModelProperty(value = "用户名称") |
| | | @TableField("nick_name") |
| | | private String nickName; |
| | | |
| | | /** |
| | | * 用户邮箱 |
| | | */ |
| | | //@Excel(name = "用户邮箱") |
| | | @ApiModelProperty(value = "用户邮箱") |
| | | @TableField("email") |
| | | private String email; |
| | | |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | //@Excel(name = "手机号码") |
| | | @ApiModelProperty(value = "手机号码") |
| | | @TableField("phone_number") |
| | | private String phoneNumber; |
| | | |
| | | /** |
| | | * 用户性别 |
| | | */ |
| | | //@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") |
| | | @ApiModelProperty(value = "用户性别 0=男,1=女,2=未知") |
| | | @TableField("sex") |
| | | private String sex; |
| | | |
| | | /** |
| | | * 用户头像 |
| | | */ |
| | | @ApiModelProperty(value = "用户头像") |
| | | @TableField("avatar") |
| | | private String avatar; |
| | | |
| | | /** |
| | | * 密码 |
| | | */ |
| | | @ApiModelProperty(value = "密码") |
| | | @TableField("password") |
| | | private String password; |
| | | |
| | | /** |
| | | * 帐号状态(0正常 1停用) |
| | | */ |
| | | //@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") |
| | | @ApiModelProperty(value = "帐号状态 0=正常,1=停用") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | /** |
| | | * 删除标志(0代表存在 2代表删除) |
| | | */ |
| | | @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)") |
| | | @TableField("del_flag") |
| | | private String delFlag; |
| | | |
| | | /** |
| | | * 最后登录IP |
| | | */ |
| | | //@Excel(name = "最后登录IP", type = Type.EXPORT) |
| | | @ApiModelProperty(value = "最后登录IP") |
| | | @TableField("login_ip") |
| | | private String loginIp; |
| | | |
| | | /** |
| | | * 最后登录时间 |
| | | */ |
| | | //@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "最后登录时间") |
| | | @TableField("login_date") |
| | | private Date loginDate; |
| | | |
| | | /** |
| | | * 部门对象 |
| | | */ |
| | | //@Excels({ |
| | | //@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), |
| | | //@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) |
| | | // }) |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "部门对象") |
| | | private SysDept dept; |
| | | |
| | | /** |
| | | * 角色对象 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "角色对象") |
| | | private List<SysRole> roles; |
| | | |
| | | /** |
| | | * 角色组 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "角色组") |
| | | private Long[] roleIds; |
| | | |
| | | /** |
| | | * 岗位组 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "岗位组") |
| | | private Long[] postIds; |
| | | |
| | | /** |
| | | * 角色ID |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "角色ID") |
| | | private Long roleId; |
| | | |
| | | @TableField(exist = false) |
| | | private String roleName; |
| | | |
| | | @TableField(exist = false) |
| | | private String deptName; |
| | | |
| | | @ApiModelProperty(value = "部门地区") |
| | | @TableField("area_name") |
| | | private String areaName; |
| | | |
| | | @ApiModelProperty(value = "别名") |
| | | @TableField("area_alias") |
| | | private String areaAlias; |
| | | |
| | | @ApiModelProperty(value = "区划代码") |
| | | @TableField("area_code") |
| | | private String areaCode; |
| | | |
| | | @ApiModelProperty(value = "级次(省、市、县)") |
| | | @TableField("area_level") |
| | | private String areaLevel; |
| | | |
| | | @ApiModelProperty(value = "县级标志(不包含直辖市的区 0:否 1:是)") |
| | | @TableField("county_flag") |
| | | private DisabledEnum countyFlag; |
| | | |
| | | @ApiModelProperty(value = "负责人") |
| | | @TableField("person_in_charge") |
| | | private String personInCharge; |
| | | |
| | | @ApiModelProperty(value = "是否重点关注(0:否 1:是)") |
| | | @TableField("focussed") |
| | | private DisabledEnum focussed; |
| | | |
| | | |
| | | public String getRoleName() { |
| | | return roleName; |
| | | } |
| | | |
| | | public void setRoleName(String roleName) { |
| | | this.roleName = roleName; |
| | | } |
| | | |
| | | public SysUser() { |
| | | |
| | | } |
| | | |
| | | public SysUser(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public static boolean isAdmin(Long userId) { |
| | | return userId != null && 1L == userId; |
| | | } |
| | | |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public boolean isAdmin() { |
| | | return isAdmin(this.userId); |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | @Xss(message = "用户昵称不能包含脚本字符") |
| | | @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") |
| | | public String getNickName() { |
| | | return nickName; |
| | | } |
| | | |
| | | public void setNickName(String nickName) { |
| | | this.nickName = nickName; |
| | | } |
| | | |
| | | @Xss(message = "用户账号不能包含脚本字符") |
| | | @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | @Email(message = "邮箱格式不正确") |
| | | @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") |
| | | public String getPhoneNumber() { |
| | | return phoneNumber; |
| | | } |
| | | |
| | | public void setPhoneNumber(String phoneNumber) { |
| | | this.phoneNumber = phoneNumber; |
| | | } |
| | | |
| | | public String getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(String sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getAvatar() { |
| | | return avatar; |
| | | } |
| | | |
| | | public void setAvatar(String avatar) { |
| | | this.avatar = avatar; |
| | | } |
| | | |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getLoginIp() { |
| | | return loginIp; |
| | | } |
| | | |
| | | public void setLoginIp(String loginIp) { |
| | | this.loginIp = loginIp; |
| | | } |
| | | |
| | | public Date getLoginDate() { |
| | | return loginDate; |
| | | } |
| | | |
| | | public void setLoginDate(Date loginDate) { |
| | | this.loginDate = loginDate; |
| | | } |
| | | |
| | | public SysDept getDept() { |
| | | return dept; |
| | | } |
| | | |
| | | public void setDept(SysDept dept) { |
| | | this.dept = dept; |
| | | } |
| | | |
| | | public List<SysRole> getRoles() { |
| | | return roles; |
| | | } |
| | | |
| | | public void setRoles(List<SysRole> roles) { |
| | | this.roles = roles; |
| | | } |
| | | |
| | | public Long[] getRoleIds() { |
| | | return roleIds; |
| | | } |
| | | |
| | | public void setRoleIds(Long[] roleIds) { |
| | | this.roleIds = roleIds; |
| | | } |
| | | |
| | | public Long[] getPostIds() { |
| | | return postIds; |
| | | } |
| | | |
| | | public void setPostIds(Long[] postIds) { |
| | | this.postIds = postIds; |
| | | } |
| | | |
| | | public Long getRoleId() { |
| | | return roleId; |
| | | } |
| | | |
| | | public void setRoleId(Long roleId) { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("userId", getUserId()) |
| | | .append("deptId", getDeptId()) |
| | | .append("userName", getUserName()) |
| | | .append("nickName", getNickName()) |
| | | .append("email", getEmail()) |
| | | .append("phoneNumber", getPhoneNumber()) |
| | | .append("sex", getSex()) |
| | | .append("avatar", getAvatar()) |
| | | .append("password", getPassword()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("loginIp", getLoginIp()) |
| | | .append("loginDate", getLoginDate()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .append("dept", getDept()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain.model; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 用户登录对象 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @ApiModel(value = "登录对象Body") |
| | | public class LoginBody |
| | | { |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | @ApiModelProperty(value = "用户名",notes = "用户名") |
| | | private String username; |
| | | |
| | | /** |
| | | * 用户密码 |
| | | */ |
| | | @ApiModelProperty(value = "用户密码") |
| | | private String password; |
| | | |
| | | /** |
| | | * 验证码 |
| | | */ |
| | | @ApiModelProperty(value = "验证码") |
| | | private String code; |
| | | |
| | | /** |
| | | * 唯一标识 |
| | | */ |
| | | private String uuid; |
| | | |
| | | public String getUsername() |
| | | { |
| | | return username; |
| | | } |
| | | |
| | | public void setUsername(String username) |
| | | { |
| | | this.username = username; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) |
| | | { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getUuid() |
| | | { |
| | | return uuid; |
| | | } |
| | | |
| | | public void setUuid(String uuid) |
| | | { |
| | | this.uuid = uuid; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain.model; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.finance.common.core.domain.entity.SysUser; |
| | | import org.springframework.security.core.GrantedAuthority; |
| | | import org.springframework.security.core.userdetails.UserDetails; |
| | | import java.util.Collection; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 登录用户身份权限 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class LoginUser implements UserDetails |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 部门ID |
| | | */ |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * 用户唯一标识 |
| | | */ |
| | | private String token; |
| | | |
| | | /** |
| | | * 登录时间 |
| | | */ |
| | | private Long loginTime; |
| | | |
| | | /** |
| | | * 过期时间 |
| | | */ |
| | | private Long expireTime; |
| | | |
| | | /** |
| | | * 登录IP地址 |
| | | */ |
| | | private String ipaddr; |
| | | |
| | | /** |
| | | * 登录地点 |
| | | */ |
| | | private String loginLocation; |
| | | |
| | | /** |
| | | * 浏览器类型 |
| | | */ |
| | | private String browser; |
| | | |
| | | /** |
| | | * 操作系统 |
| | | */ |
| | | private String os; |
| | | |
| | | /** |
| | | * 权限列表 |
| | | */ |
| | | private Set<String> permissions; |
| | | |
| | | /** |
| | | * 用户信息 |
| | | */ |
| | | private SysUser user; |
| | | |
| | | public LoginUser() |
| | | { |
| | | } |
| | | |
| | | public LoginUser(SysUser user, Set<String> permissions) |
| | | { |
| | | this.user = user; |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions) |
| | | { |
| | | this.userId = userId; |
| | | this.deptId = deptId; |
| | | this.user = user; |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public Long getUserId() |
| | | { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) |
| | | { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public String getToken() |
| | | { |
| | | return token; |
| | | } |
| | | |
| | | public void setToken(String token) |
| | | { |
| | | this.token = token; |
| | | } |
| | | |
| | | @JSONField(serialize = false) |
| | | @Override |
| | | public String getPassword() |
| | | { |
| | | return user.getPassword(); |
| | | } |
| | | |
| | | @Override |
| | | public String getUsername() |
| | | { |
| | | return user.getUserName(); |
| | | } |
| | | |
| | | /** |
| | | * 账户是否未过期,过期无法验证 |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @Override |
| | | public boolean isAccountNonExpired() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 指定用户是否解锁,锁定的用户无法进行身份验证 |
| | | * |
| | | * @return |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @Override |
| | | public boolean isAccountNonLocked() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证 |
| | | * |
| | | * @return |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @Override |
| | | public boolean isCredentialsNonExpired() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 是否可用 ,禁用的用户不能身份验证 |
| | | * |
| | | * @return |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @Override |
| | | public boolean isEnabled() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | public Long getLoginTime() |
| | | { |
| | | return loginTime; |
| | | } |
| | | |
| | | public void setLoginTime(Long loginTime) |
| | | { |
| | | this.loginTime = loginTime; |
| | | } |
| | | |
| | | public String getIpaddr() |
| | | { |
| | | return ipaddr; |
| | | } |
| | | |
| | | public void setIpaddr(String ipaddr) |
| | | { |
| | | this.ipaddr = ipaddr; |
| | | } |
| | | |
| | | public String getLoginLocation() |
| | | { |
| | | return loginLocation; |
| | | } |
| | | |
| | | public void setLoginLocation(String loginLocation) |
| | | { |
| | | this.loginLocation = loginLocation; |
| | | } |
| | | |
| | | public String getBrowser() |
| | | { |
| | | return browser; |
| | | } |
| | | |
| | | public void setBrowser(String browser) |
| | | { |
| | | this.browser = browser; |
| | | } |
| | | |
| | | public String getOs() |
| | | { |
| | | return os; |
| | | } |
| | | |
| | | public void setOs(String os) |
| | | { |
| | | this.os = os; |
| | | } |
| | | |
| | | public Long getExpireTime() |
| | | { |
| | | return expireTime; |
| | | } |
| | | |
| | | public void setExpireTime(Long expireTime) |
| | | { |
| | | this.expireTime = expireTime; |
| | | } |
| | | |
| | | public Set<String> getPermissions() |
| | | { |
| | | return permissions; |
| | | } |
| | | |
| | | public void setPermissions(Set<String> permissions) |
| | | { |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public SysUser getUser() |
| | | { |
| | | return user; |
| | | } |
| | | |
| | | public void setUser(SysUser user) |
| | | { |
| | | this.user = user; |
| | | } |
| | | |
| | | @Override |
| | | public Collection<? extends GrantedAuthority> getAuthorities() |
| | | { |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain.model; |
| | | |
| | | /** |
| | | * 用户注册对象 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class RegisterBody extends LoginBody |
| | | { |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.core.domain.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.finance.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | @ApiModel("时间范围分页dto") |
| | | public class TimeRangeQueryBody extends BasePage { |
| | | |
| | | @ApiModelProperty("开始时间 格式 yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty("结束时间 格式 yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | public String getStartTime() { |
| | | if (Objects.nonNull(startTime)) { |
| | | return new SimpleDateFormat("yyyy-MM-dd").format(startTime) + " 00:00:00"; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | if (Objects.nonNull(endTime)) { |
| | | return new SimpleDateFormat("yyyy-MM-dd").format(endTime) + " 23:59:59"; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.core.page; |
| | | |
| | | import com.finance.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 分页数据 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class PageDomain |
| | | { |
| | | /** 当前记录起始索引 */ |
| | | private Integer pageNum; |
| | | |
| | | /** 每页显示记录数 */ |
| | | private Integer pageSize; |
| | | |
| | | /** 排序列 */ |
| | | private String orderByColumn; |
| | | |
| | | /** 排序的方向desc或者asc */ |
| | | private String isAsc = "asc"; |
| | | |
| | | /** 分页参数合理化 */ |
| | | private Boolean reasonable = true; |
| | | |
| | | public String getOrderBy() |
| | | { |
| | | if (StringUtils.isEmpty(orderByColumn)) |
| | | { |
| | | return ""; |
| | | } |
| | | return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; |
| | | } |
| | | |
| | | public Integer getPageNum() |
| | | { |
| | | return pageNum; |
| | | } |
| | | |
| | | public void setPageNum(Integer pageNum) |
| | | { |
| | | this.pageNum = pageNum; |
| | | } |
| | | |
| | | public Integer getPageSize() |
| | | { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(Integer pageSize) |
| | | { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public String getOrderByColumn() |
| | | { |
| | | return orderByColumn; |
| | | } |
| | | |
| | | public void setOrderByColumn(String orderByColumn) |
| | | { |
| | | this.orderByColumn = orderByColumn; |
| | | } |
| | | |
| | | public String getIsAsc() |
| | | { |
| | | return isAsc; |
| | | } |
| | | |
| | | public void setIsAsc(String isAsc) |
| | | { |
| | | if (StringUtils.isNotEmpty(isAsc)) |
| | | { |
| | | // 兼容前端排序类型 |
| | | if ("ascending".equals(isAsc)) |
| | | { |
| | | isAsc = "asc"; |
| | | } |
| | | else if ("descending".equals(isAsc)) |
| | | { |
| | | isAsc = "desc"; |
| | | } |
| | | this.isAsc = isAsc; |
| | | } |
| | | } |
| | | |
| | | public Boolean getReasonable() |
| | | { |
| | | if (StringUtils.isNull(reasonable)) |
| | | { |
| | | return Boolean.TRUE; |
| | | } |
| | | return reasonable; |
| | | } |
| | | |
| | | public void setReasonable(Boolean reasonable) |
| | | { |
| | | this.reasonable = reasonable; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.page; |
| | | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 表格分页数据对象 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TableDataInfo<T> implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 总记录数 */ |
| | | private long total; |
| | | |
| | | /** 列表数据 */ |
| | | private List<?> records; |
| | | |
| | | /** 消息状态码 */ |
| | | private int code; |
| | | |
| | | /** 消息内容 */ |
| | | private String msg; |
| | | |
| | | // private boolean hasNextPage; |
| | | // private boolean hasPrevPage; |
| | | // private long startIndex; |
| | | |
| | | // public boolean getHasNextPage() { |
| | | // return hasNextPage; |
| | | // } |
| | | // |
| | | // public void setHasNextPage(boolean hasNextPage) { |
| | | // this.hasNextPage = hasNextPage; |
| | | // } |
| | | // |
| | | // public boolean getHasPrevPage() { |
| | | // return hasPrevPage; |
| | | // } |
| | | // |
| | | // public void setHasPrevPage(boolean hasPrevPage) { |
| | | // this.hasPrevPage = hasPrevPage; |
| | | // } |
| | | // |
| | | // private boolean hasNextPage(long currentPage, long totalPage) { |
| | | // return currentPage < totalPage && totalPage != 0; |
| | | // } |
| | | // private static boolean hasPrevPage(long currentPage) { |
| | | // return currentPage != 1; |
| | | // } |
| | | // |
| | | // public long getStartIndex() { |
| | | // return startIndex; |
| | | // } |
| | | // |
| | | // public void setStartIndex(long startIndex) { |
| | | // this.startIndex = startIndex; |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 表格数据对象 |
| | | */ |
| | | public TableDataInfo() |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | * |
| | | * @param list 列表数据 |
| | | * @param total 总记录数 |
| | | */ |
| | | public TableDataInfo(List<?> list, int total) |
| | | { |
| | | this.records = list; |
| | | this.total = total; |
| | | } |
| | | |
| | | public long getTotal() |
| | | { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(long total) |
| | | { |
| | | this.total = total; |
| | | } |
| | | |
| | | public List<?> getRecords() |
| | | { |
| | | return records; |
| | | } |
| | | |
| | | public void setRecords(List<?> records) |
| | | { |
| | | this.records = records; |
| | | } |
| | | |
| | | public int getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) |
| | | { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() |
| | | { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) |
| | | { |
| | | this.msg = msg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.page; |
| | | |
| | | import com.finance.common.core.text.Convert; |
| | | import com.finance.common.utils.ServletUtils; |
| | | |
| | | /** |
| | | * 表格数据处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TableSupport |
| | | { |
| | | /** |
| | | * 当前记录起始索引 |
| | | */ |
| | | public static final String PAGE_NUM = "pageNum"; |
| | | |
| | | /** |
| | | * 每页显示记录数 |
| | | */ |
| | | public static final String PAGE_SIZE = "pageSize"; |
| | | |
| | | /** |
| | | * 排序列 |
| | | */ |
| | | public static final String ORDER_BY_COLUMN = "orderByColumn"; |
| | | |
| | | /** |
| | | * 排序的方向 "desc" 或者 "asc". |
| | | */ |
| | | public static final String IS_ASC = "isAsc"; |
| | | |
| | | /** |
| | | * 分页参数合理化 |
| | | */ |
| | | public static final String REASONABLE = "reasonable"; |
| | | |
| | | /** |
| | | * 封装分页对象 |
| | | */ |
| | | public static PageDomain getPageDomain() |
| | | { |
| | | PageDomain pageDomain = new PageDomain(); |
| | | pageDomain.setPageNum(Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1)); |
| | | pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10)); |
| | | pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN)); |
| | | pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC)); |
| | | pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE)); |
| | | return pageDomain; |
| | | } |
| | | |
| | | public static PageDomain buildPageRequest() |
| | | { |
| | | return getPageDomain(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.redis; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.BoundSetOperations; |
| | | import org.springframework.data.redis.core.HashOperations; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * spring redis 工具类 |
| | | * |
| | | * @author ruoyi |
| | | **/ |
| | | @SuppressWarnings(value = { "unchecked", "rawtypes" }) |
| | | @Component |
| | | public class RedisCache |
| | | { |
| | | @Autowired |
| | | public RedisTemplate redisTemplate; |
| | | |
| | | /** |
| | | * 缓存基本的对象,Integer、String、实体类等 |
| | | * |
| | | * @param key 缓存的键值 |
| | | * @param value 缓存的值 |
| | | */ |
| | | public <T> void setCacheObject(final String key, final T value) |
| | | { |
| | | redisTemplate.opsForValue().set(key, value); |
| | | } |
| | | |
| | | /** |
| | | * 缓存基本的对象,Integer、String、实体类等 |
| | | * |
| | | * @param key 缓存的键值 |
| | | * @param value 缓存的值 |
| | | * @param timeout 时间 |
| | | * @param timeUnit 时间颗粒度 |
| | | */ |
| | | public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit) |
| | | { |
| | | redisTemplate.opsForValue().set(key, value, timeout, timeUnit); |
| | | } |
| | | |
| | | /** |
| | | * 设置有效时间 |
| | | * |
| | | * @param key Redis键 |
| | | * @param timeout 超时时间 |
| | | * @return true=设置成功;false=设置失败 |
| | | */ |
| | | public boolean expire(final String key, final long timeout) |
| | | { |
| | | return expire(key, timeout, TimeUnit.SECONDS); |
| | | } |
| | | |
| | | /** |
| | | * 设置有效时间 |
| | | * |
| | | * @param key Redis键 |
| | | * @param timeout 超时时间 |
| | | * @param unit 时间单位 |
| | | * @return true=设置成功;false=设置失败 |
| | | */ |
| | | public boolean expire(final String key, final long timeout, final TimeUnit unit) |
| | | { |
| | | return redisTemplate.expire(key, timeout, unit); |
| | | } |
| | | |
| | | /** |
| | | * 获取有效时间 |
| | | * |
| | | * @param key Redis键 |
| | | * @return 有效时间 |
| | | */ |
| | | public long getExpire(final String key) |
| | | { |
| | | return redisTemplate.getExpire(key); |
| | | } |
| | | |
| | | /** |
| | | * 判断 key是否存在 |
| | | * |
| | | * @param key 键 |
| | | * @return true 存在 false不存在 |
| | | */ |
| | | public Boolean hasKey(String key) |
| | | { |
| | | return redisTemplate.hasKey(key); |
| | | } |
| | | |
| | | /** |
| | | * 获得缓存的基本对象。 |
| | | * |
| | | * @param key 缓存键值 |
| | | * @return 缓存键值对应的数据 |
| | | */ |
| | | public <T> T getCacheObject(final String key) |
| | | { |
| | | ValueOperations<String, T> operation = redisTemplate.opsForValue(); |
| | | return operation.get(key); |
| | | } |
| | | |
| | | /** |
| | | * 删除单个对象 |
| | | * |
| | | * @param key |
| | | */ |
| | | public boolean deleteObject(final String key) |
| | | { |
| | | return redisTemplate.delete(key); |
| | | } |
| | | |
| | | /** |
| | | * 删除集合对象 |
| | | * |
| | | * @param collection 多个对象 |
| | | * @return |
| | | */ |
| | | public boolean deleteObject(final Collection collection) |
| | | { |
| | | return redisTemplate.delete(collection) > 0; |
| | | } |
| | | |
| | | /** |
| | | * 缓存List数据 |
| | | * |
| | | * @param key 缓存的键值 |
| | | * @param dataList 待缓存的List数据 |
| | | * @return 缓存的对象 |
| | | */ |
| | | public <T> long setCacheList(final String key, final List<T> dataList) |
| | | { |
| | | Long count = redisTemplate.opsForList().rightPushAll(key, dataList); |
| | | return count == null ? 0 : count; |
| | | } |
| | | |
| | | /** |
| | | * 获得缓存的list对象 |
| | | * |
| | | * @param key 缓存的键值 |
| | | * @return 缓存键值对应的数据 |
| | | */ |
| | | public <T> List<T> getCacheList(final String key) |
| | | { |
| | | return redisTemplate.opsForList().range(key, 0, -1); |
| | | } |
| | | |
| | | /** |
| | | * 缓存Set |
| | | * |
| | | * @param key 缓存键值 |
| | | * @param dataSet 缓存的数据 |
| | | * @return 缓存数据的对象 |
| | | */ |
| | | public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet) |
| | | { |
| | | BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key); |
| | | Iterator<T> it = dataSet.iterator(); |
| | | while (it.hasNext()) |
| | | { |
| | | setOperation.add(it.next()); |
| | | } |
| | | return setOperation; |
| | | } |
| | | |
| | | /** |
| | | * 获得缓存的set |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public <T> Set<T> getCacheSet(final String key) |
| | | { |
| | | return redisTemplate.opsForSet().members(key); |
| | | } |
| | | |
| | | /** |
| | | * 缓存Map |
| | | * |
| | | * @param key |
| | | * @param dataMap |
| | | */ |
| | | public <T> void setCacheMap(final String key, final Map<String, T> dataMap) |
| | | { |
| | | if (dataMap != null) { |
| | | redisTemplate.opsForHash().putAll(key, dataMap); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获得缓存的Map |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public <T> Map<String, T> getCacheMap(final String key) |
| | | { |
| | | return redisTemplate.opsForHash().entries(key); |
| | | } |
| | | |
| | | /** |
| | | * 往Hash中存入数据 |
| | | * |
| | | * @param key Redis键 |
| | | * @param hKey Hash键 |
| | | * @param value 值 |
| | | */ |
| | | public <T> void setCacheMapValue(final String key, final String hKey, final T value) |
| | | { |
| | | redisTemplate.opsForHash().put(key, hKey, value); |
| | | } |
| | | |
| | | /** |
| | | * 获取Hash中的数据 |
| | | * |
| | | * @param key Redis键 |
| | | * @param hKey Hash键 |
| | | * @return Hash中的对象 |
| | | */ |
| | | public <T> T getCacheMapValue(final String key, final String hKey) |
| | | { |
| | | HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash(); |
| | | return opsForHash.get(key, hKey); |
| | | } |
| | | |
| | | /** |
| | | * 获取多个Hash中的数据 |
| | | * |
| | | * @param key Redis键 |
| | | * @param hKeys Hash键集合 |
| | | * @return Hash对象集合 |
| | | */ |
| | | public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys) |
| | | { |
| | | return redisTemplate.opsForHash().multiGet(key, hKeys); |
| | | } |
| | | |
| | | /** |
| | | * 删除Hash中的某条数据 |
| | | * |
| | | * @param key Redis键 |
| | | * @param hKey Hash键 |
| | | * @return 是否成功 |
| | | */ |
| | | public boolean deleteCacheMapValue(final String key, final String hKey) |
| | | { |
| | | return redisTemplate.opsForHash().delete(key, hKey) > 0; |
| | | } |
| | | |
| | | /** |
| | | * 获得缓存的基本对象列表 |
| | | * |
| | | * @param pattern 字符串前缀 |
| | | * @return 对象列表 |
| | | */ |
| | | public Collection<String> keys(final String pattern) |
| | | { |
| | | return redisTemplate.keys(pattern); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.text; |
| | | |
| | | import java.nio.charset.Charset; |
| | | import java.nio.charset.StandardCharsets; |
| | | import com.finance.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 字符集工具类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class CharsetKit |
| | | { |
| | | /** ISO-8859-1 */ |
| | | public static final String ISO_8859_1 = "ISO-8859-1"; |
| | | /** UTF-8 */ |
| | | public static final String UTF_8 = "UTF-8"; |
| | | /** GBK */ |
| | | public static final String GBK = "GBK"; |
| | | |
| | | /** ISO-8859-1 */ |
| | | public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1); |
| | | /** UTF-8 */ |
| | | public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8); |
| | | /** GBK */ |
| | | public static final Charset CHARSET_GBK = Charset.forName(GBK); |
| | | |
| | | /** |
| | | * 转换为Charset对象 |
| | | * |
| | | * @param charset 字符集,为空则返回默认字符集 |
| | | * @return Charset |
| | | */ |
| | | public static Charset charset(String charset) |
| | | { |
| | | return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); |
| | | } |
| | | |
| | | /** |
| | | * 转换字符串的字符集编码 |
| | | * |
| | | * @param source 字符串 |
| | | * @param srcCharset 源字符集,默认ISO-8859-1 |
| | | * @param destCharset 目标字符集,默认UTF-8 |
| | | * @return 转换后的字符集 |
| | | */ |
| | | public static String convert(String source, String srcCharset, String destCharset) |
| | | { |
| | | return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); |
| | | } |
| | | |
| | | /** |
| | | * 转换字符串的字符集编码 |
| | | * |
| | | * @param source 字符串 |
| | | * @param srcCharset 源字符集,默认ISO-8859-1 |
| | | * @param destCharset 目标字符集,默认UTF-8 |
| | | * @return 转换后的字符集 |
| | | */ |
| | | public static String convert(String source, Charset srcCharset, Charset destCharset) |
| | | { |
| | | if (null == srcCharset) |
| | | { |
| | | srcCharset = StandardCharsets.ISO_8859_1; |
| | | } |
| | | |
| | | if (null == destCharset) |
| | | { |
| | | destCharset = StandardCharsets.UTF_8; |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) |
| | | { |
| | | return source; |
| | | } |
| | | return new String(source.getBytes(srcCharset), destCharset); |
| | | } |
| | | |
| | | /** |
| | | * @return 系统字符集编码 |
| | | */ |
| | | public static String systemCharset() |
| | | { |
| | | return Charset.defaultCharset().name(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.text; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.nio.ByteBuffer; |
| | | import java.nio.charset.Charset; |
| | | import java.text.NumberFormat; |
| | | import java.util.Set; |
| | | import com.finance.common.utils.StringUtils; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | |
| | | /** |
| | | * 类型转换器 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class Convert |
| | | { |
| | | /** |
| | | * 转换为字符串<br> |
| | | * 如果给定的值为null,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static String toStr(Object value, String defaultValue) |
| | | { |
| | | if (null == value) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof String) |
| | | { |
| | | return (String) value; |
| | | } |
| | | return value.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 转换为字符串<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static String toStr(Object value) |
| | | { |
| | | return toStr(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为字符<br> |
| | | * 如果给定的值为null,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Character toChar(Object value, Character defaultValue) |
| | | { |
| | | if (null == value) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Character) |
| | | { |
| | | return (Character) value; |
| | | } |
| | | |
| | | final String valueStr = toStr(value, null); |
| | | return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0); |
| | | } |
| | | |
| | | /** |
| | | * 转换为字符<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Character toChar(Object value) |
| | | { |
| | | return toChar(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为byte<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Byte toByte(Object value, Byte defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Byte) |
| | | { |
| | | return (Byte) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).byteValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return Byte.parseByte(valueStr); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为byte<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Byte toByte(Object value) |
| | | { |
| | | return toByte(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Short<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Short toShort(Object value, Short defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Short) |
| | | { |
| | | return (Short) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).shortValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return Short.parseShort(valueStr.trim()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为Short<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Short toShort(Object value) |
| | | { |
| | | return toShort(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Number<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Number toNumber(Object value, Number defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return (Number) value; |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return NumberFormat.getInstance().parse(valueStr); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为Number<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Number toNumber(Object value) |
| | | { |
| | | return toNumber(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为int<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Integer toInt(Object value, Integer defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Integer) |
| | | { |
| | | return (Integer) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).intValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return Integer.parseInt(valueStr.trim()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为int<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Integer toInt(Object value) |
| | | { |
| | | return toInt(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Integer数组<br> |
| | | * |
| | | * @param str 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Integer[] toIntArray(String str) |
| | | { |
| | | return toIntArray(",", str); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Long数组<br> |
| | | * |
| | | * @param str 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Long[] toLongArray(String str) |
| | | { |
| | | return toLongArray(",", str); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Integer数组<br> |
| | | * |
| | | * @param split 分隔符 |
| | | * @param split 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Integer[] toIntArray(String split, String str) |
| | | { |
| | | if (StringUtils.isEmpty(str)) |
| | | { |
| | | return new Integer[] {}; |
| | | } |
| | | String[] arr = str.split(split); |
| | | final Integer[] ints = new Integer[arr.length]; |
| | | for (int i = 0; i < arr.length; i++) |
| | | { |
| | | final Integer v = toInt(arr[i], 0); |
| | | ints[i] = v; |
| | | } |
| | | return ints; |
| | | } |
| | | |
| | | /** |
| | | * 转换为Long数组<br> |
| | | * |
| | | * @param split 分隔符 |
| | | * @param str 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Long[] toLongArray(String split, String str) |
| | | { |
| | | if (StringUtils.isEmpty(str)) |
| | | { |
| | | return new Long[] {}; |
| | | } |
| | | String[] arr = str.split(split); |
| | | final Long[] longs = new Long[arr.length]; |
| | | for (int i = 0; i < arr.length; i++) |
| | | { |
| | | final Long v = toLong(arr[i], null); |
| | | longs[i] = v; |
| | | } |
| | | return longs; |
| | | } |
| | | |
| | | /** |
| | | * 转换为String数组<br> |
| | | * |
| | | * @param str 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static String[] toStrArray(String str) |
| | | { |
| | | return toStrArray(",", str); |
| | | } |
| | | |
| | | /** |
| | | * 转换为String数组<br> |
| | | * |
| | | * @param split 分隔符 |
| | | * @param split 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static String[] toStrArray(String split, String str) |
| | | { |
| | | return str.split(split); |
| | | } |
| | | |
| | | /** |
| | | * 转换为long<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Long toLong(Object value, Long defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Long) |
| | | { |
| | | return (Long) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).longValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | // 支持科学计数法 |
| | | return new BigDecimal(valueStr.trim()).longValue(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为long<br> |
| | | * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Long toLong(Object value) |
| | | { |
| | | return toLong(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为double<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Double toDouble(Object value, Double defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Double) |
| | | { |
| | | return (Double) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).doubleValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | // 支持科学计数法 |
| | | return new BigDecimal(valueStr.trim()).doubleValue(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为double<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Double toDouble(Object value) |
| | | { |
| | | return toDouble(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Float<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Float toFloat(Object value, Float defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Float) |
| | | { |
| | | return (Float) value; |
| | | } |
| | | if (value instanceof Number) |
| | | { |
| | | return ((Number) value).floatValue(); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return Float.parseFloat(valueStr.trim()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为Float<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Float toFloat(Object value) |
| | | { |
| | | return toFloat(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为boolean<br> |
| | | * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static Boolean toBool(Object value, Boolean defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof Boolean) |
| | | { |
| | | return (Boolean) value; |
| | | } |
| | | String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | valueStr = valueStr.trim().toLowerCase(); |
| | | switch (valueStr) |
| | | { |
| | | case "true": |
| | | case "yes": |
| | | case "ok": |
| | | case "1": |
| | | return true; |
| | | case "false": |
| | | case "no": |
| | | case "0": |
| | | return false; |
| | | default: |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为boolean<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static Boolean toBool(Object value) |
| | | { |
| | | return toBool(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为Enum对象<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * |
| | | * @param clazz Enum的Class |
| | | * @param value 值 |
| | | * @param defaultValue 默认值 |
| | | * @return Enum |
| | | */ |
| | | public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value, E defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (clazz.isAssignableFrom(value.getClass())) |
| | | { |
| | | @SuppressWarnings("unchecked") |
| | | E myE = (E) value; |
| | | return myE; |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return Enum.valueOf(clazz, valueStr); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为Enum对象<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * |
| | | * @param clazz Enum的Class |
| | | * @param value 值 |
| | | * @return Enum |
| | | */ |
| | | public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value) |
| | | { |
| | | return toEnum(clazz, value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为BigInteger<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static BigInteger toBigInteger(Object value, BigInteger defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof BigInteger) |
| | | { |
| | | return (BigInteger) value; |
| | | } |
| | | if (value instanceof Long) |
| | | { |
| | | return BigInteger.valueOf((Long) value); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return new BigInteger(valueStr); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为BigInteger<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static BigInteger toBigInteger(Object value) |
| | | { |
| | | return toBigInteger(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 转换为BigDecimal<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @param defaultValue 转换错误时的默认值 |
| | | * @return 结果 |
| | | */ |
| | | public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) |
| | | { |
| | | if (value == null) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | if (value instanceof BigDecimal) |
| | | { |
| | | return (BigDecimal) value; |
| | | } |
| | | if (value instanceof Long) |
| | | { |
| | | return new BigDecimal((Long) value); |
| | | } |
| | | if (value instanceof Double) |
| | | { |
| | | return BigDecimal.valueOf((Double) value); |
| | | } |
| | | if (value instanceof Integer) |
| | | { |
| | | return new BigDecimal((Integer) value); |
| | | } |
| | | final String valueStr = toStr(value, null); |
| | | if (StringUtils.isEmpty(valueStr)) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | try |
| | | { |
| | | return new BigDecimal(valueStr); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换为BigDecimal<br> |
| | | * 如果给定的值为空,或者转换失败,返回默认值<br> |
| | | * 转换失败不会报错 |
| | | * |
| | | * @param value 被转换的值 |
| | | * @return 结果 |
| | | */ |
| | | public static BigDecimal toBigDecimal(Object value) |
| | | { |
| | | return toBigDecimal(value, null); |
| | | } |
| | | |
| | | /** |
| | | * 将对象转为字符串<br> |
| | | * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 |
| | | * |
| | | * @param obj 对象 |
| | | * @return 字符串 |
| | | */ |
| | | public static String utf8Str(Object obj) |
| | | { |
| | | return str(obj, CharsetKit.CHARSET_UTF_8); |
| | | } |
| | | |
| | | /** |
| | | * 将对象转为字符串<br> |
| | | * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 |
| | | * |
| | | * @param obj 对象 |
| | | * @param charsetName 字符集 |
| | | * @return 字符串 |
| | | */ |
| | | public static String str(Object obj, String charsetName) |
| | | { |
| | | return str(obj, Charset.forName(charsetName)); |
| | | } |
| | | |
| | | /** |
| | | * 将对象转为字符串<br> |
| | | * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 |
| | | * |
| | | * @param obj 对象 |
| | | * @param charset 字符集 |
| | | * @return 字符串 |
| | | */ |
| | | public static String str(Object obj, Charset charset) |
| | | { |
| | | if (null == obj) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | if (obj instanceof String) |
| | | { |
| | | return (String) obj; |
| | | } |
| | | else if (obj instanceof byte[]) |
| | | { |
| | | return str((byte[]) obj, charset); |
| | | } |
| | | else if (obj instanceof Byte[]) |
| | | { |
| | | byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj); |
| | | return str(bytes, charset); |
| | | } |
| | | else if (obj instanceof ByteBuffer) |
| | | { |
| | | return str((ByteBuffer) obj, charset); |
| | | } |
| | | return obj.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 将byte数组转为字符串 |
| | | * |
| | | * @param bytes byte数组 |
| | | * @param charset 字符集 |
| | | * @return 字符串 |
| | | */ |
| | | public static String str(byte[] bytes, String charset) |
| | | { |
| | | return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); |
| | | } |
| | | |
| | | /** |
| | | * 解码字节码 |
| | | * |
| | | * @param data 字符串 |
| | | * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 |
| | | * @return 解码后的字符串 |
| | | */ |
| | | public static String str(byte[] data, Charset charset) |
| | | { |
| | | if (data == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | if (null == charset) |
| | | { |
| | | return new String(data); |
| | | } |
| | | return new String(data, charset); |
| | | } |
| | | |
| | | /** |
| | | * 将编码的byteBuffer数据转换为字符串 |
| | | * |
| | | * @param data 数据 |
| | | * @param charset 字符集,如果为空使用当前系统字符集 |
| | | * @return 字符串 |
| | | */ |
| | | public static String str(ByteBuffer data, String charset) |
| | | { |
| | | if (data == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | return str(data, Charset.forName(charset)); |
| | | } |
| | | |
| | | /** |
| | | * 将编码的byteBuffer数据转换为字符串 |
| | | * |
| | | * @param data 数据 |
| | | * @param charset 字符集,如果为空使用当前系统字符集 |
| | | * @return 字符串 |
| | | */ |
| | | public static String str(ByteBuffer data, Charset charset) |
| | | { |
| | | if (null == charset) |
| | | { |
| | | charset = Charset.defaultCharset(); |
| | | } |
| | | return charset.decode(data).toString(); |
| | | } |
| | | |
| | | // ----------------------------------------------------------------------- 全角半角转换 |
| | | /** |
| | | * 半角转全角 |
| | | * |
| | | * @param input String. |
| | | * @return 全角字符串. |
| | | */ |
| | | public static String toSBC(String input) |
| | | { |
| | | return toSBC(input, null); |
| | | } |
| | | |
| | | /** |
| | | * 半角转全角 |
| | | * |
| | | * @param input String |
| | | * @param notConvertSet 不替换的字符集合 |
| | | * @return 全角字符串. |
| | | */ |
| | | public static String toSBC(String input, Set<Character> notConvertSet) |
| | | { |
| | | char[] c = input.toCharArray(); |
| | | for (int i = 0; i < c.length; i++) |
| | | { |
| | | if (null != notConvertSet && notConvertSet.contains(c[i])) |
| | | { |
| | | // 跳过不替换的字符 |
| | | continue; |
| | | } |
| | | |
| | | if (c[i] == ' ') |
| | | { |
| | | c[i] = '\u3000'; |
| | | } |
| | | else if (c[i] < '\177') |
| | | { |
| | | c[i] = (char) (c[i] + 65248); |
| | | |
| | | } |
| | | } |
| | | return new String(c); |
| | | } |
| | | |
| | | /** |
| | | * 全角转半角 |
| | | * |
| | | * @param input String. |
| | | * @return 半角字符串 |
| | | */ |
| | | public static String toDBC(String input) |
| | | { |
| | | return toDBC(input, null); |
| | | } |
| | | |
| | | /** |
| | | * 替换全角为半角 |
| | | * |
| | | * @param text 文本 |
| | | * @param notConvertSet 不替换的字符集合 |
| | | * @return 替换后的字符 |
| | | */ |
| | | public static String toDBC(String text, Set<Character> notConvertSet) |
| | | { |
| | | char[] c = text.toCharArray(); |
| | | for (int i = 0; i < c.length; i++) |
| | | { |
| | | if (null != notConvertSet && notConvertSet.contains(c[i])) |
| | | { |
| | | // 跳过不替换的字符 |
| | | continue; |
| | | } |
| | | |
| | | if (c[i] == '\u3000') |
| | | { |
| | | c[i] = ' '; |
| | | } |
| | | else if (c[i] > '\uFF00' && c[i] < '\uFF5F') |
| | | { |
| | | c[i] = (char) (c[i] - 65248); |
| | | } |
| | | } |
| | | String returnString = new String(c); |
| | | |
| | | return returnString; |
| | | } |
| | | |
| | | /** |
| | | * 数字金额大写转换 先写个完整的然后将如零拾替换成零 |
| | | * |
| | | * @param n 数字 |
| | | * @return 中文大写数字 |
| | | */ |
| | | public static String digitUppercase(double n) |
| | | { |
| | | String[] fraction = { "角", "分" }; |
| | | String[] digit = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; |
| | | String[][] unit = { { "元", "万", "亿" }, { "", "拾", "佰", "仟" } }; |
| | | |
| | | String head = n < 0 ? "负" : ""; |
| | | n = Math.abs(n); |
| | | |
| | | String s = ""; |
| | | for (int i = 0; i < fraction.length; i++) |
| | | { |
| | | s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); |
| | | } |
| | | if (s.length() < 1) |
| | | { |
| | | s = "整"; |
| | | } |
| | | int integerPart = (int) Math.floor(n); |
| | | |
| | | for (int i = 0; i < unit[0].length && integerPart > 0; i++) |
| | | { |
| | | String p = ""; |
| | | for (int j = 0; j < unit[1].length && n > 0; j++) |
| | | { |
| | | p = digit[integerPart % 10] + unit[1][j] + p; |
| | | integerPart = integerPart / 10; |
| | | } |
| | | s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s; |
| | | } |
| | | return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.core.text; |
| | | |
| | | import com.finance.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 字符串格式化 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class StrFormatter |
| | | { |
| | | public static final String EMPTY_JSON = "{}"; |
| | | public static final char C_BACKSLASH = '\\'; |
| | | public static final char C_DELIM_START = '{'; |
| | | public static final char C_DELIM_END = '}'; |
| | | |
| | | /** |
| | | * 格式化字符串<br> |
| | | * 此方法只是简单将占位符 {} 按照顺序替换为参数<br> |
| | | * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br> |
| | | * 例:<br> |
| | | * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br> |
| | | * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br> |
| | | * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br> |
| | | * |
| | | * @param strPattern 字符串模板 |
| | | * @param argArray 参数列表 |
| | | * @return 结果 |
| | | */ |
| | | public static String format(final String strPattern, final Object... argArray) |
| | | { |
| | | if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) |
| | | { |
| | | return strPattern; |
| | | } |
| | | final int strPatternLength = strPattern.length(); |
| | | |
| | | // 初始化定义好的长度以获得更好的性能 |
| | | StringBuilder sbuf = new StringBuilder(strPatternLength + 50); |
| | | |
| | | int handledPosition = 0; |
| | | int delimIndex;// 占位符所在位置 |
| | | for (int argIndex = 0; argIndex < argArray.length; argIndex++) |
| | | { |
| | | delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition); |
| | | if (delimIndex == -1) |
| | | { |
| | | if (handledPosition == 0) |
| | | { |
| | | return strPattern; |
| | | } |
| | | else |
| | | { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果 |
| | | sbuf.append(strPattern, handledPosition, strPatternLength); |
| | | return sbuf.toString(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) |
| | | { |
| | | if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) |
| | | { |
| | | // 转义符之前还有一个转义符,占位符依旧有效 |
| | | sbuf.append(strPattern, handledPosition, delimIndex - 1); |
| | | sbuf.append(Convert.utf8Str(argArray[argIndex])); |
| | | handledPosition = delimIndex + 2; |
| | | } |
| | | else |
| | | { |
| | | // 占位符被转义 |
| | | argIndex--; |
| | | sbuf.append(strPattern, handledPosition, delimIndex - 1); |
| | | sbuf.append(C_DELIM_START); |
| | | handledPosition = delimIndex + 1; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // 正常占位符 |
| | | sbuf.append(strPattern, handledPosition, delimIndex); |
| | | sbuf.append(Convert.utf8Str(argArray[argIndex])); |
| | | handledPosition = delimIndex + 2; |
| | | } |
| | | } |
| | | } |
| | | // 加入最后一个占位符后所有的字符 |
| | | sbuf.append(strPattern, handledPosition, strPattern.length()); |
| | | |
| | | return sbuf.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum AreaLevelEnum { |
| | | PROVINCE(1, "省本级"), |
| | | CITY(2, "市"), |
| | | DEVELOPMENT_ZONES(3, "开发区"), |
| | | COUNTY(3, "县"); |
| | | |
| | | private final Integer code; |
| | | private final String desc; |
| | | |
| | | public static AreaLevelEnum getEnumByCode(Integer code) { |
| | | for (AreaLevelEnum e : AreaLevelEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | /** |
| | | * 操作状态 |
| | | * |
| | | * @author ruoyi |
| | | * |
| | | */ |
| | | public enum BusinessStatus |
| | | { |
| | | /** |
| | | * 成功 |
| | | */ |
| | | SUCCESS, |
| | | |
| | | /** |
| | | * 失败 |
| | | */ |
| | | FAIL, |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | /** |
| | | * 业务操作类型 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum BusinessType { |
| | | /** |
| | | * 其它 |
| | | */ |
| | | OTHER, |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | INSERT, |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | UPDATE, |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | DELETE, |
| | | |
| | | /** |
| | | * 授权 |
| | | */ |
| | | GRANT, |
| | | |
| | | /** |
| | | * 导出 |
| | | */ |
| | | EXPORT, |
| | | |
| | | /** |
| | | * 导入 |
| | | */ |
| | | IMPORT, |
| | | |
| | | /** |
| | | * 强退 |
| | | */ |
| | | FORCE, |
| | | |
| | | /** |
| | | * 生成代码 |
| | | */ |
| | | GENCODE, |
| | | |
| | | /** |
| | | * 清空数据 |
| | | */ |
| | | CLEAN, |
| | | /** |
| | | * 现场作业修改时间 |
| | | */ |
| | | UPDATETIME, |
| | | /** |
| | | * 现场作业修改经理 |
| | | */ |
| | | UPDATEMANAGER, |
| | | /** |
| | | * 现场作业修改负责人 |
| | | */ |
| | | UPDATEHEADER, |
| | | /** |
| | | * 现场作业修改人员 |
| | | */ |
| | | UPDATEUSERADD, |
| | | /** |
| | | * 现场作业修改人员 |
| | | */ |
| | | UPDATEUSERREMOVE, |
| | | /** |
| | | * 部门端修改基础数据 |
| | | */ |
| | | UPDBASICDATA, |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum CalculateTypeEnum { |
| | | NUMBER(1, "数字计算"), |
| | | TEXT(2, "文本统计"), |
| | | PERCENTAGE(3, "百分比统计"); |
| | | @EnumValue |
| | | private final Integer code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static CalculateTypeEnum getEnumByCode(Integer code) { |
| | | for (CalculateTypeEnum e : CalculateTypeEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum DataScreenConfigEnum { |
| | | RISK_LEVEL(1, "风险等级设置"), |
| | | DATA_INDICATORS(2, "数据指标设置"), |
| | | FORMAL_INDICATORS(3, "形式指标设置"); |
| | | @EnumValue |
| | | private final Integer code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static DataScreenConfigEnum getEnumByCode(Integer code) { |
| | | for (DataScreenConfigEnum e : DataScreenConfigEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | /** |
| | | * 数据源 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum DataSourceType |
| | | { |
| | | /** |
| | | * 主库 |
| | | */ |
| | | MASTER, |
| | | |
| | | /** |
| | | * 从库 |
| | | */ |
| | | SLAVE |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName Disable |
| | | * @Description |
| | | * @date 2022-06-08 16:55 |
| | | */ |
| | | public enum DisabledEnum { |
| | | NO(0, "否"), |
| | | YES(1, "是"); |
| | | |
| | | @Getter |
| | | @JsonValue |
| | | private String desc; |
| | | |
| | | |
| | | @Getter |
| | | @EnumValue |
| | | private int code; |
| | | |
| | | |
| | | DisabledEnum(int code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static DisabledEnum fromCode(Integer code) { |
| | | DisabledEnum[] resultTypes = DisabledEnum.values(); |
| | | for (DisabledEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 通过desc获取美剧 |
| | | * |
| | | * @param desc |
| | | * @return |
| | | */ |
| | | public static DisabledEnum getByDesc(String desc) { |
| | | DisabledEnum[] resultTypes = DisabledEnum.values(); |
| | | for (DisabledEnum resultType : resultTypes) { |
| | | if (desc.equals(resultType.getDesc())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.Getter; |
| | | import lombok.AllArgsConstructor; |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum FieldInputTypeEnum { |
| | | MANUAL_INPUT(1, "手动输入"), |
| | | FIXED_CONTENT(2, "固定内容"); |
| | | @EnumValue |
| | | private final Integer code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static FieldInputTypeEnum getEnumByCode(Integer code) { |
| | | for (FieldInputTypeEnum e : FieldInputTypeEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum FieldTypeEnum { |
| | | NUMBER(1, "数字"), |
| | | TEXT(2, "文本"), |
| | | PERCENTAGE(3, "百分比"); |
| | | @EnumValue |
| | | private final Integer code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static FieldTypeEnum getEnumByCode(Integer code) { |
| | | for (FieldTypeEnum e : FieldTypeEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static FieldTypeEnum getEnumByDesc(String desc) { |
| | | for (FieldTypeEnum e : FieldTypeEnum.values()) { |
| | | if (e.desc.equals(desc)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import org.springframework.lang.Nullable; |
| | | |
| | | /** |
| | | * 请求方式 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum HttpMethod |
| | | { |
| | | GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE; |
| | | |
| | | private static final Map<String, HttpMethod> mappings = new HashMap<>(16); |
| | | |
| | | static |
| | | { |
| | | for (HttpMethod httpMethod : values()) |
| | | { |
| | | mappings.put(httpMethod.name(), httpMethod); |
| | | } |
| | | } |
| | | |
| | | @Nullable |
| | | public static HttpMethod resolve(@Nullable String method) |
| | | { |
| | | return (method != null ? mappings.get(method) : null); |
| | | } |
| | | |
| | | public boolean matches(String method) |
| | | { |
| | | return (this == resolve(method)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | /** |
| | | * 限流类型 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | |
| | | public enum LimitType |
| | | { |
| | | /** |
| | | * 默认策略全局限流 |
| | | */ |
| | | DEFAULT, |
| | | |
| | | /** |
| | | * 根据请求者IP进行限流 |
| | | */ |
| | | IP |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | /** |
| | | * 操作人类别 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum OperatorType |
| | | { |
| | | /** |
| | | * 其它 |
| | | */ |
| | | OTHER, |
| | | |
| | | /** |
| | | * 后台用户 |
| | | */ |
| | | MANAGE, |
| | | |
| | | /** |
| | | * 手机端用户 |
| | | */ |
| | | MOBILE |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | public enum RedisKeys { |
| | | AREA_CODE_VERIFY("area_code_verify:", 2L); |
| | | //相当于下面写法 |
| | | private String prefix; |
| | | private Long time; |
| | | |
| | | private RedisKeys(String prefix, Long time) { |
| | | this.prefix = prefix; |
| | | this.time = time; |
| | | } |
| | | |
| | | //用于拼接key |
| | | public String join(String... values) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append(prefix); |
| | | for (String value : values) { |
| | | sb.append(":").append(value); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.Getter; |
| | | import lombok.AllArgsConstructor; |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ReportingStatusEnum { |
| | | UNFILLED(1, "未填报"), |
| | | MISSING_DATA(2, "数据缺失"), |
| | | FILLED(3, "已填报"); |
| | | @EnumValue |
| | | private final Integer code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static ReportingStatusEnum getEnumByCode(Integer code) { |
| | | for (ReportingStatusEnum e : ReportingStatusEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum RiskLevelEnum { |
| | | L1("R1", "低风险"), |
| | | L2("R2", "一般风险"), |
| | | L3("R3", "较高风险"), |
| | | L4("R4", "高风险"); |
| | | @EnumValue |
| | | private final String code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static RiskLevelEnum getEnumByCode(String code) { |
| | | for (RiskLevelEnum e : RiskLevelEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.Getter; |
| | | import lombok.AllArgsConstructor; |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ShowStatusEnum { |
| | | SHOW(0, "展示中"), |
| | | HIDE(1, "已隐藏"); |
| | | |
| | | @EnumValue |
| | | private final Integer code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static ShowStatusEnum getEnumByCode(Integer code) { |
| | | for (ShowStatusEnum e : ShowStatusEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum SubTypeEnum { |
| | | INDICATOR_ONE(1, "指标一"), |
| | | INDICATOR_TWO(2, "指标二"), |
| | | INDICATOR_THREE(3, "指标三"), |
| | | INDICATOR_FOUR(4, "指标四"); |
| | | @EnumValue |
| | | private final Integer code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static SubTypeEnum getEnumByCode(Integer code) { |
| | | for (SubTypeEnum e : SubTypeEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName Disable |
| | | * @Description |
| | | * @date 2022-06-08 16:55 |
| | | */ |
| | | public enum UpdateTypeEnum { |
| | | /*调整类型 1=经理更换,2=负责人更换,3=人员新增,4=调整计划时间*/ |
| | | PROJECT_MANAGER(1, "经理更换"), |
| | | WORK_HEADER(2, "负责人更换"), |
| | | ADD_USER(3, "人员新增"), |
| | | UPDATE_PLAN_TIME(4, "调整计划时间"), |
| | | REDUCE_USER(5, "人员减少"); |
| | | |
| | | @Getter |
| | | private String desc; |
| | | |
| | | |
| | | @Getter |
| | | private int code; |
| | | |
| | | |
| | | UpdateTypeEnum(int code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static UpdateTypeEnum fromCode(Integer code) { |
| | | UpdateTypeEnum[] resultTypes = UpdateTypeEnum.values(); |
| | | for (UpdateTypeEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | /** |
| | | * 用户状态 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public enum UserStatus |
| | | { |
| | | OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除"); |
| | | |
| | | private final String code; |
| | | private final String info; |
| | | |
| | | UserStatus(String code, String info) |
| | | { |
| | | this.code = code; |
| | | this.info = info; |
| | | } |
| | | |
| | | public String getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public String getInfo() |
| | | { |
| | | return info; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum UserTypeEnum { |
| | | PLATFORM("1", "平台"), |
| | | DEPARTMENT("2", "部门"); |
| | | @EnumValue |
| | | private final String code; |
| | | @JsonValue |
| | | private final String desc; |
| | | |
| | | public static UserTypeEnum getEnumByCode(String code) { |
| | | for (UserTypeEnum e : UserTypeEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.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; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception; |
| | | |
| | | /** |
| | | * 演示模式异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class DemoModeException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public DemoModeException() |
| | | { |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception; |
| | | |
| | | /** |
| | | * 全局异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class GlobalException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 错误提示 |
| | | */ |
| | | private String message; |
| | | |
| | | /** |
| | | * 错误明细,内部调试错误 |
| | | * |
| | | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 |
| | | */ |
| | | private String detailMessage; |
| | | |
| | | /** |
| | | * 空构造方法,避免反序列化问题 |
| | | */ |
| | | public GlobalException() |
| | | { |
| | | } |
| | | |
| | | public GlobalException(String message) |
| | | { |
| | | this.message = message; |
| | | } |
| | | |
| | | public String getDetailMessage() |
| | | { |
| | | return detailMessage; |
| | | } |
| | | |
| | | public GlobalException setDetailMessage(String detailMessage) |
| | | { |
| | | this.detailMessage = detailMessage; |
| | | return this; |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() |
| | | { |
| | | return message; |
| | | } |
| | | |
| | | public GlobalException setMessage(String message) |
| | | { |
| | | this.message = message; |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception; |
| | | |
| | | /** |
| | | * 业务异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public final class ServiceException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 错误码 |
| | | */ |
| | | private Integer code; |
| | | |
| | | /** |
| | | * 错误提示 |
| | | */ |
| | | private String message; |
| | | |
| | | /** |
| | | * 错误明细,内部调试错误 |
| | | * |
| | | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 |
| | | */ |
| | | private String detailMessage; |
| | | |
| | | /** |
| | | * 空构造方法,避免反序列化问题 |
| | | */ |
| | | public ServiceException() |
| | | { |
| | | } |
| | | |
| | | public ServiceException(String message) |
| | | { |
| | | this.message = message; |
| | | } |
| | | |
| | | public ServiceException(String message, Integer code) |
| | | { |
| | | this.message = message; |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getDetailMessage() |
| | | { |
| | | return detailMessage; |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() |
| | | { |
| | | return message; |
| | | } |
| | | |
| | | public Integer getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public ServiceException setMessage(String message) |
| | | { |
| | | this.message = message; |
| | | return this; |
| | | } |
| | | |
| | | public ServiceException setDetailMessage(String detailMessage) |
| | | { |
| | | this.detailMessage = detailMessage; |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception; |
| | | |
| | | /** |
| | | * 工具类异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UtilException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 8247610319171014183L; |
| | | |
| | | public UtilException(Throwable e) |
| | | { |
| | | super(e.getMessage(), e); |
| | | } |
| | | |
| | | public UtilException(String message) |
| | | { |
| | | super(message); |
| | | } |
| | | |
| | | public UtilException(String message, Throwable throwable) |
| | | { |
| | | super(message, throwable); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.base; |
| | | |
| | | import com.finance.common.utils.MessageUtils; |
| | | import com.finance.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * 基础异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BaseException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 所属模块 |
| | | */ |
| | | private String module; |
| | | |
| | | /** |
| | | * 错误码 |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * 错误码对应的参数 |
| | | */ |
| | | private Object[] args; |
| | | |
| | | /** |
| | | * 错误消息 |
| | | */ |
| | | private String defaultMessage; |
| | | |
| | | public BaseException(String module, String code, Object[] args, String defaultMessage) |
| | | { |
| | | this.module = module; |
| | | this.code = code; |
| | | this.args = args; |
| | | this.defaultMessage = defaultMessage; |
| | | } |
| | | |
| | | public BaseException(String module, String code, Object[] args) |
| | | { |
| | | this(module, code, args, null); |
| | | } |
| | | |
| | | public BaseException(String module, String defaultMessage) |
| | | { |
| | | this(module, null, null, defaultMessage); |
| | | } |
| | | |
| | | public BaseException(String code, Object[] args) |
| | | { |
| | | this(null, code, args, null); |
| | | } |
| | | |
| | | public BaseException(String defaultMessage) |
| | | { |
| | | this(null, null, null, defaultMessage); |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() |
| | | { |
| | | String message = null; |
| | | if (!StringUtils.isEmpty(code)) |
| | | { |
| | | message = MessageUtils.message(code, args); |
| | | } |
| | | if (message == null) |
| | | { |
| | | message = defaultMessage; |
| | | } |
| | | return message; |
| | | } |
| | | |
| | | public String getModule() |
| | | { |
| | | return module; |
| | | } |
| | | |
| | | public String getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public Object[] getArgs() |
| | | { |
| | | return args; |
| | | } |
| | | |
| | | public String getDefaultMessage() |
| | | { |
| | | return defaultMessage; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.file; |
| | | |
| | | import com.finance.common.exception.base.BaseException; |
| | | |
| | | /** |
| | | * 文件信息异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FileException extends BaseException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public FileException(String code, Object[] args) |
| | | { |
| | | super("file", code, args, null); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.file; |
| | | |
| | | /** |
| | | * 文件名称超长限制异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FileNameLengthLimitExceededException extends FileException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public FileNameLengthLimitExceededException(int defaultFileNameLength) |
| | | { |
| | | super("upload.filename.exceed.length", new Object[] { defaultFileNameLength }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.file; |
| | | |
| | | /** |
| | | * 文件名大小限制异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FileSizeLimitExceededException extends FileException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public FileSizeLimitExceededException(long defaultMaxSize) |
| | | { |
| | | super("upload.exceed.maxSize", new Object[] { defaultMaxSize }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.file; |
| | | |
| | | import java.io.PrintStream; |
| | | import java.io.PrintWriter; |
| | | |
| | | /** |
| | | * 文件上传异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class FileUploadException extends Exception |
| | | { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private final Throwable cause; |
| | | |
| | | public FileUploadException() |
| | | { |
| | | this(null, null); |
| | | } |
| | | |
| | | public FileUploadException(final String msg) |
| | | { |
| | | this(msg, null); |
| | | } |
| | | |
| | | public FileUploadException(String msg, Throwable cause) |
| | | { |
| | | super(msg); |
| | | this.cause = cause; |
| | | } |
| | | |
| | | @Override |
| | | public void printStackTrace(PrintStream stream) |
| | | { |
| | | super.printStackTrace(stream); |
| | | if (cause != null) |
| | | { |
| | | stream.println("Caused by:"); |
| | | cause.printStackTrace(stream); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void printStackTrace(PrintWriter writer) |
| | | { |
| | | super.printStackTrace(writer); |
| | | if (cause != null) |
| | | { |
| | | writer.println("Caused by:"); |
| | | cause.printStackTrace(writer); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Throwable getCause() |
| | | { |
| | | return cause; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.file; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 文件上传 误异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class InvalidExtensionException extends FileUploadException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String[] allowedExtension; |
| | | private String extension; |
| | | private String filename; |
| | | |
| | | public InvalidExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super("文件[" + filename + "]后缀[" + extension + "]不正确,请上传" + Arrays.toString(allowedExtension) + "格式"); |
| | | this.allowedExtension = allowedExtension; |
| | | this.extension = extension; |
| | | this.filename = filename; |
| | | } |
| | | |
| | | public String[] getAllowedExtension() |
| | | { |
| | | return allowedExtension; |
| | | } |
| | | |
| | | public String getExtension() |
| | | { |
| | | return extension; |
| | | } |
| | | |
| | | public String getFilename() |
| | | { |
| | | return filename; |
| | | } |
| | | |
| | | public static class InvalidImageExtensionException extends InvalidExtensionException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super(allowedExtension, extension, filename); |
| | | } |
| | | } |
| | | |
| | | public static class InvalidFlashExtensionException extends InvalidExtensionException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super(allowedExtension, extension, filename); |
| | | } |
| | | } |
| | | |
| | | public static class InvalidMediaExtensionException extends InvalidExtensionException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super(allowedExtension, extension, filename); |
| | | } |
| | | } |
| | | |
| | | public static class InvalidVideoExtensionException extends InvalidExtensionException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public InvalidVideoExtensionException(String[] allowedExtension, String extension, String filename) |
| | | { |
| | | super(allowedExtension, extension, filename); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.job; |
| | | |
| | | /** |
| | | * 计划策略异常 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TaskException extends Exception |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Code code; |
| | | |
| | | public TaskException(String msg, Code code) |
| | | { |
| | | this(msg, code, null); |
| | | } |
| | | |
| | | public TaskException(String msg, Code code, Exception nestedEx) |
| | | { |
| | | super(msg, nestedEx); |
| | | this.code = code; |
| | | } |
| | | |
| | | public Code getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public enum Code |
| | | { |
| | | TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.user; |
| | | |
| | | /** |
| | | * 黑名单IP异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BlackListException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public BlackListException() |
| | | { |
| | | super("login.blocked", null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.user; |
| | | |
| | | /** |
| | | * 验证码错误异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class CaptchaException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public CaptchaException() |
| | | { |
| | | super("user.jcaptcha.error", null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.user; |
| | | |
| | | /** |
| | | * 验证码失效异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class CaptchaExpireException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public CaptchaExpireException() |
| | | { |
| | | super("user.jcaptcha.expire", null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.user; |
| | | |
| | | import com.finance.common.exception.base.BaseException; |
| | | |
| | | /** |
| | | * 用户信息异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserException extends BaseException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public UserException(String code, Object[] args) |
| | | { |
| | | super("user", code, args, null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.user; |
| | | |
| | | /** |
| | | * 用户不存在异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserNotExistsException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public UserNotExistsException() |
| | | { |
| | | super("user.not.exists", null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.user; |
| | | |
| | | /** |
| | | * 用户密码不正确或不符合规范异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserPasswordNotMatchException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public UserPasswordNotMatchException() |
| | | { |
| | | super("user.password.not.match", null); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.exception.user; |
| | | |
| | | /** |
| | | * 用户错误最大次数异常类 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserPasswordRetryLimitExceedException extends UserException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public UserPasswordRetryLimitExceedException(int retryLimitCount, int lockTime) |
| | | { |
| | | super("user.password.retry.limit.exceed", new Object[] { retryLimitCount, lockTime }); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.filter; |
| | | |
| | | import com.alibaba.fastjson2.filter.SimplePropertyPreFilter; |
| | | |
| | | /** |
| | | * 排除JSON敏感属性 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class PropertyPreExcludeFilter extends SimplePropertyPreFilter |
| | | { |
| | | public PropertyPreExcludeFilter() |
| | | { |
| | | } |
| | | |
| | | public PropertyPreExcludeFilter addExcludes(String... filters) |
| | | { |
| | | for (int i = 0; i < filters.length; i++) |
| | | { |
| | | this.getExcludes().add(filters[i]); |
| | | } |
| | | return this; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.filter; |
| | | |
| | | import java.io.IOException; |
| | | import javax.servlet.Filter; |
| | | import javax.servlet.FilterChain; |
| | | import javax.servlet.FilterConfig; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.ServletResponse; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import org.springframework.http.MediaType; |
| | | import com.finance.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * Repeatable 过滤器 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class RepeatableFilter implements Filter |
| | | { |
| | | @Override |
| | | public void init(FilterConfig filterConfig) throws ServletException |
| | | { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
| | | throws IOException, ServletException |
| | | { |
| | | ServletRequest requestWrapper = null; |
| | | if (request instanceof HttpServletRequest |
| | | && StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) |
| | | { |
| | | requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response); |
| | | } |
| | | if (null == requestWrapper) |
| | | { |
| | | chain.doFilter(request, response); |
| | | } |
| | | else |
| | | { |
| | | chain.doFilter(requestWrapper, response); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void destroy() |
| | | { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.filter; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import javax.servlet.ReadListener; |
| | | import javax.servlet.ServletInputStream; |
| | | import javax.servlet.ServletResponse; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletRequestWrapper; |
| | | import com.finance.common.utils.http.HttpHelper; |
| | | import com.finance.common.constant.Constants; |
| | | |
| | | /** |
| | | * 构建可重复读取inputStream的request |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper |
| | | { |
| | | private final byte[] body; |
| | | |
| | | public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException |
| | | { |
| | | super(request); |
| | | request.setCharacterEncoding(Constants.UTF8); |
| | | response.setCharacterEncoding(Constants.UTF8); |
| | | |
| | | body = HttpHelper.getBodyString(request).getBytes(Constants.UTF8); |
| | | } |
| | | |
| | | @Override |
| | | public BufferedReader getReader() throws IOException |
| | | { |
| | | return new BufferedReader(new InputStreamReader(getInputStream())); |
| | | } |
| | | |
| | | @Override |
| | | public ServletInputStream getInputStream() throws IOException |
| | | { |
| | | final ByteArrayInputStream bais = new ByteArrayInputStream(body); |
| | | return new ServletInputStream() |
| | | { |
| | | @Override |
| | | public int read() throws IOException |
| | | { |
| | | return bais.read(); |
| | | } |
| | | |
| | | @Override |
| | | public int available() throws IOException |
| | | { |
| | | return body.length; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isFinished() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isReady() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public void setReadListener(ReadListener readListener) |
| | | { |
| | | |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.filter; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.servlet.Filter; |
| | | import javax.servlet.FilterChain; |
| | | import javax.servlet.FilterConfig; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.ServletResponse; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.common.enums.HttpMethod; |
| | | |
| | | /** |
| | | * 防止XSS攻击的过滤器 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class XssFilter implements Filter |
| | | { |
| | | /** |
| | | * 排除链接 |
| | | */ |
| | | public List<String> excludes = new ArrayList<>(); |
| | | |
| | | @Override |
| | | public void init(FilterConfig filterConfig) throws ServletException |
| | | { |
| | | String tempExcludes = filterConfig.getInitParameter("excludes"); |
| | | if (StringUtils.isNotEmpty(tempExcludes)) |
| | | { |
| | | String[] url = tempExcludes.split(","); |
| | | for (int i = 0; url != null && i < url.length; i++) |
| | | { |
| | | excludes.add(url[i]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
| | | throws IOException, ServletException |
| | | { |
| | | HttpServletRequest req = (HttpServletRequest) request; |
| | | HttpServletResponse resp = (HttpServletResponse) response; |
| | | if (handleExcludeURL(req, resp)) |
| | | { |
| | | chain.doFilter(request, response); |
| | | return; |
| | | } |
| | | XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper((HttpServletRequest) request); |
| | | chain.doFilter(xssRequest, response); |
| | | } |
| | | |
| | | private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response) |
| | | { |
| | | String url = request.getServletPath(); |
| | | String method = request.getMethod(); |
| | | // GET DELETE 不过滤 |
| | | if (method == null || HttpMethod.GET.matches(method) || HttpMethod.DELETE.matches(method)) |
| | | { |
| | | return true; |
| | | } |
| | | return StringUtils.matches(url, excludes); |
| | | } |
| | | |
| | | @Override |
| | | public void destroy() |
| | | { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.filter; |
| | | |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.IOException; |
| | | import javax.servlet.ReadListener; |
| | | import javax.servlet.ServletInputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletRequestWrapper; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import com.finance.common.utils.StringUtils; |
| | | import com.finance.common.utils.html.EscapeUtil; |
| | | |
| | | /** |
| | | * XSS过滤处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper |
| | | { |
| | | /** |
| | | * @param request |
| | | */ |
| | | public XssHttpServletRequestWrapper(HttpServletRequest request) |
| | | { |
| | | super(request); |
| | | } |
| | | |
| | | @Override |
| | | public String[] getParameterValues(String name) |
| | | { |
| | | String[] values = super.getParameterValues(name); |
| | | if (values != null) |
| | | { |
| | | int length = values.length; |
| | | String[] escapesValues = new String[length]; |
| | | for (int i = 0; i < length; i++) |
| | | { |
| | | // 防xss攻击和过滤前后空格 |
| | | escapesValues[i] = EscapeUtil.clean(values[i]).trim(); |
| | | } |
| | | return escapesValues; |
| | | } |
| | | return super.getParameterValues(name); |
| | | } |
| | | |
| | | @Override |
| | | public ServletInputStream getInputStream() throws IOException |
| | | { |
| | | // 非json类型,直接返回 |
| | | if (!isJsonRequest()) |
| | | { |
| | | return super.getInputStream(); |
| | | } |
| | | |
| | | // 为空,直接返回 |
| | | String json = IOUtils.toString(super.getInputStream(), "utf-8"); |
| | | if (StringUtils.isEmpty(json)) |
| | | { |
| | | return super.getInputStream(); |
| | | } |
| | | |
| | | // xss过滤 |
| | | json = EscapeUtil.clean(json).trim(); |
| | | byte[] jsonBytes = json.getBytes("utf-8"); |
| | | final ByteArrayInputStream bis = new ByteArrayInputStream(jsonBytes); |
| | | return new ServletInputStream() |
| | | { |
| | | @Override |
| | | public boolean isFinished() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isReady() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public int available() throws IOException |
| | | { |
| | | return jsonBytes.length; |
| | | } |
| | | |
| | | @Override |
| | | public void setReadListener(ReadListener readListener) |
| | | { |
| | | } |
| | | |
| | | @Override |
| | | public int read() throws IOException |
| | | { |
| | | return bis.read(); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 是否是Json请求 |
| | | * |
| | | * @param request |
| | | */ |
| | | public boolean isJsonRequest() |
| | | { |
| | | String header = super.getHeader(HttpHeaders.CONTENT_TYPE); |
| | | return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.resp; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * AccessToken 全局唯一 |
| | | * |
| | | * @author liheng |
| | | */ |
| | | @Data |
| | | public class AccessTokenRespBody implements Serializable { |
| | | |
| | | /** |
| | | * 获取到的凭证 |
| | | */ |
| | | @JsonProperty("access_token") |
| | | private String accessToken; |
| | | /** |
| | | * 凭证有效时间,单位:秒 |
| | | */ |
| | | @JsonProperty("expires_in") |
| | | private int expiresIn; |
| | | |
| | | } |
New file |
| | |
| | | package com.finance.common.utils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | |
| | | /** |
| | | * 精确的浮点数运算 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class Arith |
| | | { |
| | | |
| | | /** 默认除法运算精度 */ |
| | | private static final int DEF_DIV_SCALE = 10; |
| | | |
| | | /** 这个类不能实例化 */ |
| | | private Arith() |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的加法运算。 |
| | | * @param v1 被加数 |
| | | * @param v2 加数 |
| | | * @return 两个参数的和 |
| | | */ |
| | | public static double add(double v1, double v2) |
| | | { |
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1)); |
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2)); |
| | | return b1.add(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的减法运算。 |
| | | * @param v1 被减数 |
| | | * @param v2 减数 |
| | | * @return 两个参数的差 |
| | | */ |
| | | public static double sub(double v1, double v2) |
| | | { |
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1)); |
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2)); |
| | | return b1.subtract(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的乘法运算。 |
| | | * @param v1 被乘数 |
| | | * @param v2 乘数 |
| | | * @return 两个参数的积 |
| | | */ |
| | | public static double mul(double v1, double v2) |
| | | { |
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1)); |
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2)); |
| | | return b1.multiply(b2).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 |
| | | * 小数点以后10位,以后的数字四舍五入。 |
| | | * @param v1 被除数 |
| | | * @param v2 除数 |
| | | * @return 两个参数的商 |
| | | */ |
| | | public static double div(double v1, double v2) |
| | | { |
| | | return div(v1, v2, DEF_DIV_SCALE); |
| | | } |
| | | |
| | | /** |
| | | * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 |
| | | * 定精度,以后的数字四舍五入。 |
| | | * @param v1 被除数 |
| | | * @param v2 除数 |
| | | * @param scale 表示表示需要精确到小数点以后几位。 |
| | | * @return 两个参数的商 |
| | | */ |
| | | public static double div(double v1, double v2, int scale) |
| | | { |
| | | if (scale < 0) |
| | | { |
| | | throw new IllegalArgumentException( |
| | | "The scale must be a positive integer or zero"); |
| | | } |
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1)); |
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2)); |
| | | if (b1.compareTo(BigDecimal.ZERO) == 0) |
| | | { |
| | | return BigDecimal.ZERO.doubleValue(); |
| | | } |
| | | return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue(); |
| | | } |
| | | |
| | | /** |
| | | * 提供精确的小数位四舍五入处理。 |
| | | * @param v 需要四舍五入的数字 |
| | | * @param scale 小数点后保留几位 |
| | | * @return 四舍五入后的结果 |
| | | */ |
| | | public static double round(double v, int scale) |
| | | { |
| | | if (scale < 0) |
| | | { |
| | | throw new IllegalArgumentException( |
| | | "The scale must be a positive integer or zero"); |
| | | } |
| | | BigDecimal b = new BigDecimal(Double.toString(v)); |
| | | BigDecimal one = BigDecimal.ONE; |
| | | return b.divide(one, scale, RoundingMode.HALF_UP).doubleValue(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.utils; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 数组工具类 |
| | | * @ClassName ArrayUtils |
| | | * @author wusongsong |
| | | * @since 2022/7/10 12:02 |
| | | * @version 1.0.0 |
| | | **/ |
| | | public class ArrayUtils extends ArrayUtil { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 将源数组转换成指定类型的列表 |
| | | * |
| | | * @param originList 原始列表 |
| | | * @param targetClazz 转换后列表元素的类型 |
| | | * @param <R> 原始列表元素的类型 |
| | | * @param <T> 目标列表元素的类型 |
| | | * @return 目标类型的集合 |
| | | */ |
| | | public static <R, T> List<T> convert(R[] originList, Class<T> targetClazz) { |
| | | return convert(originList, targetClazz, null); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 将源数组转换成指定类型的列表 |
| | | * |
| | | * @param originList 原始列表 |
| | | * @param targetClazz 转换后列表元素的类型 |
| | | * @param convert 转换特殊字段接口 |
| | | * @param <R> 原始列表元素的类型 |
| | | * @param <T> 目标列表元素的类型 |
| | | * @return 目标类型的集合 |
| | | */ |
| | | public static <R, T> List<T> convert(R[] originList, Class<T> targetClazz, Convert<R, T> convert) { |
| | | if (isEmpty(originList)) { |
| | | return null; |
| | | } |
| | | |
| | | return Arrays.stream(originList) |
| | | .map(origin -> BeanUtils.copyBean(origin, targetClazz, convert)) |
| | | .collect(Collectors.toList()); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.finance.common.utils; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 继承自 hutool 的BeanUtil,增加了bean转换时自定义转换器的功能 |
| | | */ |
| | | public class BeanUtils extends BeanUtil { |
| | | |
| | | /** |
| | | * 将原对象转换成目标对象,对于字段不匹配的字段可以使用转换器处理 |
| | | * |
| | | * @param source 原对象 |
| | | * @param clazz 目标对象的class |
| | | * @param convert 转换器 |
| | | * @param <R> 原对象类型 |
| | | * @param <T> 目标对象类型 |
| | | * @return 目标对象 |
| | | */ |
| | | public static <R, T> T copyBean(R source, Class<T> clazz, Convert<R, T> convert) { |
| | | T target = copyBean(source, clazz); |
| | | if (convert != null) { |
| | | convert.convert(source, target); |
| | | } |
| | | return target; |
| | | } |
| | | /** |
| | | * 将原对象转换成目标对象,对于字段不匹配的字段可以使用转换器处理 |
| | | * |
| | | * @param source 原对象 |
| | | * @param clazz 目标对象的class |
| | | * @param <R> 原对象类型 |
| | | * @param <T> 目标对象类型 |
| | | * @return 目标对象 |
| | | */ |
| | | public static <R, T> T copyBean(R source, Class<T> clazz){ |
| | | if (source == null) { |
| | | return null; |
| | | } |
| | | return toBean(source, clazz); |
| | | } |
| | | |
| | | public static <R, T> List<T> copyList(List<R> list, Class<T> clazz) { |
| | | if (list == null || list.size() == 0) { |
| | | return CollUtils.emptyList(); |
| | | } |
| | | return copyToList(list, clazz); |
| | | } |
| | | |
| | | public static <R, T> List<T> copyList(List<R> list, Class<T> clazz, Convert<R, T> convert) { |
| | | if (list == null || list.size() == 0) { |
| | | return CollUtils.emptyList(); |
| | | } |
| | | return list.stream().map(r -> copyBean(r, clazz, convert)).collect(Collectors.toList()); |
| | | } |
| | | } |
finance-common/src/main/java/com/finance/common/utils/CalculateUtil.java
finance-common/src/main/java/com/finance/common/utils/Checker.java
finance-common/src/main/java/com/finance/common/utils/CodeGenerateUtils.java
finance-common/src/main/java/com/finance/common/utils/CollUtils.java
finance-common/src/main/java/com/finance/common/utils/Convert.java
finance-common/src/main/java/com/finance/common/utils/DateUtils.java
finance-common/src/main/java/com/finance/common/utils/DictUtils.java
finance-common/src/main/java/com/finance/common/utils/EasyExcelUtil.java
finance-common/src/main/java/com/finance/common/utils/ExcelUtil.java
finance-common/src/main/java/com/finance/common/utils/ExceptionUtil.java
finance-common/src/main/java/com/finance/common/utils/IDCardUtils.java
finance-common/src/main/java/com/finance/common/utils/LogUtils.java
finance-common/src/main/java/com/finance/common/utils/MessageUtils.java
finance-common/src/main/java/com/finance/common/utils/MultipartFileUtil.java
finance-common/src/main/java/com/finance/common/utils/NumberUtils.java
finance-common/src/main/java/com/finance/common/utils/ObjectUtils.java
finance-common/src/main/java/com/finance/common/utils/PageUtils.java
finance-common/src/main/java/com/finance/common/utils/SecurityUtils.java
finance-common/src/main/java/com/finance/common/utils/ServletUtils.java
finance-common/src/main/java/com/finance/common/utils/StringUtils.java
finance-common/src/main/java/com/finance/common/utils/Threads.java
finance-common/src/main/java/com/finance/common/utils/TimeConverter.java
finance-common/src/main/java/com/finance/common/utils/VideoUtil.java
finance-common/src/main/java/com/finance/common/utils/WebUtils.java
finance-common/src/main/java/com/finance/common/utils/WxAppletTools.java
finance-common/src/main/java/com/finance/common/utils/bean/BeanUtils.java
finance-common/src/main/java/com/finance/common/utils/bean/BeanValidators.java
finance-common/src/main/java/com/finance/common/utils/file/FileTypeUtils.java
finance-common/src/main/java/com/finance/common/utils/file/FileUploadUtils.java
finance-common/src/main/java/com/finance/common/utils/file/FileUtils.java
finance-common/src/main/java/com/finance/common/utils/file/ImageUtils.java
finance-common/src/main/java/com/finance/common/utils/file/MimeTypeUtils.java
finance-common/src/main/java/com/finance/common/utils/html/EscapeUtil.java
finance-common/src/main/java/com/finance/common/utils/html/HTMLFilter.java
finance-common/src/main/java/com/finance/common/utils/http/HttpHelper.java
finance-common/src/main/java/com/finance/common/utils/http/HttpUtils.java
finance-common/src/main/java/com/finance/common/utils/ip/AddressUtils.java
finance-common/src/main/java/com/finance/common/utils/ip/IpUtils.java
finance-common/src/main/java/com/finance/common/utils/poi/ExcelHandlerAdapter.java
finance-common/src/main/java/com/finance/common/utils/poi/ExcelUtil.java
finance-common/src/main/java/com/finance/common/utils/reflect/ReflectUtils.java
finance-common/src/main/java/com/finance/common/utils/sign/Base64.java
finance-common/src/main/java/com/finance/common/utils/sign/Md5Utils.java
finance-common/src/main/java/com/finance/common/utils/spring/SpringUtils.java
finance-common/src/main/java/com/finance/common/utils/sql/SqlUtil.java
finance-common/src/main/java/com/finance/common/utils/uuid/IdUtils.java
finance-common/src/main/java/com/finance/common/utils/uuid/Seq.java
finance-common/src/main/java/com/finance/common/utils/uuid/UUID.java
finance-common/src/main/java/com/finance/common/xss/Xss.java
finance-common/src/main/java/com/finance/common/xss/XssValidator.java
finance-framework/pom.xml
finance-framework/src/main/java/com/finance/framework/aspectj/DataScopeAspect.java
finance-framework/src/main/java/com/finance/framework/aspectj/DataSourceAspect.java
finance-framework/src/main/java/com/finance/framework/aspectj/FinancialLogAspect.java
finance-framework/src/main/java/com/finance/framework/aspectj/LogAspect.java
finance-framework/src/main/java/com/finance/framework/aspectj/RateLimiterAspect.java
finance-framework/src/main/java/com/finance/framework/config/ApplicationConfig.java
finance-framework/src/main/java/com/finance/framework/config/CaptchaConfig.java
finance-framework/src/main/java/com/finance/framework/config/DruidConfig.java
finance-framework/src/main/java/com/finance/framework/config/FastJson2JsonRedisSerializer.java
finance-framework/src/main/java/com/finance/framework/config/FilterConfig.java
finance-framework/src/main/java/com/finance/framework/config/KaptchaTextCreator.java
finance-framework/src/main/java/com/finance/framework/config/MyBatisConfig.java
finance-framework/src/main/java/com/finance/framework/config/RedisConfig.java
finance-framework/src/main/java/com/finance/framework/config/ResourcesConfig.java
finance-framework/src/main/java/com/finance/framework/config/SecurityConfig.java
finance-framework/src/main/java/com/finance/framework/config/ServerConfig.java
finance-framework/src/main/java/com/finance/framework/config/ThreadPoolConfig.java
finance-framework/src/main/java/com/finance/framework/config/properties/DruidProperties.java
finance-framework/src/main/java/com/finance/framework/config/properties/PermitAllUrlProperties.java
finance-framework/src/main/java/com/finance/framework/datasource/DynamicDataSource.java
finance-framework/src/main/java/com/finance/framework/datasource/DynamicDataSourceContextHolder.java
finance-framework/src/main/java/com/finance/framework/interceptor/RepeatSubmitInterceptor.java
finance-framework/src/main/java/com/finance/framework/interceptor/impl/SameUrlDataInterceptor.java
finance-framework/src/main/java/com/finance/framework/manager/AsyncManager.java
finance-framework/src/main/java/com/finance/framework/manager/ShutdownManager.java
finance-framework/src/main/java/com/finance/framework/manager/factory/AsyncFactory.java
finance-framework/src/main/java/com/finance/framework/security/context/AuthenticationContextHolder.java
finance-framework/src/main/java/com/finance/framework/security/context/PermissionContextHolder.java
finance-framework/src/main/java/com/finance/framework/security/filter/JwtAuthenticationTokenFilter.java
finance-framework/src/main/java/com/finance/framework/security/handle/AuthenticationEntryPointImpl.java
finance-framework/src/main/java/com/finance/framework/security/handle/LogoutSuccessHandlerImpl.java
finance-framework/src/main/java/com/finance/framework/web/domain/Server.java
finance-framework/src/main/java/com/finance/framework/web/domain/server/Cpu.java
finance-framework/src/main/java/com/finance/framework/web/domain/server/Jvm.java
finance-framework/src/main/java/com/finance/framework/web/domain/server/Mem.java
finance-framework/src/main/java/com/finance/framework/web/domain/server/Sys.java
finance-framework/src/main/java/com/finance/framework/web/domain/server/SysFile.java
finance-framework/src/main/java/com/finance/framework/web/exception/GlobalExceptionHandler.java
finance-framework/src/main/java/com/finance/framework/web/service/PermissionService.java
finance-framework/src/main/java/com/finance/framework/web/service/SysLoginService.java
finance-framework/src/main/java/com/finance/framework/web/service/SysPasswordService.java
finance-framework/src/main/java/com/finance/framework/web/service/SysPermissionService.java
finance-framework/src/main/java/com/finance/framework/web/service/SysRegisterService.java
finance-framework/src/main/java/com/finance/framework/web/service/TokenService.java
finance-framework/src/main/java/com/finance/framework/web/service/UserDetailsServiceImpl.java
finance-generator/pom.xml
finance-generator/src/main/java/com/finance/generator/config/GenConfig.java
finance-generator/src/main/java/com/finance/generator/controller/GenController.java
finance-generator/src/main/java/com/finance/generator/domain/GenTable.java
finance-generator/src/main/java/com/finance/generator/domain/GenTableColumn.java
finance-generator/src/main/java/com/finance/generator/mapper/GenTableColumnMapper.java
finance-generator/src/main/java/com/finance/generator/mapper/GenTableMapper.java
finance-generator/src/main/java/com/finance/generator/service/GenTableColumnServiceImpl.java
finance-generator/src/main/java/com/finance/generator/service/GenTableServiceImpl.java
finance-generator/src/main/java/com/finance/generator/service/IGenTableColumnService.java
finance-generator/src/main/java/com/finance/generator/service/IGenTableService.java
finance-generator/src/main/java/com/finance/generator/util/GenUtils.java
finance-generator/src/main/java/com/finance/generator/util/VelocityInitializer.java
finance-generator/src/main/java/com/finance/generator/util/VelocityUtils.java
finance-generator/src/main/resources/generator.yml
finance-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml
finance-generator/src/main/resources/mapper/generator/GenTableMapper.xml
finance-generator/src/main/resources/vm/java/controller.java.vm
finance-generator/src/main/resources/vm/java/domain.java.vm
finance-generator/src/main/resources/vm/java/mapper.java.vm
finance-generator/src/main/resources/vm/java/service.java.vm
finance-generator/src/main/resources/vm/java/serviceImpl.java.vm
finance-generator/src/main/resources/vm/java/sub-domain.java.vm
finance-generator/src/main/resources/vm/js/api.js.vm
finance-generator/src/main/resources/vm/sql/sql.vm
finance-generator/src/main/resources/vm/vue/index-tree.vue.vm
finance-generator/src/main/resources/vm/vue/index.vue.vm
finance-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm
finance-generator/src/main/resources/vm/vue/v3/index.vue.vm
finance-generator/src/main/resources/vm/vue/v3/readme.txt
finance-generator/src/main/resources/vm/xml/mapper.xml.vm
finance-quartz/pom.xml
finance-quartz/src/main/java/com/finance/quartz/config/ScheduleConfig.java
finance-quartz/src/main/java/com/finance/quartz/controller/SysJobController.java
finance-quartz/src/main/java/com/finance/quartz/controller/SysJobLogController.java
finance-quartz/src/main/java/com/finance/quartz/domain/SysJob.java
finance-quartz/src/main/java/com/finance/quartz/domain/SysJobLog.java
finance-quartz/src/main/java/com/finance/quartz/mapper/SysJobLogMapper.java
finance-quartz/src/main/java/com/finance/quartz/mapper/SysJobMapper.java
finance-quartz/src/main/java/com/finance/quartz/service/ISysJobLogService.java
finance-quartz/src/main/java/com/finance/quartz/service/ISysJobService.java
finance-quartz/src/main/java/com/finance/quartz/service/impl/SysJobLogServiceImpl.java
finance-quartz/src/main/java/com/finance/quartz/service/impl/SysJobServiceImpl.java
finance-quartz/src/main/java/com/finance/quartz/task/RyTask.java
finance-quartz/src/main/java/com/finance/quartz/util/AbstractQuartzJob.java
finance-quartz/src/main/java/com/finance/quartz/util/CronUtils.java
finance-quartz/src/main/java/com/finance/quartz/util/JobInvokeUtil.java
finance-quartz/src/main/java/com/finance/quartz/util/QuartzDisallowConcurrentExecution.java
finance-quartz/src/main/java/com/finance/quartz/util/QuartzJobExecution.java
finance-quartz/src/main/java/com/finance/quartz/util/ScheduleUtils.java
finance-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml
finance-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml
finance-system/pom.xml
finance-system/src/main/java/com/finance/system/code/SubmitTemplateReg.java
finance-system/src/main/java/com/finance/system/domain/SysCache.java
finance-system/src/main/java/com/finance/system/domain/SysConfig.java
finance-system/src/main/java/com/finance/system/domain/SysLogininfor.java
finance-system/src/main/java/com/finance/system/domain/SysNotice.java
finance-system/src/main/java/com/finance/system/domain/SysOperLog.java
finance-system/src/main/java/com/finance/system/domain/SysPost.java
finance-system/src/main/java/com/finance/system/domain/SysRoleDept.java
finance-system/src/main/java/com/finance/system/domain/SysRoleMenu.java
finance-system/src/main/java/com/finance/system/domain/SysUserOnline.java
finance-system/src/main/java/com/finance/system/domain/SysUserPost.java
finance-system/src/main/java/com/finance/system/domain/SysUserRole.java
finance-system/src/main/java/com/finance/system/domain/TbBasicData.java
finance-system/src/main/java/com/finance/system/domain/TbBasicDataCategory.java
finance-system/src/main/java/com/finance/system/domain/TbBasicDataConfig.java
finance-system/src/main/java/com/finance/system/domain/TbBasicDataConfigDetail.java
finance-system/src/main/java/com/finance/system/domain/TbBasicDataField.java
finance-system/src/main/java/com/finance/system/domain/TbDataScreenConfig.java
finance-system/src/main/java/com/finance/system/domain/TbDataScreenScore.java
finance-system/src/main/java/com/finance/system/domain/TbDept.java
finance-system/src/main/java/com/finance/system/domain/TbField.java
finance-system/src/main/java/com/finance/system/domain/TbFieldCategory.java
finance-system/src/main/java/com/finance/system/domain/TbOperLog.java
finance-system/src/main/java/com/finance/system/domain/TbQuestion.java
finance-system/src/main/java/com/finance/system/domain/TbScore.java
finance-system/src/main/java/com/finance/system/domain/vo/MetaVo.java
finance-system/src/main/java/com/finance/system/domain/vo/RouterVo.java
finance-system/src/main/java/com/finance/system/dto/BasicDataCategoryDTO.java
finance-system/src/main/java/com/finance/system/dto/BasicDataConfigDTO.java
finance-system/src/main/java/com/finance/system/dto/BasicDataDTO.java
finance-system/src/main/java/com/finance/system/dto/BasicDataFieldDTO.java
finance-system/src/main/java/com/finance/system/dto/CalculateDTO.java
finance-system/src/main/java/com/finance/system/dto/CalculateItemDTO.java
finance-system/src/main/java/com/finance/system/dto/DataScreeningDTO.java
finance-system/src/main/java/com/finance/system/dto/FieldCategoryDTO.java
finance-system/src/main/java/com/finance/system/dto/FieldDTO.java
finance-system/src/main/java/com/finance/system/dto/QuestionDTO.java
finance-system/src/main/java/com/finance/system/dto/ShowHideDTO.java
finance-system/src/main/java/com/finance/system/dto/SysRoleDTO.java
finance-system/src/main/java/com/finance/system/dto/SysUserDTO.java
finance-system/src/main/java/com/finance/system/dto/SysUserUpdateStatusDTO.java
finance-system/src/main/java/com/finance/system/dto/update/BasicDataCategoryUpdateDTO.java
finance-system/src/main/java/com/finance/system/dto/update/BasicDataConfigUpdateDTO.java
finance-system/src/main/java/com/finance/system/dto/update/BasicDataUpdDTO.java
finance-system/src/main/java/com/finance/system/dto/update/DataIndicatorsUpdDTO.java
finance-system/src/main/java/com/finance/system/dto/update/DeptFocusDTO.java
finance-system/src/main/java/com/finance/system/dto/update/DeptUpdateDTO.java
finance-system/src/main/java/com/finance/system/dto/update/FieldCategoryUpdateDTO.java
finance-system/src/main/java/com/finance/system/dto/update/FieldUpdateDTO.java
finance-system/src/main/java/com/finance/system/dto/update/FormalIndicatorsUpdDTO.java
finance-system/src/main/java/com/finance/system/dto/update/QuestionUpdDTO.java
finance-system/src/main/java/com/finance/system/dto/update/RiskLevelUpdDTO.java
finance-system/src/main/java/com/finance/system/dto/update/SysUserPwdUpdDTO.java
finance-system/src/main/java/com/finance/system/dto/update/SysUserUpdDTO.java
finance-system/src/main/java/com/finance/system/export/OpticalInspectionExport.java
finance-system/src/main/java/com/finance/system/handler/CustomCellWriteHandler.java
finance-system/src/main/java/com/finance/system/handler/CustomerHandler.java
finance-system/src/main/java/com/finance/system/handler/DeptVerifyHandler.java
finance-system/src/main/java/com/finance/system/handler/SelectedSheetWriteHandler.java
finance-system/src/main/java/com/finance/system/handler/TitleHandler.java
finance-system/src/main/java/com/finance/system/importExcel/BasicDataExcel.java
finance-system/src/main/java/com/finance/system/importExcel/DeptExcel.java
finance-system/src/main/java/com/finance/system/importExcel/FieldExcel.java
finance-system/src/main/java/com/finance/system/importExcel/TCheckImportExcel.java
finance-system/src/main/java/com/finance/system/importExcel/TOperationsImportExcel.java
finance-system/src/main/java/com/finance/system/listener/BasicDataListener.java
finance-system/src/main/java/com/finance/system/listener/HistoryDataListener.java
finance-system/src/main/java/com/finance/system/mapper/SysConfigMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysDeptMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysDictDataMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysDictTypeMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysLogininforMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysMenuMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysNoticeMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysOperLogMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysPostMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysRoleDeptMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysRoleMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysRoleMenuMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysUserMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysUserPostMapper.java
finance-system/src/main/java/com/finance/system/mapper/SysUserRoleMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbBasicDataCategoryMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbBasicDataConfigDetailMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbBasicDataConfigMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbBasicDataFieldMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbBasicDataMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbDataScreenConfigMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbDataScreenScoreMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbDeptMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbFieldCategoryMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbFieldMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbOperLogMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbQuestionMapper.java
finance-system/src/main/java/com/finance/system/mapper/TbScoreMapper.java
finance-system/src/main/java/com/finance/system/query/BasicDataCategoryQuery.java
finance-system/src/main/java/com/finance/system/query/BasicDataConfigQuery.java
finance-system/src/main/java/com/finance/system/query/CalculateDetailQuery.java
finance-system/src/main/java/com/finance/system/query/CurrentFieldsQuery.java
finance-system/src/main/java/com/finance/system/query/DataScreenConfigQuery.java
finance-system/src/main/java/com/finance/system/query/DeptCalculateDetailQuery.java
finance-system/src/main/java/com/finance/system/query/DeptQuery.java
finance-system/src/main/java/com/finance/system/query/FieldCategoryQuery.java
finance-system/src/main/java/com/finance/system/query/FieldQuery.java
finance-system/src/main/java/com/finance/system/query/HistoryDataQuery.java
finance-system/src/main/java/com/finance/system/query/HistoryFieldsQuery.java
finance-system/src/main/java/com/finance/system/query/HistoryScoreQuery.java
finance-system/src/main/java/com/finance/system/query/OperLogQuery.java
finance-system/src/main/java/com/finance/system/query/QuestionQuery.java
finance-system/src/main/java/com/finance/system/query/ScoreCalculateDetailQuery.java
finance-system/src/main/java/com/finance/system/query/ScoreCalculateQuery.java
finance-system/src/main/java/com/finance/system/query/ScoreQuery.java
finance-system/src/main/java/com/finance/system/query/SysRoleQuery.java
finance-system/src/main/java/com/finance/system/query/SysUserQuery.java
finance-system/src/main/java/com/finance/system/query/TBannerQuery.java
finance-system/src/main/java/com/finance/system/query/TInformationQuery.java
finance-system/src/main/java/com/finance/system/query/TUserQuery.java
finance-system/src/main/java/com/finance/system/query/TVideoQuery.java
finance-system/src/main/java/com/finance/system/query/TVipPurchaseRecordQuery.java
finance-system/src/main/java/com/finance/system/query/TransferPaymentScaleQuery.java
finance-system/src/main/java/com/finance/system/service/ISysConfigService.java
finance-system/src/main/java/com/finance/system/service/ISysDeptService.java
finance-system/src/main/java/com/finance/system/service/ISysDictDataService.java
finance-system/src/main/java/com/finance/system/service/ISysDictTypeService.java
finance-system/src/main/java/com/finance/system/service/ISysLogininforService.java
finance-system/src/main/java/com/finance/system/service/ISysMenuService.java
finance-system/src/main/java/com/finance/system/service/ISysNoticeService.java
finance-system/src/main/java/com/finance/system/service/ISysOperLogService.java
finance-system/src/main/java/com/finance/system/service/ISysPostService.java
finance-system/src/main/java/com/finance/system/service/ISysRoleService.java
finance-system/src/main/java/com/finance/system/service/ISysUserOnlineService.java
finance-system/src/main/java/com/finance/system/service/ISysUserService.java
finance-system/src/main/java/com/finance/system/service/TbBasicDataCategoryService.java
finance-system/src/main/java/com/finance/system/service/TbBasicDataConfigDetailService.java
finance-system/src/main/java/com/finance/system/service/TbBasicDataConfigService.java
finance-system/src/main/java/com/finance/system/service/TbBasicDataFieldService.java
finance-system/src/main/java/com/finance/system/service/TbBasicDataService.java
finance-system/src/main/java/com/finance/system/service/TbDataScreenConfigService.java
finance-system/src/main/java/com/finance/system/service/TbDataScreenScoreService.java
finance-system/src/main/java/com/finance/system/service/TbDeptService.java
finance-system/src/main/java/com/finance/system/service/TbFieldCategoryService.java
finance-system/src/main/java/com/finance/system/service/TbFieldService.java
finance-system/src/main/java/com/finance/system/service/TbOperLogService.java
finance-system/src/main/java/com/finance/system/service/TbQuestionService.java
finance-system/src/main/java/com/finance/system/service/TbScoreService.java
finance-system/src/main/java/com/finance/system/service/impl/SysConfigServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysDeptServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysDictDataServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysDictTypeServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysLogininforServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysMenuServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysNoticeServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysOperLogServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysPostServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysRoleServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysUserOnlineServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/SysUserServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbBasicDataCategoryServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbBasicDataConfigDetailServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbBasicDataConfigServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbBasicDataFieldServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbBasicDataServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbDataScreenConfigServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbDataScreenScoreServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbDeptServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbFieldCategoryServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbFieldServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbOperLogServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbQuestionServiceImpl.java
finance-system/src/main/java/com/finance/system/service/impl/TbScoreServiceImpl.java
finance-system/src/main/java/com/finance/system/utils/FieldBuildUtil.java
finance-system/src/main/java/com/finance/system/vo/BasicDataCategoryVO.java
finance-system/src/main/java/com/finance/system/vo/BasicDataConfigDetailVO.java
finance-system/src/main/java/com/finance/system/vo/BasicDataConfigVO.java
finance-system/src/main/java/com/finance/system/vo/BasicDataFieldVO.java
finance-system/src/main/java/com/finance/system/vo/BasicDataReportingVO.java
finance-system/src/main/java/com/finance/system/vo/BasicDataVO.java
finance-system/src/main/java/com/finance/system/vo/CalculateVO.java
finance-system/src/main/java/com/finance/system/vo/CurrentFieldsAllVO.java
finance-system/src/main/java/com/finance/system/vo/CurrentFieldsDetailVO.java
finance-system/src/main/java/com/finance/system/vo/CurrentFieldsVO.java
finance-system/src/main/java/com/finance/system/vo/DataAnalysisVO.java
finance-system/src/main/java/com/finance/system/vo/DataScreenConfigVO.java
finance-system/src/main/java/com/finance/system/vo/DataScreenScoreVO.java
finance-system/src/main/java/com/finance/system/vo/DeptCalculateDetailVO.java
finance-system/src/main/java/com/finance/system/vo/DeptVO.java
finance-system/src/main/java/com/finance/system/vo/FieldAndScoreDataVO.java
finance-system/src/main/java/com/finance/system/vo/FieldCategoryDetailVO.java
finance-system/src/main/java/com/finance/system/vo/FieldCategoryVO.java
finance-system/src/main/java/com/finance/system/vo/FieldReportingVO.java
finance-system/src/main/java/com/finance/system/vo/FieldVO.java
finance-system/src/main/java/com/finance/system/vo/FieldsTreeVO.java
finance-system/src/main/java/com/finance/system/vo/OperLogVO.java
finance-system/src/main/java/com/finance/system/vo/ProvinceStaticsVO.java
finance-system/src/main/java/com/finance/system/vo/QuestionVO.java
finance-system/src/main/java/com/finance/system/vo/RiskAndTransferVO.java
finance-system/src/main/java/com/finance/system/vo/RiskCountVO.java
finance-system/src/main/java/com/finance/system/vo/RiskLevelVO.java
finance-system/src/main/java/com/finance/system/vo/RiskMapVO.java
finance-system/src/main/java/com/finance/system/vo/RiskRankingVO.java
finance-system/src/main/java/com/finance/system/vo/RoleInfoVO.java
finance-system/src/main/java/com/finance/system/vo/ScoreCalculateDetailVO.java
finance-system/src/main/java/com/finance/system/vo/ScoreCalculateVO.java
finance-system/src/main/java/com/finance/system/vo/ScoreDataVO.java
finance-system/src/main/java/com/finance/system/vo/ScoreDetailVO.java
finance-system/src/main/java/com/finance/system/vo/ScoreRankVO.java
finance-system/src/main/java/com/finance/system/vo/ScoreRateDataVO.java
finance-system/src/main/java/com/finance/system/vo/ScoreVO.java
finance-system/src/main/java/com/finance/system/vo/SysOperLogVO.java
finance-system/src/main/java/com/finance/system/vo/SysUserVO.java
finance-system/src/main/java/com/finance/system/vo/TransferPaymentScaleVO.java
finance-system/src/main/java/com/finance/system/vo/UserAddListVO.java
finance-system/src/main/java/com/finance/system/vo/UserInfoVo.java
finance-system/src/main/java/com/finance/system/vo/UserLevelVO.java
finance-system/src/main/resources/mapper/system/SysConfigMapper.xml
finance-system/src/main/resources/mapper/system/SysDeptMapper.xml
finance-system/src/main/resources/mapper/system/SysDictDataMapper.xml
finance-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
finance-system/src/main/resources/mapper/system/SysLogininforMapper.xml
finance-system/src/main/resources/mapper/system/SysMenuMapper.xml
finance-system/src/main/resources/mapper/system/SysNoticeMapper.xml
finance-system/src/main/resources/mapper/system/SysOperLogMapper.xml
finance-system/src/main/resources/mapper/system/SysPostMapper.xml
finance-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml
finance-system/src/main/resources/mapper/system/SysRoleMapper.xml
finance-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml
finance-system/src/main/resources/mapper/system/SysUserMapper.xml
finance-system/src/main/resources/mapper/system/SysUserPostMapper.xml
finance-system/src/main/resources/mapper/system/SysUserRoleMapper.xml
finance-system/src/main/resources/mapper/system/TbBasicDataCategoryMapper.xml
finance-system/src/main/resources/mapper/system/TbBasicDataConfigDetailMapper.xml
finance-system/src/main/resources/mapper/system/TbBasicDataConfigMapper.xml
finance-system/src/main/resources/mapper/system/TbBasicDataFieldMapper.xml
finance-system/src/main/resources/mapper/system/TbBasicDataMapper.xml
finance-system/src/main/resources/mapper/system/TbDataScreenConfigMapper.xml
finance-system/src/main/resources/mapper/system/TbDataScreenScoreMapper.xml
finance-system/src/main/resources/mapper/system/TbDeptMapper.xml
finance-system/src/main/resources/mapper/system/TbFieldCategoryMapper.xml
finance-system/src/main/resources/mapper/system/TbFieldMapper.xml
finance-system/src/main/resources/mapper/system/TbOperLogMapper.xml
finance-system/src/main/resources/mapper/system/TbQuestionMapper.xml
finance-system/src/main/resources/mapper/system/TbScoreMapper.xml
pom.xml
ruoyi-admin-dept/pom.xml (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/RuoYiAdminDeptApplication.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/RuoYiServletInitializer.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/api/CurrentQuarterController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/api/HistoryDataController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/common/CommonController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/interceptor/MybatisConfiguration.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/interceptor/MybatisInterceptor.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysPostController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/tool/BaiDuApi.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/tool/HttpClientUtil.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/tool/ImportExcelUtil.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/tool/MsgCodeUtil.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/tool/MsgUtils.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/tool/QRCodeUtil.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/tool/TaskUtil.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/controller/tool/TestController.java (deleted)
ruoyi-admin-dept/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java (deleted)
ruoyi-admin-dept/src/main/resources/application-dev.yml (deleted)
ruoyi-admin-dept/src/main/resources/application-prod.yml (deleted)
ruoyi-admin-dept/src/main/resources/application-test.yml (deleted)
ruoyi-admin-dept/src/main/resources/application.yml (deleted)
ruoyi-admin-dept/src/main/resources/banner.txt (deleted)
ruoyi-admin-dept/src/main/resources/logback.xml (deleted)
ruoyi-admin/pom.xml (deleted)
ruoyi-admin/src/main/java/com/ruoyi/RuoYiManageApplication.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/CurrentQuarterController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/HistoryDataController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbBasicDataCategoryController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbBasicDataConfigController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbBasicDataConfigDetailController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbBasicDataController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbBasicDataFieldController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbDataScreenConfigController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbDeptController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbFieldCategoryController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbFieldController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbOperLogController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbQuestionController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TbScoreController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/screen/ScreenGeneralController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/screen/ScreenInnerController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/conveter/CountyFlagConverter.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/excel/DeptExcel.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/interceptor/MybatisConfiguration.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/interceptor/MybatisInterceptor.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/lisenter/DeptImportListener.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/service/DepartmentRanking.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/service/ScreenService.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/BaiDuApi.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/HttpClientUtil.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/ImportExcelUtil.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/MsgCodeUtil.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/MsgUtils.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/QRCodeUtil.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TaskUtil.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java (deleted)
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java (deleted)
ruoyi-admin/src/main/resources/application-dev.yml (deleted)
ruoyi-admin/src/main/resources/application-prod.yml (deleted)
ruoyi-admin/src/main/resources/application-test.yml (deleted)
ruoyi-admin/src/main/resources/application.yml (deleted)
ruoyi-admin/src/main/resources/banner.txt (deleted)
ruoyi-admin/src/main/resources/logback.xml (deleted)
ruoyi-admin/src/test/java/com/ruoyi/RuoYiManageApplicationTest.java (deleted)
ruoyi-common/pom.xml (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Anonymous.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/annotation/FinancialLog.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/annotation/HistoryGroup.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/basic/PageDTO.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/basic/PageInfo.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/config/DataUpdateHandlerConfig.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/config/FileUploadConfig.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/config/MybatisPlusConfig.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/config/WxConfig.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/constant/WxConstant.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/FileController.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseModel.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BasePage.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/TimeRangeQueryBody.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/AreaLevelEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/CalculateTypeEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/DataScreenConfigEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/DisabledEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/FieldInputTypeEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/FieldTypeEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/LimitType.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/RedisKeys.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/ReportingStatusEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/RiskLevelEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/ShowStatusEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/SubTypeEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/UpdateTypeEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/UserTypeEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/enums/ValueTypeEnum.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/base/BaseException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/BlackListException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserNotExistsException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/filter/PropertyPreExcludeFilter.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/resp/AccessTokenRespBody.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/ArrayUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/BeanUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/CalculateUtil.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/Checker.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/CodeGenerateUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/CollUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/Convert.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/EasyExcelUtil.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/ExcelUtil.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/IDCardUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/NumberUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/ObjectUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/TimeConverter.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/VideoUtil.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/WebUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletTools.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/xss/Xss.java (deleted)
ruoyi-common/src/main/java/com/ruoyi/common/xss/XssValidator.java (deleted)
ruoyi-framework/pom.xml (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/FinancialLogAspect.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/PermitAllUrlProperties.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/AuthenticationContextHolder.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/PermissionContextHolder.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPasswordService.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java (deleted)
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java (deleted)
ruoyi-generator/pom.xml (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java (deleted)
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java (deleted)
ruoyi-generator/src/main/resources/generator.yml (deleted)
ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml (deleted)
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml (deleted)
ruoyi-generator/src/main/resources/vm/java/controller.java.vm (deleted)
ruoyi-generator/src/main/resources/vm/java/domain.java.vm (deleted)
ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm (deleted)
ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm (deleted)
ruoyi-quartz/pom.xml (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java (deleted)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java (deleted)
ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml (deleted)
ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml (deleted)
ruoyi-system/pom.xml (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/code/SubmitTemplateReg.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbBasicData.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbBasicDataCategory.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbBasicDataConfig.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbBasicDataConfigDetail.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbBasicDataField.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbDataScreenConfig.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbDataScreenScore.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbDept.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbField.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbFieldCategory.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbOperLog.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbQuestion.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/TbScore.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/BasicDataCategoryDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/BasicDataConfigDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/BasicDataDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/BasicDataFieldDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/CalculateDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/CalculateItemDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/DataScreeningDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/FieldCategoryDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/FieldDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/QuestionDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/ShowHideDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/SysRoleDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/SysUserDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/SysUserUpdateStatusDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/BasicDataCategoryUpdateDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/BasicDataConfigUpdateDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/BasicDataUpdDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/DataIndicatorsUpdDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/DeptFocusDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/DeptUpdateDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/FieldCategoryUpdateDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/FieldUpdateDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/FormalIndicatorsUpdDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/QuestionUpdDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/RiskLevelUpdDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/SysUserPwdUpdDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/dto/update/SysUserUpdDTO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/export/OpticalInspectionExport.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/handler/CustomCellWriteHandler.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/handler/CustomerHandler.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/handler/DeptVerifyHandler.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/handler/SelectedSheetWriteHandler.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/handler/TitleHandler.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/importExcel/BasicDataExcel.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/importExcel/DeptExcel.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/importExcel/FieldExcel.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/importExcel/TCheckImportExcel.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/importExcel/TOperationsImportExcel.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/listener/BasicDataListener.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/listener/HistoryDataListener.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbBasicDataCategoryMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbBasicDataConfigDetailMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbBasicDataConfigMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbBasicDataFieldMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbBasicDataMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbDataScreenConfigMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbDataScreenScoreMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbDeptMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbFieldCategoryMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbFieldMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbOperLogMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbQuestionMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TbScoreMapper.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/BasicDataCategoryQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/BasicDataConfigQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/CalculateDetailQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/CurrentFieldsQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/DataScreenConfigQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/DeptCalculateDetailQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/DeptQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/FieldCategoryQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/FieldQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/HistoryDataQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/HistoryFieldsQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/HistoryScoreQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/OperLogQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/QuestionQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/ScoreCalculateDetailQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/ScoreCalculateQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/ScoreQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/SysRoleQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/SysUserQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/TBannerQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/TInformationQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/TUserQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/TVideoQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/TVipPurchaseRecordQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/query/TransferPaymentScaleQuery.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbBasicDataCategoryService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbBasicDataConfigDetailService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbBasicDataConfigService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbBasicDataFieldService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbBasicDataService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbDataScreenConfigService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbDataScreenScoreService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbDeptService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbFieldCategoryService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbFieldService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbOperLogService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbQuestionService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/TbScoreService.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbBasicDataCategoryServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbBasicDataConfigDetailServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbBasicDataConfigServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbBasicDataFieldServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbBasicDataServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbDataScreenConfigServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbDataScreenScoreServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbDeptServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbFieldCategoryServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbFieldServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbOperLogServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbQuestionServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TbScoreServiceImpl.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/utils/FieldBuildUtil.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/BasicDataCategoryVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/BasicDataConfigDetailVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/BasicDataConfigVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/BasicDataFieldVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/BasicDataReportingVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/BasicDataVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/CalculateVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/CurrentFieldsAllVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/CurrentFieldsDetailVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/CurrentFieldsVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/DataAnalysisVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/DataScreenConfigVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/DataScreenScoreVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/DeptCalculateDetailVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/DeptVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/FieldAndScoreDataVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/FieldCategoryDetailVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/FieldCategoryVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/FieldReportingVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/FieldVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/FieldsTreeVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/OperLogVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/ProvinceStaticsVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/QuestionVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/RiskAndTransferVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/RiskCountVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/RiskLevelVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/RiskMapVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/RiskRankingVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/RoleInfoVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScoreCalculateDetailVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScoreCalculateVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScoreDataVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScoreDetailVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScoreRankVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScoreRateDataVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/ScoreVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/SysOperLogVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/SysUserVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/TransferPaymentScaleVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/UserAddListVO.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/UserInfoVo.java (deleted)
ruoyi-system/src/main/java/com/ruoyi/system/vo/UserLevelVO.java (deleted)
ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbBasicDataCategoryMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbBasicDataConfigDetailMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbBasicDataConfigMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbBasicDataFieldMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbBasicDataMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbDataScreenConfigMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbDataScreenScoreMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbDeptMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbFieldCategoryMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbFieldMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbOperLogMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbQuestionMapper.xml (deleted)
ruoyi-system/src/main/resources/mapper/system/TbScoreMapper.xml (deleted) |