commit
1e73fa59db
721 changed files with 78469 additions and 0 deletions
-
18.editorconfig
-
46.gitignore
-
2README.md
-
117cas-admin/pom.xml
-
30cas-admin/src/main/java/com/inscloudtech/CasApplication.java
-
18cas-admin/src/main/java/com/inscloudtech/CasServletInitializer.java
-
88cas-admin/src/main/java/com/inscloudtech/web/controller/analysiscenter/AnalysisReportController.java
-
98cas-admin/src/main/java/com/inscloudtech/web/controller/analysiscenter/AnalysisResultController.java
-
192cas-admin/src/main/java/com/inscloudtech/web/controller/analysiscenter/PlateNumberInfoController.java
-
134cas-admin/src/main/java/com/inscloudtech/web/controller/common/CaptchaController.java
-
399cas-admin/src/main/java/com/inscloudtech/web/controller/datacenter/BankController.java
-
191cas-admin/src/main/java/com/inscloudtech/web/controller/datacenter/CarInfoController.java
-
148cas-admin/src/main/java/com/inscloudtech/web/controller/datacenter/OtherAssetsController.java
-
148cas-admin/src/main/java/com/inscloudtech/web/controller/datacenter/OtherInformationController.java
-
203cas-admin/src/main/java/com/inscloudtech/web/controller/datacenter/PublicFamilyController.java
-
316cas-admin/src/main/java/com/inscloudtech/web/controller/index/LeaderTaskController.java
-
161cas-admin/src/main/java/com/inscloudtech/web/controller/monitor/CacheController.java
-
84cas-admin/src/main/java/com/inscloudtech/web/controller/monitor/SysLogininforController.java
-
101cas-admin/src/main/java/com/inscloudtech/web/controller/monitor/SysOperUpdateLogController.java
-
70cas-admin/src/main/java/com/inscloudtech/web/controller/monitor/SysOperlogController.java
-
88cas-admin/src/main/java/com/inscloudtech/web/controller/monitor/SysUserOnlineController.java
-
128cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysConfigController.java
-
116cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysDeptController.java
-
107cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysDictDataController.java
-
119cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysDictTypeController.java
-
27cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysIndexController.java
-
155cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysLoginController.java
-
120cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysMenuController.java
-
75cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysNoticeController.java
-
144cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysNotifyMessageController.java
-
111cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysNotifyTemplateController.java
-
107cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysOssController.java
-
108cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysPostController.java
-
138cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysProfileController.java
-
39cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysRegisterController.java
-
214cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysRoleController.java
-
240cas-admin/src/main/java/com/inscloudtech/web/controller/system/SysUserController.java
-
87cas-admin/src/main/resources/application-dev.yml
-
96cas-admin/src/main/resources/application-prod.yml
-
281cas-admin/src/main/resources/application.yml
-
2cas-admin/src/main/resources/banner.txt
-
49cas-admin/src/main/resources/i18n/messages.properties
-
49cas-admin/src/main/resources/i18n/messages_en_US.properties
-
49cas-admin/src/main/resources/i18n/messages_zh_CN.properties
-
BINcas-admin/src/main/resources/ip2region.xdb
-
129cas-admin/src/main/resources/logback-plus.xml
-
28cas-admin/src/main/resources/spy.properties
-
206cas-common/pom.xml
-
24cas-common/src/main/java/com/inscloudtech/common/annotation/CellMerge.java
-
26cas-common/src/main/java/com/inscloudtech/common/annotation/DataColumn.java
-
18cas-common/src/main/java/com/inscloudtech/common/annotation/DataPermission.java
-
24cas-common/src/main/java/com/inscloudtech/common/annotation/DeduplicationField.java
-
28cas-common/src/main/java/com/inscloudtech/common/annotation/DictDataMapper.java
-
39cas-common/src/main/java/com/inscloudtech/common/annotation/EncryptField.java
-
29cas-common/src/main/java/com/inscloudtech/common/annotation/ExcelDictFormat.java
-
27cas-common/src/main/java/com/inscloudtech/common/annotation/ExcelEnumFormat.java
-
24cas-common/src/main/java/com/inscloudtech/common/annotation/IdCardField.java
-
41cas-common/src/main/java/com/inscloudtech/common/annotation/Log.java
-
24cas-common/src/main/java/com/inscloudtech/common/annotation/NameField.java
-
24cas-common/src/main/java/com/inscloudtech/common/annotation/PhoneField.java
-
36cas-common/src/main/java/com/inscloudtech/common/annotation/RateLimiter.java
-
27cas-common/src/main/java/com/inscloudtech/common/annotation/RepeatSubmit.java
-
24cas-common/src/main/java/com/inscloudtech/common/annotation/Sensitive.java
-
36cas-common/src/main/java/com/inscloudtech/common/annotation/Translation.java
-
20cas-common/src/main/java/com/inscloudtech/common/annotation/TranslationType.java
-
54cas-common/src/main/java/com/inscloudtech/common/annotation/UpdateLog.java
-
23cas-common/src/main/java/com/inscloudtech/common/annotation/UpdateValueLog.java
-
80cas-common/src/main/java/com/inscloudtech/common/captcha/UnsignedMathGenerator.java
-
130cas-common/src/main/java/com/inscloudtech/common/config/ProjectConfig.java
-
34cas-common/src/main/java/com/inscloudtech/common/constant/BankStatementConstants.java
-
37cas-common/src/main/java/com/inscloudtech/common/constant/CacheConstants.java
-
57cas-common/src/main/java/com/inscloudtech/common/constant/CacheNames.java
-
12cas-common/src/main/java/com/inscloudtech/common/constant/CompanyConfig.java
-
670cas-common/src/main/java/com/inscloudtech/common/constant/Constants.java
-
157cas-common/src/main/java/com/inscloudtech/common/constant/GenConstants.java
-
76cas-common/src/main/java/com/inscloudtech/common/constant/HttpStatus.java
-
28cas-common/src/main/java/com/inscloudtech/common/constant/TransConstant.java
-
108cas-common/src/main/java/com/inscloudtech/common/constant/UserConstants.java
-
52cas-common/src/main/java/com/inscloudtech/common/convert/ExcelBigNumberConvert.java
-
73cas-common/src/main/java/com/inscloudtech/common/convert/ExcelDictConvert.java
-
75cas-common/src/main/java/com/inscloudtech/common/convert/ExcelEnumConvert.java
-
62cas-common/src/main/java/com/inscloudtech/common/core/controller/BaseController.java
-
83cas-common/src/main/java/com/inscloudtech/common/core/domain/BaseEntity.java
-
48cas-common/src/main/java/com/inscloudtech/common/core/domain/ExportBaseEntity.java
-
105cas-common/src/main/java/com/inscloudtech/common/core/domain/PageQuery.java
-
103cas-common/src/main/java/com/inscloudtech/common/core/domain/R.java
-
36cas-common/src/main/java/com/inscloudtech/common/core/domain/TreeEntity.java
-
34cas-common/src/main/java/com/inscloudtech/common/core/domain/dto/RoleDTO.java
-
52cas-common/src/main/java/com/inscloudtech/common/core/domain/dto/UserOnlineDTO.java
-
110cas-common/src/main/java/com/inscloudtech/common/core/domain/entity/SysDept.java
-
109cas-common/src/main/java/com/inscloudtech/common/core/domain/entity/SysDictData.java
-
74cas-common/src/main/java/com/inscloudtech/common/core/domain/entity/SysDictType.java
-
90cas-common/src/main/java/com/inscloudtech/common/core/domain/entity/SysMenu.java
-
124cas-common/src/main/java/com/inscloudtech/common/core/domain/entity/SysRole.java
-
172cas-common/src/main/java/com/inscloudtech/common/core/domain/entity/SysUser.java
-
39cas-common/src/main/java/com/inscloudtech/common/core/domain/event/LogininforEvent.java
-
100cas-common/src/main/java/com/inscloudtech/common/core/domain/event/OperLogEvent.java
-
28cas-common/src/main/java/com/inscloudtech/common/core/domain/model/EmailLoginBody.java
-
42cas-common/src/main/java/com/inscloudtech/common/core/domain/model/LoginBody.java
-
109cas-common/src/main/java/com/inscloudtech/common/core/domain/model/LoginUser.java
@ -0,0 +1,18 @@ |
|||
# http://editorconfig.org |
|||
root = true |
|||
|
|||
# 空格替代Tab缩进在各种编辑工具下效果一致 |
|||
[*] |
|||
indent_style = space |
|||
indent_size = 4 |
|||
charset = utf-8 |
|||
end_of_line = lf |
|||
trim_trailing_whitespace = true |
|||
insert_final_newline = true |
|||
|
|||
[*.{json,yml,yaml}] |
|||
indent_size = 2 |
|||
|
|||
[*.md] |
|||
insert_final_newline = false |
|||
trim_trailing_whitespace = false |
@ -0,0 +1,46 @@ |
|||
###################################################################### |
|||
# Build Tools |
|||
|
|||
.gradle |
|||
/build/ |
|||
!gradle/wrapper/gradle-wrapper.jar |
|||
|
|||
target/ |
|||
!.mvn/wrapper/maven-wrapper.jar |
|||
|
|||
###################################################################### |
|||
# IDE |
|||
|
|||
### STS ### |
|||
.apt_generated |
|||
.classpath |
|||
.factorypath |
|||
.project |
|||
.settings |
|||
.springBeans |
|||
|
|||
### IntelliJ IDEA ### |
|||
.idea |
|||
*.iws |
|||
*.iml |
|||
*.ipr |
|||
|
|||
### JRebel ### |
|||
rebel.xml |
|||
|
|||
### NetBeans ### |
|||
nbproject/private/ |
|||
build/* |
|||
nbbuild/ |
|||
nbdist/ |
|||
.nb-gradle/ |
|||
|
|||
###################################################################### |
|||
# Others |
|||
*.log |
|||
*.xml.versionsBackup |
|||
*.swp |
|||
|
|||
!*/build/*.java |
|||
!*/build/*.html |
|||
!*/build/*.xml |
@ -0,0 +1,2 @@ |
|||
|
|||
|
@ -0,0 +1,117 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<parent> |
|||
<artifactId>cas-server</artifactId> |
|||
<groupId>com.inscloudtech</groupId> |
|||
<version>4.7.0</version> |
|||
</parent> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<packaging>jar</packaging> |
|||
<artifactId>cas-admin</artifactId> |
|||
|
|||
<description> |
|||
web服务入口 |
|||
</description> |
|||
|
|||
<dependencies> |
|||
|
|||
<!-- spring-boot-devtools --> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-devtools</artifactId> |
|||
<optional>true</optional> <!-- 表示依赖不会传递 --> |
|||
</dependency> |
|||
|
|||
<!-- Mysql驱动包 --> |
|||
<dependency> |
|||
<groupId>com.mysql</groupId> |
|||
<artifactId>mysql-connector-j</artifactId> |
|||
</dependency> |
|||
<!-- SqlServer --> |
|||
<dependency> |
|||
<groupId>com.microsoft.sqlserver</groupId> |
|||
<artifactId>mssql-jdbc</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- 核心模块--> |
|||
<dependency> |
|||
<groupId>com.inscloudtech</groupId> |
|||
<artifactId>cas-framework</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.inscloudtech</groupId> |
|||
<artifactId>cas-system</artifactId> |
|||
</dependency> |
|||
<!-- 代码生成--> |
|||
<dependency> |
|||
<groupId>com.inscloudtech</groupId> |
|||
<artifactId>cas-generator</artifactId> |
|||
</dependency> |
|||
|
|||
|
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-test</artifactId> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
|
|||
|
|||
|
|||
</dependencies> |
|||
|
|||
<build> |
|||
<finalName>${project.artifactId}</finalName> |
|||
<plugins> |
|||
<plugin> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-maven-plugin</artifactId> |
|||
<version>${spring-boot.version}</version> |
|||
<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.2.2</version> |
|||
<configuration> |
|||
<failOnMissingWebXml>false</failOnMissingWebXml> |
|||
<warName>${project.artifactId}</warName> |
|||
</configuration> |
|||
</plugin> |
|||
|
|||
<plugin> |
|||
<groupId>net.roseboy</groupId> |
|||
<artifactId>classfinal-maven-plugin</artifactId> |
|||
<version>1.2.1</version> |
|||
<configuration> |
|||
<password>#</password><!-- #表示启动时不需要密码,事实上对于代码混淆来说,这个密码没什么用,它只是一个启动密码 --> |
|||
<excludes>org.spring</excludes> |
|||
<packages>com.inscloudtech</packages><!-- 加密的包名,多个包用逗号分开 --> |
|||
<cfgfiles>application.yml,application-dev.yml,application-prod.yml,application-soft.yml</cfgfiles> |
|||
<libjars>cas-system-4.7.0.jar</libjars><!-- jar包lib下面要加密的jar依赖文件,多个包用逗号分开 --> |
|||
<!-- <code>78828431441AC7E1D92FC694D6886239D41D8CD98F00B204E9800998ECF8427ED41D8CD98F00B204E9800998ECF8427E</code> <!– 指定机器启动,机器码 –>--> |
|||
</configuration> |
|||
<executions> |
|||
<execution> |
|||
<phase>package</phase> |
|||
<goals> |
|||
<goal>classFinal</goal> |
|||
</goals> |
|||
</execution> |
|||
</executions> |
|||
</plugin> |
|||
</plugins> |
|||
</build> |
|||
|
|||
</project> |
@ -0,0 +1,30 @@ |
|||
package com.inscloudtech; |
|||
|
|||
import org.dromara.easyes.starter.register.EsMapperScan; |
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; |
|||
import org.springframework.context.annotation.EnableAspectJAutoProxy; |
|||
import org.springframework.scheduling.annotation.EnableScheduling; |
|||
|
|||
/** |
|||
* 启动程序 |
|||
* |
|||
* @author |
|||
*/ |
|||
|
|||
@EsMapperScan("com.inscloudtech.*.mapper") |
|||
@SpringBootApplication(scanBasePackages = {"com.inscloudtech"}) |
|||
@EnableAspectJAutoProxy(exposeProxy = true, proxyTargetClass = true) |
|||
@EnableScheduling |
|||
public class CasApplication { |
|||
|
|||
public static void main(String[] args) { |
|||
System.setProperty("spring.devtools.restart.enabled", "false"); |
|||
SpringApplication application = new SpringApplication(CasApplication.class); |
|||
application.setApplicationStartup(new BufferingApplicationStartup(2048)); |
|||
application.run(args); |
|||
System.out.println(">>>cas服务启动成功<<<"); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.inscloudtech; |
|||
|
|||
import org.springframework.boot.builder.SpringApplicationBuilder; |
|||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
|||
|
|||
/** |
|||
* web容器中进行部署 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
public class CasServletInitializer extends SpringBootServletInitializer { |
|||
|
|||
@Override |
|||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { |
|||
return application.sources(CasApplication.class); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,88 @@ |
|||
package com.inscloudtech.web.controller.analysiscenter; |
|||
|
|||
import com.inscloudtech.analysiscenter.domain.AnalysisDto; |
|||
import com.inscloudtech.analysiscenter.domain.AnalysisReport; |
|||
import com.inscloudtech.analysiscenter.mapper.AnalysisReportMapper; |
|||
import com.inscloudtech.analysiscenter.service.IAnalysisReportService; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.RepeatSubmit; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.IOException; |
|||
import java.util.Arrays; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 分析中心-分析报告对象 |
|||
* |
|||
* @author inscloudtech |
|||
* @date 2023-11-10 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/ac/analysisReport") |
|||
public class AnalysisReportController extends BaseController { |
|||
|
|||
private final IAnalysisReportService iAnalysisReportService; |
|||
|
|||
//"OSS对象word格式转化为pdf格式") |
|||
@GetMapping("/download/{ossId}") |
|||
public void wordToPdf(@PathVariable String ossId, HttpServletResponse response) throws IOException { |
|||
iAnalysisReportService.download(ossId, response); |
|||
} |
|||
|
|||
//"查询分析报告对象列表") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<AnalysisReport> list(AnalysisReport bo, PageQuery pageQuery) { |
|||
return iAnalysisReportService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
//"获取分析报告对象") |
|||
@GetMapping("/{id}") |
|||
public R<AnalysisReport> getInfo(@NotNull(message = "主键不能为空") @PathVariable String id) { |
|||
return R.ok(iAnalysisReportService.queryById(id)); |
|||
} |
|||
|
|||
//"新增分析报告对象") |
|||
@Log(title = "分析报告对象", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R add(@RequestBody AnalysisReport bo) { |
|||
bo.setCreateBy(getUsername()); |
|||
bo.setCreateTime(new Date()); |
|||
iAnalysisReportService.insert(bo); |
|||
return R.ok("分析报告生成成功",bo); |
|||
} |
|||
|
|||
//"修改分析报告对象") |
|||
@UpdateLog(title = "分析报告对象", mapperClass = AnalysisReportMapper.class, businessType = BusinessType.UPDATE) |
|||
@PutMapping() |
|||
public R edit(@RequestBody AnalysisReport bo) { |
|||
return R.ok(iAnalysisReportService.update(bo)); |
|||
} |
|||
|
|||
//"删除分析报告对象") |
|||
@Log(title = "分析报告对象", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ids) { |
|||
return R.ok(iAnalysisReportService.deleteWithValidByIds(Arrays.asList(ids))); |
|||
} |
|||
|
|||
//"保存至分析成果") |
|||
@PostMapping("/save2AnalysisResult") |
|||
public R save2AnalysisResult(@RequestBody AnalysisDto dto) { |
|||
iAnalysisReportService.save2AnalysisResult(dto); |
|||
return R.ok(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,98 @@ |
|||
package com.inscloudtech.web.controller.analysiscenter; |
|||
|
|||
import com.inscloudtech.analysiscenter.domain.AnalysisResult; |
|||
import com.inscloudtech.analysiscenter.mapper.AnalysisResultMapper; |
|||
import com.inscloudtech.analysiscenter.service.IAnalysisResultService; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.RepeatSubmit; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.datacenter.service.QueryCenterService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.Arrays; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 分析中心-分析成果对象 |
|||
* |
|||
* @author inscloudtech |
|||
* @date 2023-11-10 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/ac/analysisResult") |
|||
public class AnalysisResultController extends BaseController { |
|||
|
|||
private final IAnalysisResultService iAnalysisResultService; |
|||
|
|||
private final QueryCenterService queryCenterService; |
|||
|
|||
//"查询分析成果对象列表") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<AnalysisResult> list(AnalysisResult bo, PageQuery pageQuery) { |
|||
return iAnalysisResultService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
|
|||
//"获取分析成果对象") |
|||
@GetMapping("/{id}") |
|||
public R<AnalysisResult> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(iAnalysisResultService.queryById(id)); |
|||
} |
|||
|
|||
|
|||
//"新增分析成果对象") |
|||
@Log(title = "分析成果对象", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R add( @RequestBody AnalysisResult bo) { |
|||
bo.setCreateBy(getUsername()); |
|||
bo.setCreateTime(new Date()); |
|||
iAnalysisResultService.insert(bo); |
|||
return R.ok(bo.getId()); |
|||
} |
|||
|
|||
|
|||
//"修改分析成果对象") |
|||
@UpdateLog(title = "分析成果对象",mapperClass = AnalysisResultMapper.class, businessType = BusinessType.UPDATE) |
|||
@PutMapping() |
|||
public R edit(@RequestBody AnalysisResult bo) { |
|||
return R.ok(iAnalysisResultService.update(bo)); |
|||
} |
|||
|
|||
//"删除分析成果对象") |
|||
@Log(title = "分析成果对象", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return R.ok(iAnalysisResultService.deleteWithValidByIds(Arrays.asList(ids))); |
|||
} |
|||
|
|||
|
|||
//"下载分析成果对象") |
|||
@PostMapping("/export") |
|||
public void export(AnalysisResult bo, HttpServletResponse response) { |
|||
queryCenterService.excelExport(response,bo); |
|||
} |
|||
|
|||
//"导入分析成果对象") |
|||
@PostMapping(value = "/import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R importData(@RequestPart("file") MultipartFile file, String caseId, String analysisResultId) { |
|||
iAnalysisResultService.importData(file,caseId,analysisResultId); |
|||
return R.ok(); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,192 @@ |
|||
package com.inscloudtech.web.controller.analysiscenter; |
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import com.inscloudtech.analysiscenter.domain.AnalysisDto; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.excel.ExcelResult; |
|||
import com.inscloudtech.common.utils.BeanCopyUtils; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.datacenter.domain.PlateNumberInfo; |
|||
import com.inscloudtech.datacenter.mapper.es.PlateNumberEsMapper; |
|||
import com.inscloudtech.system.service.ISysOssService; |
|||
import com.inscloudtech.datacenter.service.PlateNumberService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.*; |
|||
|
|||
/** |
|||
* 车牌抓取 |
|||
* |
|||
* @author inscloudtech |
|||
* @date 2023-11-10 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/ac/plateNumberInfo") |
|||
public class PlateNumberInfoController extends BaseController { |
|||
|
|||
private final PlateNumberService iPlateNumberInfoService; |
|||
|
|||
private final ISysOssService iSysOssService; |
|||
|
|||
//"保存至分析成果") |
|||
@PostMapping("/save2AnalysisResult") |
|||
public R save2AnalysisResult(@RequestBody AnalysisDto dto) { |
|||
iPlateNumberInfoService.save2AnalysisResult(dto); |
|||
return R.ok(); |
|||
} |
|||
|
|||
/** |
|||
* 查询车牌抓取列表 |
|||
*/ |
|||
//"查询车牌抓取列表") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PlateNumberInfo> list(PlateNumberInfo bo, PageQuery pageQuery) { |
|||
return iPlateNumberInfoService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 获取车牌抓取详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
//"获取车牌抓取") |
|||
@GetMapping("/{id}") |
|||
public R<PlateNumberInfo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(iPlateNumberInfoService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增车牌抓取 |
|||
*/ |
|||
//"新增车牌抓取") |
|||
@Log(title = "车牌抓取", businessType = BusinessType.INSERT) |
|||
@PostMapping() |
|||
public R add( @RequestBody PlateNumberInfo bo) { |
|||
bo.setCreateBy(getUsername()); |
|||
return R.ok(iPlateNumberInfoService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改车牌抓取 |
|||
*/ |
|||
//"修改车牌抓取") |
|||
@UpdateLog(title = "车牌抓取",mapperClass = PlateNumberEsMapper.class, businessType = BusinessType.UPDATE) |
|||
@PutMapping() |
|||
public R edit(@RequestBody PlateNumberInfo bo) { |
|||
return R.ok(iPlateNumberInfoService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除车牌抓取 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
//"删除车牌抓取") |
|||
@Log(title = "车牌抓取", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return R.ok(iPlateNumberInfoService.deleteWithValidByIds(Arrays.asList(ids), true)); |
|||
} |
|||
|
|||
//"批量修改车牌抓取") |
|||
@PutMapping("/updateBatch") |
|||
public R updateBatch(@RequestBody PlateNumberInfo bo) { |
|||
List<String> ids = bo.getIds(); |
|||
List<PlateNumberInfo> list = new ArrayList<>(); |
|||
ids.stream().forEach(id ->{ |
|||
PlateNumberInfo update = BeanCopyUtils.copy(bo,PlateNumberInfo.class); |
|||
update.setId(id); |
|||
update.setUpdateBy(getUsername()); |
|||
update.setUpdateTime(new Date()); |
|||
list.add(update); |
|||
}); |
|||
return R.ok(iPlateNumberInfoService.updateBatch(list)); |
|||
} |
|||
|
|||
//"批量修改车牌抓取对象集合") |
|||
@PutMapping("/updateBatchByList") |
|||
public R updateBatch(@RequestBody List<PlateNumberInfo> list) { |
|||
list.stream().forEach(update ->{ |
|||
update.setUpdateBy(getUsername()); |
|||
update.setUpdateTime(new Date()); |
|||
}); |
|||
return R.ok(iPlateNumberInfoService.updateBatch(list)); |
|||
} |
|||
|
|||
//"导入车牌抓取") |
|||
@PostMapping(value = "/import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R importData(@RequestPart("file") MultipartFile file, String caseId) { |
|||
boolean result = false; |
|||
String importResultStr = ""; |
|||
int importCount = 0; |
|||
try { |
|||
ExcelResult<PlateNumberInfo> excelResult = ExcelUtil.importExcel(file.getInputStream(), PlateNumberInfo.class, true); |
|||
List<PlateNumberInfo> list = excelResult.getList(); |
|||
if(CollectionUtil.isNotEmpty(list)){ |
|||
list = iPlateNumberInfoService.dataTrimAndDeduplication(list,caseId,getUsername()); |
|||
result = iPlateNumberInfoService.importData(list,caseId,null); |
|||
importCount = list.size(); |
|||
}else { |
|||
throw new RuntimeException("未解析到数据!"); |
|||
} |
|||
}catch (Exception e){ |
|||
importResultStr = e.getMessage(); |
|||
} |
|||
iSysOssService.upload2Local(importCount,importResultStr,file,caseId,"PLATE_NUMBER_INFO"); |
|||
return result ? R.ok() : R.fail(importResultStr); |
|||
} |
|||
|
|||
//"分析成果-车牌抓取导入") |
|||
@PostMapping(value = "/import4AnalysisResult", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R importAnalysisResult(@RequestPart("file") MultipartFile file, String caseId, String analysisResultId) { |
|||
boolean result = false; |
|||
String importResultStr = ""; |
|||
int importCount = 0; |
|||
try { |
|||
ExcelResult<PlateNumberInfo> excelResult = ExcelUtil.importExcel(file.getInputStream(), PlateNumberInfo.class, true); |
|||
List<PlateNumberInfo> list = excelResult.getList(); |
|||
if(CollectionUtil.isNotEmpty(list)){ |
|||
result = iPlateNumberInfoService.importAnalysisResult(list,analysisResultId,getUsername()); |
|||
importCount = list.size(); |
|||
}else { |
|||
throw new RuntimeException("未解析到数据!"); |
|||
} |
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
importResultStr = e.getMessage(); |
|||
} |
|||
|
|||
iSysOssService.upload2Local(importCount,importResultStr,file,caseId,"ANALYSIS_RESULT"); |
|||
return result ? R.ok() : R.fail(importResultStr); |
|||
} |
|||
|
|||
/** |
|||
* 导出交易对象列表 |
|||
*/ |
|||
//"导出车牌抓取") |
|||
@PostMapping("/export") |
|||
public void export(PlateNumberInfo bo, HttpServletResponse response) { |
|||
List<PlateNumberInfo> list = Collections.EMPTY_LIST; |
|||
if(bo.getDownloadTemplate() == null){ |
|||
list = iPlateNumberInfoService.queryList(bo); |
|||
} |
|||
ExcelUtil.exportExcel(list, "车牌抓取", PlateNumberInfo.class, response); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,134 @@ |
|||
package com.inscloudtech.web.controller.common; |
|||
|
|||
import cn.dev33.satoken.annotation.SaIgnore; |
|||
import cn.hutool.captcha.AbstractCaptcha; |
|||
import cn.hutool.captcha.generator.CodeGenerator; |
|||
import cn.hutool.core.util.IdUtil; |
|||
import cn.hutool.core.util.RandomUtil; |
|||
import com.inscloudtech.common.constant.CacheConstants; |
|||
import com.inscloudtech.common.constant.Constants; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.enums.CaptchaType; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
import com.inscloudtech.common.utils.email.MailUtils; |
|||
import com.inscloudtech.common.utils.redis.RedisUtils; |
|||
import com.inscloudtech.common.utils.reflect.ReflectUtils; |
|||
import com.inscloudtech.common.utils.spring.SpringUtils; |
|||
import com.inscloudtech.framework.config.properties.CaptchaProperties; |
|||
import com.inscloudtech.framework.config.properties.MailProperties; |
|||
//import com.inscloudtech.sms.config.properties.SmsProperties; |
|||
//import com.inscloudtech.sms.core.SmsTemplate; |
|||
//import com.inscloudtech.sms.entity.SmsResult; |
|||
import com.inscloudtech.system.service.ISysConfigService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.expression.Expression; |
|||
import org.springframework.expression.ExpressionParser; |
|||
import org.springframework.expression.spel.standard.SpelExpressionParser; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.time.Duration; |
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 验证码操作处理 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@SaIgnore |
|||
@Slf4j |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
public class CaptchaController { |
|||
|
|||
private final CaptchaProperties captchaProperties; |
|||
// private final SmsProperties smsProperties; |
|||
private final ISysConfigService configService; |
|||
private final MailProperties mailProperties; |
|||
|
|||
// /** |
|||
// * 短信验证码 |
|||
// * |
|||
// * @param phonenumber 用户手机号 |
|||
// */ |
|||
// @GetMapping("/captchaSms") |
|||
// public R<Void> smsCaptcha(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) { |
|||
// if (!smsProperties.getEnabled()) { |
|||
// return R.fail("当前系统没有开启短信功能!"); |
|||
// } |
|||
// String key = CacheConstants.CAPTCHA_CODE_KEY + phonenumber; |
|||
// String code = RandomUtil.randomNumbers(4); |
|||
// RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION)); |
|||
// // 验证码模板id 自行处理 (查数据库或写死均可) |
|||
// String templateId = ""; |
|||
// Map<String, String> map = new HashMap<>(1); |
|||
// map.put("code", code); |
|||
// SmsTemplate smsTemplate = SpringUtils.getBean(SmsTemplate.class); |
|||
// SmsResult result = smsTemplate.send(phonenumber, templateId, map); |
|||
// if (!result.isSuccess()) { |
|||
// log.error("验证码短信发送异常 => {}", result); |
|||
// return R.fail(result.getMessage()); |
|||
// } |
|||
// return R.ok(); |
|||
// } |
|||
/** |
|||
* 邮箱验证码 |
|||
* |
|||
* @param email 邮箱 |
|||
*/ |
|||
@GetMapping("/captchaEmail") |
|||
public R<Void> emailCode(@NotBlank(message = "{user.email.not.blank}") String email) { |
|||
if (!mailProperties.getEnabled()) { |
|||
return R.fail("当前系统没有开启邮箱功能!"); |
|||
} |
|||
String key = CacheConstants.CAPTCHA_CODE_KEY + email; |
|||
String code = RandomUtil.randomNumbers(4); |
|||
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION)); |
|||
try { |
|||
MailUtils.sendText(email, "登录验证码", "您本次验证码为:" + code + ",有效性为" + Constants.CAPTCHA_EXPIRATION + "分钟,请尽快填写。"); |
|||
} catch (Exception e) { |
|||
log.error("验证码短信发送异常 => {}", e.getMessage()); |
|||
return R.fail(e.getMessage()); |
|||
} |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 生成验证码 |
|||
*/ |
|||
@GetMapping("/captchaImage") |
|||
public R<Map<String, Object>> getCode() { |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
boolean captchaEnabled = configService.selectCaptchaEnabled(); |
|||
ajax.put("captchaEnabled", captchaEnabled); |
|||
if (!captchaEnabled) { |
|||
return R.ok(ajax); |
|||
} |
|||
// 保存验证码信息 |
|||
String uuid = IdUtil.simpleUUID(); |
|||
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; |
|||
// 生成验证码 |
|||
CaptchaType captchaType = captchaProperties.getType(); |
|||
boolean isMath = CaptchaType.MATH == captchaType; |
|||
Integer length = isMath ? captchaProperties.getNumberLength() : captchaProperties.getCharLength(); |
|||
CodeGenerator codeGenerator = ReflectUtils.newInstance(captchaType.getClazz(), length); |
|||
AbstractCaptcha captcha = SpringUtils.getBean(captchaProperties.getCategory().getClazz()); |
|||
captcha.setGenerator(codeGenerator); |
|||
captcha.createCode(); |
|||
String code = captcha.getCode(); |
|||
if (isMath) { |
|||
ExpressionParser parser = new SpelExpressionParser(); |
|||
Expression exp = parser.parseExpression(StringUtils.remove(code, "=")); |
|||
code = exp.getValue(String.class); |
|||
} |
|||
RedisUtils.setCacheObject(verifyKey, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION)); |
|||
ajax.put("uuid", uuid); |
|||
ajax.put("img", captcha.getImageBase64()); |
|||
return R.ok(ajax); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,399 @@ |
|||
package com.inscloudtech.web.controller.datacenter; |
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import cn.hutool.core.util.IdUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.inscloudtech.analysiscenter.domain.AnalysisDto; |
|||
import com.inscloudtech.analysiscenter.domain.AnalysisPerson; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.constant.BankStatementConstants; |
|||
import com.inscloudtech.common.constant.Constants; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.excel.ExcelResult; |
|||
import com.inscloudtech.common.helper.LoginHelper; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.common.utils.redis.RedisUtils; |
|||
import com.inscloudtech.datacenter.domain.BankStatement; |
|||
import com.inscloudtech.datacenter.domain.ImportResult; |
|||
import com.inscloudtech.datacenter.domain.OpeningAccountInfo; |
|||
import com.inscloudtech.datacenter.domain.dto.QueryFailedMsgReq; |
|||
import com.inscloudtech.datacenter.domain.vo.GetBSFieldValueCountReq; |
|||
import com.inscloudtech.datacenter.domain.vo.GetBankStatementListReq; |
|||
import com.inscloudtech.datacenter.domain.vo.GetOpeningAccountInfoListReq; |
|||
import com.inscloudtech.datacenter.domain.vo.GetPersonReq; |
|||
import com.inscloudtech.datacenter.mapper.es.ESBankStatementMapper; |
|||
import com.inscloudtech.datacenter.service.*; |
|||
import com.inscloudtech.system.service.ISysOssService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.IOException; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 银行流水 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequiredArgsConstructor |
|||
@RequestMapping("/bank_statement") |
|||
public class BankController extends BaseController { |
|||
|
|||
private final BankService bankService; |
|||
private final ISysOssService ossService; |
|||
private final ImportResultService importResultService; |
|||
private final OpeningAccountInfoService openingAccountInfoService; |
|||
private final ESBankStatementMapper esBsMapper; |
|||
private final PlateNumberService plateNumberService; |
|||
|
|||
|
|||
//"获取导入银行流水模板") |
|||
@GetMapping("/template") |
|||
public void getTemplateFile(HttpServletResponse response) { |
|||
String sourceFolderPath = "/template/银行流水/"; // 源文件夹路径 |
|||
String zipFilePath = "银行流水导入模板.zip"; // 压缩文件路径 |
|||
bankService.createTemplate(sourceFolderPath,zipFilePath); |
|||
ossService.downloadLocal("/template/" + zipFilePath,zipFilePath, response); |
|||
} |
|||
|
|||
/** |
|||
* 返回银行信息 |
|||
*/ |
|||
//"获取银行信息") |
|||
@GetMapping("/bank/list") |
|||
public R getBankList() { |
|||
return R.ok(bankService.getBankList()); |
|||
} |
|||
|
|||
//"查询导入失败原因") |
|||
@PostMapping("/queryFailedMsg") |
|||
public R queryFailedPromptMsg(@RequestBody QueryFailedMsgReq req) { |
|||
List<ImportResult> importResults = importResultService.getResultListByCaseId(req.getCaseId(),req.getBatchId()); |
|||
return R.ok(importResults); |
|||
} |
|||
|
|||
//"导入银行流水4Excel") |
|||
@PostMapping(value = "/importExcel", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R importData(@RequestPart("file") MultipartFile file,String caseId) { |
|||
boolean result = false; |
|||
String importResultStr = ""; |
|||
int importCount = 0; |
|||
try { |
|||
ExcelResult<BankStatement> excelResult = ExcelUtil.importExcel(file.getInputStream(), BankStatement.class, true); |
|||
List<BankStatement> list = excelResult.getList(); |
|||
if(CollectionUtil.isNotEmpty(list)){ |
|||
result = bankService.importData(list,caseId,file.getOriginalFilename()); |
|||
importCount = list.size(); |
|||
}else { |
|||
throw new RuntimeException("未解析到数据!"); |
|||
} |
|||
}catch (Exception e){ |
|||
importResultStr = e.getMessage(); |
|||
} |
|||
ossService.upload2Local(importCount,importResultStr,file,caseId,"BANK_STATEMENT"); |
|||
return result ? R.ok() : R.fail(importResultStr); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 导入银行流水 |
|||
*/ |
|||
//"导入银行流水V2") |
|||
@Log(title = "导入银行流水", businessType = BusinessType.IMPORT) |
|||
@PostMapping("/import/v2") |
|||
public R importBankStatementsV2(MultipartFile file, String caseId) { |
|||
try { |
|||
//批次号 |
|||
String batchId = IdUtil.getSnowflakeNextIdStr(); |
|||
RedisUtils.setCacheObject(BankStatementConstants.USERID_4_IMPORT+caseId, LoginHelper.getUsername()); |
|||
RedisUtils.setCacheObject(BankStatementConstants.BATCH_ID_4_IMPORT+caseId, batchId); |
|||
int total = bankService.importBankStatements(file, caseId); |
|||
List<ImportResult> importResults = importResultService.getResultListByCaseId(caseId,batchId); |
|||
Map<String, List<ImportResult>> collect = importResults.stream().collect(Collectors.groupingBy(ImportResult::getBankName)); |
|||
int failCount = collect.keySet().size(); |
|||
int successCount = total - failCount; |
|||
Integer uploadResult = 1; |
|||
if (importResults.size() > 0) { |
|||
uploadResult = 0; |
|||
} |
|||
Map<String,Object> result = new HashMap<>(); |
|||
result.put("total",total); |
|||
result.put("failCount",failCount); |
|||
result.put("successCount",successCount); |
|||
result.put("errorInfoList",importResults); |
|||
|
|||
// 处理结果 |
|||
ossService.upload2LocalWithBatchId(file,caseId,"BANK_STATEMENT",batchId,uploadResult); |
|||
|
|||
//处理车牌信息 |
|||
plateNumberService.invoke(caseId); |
|||
|
|||
return R.ok(result); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
return R.fail(e.getMessage()); |
|||
} finally { |
|||
checkIsImportComplete(caseId); |
|||
esBsMapper.refresh("dc_bank_statement"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 查询流水导入结果 |
|||
*/ |
|||
//"查询流水导入结果") |
|||
@GetMapping("/listImportResult") |
|||
public TableDataInfo<ImportResult> listImportResult(ImportResult bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ImportResult> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(ImportResult::getCaseId,bo.getCaseId()); |
|||
lqw.eq(ImportResult::getBatchId,bo.getBatchId()); |
|||
lqw.eq(bo.getSuccess() != null,ImportResult::getSuccess,bo.getSuccess()); |
|||
Page<ImportResult> page = pageQuery.build(); |
|||
page = importResultService.page(page,lqw); |
|||
TableDataInfo tableDataInfo = new TableDataInfo(); |
|||
tableDataInfo.setTotal(page.getTotal()); |
|||
tableDataInfo.setRows(page.getRecords()); |
|||
return tableDataInfo; |
|||
} |
|||
|
|||
/** |
|||
* 导出流水导入失败结果 |
|||
*/ |
|||
//"导出流水导入失败结果") |
|||
@PostMapping("/exportImportResult") |
|||
public void export(ImportResult bo, HttpServletResponse response) { |
|||
List<ImportResult> importResults = importResultService.getResultListByCaseId(bo.getCaseId(),bo.getBatchId()); |
|||
|
|||
ExcelUtil.exportExcel(importResults, "流水导入失败结果", ImportResult.class, response); |
|||
} |
|||
|
|||
|
|||
//"分析成果-流水信息导入") |
|||
@PostMapping(value = "/import4AnalysisResult", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R importAnalysisResult(@RequestPart("file") MultipartFile file, String caseId, String analysisResultId) { |
|||
boolean result = false; |
|||
String importResultStr = ""; |
|||
int importCount = 0; |
|||
try { |
|||
ExcelResult<BankStatement> excelResult = ExcelUtil.importExcel(file.getInputStream(), BankStatement.class, true); |
|||
List<BankStatement> list = excelResult.getList(); |
|||
if(CollectionUtil.isNotEmpty(list)){ |
|||
result = bankService.importAnalysisResult(list,analysisResultId,getUsername()); |
|||
importCount = list.size(); |
|||
}else { |
|||
throw new RuntimeException("未解析到数据!"); |
|||
} |
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
importResultStr = e.getMessage(); |
|||
} |
|||
if(!result){ |
|||
return R.fail(importResultStr); |
|||
}else { |
|||
ossService.upload2Local(importCount,importResultStr,file,caseId,"ANALYSIS_RESULT"); |
|||
return R.ok(); |
|||
} |
|||
} |
|||
|
|||
|
|||
//"分析成果-开户信息导入") |
|||
@PostMapping(value = "/oai/import4AnalysisResult", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R oaiImportAnalysisResult(@RequestPart("file") MultipartFile file, String caseId, String analysisResultId) { |
|||
boolean result = false; |
|||
String importResultStr = ""; |
|||
int importCount = 0; |
|||
try { |
|||
ExcelResult<OpeningAccountInfo> excelResult = ExcelUtil.importExcel(file.getInputStream(), OpeningAccountInfo.class, true); |
|||
List<OpeningAccountInfo> list = excelResult.getList(); |
|||
if(CollectionUtil.isNotEmpty(list)){ |
|||
result = openingAccountInfoService.importAnalysisResult(list,analysisResultId,getUsername()); |
|||
importCount = list.size(); |
|||
}else { |
|||
throw new RuntimeException("未解析到数据!"); |
|||
} |
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
importResultStr = e.getMessage(); |
|||
} |
|||
if(!result){ |
|||
return R.fail(importResultStr); |
|||
}else { |
|||
ossService.upload2Local(importCount,importResultStr,file,caseId,"ANALYSIS_RESULT"); |
|||
return R.ok(); |
|||
} |
|||
} |
|||
|
|||
|
|||
//"更新流水信息") |
|||
@Log(title = "流水信息", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/updateBatch") |
|||
public R edit(@RequestBody BankStatement bs) { |
|||
|
|||
bankService.updateBatchBSEsVersion(bs); |
|||
|
|||
return R.ok(null); |
|||
} |
|||
|
|||
//"保存至分析成果-流水") |
|||
@PostMapping("/save2AnalysisResult") |
|||
public R save2AnalysisResult(@RequestBody AnalysisDto dto) { |
|||
bankService.save2AnalysisResult(dto); |
|||
return R.ok(); |
|||
} |
|||
|
|||
//"保存至分析成果-开户") |
|||
@PostMapping("/save2AnalysisResultOai") |
|||
public R save2AnalysisResultOai(@RequestBody AnalysisDto dto) { |
|||
bankService.save2AnalysisResultOai(dto); |
|||
return R.ok(); |
|||
} |
|||
|
|||
|
|||
//"查询开户信息") |
|||
@PostMapping("/oai/list") |
|||
public TableDataInfo<OpeningAccountInfo> oaiPage(@RequestBody GetOpeningAccountInfoListReq req) throws Exception { |
|||
return bankService.oaiPage(req); |
|||
} |
|||
|
|||
//"导出银行开户信息") |
|||
@Log(title = "开户信息详情", businessType = BusinessType.EXPORT) |
|||
@PostMapping(value = "/oai/export") |
|||
public void exportOAI(GetOpeningAccountInfoListReq req, HttpServletResponse response) { |
|||
try { |
|||
bankService.exportOAI(req, response); |
|||
} catch (IOException e) { |
|||
throw new RuntimeException(e); |
|||
} |
|||
} |
|||
|
|||
//"查询银行流水列表") |
|||
@PostMapping("/list") |
|||
public TableDataInfo<BankStatement> page(@RequestBody GetBankStatementListReq req) throws Exception { |
|||
return bankService.page(req); |
|||
} |
|||
|
|||
//"导出银行流水") |
|||
@Log(title = "流水信息", businessType = BusinessType.EXPORT) |
|||
@PostMapping(value = "/export") |
|||
public void export(GetBSFieldValueCountReq req, HttpServletResponse response) throws IOException { |
|||
bankService.exportBankStatement(req, response); |
|||
} |
|||
|
|||
//"删除流水") |
|||
@DeleteMapping("/del/{bsIds}") |
|||
@Log(title = "流水信息", businessType = BusinessType.DELETE) |
|||
public R del(@PathVariable String[] bsIds) { |
|||
return R.ok(bankService.deleteBSByIdsEsVersion(bsIds)); |
|||
} |
|||
|
|||
//"查询字段统计值") |
|||
@PostMapping("/getFieldsValueCount") |
|||
public R getFieldsValueCount(@RequestBody GetBSFieldValueCountReq req) throws IOException { |
|||
return R.ok(bankService.getFieldsValueCount(req)); |
|||
} |
|||
|
|||
//"查询字段统计值") |
|||
@PostMapping("/oai/getFieldsValueCount") |
|||
public R getFieldsValueCountForOAI(@RequestBody GetOpeningAccountInfoListReq req) throws IOException { |
|||
return R.ok(bankService.getFieldsValueCount4OAI(req)); |
|||
} |
|||
|
|||
//"更新开户信息") |
|||
@Log(title = "开户信息", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/oai/updateBatch") |
|||
public R editOpeningAccountInfo(@RequestBody OpeningAccountInfo oai) { |
|||
|
|||
bankService.updateBatchOAIEsVersion(oai); |
|||
|
|||
return R.ok(null); |
|||
} |
|||
|
|||
//"删除开户") |
|||
@Log(title = "开户信息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/oai/del/{oaiIds}") |
|||
public R delOAI(@PathVariable String[] oaiIds) { |
|||
return R.ok(bankService.deleteOAIByIdsEsVersion(oaiIds)); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 人员统计 |
|||
*/ |
|||
//"人员统计") |
|||
@GetMapping("/getPersonInfo") |
|||
public R getPersons(GetPersonReq req) throws Exception { |
|||
return R.ok(bankService.getPersonInfo(req)); |
|||
} |
|||
|
|||
/** |
|||
* 修改交易对象 |
|||
*/ |
|||
//"修改分析人员类别") |
|||
@PutMapping("/editPersonInfo") |
|||
public R editPersonInfo(@RequestBody List<AnalysisPerson> updateList) { |
|||
return R.ok(bankService.editPersonInfo(updateList)); |
|||
} |
|||
|
|||
//"清空") |
|||
@Log(title = "流水信息", businessType = BusinessType.CLEAN) |
|||
@GetMapping("/clear/{caseId}") |
|||
public R clear(@PathVariable("caseId") String caseId) { |
|||
try { |
|||
bankService.clear(caseId); |
|||
return R.ok(); |
|||
} catch (Exception e) { |
|||
return R.fail(e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
//"获取流水文件导入完成状态") |
|||
@GetMapping("/isImportComplete/{caseId}") |
|||
public R isImportComplete(@PathVariable String caseId) { |
|||
return R.ok(checkIsImportComplete(caseId)); |
|||
} |
|||
|
|||
public int checkIsImportComplete(String caseId) { |
|||
int flag = 0; |
|||
String importFileKey = "importFile-" + caseId; |
|||
Integer tempVar = RedisUtils.getCacheObject(importFileKey); |
|||
if(null != tempVar){ |
|||
flag = 1; |
|||
RedisUtils.deleteObject(importFileKey); |
|||
} |
|||
|
|||
String ckey = Constants.COMPLETE_BANK_COUNT + caseId; |
|||
String bankCountKey = Constants.IMPORT_BANK_COUNT + caseId; |
|||
long completeCount = RedisUtils.getAtomicValue(ckey); |
|||
long bankCount = RedisUtils.getAtomicValue(bankCountKey); |
|||
|
|||
if(bankCount == completeCount){ |
|||
RedisUtils.deleteObject(bankCountKey); |
|||
flag = 1; |
|||
RedisUtils.deleteObject(importFileKey); |
|||
RedisUtils.deleteObject(ckey); |
|||
} |
|||
|
|||
RedisUtils.deleteObject(BankStatementConstants.USERID_4_IMPORT+caseId); |
|||
RedisUtils.deleteObject(BankStatementConstants.BATCH_ID_4_IMPORT+caseId); |
|||
return flag; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,191 @@ |
|||
package com.inscloudtech.web.controller.datacenter; |
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import com.inscloudtech.analysiscenter.domain.AnalysisDto; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.excel.ExcelResult; |
|||
import com.inscloudtech.common.utils.BeanCopyUtils; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.datacenter.domain.CarInfo; |
|||
import com.inscloudtech.datacenter.mapper.CarInfoMapper; |
|||
import com.inscloudtech.datacenter.service.ICarInfoService; |
|||
import com.inscloudtech.system.service.ISysOssService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.*; |
|||
|
|||
/** |
|||
* 重点人员资产-车辆信息 |
|||
* |
|||
* @author inscloudtech |
|||
* @date 2023-11-10 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/dc/carInfo") |
|||
public class CarInfoController extends BaseController { |
|||
|
|||
private final ICarInfoService iCarInfoService; |
|||
|
|||
private final ISysOssService iSysOssService; |
|||
|
|||
//"保存至分析成果") |
|||
@PostMapping("/save2AnalysisResult") |
|||
public R save2AnalysisResult(@RequestBody AnalysisDto dto) { |
|||
iCarInfoService.save2AnalysisResult(dto); |
|||
return R.ok(); |
|||
} |
|||
|
|||
/** |
|||
* 查询重点人员资产-车辆信息列表 |
|||
*/ |
|||
//"查询车辆信息列表") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<CarInfo> list(CarInfo bo, PageQuery pageQuery) { |
|||
return iCarInfoService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 获取重点人员资产-车辆信息详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
//"获取车辆信息") |
|||
@GetMapping("/{id}") |
|||
public R<CarInfo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(iCarInfoService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增重点人员资产-车辆信息 |
|||
*/ |
|||
//"新增车辆信息") |
|||
@Log(title = "重点人员资产-车辆信息", businessType = BusinessType.INSERT) |
|||
@PostMapping() |
|||
public R add( @RequestBody CarInfo bo) { |
|||
return R.ok(iCarInfoService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改重点人员资产-车辆信息 |
|||
*/ |
|||
//"修改车辆信息") |
|||
@UpdateLog(title = "重点人员资产-车辆信息",mapperClass = CarInfoMapper.class, businessType = BusinessType.UPDATE) |
|||
@PutMapping() |
|||
public R edit(@RequestBody CarInfo bo) { |
|||
return R.ok(iCarInfoService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除重点人员资产-车辆信息 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
//"删除车辆信息") |
|||
@Log(title = "重点人员资产-车辆信息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return R.ok(iCarInfoService.deleteWithValidByIds(Arrays.asList(ids), true)); |
|||
} |
|||
|
|||
//"批量修改车辆信息") |
|||
@PutMapping("/updateBatch") |
|||
public R updateBatch(@RequestBody CarInfo bo) { |
|||
List<String> ids = bo.getIds(); |
|||
List<CarInfo> list = new ArrayList<>(); |
|||
ids.stream().forEach(id ->{ |
|||
CarInfo update = BeanCopyUtils.copy(bo,CarInfo.class); |
|||
update.setId(id); |
|||
update.setUpdateBy(getUsername()); |
|||
update.setUpdateTime(new Date()); |
|||
list.add(update); |
|||
}); |
|||
return R.ok(iCarInfoService.updateBatch(list)); |
|||
} |
|||
|
|||
//"批量修改车辆信息对象集合") |
|||
@PutMapping("/updateBatchByList") |
|||
public R updateBatch(@RequestBody List<CarInfo> list) { |
|||
list.stream().forEach(update ->{ |
|||
update.setUpdateBy(getUsername()); |
|||
update.setUpdateTime(new Date()); |
|||
}); |
|||
return R.ok(iCarInfoService.updateBatch(list)); |
|||
} |
|||
|
|||
//"导入车辆信息") |
|||
@PostMapping(value = "/import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R importData(@RequestPart("file") MultipartFile file, String caseId) { |
|||
boolean result = false; |
|||
String importResultStr = ""; |
|||
int importCount = 0; |
|||
try { |
|||
ExcelResult<CarInfo> excelResult = ExcelUtil.importExcel(file.getInputStream(), CarInfo.class, true); |
|||
List<CarInfo> list = excelResult.getList(); |
|||
if(CollectionUtil.isNotEmpty(list)){ |
|||
list = iCarInfoService.dataTrimAndDeduplication(list,caseId,getUsername()); |
|||
result = iCarInfoService.importData(list,caseId,null); |
|||
importCount = list.size(); |
|||
}else { |
|||
throw new RuntimeException("未解析到数据!"); |
|||
} |
|||
}catch (Exception e){ |
|||
importResultStr = e.getMessage(); |
|||
} |
|||
iSysOssService.upload2Local(importCount,importResultStr,file,caseId,"CAR_INFO"); |
|||
return result ? R.ok() : R.fail(importResultStr); |
|||
} |
|||
|
|||
//"分析成果-车辆信息导入") |
|||
@PostMapping(value = "/import4AnalysisResult", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R importAnalysisResult(@RequestPart("file") MultipartFile file, String caseId, String analysisResultId) { |
|||
boolean result = false; |
|||
String importResultStr = ""; |
|||
int importCount = 0; |
|||
try { |
|||
ExcelResult<CarInfo> excelResult = ExcelUtil.importExcel(file.getInputStream(), CarInfo.class, true); |
|||
List<CarInfo> list = excelResult.getList(); |
|||
if(CollectionUtil.isNotEmpty(list)){ |
|||
result = iCarInfoService.importAnalysisResult(list,analysisResultId,getUsername()); |
|||
importCount = list.size(); |
|||
}else { |
|||
throw new RuntimeException("未解析到数据!"); |
|||
} |
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
importResultStr = e.getMessage(); |
|||
} |
|||
|
|||
iSysOssService.upload2Local(importCount,importResultStr,file,caseId,"CAR_INFO"); |
|||
return result ? R.ok() : R.fail(importResultStr); |
|||
} |
|||
|
|||
/** |
|||
* 导出交易对象列表 |
|||
*/ |
|||
//"导出车辆信息") |
|||
@PostMapping("/export") |
|||
public void export(CarInfo bo, HttpServletResponse response) { |
|||
List<CarInfo> list = Collections.EMPTY_LIST; |
|||
if(bo.getDownloadTemplate() == null){ |
|||
list = iCarInfoService.queryList(bo); |
|||
} |
|||
ExcelUtil.exportExcel(list, "车辆信息", CarInfo.class, response); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,148 @@ |
|||
package com.inscloudtech.web.controller.datacenter; |
|||
|
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.inscloudtech.analysiscenter.domain.AnalysisDto; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.BeanCopyUtils; |
|||
import com.inscloudtech.datacenter.domain.OtherAssets; |
|||
import com.inscloudtech.system.domain.SysOss; |
|||
import com.inscloudtech.datacenter.service.IOtherAssetsService; |
|||
import com.inscloudtech.system.service.ISysOssService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.SneakyThrows; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import java.io.IOException; |
|||
import java.util.*; |
|||
|
|||
|
|||
/** |
|||
* 重点人员资产-其他资产信息 |
|||
* |
|||
* @author inscloudtech |
|||
* @date 2023-11-09 |
|||
*/ |
|||
|
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/dc/otherAssets") |
|||
public class OtherAssetsController extends BaseController { |
|||
|
|||
private final ISysOssService iSysOssService; |
|||
|
|||
private final IOtherAssetsService iOtherAssetsService; |
|||
|
|||
//"保存至分析成果") |
|||
@PostMapping("/save2AnalysisResult") |
|||
public R save2AnalysisResult(@RequestBody AnalysisDto dto) { |
|||
iOtherAssetsService.save2AnalysisResult(dto); |
|||
return R.ok(); |
|||
} |
|||
|
|||
|
|||
private static final String BUSINESS_MODULE = "OTHER_ASSETS"; |
|||
|
|||
//"查询其他资产信息文件列表") |
|||
@GetMapping("/listFile") |
|||
public TableDataInfo<SysOss> listFile(SysOss bo, PageQuery pageQuery) { |
|||
bo.setBusinessModule(BUSINESS_MODULE); |
|||
return iSysOssService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
|
|||
//"查询其他资产信息列表") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<OtherAssets> list(OtherAssets bo, PageQuery pageQuery) { |
|||
return iOtherAssetsService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
//"导入其他资产信息") |
|||
@Log(title = "其他资产信息", businessType = BusinessType.IMPORT) |
|||
@PostMapping(value = "/import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<Map<String, String>> importData(@RequestPart("file") MultipartFile file, String caseId) { |
|||
if (ObjectUtil.isNull(file)) { |
|||
return R.fail("上传文件不能为空"); |
|||
} |
|||
SysOss oss = iSysOssService.upload2Local(1,"",file,caseId,BUSINESS_MODULE); |
|||
Map<String, String> map = new HashMap<>(2); |
|||
map.put("url", oss.getUrl()); |
|||
map.put("fileName", oss.getOriginalName()); |
|||
map.put("ossId", oss.getOssId()); |
|||
iOtherAssetsService.insertFileContent(oss.getOssId(),file,caseId,BUSINESS_MODULE); |
|||
return R.ok(map); |
|||
} |
|||
|
|||
/** |
|||
* 批量修改交易对象 |
|||
*/ |
|||
//"批量修改其他资产") |
|||
@PutMapping("/updateBatch") |
|||
public R updateBatch(@RequestBody SysOss bo) { |
|||
List<String> ids = bo.getIds(); |
|||
List<SysOss> list = new ArrayList<>(); |
|||
ids.stream().forEach(id ->{ |
|||
SysOss update = BeanCopyUtils.copy(bo,SysOss.class); |
|||
update.setOssId(id); |
|||
update.setUpdateBy(getUsername()); |
|||
update.setUpdateTime(new Date()); |
|||
list.add(update); |
|||
}); |
|||
return R.ok(iSysOssService.updateBatch(list)); |
|||
} |
|||
|
|||
//"批量修改其他资产集合") |
|||
@PutMapping("/updateBatchByList") |
|||
public R updateBatch(@RequestBody List<SysOss> list) { |
|||
list.stream().forEach(update ->{ |
|||
update.setUpdateBy(getUsername()); |
|||
update.setUpdateTime(new Date()); |
|||
}); |
|||
return R.ok(iSysOssService.updateBatch(list)); |
|||
} |
|||
|
|||
@SneakyThrows |
|||
//"导出其他资产信息") |
|||
@Log(title = "其他资产信息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(SysOss bo, HttpServletResponse response) { |
|||
if(CollectionUtil.isNotEmpty(bo.getIds())){ |
|||
bo.getIds().stream().forEach(id ->{ |
|||
try { |
|||
iSysOssService.download(id,response); |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
}); |
|||
}else { |
|||
List<SysOss> sysOsses = iSysOssService.queryList(bo); |
|||
if(CollectionUtil.isNotEmpty(sysOsses)){ |
|||
sysOsses.stream().forEach(oss ->{ |
|||
try { |
|||
iSysOssService.download(oss.getOssId(),response); |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
//"删除其他资产信息") |
|||
@Log(title = "其他资产信息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ossIds}") |
|||
public R remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ossIds) { |
|||
return R.ok(iOtherAssetsService.remove(Arrays.asList(ossIds))); |
|||
} |
|||
} |
@ -0,0 +1,148 @@ |
|||
package com.inscloudtech.web.controller.datacenter; |
|||
|
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.inscloudtech.analysiscenter.domain.AnalysisDto; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.BeanCopyUtils; |
|||
import com.inscloudtech.datacenter.domain.OtherInformation; |
|||
import com.inscloudtech.system.domain.SysOss; |
|||
import com.inscloudtech.datacenter.service.IOtherInformationService; |
|||
import com.inscloudtech.system.service.ISysOssService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.SneakyThrows; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import java.io.IOException; |
|||
import java.util.*; |
|||
|
|||
|
|||
/** |
|||
* -其他信息 |
|||
* |
|||
* @author inscloudtech |
|||
* @date 2023-11-09 |
|||
*/ |
|||
|
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/dc/otherInformation") |
|||
public class OtherInformationController extends BaseController { |
|||
|
|||
private final ISysOssService iSysOssService; |
|||
|
|||
private final IOtherInformationService otherInformationService; |
|||
|
|||
private static final String BUSINESS_MODULE = "OTHER_INFORMATION"; |
|||
|
|||
//"保存至分析成果") |
|||
@PostMapping("/save2AnalysisResult") |
|||
public R save2AnalysisResult(@RequestBody AnalysisDto dto) { |
|||
otherInformationService.save2AnalysisResult(dto); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 查询-其他信息列表 |
|||
*/ |
|||
//"查询其他信息文件列表") |
|||
@GetMapping("/listFile") |
|||
public TableDataInfo<SysOss> listFile(SysOss bo, PageQuery pageQuery) { |
|||
bo.setBusinessModule(BUSINESS_MODULE); |
|||
return iSysOssService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
//"查询其他信息列表") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<OtherInformation> list(OtherInformation bo, PageQuery pageQuery) { |
|||
return otherInformationService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 批量修改交易对象 |
|||
*/ |
|||
//"批量修改其他信息") |
|||
@PutMapping("/updateBatch") |
|||
public R updateBatch(@RequestBody SysOss bo) { |
|||
List<String> ids = bo.getIds(); |
|||
List<SysOss> list = new ArrayList<>(); |
|||
ids.stream().forEach(id ->{ |
|||
SysOss update = BeanCopyUtils.copy(bo,SysOss.class); |
|||
update.setOssId(id); |
|||
update.setUpdateBy(getUsername()); |
|||
update.setUpdateTime(new Date()); |
|||
list.add(update); |
|||
}); |
|||
return R.ok(iSysOssService.updateBatch(list)); |
|||
} |
|||
|
|||
//"批量修改其他信息集合") |
|||
@PutMapping("/updateBatchByList") |
|||
public R updateBatch(@RequestBody List<SysOss> list) { |
|||
list.stream().forEach(update ->{ |
|||
update.setUpdateBy(getUsername()); |
|||
update.setUpdateTime(new Date()); |
|||
}); |
|||
return R.ok(iSysOssService.updateBatch(list)); |
|||
} |
|||
|
|||
//"导入其他信息") |
|||
@Log(title = "其他信息", businessType = BusinessType.IMPORT) |
|||
@PostMapping(value = "/import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<Map<String, String>> importData(@RequestPart("file") MultipartFile file, String caseId) { |
|||
if (ObjectUtil.isNull(file)) { |
|||
return R.fail("上传文件不能为空"); |
|||
} |
|||
SysOss oss = iSysOssService.upload2Local(1,"",file,caseId,BUSINESS_MODULE); |
|||
Map<String, String> map = new HashMap<>(2); |
|||
map.put("url", oss.getUrl()); |
|||
map.put("fileName", oss.getOriginalName()); |
|||
map.put("ossId", oss.getOssId()); |
|||
otherInformationService.insertFileContent(oss.getOssId(),file,caseId,BUSINESS_MODULE); |
|||
return R.ok(map); |
|||
} |
|||
|
|||
@SneakyThrows |
|||
//"导出其他信息") |
|||
@Log(title = "其他信息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(SysOss bo, HttpServletResponse response) { |
|||
if(CollectionUtil.isNotEmpty(bo.getIds())){ |
|||
bo.getIds().stream().forEach(id ->{ |
|||
try { |
|||
iSysOssService.download(id,response); |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
}); |
|||
}else { |
|||
List<SysOss> sysOsses = iSysOssService.queryList(bo); |
|||
if(CollectionUtil.isNotEmpty(sysOsses)){ |
|||
sysOsses.stream().forEach(oss ->{ |
|||
try { |
|||
iSysOssService.download(oss.getOssId(),response); |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
//"删除其他信息") |
|||
@Log(title = "其他信息", businessType = BusinessType.EXPORT) |
|||
@DeleteMapping("/{ossIds}") |
|||
public R remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ossIds) { |
|||
return R.ok(otherInformationService.remove(Arrays.asList(ossIds))); |
|||
} |
|||
} |
@ -0,0 +1,203 @@ |
|||
package com.inscloudtech.web.controller.datacenter; |
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import com.inscloudtech.analysiscenter.domain.AnalysisDto; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.excel.ExcelResult; |
|||
import com.inscloudtech.common.utils.BeanCopyUtils; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.datacenter.domain.PublicFamily; |
|||
import com.inscloudtech.datacenter.mapper.PublicFamilyMapper; |
|||
import com.inscloudtech.datacenter.service.IPublicFamilyService; |
|||
import com.inscloudtech.system.service.ISysOssService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.*; |
|||
|
|||
|
|||
/** |
|||
* 数据中心-职工家属 |
|||
* |
|||
* @author inscloudtech |
|||
* @date 2023-11-09 |
|||
*/ |
|||
//"公职人员-职工家属") |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/dc/publicFamily") |
|||
public class PublicFamilyController extends BaseController { |
|||
|
|||
private final IPublicFamilyService iPublicFamilyService; |
|||
|
|||
private final ISysOssService iSysOssService; |
|||
|
|||
//"保存至分析成果") |
|||
@PostMapping("/save2AnalysisResult") |
|||
public R save2AnalysisResult(@RequestBody AnalysisDto dto) { |
|||
iPublicFamilyService.save2AnalysisResult(dto); |
|||
return R.ok(); |
|||
} |
|||
|
|||
/** |
|||
* 查询数据中心-职工家属列表 |
|||
*/ |
|||
//"查询职工家属列表") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<PublicFamily> list(PublicFamily bo, PageQuery pageQuery) { |
|||
return iPublicFamilyService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 查询交易对象列表 |
|||
*/ |
|||
//"高亮查询职工家属列表") |
|||
@GetMapping("/highlightList") |
|||
public TableDataInfo<PublicFamily> highlightList(PublicFamily bo, PageQuery pageQuery) { |
|||
return iPublicFamilyService.highlightList(bo, pageQuery); |
|||
} |
|||
|
|||
|
|||
//"导出职工家属列表") |
|||
@Log(title = "职工家属", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(PublicFamily bo, HttpServletResponse response) { |
|||
List<PublicFamily> list = Collections.EMPTY_LIST; |
|||
if(bo.getDownloadTemplate() == null){ |
|||
list = iPublicFamilyService.queryList(bo); |
|||
} |
|||
ExcelUtil.exportExcel(list, "职工及家属名册", PublicFamily.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取数据中心-职工家属详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
//"获取职工家属信息") |
|||
@GetMapping("/{id}") |
|||
public R<PublicFamily> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(iPublicFamilyService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增数据中心-职工家属 |
|||
*/ |
|||
//"新增职工家属信息") |
|||
@Log(title = "职工家属", businessType = BusinessType.INSERT) |
|||
@PostMapping() |
|||
public R add( @RequestBody PublicFamily bo) { |
|||
return R.ok(iPublicFamilyService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改数据中心-职工家属 |
|||
*/ |
|||
//"修改职工家属信息") |
|||
@UpdateLog(title = "职工家属",mapperClass = PublicFamilyMapper.class, businessType = BusinessType.UPDATE) |
|||
@PutMapping() |
|||
public R edit(@RequestBody PublicFamily bo) { |
|||
return R.ok(iPublicFamilyService.updateByBo(bo)); |
|||
} |
|||
|
|||
//"批量修改职工家属信息") |
|||
@PutMapping("/updateBatch") |
|||
public R updateBatch(@RequestBody PublicFamily bo) { |
|||
List<String> ids = bo.getIds(); |
|||
List<PublicFamily> list = new ArrayList<>(); |
|||
ids.stream().forEach(id ->{ |
|||
PublicFamily update = BeanCopyUtils.copy(bo,PublicFamily.class); |
|||
update.setId(id); |
|||
update.setUpdateBy(getUsername()); |
|||
update.setUpdateTime(new Date()); |
|||
list.add(update); |
|||
}); |
|||
return R.ok(iPublicFamilyService.updateBatch(list)); |
|||
} |
|||
//"批量修改职工家属信息集合") |
|||
@PutMapping("/updateBatchByList") |
|||
public R updateBatch(@RequestBody List<PublicFamily> list) { |
|||
list.stream().forEach(update ->{ |
|||
update.setUpdateBy(getUsername()); |
|||
update.setUpdateTime(new Date()); |
|||
}); |
|||
return R.ok(iPublicFamilyService.updateBatch(list)); |
|||
} |
|||
|
|||
|
|||
//"导入职工家属列表") |
|||
@PostMapping(value = "/import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R importData(@RequestPart("file") MultipartFile file, String caseId) { |
|||
boolean result = false; |
|||
String importResultStr = ""; |
|||
int importCount = 0; |
|||
try { |
|||
ExcelResult<PublicFamily> excelResult = ExcelUtil.importExcel(file.getInputStream(), PublicFamily.class, true); |
|||
List<PublicFamily> list = excelResult.getList(); |
|||
if(CollectionUtil.isNotEmpty(list)){ |
|||
list = iPublicFamilyService.dataTrimAndDeduplication(list,caseId,getUsername()); |
|||
result = iPublicFamilyService.importData(list,caseId,null); |
|||
importCount = list.size(); |
|||
}else { |
|||
throw new RuntimeException("未解析到数据!"); |
|||
} |
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
importResultStr = e.getMessage(); |
|||
} |
|||
iSysOssService.upload2Local(importCount,importResultStr,file,caseId,"PUBLIC_FAMILY"); |
|||
return result ? R.ok() : R.fail(importResultStr); |
|||
} |
|||
|
|||
//"分析成果-不动产信息导入") |
|||
@PostMapping(value = "/import4AnalysisResult", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R importAnalysisResult(@RequestPart("file") MultipartFile file, String caseId, String analysisResultId) { |
|||
boolean result = false; |
|||
String importResultStr = ""; |
|||
int importCount = 0; |
|||
try { |
|||
ExcelResult<PublicFamily> excelResult = ExcelUtil.importExcel(file.getInputStream(), PublicFamily.class, true); |
|||
List<PublicFamily> list = excelResult.getList(); |
|||
if(CollectionUtil.isNotEmpty(list)){ |
|||
result = iPublicFamilyService.importAnalysisResult(list,analysisResultId,getUsername()); |
|||
importCount = list.size(); |
|||
}else { |
|||
throw new RuntimeException("未解析到数据!"); |
|||
} |
|||
}catch (Exception e){ |
|||
importResultStr = e.getMessage(); |
|||
} |
|||
|
|||
iSysOssService.upload2Local(importCount,importResultStr,file,caseId,"ANALYSIS_RESULT"); |
|||
return result ? R.ok() : R.fail(importResultStr); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 删除数据中心-职工家属 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
|
|||
//"删除职工家属信息") |
|||
@Log(title = "职工家属", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return R.ok(iPublicFamilyService.deleteWithValidByIds(Arrays.asList(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,316 @@ |
|||
package com.inscloudtech.web.controller.index; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import com.inscloudtech.bankStatementAnalysis.util.DesUtil; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.caseMange.domain.vo.*; |
|||
import com.inscloudtech.common.constant.Constants; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.entity.SysDept; |
|||
import com.inscloudtech.common.core.domain.entity.SysUser; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.excel.ExcelResult; |
|||
import com.inscloudtech.common.helper.LoginHelper; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
|
|||
import com.inscloudtech.caseMange.domain.SysLawCase; |
|||
import com.inscloudtech.caseMange.mapper.SysLawCaseMapper; |
|||
import com.inscloudtech.system.domain.vo.LoginRecordEntity; |
|||
import com.inscloudtech.system.domain.vo.SysUserExportVo; |
|||
import com.inscloudtech.system.mapper.SysUserMapper; |
|||
import com.inscloudtech.caseMange.service.ILeaderTaskService; |
|||
import com.inscloudtech.caseMange.service.ISysLawCaseService; |
|||
import com.inscloudtech.system.service.ISysOperLogService; |
|||
import com.inscloudtech.system.service.ISysUserService; |
|||
import com.inscloudtech.system.service.LoginRecordHelper; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.ArrayList; |
|||
import java.util.Arrays; |
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 案管领导首页 |
|||
*/ |
|||
|
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/leader/task") |
|||
public class LeaderTaskController { |
|||
|
|||
private final ISysUserService userService; |
|||
private final ILeaderTaskService taskService; |
|||
private final ISysLawCaseService lawCaseService; |
|||
private final ISysOperLogService operLogService; |
|||
private final LoginRecordHelper loginRecordHelper; |
|||
private final SysUserMapper userMapper; |
|||
|
|||
private final Logger log = LoggerFactory.getLogger(LeaderTaskController.class); |
|||
|
|||
//"案件删除") |
|||
@Log(title = "案管领导", businessType = BusinessType.DELETE) |
|||
@PostMapping("/lawCase/delete") |
|||
public R deleteLawCase(@RequestBody SysLawCase req) { |
|||
try { |
|||
taskService.deleteLawCase(req.getId()); |
|||
return R.ok(null); |
|||
} catch (Exception e) { |
|||
log.error("删除案件错误:" + e.getMessage(), e); |
|||
return R.fail(e.getMessage(), null); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 导出用户列表 |
|||
*/ |
|||
@Log(title = "用户管理", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/investigator/export") |
|||
public void export(SysUser user, HttpServletResponse response) { |
|||
user.setRoleId(Constants.INVESTIGATOR_ROLE_ID); |
|||
List<SysUser> list = userService.selectUserList(user); |
|||
List<SysUserExportVo> listVo = BeanUtil.copyToList(list, SysUserExportVo.class); |
|||
for (int i = 0; i < list.size(); i++) { |
|||
SysDept dept = list.get(i).getDept(); |
|||
SysUserExportVo vo = listVo.get(i); |
|||
if (ObjectUtil.isNotEmpty(dept)) { |
|||
vo.setDeptName(dept.getDeptName()); |
|||
vo.setLeader(dept.getLeader()); |
|||
} |
|||
} |
|||
ExcelUtil.exportExcel(listVo, "调查人员信息", SysUserExportVo.class, response); |
|||
} |
|||
|
|||
//"导入调查人员信息") |
|||
@PostMapping(value = "/investigator/import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R importData(@RequestPart("file") MultipartFile file, boolean updateSupport) { |
|||
try { |
|||
ExcelResult<MInvestigator> excelResult = ExcelUtil.importExcel(file.getInputStream(), MInvestigator.class, true); |
|||
List<MInvestigator> list = excelResult.getList(); |
|||
List<SysUser> users = BeanUtil.copyToList(list,SysUser.class); |
|||
String msg = taskService.importInvestigator(users, updateSupport); |
|||
return R.ok(msg); |
|||
} catch (Exception e) { |
|||
log.error("导入调查人员信息错误: " + e.getMessage(), e); |
|||
return R.fail(e.getMessage(), null); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 添加调查人员 |
|||
*/ |
|||
//"添加调查人员") |
|||
@Log(title = "调查人员管理", businessType = BusinessType.INSERT) |
|||
@PostMapping("/investigator/add") |
|||
public R addInvestigator(@RequestBody AddInvestigatorReq req) { |
|||
try { |
|||
taskService.addInvestigator(req); |
|||
return R.ok(null); |
|||
} catch (Exception e) { |
|||
log.error("添加调查人员: " + e.getMessage(), e); |
|||
return R.fail(e.getMessage(), null); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 调查人员信息编辑 |
|||
*/ |
|||
//"调查人员信息编辑") |
|||
@UpdateLog( |
|||
title = "调查人员管理", |
|||
businessType = BusinessType.UPDATE, |
|||
mapperClass = SysUserMapper.class) |
|||
@PostMapping("/investigator/edit") |
|||
public R editInvestigator(@RequestBody EditInvestigatorReq req) { |
|||
try { |
|||
taskService.editInvestigator(req); |
|||
return R.ok(null); |
|||
} catch (Exception e) { |
|||
log.error("编辑调查人员信息: " + e.getMessage(), e); |
|||
return R.fail(e.getMessage(), null); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 删除调查人员 |
|||
*/ |
|||
//"删除调查人员") |
|||
@Log(title = "调查人员管理", businessType = BusinessType.DELETE) |
|||
@PostMapping("/investigator/delete") |
|||
public R deleteInvestigator(@RequestBody DeleteInvestigatorReq req) { |
|||
try { |
|||
// 删除调查人员的同时,操作记录也应该删除 |
|||
taskService.deleteInvestigator(req.getId()); |
|||
return R.ok(null); |
|||
} catch (Exception e) { |
|||
log.error("删除调查人员信息: " + e.getMessage(), e); |
|||
return R.fail(e.getMessage(), null); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 调查人员列表 |
|||
*/ |
|||
@GetMapping("/investigator/list") |
|||
public TableDataInfo<SysUser> investigatorList(SysUser user, PageQuery pageQuery) { |
|||
user.setRoleId(Constants.INVESTIGATOR_ROLE_ID); |
|||
return userService.selectPageUserList(user,pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 登录记录 |
|||
*/ |
|||
//"登录记录") |
|||
@PostMapping("/queryOperateLog") |
|||
public TableDataInfo<LoginRecordEntity> queryOperateLog(@RequestBody QueryOperateLogReq req) { |
|||
return operLogService.queryOperateLogV2(req); |
|||
} |
|||
|
|||
/** |
|||
* 案件编辑 |
|||
*/ |
|||
@UpdateLog( |
|||
title = "案件管理", |
|||
businessType = BusinessType.UPDATE, |
|||
mapperClass = SysLawCaseMapper.class, |
|||
methodName = "selectById") |
|||
//"案件编辑") |
|||
@PostMapping("/lawCase/edit") |
|||
public R editLawCase(@RequestBody EditLawCaseReq req) { |
|||
try { |
|||
taskService.editLawCase(req); |
|||
return R.ok(null); |
|||
} catch (Exception e) { |
|||
log.error("案件编辑错误: " + e.getMessage(), e); |
|||
return R.fail(e.getMessage(), null); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 案列列表 |
|||
*/ |
|||
@PostMapping("/lawCase/list") |
|||
public TableDataInfo<LawCaseResp> lawCaseList(@RequestBody LawCaseListReq req) { |
|||
|
|||
TableDataInfo<SysLawCase> page = lawCaseService.getLawCaseList(req); |
|||
|
|||
List<LawCaseResp> records = new ArrayList<>(); |
|||
|
|||
for (SysLawCase lawCase : page.getRows()) { |
|||
LawCaseResp resp = new LawCaseResp(); |
|||
|
|||
String caseId = lawCase.getId(); |
|||
|
|||
resp.setId(caseId); |
|||
resp.setName(lawCase.getName()); |
|||
resp.setCreateTime(lawCase.getCreateTime()); |
|||
resp.setRemark(lawCase.getRemark()); |
|||
|
|||
// 根据案件Id,查询关联的调查人员 |
|||
String investigators = lawCase.getInvestigatorStr(); |
|||
if(StrUtil.isNotEmpty(investigators)){ |
|||
List<String> idNoList; |
|||
if(investigators.contains(",")){ |
|||
idNoList = Arrays.asList(investigators.split(",")); |
|||
}else { |
|||
idNoList = Collections.singletonList(investigators); |
|||
} |
|||
if(CollectionUtil.isNotEmpty(idNoList)){ |
|||
LambdaQueryWrapper<SysUser> userLqw = Wrappers.lambdaQuery(); |
|||
userLqw.in(SysUser::getIdCardNo, idNoList); |
|||
List<SysUser> sysUsers = userMapper.selectList(userLqw); |
|||
// 根据案件Id,查询关联的调查人员 |
|||
List<String> investigatorNames = new ArrayList<>(); |
|||
List<Long> investigatorIds = new ArrayList<>(); |
|||
for (SysUser user : sysUsers) { |
|||
investigatorNames.add(user.getUserName()); |
|||
investigatorIds.add(user.getUserId()); |
|||
} |
|||
resp.setInvestigators(String.join("、", investigatorNames)); |
|||
resp.setIds(investigatorIds); |
|||
} |
|||
} |
|||
|
|||
// 添加 |
|||
records.add(resp); |
|||
} |
|||
TableDataInfo<LawCaseResp> tableDataInfo = TableDataInfo.build(); |
|||
tableDataInfo.setRows(records); |
|||
tableDataInfo.setTotal(page.getTotal()); |
|||
return tableDataInfo; |
|||
} |
|||
|
|||
/** |
|||
* 新增案件时,所有调查人员信息 |
|||
*/ |
|||
@GetMapping("/addLawCase/investigator/list") |
|||
public R getInvestigatorsForAddLawCase() { |
|||
try { |
|||
SysUser user = new SysUser(); |
|||
user.setRoleId(Constants.INVESTIGATOR_ROLE_ID); |
|||
List<SysUser> investigators = userService.selectUserList(user); |
|||
return R.ok(investigators); |
|||
} catch (Exception e) { |
|||
log.error("新增案件,获取调查员人列表错误:" + e.getMessage(), e); |
|||
return R.fail(e.getMessage(), null); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 新增案件 |
|||
*/ |
|||
//"新增案件") |
|||
@Log(title = "新增案件", businessType = BusinessType.INSERT) |
|||
@PostMapping("/addLawCase") |
|||
public R addLawCase(@RequestBody AddLawCaseReq req) { |
|||
|
|||
lawCaseService.addLawCase(req); |
|||
|
|||
return R.ok(null); |
|||
} |
|||
|
|||
/** |
|||
* 领导权限转移 |
|||
*/ |
|||
//"领导权限转移") |
|||
@Log(title = "领导权限转移", businessType = BusinessType.GRANT) |
|||
@PostMapping("/transfer") |
|||
public R transfer(@RequestBody LeaderTransferReq req) { |
|||
// 权限转移后,当前账号将失效且无法再登录 |
|||
// 创建账号,根据姓名和身份证号 |
|||
String name = req.getName(); |
|||
String encryptedIdCardNo = req.getIdCardNo(); |
|||
String idCardNo = DesUtil.decrypt(encryptedIdCardNo); |
|||
|
|||
taskService.transform(idCardNo, name); |
|||
|
|||
// 冻结当前案管领导账号 |
|||
userService.freezeUser(LoginHelper.getUserId()); |
|||
|
|||
return R.ok(); |
|||
} |
|||
|
|||
//"查询字段统计值") |
|||
@PostMapping("/getFieldsValueCount") |
|||
public R getFieldsValueCount(@RequestBody GetLoginRecordFieldValueCountReq req) throws Exception { |
|||
return R.ok(loginRecordHelper.getFieldsValueCount(req)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,161 @@ |
|||
package com.inscloudtech.web.controller.monitor; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import cn.hutool.core.collection.CollUtil; |
|||
import com.inscloudtech.common.constant.CacheConstants; |
|||
import com.inscloudtech.common.constant.CacheNames; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.utils.JsonUtils; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
import com.inscloudtech.common.utils.redis.CacheUtils; |
|||
import com.inscloudtech.common.utils.redis.RedisUtils; |
|||
import com.inscloudtech.system.domain.SysCache; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.redisson.spring.data.connection.RedissonConnectionFactory; |
|||
import org.springframework.data.redis.connection.RedisConnection; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.*; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 缓存监控 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/monitor/cache") |
|||
public class CacheController { |
|||
|
|||
private final RedissonConnectionFactory connectionFactory; |
|||
|
|||
private final static List<SysCache> CACHES = new ArrayList<>(); |
|||
|
|||
static { |
|||
CACHES.add(new SysCache(CacheConstants.ONLINE_TOKEN_KEY, "在线用户")); |
|||
CACHES.add(new SysCache(CacheNames.SYS_CONFIG, "配置信息")); |
|||
CACHES.add(new SysCache(CacheNames.SYS_DICT, "数据字典")); |
|||
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(CacheNames.SYS_OSS_CONFIG, "OSS配置")); |
|||
CACHES.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数")); |
|||
} |
|||
/** |
|||
* 获取缓存监控列表 |
|||
*/ |
|||
@SaCheckPermission("monitor:cache:list") |
|||
@GetMapping() |
|||
public R<Map<String, Object>> getInfo() throws Exception { |
|||
RedisConnection connection = connectionFactory.getConnection(); |
|||
Properties info = connection.info(); |
|||
Properties commandStats = connection.info("commandstats"); |
|||
Long dbSize = connection.dbSize(); |
|||
|
|||
Map<String, Object> result = new HashMap<>(3); |
|||
result.put("info", info); |
|||
result.put("dbSize", dbSize); |
|||
|
|||
List<Map<String, String>> pieList = new ArrayList<>(); |
|||
if (commandStats != null) { |
|||
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 R.ok(result); |
|||
} |
|||
/** |
|||
* 获取缓存监控缓存名列表 |
|||
*/ |
|||
@SaCheckPermission("monitor:cache:list") |
|||
@GetMapping("/getNames") |
|||
public R<List<SysCache>> cache() { |
|||
return R.ok(CACHES); |
|||
} |
|||
/** |
|||
* 获取缓存监控Key列表 |
|||
* |
|||
* @param cacheName 缓存名 |
|||
*/ |
|||
@SaCheckPermission("monitor:cache:list") |
|||
@GetMapping("/getKeys/{cacheName}") |
|||
public R<Collection<String>> getCacheKeys(@PathVariable String cacheName) { |
|||
Collection<String> cacheKeys = new HashSet<>(0); |
|||
if (isCacheNames(cacheName)) { |
|||
Set<Object> keys = CacheUtils.keys(cacheName); |
|||
if (CollUtil.isNotEmpty(keys)) { |
|||
cacheKeys = keys.stream().map(Object::toString).collect(Collectors.toList()); |
|||
} |
|||
} else { |
|||
cacheKeys = RedisUtils.keys(cacheName + "*"); |
|||
} |
|||
return R.ok(cacheKeys); |
|||
} |
|||
/** |
|||
* 获取缓存监控缓存值详情 |
|||
* |
|||
* @param cacheName 缓存名 |
|||
* @param cacheKey 缓存key |
|||
*/ |
|||
@SaCheckPermission("monitor:cache:list") |
|||
@GetMapping("/getValue/{cacheName}/{cacheKey}") |
|||
public R<SysCache> getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) { |
|||
Object cacheValue; |
|||
if (isCacheNames(cacheName)) { |
|||
cacheValue = CacheUtils.get(cacheName, cacheKey); |
|||
} else { |
|||
cacheValue = RedisUtils.getCacheObject(cacheKey); |
|||
} |
|||
SysCache sysCache = new SysCache(cacheName, cacheKey, JsonUtils.toJsonString(cacheValue)); |
|||
return R.ok(sysCache); |
|||
} |
|||
/** |
|||
* 清理缓存监控缓存名 |
|||
* |
|||
* @param cacheName 缓存名 |
|||
*/ |
|||
@SaCheckPermission("monitor:cache:list") |
|||
@DeleteMapping("/clearCacheName/{cacheName}") |
|||
public R<Void> clearCacheName(@PathVariable String cacheName) { |
|||
if (isCacheNames(cacheName)) { |
|||
CacheUtils.clear(cacheName); |
|||
} else { |
|||
RedisUtils.deleteKeys(cacheName + "*"); |
|||
} |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 清理缓存监控Key |
|||
* |
|||
* @param cacheKey key名 |
|||
*/ |
|||
@SaCheckPermission("monitor:cache:list") |
|||
@DeleteMapping("/clearCacheKey/{cacheName}/{cacheKey}") |
|||
public R<Void> clearCacheKey(@PathVariable String cacheName, @PathVariable String cacheKey) { |
|||
if (isCacheNames(cacheName)) { |
|||
CacheUtils.evict(cacheName, cacheKey); |
|||
} else { |
|||
RedisUtils.deleteObject(cacheKey); |
|||
} |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 清理全部缓存监控 |
|||
*/ |
|||
@SaCheckPermission("monitor:cache:list") |
|||
@DeleteMapping("/clearCacheAll") |
|||
public R<Void> clearCacheAll() { |
|||
RedisUtils.deleteKeys("*"); |
|||
return R.ok(); |
|||
} |
|||
|
|||
private boolean isCacheNames(String cacheName) { |
|||
return !StringUtils.contains(cacheName, ":"); |
|||
} |
|||
} |
@ -0,0 +1,84 @@ |
|||
package com.inscloudtech.web.controller.monitor; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.constant.CacheConstants; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.common.utils.redis.RedisUtils; |
|||
import com.inscloudtech.system.domain.SysLogininfor; |
|||
import com.inscloudtech.system.service.ISysLogininforService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 系统访问记录 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/monitor/logininfor") |
|||
public class SysLogininforController extends BaseController { |
|||
|
|||
private final ISysLogininforService logininforService; |
|||
/** |
|||
* 获取系统访问记录列表 |
|||
*/ |
|||
@SaCheckPermission("monitor:logininfor:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysLogininfor> list(SysLogininfor logininfor, PageQuery pageQuery) { |
|||
return logininforService.selectPageLogininforList(logininfor, pageQuery); |
|||
} |
|||
/** |
|||
* 导出系统访问记录列表 |
|||
*/ |
|||
@Log(title = "登录日志", businessType = BusinessType.EXPORT) |
|||
@SaCheckPermission("monitor:logininfor:export") |
|||
@PostMapping("/export") |
|||
public void export(SysLogininfor logininfor, HttpServletResponse response) { |
|||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
|||
ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response); |
|||
} |
|||
/** |
|||
* 批量删除登录日志 |
|||
* @param infoIds 日志ids |
|||
*/ |
|||
@SaCheckPermission("monitor:logininfor:remove") |
|||
@Log(title = "登录日志", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{infoIds}") |
|||
public R<Void> remove(@PathVariable Long[] infoIds) { |
|||
return toAjax(logininforService.deleteLogininforByIds(infoIds)); |
|||
} |
|||
/** |
|||
* 清理系统访问记录 |
|||
*/ |
|||
@SaCheckPermission("monitor:logininfor:remove") |
|||
@Log(title = "登录日志", businessType = BusinessType.CLEAN) |
|||
@DeleteMapping("/clean") |
|||
public R<Void> clean() { |
|||
logininforService.cleanLogininfor(); |
|||
return R.ok(); |
|||
} |
|||
|
|||
@SaCheckPermission("monitor:logininfor:unlock") |
|||
@Log(title = "账户解锁", businessType = BusinessType.OTHER) |
|||
@GetMapping("/unlock/{userName}") |
|||
public R<Void> unlock(@PathVariable("userName") String userName) { |
|||
String loginName = CacheConstants.PWD_ERR_CNT_KEY + userName; |
|||
if (RedisUtils.hasKey(loginName)) { |
|||
RedisUtils.deleteObject(loginName); |
|||
} |
|||
return R.ok(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,101 @@ |
|||
package com.inscloudtech.web.controller.monitor; |
|||
|
|||
import java.util.List; |
|||
import java.util.Arrays; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import com.inscloudtech.common.annotation.RepeatSubmit; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.validate.AddGroup; |
|||
import com.inscloudtech.common.core.validate.EditGroup; |
|||
import com.inscloudtech.common.core.validate.QueryGroup; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.system.domain.vo.SysOperUpdateLogVo; |
|||
import com.inscloudtech.system.domain.bo.SysOperUpdateLogBo; |
|||
import com.inscloudtech.system.service.ISysOperUpdateLogService; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 操作数据更新记录 |
|||
* |
|||
* @author cas |
|||
* @date 2023-05-18 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/monitor/operUpdateLog") |
|||
public class SysOperUpdateLogController extends BaseController { |
|||
|
|||
private final ISysOperUpdateLogService iSysOperUpdateLogService; |
|||
/** |
|||
* 查询操作日志记录列表 |
|||
*/ |
|||
// @SaCheckPermission("system:operUpdateLog:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysOperUpdateLogVo> list(SysOperUpdateLogBo bo, PageQuery pageQuery) { |
|||
return iSysOperUpdateLogService.queryPageList(bo, pageQuery); |
|||
} |
|||
/** |
|||
* 导出操作日志记录列表 |
|||
*/ |
|||
@SaCheckPermission("system:operUpdateLog:export") |
|||
@Log(title = "操作日志记录", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(SysOperUpdateLogBo bo, HttpServletResponse response) { |
|||
List<SysOperUpdateLogVo> list = iSysOperUpdateLogService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "操作日志记录", SysOperUpdateLogVo.class, response); |
|||
} |
|||
/** |
|||
* 获取操作日志记录详细信息 |
|||
* |
|||
* @param operId 主键 |
|||
*/ |
|||
@SaCheckPermission("system:operUpdateLog:query") |
|||
@GetMapping("/{operId}") |
|||
public R<SysOperUpdateLogVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long operId) { |
|||
return R.ok(iSysOperUpdateLogService.queryById(operId)); |
|||
} |
|||
/** |
|||
* 新增操作日志记录 |
|||
*/ |
|||
@SaCheckPermission("system:operUpdateLog:add") |
|||
@Log(title = "操作日志记录", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysOperUpdateLogBo bo) { |
|||
return toAjax(iSysOperUpdateLogService.insertByBo(bo)); |
|||
} |
|||
/** |
|||
* 修改操作日志记录 |
|||
*/ |
|||
@SaCheckPermission("system:operUpdateLog:edit") |
|||
@Log(title = "操作日志记录", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysOperUpdateLogBo bo) { |
|||
return toAjax(iSysOperUpdateLogService.updateByBo(bo)); |
|||
} |
|||
/** |
|||
* 删除操作日志记录 |
|||
* |
|||
* @param operIds 主键串 |
|||
*/ |
|||
@SaCheckPermission("system:operUpdateLog:remove") |
|||
@Log(title = "操作日志记录", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{operIds}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] operIds) { |
|||
return toAjax(iSysOperUpdateLogService.deleteWithValidByIds(Arrays.asList(operIds), true)); |
|||
} |
|||
} |
@ -0,0 +1,70 @@ |
|||
package com.inscloudtech.web.controller.monitor; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.system.domain.SysOperLog; |
|||
import com.inscloudtech.system.service.ISysOperLogService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 操作日志记录 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/monitor/operlog") |
|||
public class SysOperlogController extends BaseController { |
|||
|
|||
private final ISysOperLogService operLogService; |
|||
/** |
|||
* 获取操作日志记录列表 |
|||
*/ |
|||
@SaCheckPermission("monitor:operlog:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysOperLog> list(SysOperLog operLog, PageQuery pageQuery) { |
|||
return operLogService.selectPageOperLogList(operLog, pageQuery); |
|||
} |
|||
/** |
|||
* 导出操作日志记录列表 |
|||
*/ |
|||
@Log(title = "操作日志", businessType = BusinessType.EXPORT) |
|||
@SaCheckPermission("monitor:operlog:export") |
|||
@PostMapping("/export") |
|||
public void export(SysOperLog operLog, HttpServletResponse response) { |
|||
List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
|||
ExcelUtil.exportExcel(list, "操作日志", SysOperLog.class, response); |
|||
} |
|||
/** |
|||
* 批量删除操作日志记录 |
|||
* @param operIds 日志ids |
|||
*/ |
|||
@Log(title = "操作日志", businessType = BusinessType.DELETE) |
|||
@SaCheckPermission("monitor:operlog:remove") |
|||
@DeleteMapping("/{operIds}") |
|||
public R<Void> remove(@PathVariable Long[] operIds) { |
|||
return toAjax(operLogService.deleteOperLogByIds(operIds)); |
|||
} |
|||
/** |
|||
* 清理操作日志记录 |
|||
*/ |
|||
@Log(title = "操作日志", businessType = BusinessType.CLEAN) |
|||
@SaCheckPermission("monitor:operlog:remove") |
|||
@DeleteMapping("/clean") |
|||
public R<Void> clean() { |
|||
operLogService.cleanOperLog(); |
|||
return R.ok(); |
|||
} |
|||
} |
@ -0,0 +1,88 @@ |
|||
package com.inscloudtech.web.controller.monitor; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import cn.dev33.satoken.exception.NotLoginException; |
|||
import cn.dev33.satoken.stp.StpUtil; |
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.constant.CacheConstants; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.dto.UserOnlineDTO; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.StreamUtils; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
import com.inscloudtech.common.utils.redis.RedisUtils; |
|||
import com.inscloudtech.system.domain.SysUserOnline; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 在线用户监控 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/monitor/online") |
|||
public class SysUserOnlineController extends BaseController { |
|||
/** |
|||
* 获取在线用户监控列表 |
|||
* |
|||
* @param ipaddr IP地址 |
|||
* @param userName 用户名 |
|||
*/ |
|||
@SaCheckPermission("monitor:online:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysUserOnline> list(String ipaddr, String userName) { |
|||
// 获取所有未过期的 token |
|||
List<String> keys = StpUtil.searchTokenValue("", 0, -1, false); |
|||
List<UserOnlineDTO> userOnlineDTOList = new ArrayList<>(); |
|||
for (String key : keys) { |
|||
String token = StringUtils.substringAfterLast(key, ":"); |
|||
// 如果已经过期则跳过 |
|||
if (StpUtil.stpLogic.getTokenActivityTimeoutByToken(token) < -1) { |
|||
continue; |
|||
} |
|||
userOnlineDTOList.add(RedisUtils.getCacheObject(CacheConstants.ONLINE_TOKEN_KEY + token)); |
|||
} |
|||
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) { |
|||
userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline -> |
|||
StringUtils.equals(ipaddr, userOnline.getIpaddr()) && |
|||
StringUtils.equals(userName, userOnline.getUserName()) |
|||
); |
|||
} else if (StringUtils.isNotEmpty(ipaddr)) { |
|||
userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline -> |
|||
StringUtils.equals(ipaddr, userOnline.getIpaddr()) |
|||
); |
|||
} else if (StringUtils.isNotEmpty(userName)) { |
|||
userOnlineDTOList = StreamUtils.filter(userOnlineDTOList, userOnline -> |
|||
StringUtils.equals(userName, userOnline.getUserName()) |
|||
); |
|||
} |
|||
Collections.reverse(userOnlineDTOList); |
|||
userOnlineDTOList.removeAll(Collections.singleton(null)); |
|||
List<SysUserOnline> userOnlineList = BeanUtil.copyToList(userOnlineDTOList, SysUserOnline.class); |
|||
return TableDataInfo.build(userOnlineList); |
|||
} |
|||
/** |
|||
* 强退用户 |
|||
* |
|||
* @param tokenId token值 |
|||
*/ |
|||
@SaCheckPermission("monitor:online:forceLogout") |
|||
@Log(title = "在线用户", businessType = BusinessType.FORCE) |
|||
@DeleteMapping("/{tokenId}") |
|||
public R<Void> forceLogout(@PathVariable String tokenId) { |
|||
try { |
|||
StpUtil.kickoutByTokenValue(tokenId); |
|||
} catch (NotLoginException ignored) { |
|||
} |
|||
return R.ok(); |
|||
} |
|||
} |
@ -0,0 +1,128 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.constant.UserConstants; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.system.domain.SysConfig; |
|||
import com.inscloudtech.system.service.ISysConfigService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 参数配置 信息操作处理 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/config") |
|||
public class SysConfigController extends BaseController { |
|||
|
|||
private final ISysConfigService configService; |
|||
/** |
|||
* 获取参数配置列表 |
|||
*/ |
|||
@SaCheckPermission("system:config:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysConfig> list(SysConfig config, PageQuery pageQuery) { |
|||
return configService.selectPageConfigList(config, pageQuery); |
|||
} |
|||
/** |
|||
* 导出参数配置列表 |
|||
*/ |
|||
@Log(title = "参数管理", businessType = BusinessType.EXPORT) |
|||
@SaCheckPermission("system:config:export") |
|||
@PostMapping("/export") |
|||
public void export(SysConfig config, HttpServletResponse response) { |
|||
List<SysConfig> list = configService.selectConfigList(config); |
|||
ExcelUtil.exportExcel(list, "参数数据", SysConfig.class, response); |
|||
} |
|||
/** |
|||
* 根据参数编号获取详细信息 |
|||
* |
|||
* @param configId 参数ID |
|||
*/ |
|||
@SaCheckPermission("system:config:query") |
|||
@GetMapping(value = "/{configId}") |
|||
public R<SysConfig> getInfo(@PathVariable Long configId) { |
|||
return R.ok(configService.selectConfigById(configId)); |
|||
} |
|||
/** |
|||
* 根据参数键名查询参数值 |
|||
* |
|||
* @param configKey 参数Key |
|||
*/ |
|||
@GetMapping(value = "/configKey/{configKey}") |
|||
public R<Void> getConfigKey(@PathVariable String configKey) { |
|||
return R.ok(configService.selectConfigByKey(configKey)); |
|||
} |
|||
/** |
|||
* 新增参数配置 |
|||
*/ |
|||
@SaCheckPermission("system:config:add") |
|||
@Log(title = "参数管理", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public R<Void> add(@Validated @RequestBody SysConfig config) { |
|||
if (!configService.checkConfigKeyUnique(config)) { |
|||
return R.fail("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
|||
} |
|||
configService.insertConfig(config); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 修改参数配置 |
|||
*/ |
|||
@SaCheckPermission("system:config:edit") |
|||
@Log(title = "参数管理", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public R<Void> edit(@Validated @RequestBody SysConfig config) { |
|||
if (!configService.checkConfigKeyUnique(config)) { |
|||
return R.fail("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
|||
} |
|||
configService.updateConfig(config); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 根据参数键名修改参数配置 |
|||
*/ |
|||
@SaCheckPermission("system:config:edit") |
|||
@Log(title = "参数管理", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/updateByKey") |
|||
public R<Void> updateByKey(@RequestBody SysConfig config) { |
|||
configService.updateConfig(config); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 删除参数配置 |
|||
* |
|||
* @param configIds 参数ID串 |
|||
*/ |
|||
@SaCheckPermission("system:config:remove") |
|||
@Log(title = "参数管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{configIds}") |
|||
public R<Void> remove(@PathVariable Long[] configIds) { |
|||
configService.deleteConfigByIds(configIds); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 刷新参数缓存 |
|||
*/ |
|||
@SaCheckPermission("system:config:remove") |
|||
@Log(title = "参数管理", businessType = BusinessType.CLEAN) |
|||
@DeleteMapping("/refreshCache") |
|||
public R<Void> refreshCache() { |
|||
configService.resetConfigCache(); |
|||
return R.ok(); |
|||
} |
|||
} |
@ -0,0 +1,116 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import cn.hutool.core.convert.Convert; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.common.constant.UserConstants; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.entity.SysDept; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
import com.inscloudtech.system.mapper.SysDeptMapper; |
|||
import com.inscloudtech.system.service.ISysDeptService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 部门信息 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/dept") |
|||
public class SysDeptController extends BaseController { |
|||
|
|||
private final ISysDeptService deptService; |
|||
/** |
|||
* 获取部门列表 |
|||
*/ |
|||
// @SaCheckPermission("system:dept:list") |
|||
@GetMapping("/list") |
|||
public R<List<SysDept>> list(SysDept dept) { |
|||
List<SysDept> depts = deptService.selectDeptList(dept); |
|||
return R.ok(depts); |
|||
} |
|||
/** |
|||
* 查询部门列表(排除节点) |
|||
* |
|||
* @param deptId 部门ID |
|||
*/ |
|||
// @SaCheckPermission("system:dept:list") |
|||
@GetMapping("/list/exclude/{deptId}") |
|||
public R<List<SysDept>> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { |
|||
List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
|||
depts.removeIf(d -> d.getDeptId().equals(deptId) |
|||
|| StringUtils.splitList(d.getAncestors()).contains(Convert.toStr(deptId))); |
|||
return R.ok(depts); |
|||
} |
|||
/** |
|||
* 根据部门编号获取详细信息 |
|||
* |
|||
* @param deptId 部门ID |
|||
*/ |
|||
@SaCheckPermission("system:dept:query") |
|||
@GetMapping(value = "/{deptId}") |
|||
public R<SysDept> getInfo(@PathVariable Long deptId) { |
|||
deptService.checkDeptDataScope(deptId); |
|||
return R.ok(deptService.selectDeptById(deptId)); |
|||
} |
|||
/** |
|||
* 新增部门 |
|||
*/ |
|||
@SaCheckPermission("system:dept:add") |
|||
@Log(title = "部门管理", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public R<Void> add(@Validated @RequestBody SysDept dept) { |
|||
if (!deptService.checkDeptNameUnique(dept)) { |
|||
return R.fail("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
|||
} |
|||
return toAjax(deptService.insertDept(dept)); |
|||
} |
|||
/** |
|||
* 修改部门 |
|||
*/ |
|||
@SaCheckPermission("system:dept:edit") |
|||
// @Log(title = "部门管理", businessType = BusinessType.UPDATE) |
|||
@UpdateLog(title = "组织机构",mapperClass = ISysDeptService.class,entityClass = SysDept.class,methodName = "selectDeptById", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public R<Void> edit(@Validated @RequestBody SysDept dept) { |
|||
Long deptId = dept.getDeptId(); |
|||
deptService.checkDeptDataScope(deptId); |
|||
if (!deptService.checkDeptNameUnique(dept)) { |
|||
return R.fail("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
|||
} else if (dept.getParentId().equals(deptId)) { |
|||
return R.fail("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); |
|||
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) |
|||
&& deptService.selectNormalChildrenDeptById(deptId) > 0) { |
|||
return R.fail("该部门包含未停用的子部门!"); |
|||
} |
|||
return toAjax(deptService.updateDept(dept)); |
|||
} |
|||
/** |
|||
* 删除部门 |
|||
* |
|||
* @param deptId 部门ID |
|||
*/ |
|||
@SaCheckPermission("system:dept:remove") |
|||
@Log(title = "部门管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{deptId}") |
|||
public R<Void> remove(@PathVariable Long deptId) { |
|||
if (deptService.hasChildByDeptId(deptId)) { |
|||
return R.warn("存在下级部门,不允许删除"); |
|||
} |
|||
if (deptService.checkDeptExistUser(deptId)) { |
|||
return R.warn("部门存在用户,不允许删除"); |
|||
} |
|||
deptService.checkDeptDataScope(deptId); |
|||
return toAjax(deptService.deleteDeptById(deptId)); |
|||
} |
|||
} |
@ -0,0 +1,107 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.entity.SysDictData; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.system.mapper.SysDictDataMapper; |
|||
import com.inscloudtech.system.service.ISysDictDataService; |
|||
import com.inscloudtech.system.service.ISysDictTypeService; |
|||
import com.inscloudtech.system.service.ISysUserService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 数据字典信息 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/dict/data") |
|||
public class SysDictDataController extends BaseController { |
|||
|
|||
private final ISysDictDataService dictDataService; |
|||
private final ISysDictTypeService dictTypeService; |
|||
/** |
|||
* 查询字典数据列表 |
|||
*/ |
|||
// @SaCheckPermission("system:dict:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysDictData> list(SysDictData dictData, PageQuery pageQuery) { |
|||
return dictDataService.selectPageDictDataList(dictData, pageQuery); |
|||
} |
|||
/** |
|||
* 导出字典数据列表 |
|||
*/ |
|||
@Log(title = "字典数据", businessType = BusinessType.EXPORT) |
|||
@SaCheckPermission("system:dict:export") |
|||
@PostMapping("/export") |
|||
public void export(SysDictData dictData, HttpServletResponse response) { |
|||
List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
|||
ExcelUtil.exportExcel(list, "字典数据", SysDictData.class, response); |
|||
} |
|||
/** |
|||
* 查询字典数据详细 |
|||
* |
|||
* @param dictCode 字典code |
|||
*/ |
|||
@SaCheckPermission("system:dict:query") |
|||
@GetMapping(value = "/{dictCode}") |
|||
public R<SysDictData> getInfo(@PathVariable Long dictCode) { |
|||
return R.ok(dictDataService.selectDictDataById(dictCode)); |
|||
} |
|||
/** |
|||
* 根据字典类型查询字典数据信息 |
|||
* |
|||
* @param dictType 字典类型 |
|||
*/ |
|||
@GetMapping(value = "/type/{dictType}") |
|||
public R<List<SysDictData>> dictType(@PathVariable String dictType) { |
|||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
|||
return R.ok(data); |
|||
} |
|||
/** |
|||
* 新增字典类型 |
|||
*/ |
|||
@SaCheckPermission("system:dict:add") |
|||
@Log(title = "字典数据", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public R<Void> add(@Validated @RequestBody SysDictData dict) { |
|||
dictDataService.insertDictData(dict); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 修改保存字典类型 |
|||
*/ |
|||
@SaCheckPermission("system:dict:edit") |
|||
@UpdateLog(title = "字典数据",mapperClass = SysDictDataMapper.class, businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public R<Void> edit(@Validated @RequestBody SysDictData dict) { |
|||
dictDataService.updateDictData(dict); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 删除字典类型 |
|||
* |
|||
* @param dictCodes 字典code串 |
|||
*/ |
|||
@SaCheckPermission("system:dict:remove") |
|||
@Log(title = "字典类型", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{dictCodes}") |
|||
public R<Void> remove(@PathVariable Long[] dictCodes) { |
|||
dictDataService.deleteDictDataByIds(dictCodes); |
|||
return R.ok(); |
|||
} |
|||
} |
@ -0,0 +1,119 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.entity.SysDictType; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.system.mapper.SysDictTypeMapper; |
|||
import com.inscloudtech.system.service.ISysDictTypeService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 数据字典信息 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/dict/type") |
|||
public class SysDictTypeController extends BaseController { |
|||
|
|||
private final ISysDictTypeService dictTypeService; |
|||
/** |
|||
* 查询字典类型列表 |
|||
*/ |
|||
// @SaCheckPermission("system:dict:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysDictType> list(SysDictType dictType, PageQuery pageQuery) { |
|||
return dictTypeService.selectPageDictTypeList(dictType, pageQuery); |
|||
} |
|||
/** |
|||
* 导出字典类型列表 |
|||
*/ |
|||
@Log(title = "字典管理", businessType = BusinessType.EXPORT) |
|||
@SaCheckPermission("system:dict:export") |
|||
@PostMapping("/export") |
|||
public void export(SysDictType dictType, HttpServletResponse response) { |
|||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
|||
ExcelUtil.exportExcel(list, "字典管理", SysDictType.class, response); |
|||
} |
|||
/** |
|||
* 查询字典类型详细 |
|||
* |
|||
* @param dictId 字典ID |
|||
*/ |
|||
@SaCheckPermission("system:dict:query") |
|||
@GetMapping(value = "/{dictId}") |
|||
public R<SysDictType> getInfo(@PathVariable Long dictId) { |
|||
return R.ok(dictTypeService.selectDictTypeById(dictId)); |
|||
} |
|||
/** |
|||
* 新增字典类型 |
|||
*/ |
|||
@SaCheckPermission("system:dict:add") |
|||
@Log(title = "字典管理", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public R<Void> add(@Validated @RequestBody SysDictType dict) { |
|||
if (!dictTypeService.checkDictTypeUnique(dict)) { |
|||
return R.fail("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
|||
} |
|||
dictTypeService.insertDictType(dict); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 修改字典类型 |
|||
*/ |
|||
@SaCheckPermission("system:dict:edit") |
|||
// @Log(title = "字典管理", businessType = BusinessType.UPDATE) |
|||
@UpdateLog(title = "字典管理",mapperClass = SysDictTypeMapper.class, businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public R<Void> edit(@Validated @RequestBody SysDictType dict) { |
|||
if (!dictTypeService.checkDictTypeUnique(dict)) { |
|||
return R.fail("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
|||
} |
|||
dictTypeService.updateDictType(dict); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 删除字典类型 |
|||
* |
|||
* @param dictIds 字典ID串 |
|||
*/ |
|||
@SaCheckPermission("system:dict:remove") |
|||
@Log(title = "字典管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{dictIds}") |
|||
public R<Void> remove(@PathVariable Long[] dictIds) { |
|||
dictTypeService.deleteDictTypeByIds(dictIds); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 刷新字典缓存 |
|||
*/ |
|||
@SaCheckPermission("system:dict:remove") |
|||
@Log(title = "字典管理", businessType = BusinessType.CLEAN) |
|||
@DeleteMapping("/refreshCache") |
|||
public R<Void> refreshCache() { |
|||
dictTypeService.resetDictCache(); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 获取字典选择框列表 |
|||
*/ |
|||
@GetMapping("/optionselect") |
|||
public R<List<SysDictType>> optionselect() { |
|||
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); |
|||
return R.ok(dictTypes); |
|||
} |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaIgnore; |
|||
import cn.hutool.json.JSONObject; |
|||
import com.inscloudtech.common.config.ProjectConfig; |
|||
import lombok.RequiredArgsConstructor; |
|||
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.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 首页 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
public class SysIndexController { |
|||
/** |
|||
* 系统基础配置 |
|||
*/ |
|||
private final ProjectConfig wuziConfig; |
|||
|
|||
} |
@ -0,0 +1,155 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaIgnore; |
|||
import com.inscloudtech.common.constant.Constants; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.entity.SysMenu; |
|||
import com.inscloudtech.common.core.domain.entity.SysUser; |
|||
import com.inscloudtech.common.core.domain.model.EmailLoginBody; |
|||
import com.inscloudtech.common.core.domain.model.LoginBody; |
|||
import com.inscloudtech.common.core.domain.model.LoginUser; |
|||
import com.inscloudtech.common.core.domain.model.SmsLoginBody; |
|||
import com.inscloudtech.common.helper.LoginHelper; |
|||
import com.inscloudtech.system.domain.vo.RouterVo; |
|||
import com.inscloudtech.system.service.ISysMenuService; |
|||
import com.inscloudtech.system.service.ISysUserService; |
|||
import com.inscloudtech.system.service.SysLoginService; |
|||
import lombok.RequiredArgsConstructor; |
|||
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.RestController; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 登录验证 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
public class SysLoginController { |
|||
|
|||
private final SysLoginService loginService; |
|||
private final ISysMenuService menuService; |
|||
private final ISysUserService userService; |
|||
/** |
|||
* 登录方法 |
|||
* |
|||
* @param loginBody 登录信息 |
|||
* @return 结果 |
|||
*/ |
|||
@SaIgnore |
|||
@PostMapping("/login") |
|||
public R<Map<String, Object>> login(@Validated @RequestBody LoginBody loginBody) { |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
// 生成令牌 |
|||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), |
|||
loginBody.getUuid()); |
|||
ajax.put(Constants.TOKEN, token); |
|||
return R.ok(ajax); |
|||
} |
|||
/** |
|||
* 登录方法 |
|||
* |
|||
* @param loginBody 登录信息 |
|||
* @return 结果 |
|||
*/ |
|||
@SaIgnore |
|||
@PostMapping("/usernameLogin") |
|||
public R<Map<String, Object>> usernameLogin(@Validated @RequestBody LoginBody loginBody) { |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
// 生成令牌 |
|||
String token = loginService.usernameLogin(loginBody.getUsername(),loginBody.getRole()); |
|||
ajax.put(Constants.TOKEN, token); |
|||
ajax.put("username", loginBody.getUsername()); |
|||
return R.ok(ajax); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 短信登录 |
|||
* |
|||
* @param smsLoginBody 登录信息 |
|||
* @return 结果 |
|||
*/ |
|||
@SaIgnore |
|||
@PostMapping("/smsLogin") |
|||
public R<Map<String, Object>> smsLogin(@Validated @RequestBody SmsLoginBody smsLoginBody) { |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
// 生成令牌 |
|||
String token = loginService.smsLogin(smsLoginBody.getPhonenumber(), smsLoginBody.getSmsCode()); |
|||
ajax.put(Constants.TOKEN, token); |
|||
return R.ok(ajax); |
|||
} |
|||
/** |
|||
* 邮件登录 |
|||
* |
|||
* @param body 登录信息 |
|||
* @return 结果 |
|||
*/ |
|||
@PostMapping("/emailLogin") |
|||
public R<Map<String, Object>> emailLogin(@Validated @RequestBody EmailLoginBody body) { |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
// 生成令牌 |
|||
String token = loginService.emailLogin(body.getEmail(), body.getEmailCode()); |
|||
ajax.put(Constants.TOKEN, token); |
|||
return R.ok(ajax); |
|||
} |
|||
/** |
|||
* 小程序登录(示例) |
|||
* |
|||
* @param xcxCode 小程序code |
|||
* @return 结果 |
|||
*/ |
|||
@SaIgnore |
|||
@PostMapping("/xcxLogin") |
|||
public R<Map<String, Object>> xcxLogin(@NotBlank(message = "{xcx.code.not.blank}") String xcxCode) { |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
// 生成令牌 |
|||
String token = loginService.xcxLogin(xcxCode); |
|||
ajax.put(Constants.TOKEN, token); |
|||
return R.ok(ajax); |
|||
} |
|||
/** |
|||
* 退出登录 |
|||
*/ |
|||
@SaIgnore |
|||
@PostMapping("/logout") |
|||
public R<Void> logout() { |
|||
loginService.logout(); |
|||
return R.ok("退出成功"); |
|||
} |
|||
/** |
|||
* 获取用户信息 |
|||
* |
|||
* @return 用户信息 |
|||
*/ |
|||
@GetMapping("getInfo") |
|||
public R<Map<String, Object>> getInfo() { |
|||
LoginUser loginUser = LoginHelper.getLoginUser(); |
|||
SysUser user = userService.selectUserById(loginUser.getUserId()); |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
ajax.put("user", user); |
|||
ajax.put("roles", loginUser.getRolePermission()); |
|||
ajax.put("permissions", loginUser.getMenuPermission()); |
|||
return R.ok(ajax); |
|||
} |
|||
/** |
|||
* 获取路由信息 |
|||
* |
|||
* @return 路由信息 |
|||
*/ |
|||
@GetMapping("getRouters") |
|||
public R<List<RouterVo>> getRouters() { |
|||
Long userId = LoginHelper.getUserId(); |
|||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
|||
return R.ok(menuService.buildMenus(menus)); |
|||
} |
|||
} |
@ -0,0 +1,120 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import cn.hutool.core.lang.tree.Tree; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.constant.UserConstants; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.entity.SysMenu; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
import com.inscloudtech.system.service.ISysMenuService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 菜单信息 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/menu") |
|||
public class SysMenuController extends BaseController { |
|||
|
|||
private final ISysMenuService menuService; |
|||
/** |
|||
* 获取菜单列表 |
|||
*/ |
|||
@SaCheckPermission("system:menu:list") |
|||
@GetMapping("/list") |
|||
public R<List<SysMenu>> list(SysMenu menu) { |
|||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
|||
return R.ok(menus); |
|||
} |
|||
/** |
|||
* 根据菜单编号获取详细信息 |
|||
* |
|||
* @param menuId 菜单ID |
|||
*/ |
|||
@SaCheckPermission("system:menu:query") |
|||
@GetMapping(value = "/{menuId}") |
|||
public R<SysMenu> getInfo(@PathVariable Long menuId) { |
|||
return R.ok(menuService.selectMenuById(menuId)); |
|||
} |
|||
/** |
|||
* 获取菜单下拉树列表 |
|||
*/ |
|||
@GetMapping("/treeselect") |
|||
public R<List<Tree<Long>>> treeselect(SysMenu menu) { |
|||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
|||
return R.ok(menuService.buildMenuTreeSelect(menus)); |
|||
} |
|||
/** |
|||
* 加载对应角色菜单列表树 |
|||
* |
|||
* @param roleId 角色ID |
|||
*/ |
|||
@GetMapping(value = "/roleMenuTreeselect/{roleId}") |
|||
public R<Map<String, Object>> roleMenuTreeselect(@PathVariable("roleId") Long roleId) { |
|||
List<SysMenu> menus = menuService.selectMenuList(getUserId()); |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); |
|||
ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
|||
return R.ok(ajax); |
|||
} |
|||
/** |
|||
* 新增菜单 |
|||
*/ |
|||
@SaCheckPermission("system:menu:add") |
|||
@Log(title = "菜单管理", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public R<Void> add(@Validated @RequestBody SysMenu menu) { |
|||
if (!menuService.checkMenuNameUnique(menu)) { |
|||
return R.fail("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); |
|||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { |
|||
return R.fail("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
|||
} |
|||
return toAjax(menuService.insertMenu(menu)); |
|||
} |
|||
/** |
|||
* 修改菜单 |
|||
*/ |
|||
@SaCheckPermission("system:menu:edit") |
|||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public R<Void> edit(@Validated @RequestBody SysMenu menu) { |
|||
if (!menuService.checkMenuNameUnique(menu)) { |
|||
return R.fail("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); |
|||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { |
|||
return R.fail("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
|||
} else if (menu.getMenuId().equals(menu.getParentId())) { |
|||
return R.fail("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); |
|||
} |
|||
return toAjax(menuService.updateMenu(menu)); |
|||
} |
|||
/** |
|||
* 删除菜单 |
|||
* |
|||
* @param menuId 菜单ID |
|||
*/ |
|||
@SaCheckPermission("system:menu:remove") |
|||
@Log(title = "菜单管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{menuId}") |
|||
public R<Void> remove(@PathVariable("menuId") Long menuId) { |
|||
if (menuService.hasChildByMenuId(menuId)) { |
|||
return R.warn("存在子菜单,不允许删除"); |
|||
} |
|||
if (menuService.checkMenuExistRole(menuId)) { |
|||
return R.warn("菜单已分配,不允许删除"); |
|||
} |
|||
return toAjax(menuService.deleteMenuById(menuId)); |
|||
} |
|||
} |
@ -0,0 +1,75 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.system.domain.SysNotice; |
|||
import com.inscloudtech.system.service.ISysNoticeService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* 公告 信息操作处理 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/notice") |
|||
public class SysNoticeController extends BaseController { |
|||
|
|||
private final ISysNoticeService noticeService; |
|||
/** |
|||
* 获取通知公告列表 |
|||
*/ |
|||
@SaCheckPermission("system:notice:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysNotice> list(SysNotice notice, PageQuery pageQuery) { |
|||
return noticeService.selectPageNoticeList(notice, pageQuery); |
|||
} |
|||
/** |
|||
* 根据通知公告编号获取详细信息 |
|||
* |
|||
* @param noticeId 公告ID |
|||
*/ |
|||
@SaCheckPermission("system:notice:query") |
|||
@GetMapping(value = "/{noticeId}") |
|||
public R<SysNotice> getInfo(@PathVariable Long noticeId) { |
|||
return R.ok(noticeService.selectNoticeById(noticeId)); |
|||
} |
|||
/** |
|||
* 新增通知公告 |
|||
*/ |
|||
@SaCheckPermission("system:notice:add") |
|||
@Log(title = "通知公告", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public R<Void> add(@Validated @RequestBody SysNotice notice) { |
|||
return toAjax(noticeService.insertNotice(notice)); |
|||
} |
|||
/** |
|||
* 修改通知公告 |
|||
*/ |
|||
@SaCheckPermission("system:notice:edit") |
|||
@Log(title = "通知公告", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public R<Void> edit(@Validated @RequestBody SysNotice notice) { |
|||
return toAjax(noticeService.updateNotice(notice)); |
|||
} |
|||
/** |
|||
* 删除通知公告 |
|||
* |
|||
* @param noticeIds 公告ID串 |
|||
*/ |
|||
@SaCheckPermission("system:notice:remove") |
|||
@Log(title = "通知公告", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{noticeIds}") |
|||
public R<Void> remove(@PathVariable Long[] noticeIds) { |
|||
return toAjax(noticeService.deleteNoticeByIds(noticeIds)); |
|||
} |
|||
} |
@ -0,0 +1,144 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.RepeatSubmit; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.core.validate.AddGroup; |
|||
import com.inscloudtech.common.core.validate.EditGroup; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.system.domain.SysNotifyMessage; |
|||
import com.inscloudtech.system.service.ISysNotifyMessageService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 站内信消息 |
|||
* |
|||
* @author inscloudtech |
|||
* @date 2023-06-02 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/notifyMessage") |
|||
public class SysNotifyMessageController extends BaseController { |
|||
|
|||
private final ISysNotifyMessageService iSysNotifyMessageService; |
|||
/** |
|||
* 查询站内信消息列表 |
|||
*/ |
|||
@SaCheckPermission("system:notifyMessage:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysNotifyMessage> list(SysNotifyMessage bo, PageQuery pageQuery) { |
|||
return iSysNotifyMessageService.queryPageList(bo, pageQuery); |
|||
} |
|||
/** |
|||
* 导出站内信消息列表 |
|||
*/ |
|||
@SaCheckPermission("system:notifyMessage:export") |
|||
@Log(title = "站内信消息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(SysNotifyMessage bo, HttpServletResponse response) { |
|||
List<SysNotifyMessage> list = iSysNotifyMessageService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "站内信消息", SysNotifyMessage.class, response); |
|||
} |
|||
/** |
|||
* 获取站内信消息详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("system:notifyMessage:query") |
|||
@GetMapping("/{id}") |
|||
public R<SysNotifyMessage> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(iSysNotifyMessageService.queryById(id)); |
|||
} |
|||
/** |
|||
* 新增站内信消息 |
|||
*/ |
|||
@SaCheckPermission("system:notifyMessage:add") |
|||
@Log(title = "站内信消息", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysNotifyMessage bo) { |
|||
return toAjax(iSysNotifyMessageService.insert(bo)); |
|||
} |
|||
/** |
|||
* 修改站内信消息 |
|||
*/ |
|||
@SaCheckPermission("system:notifyMessage:edit") |
|||
@Log(title = "站内信消息", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysNotifyMessage bo) { |
|||
return toAjax(iSysNotifyMessageService.update(bo)); |
|||
} |
|||
/** |
|||
* 删除站内信消息 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("system:notifyMessage:remove") |
|||
@Log(title = "站内信消息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(iSysNotifyMessageService.deleteWithValidByIds(Arrays.asList(ids), true)); |
|||
} |
|||
/** |
|||
* 查询站内信消息列表 |
|||
*/ |
|||
// @SaCheckPermission("system:notifyMessage:list") |
|||
@GetMapping("/unreadCount") |
|||
public R<Long> unreadCount() { |
|||
return R.ok(getUnreadList().getTotal()); |
|||
} |
|||
|
|||
@GetMapping("/unreadList") |
|||
public TableDataInfo<SysNotifyMessage> unreadList() { |
|||
return getUnreadList(); |
|||
} |
|||
|
|||
TableDataInfo<SysNotifyMessage> getUnreadList(){ |
|||
SysNotifyMessage condition = new SysNotifyMessage(); |
|||
condition.setReadStatus(0); |
|||
PageQuery pageQuery = new PageQuery(); |
|||
pageQuery.setPageNum(1); |
|||
pageQuery.setPageSize(5); |
|||
pageQuery.setOrderByColumn("create_time"); |
|||
pageQuery.setIsAsc("desc"); |
|||
TableDataInfo<SysNotifyMessage> tableDataInfo = iSysNotifyMessageService.queryPageList(condition, pageQuery); |
|||
return tableDataInfo; |
|||
} |
|||
|
|||
|
|||
@PutMapping("/updateRead") |
|||
@RepeatSubmit |
|||
@Log(title = "标记站内信为已读", businessType = BusinessType.UPDATE) |
|||
public R<Void> updateNotifyMessageRead(@RequestBody Long[] ids) { |
|||
return toAjax(iSysNotifyMessageService.updateNotifyMessageRead(ids,getUserId())); |
|||
} |
|||
|
|||
@PutMapping("/updateAllRead") |
|||
@RepeatSubmit |
|||
@Log(title = "标记所有站内信为已读", businessType = BusinessType.UPDATE) |
|||
public R<Void> updateAllNotifyMessageRead() { |
|||
iSysNotifyMessageService.updateAllNotifyMessageRead(getUserId()); |
|||
return toAjax(true); |
|||
} |
|||
} |
|||
|
@ -0,0 +1,111 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import java.util.List; |
|||
import java.util.Arrays; |
|||
|
|||
import com.inscloudtech.system.domain.SysNotifyTemplate; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import lombok.RequiredArgsConstructor; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.Valid; |
|||
import javax.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import com.inscloudtech.common.annotation.RepeatSubmit; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.validate.AddGroup; |
|||
import com.inscloudtech.common.core.validate.EditGroup; |
|||
import com.inscloudtech.common.core.validate.QueryGroup; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.system.domain.vo.SysNotifyTemplateVo; |
|||
import com.inscloudtech.system.service.ISysNotifyTemplateService; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 站内信模板 |
|||
* |
|||
* @author inscloudtech |
|||
* @date 2023-06-07 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/notifyTemplate") |
|||
public class SysNotifyTemplateController extends BaseController { |
|||
|
|||
private final ISysNotifyTemplateService iSysNotifyTemplateService; |
|||
/** |
|||
* 查询站内信模板列表 |
|||
*/ |
|||
@SaCheckPermission("system:notifyTemplate:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysNotifyTemplateVo> list(SysNotifyTemplate bo, PageQuery pageQuery) { |
|||
return iSysNotifyTemplateService.queryPageList(bo, pageQuery); |
|||
} |
|||
/** |
|||
* 导出站内信模板列表 |
|||
*/ |
|||
@SaCheckPermission("system:notifyTemplate:export") |
|||
@Log(title = "站内信模板", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(SysNotifyTemplate bo, HttpServletResponse response) { |
|||
List<SysNotifyTemplateVo> list = iSysNotifyTemplateService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "站内信模板", SysNotifyTemplateVo.class, response); |
|||
} |
|||
/** |
|||
* 获取站内信模板详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("system:notifyTemplate:query") |
|||
@GetMapping("/{id}") |
|||
public R<SysNotifyTemplateVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(iSysNotifyTemplateService.queryById(id)); |
|||
} |
|||
/** |
|||
* 新增站内信模板 |
|||
*/ |
|||
@SaCheckPermission("system:notifyTemplate:add") |
|||
@Log(title = "站内信模板", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysNotifyTemplate bo) { |
|||
return toAjax(iSysNotifyTemplateService.insertByBo(bo)); |
|||
} |
|||
/** |
|||
* 修改站内信模板 |
|||
*/ |
|||
@SaCheckPermission("system:notifyTemplate:edit") |
|||
@Log(title = "站内信模板", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysNotifyTemplate bo) { |
|||
return toAjax(iSysNotifyTemplateService.updateByBo(bo)); |
|||
} |
|||
/** |
|||
* 删除站内信模板 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("system:notifyTemplate:remove") |
|||
@Log(title = "站内信模板", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(iSysNotifyTemplateService.deleteWithValidByIds(Arrays.asList(ids), true)); |
|||
} |
|||
|
|||
@PostMapping("/send") |
|||
@Operation(summary = "发送站内信") |
|||
@SaCheckPermission("system:notifyTemplate:send") |
|||
public R<Void> sendNotify(@Valid @RequestBody SysNotifyTemplate bo) { |
|||
return toAjax(iSysNotifyTemplateService.sendSingleNotify(null, |
|||
bo.getCode(),null)); |
|||
} |
|||
} |
@ -0,0 +1,107 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
|
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.system.domain.SysOss; |
|||
import com.inscloudtech.system.service.ISysOssService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import java.io.IOException; |
|||
import java.util.Arrays; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 文件上传 控制层 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/oss") |
|||
public class SysOssController extends BaseController { |
|||
|
|||
private final ISysOssService iSysOssService; |
|||
/** |
|||
* 查询OSS对象存储列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysOss> list(SysOss bo, PageQuery pageQuery) { |
|||
return iSysOssService.queryPageList(bo, pageQuery); |
|||
} |
|||
/** |
|||
* 查询OSS对象基于id串 |
|||
* |
|||
* @param ossIds OSS对象ID串 |
|||
*/ |
|||
@GetMapping("/listByIds/{ossIds}") |
|||
public R<List<SysOss>> listByIds(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ossIds) { |
|||
List<SysOss> list = iSysOssService.listByIds(Arrays.asList(ossIds)); |
|||
return R.ok(list); |
|||
} |
|||
/** |
|||
* 根据id获取详细信息 |
|||
* |
|||
* @param ossId 菜单ID |
|||
*/ |
|||
@GetMapping(value = "/{ossId}") |
|||
public R<SysOss> getInfo(@PathVariable String ossId) { |
|||
return R.ok(iSysOssService.getById(ossId)); |
|||
} |
|||
/** |
|||
* 上传OSS对象存储 |
|||
* |
|||
* @param file 文件 |
|||
*/ |
|||
|
|||
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT) |
|||
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<Map<String, String>> upload(@RequestPart("file") MultipartFile file) { |
|||
if (ObjectUtil.isNull(file)) { |
|||
return R.fail("上传文件不能为空"); |
|||
} |
|||
SysOss oss = iSysOssService.upload(file); |
|||
Map<String, String> map = new HashMap<>(2); |
|||
map.put("url", oss.getUrl()); |
|||
map.put("fileName", oss.getOriginalName()); |
|||
map.put("ossId", oss.getOssId()); |
|||
return R.ok(map); |
|||
} |
|||
/** |
|||
* 下载OSS对象 |
|||
* |
|||
* @param ossId OSS对象ID |
|||
*/ |
|||
@GetMapping("/download/{ossId}") |
|||
public void download(@PathVariable String ossId, HttpServletResponse response) throws IOException { |
|||
iSysOssService.download(ossId,response); |
|||
} |
|||
/** |
|||
* 删除OSS对象存储 |
|||
* |
|||
* @param ossIds OSS对象ID串 |
|||
*/ |
|||
@Log(title = "OSS对象存储", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ossIds}") |
|||
public R remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ossIds) { |
|||
iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds)); |
|||
return R.ok(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,108 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.constant.UserConstants; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.system.domain.SysPost; |
|||
import com.inscloudtech.system.service.ISysPostService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 岗位信息操作处理 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/post") |
|||
public class SysPostController extends BaseController { |
|||
|
|||
private final ISysPostService postService; |
|||
/** |
|||
* 获取岗位列表 |
|||
*/ |
|||
@SaCheckPermission("system:post:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysPost> list(SysPost post, PageQuery pageQuery) { |
|||
return postService.selectPagePostList(post, pageQuery); |
|||
} |
|||
/** |
|||
* 导出岗位列表 |
|||
*/ |
|||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT) |
|||
@SaCheckPermission("system:post:export") |
|||
@PostMapping("/export") |
|||
public void export(SysPost post, HttpServletResponse response) { |
|||
List<SysPost> list = postService.selectPostList(post); |
|||
ExcelUtil.exportExcel(list, "岗位数据", SysPost.class, response); |
|||
} |
|||
/** |
|||
* 根据岗位编号获取详细信息 |
|||
* |
|||
* @param postId 岗位ID |
|||
*/ |
|||
@SaCheckPermission("system:post:query") |
|||
@GetMapping(value = "/{postId}") |
|||
public R<SysPost> getInfo(@PathVariable Long postId) { |
|||
return R.ok(postService.selectPostById(postId)); |
|||
} |
|||
/** |
|||
* 新增岗位 |
|||
*/ |
|||
@SaCheckPermission("system:post:add") |
|||
@Log(title = "岗位管理", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public R<Void> add(@Validated @RequestBody SysPost post) { |
|||
if (!postService.checkPostNameUnique(post)) { |
|||
return R.fail("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); |
|||
} else if (!postService.checkPostCodeUnique(post)) { |
|||
return R.fail("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
|||
} |
|||
return toAjax(postService.insertPost(post)); |
|||
} |
|||
/** |
|||
* 修改岗位 |
|||
*/ |
|||
@SaCheckPermission("system:post:edit") |
|||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public R<Void> edit(@Validated @RequestBody SysPost post) { |
|||
if (!postService.checkPostNameUnique(post)) { |
|||
return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); |
|||
} else if (!postService.checkPostCodeUnique(post)) { |
|||
return R.fail("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
|||
} |
|||
return toAjax(postService.updatePost(post)); |
|||
} |
|||
/** |
|||
* 删除岗位 |
|||
* |
|||
* @param postIds 岗位ID串 |
|||
*/ |
|||
@SaCheckPermission("system:post:remove") |
|||
@Log(title = "岗位管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{postIds}") |
|||
public R<Void> remove(@PathVariable Long[] postIds) { |
|||
return toAjax(postService.deletePostByIds(postIds)); |
|||
} |
|||
/** |
|||
* 获取岗位选择框列表 |
|||
*/ |
|||
@GetMapping("/optionselect") |
|||
public R<List<SysPost>> optionselect() { |
|||
List<SysPost> posts = postService.selectPostAll(); |
|||
return R.ok(posts); |
|||
} |
|||
} |
@ -0,0 +1,138 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.secure.BCrypt; |
|||
import cn.hutool.core.io.FileUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.constant.UserConstants; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.entity.SysDept; |
|||
import com.inscloudtech.common.core.domain.entity.SysUser; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.helper.LoginHelper; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
import com.inscloudtech.common.utils.file.MimeTypeUtils; |
|||
import com.inscloudtech.system.domain.SysOss; |
|||
import com.inscloudtech.system.domain.vo.SysOssVo; |
|||
import com.inscloudtech.system.service.ISysOssService; |
|||
import com.inscloudtech.system.service.ISysUserService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 个人信息 业务处理 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/user/profile") |
|||
public class SysProfileController extends BaseController { |
|||
|
|||
private final ISysUserService userService; |
|||
private final ISysOssService iSysOssService; |
|||
/** |
|||
* 个人信息 |
|||
*/ |
|||
@GetMapping |
|||
public R<Map<String, Object>> profile() { |
|||
SysUser user = userService.selectUserById(getUserId()); |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
ajax.put("user", user); |
|||
ajax.put("roleGroup", userService.selectUserRoleGroup(user.getUserName())); |
|||
ajax.put("postGroup", userService.selectUserPostGroup(user.getUserName())); |
|||
return R.ok(ajax); |
|||
} |
|||
|
|||
/** |
|||
* 个人信息 |
|||
*/ |
|||
@GetMapping("/getDZDept") |
|||
public R<Map<String, Object>> getDZDept() { |
|||
SysDept dzDept = userService.getDzDept(); |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
ajax.put("dzDept", dzDept); |
|||
return R.ok(ajax); |
|||
} |
|||
/** |
|||
* 修改用户 |
|||
*/ |
|||
@Log(title = "个人信息", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public R<Void> updateProfile(@RequestBody SysUser user) { |
|||
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
|||
return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); |
|||
} |
|||
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { |
|||
return R.fail("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
|||
} |
|||
user.setUserId(getUserId()); |
|||
user.setUserName(null); |
|||
user.setPassword(null); |
|||
user.setAvatar(null); |
|||
user.setDeptId(null); |
|||
if (userService.updateUserProfile(user) > 0) { |
|||
return R.ok(); |
|||
} |
|||
return R.fail("修改个人信息异常,请联系管理员"); |
|||
} |
|||
/** |
|||
* 重置密码 |
|||
* |
|||
* @param newPassword 旧密码 |
|||
* @param oldPassword 新密码 |
|||
*/ |
|||
@Log(title = "个人信息", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/updatePwd") |
|||
public R<Void> updatePwd(String oldPassword, String newPassword) { |
|||
SysUser user = userService.selectUserById(LoginHelper.getUserId()); |
|||
String userName = user.getUserName(); |
|||
String password = user.getPassword(); |
|||
if (!BCrypt.checkpw(oldPassword, password)) { |
|||
return R.fail("修改密码失败,旧密码错误"); |
|||
} |
|||
if (BCrypt.checkpw(newPassword, password)) { |
|||
return R.fail("新密码不能与旧密码相同"); |
|||
} |
|||
|
|||
if (userService.resetUserPwd(userName, BCrypt.hashpw(newPassword)) > 0) { |
|||
return R.ok(); |
|||
} |
|||
return R.fail("修改密码异常,请联系管理员"); |
|||
} |
|||
/** |
|||
* 头像上传 |
|||
* |
|||
* @param avatarfile 用户头像 |
|||
*/ |
|||
@Log(title = "用户头像", businessType = BusinessType.UPDATE) |
|||
@PostMapping(value = "/avatar", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<Map<String, Object>> avatar(@RequestPart("avatarfile") MultipartFile avatarfile) { |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
if (!avatarfile.isEmpty()) { |
|||
String extension = FileUtil.extName(avatarfile.getOriginalFilename()); |
|||
if (!StringUtils.equalsAnyIgnoreCase(extension, MimeTypeUtils.IMAGE_EXTENSION)) { |
|||
return R.fail("文件格式不正确,请上传" + Arrays.toString(MimeTypeUtils.IMAGE_EXTENSION) + "格式"); |
|||
} |
|||
/* SysOssVo oss = iSysOssService.upload(avatarfile); |
|||
String avatar = oss.getUrl(); |
|||
if (userService.updateUserAvatar(getUsername(), avatar)) { |
|||
ajax.put("imgUrl", avatar); |
|||
return R.ok(ajax); |
|||
}*/ |
|||
} |
|||
return R.fail("上传图片异常,请联系管理员"); |
|||
} |
|||
} |
@ -0,0 +1,39 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaIgnore; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.model.RegisterBody; |
|||
import com.inscloudtech.system.service.ISysConfigService; |
|||
import com.inscloudtech.system.service.SysRegisterService; |
|||
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.RestController; |
|||
|
|||
/** |
|||
* 注册验证 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
public class SysRegisterController extends BaseController { |
|||
|
|||
private final SysRegisterService registerService; |
|||
private final ISysConfigService configService; |
|||
/** |
|||
* 用户注册 |
|||
*/ |
|||
@SaIgnore |
|||
@PostMapping("/register") |
|||
public R<Void> register(@Validated @RequestBody RegisterBody user) { |
|||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) { |
|||
return R.fail("当前系统没有开启注册功能!"); |
|||
} |
|||
registerService.register(user); |
|||
return R.ok(); |
|||
} |
|||
} |
@ -0,0 +1,214 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.entity.SysDept; |
|||
import com.inscloudtech.common.core.domain.entity.SysRole; |
|||
import com.inscloudtech.common.core.domain.entity.SysUser; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.system.domain.SysUserRole; |
|||
import com.inscloudtech.system.service.ISysDeptService; |
|||
import com.inscloudtech.system.service.ISysRoleService; |
|||
import com.inscloudtech.system.service.ISysUserService; |
|||
import com.inscloudtech.system.service.SysPermissionService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 角色信息 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/role") |
|||
public class SysRoleController extends BaseController { |
|||
|
|||
private final ISysRoleService roleService; |
|||
private final ISysUserService userService; |
|||
private final ISysDeptService deptService; |
|||
private final SysPermissionService permissionService; |
|||
/** |
|||
* 获取角色信息列表 |
|||
*/ |
|||
@SaCheckPermission("system:role:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysRole> list(SysRole role, PageQuery pageQuery) { |
|||
return roleService.selectPageRoleList(role, pageQuery); |
|||
} |
|||
/** |
|||
* 导出角色信息列表 |
|||
*/ |
|||
@Log(title = "角色权限", businessType = BusinessType.EXPORT) |
|||
@SaCheckPermission("system:role:export") |
|||
@PostMapping("/export") |
|||
public void export(SysRole role, HttpServletResponse response) { |
|||
List<SysRole> list = roleService.selectRoleList(role); |
|||
ExcelUtil.exportExcel(list, "角色数据", SysRole.class, response); |
|||
} |
|||
/** |
|||
* 根据角色编号获取详细信息 |
|||
* |
|||
* @param roleId 角色ID |
|||
*/ |
|||
@SaCheckPermission("system:role:query") |
|||
@GetMapping(value = "/{roleId}") |
|||
public R<SysRole> getInfo(@PathVariable Long roleId) { |
|||
roleService.checkRoleDataScope(roleId); |
|||
return R.ok(roleService.selectRoleById(roleId)); |
|||
} |
|||
/** |
|||
* 新增角色 |
|||
*/ |
|||
@SaCheckPermission("system:role:add") |
|||
@Log(title = "角色权限", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public R<Void> add(@Validated @RequestBody SysRole role) { |
|||
if (!roleService.checkRoleNameUnique(role)) { |
|||
return R.fail("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); |
|||
} else if (!roleService.checkRoleKeyUnique(role)) { |
|||
return R.fail("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); |
|||
} |
|||
return toAjax(roleService.insertRole(role)); |
|||
|
|||
} |
|||
/** |
|||
* 修改保存角色 |
|||
*/ |
|||
@SaCheckPermission("system:role:edit") |
|||
// @Log(title = "角色权限", businessType = BusinessType.UPDATE) |
|||
@UpdateLog(title = "角色权限",mapperClass = ISysRoleService.class,methodName = "selectRoleInfoById",entityClass = SysRole.class, businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public R<Void> edit(@Validated @RequestBody SysRole role) { |
|||
roleService.checkRoleAllowed(role); |
|||
roleService.checkRoleDataScope(role.getRoleId()); |
|||
if (!roleService.checkRoleNameUnique(role)) { |
|||
return R.fail("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); |
|||
} else if (!roleService.checkRoleKeyUnique(role)) { |
|||
return R.fail("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); |
|||
} |
|||
|
|||
if (roleService.updateRole(role) > 0) { |
|||
roleService.cleanOnlineUserByRole(role.getRoleId()); |
|||
return R.ok(); |
|||
} |
|||
return R.fail("修改角色'" + role.getRoleName() + "'失败,请联系管理员"); |
|||
} |
|||
/** |
|||
* 修改保存数据权限 |
|||
*/ |
|||
@SaCheckPermission("system:role:edit") |
|||
@Log(title = "角色权限", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/dataScope") |
|||
public R<Void> dataScope(@RequestBody SysRole role) { |
|||
roleService.checkRoleAllowed(role); |
|||
roleService.checkRoleDataScope(role.getRoleId()); |
|||
return toAjax(roleService.authDataScope(role)); |
|||
} |
|||
/** |
|||
* 状态修改 |
|||
*/ |
|||
@SaCheckPermission("system:role:edit") |
|||
@Log(title = "角色权限", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/changeStatus") |
|||
public R<Void> changeStatus(@RequestBody SysRole role) { |
|||
roleService.checkRoleAllowed(role); |
|||
roleService.checkRoleDataScope(role.getRoleId()); |
|||
return toAjax(roleService.updateRoleStatus(role)); |
|||
} |
|||
/** |
|||
* 删除角色 |
|||
* |
|||
* @param roleIds 角色ID串 |
|||
*/ |
|||
@SaCheckPermission("system:role:remove") |
|||
@Log(title = "角色权限", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{roleIds}") |
|||
public R<Void> remove(@PathVariable Long[] roleIds) { |
|||
return toAjax(roleService.deleteRoleByIds(roleIds)); |
|||
} |
|||
/** |
|||
* 获取角色选择框列表 |
|||
*/ |
|||
@SaCheckPermission("system:role:query") |
|||
@GetMapping("/optionselect") |
|||
public R<List<SysRole>> optionselect() { |
|||
return R.ok(roleService.selectRoleAll()); |
|||
} |
|||
/** |
|||
* 查询已分配用户角色列表 |
|||
*/ |
|||
@SaCheckPermission("system:role:list") |
|||
@GetMapping("/authUser/allocatedList") |
|||
public TableDataInfo<SysUser> allocatedList(SysUser user, PageQuery pageQuery) { |
|||
return userService.selectAllocatedList(user, pageQuery); |
|||
} |
|||
/** |
|||
* 查询未分配用户角色列表 |
|||
*/ |
|||
@SaCheckPermission("system:role:list") |
|||
@GetMapping("/authUser/unallocatedList") |
|||
public TableDataInfo<SysUser> unallocatedList(SysUser user, PageQuery pageQuery) { |
|||
return userService.selectUnallocatedList(user, pageQuery); |
|||
} |
|||
/** |
|||
* 取消授权用户 |
|||
*/ |
|||
@SaCheckPermission("system:role:edit") |
|||
@Log(title = "角色权限", businessType = BusinessType.GRANT) |
|||
@PutMapping("/authUser/cancel") |
|||
public R<Void> cancelAuthUser(@RequestBody SysUserRole userRole) { |
|||
return toAjax(roleService.deleteAuthUser(userRole)); |
|||
} |
|||
/** |
|||
* 批量取消授权用户 |
|||
* |
|||
* @param roleId 角色ID |
|||
* @param userIds 用户ID串 |
|||
*/ |
|||
@SaCheckPermission("system:role:edit") |
|||
@Log(title = "角色权限", businessType = BusinessType.GRANT) |
|||
@PutMapping("/authUser/cancelAll") |
|||
public R<Void> cancelAuthUserAll(Long roleId, Long[] userIds) { |
|||
return toAjax(roleService.deleteAuthUsers(roleId, userIds)); |
|||
} |
|||
/** |
|||
* 批量选择用户授权 |
|||
* |
|||
* @param roleId 角色ID |
|||
* @param userIds 用户ID串 |
|||
*/ |
|||
@SaCheckPermission("system:role:edit") |
|||
@Log(title = "角色权限", businessType = BusinessType.GRANT) |
|||
@PutMapping("/authUser/selectAll") |
|||
public R<Void> selectAuthUserAll(Long roleId, Long[] userIds) { |
|||
roleService.checkRoleDataScope(roleId); |
|||
return toAjax(roleService.insertAuthUsers(roleId, userIds)); |
|||
} |
|||
/** |
|||
* 获取对应角色部门树列表 |
|||
* |
|||
* @param roleId 角色ID |
|||
*/ |
|||
@SaCheckPermission("system:role:list") |
|||
@GetMapping(value = "/deptTree/{roleId}") |
|||
public R<Map<String, Object>> roleDeptTreeselect(@PathVariable("roleId") Long roleId) { |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); |
|||
ajax.put("depts", deptService.selectDeptTreeList(new SysDept())); |
|||
return R.ok(ajax); |
|||
} |
|||
} |
@ -0,0 +1,240 @@ |
|||
package com.inscloudtech.web.controller.system; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import cn.dev33.satoken.secure.BCrypt; |
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.lang.tree.Tree; |
|||
import cn.hutool.core.util.ArrayUtil; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.inscloudtech.common.annotation.Log; |
|||
import com.inscloudtech.common.annotation.UpdateLog; |
|||
import com.inscloudtech.common.core.controller.BaseController; |
|||
import com.inscloudtech.common.core.domain.PageQuery; |
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.entity.SysDept; |
|||
import com.inscloudtech.common.core.domain.entity.SysRole; |
|||
import com.inscloudtech.common.core.domain.entity.SysUser; |
|||
import com.inscloudtech.common.core.page.TableDataInfo; |
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.excel.ExcelResult; |
|||
import com.inscloudtech.common.helper.LoginHelper; |
|||
import com.inscloudtech.common.utils.StreamUtils; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.system.domain.vo.SysUserExportVo; |
|||
import com.inscloudtech.system.domain.vo.SysUserImportVo; |
|||
import com.inscloudtech.system.listener.SysUserImportListener; |
|||
import com.inscloudtech.system.mapper.SysUserMapper; |
|||
import com.inscloudtech.system.service.ISysDeptService; |
|||
import com.inscloudtech.system.service.ISysPostService; |
|||
import com.inscloudtech.system.service.ISysRoleService; |
|||
import com.inscloudtech.system.service.ISysUserService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.*; |
|||
|
|||
/** |
|||
* 用户信息 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/system/user") |
|||
public class SysUserController extends BaseController { |
|||
|
|||
private final ISysUserService userService; |
|||
private final ISysRoleService roleService; |
|||
private final ISysPostService postService; |
|||
private final ISysDeptService deptService; |
|||
/** |
|||
* 获取用户列表 |
|||
*/ |
|||
// @SaCheckPermission("system:user:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<SysUser> list(SysUser user, PageQuery pageQuery) { |
|||
return userService.selectPageUserList(user, pageQuery); |
|||
} |
|||
/** |
|||
* 导出用户列表 |
|||
*/ |
|||
@Log(title = "用户管理", businessType = BusinessType.EXPORT) |
|||
@SaCheckPermission("system:user:export") |
|||
@PostMapping("/export") |
|||
public void export(SysUser user, HttpServletResponse response) { |
|||
List<SysUser> list = userService.selectUserList(user); |
|||
List<SysUserExportVo> listVo = BeanUtil.copyToList(list, SysUserExportVo.class); |
|||
for (int i = 0; i < list.size(); i++) { |
|||
SysDept dept = list.get(i).getDept(); |
|||
SysUserExportVo vo = listVo.get(i); |
|||
if (ObjectUtil.isNotEmpty(dept)) { |
|||
vo.setDeptName(dept.getDeptName()); |
|||
vo.setLeader(dept.getLeader()); |
|||
} |
|||
} |
|||
ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response); |
|||
} |
|||
/** |
|||
* 导入数据 |
|||
* |
|||
* @param file 导入文件 |
|||
* @param updateSupport 是否更新已存在数据 |
|||
*/ |
|||
@Log(title = "用户管理", businessType = BusinessType.IMPORT) |
|||
@SaCheckPermission("system:user:import") |
|||
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|||
public R<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport, Long deptId) throws Exception { |
|||
if(null == deptId){ |
|||
return R.fail("所属机构不能为空!"); |
|||
} |
|||
ExcelResult<SysUserImportVo> result = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class, new SysUserImportListener(updateSupport,deptId)); |
|||
return R.ok(result.getAnalysis()); |
|||
} |
|||
/** |
|||
* 获取导入模板 |
|||
*/ |
|||
@PostMapping("/importTemplate") |
|||
public void importTemplate(HttpServletResponse response) { |
|||
ExcelUtil.exportExcel(new ArrayList<>(), "用户数据", SysUserImportVo.class, response); |
|||
} |
|||
/** |
|||
* 根据用户编号获取详细信息 |
|||
* |
|||
* @param userId 用户ID |
|||
*/ |
|||
@SaCheckPermission("system:user:query") |
|||
@GetMapping(value = {"/", "/{userId}"}) |
|||
public R<Map<String, Object>> getInfo(@PathVariable(value = "userId", required = false) Long userId) { |
|||
userService.checkUserDataScope(userId); |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
List<SysRole> roles = roleService.selectRoleAll(); |
|||
ajax.put("roles", LoginHelper.isAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isAdmin())); |
|||
// ajax.put("posts", postService.selectPostAll()); |
|||
ajax.put("posts", Collections.EMPTY_LIST); |
|||
if (ObjectUtil.isNotNull(userId)) { |
|||
SysUser sysUser = userService.selectUserById(userId); |
|||
ajax.put("user", sysUser); |
|||
// ajax.put("postIds", postService.selectPostListByUserId(userId)); |
|||
ajax.put("postIds", Collections.EMPTY_LIST); |
|||
ajax.put("roleIds", StreamUtils.toList(sysUser.getRoles(), SysRole::getRoleId)); |
|||
} |
|||
return R.ok(ajax); |
|||
} |
|||
/** |
|||
* 新增用户 |
|||
*/ |
|||
@SaCheckPermission("system:user:add") |
|||
@Log(title = "用户管理", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public R<Void> add(@Validated @RequestBody SysUser user) { |
|||
if (!userService.checkUserNameUnique(user)) { |
|||
return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); |
|||
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
|||
return R.fail("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); |
|||
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { |
|||
return R.fail("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
|||
} |
|||
user.setPassword(BCrypt.hashpw(user.getPassword())); |
|||
return toAjax(userService.insertUser(user)); |
|||
} |
|||
/** |
|||
* 修改用户 |
|||
*/ |
|||
@SaCheckPermission("system:user:edit") |
|||
// @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
|||
@UpdateLog(title = "用户管理",mapperClass = SysUserMapper.class,methodName = "selectUserById" ,businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public R<Void> edit(@Validated @RequestBody SysUser user) { |
|||
userService.checkUserAllowed(user); |
|||
userService.checkUserDataScope(user.getUserId()); |
|||
if (!userService.checkUserNameUnique(user)) { |
|||
return R.fail("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); |
|||
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
|||
return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); |
|||
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { |
|||
return R.fail("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
|||
} |
|||
return toAjax(userService.updateUser(user)); |
|||
} |
|||
/** |
|||
* 删除用户 |
|||
* |
|||
* @param userIds 角色ID串 |
|||
*/ |
|||
@SaCheckPermission("system:user:remove") |
|||
@Log(title = "用户管理", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{userIds}") |
|||
public R<Void> remove(@PathVariable Long[] userIds) { |
|||
if (ArrayUtil.contains(userIds, getUserId())) { |
|||
return R.fail("当前用户不能删除"); |
|||
} |
|||
return toAjax(userService.deleteUserByIds(userIds)); |
|||
} |
|||
/** |
|||
* 重置密码 |
|||
*/ |
|||
@SaCheckPermission("system:user:resetPwd") |
|||
@Log(title = "用户管理", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/resetPwd") |
|||
public R<Void> resetPwd(@RequestBody SysUser user) { |
|||
userService.checkUserAllowed(user); |
|||
userService.checkUserDataScope(user.getUserId()); |
|||
user.setPassword(BCrypt.hashpw(user.getPassword())); |
|||
return toAjax(userService.resetPwd(user)); |
|||
} |
|||
/** |
|||
* 状态修改 |
|||
*/ |
|||
@SaCheckPermission("system:user:edit") |
|||
@Log(title = "用户管理", businessType = BusinessType.UPDATE) |
|||
@PutMapping("/changeStatus") |
|||
public R<Void> changeStatus(@RequestBody SysUser user) { |
|||
userService.checkUserAllowed(user); |
|||
userService.checkUserDataScope(user.getUserId()); |
|||
return toAjax(userService.updateUserStatus(user)); |
|||
} |
|||
/** |
|||
* 根据用户编号获取授权角色 |
|||
* |
|||
* @param userId 用户ID |
|||
*/ |
|||
@SaCheckPermission("system:user:query") |
|||
@GetMapping("/authRole/{userId}") |
|||
public R<Map<String, Object>> authRole(@PathVariable Long userId) { |
|||
SysUser user = userService.selectUserById(userId); |
|||
List<SysRole> roles = roleService.selectRolesByUserId(userId); |
|||
Map<String, Object> ajax = new HashMap<>(); |
|||
ajax.put("user", user); |
|||
ajax.put("roles", LoginHelper.isAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isAdmin())); |
|||
return R.ok(ajax); |
|||
} |
|||
/** |
|||
* 用户授权角色 |
|||
* |
|||
* @param userId 用户Id |
|||
* @param roleIds 角色ID串 |
|||
*/ |
|||
@SaCheckPermission("system:user:edit") |
|||
@Log(title = "用户管理", businessType = BusinessType.GRANT) |
|||
@PutMapping("/authRole") |
|||
public R<Void> insertAuthRole(Long userId, Long[] roleIds) { |
|||
userService.checkUserDataScope(userId); |
|||
userService.insertUserAuth(userId, roleIds); |
|||
return R.ok(); |
|||
} |
|||
/** |
|||
* 获取部门树列表 |
|||
*/ |
|||
// @SaCheckPermission("system:user:list") |
|||
@GetMapping("/deptTree") |
|||
public R<List<Tree<Long>>> deptTree(SysDept dept) { |
|||
return R.ok(deptService.selectDeptTreeList(dept)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,87 @@ |
|||
spring: |
|||
datasource: |
|||
type: com.zaxxer.hikari.HikariDataSource |
|||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content |
|||
dynamic: |
|||
# 性能分析插件(有性能损耗 不建议生产环境使用) |
|||
p6spy: false |
|||
# 设置默认的数据源或者数据源组,默认值即为 master |
|||
primary: master |
|||
# 严格模式 匹配不到数据源则报错 |
|||
strict: true |
|||
datasource: |
|||
# 主库数据源 |
|||
master: |
|||
type: ${spring.datasource.type} |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 |
|||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) |
|||
url: jdbc:mysql://localhost:3306/chng_wuzi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true |
|||
username: root |
|||
password: 123456 |
|||
# 从库数据源 |
|||
hikari: |
|||
# 最大连接池数量 |
|||
maxPoolSize: 20 |
|||
# 最小空闲线程数量 |
|||
minIdle: 10 |
|||
# 配置获取连接等待超时的时间 |
|||
connectionTimeout: 30000 |
|||
# 校验超时时间 |
|||
validationTimeout: 5000 |
|||
# 空闲连接存活最大时间,默认10分钟 |
|||
idleTimeout: 600000 |
|||
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 |
|||
maxLifetime: 1800000 |
|||
# 连接测试query(配置检测连接是否有效) |
|||
connectionTestQuery: SELECT 1 |
|||
# 多久检查一次连接的活性 |
|||
keepaliveTime: 30000 |
|||
|
|||
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉) |
|||
spring: |
|||
redis: |
|||
# 地址 |
|||
host: localhost |
|||
# 端口,默认为6379 |
|||
port: 6379 |
|||
# 数据库索引 |
|||
database: 0 |
|||
# 密码(如没有密码请注释掉) |
|||
password: 123456 |
|||
# 连接超时时间 |
|||
timeout: 10s |
|||
# 是否开启ssl |
|||
ssl: false |
|||
|
|||
redisson: |
|||
# redis key前缀 |
|||
keyPrefix: |
|||
# 线程池数量 |
|||
threads: 4 |
|||
# Netty线程池数量 |
|||
nettyThreads: 8 |
|||
# 单节点配置 |
|||
singleServerConfig: |
|||
# 客户端名称 |
|||
clientName: ${cas.name} |
|||
# 最小空闲连接数 |
|||
connectionMinimumIdleSize: 8 |
|||
# 连接池大小 |
|||
connectionPoolSize: 32 |
|||
# 连接空闲超时,单位:毫秒 |
|||
idleConnectionTimeout: 10000 |
|||
# 命令等待超时,单位:毫秒 |
|||
timeout: 3000 |
|||
# 发布和订阅连接池大小 |
|||
subscriptionConnectionPoolSize: 50 |
|||
|
|||
#elasticsearch |
|||
easy-es: |
|||
enable: true #默认为true,若为false则认为不启用本框架 |
|||
address: 192.168.3.20:9200 #es的连接地址,必须含端口 若为集群,则可以用逗号隔开 例如:127.0.0.1:9200,127.0.0.2:9200 |
|||
global-config: |
|||
distributed: false |
|||
print-dsl: false |
|||
password: ly123456 |
|||
username: elastic |
@ -0,0 +1,96 @@ |
|||
--- # 临时文件存储位置 避免临时文件被系统清理报错 |
|||
spring.servlet.multipart.location: /app/asb/uploadPath |
|||
|
|||
|
|||
--- # 数据源配置 |
|||
spring: |
|||
datasource: |
|||
type: com.zaxxer.hikari.HikariDataSource |
|||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content |
|||
dynamic: |
|||
# 性能分析插件(有性能损耗 不建议生产环境使用) |
|||
p6spy: false |
|||
# 设置默认的数据源或者数据源组,默认值即为 master |
|||
primary: master |
|||
# 严格模式 匹配不到数据源则报错 |
|||
strict: true |
|||
datasource: |
|||
# 主库数据源 |
|||
master: |
|||
type: ${spring.datasource.type} |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 |
|||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) |
|||
url: jdbc:mysql://10.64.200.69:3306/chng_wuzi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true |
|||
username: root |
|||
password: Wuzi!@5212 |
|||
# 从库数据源 |
|||
postgresql: |
|||
lazy: true |
|||
type: ${spring.datasource.type} |
|||
driverClassName: org.postgresql.Driver |
|||
url: jdbc:postgresql://10.64.203.136:8000/hnlcj_dws?currentSchema=dwi&useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true |
|||
username: lcj_wz |
|||
password: Lzx-wz*983$265 |
|||
hikari: |
|||
# 最大连接池数量 |
|||
maxPoolSize: 20 |
|||
# 最小空闲线程数量 |
|||
minIdle: 10 |
|||
# 配置获取连接等待超时的时间 |
|||
connectionTimeout: 30000 |
|||
# 校验超时时间 |
|||
validationTimeout: 5000 |
|||
# 空闲连接存活最大时间,默认10分钟 |
|||
idleTimeout: 600000 |
|||
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟 |
|||
maxLifetime: 1800000 |
|||
# 连接测试query(配置检测连接是否有效) |
|||
connectionTestQuery: SELECT 1 |
|||
# 多久检查一次连接的活性 |
|||
keepaliveTime: 30000 |
|||
|
|||
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉) |
|||
spring: |
|||
redis: |
|||
# 地址 |
|||
host: 192.168.0.10 |
|||
# 端口,默认为6379 |
|||
port: 6379 |
|||
# 数据库索引 |
|||
database: 0 |
|||
# 密码(如没有密码请注释掉) |
|||
password: Wuzi!@5212 |
|||
# 连接超时时间 |
|||
timeout: 10s |
|||
# 是否开启ssl |
|||
ssl: false |
|||
|
|||
redisson: |
|||
# redis key前缀 |
|||
keyPrefix: |
|||
# 线程池数量 |
|||
threads: 16 |
|||
# Netty线程池数量 |
|||
nettyThreads: 32 |
|||
# 单节点配置 |
|||
singleServerConfig: |
|||
# 客户端名称 |
|||
clientName: ${cas.name} |
|||
# 最小空闲连接数 |
|||
connectionMinimumIdleSize: 32 |
|||
# 连接池大小 |
|||
connectionPoolSize: 64 |
|||
# 连接空闲超时,单位:毫秒 |
|||
idleConnectionTimeout: 10000 |
|||
# 命令等待超时,单位:毫秒 |
|||
timeout: 3000 |
|||
# 发布和订阅连接池大小 |
|||
subscriptionConnectionPoolSize: 50 |
|||
#elasticsearch |
|||
easy-es: |
|||
enable: true #默认为true,若为false则认为不启用本框架 |
|||
address: localhost:9200 #es的连接地址,必须含端口 若为集群,则可以用逗号隔开 例如:127.0.0.1:9200,127.0.0.2:9200 |
|||
global-config: |
|||
distributed: false |
|||
print-dsl: false |
@ -0,0 +1,281 @@ |
|||
# 项目相关配置 |
|||
cas: |
|||
# 名称 |
|||
name: cas |
|||
# 版本 |
|||
version: ${cas-server.version} |
|||
# 版权年份 |
|||
copyrightYear: 2023 |
|||
# 实例演示开关 |
|||
demoEnabled: true |
|||
# 获取ip地址开关 |
|||
addressEnabled: true |
|||
# 缓存懒加载 |
|||
cacheLazy: false |
|||
profile: /app/asb/uploadPath |
|||
|
|||
captcha: |
|||
# 页面 <参数设置> 可开启关闭 验证码校验 |
|||
# 验证码类型 math 数组计算 char 字符验证 |
|||
type: MATH |
|||
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰 |
|||
category: CIRCLE |
|||
# 数字验证码位数 |
|||
numberLength: 1 |
|||
# 字符验证码长度 |
|||
charLength: 4 |
|||
|
|||
# 开发环境配置 |
|||
server: |
|||
# 服务器的HTTP端口,默认为8080 |
|||
port: 8080 |
|||
servlet: |
|||
# 应用的访问路径 |
|||
context-path: / |
|||
# undertow 配置 |
|||
undertow: |
|||
# HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的 |
|||
max-http-post-size: -1 |
|||
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 |
|||
# 每块buffer的空间大小,越小的空间被利用越充分 |
|||
buffer-size: 512 |
|||
# 是否分配的直接内存 |
|||
direct-buffers: true |
|||
threads: |
|||
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程 |
|||
io: 8 |
|||
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载 |
|||
worker: 256 |
|||
|
|||
# 日志配置 |
|||
logging: |
|||
level: |
|||
com.inscloudtech: @logging.level@ |
|||
org.springframework: warn |
|||
config: classpath:logback-plus.xml |
|||
|
|||
# 用户配置 |
|||
user: |
|||
password: |
|||
# 密码最大错误次数 |
|||
maxRetryCount: 55 |
|||
# 密码锁定时间(默认10分钟) |
|||
lockTime: 1 |
|||
|
|||
# Spring配置 |
|||
spring: |
|||
application: |
|||
name: ${cas.name} |
|||
# 资源信息 |
|||
messages: |
|||
# 国际化资源文件路径 |
|||
basename: i18n/messages |
|||
profiles: |
|||
active: @profiles.active@ |
|||
# 文件上传 |
|||
servlet: |
|||
multipart: |
|||
# 单个文件大小 |
|||
max-file-size: 10MB |
|||
# 设置总上传的文件大小 |
|||
max-request-size: 20MB |
|||
# 服务模块 |
|||
devtools: |
|||
restart: |
|||
# 热部署开关 |
|||
enabled: true |
|||
mvc: |
|||
format: |
|||
date-time: yyyy-MM-dd HH:mm:ss |
|||
jackson: |
|||
# 日期格式化 |
|||
date-format: yyyy-MM-dd HH:mm:ss |
|||
serialization: |
|||
# 格式化输出 |
|||
indent_output: false |
|||
# 忽略无法转换的对象 |
|||
fail_on_empty_beans: false |
|||
deserialization: |
|||
# 允许对象忽略json中不存在的属性 |
|||
fail_on_unknown_properties: false |
|||
|
|||
# Sa-Token配置 |
|||
sa-token: |
|||
# token名称 (同时也是cookie名称) |
|||
token-name: Authorization |
|||
# token有效期 设为一天 (必定过期) 单位: 秒 |
|||
timeout: 86400 |
|||
# token临时有效期 (指定时间无操作就过期) 单位: 秒 |
|||
activity-timeout: 28800 |
|||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) |
|||
is-concurrent: true |
|||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) |
|||
is-share: false |
|||
# 是否尝试从header里读取token |
|||
is-read-header: true |
|||
# 是否尝试从cookie里读取token |
|||
is-read-cookie: false |
|||
# token前缀 |
|||
token-prefix: "Bearer" |
|||
# jwt秘钥 |
|||
jwt-secret-key: abcdefghijklmnopqrstuvwxyz |
|||
|
|||
# security配置 |
|||
security: |
|||
# 排除路径 |
|||
excludes: |
|||
# 静态资源 |
|||
- /*.html |
|||
- /**/*.html |
|||
- /**/*.css |
|||
- /**/*.js |
|||
# 公共路径 |
|||
- /favicon.ico |
|||
- /error |
|||
# swagger 文档配置 |
|||
- /*/api-docs |
|||
- /*/api-docs/** |
|||
# actuator 监控配置 |
|||
- /actuator |
|||
- /actuator/** |
|||
- /jmreport/** |
|||
|
|||
|
|||
# MyBatisPlus配置 |
|||
# https://baomidou.com/config/ |
|||
mybatis-plus: |
|||
# 不支持多包, 如有需要可在注解配置 或 提升扫包等级 |
|||
# 例如 com.**.**.mapper |
|||
mapperPackage: com.inscloudtech.**.mapper |
|||
# 对应的 XML 文件位置 |
|||
mapperLocations: classpath*:mapper/**/*Mapper.xml |
|||
# 实体扫描,多个package用逗号或者分号分隔 |
|||
typeAliasesPackage: com.inscloudtech.**.domain |
|||
# 启动时是否检查 MyBatis XML 文件的存在,默认不检查 |
|||
checkConfigLocation: false |
|||
configuration: |
|||
# 自动驼峰命名规则(camel case)映射 |
|||
mapUnderscoreToCamelCase: true |
|||
# MyBatis 自动映射策略 |
|||
# NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射 |
|||
autoMappingBehavior: PARTIAL |
|||
# MyBatis 自动映射时未知列或未知属性处理策 |
|||
# NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息 |
|||
autoMappingUnknownColumnBehavior: NONE |
|||
# 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl |
|||
# 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl |
|||
# 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl |
|||
logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl |
|||
global-config: |
|||
# 是否打印 Logo banner |
|||
banner: false |
|||
dbConfig: |
|||
# 主键类型 |
|||
# AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID |
|||
idType: AUTO |
|||
# 逻辑已删除值 |
|||
logicDeleteValue: 2 |
|||
# 逻辑未删除值 |
|||
logicNotDeleteValue: 0 |
|||
# 字段验证策略之 insert,在 insert 的时候的字段验证策略 |
|||
# IGNORED 忽略 NOT_NULL 非NULL NOT_EMPTY 非空 DEFAULT 默认 NEVER 不加入 SQL |
|||
insertStrategy: NOT_NULL |
|||
# 字段验证策略之 update,在 update 的时候的字段验证策略 |
|||
updateStrategy: NOT_NULL |
|||
# 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件 |
|||
where-strategy: NOT_NULL |
|||
|
|||
# 数据加密 |
|||
mybatis-encryptor: |
|||
# 是否开启加密 |
|||
enable: false |
|||
# 默认加密算法 |
|||
algorithm: BASE64 |
|||
# 编码方式 BASE64/HEX。默认BASE64 |
|||
encode: BASE64 |
|||
# 安全秘钥 对称算法的秘钥 如:AES,SM4 |
|||
# password: |
|||
# 公私钥 非对称算法的公私钥 如:SM2,RSA |
|||
publicKey: |
|||
privateKey: |
|||
|
|||
# Swagger配置 |
|||
swagger: |
|||
info: |
|||
# 标题 |
|||
title: '标题:${cas.name}后台管理系统_接口文档' |
|||
# 描述 |
|||
description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...' |
|||
# 版本 |
|||
version: '版本号: ${cas-server.version}' |
|||
# 作者信息 |
|||
contact: |
|||
name: inscloudtech |
|||
email: inscloudtech@163.com |
|||
url: inscloudtech |
|||
components: |
|||
# 鉴权方式配置 |
|||
security-schemes: |
|||
apiKey: |
|||
type: APIKEY |
|||
in: HEADER |
|||
name: ${sa-token.token-name} |
|||
|
|||
springdoc: |
|||
api-docs: |
|||
# 是否开启接口文档 |
|||
enabled: true |
|||
swagger-ui: |
|||
# 持久化认证数据 |
|||
persistAuthorization: true |
|||
#这里定义了两个分组,可定义多个,也可以不定义 |
|||
group-configs: |
|||
- group: 1.演示模块 |
|||
packages-to-scan: com.inscloudtech.demo |
|||
- group: 2.系统模块 |
|||
packages-to-scan: com.inscloudtech.web |
|||
- group: 3.代码生成模块 |
|||
packages-to-scan: com.inscloudtech.generator |
|||
- group: 4.编码库存计划模块 |
|||
packages-to-scan: com.inscloudtech.code |
|||
|
|||
# 防止XSS攻击 |
|||
xss: |
|||
# 过滤开关 |
|||
enabled: true |
|||
# 排除链接(多个用逗号分隔) |
|||
excludes: /system/notice |
|||
# 匹配链接 |
|||
urlPatterns: /system/*,/monitor/*,/tool/* |
|||
|
|||
# 全局线程池相关配置 |
|||
thread-pool: |
|||
# 是否开启线程池 |
|||
enabled: false |
|||
# 队列最大长度 |
|||
queueCapacity: 128 |
|||
# 线程池维护线程所允许的空闲时间 |
|||
keepAliveSeconds: 300 |
|||
|
|||
--- # 分布式锁 lock4j 全局配置 |
|||
lock4j: |
|||
# 获取分布式锁超时时间,默认为 3000 毫秒 |
|||
acquire-timeout: 3000 |
|||
# 分布式锁的超时时间,默认为 30 秒 |
|||
expire: 30000 |
|||
|
|||
--- # Actuator 监控端点的配置项 |
|||
management: |
|||
endpoints: |
|||
web: |
|||
exposure: |
|||
include: '*' |
|||
endpoint: |
|||
health: |
|||
show-details: ALWAYS |
|||
logfile: |
|||
external-file: ./logs/sys-console.log |
|||
|
|||
minidao : |
|||
base-package: org.jeecg.modules.jmreport.desreport.dao* |
|||
db-type: mysql |
@ -0,0 +1,2 @@ |
|||
Application Version: ${cas-server.version} |
|||
Spring Boot Version: ${spring-boot.version} |
@ -0,0 +1,49 @@ |
|||
#错误消息 |
|||
not.null=* 必须填写 |
|||
user.jcaptcha.error=验证码错误 |
|||
user.jcaptcha.expire=验证码已失效 |
|||
user.not.exists=对不起, 您的账号:{0} 不存在. |
|||
user.password.not.match=用户不存在/密码错误 |
|||
user.password.retry.limit.count=密码输入错误{0}次 |
|||
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 |
|||
user.password.delete=对不起,您的账号:{0} 已被删除 |
|||
user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员 |
|||
role.blocked=角色已封禁,请联系管理员 |
|||
user.logout.success=退出成功 |
|||
length.not.valid=长度必须在{min}到{max}个字符之间 |
|||
user.username.not.blank=用户名不能为空 |
|||
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 |
|||
user.username.length.valid=账户长度必须在{min}到{max}个字符之间 |
|||
user.password.not.blank=用户密码不能为空 |
|||
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间 |
|||
user.password.not.valid=* 5-50个字符 |
|||
user.email.not.valid=邮箱格式错误 |
|||
user.email.not.blank=邮箱不能为空 |
|||
user.phonenumber.not.blank=用户手机号不能为空 |
|||
user.mobile.phone.number.not.valid=手机号格式错误 |
|||
user.login.success=登录成功 |
|||
user.register.success=注册成功 |
|||
user.register.save.error=保存用户 {0} 失败,注册账号已存在 |
|||
user.register.error=注册失败,请联系系统管理人员 |
|||
user.notfound=请重新登录 |
|||
user.forcelogout=管理员强制退出,请重新登录 |
|||
user.unknown.error=未知错误,请重新登录 |
|||
##文件上传消息 |
|||
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB! |
|||
upload.filename.exceed.length=上传的文件名最长{0}个字符 |
|||
##权限 |
|||
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] |
|||
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] |
|||
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] |
|||
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] |
|||
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] |
|||
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] |
|||
repeat.submit.message=不允许重复提交,请稍候再试 |
|||
rate.limiter.message=访问过于频繁,请稍候再试 |
|||
sms.code.not.blank=短信验证码不能为空 |
|||
sms.code.retry.limit.count=短信验证码输入错误{0}次 |
|||
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟 |
|||
email.code.not.blank=邮箱验证码不能为空 |
|||
email.code.retry.limit.count=邮箱验证码输入错误{0}次 |
|||
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟 |
|||
xcx.code.not.blank=小程序code不能为空 |
@ -0,0 +1,49 @@ |
|||
#错误消息 |
|||
not.null=* Required fill in |
|||
user.jcaptcha.error=Captcha error |
|||
user.jcaptcha.expire=Captcha invalid |
|||
user.not.exists=Sorry, your account: {0} does not exist |
|||
user.password.not.match=User does not exist/Password error |
|||
user.password.retry.limit.count=Password input error {0} times |
|||
user.password.retry.limit.exceed=Password input error {0} times, account locked for {1} minutes |
|||
user.password.delete=Sorry, your account:{0} has been deleted |
|||
user.blocked=Sorry, your account: {0} has been disabled. Please contact the administrator |
|||
role.blocked=Role disabled,please contact administrators |
|||
user.logout.success=Exit successful |
|||
length.not.valid=The length must be between {min} and {max} characters |
|||
user.username.not.blank=Username cannot be blank |
|||
user.username.not.valid=* 2 to 20 chinese characters, letters, numbers or underscores, and must start with a non number |
|||
user.username.length.valid=Account length must be between {min} and {max} characters |
|||
user.password.not.blank=Password cannot be empty |
|||
user.password.length.valid=Password length must be between {min} and {max} characters |
|||
user.password.not.valid=* 5-50 characters |
|||
user.email.not.valid=Mailbox format error |
|||
user.email.not.blank=Mailbox cannot be blank |
|||
user.phonenumber.not.blank=Phone number cannot be blank |
|||
user.mobile.phone.number.not.valid=Phone number format error |
|||
user.login.success=Login successful |
|||
user.register.success=Register successful |
|||
user.register.save.error=Failed to save user {0}, The registered account already exists |
|||
user.register.error=Register failed, please contact system administrator |
|||
user.notfound=Please login again |
|||
user.forcelogout=The administrator is forced to exit,please login again |
|||
user.unknown.error=Unknown error, please login again |
|||
##文件上传消息 |
|||
upload.exceed.maxSize=The uploaded file size exceeds the limit file size!<br/>the maximum allowed file size is:{0}MB! |
|||
upload.filename.exceed.length=The maximum length of uploaded file name is {0} characters |
|||
##权限 |
|||
no.permission=You do not have permission to the data,please contact your administrator to add permissions [{0}] |
|||
no.create.permission=You do not have permission to create data,please contact your administrator to add permissions [{0}] |
|||
no.update.permission=You do not have permission to modify data,please contact your administrator to add permissions [{0}] |
|||
no.delete.permission=You do not have permission to delete data,please contact your administrator to add permissions [{0}] |
|||
no.export.permission=You do not have permission to export data,please contact your administrator to add permissions [{0}] |
|||
no.view.permission=You do not have permission to view data,please contact your administrator to add permissions [{0}] |
|||
repeat.submit.message=Repeat submit is not allowed, please try again later |
|||
rate.limiter.message=Visit too frequently, please try again later |
|||
sms.code.not.blank=Sms code cannot be blank |
|||
sms.code.retry.limit.count=Sms code input error {0} times |
|||
sms.code.retry.limit.exceed=Sms code input error {0} times, account locked for {1} minutes |
|||
email.code.not.blank=Email code cannot be blank |
|||
email.code.retry.limit.count=Email code input error {0} times |
|||
email.code.retry.limit.exceed=Email code input error {0} times, account locked for {1} minutes |
|||
xcx.code.not.blank=Mini program code cannot be blank |
@ -0,0 +1,49 @@ |
|||
#错误消息 |
|||
not.null=* 必须填写 |
|||
user.jcaptcha.error=验证码错误 |
|||
user.jcaptcha.expire=验证码已失效 |
|||
user.not.exists=对不起, 您的账号:{0} 不存在. |
|||
user.password.not.match=用户不存在/密码错误 |
|||
user.password.retry.limit.count=密码输入错误{0}次 |
|||
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 |
|||
user.password.delete=对不起,您的账号:{0} 已被删除 |
|||
user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员 |
|||
role.blocked=角色已封禁,请联系管理员 |
|||
user.logout.success=退出成功 |
|||
length.not.valid=长度必须在{min}到{max}个字符之间 |
|||
user.username.not.blank=用户名不能为空 |
|||
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 |
|||
user.username.length.valid=账户长度必须在{min}到{max}个字符之间 |
|||
user.password.not.blank=用户密码不能为空 |
|||
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间 |
|||
user.password.not.valid=* 5-50个字符 |
|||
user.email.not.valid=邮箱格式错误 |
|||
user.email.not.blank=邮箱不能为空 |
|||
user.phonenumber.not.blank=用户手机号不能为空 |
|||
user.mobile.phone.number.not.valid=手机号格式错误 |
|||
user.login.success=登录成功 |
|||
user.register.success=注册成功 |
|||
user.register.save.error=保存用户 {0} 失败,注册账号已存在 |
|||
user.register.error=注册失败,请联系系统管理人员 |
|||
user.notfound=请重新登录 |
|||
user.forcelogout=管理员强制退出,请重新登录 |
|||
user.unknown.error=未知错误,请重新登录 |
|||
##文件上传消息 |
|||
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB! |
|||
upload.filename.exceed.length=上传的文件名最长{0}个字符 |
|||
##权限 |
|||
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] |
|||
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] |
|||
no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] |
|||
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] |
|||
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] |
|||
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] |
|||
repeat.submit.message=不允许重复提交,请稍候再试 |
|||
rate.limiter.message=访问过于频繁,请稍候再试 |
|||
sms.code.not.blank=短信验证码不能为空 |
|||
sms.code.retry.limit.count=短信验证码输入错误{0}次 |
|||
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟 |
|||
email.code.not.blank=邮箱验证码不能为空 |
|||
email.code.retry.limit.count=邮箱验证码输入错误{0}次 |
|||
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟 |
|||
xcx.code.not.blank=小程序code不能为空 |
@ -0,0 +1,129 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<configuration> |
|||
<property name="log.path" value="./logs"/> |
|||
<property name="console.log.pattern" |
|||
value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/> |
|||
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/> |
|||
|
|||
<!-- 控制台输出 --> |
|||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
|||
<encoder> |
|||
<pattern>${console.log.pattern}</pattern> |
|||
<charset>utf-8</charset> |
|||
</encoder> |
|||
</appender> |
|||
|
|||
<!-- 控制台输出 --> |
|||
<appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<file>${log.path}/sys-console.log</file> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 日志文件名格式 --> |
|||
<fileNamePattern>${log.path}/sys-console.%d{yyyy-MM-dd}.log</fileNamePattern> |
|||
<!-- 日志最大 1天 --> |
|||
<maxHistory>1</maxHistory> |
|||
</rollingPolicy> |
|||
<encoder> |
|||
<pattern>${log.pattern}</pattern> |
|||
<charset>utf-8</charset> |
|||
</encoder> |
|||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
|||
<!-- 过滤的级别 --> |
|||
<level>INFO</level> |
|||
</filter> |
|||
</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> |
|||
|
|||
<!-- info异步输出 --> |
|||
<appender name="async_info" class="ch.qos.logback.classic.AsyncAppender"> |
|||
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 --> |
|||
<discardingThreshold>0</discardingThreshold> |
|||
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 --> |
|||
<queueSize>512</queueSize> |
|||
<!-- 添加附加的appender,最多只能添加一个 --> |
|||
<appender-ref ref="file_info"/> |
|||
</appender> |
|||
|
|||
<!-- error异步输出 --> |
|||
<appender name="async_error" class="ch.qos.logback.classic.AsyncAppender"> |
|||
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 --> |
|||
<discardingThreshold>0</discardingThreshold> |
|||
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 --> |
|||
<queueSize>512</queueSize> |
|||
<!-- 添加附加的appender,最多只能添加一个 --> |
|||
<appender-ref ref="file_error"/> |
|||
</appender> |
|||
|
|||
<!-- 整合 skywalking 控制台输出 tid --> |
|||
<!-- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">--> |
|||
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">--> |
|||
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">--> |
|||
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>--> |
|||
<!-- </layout>--> |
|||
<!-- <charset>utf-8</charset>--> |
|||
<!-- </encoder>--> |
|||
<!-- </appender>--> |
|||
|
|||
<!-- 整合 skywalking 推送采集日志 --> |
|||
<!-- <appender name="sky_log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">--> |
|||
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">--> |
|||
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">--> |
|||
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>--> |
|||
<!-- </layout>--> |
|||
<!-- <charset>utf-8</charset>--> |
|||
<!-- </encoder>--> |
|||
<!-- </appender>--> |
|||
|
|||
<!--系统操作日志--> |
|||
<root level="info"> |
|||
<appender-ref ref="console" /> |
|||
<appender-ref ref="async_info" /> |
|||
<appender-ref ref="async_error" /> |
|||
<appender-ref ref="file_console" /> |
|||
<!-- <appender-ref ref="sky_log"/>--> |
|||
</root> |
|||
|
|||
</configuration> |
@ -0,0 +1,28 @@ |
|||
# p6spy 性能分析插件配置文件 |
|||
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory |
|||
# 自定义日志打印 |
|||
logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger |
|||
#日志输出到控制台 |
|||
appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger |
|||
# 使用日志系统记录 sql |
|||
#appender=com.p6spy.engine.spy.appender.Slf4JLogger |
|||
# 设置 p6spy driver 代理 |
|||
#deregisterdrivers=true |
|||
# 取消JDBC URL前缀 |
|||
useprefix=true |
|||
# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset. |
|||
excludecategories=info,debug,result,commit,resultset |
|||
# 日期格式 |
|||
dateformat=yyyy-MM-dd HH:mm:ss |
|||
# SQL语句打印时间格式 |
|||
databaseDialectTimestampFormat=yyyy-MM-dd HH:mm:ss |
|||
# 实际驱动可多个 |
|||
#driverlist=org.h2.Driver |
|||
# 是否开启慢SQL记录 |
|||
outagedetection=true |
|||
# 慢SQL记录标准 2 秒 |
|||
outagedetectioninterval=2 |
|||
# 是否过滤 Log |
|||
filter=true |
|||
# 过滤 Log 时所排除的 sql 关键字,以逗号分隔 |
|||
exclude=SELECT 1 |
@ -0,0 +1,206 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<parent> |
|||
<artifactId>cas-server</artifactId> |
|||
<groupId>com.inscloudtech</groupId> |
|||
<version>4.7.0</version> |
|||
</parent> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<artifactId>cas-common</artifactId> |
|||
|
|||
<description> |
|||
common通用工具 |
|||
</description> |
|||
|
|||
<dependencies> |
|||
|
|||
<!-- Spring框架基本的核心工具 --> |
|||
<dependency> |
|||
<groupId>org.springframework</groupId> |
|||
<artifactId>spring-context-support</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- SpringWeb模块 --> |
|||
<dependency> |
|||
<groupId>org.springframework</groupId> |
|||
<artifactId>spring-web</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- Sa-Token 权限认证, 在线文档:http://sa-token.dev33.cn/ --> |
|||
<dependency> |
|||
<groupId>cn.dev33</groupId> |
|||
<artifactId>sa-token-spring-boot-starter</artifactId> |
|||
</dependency> |
|||
<!-- Sa-Token 整合 jwt --> |
|||
<dependency> |
|||
<groupId>cn.dev33</groupId> |
|||
<artifactId>sa-token-jwt</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.alibaba</groupId> |
|||
<artifactId>easyexcel</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- yml解析器 --> |
|||
<dependency> |
|||
<groupId>org.yaml</groupId> |
|||
<artifactId>snakeyaml</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- servlet包 --> |
|||
<dependency> |
|||
<groupId>javax.servlet</groupId> |
|||
<artifactId>javax.servlet-api</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.baomidou</groupId> |
|||
<artifactId>mybatis-plus-boot-starter</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- dynamic-datasource 多数据源--> |
|||
<dependency> |
|||
<groupId>com.baomidou</groupId> |
|||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-core</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-http</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-captcha</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-jwt</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-extra</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.sun.mail</groupId> |
|||
<artifactId>jakarta.mail</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.projectlombok</groupId> |
|||
<artifactId>lombok</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.springdoc</groupId> |
|||
<artifactId>springdoc-openapi-webmvc-core</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.springdoc</groupId> |
|||
<artifactId>springdoc-openapi-javadoc</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- 自动生成YML配置关联JSON文件 --> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-configuration-processor</artifactId> |
|||
</dependency> |
|||
|
|||
<!--redisson--> |
|||
<dependency> |
|||
<groupId>org.redisson</groupId> |
|||
<artifactId>redisson-spring-boot-starter</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.redisson</groupId> |
|||
<artifactId>redisson-spring-data-27</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.baomidou</groupId> |
|||
<artifactId>lock4j-redisson-spring-boot-starter</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- 加密包引入 --> |
|||
<dependency> |
|||
<groupId>org.bouncycastle</groupId> |
|||
<artifactId>bcprov-jdk15to18</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- 离线IP地址定位库 --> |
|||
<dependency> |
|||
<groupId>org.lionsoul</groupId> |
|||
<artifactId>ip2region</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.apache.commons</groupId> |
|||
<artifactId>commons-compress</artifactId> |
|||
<version>1.21</version> |
|||
</dependency> |
|||
|
|||
<!-- io常用工具类 --> |
|||
<dependency> |
|||
<groupId>commons-io</groupId> |
|||
<artifactId>commons-io</artifactId> |
|||
<version>${commons.io.version}</version> |
|||
</dependency> |
|||
|
|||
<!-- 解压rar5,所需依赖开始--> |
|||
<dependency> |
|||
<groupId>com.github.axet</groupId> |
|||
<artifactId>java-unrar</artifactId> |
|||
<version>1.7.0-8</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>net.sf.sevenzipjbinding</groupId> |
|||
<artifactId>sevenzipjbinding</artifactId> |
|||
<version>16.02-2.01</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>net.sf.sevenzipjbinding</groupId> |
|||
<artifactId>sevenzipjbinding-all-platforms</artifactId> |
|||
<version>16.02-2.01</version> |
|||
</dependency> |
|||
<!-- 解压rar5,所需依赖结束--> |
|||
<dependency> |
|||
<groupId>org.dromara.easy-es</groupId> |
|||
<artifactId>easy-es-annotation</artifactId> |
|||
<version>2.0.0-beta4</version> |
|||
</dependency> |
|||
|
|||
</dependencies> |
|||
|
|||
</project> |
@ -0,0 +1,24 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import com.inscloudtech.common.excel.CellMergeStrategy; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* excel 列单元格合并(合并列相同项) |
|||
* |
|||
* 需搭配 {@link CellMergeStrategy} 策略使用 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Target(ElementType.FIELD) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Inherited |
|||
public @interface CellMerge { |
|||
|
|||
/** |
|||
* col index |
|||
*/ |
|||
int index() default -1; |
|||
|
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* 数据权限 |
|||
* |
|||
* 一个注解只能对应一个模板 |
|||
* |
|||
* @author inscloudtech |
|||
* @version 3.5.0 |
|||
*/ |
|||
@Target(ElementType.METHOD) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Documented |
|||
public @interface DataColumn { |
|||
/** |
|||
* 占位符关键字 |
|||
*/ |
|||
String[] key() default "deptName"; |
|||
/** |
|||
* 占位符替换值 |
|||
*/ |
|||
String[] value() default "dept_id"; |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* 数据权限组 |
|||
* |
|||
* @author inscloudtech |
|||
* @version 3.5.0 |
|||
*/ |
|||
@Target({ElementType.METHOD, ElementType.TYPE}) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Documented |
|||
public @interface DataPermission { |
|||
|
|||
DataColumn[] value(); |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
|
|||
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
|||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|||
import com.inscloudtech.common.jackson.SensitiveJsonSerializer; |
|||
|
|||
import java.lang.annotation.ElementType; |
|||
import java.lang.annotation.Retention; |
|||
import java.lang.annotation.RetentionPolicy; |
|||
import java.lang.annotation.Target; |
|||
|
|||
/** |
|||
* name字段 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Target(ElementType.FIELD) |
|||
@JacksonAnnotationsInside |
|||
@JsonSerialize(using = SensitiveJsonSerializer.class) |
|||
public @interface DeduplicationField { |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
|||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|||
import com.inscloudtech.common.jackson.DictDataJsonSerializer; |
|||
|
|||
import java.lang.annotation.ElementType; |
|||
import java.lang.annotation.Retention; |
|||
import java.lang.annotation.RetentionPolicy; |
|||
import java.lang.annotation.Target; |
|||
|
|||
/** |
|||
* 字典数据映射注解 |
|||
* |
|||
* @author inscloudtech |
|||
* @deprecated 建议使用通用翻译注解 |
|||
*/ |
|||
@Deprecated |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Target({ElementType.FIELD, ElementType.METHOD}) |
|||
@JacksonAnnotationsInside |
|||
@JsonSerialize(using = DictDataJsonSerializer.class) |
|||
public @interface DictDataMapper { |
|||
/** |
|||
* 设置字典的type值 (如: sys_user_sex) |
|||
*/ |
|||
String dictType() default ""; |
|||
} |
@ -0,0 +1,39 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import com.inscloudtech.common.enums.AlgorithmType; |
|||
import com.inscloudtech.common.enums.EncodeType; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* 字段加密注解 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Documented |
|||
@Inherited |
|||
@Target({ElementType.FIELD}) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
public @interface EncryptField { |
|||
/** |
|||
* 加密算法 |
|||
*/ |
|||
AlgorithmType algorithm() default AlgorithmType.DEFAULT; |
|||
/** |
|||
* 秘钥。AES、SM4需要 |
|||
*/ |
|||
String password() default ""; |
|||
/** |
|||
* 公钥。RSA、SM2需要 |
|||
*/ |
|||
String publicKey() default ""; |
|||
/** |
|||
* 公钥。RSA、SM2需要 |
|||
*/ |
|||
String privateKey() default ""; |
|||
/** |
|||
* 编码方式。对加密算法为BASE64的不起作用 |
|||
*/ |
|||
EncodeType encode() default EncodeType.DEFAULT; |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* 字典格式化 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Target({ElementType.FIELD}) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Inherited |
|||
public @interface ExcelDictFormat { |
|||
/** |
|||
* 如果是字典类型,请设置字典的type值 (如: sys_user_sex) |
|||
*/ |
|||
String dictType() default ""; |
|||
/** |
|||
* 读取内容转表达式 (如: 0=男,1=女,2=未知) |
|||
*/ |
|||
String readConverterExp() default ""; |
|||
/** |
|||
* 分隔符,读取字符串组内容 |
|||
*/ |
|||
String separator() default StringUtils.SEPARATOR; |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* 枚举格式化 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Target({ElementType.FIELD}) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Inherited |
|||
public @interface ExcelEnumFormat { |
|||
/** |
|||
* 字典枚举类型 |
|||
*/ |
|||
Class<? extends Enum<?>> enumClass(); |
|||
/** |
|||
* 字典枚举类中对应的code属性名称,默认为code |
|||
*/ |
|||
String codeField() default "code"; |
|||
/** |
|||
* 字典枚举类中对应的text属性名称,默认为text |
|||
*/ |
|||
String textField() default "text"; |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
|
|||
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
|||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|||
import com.inscloudtech.common.jackson.SensitiveJsonSerializer; |
|||
|
|||
import java.lang.annotation.ElementType; |
|||
import java.lang.annotation.Retention; |
|||
import java.lang.annotation.RetentionPolicy; |
|||
import java.lang.annotation.Target; |
|||
|
|||
/** |
|||
* name字段 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Target(ElementType.FIELD) |
|||
@JacksonAnnotationsInside |
|||
@JsonSerialize(using = SensitiveJsonSerializer.class) |
|||
public @interface IdCardField { |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.enums.OperatorType; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* 自定义操作日志记录注解 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Target({ElementType.PARAMETER, ElementType.METHOD}) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Documented |
|||
public @interface Log { /** |
|||
* 模块 |
|||
*/ |
|||
String title() default ""; |
|||
/** |
|||
* 功能 |
|||
*/ |
|||
BusinessType businessType() default BusinessType.OTHER; |
|||
/** |
|||
* 操作人类别 |
|||
*/ |
|||
OperatorType operatorType() default OperatorType.MANAGE; |
|||
/** |
|||
* 是否保存请求的参数 |
|||
*/ |
|||
boolean isSaveRequestData() default true; |
|||
/** |
|||
* 是否保存响应的参数 |
|||
*/ |
|||
boolean isSaveResponseData() default true; |
|||
/** |
|||
* 排除指定的请求参数 |
|||
*/ |
|||
String[] excludeParamNames() default {}; |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
|
|||
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
|||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|||
import com.inscloudtech.common.jackson.SensitiveJsonSerializer; |
|||
|
|||
import java.lang.annotation.ElementType; |
|||
import java.lang.annotation.Retention; |
|||
import java.lang.annotation.RetentionPolicy; |
|||
import java.lang.annotation.Target; |
|||
|
|||
/** |
|||
* name字段 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Target(ElementType.FIELD) |
|||
@JacksonAnnotationsInside |
|||
@JsonSerialize(using = SensitiveJsonSerializer.class) |
|||
public @interface NameField { |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
|
|||
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
|||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|||
import com.inscloudtech.common.jackson.SensitiveJsonSerializer; |
|||
|
|||
import java.lang.annotation.ElementType; |
|||
import java.lang.annotation.Retention; |
|||
import java.lang.annotation.RetentionPolicy; |
|||
import java.lang.annotation.Target; |
|||
|
|||
/** |
|||
* name字段 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Target(ElementType.FIELD) |
|||
@JacksonAnnotationsInside |
|||
@JsonSerialize(using = SensitiveJsonSerializer.class) |
|||
public @interface PhoneField { |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import com.inscloudtech.common.enums.LimitType; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* 限流注解 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Target(ElementType.METHOD) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Documented |
|||
public @interface RateLimiter { /** |
|||
* 限流key,支持使用Spring el表达式来动态获取方法上的参数值 |
|||
* 格式类似于 #code.id #{#code} |
|||
*/ |
|||
String key() default ""; |
|||
/** |
|||
* 限流时间,单位秒 |
|||
*/ |
|||
int time() default 60; |
|||
/** |
|||
* 限流次数 |
|||
*/ |
|||
int count() default 100; |
|||
/** |
|||
* 限流类型 |
|||
*/ |
|||
LimitType limitType() default LimitType.DEFAULT; |
|||
/** |
|||
* 提示消息 支持国际化 格式为 {code} |
|||
*/ |
|||
String message() default "{rate.limiter.message}"; |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import java.lang.annotation.*; |
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
/** |
|||
* 自定义注解防止表单重复提交 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Inherited |
|||
@Target(ElementType.METHOD) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Documented |
|||
public @interface RepeatSubmit { |
|||
/** |
|||
* 间隔时间(ms),小于此时间视为重复提交 |
|||
*/ |
|||
int interval() default 5000; |
|||
|
|||
TimeUnit timeUnit() default TimeUnit.MILLISECONDS; |
|||
/** |
|||
* 提示消息 支持国际化 格式为 {code} |
|||
*/ |
|||
String message() default "{repeat.submit.message}"; |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
|||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|||
import com.inscloudtech.common.enums.SensitiveStrategy; |
|||
import com.inscloudtech.common.jackson.SensitiveJsonSerializer; |
|||
|
|||
import java.lang.annotation.ElementType; |
|||
import java.lang.annotation.Retention; |
|||
import java.lang.annotation.RetentionPolicy; |
|||
import java.lang.annotation.Target; |
|||
|
|||
/** |
|||
* 数据脱敏注解 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Target(ElementType.FIELD) |
|||
@JacksonAnnotationsInside |
|||
@JsonSerialize(using = SensitiveJsonSerializer.class) |
|||
public @interface Sensitive { |
|||
SensitiveStrategy strategy(); |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
|||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|||
import com.inscloudtech.common.translation.handler.TranslationHandler; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* 通用翻译注解 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Inherited |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Target({ElementType.FIELD, ElementType.METHOD}) |
|||
@Documented |
|||
@JacksonAnnotationsInside |
|||
@JsonSerialize(using = TranslationHandler.class) |
|||
public @interface Translation { |
|||
/** |
|||
* 类型 (需与实现类上的 {@link com.inscloudtech.common.annotation.TranslationType} 注解type对应) |
|||
* <p> |
|||
* 默认取当前字段的值 如果设置了 @{@link Translation#mapper()} 则取映射字段的值 |
|||
*/ |
|||
String type(); |
|||
/** |
|||
* 映射字段 (如果不为空则取此字段的值) |
|||
*/ |
|||
String mapper() default ""; |
|||
/** |
|||
* 其他条件 例如: 字典type(sys_user_sex) |
|||
*/ |
|||
String other() default ""; |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* 翻译类型注解 (标注到{@link com.inscloudtech.common.translation.TranslationInterface} 的实现类) |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Inherited |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Target({ElementType.TYPE}) |
|||
@Documented |
|||
public @interface TranslationType { |
|||
/** |
|||
* 类型 |
|||
*/ |
|||
String type(); |
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import com.inscloudtech.common.enums.BusinessType; |
|||
import com.inscloudtech.common.enums.OperatorType; |
|||
|
|||
import java.lang.annotation.*; |
|||
|
|||
/** |
|||
* 自定义操作日志记录注解 |
|||
* |
|||
* @author zhouyl |
|||
*/ |
|||
@Target({ElementType.PARAMETER, ElementType.METHOD}) |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Documented |
|||
public @interface UpdateLog { /** |
|||
* 模块 |
|||
*/ |
|||
String title() default ""; |
|||
/** |
|||
* 操作人类别 |
|||
*/ |
|||
OperatorType operatorType() default OperatorType.MANAGE; |
|||
/** |
|||
* 功能 |
|||
*/ |
|||
BusinessType businessType() default BusinessType.OTHER; |
|||
/** |
|||
* 是否保存请求的参数 |
|||
*/ |
|||
boolean isSaveRequestData() default true; |
|||
/** |
|||
* 是否保存响应的参数 |
|||
*/ |
|||
boolean isSaveResponseData() default true; |
|||
/** |
|||
* 排除指定的请求参数 |
|||
*/ |
|||
String[] excludeParamNames() default {}; |
|||
/** |
|||
* 记录数据变化 |
|||
* 需要用到的mapper or service |
|||
*/ |
|||
Class<?> mapperClass() default Object.class; |
|||
|
|||
Class<?> entityClass() default Object.class; |
|||
/** |
|||
* 用来获取数据修改前对象的方法 |
|||
* @return |
|||
*/ |
|||
String methodName() default "selectById"; |
|||
|
|||
|
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.inscloudtech.common.annotation; |
|||
|
|||
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
|||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|||
import com.inscloudtech.common.jackson.SensitiveJsonSerializer; |
|||
|
|||
import java.lang.annotation.ElementType; |
|||
import java.lang.annotation.Retention; |
|||
import java.lang.annotation.RetentionPolicy; |
|||
import java.lang.annotation.Target; |
|||
|
|||
/** |
|||
* 数值修改记录字段注解 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Retention(RetentionPolicy.RUNTIME) |
|||
@Target(ElementType.FIELD) |
|||
@JacksonAnnotationsInside |
|||
@JsonSerialize(using = SensitiveJsonSerializer.class) |
|||
public @interface UpdateValueLog { |
|||
String fieldName() default ""; |
|||
} |
@ -0,0 +1,80 @@ |
|||
package com.inscloudtech.common.captcha; |
|||
|
|||
import cn.hutool.captcha.generator.CodeGenerator; |
|||
import cn.hutool.core.math.Calculator; |
|||
import cn.hutool.core.util.CharUtil; |
|||
import cn.hutool.core.util.RandomUtil; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
|
|||
/** |
|||
* 无符号计算生成器 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
public class UnsignedMathGenerator implements CodeGenerator { |
|||
|
|||
private static final long serialVersionUID = -5514819971774091076L; |
|||
|
|||
private static final String OPERATORS = "+-*"; |
|||
/** |
|||
* 参与计算数字最大长度 |
|||
*/ |
|||
private final int numberLength; |
|||
/** |
|||
* 构造 |
|||
*/ |
|||
public UnsignedMathGenerator() { |
|||
this(2); |
|||
} |
|||
/** |
|||
* 构造 |
|||
* |
|||
* @param numberLength 参与计算最大数字位数 |
|||
*/ |
|||
public UnsignedMathGenerator(int numberLength) { |
|||
this.numberLength = numberLength; |
|||
} |
|||
|
|||
@Override |
|||
public String generate() { |
|||
final int limit = getLimit(); |
|||
int a = RandomUtil.randomInt(limit); |
|||
int b = RandomUtil.randomInt(limit); |
|||
String max = Integer.toString(Math.max(a,b)); |
|||
String min = Integer.toString(Math.min(a,b)); |
|||
max = StringUtils.rightPad(max, this.numberLength, CharUtil.SPACE); |
|||
min = StringUtils.rightPad(min, this.numberLength, CharUtil.SPACE); |
|||
|
|||
return max + RandomUtil.randomChar(OPERATORS) + min + '='; |
|||
} |
|||
|
|||
@Override |
|||
public boolean verify(String code, String userInputCode) { |
|||
int result; |
|||
try { |
|||
result = Integer.parseInt(userInputCode); |
|||
} catch (NumberFormatException e) { |
|||
// 用户输入非数字 |
|||
return false; |
|||
} |
|||
|
|||
final int calculateResult = (int) Calculator.conversion(code); |
|||
return result == calculateResult; |
|||
} |
|||
/** |
|||
* 获取验证码长度 |
|||
* |
|||
* @return 验证码长度 |
|||
*/ |
|||
public int getLength() { |
|||
return this.numberLength * 2 + 2; |
|||
} |
|||
/** |
|||
* 根据长度获取参与计算数字最大值 |
|||
* |
|||
* @return 最大值 |
|||
*/ |
|||
private int getLimit() { |
|||
return Integer.parseInt("1" + StringUtils.repeat('0', this.numberLength)); |
|||
} |
|||
} |
@ -0,0 +1,130 @@ |
|||
package com.inscloudtech.common.config; |
|||
|
|||
import lombok.Data; |
|||
import lombok.Getter; |
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 读取项目相关配置 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@Component |
|||
@ConfigurationProperties(prefix = "cas") |
|||
public class ProjectConfig { |
|||
/** |
|||
* 上传路径 |
|||
*/ |
|||
private static String profile; |
|||
/** |
|||
* 获取地址开关 |
|||
*/ |
|||
private static boolean addressEnabled; |
|||
/** |
|||
* 验证码类型 |
|||
*/ |
|||
private static String captchaType; |
|||
/** |
|||
* 项目名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 版本 |
|||
*/ |
|||
private String version; |
|||
/** |
|||
* 版权年份 |
|||
*/ |
|||
private String copyrightYear; |
|||
/** |
|||
* 实例演示开关 |
|||
*/ |
|||
private boolean demoEnabled; |
|||
|
|||
public static String getProfile() { |
|||
return profile; |
|||
} |
|||
|
|||
public void setProfile(String profile) { |
|||
ProjectConfig.profile = profile; |
|||
} |
|||
|
|||
public static boolean isAddressEnabled() { |
|||
return addressEnabled; |
|||
} |
|||
|
|||
public void setAddressEnabled(boolean addressEnabled) { |
|||
ProjectConfig.addressEnabled = addressEnabled; |
|||
} |
|||
|
|||
public static String getCaptchaType() { |
|||
return captchaType; |
|||
} |
|||
|
|||
public void setCaptchaType(String captchaType) { |
|||
ProjectConfig.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"; |
|||
} |
|||
|
|||
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; |
|||
} |
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.inscloudtech.common.constant; |
|||
|
|||
|
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author |
|||
*/ |
|||
public class BankStatementConstants { |
|||
|
|||
/** |
|||
* 批量操作 |
|||
*/ |
|||
public static final int BATCH_SIZE = 1000; |
|||
|
|||
/** |
|||
* 导入银行流水开户信息模板索引 |
|||
*/ |
|||
public static final String IMPORT_TEMPLATE_OPENING_ACCOUNT = "import_template_opening_account"; |
|||
|
|||
public static final String NAME_WITH_SHEET_NAME = "NAME_WITH_SHEET_NAME"; |
|||
|
|||
public static final String USERID_4_IMPORT = "importResult-"; |
|||
|
|||
public static final String BATCH_ID_4_IMPORT = "importBatchId-"; |
|||
|
|||
public static final String ANALYZE_TRANSACTION_AMOUNT_FAIL_TIPS = "解析交易金额失败,交易金额为:{}"; |
|||
|
|||
public static final String ANALYZE_BALANCE_FAIL_TIPS = "解析余额失败,余额为:{}"; |
|||
|
|||
public static final String ANALYZE_TRANSACTION_DATE_FAIL_TIPS = "解析交易日期失败,日期为:{}"; |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.inscloudtech.common.constant; |
|||
|
|||
/** |
|||
* 缓存的key 常量 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
public interface CacheConstants { |
|||
/** |
|||
* 在线用户 redis key |
|||
*/ |
|||
String ONLINE_TOKEN_KEY = "online_tokens:"; |
|||
/** |
|||
* 验证码 redis key |
|||
*/ |
|||
String CAPTCHA_CODE_KEY = "captcha_codes:"; |
|||
/** |
|||
* 参数管理 cache key |
|||
*/ |
|||
String SYS_CONFIG_KEY = "sys_config:"; |
|||
/** |
|||
* 字典管理 cache key |
|||
*/ |
|||
String SYS_DICT_KEY = "sys_dict:"; |
|||
/** |
|||
* 防重提交 redis key |
|||
*/ |
|||
String REPEAT_SUBMIT_KEY = "repeat_submit:"; |
|||
/** |
|||
* 限流 redis key |
|||
*/ |
|||
String RATE_LIMIT_KEY = "rate_limit:"; |
|||
/** |
|||
* 登录账户密码错误次数 redis key |
|||
*/ |
|||
String PWD_ERR_CNT_KEY = "pwd_err_cnt:"; |
|||
} |
@ -0,0 +1,57 @@ |
|||
package com.inscloudtech.common.constant; |
|||
|
|||
/** |
|||
* 缓存组名称常量 |
|||
* <p> |
|||
* key 格式为 cacheNames#ttl#maxIdleTime#maxSize |
|||
* <p> |
|||
* ttl 过期时间 如果设置为0则不过期 默认为0 |
|||
* maxIdleTime 最大空闲时间 根据LRU算法清理空闲数据 如果设置为0则不检测 默认为0 |
|||
* maxSize 组最大长度 根据LRU算法清理溢出数据 如果设置为0则无限长 默认为0 |
|||
* <p> |
|||
* 例子: test#60s、test#0#60s、test#0#1m#1000、test#1h#0#500 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
public interface CacheNames { |
|||
/** |
|||
* 演示案例 |
|||
*/ |
|||
String DEMO_CACHE = "demo:cache#60s#10m#20"; |
|||
/** |
|||
* 系统配置 |
|||
*/ |
|||
String SYS_CONFIG = "sys_config"; |
|||
/** |
|||
* 数据字典 |
|||
*/ |
|||
String SYS_DICT = "sys_dict"; |
|||
/** |
|||
* 用户账户 |
|||
*/ |
|||
String SYS_USER_ID = "sys_user_id#30d"; |
|||
/** |
|||
* 用户账户 |
|||
*/ |
|||
String SYS_USER_NAME = "sys_user_name#30d"; |
|||
/** |
|||
* 部门 |
|||
*/ |
|||
String SYS_DEPT = "sys_dept#30d"; |
|||
/** |
|||
* OSS内容 |
|||
*/ |
|||
String SYS_OSS = "sys_oss#30d"; |
|||
/** |
|||
* OSS配置 |
|||
*/ |
|||
String SYS_OSS_CONFIG = "sys_oss_config"; |
|||
/** |
|||
* 在线用户 |
|||
*/ |
|||
String ONLINE_TOKEN = "online_tokens"; |
|||
|
|||
String STOCK_WARNING = "stock_Warning"; |
|||
|
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.inscloudtech.common.constant; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
public interface CompanyConfig { |
|||
List<String> STOCK_DEPT_CODE_LIST = Arrays.asList("6330", "6351", "6361","6390", "63A0", "63B0", "63D0","63N0", "63R0", "63R2", "63R4"); |
|||
|
|||
List<String> PLAN_DEPT_CODE_LIST = Arrays.asList("6300", "6330", "6351", "6361", "6370", "6380", "6390", "63A0", |
|||
"63B0", "63D0", "63F0", "63F1", "63H0", "63J0", "63N0", "63R0", "63R2", "63R4", "63R5", "63T0", "63U0", "63VD", "63W0", "63Z1", "63Z2", "6921", "6922"); |
|||
|
|||
} |
@ -0,0 +1,670 @@ |
|||
package com.inscloudtech.common.constant; |
|||
|
|||
import java.nio.charset.StandardCharsets; |
|||
|
|||
/** |
|||
* 通用常量信息 |
|||
* |
|||
* @author ruoyi |
|||
*/ |
|||
public class Constants { |
|||
|
|||
/** |
|||
* 批量操作 |
|||
*/ |
|||
public static final int BATCH_SIZE = 1000; |
|||
|
|||
/** |
|||
* 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.ruoyi"}; |
|||
|
|||
/** |
|||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) |
|||
*/ |
|||
public static final String[] JOB_WHITELIST_STR = {"com.ruoyi"}; |
|||
|
|||
public static final byte[] AES_SEC_KEY = "managementAnalys".getBytes(StandardCharsets.UTF_8); |
|||
|
|||
public static final String DEFAULT_PASSWD = "123456"; |
|||
|
|||
public static final Long ADMIN_USER_ID = 1L; |
|||
public static final Long RY_USER_ID = 2L; |
|||
|
|||
public static final Long LEADER_ROLE_ID = 3L; |
|||
public static final String LEADER_NAME = "案管领导"; |
|||
public static final Long INVESTIGATOR_ROLE_ID = 4L; |
|||
public static final String INVESTIGATOR_NAME = "调查人员"; |
|||
|
|||
/** |
|||
* 用户类型,案管领导 |
|||
*/ |
|||
public static final int USER_TYPE_LEADER = 1; |
|||
|
|||
/** |
|||
* 用户类型,调查人员 |
|||
*/ |
|||
public static final int USER_TYPE_INVESTIGATOR = 2; |
|||
|
|||
/** |
|||
* 用户类型,其他 |
|||
*/ |
|||
public static final int USER_TYPE_OTHER = 3; |
|||
|
|||
public static final String ORDER_ASC = "asc"; |
|||
public static final String ORDER_DESC = "desc"; |
|||
|
|||
public static final int CURRENCY_TYPE_CHINA = 1; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-富滇银行流水信息-原始 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_FDB_STATEMENT = "fdb_statements"; |
|||
/** |
|||
* MongoDB中集合名称-中信银行流水信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CITIC_STATEMENT = "citic_statements"; |
|||
/** |
|||
* MongoDB中集合名称-招商银行流水信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CMB_STATEMENT = "cmb_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-招商银行流水信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CMB_RETAIL_STATEMENT = "cmb_retail_statements"; |
|||
/** |
|||
* MongoDB中集合名称-工商银行流水信息-储蓄卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_ICBC_STATEMENT = "icbc_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-工商银行流水信息-信用卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_ICBC_STATEMENT_CREDIT_CARD = "icbc_credit_card_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-农村信用社流水信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_RCC_STATEMENT = "rcc_statements"; |
|||
/** |
|||
* MongoDB中集合名称-中国银行流水信息-对私 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_BOC_STATEMENT_PRIVATE = "boc_statements_private"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-中国银行流水信息-对公 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_BOC_STATEMENT_PUBLIC = "boc_statements_public"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-农业银行流水信息 |
|||
*/ |
|||
public static final String MONGO_COLLECTION_NAME_ABC_STATEMENT = "abc_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-农业银行流水信息-公司 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_ABC_COMPANY_STATEMENT = "abc_company_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-农业银行流水信息-个人 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_ABC_CUSTOMER_STATEMENT = "abc_customer_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-浦发银行流水信息-个人流水 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_SPDB_CREDIT_CARD_CUSTOMER_STATEMENT = |
|||
"spdb_credit_card_customer_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-浦发银行流水信息-公司流水 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_SPDB_CREDIT_CARD_COMPANY_STATEMENT = "spdb_credit_card_company_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-浦发银行开户信息-个人 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_SPDB_CREDIT_CARD_CUSTOMER_INFO = "spdb_credit_card_customer_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-浦发银行开户信息-公司 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_SPDB_CREDIT_CARD_COMPANY_INFO = "spdb_credit_card_company_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-华夏银行流水信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_HUAXIA_STATEMENT = "huaxia_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-华夏银行流水信息-个人 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_HUAXIA_STATEMENT_PERSONAL = "huaxia_statements_personal"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-华夏银行开户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_HUAXIA_OPENING_ACCOUNT_INFO = "huaxia_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-富滇银行开户信息-原始 |
|||
*/ |
|||
public static final String MONGO_COLLECTION_NAME_FDB_OPENING_ACCOUNT_RAW = "fdb_opening_account_info_raw"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-富滇银行开户信息-个人 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_FDB_OPENING_ACCOUNT_PRIVATE = "fdb_opening_account_info_private"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-富滇银行开户信息-组织 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_FDB_OPENING_ACCOUNT_PUBLIC = "fdb_opening_account_info_public"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-中信银行开户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CITIC_OPENING_ACCOUNT = "citic_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-平安开户信息-客户基本信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_PING_AN_CUSTOMER_INFO = "ping_an_customer_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-平安开户信息-账户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_PING_AN_ACCOUNT_INFO = "ping_an_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-平安开户信息-账户信息-信用卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_PING_AN_CREDIT_CARD_ACCOUNT_INFO = "ping_an_credit_card_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-平安银行账户信息 |
|||
*/ |
|||
public static final String MONGO_COLLECTION_NAME_PING_AN_ACCOUNT_INFO = "ping_an_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-民生银行开户信息-储蓄卡-个人 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CMBC_SAVINGS_CARD_OPENING_ACCOUNT = |
|||
"cmbc_savings_card_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-民生银行开户信息-储蓄卡-公司 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CMBC_SAVINGS_CARD_COMPANY_INFO = "cmbc_savings_card_company_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-民生银行开户信息-信用卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CMBC_CREDIT_CARD_OPENING_ACCOUNT = "cmbc_credit_card_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-广发银行开户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CGBC_OPENING_ACCOUNT = "cgbc_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-广发银行开户信息-客户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CGBC_CUSTOMER_INFO = "cgbc_customer_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-广发银行流水 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CGBC_SAVINGS_CARD_STATEMENT = "cgbc_old_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-广发银行流水 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CGBC_SAVINGS_CARD_NEW_STATEMENT = "cgbc_new_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-广发银行流水-信用卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CGBC_CREDIT_CARD_STATEMENT = "cgbc_credit_card_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-交通银行开户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_BOCOM_OPENING_ACCOUNT = "bank_comm_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-建设银行开户信息-定期、活期 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CCB_OPENING_ACCOUNT = "ccb_opening_account_info"; |
|||
// 建设银行-公司-开户 |
|||
public static final String ES_INDEX_NAME_CCB_COMPANY_OPENING_ACCOUNT = "ccb_company_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-建设银行开户信息-电子现金 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CCB_ELECTRONIC_CASH_OPENING_ACCOUNT = |
|||
"ccb_electronic_cash_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-兴业银行开户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CIB_OPENING_ACCOUNT = "cib_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-农业银行开户信息-个人 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_ABC_CUSTOMER_OPENING_ACCOUNT = "abc_customer_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-交通银行流水信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_BOCOM_STATEMENT = "bocom_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-曲商行流水信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_QJCCB_STATEMENT = "qjccb_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-曲商行开户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_QJCCB_ACCOUNT_INFO = "qjccb_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-邮储银行流水信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_PSBC_STATEMENT = "psbc_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-光大银行流水信息-信用卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CEB_CREDIT_CARD_STATEMENT = "ceb_credit_card_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-光大银行流水信息-储蓄卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CEB_SAVINGS_CARD_STATEMENT = "ceb_savings_card_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-广发银行流水信息-信用卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CGBC_OTHER_CREDIT_CARD_STATEMENT = "ceb_other_credit_card_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-邮储银行开户 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_PSBC_ACCOUNT_INFO = "psbc_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-民生银行流水信息-储蓄卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CMBC_SAVINGS_CARD_STATEMENT = "cmbc_savings_card_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-民生银行流水信息-信用卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CMBC_CREDIT_CARD_STATEMENT = "cmbc_credit_card_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-平安银行流水信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_PING_AN_STATEMENT = "ping_an_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-平安银行流水信息-信用卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_PING_AN_CREDIT_CARD_STATEMENT = "ping_an_credit_card_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-兴业银行流水信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CIB_STATEMENT = "cib_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-兴业银行流水信息-信用卡 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CIB_CREDIT_CARD_STATEMENT = "cib_credit_card_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-建设银行流水信息-活期流水 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CCB_CURRENT_STATEMENT = "ccb_current_statements"; |
|||
// 建设银行流水信息-活期流水-公司 |
|||
public static final String ES_INDEX_NAME_CCB_COMPANY_CURRENT_STATEMENT = "ccb_company_current_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-建设银行流水信息-定期流水 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CCB_REGULAR_STATEMENT = "ccb_regular_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-建设银行流水信息-电子现金 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CCB_ELECTRONIC_CASH_STATEMENT = "ccb_electronic_cash_statements"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称-招商银行开户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CMB_OPENING_ACCOUNT = "cmb_opening_account_info"; |
|||
/** |
|||
* 富滇银行开户信息-清洗之后 |
|||
*/ |
|||
public static final String MONGO_COLLECTION_NAME_FUDIAN_OPENING_ACCOUNT_PURE = "fudian_opening_account_info_pure"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称—工商银行开户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_ICBC_OPENING_ACCOUNT = "icbc_opening_account_info"; |
|||
/** |
|||
* MongoDB中集合名称—农村信用社开户信息 |
|||
*/ |
|||
public static final String MONGO_COLLECTION_NAME_RCC_OPENING_ACCOUNT = "rcc_opening_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称—中国银行开户信息-公司开户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_BOC_PUBLIC_OPENING_ACCOUNT = "boc_opening_company_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称—中国银行开户信息-基本个人信息,不包含银行信息,一人一条数据 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_BOC_PRIVATE_BASIC_INFO = "boc_private_basic_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称—中国银行开户信息-账户信息 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_BOC_PRIVATE_ACCOUNT_INFO = "boc_private_account_info"; |
|||
|
|||
/** |
|||
* MongoDB中集合名称—中国银行开户信息-开户信息,包含银行信息,一人多条数据 |
|||
*/ |
|||
@Deprecated |
|||
public static final String MONGO_COLLECTION_NAME_BOC_CUSTOMER_OPENING_INFO = "boc_customer_opening_account_info"; |
|||
|
|||
public static final String DICT_TYPE_BANK = "sys_bank_type"; |
|||
|
|||
public static final String DICT_TYPE_TRANS_CURRENCY = "sys_trans_currency_type"; |
|||
|
|||
public static final int RANDOM_STRING_LENGTH = 20; |
|||
|
|||
/** |
|||
* 富滇银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_BANK_FDB = "16"; |
|||
/** |
|||
* 中国银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_BOC_BANK = "0"; |
|||
|
|||
/** |
|||
* 兴业银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_INDUSTRIAL_BANK = "3"; |
|||
|
|||
/** |
|||
* 建设银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_CCB_BANK = "5"; |
|||
|
|||
/** |
|||
* 曲靖商业银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_QJCCB_BANK = "13"; |
|||
|
|||
/** |
|||
* 浦发银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_SPDB_BANK = "14"; |
|||
|
|||
/** |
|||
* 华夏银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_HUAXIA_BANK = "11"; |
|||
|
|||
/** |
|||
* 招商银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_MERCHANTS_BANK = "4"; |
|||
|
|||
/** |
|||
* 中信银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_CITIC_BANK = "1"; |
|||
/** |
|||
* 工商银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_ICBC_BANK = "10"; |
|||
|
|||
/** |
|||
* 农村信用社 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_RCC_BANK = "15"; |
|||
|
|||
/** |
|||
* 平安银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_PING_AN_BANK = "2"; |
|||
|
|||
/** |
|||
* 邮储银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_PSBC_BANK = "9"; |
|||
|
|||
/** |
|||
* 广发银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_CGBC_BANK = "12"; |
|||
|
|||
/** |
|||
* 民生银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_CMBC_BANK = "6"; |
|||
|
|||
/** |
|||
* 交通银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_BANK_COMM_BANK = "8"; |
|||
|
|||
/** |
|||
* 光大银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_BANK_CEB_BANK = "17"; |
|||
|
|||
/** |
|||
* 农业银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_BANK_ABC_BANK = "7"; |
|||
|
|||
/** |
|||
* 央地系统 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_BANK_CGS = "19"; |
|||
|
|||
/** |
|||
* 恒丰银行 |
|||
*/ |
|||
public static final String BANK_IMPORT_MODEL_BANK_HFB_BANK = "18"; |
|||
|
|||
|
|||
/** |
|||
* 定时任务违规的字符 |
|||
*/ |
|||
public static final String[] JOB_ERROR_STR = { |
|||
"java.net.URL", |
|||
"javax.naming.InitialContext", |
|||
"org.yaml.snakeyaml", |
|||
"org.springframework", |
|||
"org.apache", |
|||
"com.ruoyi.common.utils.file", |
|||
"com.ruoyi.common.config" |
|||
}; |
|||
|
|||
/** |
|||
* minio导入银行流水模板文件 |
|||
*/ |
|||
public static final String IMPORT_BANK_STATEMENT_TEMPLATE_FILE_NAME = "bs_template/银行流水.zip"; |
|||
|
|||
public static final int DATE_FULL_FORMAT_LENGTH = "yyyyMMdd".length(); |
|||
public static final int TIME_FULL_FORMAT_LENGTH = "HHmmss".length(); |
|||
|
|||
public static final int DATE_TIME_FULL_FORMAT_LENGTH = "yyyyMMddHHmmss".length(); |
|||
|
|||
public static final String ID_TYPE_ID_CARD = "第二代居民身份证"; |
|||
|
|||
public static final String ID_TYPE_SOCIAL_CREDIT_CODE = "社会信用代码"; |
|||
|
|||
/** |
|||
* 工商银行流水类型-信用卡流水 |
|||
*/ |
|||
public static final int ICBC_BS_TYPE_CREDIT_CARD = 1; |
|||
/** |
|||
* 工商银行流水类型-储蓄卡流水 |
|||
*/ |
|||
public static final int ICBC_BS_TYPE_DEBIT_CARD = 2; |
|||
|
|||
public static final String ES_INDEX_NAME_ABC_COMPANY_OPENING_ACCOUNT = "abc_company_opening_account"; |
|||
|
|||
public static final String ES_INDEX_NAME_HF_COMPANY_STATEMENT = "hf_company_statements"; |
|||
|
|||
public static final String ES_INDEX_NAME_HF_COMPANY_STATEMENT_V2 = "hf_company_statements_v2"; |
|||
|
|||
public static final String REDIS_CACHE_BANK_LIST = "redis_cache_bank_list"; |
|||
|
|||
public static final String CENTRAL_GROUND_SYSTEM = "央地系统"; |
|||
|
|||
/** |
|||
* 银行流水处理完毕标识 |
|||
*/ |
|||
public static final String COMPLETE_BANK_COUNT = "COMPLETE_BANK_COUNT-"; |
|||
public static final String IMPORT_BANK_COUNT = "IMPORT_BANK_COUNT-"; |
|||
|
|||
/** |
|||
* 央地系统银行流水 |
|||
*/ |
|||
public static final String ES_INDEX_NAME_CGS_STATEMENT = "cgs_statements"; |
|||
|
|||
public static final String ES_INDEX_NAME_CGS_OPEN_ACCOUNT_INFO = "cgs_open_account_info"; |
|||
|
|||
} |
@ -0,0 +1,157 @@ |
|||
package com.inscloudtech.common.constant; |
|||
|
|||
/** |
|||
* 代码生成通用常量 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
public interface GenConstants { /** |
|||
* 单表(增删改查) |
|||
*/ |
|||
String TPL_CRUD = "crud"; |
|||
/** |
|||
* 树表(增删改查) |
|||
*/ |
|||
String TPL_TREE = "tree"; |
|||
/** |
|||
* 主子表(增删改查) |
|||
*/ |
|||
String TPL_SUB = "sub"; |
|||
/** |
|||
* 树编码字段 |
|||
*/ |
|||
String TREE_CODE = "treeCode"; |
|||
/** |
|||
* 树父编码字段 |
|||
*/ |
|||
String TREE_PARENT_CODE = "treeParentCode"; |
|||
/** |
|||
* 树名称字段 |
|||
*/ |
|||
String TREE_NAME = "treeName"; |
|||
/** |
|||
* 上级菜单ID字段 |
|||
*/ |
|||
String PARENT_MENU_ID = "parentMenuId"; |
|||
/** |
|||
* 上级菜单名称字段 |
|||
*/ |
|||
String PARENT_MENU_NAME = "parentMenuName"; |
|||
/** |
|||
* 数据库字符串类型 |
|||
*/ |
|||
String[] COLUMNTYPE_STR = {"char", "varchar", "nvarchar", "varchar2"}; |
|||
/** |
|||
* 数据库文本类型 |
|||
*/ |
|||
String[] COLUMNTYPE_TEXT = {"tinytext", "text", "mediumtext", "longtext"}; |
|||
/** |
|||
* 数据库时间类型 |
|||
*/ |
|||
String[] COLUMNTYPE_TIME = {"datetime", "time", "date", "timestamp"}; |
|||
/** |
|||
* 数据库数字类型 |
|||
*/ |
|||
String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "number", "integer", |
|||
"bit", "bigint", "float", "double", "decimal"}; |
|||
/** |
|||
* BO对象 不需要添加字段 |
|||
*/ |
|||
String[] COLUMNNAME_NOT_ADD = {"create_by", "create_time", "del_flag", "update_by", |
|||
"update_time", "version"}; |
|||
/** |
|||
* BO对象 不需要编辑字段 |
|||
*/ |
|||
String[] COLUMNNAME_NOT_EDIT = {"create_by", "create_time", "del_flag", "update_by", |
|||
"update_time", "version"}; |
|||
/** |
|||
* VO对象 不需要返回字段 |
|||
*/ |
|||
String[] COLUMNNAME_NOT_LIST = {"create_by", "create_time", "del_flag", "update_by", |
|||
"update_time", "version"}; |
|||
/** |
|||
* BO对象 不需要查询字段 |
|||
*/ |
|||
String[] COLUMNNAME_NOT_QUERY = {"id", "create_by", "create_time", "del_flag", "update_by", |
|||
"update_time", "remark", "version"}; |
|||
/** |
|||
* Entity基类字段 |
|||
*/ |
|||
String[] BASE_ENTITY = {"createBy", "createTime", "updateBy", "updateTime"}; |
|||
/** |
|||
* Tree基类字段 |
|||
*/ |
|||
String[] TREE_ENTITY = {"parentName", "parentId", "children"}; |
|||
/** |
|||
* 文本框 |
|||
*/ |
|||
String HTML_INPUT = "input"; |
|||
/** |
|||
* 文本域 |
|||
*/ |
|||
String HTML_TEXTAREA = "textarea"; |
|||
/** |
|||
* 下拉框 |
|||
*/ |
|||
String HTML_SELECT = "select"; |
|||
/** |
|||
* 单选框 |
|||
*/ |
|||
String HTML_RADIO = "radio"; |
|||
/** |
|||
* 复选框 |
|||
*/ |
|||
String HTML_CHECKBOX = "checkbox"; |
|||
/** |
|||
* 日期控件 |
|||
*/ |
|||
String HTML_DATETIME = "datetime"; |
|||
/** |
|||
* 图片上传控件 |
|||
*/ |
|||
String HTML_IMAGE_UPLOAD = "imageUpload"; |
|||
/** |
|||
* 文件上传控件 |
|||
*/ |
|||
String HTML_FILE_UPLOAD = "fileUpload"; |
|||
/** |
|||
* 富文本控件 |
|||
*/ |
|||
String HTML_EDITOR = "editor"; |
|||
/** |
|||
* 字符串类型 |
|||
*/ |
|||
String TYPE_STRING = "String"; |
|||
/** |
|||
* 整型 |
|||
*/ |
|||
String TYPE_INTEGER = "Integer"; |
|||
/** |
|||
* 长整型 |
|||
*/ |
|||
String TYPE_LONG = "Long"; |
|||
/** |
|||
* 浮点型 |
|||
*/ |
|||
String TYPE_DOUBLE = "Double"; |
|||
/** |
|||
* 高精度计算类型 |
|||
*/ |
|||
String TYPE_BIGDECIMAL = "BigDecimal"; |
|||
/** |
|||
* 时间类型 |
|||
*/ |
|||
String TYPE_DATE = "Date"; |
|||
/** |
|||
* 模糊查询 |
|||
*/ |
|||
String QUERY_LIKE = "LIKE"; |
|||
/** |
|||
* 相等查询 |
|||
*/ |
|||
String QUERY_EQ = "EQ"; |
|||
/** |
|||
* 需要 |
|||
*/ |
|||
String REQUIRE = "1"; |
|||
} |
@ -0,0 +1,76 @@ |
|||
package com.inscloudtech.common.constant; |
|||
|
|||
/** |
|||
* 返回状态码 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
public interface HttpStatus { /** |
|||
* 操作成功 |
|||
*/ |
|||
int SUCCESS = 200; |
|||
/** |
|||
* 对象创建成功 |
|||
*/ |
|||
int CREATED = 201; |
|||
/** |
|||
* 请求已经被接受 |
|||
*/ |
|||
int ACCEPTED = 202; |
|||
/** |
|||
* 操作已经执行成功,但是没有返回数据 |
|||
*/ |
|||
int NO_CONTENT = 204; |
|||
/** |
|||
* 资源已被移除 |
|||
*/ |
|||
int MOVED_PERM = 301; |
|||
/** |
|||
* 重定向 |
|||
*/ |
|||
int SEE_OTHER = 303; |
|||
/** |
|||
* 资源没有被修改 |
|||
*/ |
|||
int NOT_MODIFIED = 304; |
|||
/** |
|||
* 参数列表错误(缺少,格式不匹配) |
|||
*/ |
|||
int BAD_REQUEST = 400; |
|||
/** |
|||
* 未授权 |
|||
*/ |
|||
int UNAUTHORIZED = 401; |
|||
/** |
|||
* 访问受限,授权过期 |
|||
*/ |
|||
int FORBIDDEN = 403; |
|||
/** |
|||
* 资源,服务未找到 |
|||
*/ |
|||
int NOT_FOUND = 404; |
|||
/** |
|||
* 不允许的http方法 |
|||
*/ |
|||
int BAD_METHOD = 405; |
|||
/** |
|||
* 资源冲突,或者资源被锁 |
|||
*/ |
|||
int CONFLICT = 409; |
|||
/** |
|||
* 不支持的数据,媒体类型 |
|||
*/ |
|||
int UNSUPPORTED_TYPE = 415; |
|||
/** |
|||
* 系统内部错误 |
|||
*/ |
|||
int ERROR = 500; |
|||
/** |
|||
* 接口未实现 |
|||
*/ |
|||
int NOT_IMPLEMENTED = 501; |
|||
/** |
|||
* 系统警告消息 |
|||
*/ |
|||
int WARN = 601; |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.inscloudtech.common.constant; |
|||
|
|||
/** |
|||
* 翻译常量 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
public interface TransConstant { |
|||
/** |
|||
* 用户id转账号 |
|||
*/ |
|||
String USER_ID_TO_NAME = "user_id_to_name"; |
|||
|
|||
String USERNAME_TO_NICKNAME = "username_to_nickname"; |
|||
/** |
|||
* 部门id转名称 |
|||
*/ |
|||
String DEPT_ID_TO_NAME = "dept_id_to_name"; |
|||
/** |
|||
* 字典type转label |
|||
*/ |
|||
String DICT_TYPE_TO_LABEL = "dict_type_to_label"; |
|||
/** |
|||
* ossId转url |
|||
*/ |
|||
String OSS_ID_TO_URL = "oss_id_to_url"; |
|||
|
|||
} |
@ -0,0 +1,108 @@ |
|||
package com.inscloudtech.common.constant; |
|||
|
|||
/** |
|||
* 用户常量信息 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
public interface UserConstants { |
|||
/** |
|||
* 平台内系统用户的唯一标志 |
|||
*/ |
|||
String SYS_USER = "SYS_USER"; |
|||
/** |
|||
* 正常状态 |
|||
*/ |
|||
String NORMAL = "0"; |
|||
/** |
|||
* 异常状态 |
|||
*/ |
|||
String EXCEPTION = "1"; |
|||
/** |
|||
* 用户正常状态 |
|||
*/ |
|||
String USER_NORMAL = "0"; |
|||
/** |
|||
* 用户封禁状态 |
|||
*/ |
|||
String USER_DISABLE = "1"; |
|||
/** |
|||
* 角色正常状态 |
|||
*/ |
|||
String ROLE_NORMAL = "0"; |
|||
/** |
|||
* 角色封禁状态 |
|||
*/ |
|||
String ROLE_DISABLE = "1"; |
|||
/** |
|||
* 部门正常状态 |
|||
*/ |
|||
String DEPT_NORMAL = "0"; |
|||
/** |
|||
* 部门停用状态 |
|||
*/ |
|||
String DEPT_DISABLE = "1"; |
|||
/** |
|||
* 字典正常状态 |
|||
*/ |
|||
String DICT_NORMAL = "0"; |
|||
/** |
|||
* 是否为系统默认(是) |
|||
*/ |
|||
String YES = "Y"; |
|||
/** |
|||
* 是否菜单外链(是) |
|||
*/ |
|||
String YES_FRAME = "0"; |
|||
/** |
|||
* 是否菜单外链(否) |
|||
*/ |
|||
String NO_FRAME = "1"; |
|||
/** |
|||
* 菜单正常状态 |
|||
*/ |
|||
String MENU_NORMAL = "0"; |
|||
/** |
|||
* 菜单停用状态 |
|||
*/ |
|||
String MENU_DISABLE = "1"; |
|||
/** |
|||
* 菜单类型(目录) |
|||
*/ |
|||
String TYPE_DIR = "M"; |
|||
/** |
|||
* 菜单类型(菜单) |
|||
*/ |
|||
String TYPE_MENU = "C"; |
|||
/** |
|||
* 菜单类型(按钮) |
|||
*/ |
|||
String TYPE_BUTTON = "F"; |
|||
/** |
|||
* Layout组件标识 |
|||
*/ |
|||
String LAYOUT = "Layout"; |
|||
/** |
|||
* ParentView组件标识 |
|||
*/ |
|||
String PARENT_VIEW = "ParentView"; |
|||
/** |
|||
* InnerLink组件标识 |
|||
*/ |
|||
String INNER_LINK = "InnerLink"; |
|||
/** |
|||
* 用户名长度限制 |
|||
*/ |
|||
int USERNAME_MIN_LENGTH = 2; |
|||
int USERNAME_MAX_LENGTH = 20; |
|||
/** |
|||
* 密码长度限制 |
|||
*/ |
|||
int PASSWORD_MIN_LENGTH = 5; |
|||
int PASSWORD_MAX_LENGTH = 20; |
|||
/** |
|||
* 管理员ID |
|||
*/ |
|||
Long ADMIN_ID = 1L; |
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.inscloudtech.common.convert; |
|||
|
|||
import cn.hutool.core.convert.Convert; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
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 lombok.extern.slf4j.Slf4j; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 大数值转换 |
|||
* Excel 数值长度位15位 大于15位的数值转换位字符串 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Slf4j |
|||
public class ExcelBigNumberConvert implements Converter<Long> { |
|||
|
|||
@Override |
|||
public Class<Long> supportJavaTypeKey() { |
|||
return Long.class; |
|||
} |
|||
|
|||
@Override |
|||
public CellDataTypeEnum supportExcelTypeKey() { |
|||
return CellDataTypeEnum.STRING; |
|||
} |
|||
|
|||
@Override |
|||
public Long convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { |
|||
return Convert.toLong(cellData.getData()); |
|||
} |
|||
|
|||
@Override |
|||
public WriteCellData<Object> convertToExcelData(Long object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { |
|||
if (ObjectUtil.isNotNull(object)) { |
|||
String str = Convert.toStr(object); |
|||
if (str.length() > 15) { |
|||
return new WriteCellData<>(str); |
|||
} |
|||
} |
|||
WriteCellData<Object> cellData = new WriteCellData<>(new BigDecimal(object)); |
|||
cellData.setType(CellDataTypeEnum.NUMBER); |
|||
return cellData; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,73 @@ |
|||
package com.inscloudtech.common.convert; |
|||
|
|||
import cn.hutool.core.annotation.AnnotationUtil; |
|||
import cn.hutool.core.convert.Convert; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
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.inscloudtech.common.annotation.ExcelDictFormat; |
|||
import com.inscloudtech.common.core.service.DictService; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
import com.inscloudtech.common.utils.poi.ExcelUtil; |
|||
import com.inscloudtech.common.utils.spring.SpringUtils; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
import java.lang.reflect.Field; |
|||
|
|||
/** |
|||
* 字典格式化转换处理 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Slf4j |
|||
public class ExcelDictConvert implements Converter<Object> { |
|||
|
|||
@Override |
|||
public Class<Object> supportJavaTypeKey() { |
|||
return Object.class; |
|||
} |
|||
|
|||
@Override |
|||
public CellDataTypeEnum supportExcelTypeKey() { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public Object convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { |
|||
ExcelDictFormat anno = getAnnotation(contentProperty.getField()); |
|||
String type = anno.dictType(); |
|||
String label = cellData.getStringValue(); |
|||
String value; |
|||
if (StringUtils.isBlank(type)) { |
|||
value = ExcelUtil.reverseByExp(label, anno.readConverterExp(), anno.separator()); |
|||
} else { |
|||
value = SpringUtils.getBean(DictService.class).getDictValue(type, label, anno.separator()); |
|||
} |
|||
return Convert.convert(contentProperty.getField().getType(), value); |
|||
} |
|||
|
|||
@Override |
|||
public WriteCellData<String> convertToExcelData(Object object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { |
|||
if (ObjectUtil.isNull(object)) { |
|||
return new WriteCellData<>(""); |
|||
} |
|||
ExcelDictFormat anno = getAnnotation(contentProperty.getField()); |
|||
String type = anno.dictType(); |
|||
String value = Convert.toStr(object); |
|||
String label; |
|||
if (StringUtils.isBlank(type)) { |
|||
label = ExcelUtil.convertByExp(value, anno.readConverterExp(), anno.separator()); |
|||
} else { |
|||
label = SpringUtils.getBean(DictService.class).getDictLabel(type, value, anno.separator()); |
|||
} |
|||
return new WriteCellData<>(label); |
|||
} |
|||
|
|||
private ExcelDictFormat getAnnotation(Field field) { |
|||
return AnnotationUtil.getAnnotation(field, ExcelDictFormat.class); |
|||
} |
|||
} |
@ -0,0 +1,75 @@ |
|||
package com.inscloudtech.common.convert; |
|||
|
|||
import cn.hutool.core.annotation.AnnotationUtil; |
|||
import cn.hutool.core.convert.Convert; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
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.inscloudtech.common.annotation.ExcelEnumFormat; |
|||
import com.inscloudtech.common.utils.reflect.ReflectUtils; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
import java.lang.reflect.Field; |
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 枚举格式化转换处理 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Slf4j |
|||
public class ExcelEnumConvert implements Converter<Object> { |
|||
|
|||
@Override |
|||
public Class<Object> supportJavaTypeKey() { |
|||
return Object.class; |
|||
} |
|||
|
|||
@Override |
|||
public CellDataTypeEnum supportExcelTypeKey() { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public Object convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { |
|||
Object codeValue = cellData.getData(); |
|||
// 如果是空值 |
|||
if (ObjectUtil.isNull(codeValue)) { |
|||
return null; |
|||
} |
|||
Map<Object, String> enumValueMap = beforeConvert(contentProperty); |
|||
String textValue = enumValueMap.get(codeValue); |
|||
return Convert.convert(contentProperty.getField().getType(), textValue); |
|||
} |
|||
|
|||
@Override |
|||
public WriteCellData<String> convertToExcelData(Object object, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { |
|||
if (ObjectUtil.isNull(object)) { |
|||
return new WriteCellData<>(""); |
|||
} |
|||
Map<Object, String> enumValueMap = beforeConvert(contentProperty); |
|||
String value = Convert.toStr(enumValueMap.get(object), ""); |
|||
return new WriteCellData<>(value); |
|||
} |
|||
|
|||
private Map<Object, String> beforeConvert(ExcelContentProperty contentProperty) { |
|||
ExcelEnumFormat anno = getAnnotation(contentProperty.getField()); |
|||
Map<Object, String> enumValueMap = new HashMap<>(); |
|||
Enum<?>[] enumConstants = anno.enumClass().getEnumConstants(); |
|||
for (Enum<?> enumConstant : enumConstants) { |
|||
Object codeValue = ReflectUtils.invokeGetter(enumConstant, anno.codeField()); |
|||
String textValue = ReflectUtils.invokeGetter(enumConstant, anno.textField()); |
|||
enumValueMap.put(codeValue, textValue); |
|||
} |
|||
return enumValueMap; |
|||
} |
|||
|
|||
private ExcelEnumFormat getAnnotation(Field field) { |
|||
return AnnotationUtil.getAnnotation(field, ExcelEnumFormat.class); |
|||
} |
|||
} |
@ -0,0 +1,62 @@ |
|||
package com.inscloudtech.common.core.controller; |
|||
|
|||
import com.inscloudtech.common.core.domain.R; |
|||
import com.inscloudtech.common.core.domain.model.LoginUser; |
|||
import com.inscloudtech.common.helper.LoginHelper; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
|
|||
/** |
|||
* web层通用数据处理 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
public class BaseController { |
|||
/** |
|||
* 响应返回结果 |
|||
* |
|||
* @param rows 影响行数 |
|||
* @return 操作结果 |
|||
*/ |
|||
protected R<Void> toAjax(int rows) { |
|||
return rows > 0 ? R.ok() : R.fail(); |
|||
} |
|||
/** |
|||
* 响应返回结果 |
|||
* |
|||
* @param result 结果 |
|||
* @return 操作结果 |
|||
*/ |
|||
protected R<Void> toAjax(boolean result) { |
|||
return result ? R.ok() : R.fail(); |
|||
} |
|||
/** |
|||
* 页面跳转 |
|||
*/ |
|||
public String redirect(String url) { |
|||
return StringUtils.format("redirect:{}", url); |
|||
} |
|||
/** |
|||
* 获取用户缓存信息 |
|||
*/ |
|||
public LoginUser getLoginUser() { |
|||
return LoginHelper.getLoginUser(); |
|||
} |
|||
/** |
|||
* 获取登录用户id |
|||
*/ |
|||
public Long getUserId() { |
|||
return LoginHelper.getUserId(); |
|||
} |
|||
/** |
|||
* 获取登录部门id |
|||
*/ |
|||
public Long getDeptId() { |
|||
return LoginHelper.getDeptId(); |
|||
} |
|||
/** |
|||
* 获取登录用户名 |
|||
*/ |
|||
public String getUsername() { |
|||
return LoginHelper.getUsername(); |
|||
} |
|||
} |
@ -0,0 +1,83 @@ |
|||
package com.inscloudtech.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.FieldFill; |
|||
import com.baomidou.mybatisplus.annotation.FieldStrategy; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableLogic; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonInclude; |
|||
import lombok.Data; |
|||
import org.dromara.easyes.annotation.IndexField; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* Entity基类 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
public class BaseEntity implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 搜索值 |
|||
*/ |
|||
@JsonIgnore |
|||
@TableField(exist = false) |
|||
private String searchValue; |
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private Date createTime; |
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
@TableField(fill = FieldFill.INSERT_UPDATE) |
|||
private String updateBy; |
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
@TableField(fill = FieldFill.INSERT_UPDATE) |
|||
private Date updateTime; |
|||
/** |
|||
* 请求参数 |
|||
*/ |
|||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
|||
@TableField(exist = false) |
|||
private Map<String, Object> params = new HashMap<>(); |
|||
|
|||
@TableField(exist = false) |
|||
@IndexField(exist = false) |
|||
private List<String> ids; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@TableField(updateStrategy = FieldStrategy.IGNORED) |
|||
@IndexField(strategy = org.dromara.easyes.annotation.rely.FieldStrategy.IGNORED) |
|||
private String remark; |
|||
|
|||
@JsonIgnore |
|||
@TableField(exist = false) |
|||
@IndexField(exist = false) |
|||
private Integer downloadTemplate; |
|||
|
|||
|
|||
@IndexField(exist = false) |
|||
@TableLogic |
|||
@JsonIgnore |
|||
private String delFlag; |
|||
|
|||
} |
@ -0,0 +1,48 @@ |
|||
package com.inscloudtech.common.core.domain; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* Entity基类 |
|||
* |
|||
* @author ruoyi |
|||
*/ |
|||
@Data |
|||
public class ExportBaseEntity implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ExcelProperty("id") |
|||
private String id; |
|||
|
|||
@ExcelProperty("创建者") |
|||
private String createBy; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ExcelProperty("创建时间") |
|||
private Date createTime; |
|||
|
|||
@ExcelProperty("更新者") |
|||
private String updateBy; |
|||
|
|||
@ExcelProperty("更新时间") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
private Date updateTime; |
|||
|
|||
@ExcelProperty("备注") |
|||
private String remark; |
|||
|
|||
|
|||
@ExcelProperty("bgc") |
|||
private String bgc; |
|||
|
|||
@ExcelProperty("caseId") |
|||
private String caseId; |
|||
|
|||
@ExcelProperty("analysisResultId") |
|||
private String analysisResultId; |
|||
} |
@ -0,0 +1,105 @@ |
|||
package com.inscloudtech.common.core.domain; |
|||
|
|||
import cn.hutool.core.collection.CollUtil; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
import com.baomidou.mybatisplus.core.metadata.OrderItem; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.inscloudtech.common.exception.ServiceException; |
|||
import com.inscloudtech.common.utils.StringUtils; |
|||
import com.inscloudtech.common.utils.sql.SqlUtil; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 分页查询实体类 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
public class PageQuery implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 分页大小 |
|||
*/ |
|||
private Integer pageSize; |
|||
/** |
|||
* 当前页数 |
|||
*/ |
|||
private Integer pageNum; |
|||
/** |
|||
* 排序列 |
|||
*/ |
|||
private String orderByColumn; |
|||
/** |
|||
* 排序的方向desc或者asc |
|||
*/ |
|||
private String isAsc; |
|||
/** |
|||
* 当前记录起始索引 默认值 |
|||
*/ |
|||
public static final int DEFAULT_PAGE_NUM = 1; |
|||
/** |
|||
* 每页显示记录数 默认值 默认查全部 |
|||
*/ |
|||
public static final int DEFAULT_PAGE_SIZE = 20; |
|||
|
|||
public <T> Page<T> build() { |
|||
Integer pageNum = ObjectUtil.defaultIfNull(getPageNum(), DEFAULT_PAGE_NUM); |
|||
Integer pageSize = ObjectUtil.defaultIfNull(getPageSize(), DEFAULT_PAGE_SIZE); |
|||
if (pageNum <= 0) { |
|||
pageNum = DEFAULT_PAGE_NUM; |
|||
} |
|||
Page<T> page = new Page<>(pageNum, pageSize); |
|||
List<OrderItem> orderItems = buildOrderItem(); |
|||
if (CollUtil.isNotEmpty(orderItems)) { |
|||
page.addOrder(orderItems); |
|||
} |
|||
return page; |
|||
} |
|||
/** |
|||
* 构建排序 |
|||
* |
|||
* 支持的用法如下: |
|||
* {isAsc:"asc",orderByColumn:"id"} order by id asc |
|||
* {isAsc:"asc",orderByColumn:"id,createTime"} order by id asc,create_time asc |
|||
* {isAsc:"desc",orderByColumn:"id,createTime"} order by id desc,create_time desc |
|||
* {isAsc:"asc,desc",orderByColumn:"id,createTime"} order by id asc,create_time desc |
|||
*/ |
|||
private List<OrderItem> buildOrderItem() { |
|||
if (StringUtils.isBlank(orderByColumn) || StringUtils.isBlank(isAsc)) { |
|||
return null; |
|||
} |
|||
String orderBy = SqlUtil.escapeOrderBySql(orderByColumn); |
|||
orderBy = StringUtils.toUnderScoreCase(orderBy); |
|||
|
|||
// 兼容前端排序类型 |
|||
isAsc = StringUtils.replaceEach(isAsc, new String[]{"ascending", "descending"}, new String[]{"asc", "desc"}); |
|||
|
|||
String[] orderByArr = orderBy.split(StringUtils.SEPARATOR); |
|||
String[] isAscArr = isAsc.split(StringUtils.SEPARATOR); |
|||
if (isAscArr.length != 1 && isAscArr.length != orderByArr.length) { |
|||
throw new ServiceException("排序参数有误"); |
|||
} |
|||
|
|||
List<OrderItem> list = new ArrayList<>(); |
|||
// 每个字段各自排序 |
|||
for (int i = 0; i < orderByArr.length; i++) { |
|||
String orderByStr = orderByArr[i]; |
|||
String isAscStr = isAscArr.length == 1 ? isAscArr[0] : isAscArr[i]; |
|||
if ("asc".equals(isAscStr)) { |
|||
list.add(OrderItem.asc(orderByStr)); |
|||
} else if ("desc".equals(isAscStr)) { |
|||
list.add(OrderItem.desc(orderByStr)); |
|||
} else { |
|||
throw new ServiceException("排序参数有误"); |
|||
} |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,103 @@ |
|||
package com.inscloudtech.common.core.domain; |
|||
|
|||
import com.inscloudtech.common.constant.HttpStatus; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 响应信息主体 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
@Data |
|||
@NoArgsConstructor |
|||
public class R<T> implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 成功 |
|||
*/ |
|||
public static final int SUCCESS = 200; |
|||
/** |
|||
* 失败 |
|||
*/ |
|||
public static final int FAIL = 500; |
|||
|
|||
private int code; |
|||
|
|||
private String msg; |
|||
|
|||
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(String msg) { |
|||
return restResult(null, SUCCESS, msg); |
|||
} |
|||
|
|||
public static <T> R<T> ok(String msg, T data) { |
|||
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(String msg, T data) { |
|||
return restResult(data, FAIL, msg); |
|||
} |
|||
|
|||
public static <T> R<T> fail(int code, String msg) { |
|||
return restResult(null, code, msg); |
|||
} |
|||
/** |
|||
* 返回警告消息 |
|||
* |
|||
* @param msg 返回内容 |
|||
* @return 警告消息 |
|||
*/ |
|||
public static <T> R<T> warn(String msg) { |
|||
return restResult(null, HttpStatus.WARN, msg); |
|||
} |
|||
/** |
|||
* 返回警告消息 |
|||
* |
|||
* @param msg 返回内容 |
|||
* @param data 数据对象 |
|||
* @return 警告消息 |
|||
*/ |
|||
public static <T> R<T> warn(String msg, T data) { |
|||
return restResult(data, HttpStatus.WARN, msg); |
|||
} |
|||
|
|||
private static <T> R<T> restResult(T data, int code, String msg) { |
|||
R<T> r = new R<>(); |
|||
r.setCode(code); |
|||
r.setData(data); |
|||
r.setMsg(msg); |
|||
return r; |
|||
} |
|||
|
|||
public static <T> Boolean isError(R<T> ret) { |
|||
return !isSuccess(ret); |
|||
} |
|||
|
|||
public static <T> Boolean isSuccess(R<T> ret) { |
|||
return R.SUCCESS == ret.getCode(); |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.inscloudtech.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Tree基类 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
public class TreeEntity<T> extends BaseEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 父菜单名称 |
|||
*/ |
|||
@TableField(exist = false) |
|||
private String parentName; |
|||
/** |
|||
* 父菜单ID |
|||
*/ |
|||
private Long parentId; |
|||
/** |
|||
* 子部门 |
|||
*/ |
|||
@TableField(exist = false) |
|||
private List<T> children = new ArrayList<>(); |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.inscloudtech.common.core.domain.dto; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 角色 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
public class RoleDTO implements Serializable { |
|||
/** |
|||
* 角色ID |
|||
*/ |
|||
private Long roleId; |
|||
/** |
|||
* 角色名称 |
|||
*/ |
|||
private String roleName; |
|||
/** |
|||
* 角色权限 |
|||
*/ |
|||
private String roleKey; |
|||
/** |
|||
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) |
|||
*/ |
|||
private String dataScope; |
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.inscloudtech.common.core.domain.dto; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 当前在线会话 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
public class UserOnlineDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 会话编号 |
|||
*/ |
|||
private String tokenId; |
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
private String deptName; |
|||
/** |
|||
* 用户名称 |
|||
*/ |
|||
private String userName; |
|||
/** |
|||
* 登录IP地址 |
|||
*/ |
|||
private String ipaddr; |
|||
/** |
|||
* 登录地址 |
|||
*/ |
|||
private String loginLocation; |
|||
/** |
|||
* 浏览器类型 |
|||
*/ |
|||
private String browser; |
|||
/** |
|||
* 操作系统 |
|||
*/ |
|||
private String os; |
|||
/** |
|||
* 登录时间 |
|||
*/ |
|||
private Long loginTime; |
|||
|
|||
} |
@ -0,0 +1,110 @@ |
|||
package com.inscloudtech.common.core.domain.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableLogic; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.inscloudtech.common.annotation.UpdateValueLog; |
|||
import com.inscloudtech.common.core.domain.TreeEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import javax.validation.constraints.Email; |
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 部门表 sys_dept |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("sys_dept") |
|||
public class SysDept extends TreeEntity<SysDept> { |
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
@TableId(value = "dept_id") |
|||
private Long deptId; |
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
@NotBlank(message = "单位名称不能为空") |
|||
@Size(min = 0, max = 30, message = "单位名称长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "单位名称") |
|||
private String deptName; |
|||
|
|||
private String shortName; |
|||
|
|||
@NotBlank(message = "单位编码不能为空") |
|||
@Size(min = 0, max = 30, message = "单位编码长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "单位编码") |
|||
private String deptCode; |
|||
|
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
// @NotBlank(message = "机构类别不能为空") |
|||
@Size(min = 0, max = 30, message = "机构类别长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "机构类别") |
|||
private String deptType; |
|||
|
|||
@TableField(exist = false) |
|||
private List<String> deptTypeList; |
|||
|
|||
@TableField(exist = false) |
|||
private List<String> deptCodeList; |
|||
/** |
|||
* 显示顺序 |
|||
*/ |
|||
@NotNull(message = "显示顺序不能为空") |
|||
private Integer orderNum; |
|||
/** |
|||
* 负责人 |
|||
*/ |
|||
@UpdateValueLog(fieldName = "负责人") |
|||
private String leader; |
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
@Size(min = 0, max = 11, message = "联系电话长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "联系电话") |
|||
private String phone; |
|||
/** |
|||
* 邮箱 |
|||
*/ |
|||
@Email(message = "邮箱格式不正确") |
|||
@Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "联系电话") |
|||
private String email; |
|||
/** |
|||
* 部门状态:0正常,1停用 |
|||
*/ |
|||
@UpdateValueLog(fieldName = "部门状态") |
|||
private String status; |
|||
/** |
|||
* 删除标志(0代表存在 2代表删除) |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
/** |
|||
* 祖级列表 |
|||
*/ |
|||
private String ancestors; |
|||
/** |
|||
* 父菜单名称 |
|||
*/ |
|||
@UpdateValueLog(fieldName = "上级部门") |
|||
private String parentName; |
|||
|
|||
/** |
|||
* 是否是erp单位 |
|||
*/ |
|||
@UpdateValueLog(fieldName = "是否是erp单位") |
|||
private String erp; |
|||
} |
@ -0,0 +1,109 @@ |
|||
package com.inscloudtech.common.core.domain.entity; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.inscloudtech.common.annotation.ExcelDictFormat; |
|||
import com.inscloudtech.common.annotation.Translation; |
|||
import com.inscloudtech.common.annotation.UpdateValueLog; |
|||
import com.inscloudtech.common.constant.TransConstant; |
|||
import com.inscloudtech.common.constant.UserConstants; |
|||
import com.inscloudtech.common.convert.ExcelDictConvert; |
|||
import com.inscloudtech.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.Size; |
|||
|
|||
/** |
|||
* 字典数据表 sys_dict_data |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("sys_dict_data") |
|||
@ExcelIgnoreUnannotated |
|||
public class SysDictData extends BaseEntity { |
|||
/** |
|||
* 字典编码 |
|||
*/ |
|||
@ExcelProperty(value = "字典编码") |
|||
@TableId(value = "dict_code") |
|||
private Long dictCode; |
|||
/** |
|||
* 字典排序 |
|||
*/ |
|||
@ExcelProperty(value = "字典排序") |
|||
@UpdateValueLog(fieldName = "字典排序") |
|||
private Integer dictSort; |
|||
/** |
|||
* 字典标签 |
|||
*/ |
|||
@ExcelProperty(value = "字典标签") |
|||
@NotBlank(message = "字典标签不能为空") |
|||
@Size(min = 0, max = 100, message = "字典标签长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "字典排序") |
|||
private String dictLabel; |
|||
/** |
|||
* 字典键值 |
|||
*/ |
|||
@ExcelProperty(value = "字典键值") |
|||
@NotBlank(message = "字典键值不能为空") |
|||
@Size(min = 0, max = 100, message = "字典键值长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "字典键值") |
|||
private String dictValue; |
|||
/** |
|||
* 字典类型 |
|||
*/ |
|||
@ExcelProperty(value = "字典类型") |
|||
@NotBlank(message = "字典类型不能为空") |
|||
@Size(min = 0, max = 100, message = "字典类型长度不能超过{max}个字符") |
|||
private String dictType; |
|||
/** |
|||
* 样式属性(其他样式扩展) |
|||
*/ |
|||
@Size(min = 0, max = 100, message = "样式属性长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "样式属性") |
|||
private String cssClass; |
|||
/** |
|||
* 表格字典样式 |
|||
*/ |
|||
@UpdateValueLog(fieldName = "表格字典样式") |
|||
private String listClass; |
|||
/** |
|||
* 是否默认(Y是 N否) |
|||
*/ |
|||
@ExcelProperty(value = "是否默认", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "sys_yes_no") |
|||
private String isDefault; |
|||
/** |
|||
* 状态(0正常 1停用) |
|||
*/ |
|||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "sys_normal_disable") |
|||
@UpdateValueLog(fieldName = "状态") |
|||
private String status; |
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@UpdateValueLog(fieldName = "remark") |
|||
private String remark; |
|||
|
|||
@Translation(type = TransConstant.USERNAME_TO_NICKNAME,mapper = "createBy") |
|||
@TableField(exist = false) |
|||
private String createByNickname; |
|||
|
|||
@Translation(type = TransConstant.USERNAME_TO_NICKNAME,mapper = "updateBy") |
|||
@TableField(exist = false) |
|||
private String updateByNickname; |
|||
|
|||
public boolean getDefault() { |
|||
return UserConstants.YES.equals(this.isDefault); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.inscloudtech.common.core.domain.entity; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.inscloudtech.common.annotation.ExcelDictFormat; |
|||
import com.inscloudtech.common.annotation.UpdateValueLog; |
|||
import com.inscloudtech.common.convert.ExcelDictConvert; |
|||
import com.inscloudtech.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.Pattern; |
|||
import javax.validation.constraints.Size; |
|||
|
|||
/** |
|||
* 字典类型表 sys_dict_type |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("sys_dict_type") |
|||
@ExcelIgnoreUnannotated |
|||
public class SysDictType extends BaseEntity { |
|||
/** |
|||
* 字典主键 |
|||
*/ |
|||
@ExcelProperty(value = "字典主键") |
|||
@TableId(value = "dict_id") |
|||
private Long dictId; |
|||
/** |
|||
* 字典名称 |
|||
*/ |
|||
@ExcelProperty(value = "字典名称") |
|||
@NotBlank(message = "字典名称不能为空") |
|||
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "字典名称") |
|||
private String dictName; |
|||
/** |
|||
* 字典类型 |
|||
*/ |
|||
@ExcelProperty(value = "字典类型") |
|||
@NotBlank(message = "字典类型不能为空") |
|||
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过{max}个字符") |
|||
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)") |
|||
@UpdateValueLog(fieldName = "字典类型") |
|||
private String dictType; |
|||
/** |
|||
* 字典组名值 |
|||
*/ |
|||
@ExcelProperty(value = "字典组名值") |
|||
// @NotBlank(message = "字典组名值不能为空") |
|||
@Size(min = 0, max = 100, message = "字典组名值类型长度不能超过{max}个字符") |
|||
// @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典组名值必须以字母开头,且只能为(小写字母,数字,下滑线)") |
|||
@UpdateValueLog(fieldName = "字典组名值") |
|||
private String dictGroupValue; |
|||
/** |
|||
* 状态(0正常 1停用) |
|||
*/ |
|||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "sys_normal_disable") |
|||
@UpdateValueLog(fieldName = "状态") |
|||
private String status; |
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@UpdateValueLog(fieldName = "备注") |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,90 @@ |
|||
package com.inscloudtech.common.core.domain.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.fasterxml.jackson.annotation.JsonInclude; |
|||
import com.inscloudtech.common.core.domain.TreeEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
|
|||
/** |
|||
* 菜单权限表 sys_menu |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("sys_menu") |
|||
public class SysMenu extends TreeEntity<SysMenu> { |
|||
/** |
|||
* 菜单ID |
|||
*/ |
|||
@TableId(value = "menu_id") |
|||
private Long menuId; |
|||
/** |
|||
* 菜单名称 |
|||
*/ |
|||
@NotBlank(message = "菜单名称不能为空") |
|||
@Size(min = 0, max = 50, message = "菜单名称长度不能超过{max}个字符") |
|||
private String menuName; |
|||
/** |
|||
* 显示顺序 |
|||
*/ |
|||
@NotNull(message = "显示顺序不能为空") |
|||
private Integer orderNum; |
|||
/** |
|||
* 路由地址 |
|||
*/ |
|||
@Size(min = 0, max = 200, message = "路由地址不能超过{max}个字符") |
|||
private String path; |
|||
/** |
|||
* 组件路径 |
|||
*/ |
|||
@Size(min = 0, max = 200, message = "组件路径不能超过{max}个字符") |
|||
private String component; |
|||
/** |
|||
* 路由参数 |
|||
*/ |
|||
private String queryParam; |
|||
/** |
|||
* 是否为外链(0是 1否) |
|||
*/ |
|||
private String isFrame; |
|||
/** |
|||
* 是否缓存(0缓存 1不缓存) |
|||
*/ |
|||
private String isCache; |
|||
/** |
|||
* 类型(M目录 C菜单 F按钮) |
|||
*/ |
|||
@NotBlank(message = "菜单类型不能为空") |
|||
private String menuType; |
|||
/** |
|||
* 显示状态(0显示 1隐藏) |
|||
*/ |
|||
private String visible; |
|||
/** |
|||
* 菜单状态(0正常 1停用) |
|||
*/ |
|||
private String status; |
|||
/** |
|||
* 权限字符串 |
|||
*/ |
|||
@JsonInclude(JsonInclude.Include.NON_NULL) |
|||
@Size(min = 0, max = 100, message = "权限标识长度不能超过{max}个字符") |
|||
private String perms; |
|||
/** |
|||
* 菜单图标 |
|||
*/ |
|||
private String icon; |
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,124 @@ |
|||
package com.inscloudtech.common.core.domain.entity; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableLogic; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.inscloudtech.common.annotation.ExcelDictFormat; |
|||
import com.inscloudtech.common.annotation.UpdateValueLog; |
|||
import com.inscloudtech.common.constant.UserConstants; |
|||
import com.inscloudtech.common.convert.ExcelDictConvert; |
|||
import com.inscloudtech.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 角色表 sys_role |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("sys_role") |
|||
@ExcelIgnoreUnannotated |
|||
public class SysRole extends BaseEntity { |
|||
/** |
|||
* 角色ID |
|||
*/ |
|||
@ExcelProperty(value = "角色序号") |
|||
@TableId(value = "role_id") |
|||
private Long roleId; |
|||
/** |
|||
* 角色名称 |
|||
*/ |
|||
@ExcelProperty(value = "角色名称") |
|||
@NotBlank(message = "角色名称不能为空") |
|||
@Size(min = 0, max = 30, message = "角色名称长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "角色名称") |
|||
private String roleName; |
|||
/** |
|||
* 角色权限 |
|||
*/ |
|||
@ExcelProperty(value = "角色权限") |
|||
@NotBlank(message = "权限字符不能为空") |
|||
@Size(min = 0, max = 100, message = "权限字符长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "角色权限") |
|||
private String roleKey; |
|||
/** |
|||
* 角色排序 |
|||
*/ |
|||
@ExcelProperty(value = "角色排序") |
|||
@NotNull(message = "显示顺序不能为空") |
|||
@UpdateValueLog(fieldName = "角色权限") |
|||
private Integer roleSort; |
|||
/** |
|||
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) |
|||
*/ |
|||
@ExcelProperty(value = "数据范围", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") |
|||
private String dataScope; |
|||
/** |
|||
* 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) |
|||
*/ |
|||
private Boolean menuCheckStrictly; |
|||
/** |
|||
* 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) |
|||
*/ |
|||
private Boolean deptCheckStrictly; |
|||
/** |
|||
* 角色状态(0正常 1停用) |
|||
*/ |
|||
@ExcelProperty(value = "角色状态", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(dictType = "sys_normal_disable") |
|||
@UpdateValueLog(fieldName = "角色状态") |
|||
private String status; |
|||
/** |
|||
* 删除标志(0代表存在 2代表删除) |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@UpdateValueLog(fieldName = "备注") |
|||
private String remark; |
|||
/** |
|||
* 用户是否存在此角色标识 默认不存在 |
|||
*/ |
|||
@TableField(exist = false) |
|||
private boolean flag = false; |
|||
/** |
|||
* 菜单组 |
|||
*/ |
|||
@TableField(exist = false) |
|||
private Long[] menuIds; |
|||
/** |
|||
* 菜单组 |
|||
*/ |
|||
@TableField(exist = false) |
|||
@UpdateValueLog(fieldName = "菜单组") |
|||
private List<String> menuNames; |
|||
/** |
|||
* 部门组(数据权限) |
|||
*/ |
|||
@TableField(exist = false) |
|||
private Long[] deptIds; |
|||
|
|||
public SysRole(Long roleId) { |
|||
this.roleId = roleId; |
|||
} |
|||
|
|||
public boolean isAdmin() { |
|||
return UserConstants.ADMIN_ID.equals(this.roleId); |
|||
} |
|||
} |
@ -0,0 +1,172 @@ |
|||
package com.inscloudtech.common.core.domain.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import com.inscloudtech.common.annotation.Sensitive; |
|||
import com.inscloudtech.common.annotation.UpdateValueLog; |
|||
import com.inscloudtech.common.annotation.UpdateValueLog; |
|||
import com.inscloudtech.common.constant.UserConstants; |
|||
import com.inscloudtech.common.core.domain.BaseEntity; |
|||
import com.inscloudtech.common.enums.SensitiveStrategy; |
|||
import com.inscloudtech.common.xss.Xss; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import javax.validation.constraints.Email; |
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.Size; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.List; |
|||
/** |
|||
* 用户对象 sys_user |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("sys_user") |
|||
public class SysUser extends BaseEntity { |
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
@TableId(value = "user_id") |
|||
private Long userId; |
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
@TableField(exist = false) |
|||
@UpdateValueLog(fieldName = "所属部门") |
|||
private String deptName; |
|||
/** |
|||
* 用户账号 |
|||
*/ |
|||
@Xss(message = "用户账号不能包含脚本字符") |
|||
@NotBlank(message = "用户账号不能为空") |
|||
@Size(min = 0, max = 30, message = "用户账号长度不能超过{max}个字符") |
|||
private String userName; |
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
@Xss(message = "用户昵称不能包含脚本字符") |
|||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "用户昵称") |
|||
private String nickName; |
|||
/** |
|||
* 用户类型(sys_user系统用户) |
|||
*/ |
|||
private String userType; |
|||
/** |
|||
* 用户邮箱 |
|||
*/ |
|||
// @Sensitive(strategy = SensitiveStrategy.EMAIL) |
|||
@Email(message = "邮箱格式不正确") |
|||
@Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符") |
|||
@UpdateValueLog(fieldName = "邮箱") |
|||
private String email; |
|||
/** |
|||
* 手机号码 |
|||
*/ |
|||
// @Sensitive(strategy = SensitiveStrategy.PHONE) |
|||
@UpdateValueLog(fieldName = "手机号码") |
|||
private String phonenumber; |
|||
/** |
|||
* 用户性别 |
|||
*/ |
|||
@UpdateValueLog(fieldName = "用户性别") |
|||
private String sex; |
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
private String avatar; |
|||
|
|||
private String frRole; |
|||
|
|||
/** |
|||
* 密码 |
|||
*/ |
|||
@TableField( |
|||
insertStrategy = FieldStrategy.NOT_EMPTY, |
|||
updateStrategy = FieldStrategy.NOT_EMPTY, |
|||
whereStrategy = FieldStrategy.NOT_EMPTY |
|||
) |
|||
private String password; |
|||
|
|||
@JsonIgnore |
|||
@JsonProperty |
|||
public String getPassword() { |
|||
return password; |
|||
} |
|||
/** |
|||
* 帐号状态(0正常 1停用) |
|||
*/ |
|||
@UpdateValueLog(fieldName = "状态") |
|||
private String status; |
|||
/** |
|||
* 删除标志(0代表存在 2代表删除) |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
/** |
|||
* 最后登录IP |
|||
*/ |
|||
private String loginIp; |
|||
/** |
|||
* 最后登录时间 |
|||
*/ |
|||
private Date loginDate; |
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@UpdateValueLog(fieldName = "备注") |
|||
private String remark; |
|||
/** |
|||
* 部门对象 |
|||
*/ |
|||
@TableField(exist = false) |
|||
private SysDept dept; |
|||
/** |
|||
* 角色对象 |
|||
*/ |
|||
@TableField(exist = false) |
|||
private List<SysRole> roles; |
|||
/** |
|||
* 角色组 |
|||
*/ |
|||
@TableField(exist = false) |
|||
private Long[] roleIds; |
|||
|
|||
@TableField(exist = false) |
|||
@UpdateValueLog(fieldName = "角色组") |
|||
private List<String> roleNames; |
|||
/** |
|||
* 岗位组 |
|||
*/ |
|||
@TableField(exist = false) |
|||
// @UpdateValueLog(fieldName = "岗位") |
|||
private Long[] postIds; |
|||
/** |
|||
* 数据权限 当前角色ID |
|||
*/ |
|||
@TableField(exist = false) |
|||
private Long roleId; |
|||
|
|||
public SysUser(Long userId) { |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public boolean isAdmin() { |
|||
return UserConstants.ADMIN_ID.equals(this.userId); |
|||
} |
|||
|
|||
@UpdateValueLog(fieldName = "备注") |
|||
private String idCardNo; |
|||
|
|||
|
|||
} |
@ -0,0 +1,39 @@ |
|||
package com.inscloudtech.common.core.domain.event; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 登录事件 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
public class LogininforEvent implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 用户账号 |
|||
*/ |
|||
private String username; |
|||
/** |
|||
* 登录状态 0成功 1失败 |
|||
*/ |
|||
private String status; |
|||
/** |
|||
* 提示消息 |
|||
*/ |
|||
private String message; |
|||
/** |
|||
* 请求体 |
|||
*/ |
|||
private HttpServletRequest request; |
|||
/** |
|||
* 其他参数 |
|||
*/ |
|||
private Object[] args; |
|||
|
|||
} |
@ -0,0 +1,100 @@ |
|||
package com.inscloudtech.common.core.domain.event; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 操作日志事件 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
public class OperLogEvent implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 日志主键 |
|||
*/ |
|||
private Long operId; |
|||
/** |
|||
* 操作模块 |
|||
*/ |
|||
private String title; |
|||
/** |
|||
* 业务类型(0其它 1新增 2修改 3删除) |
|||
*/ |
|||
private Integer businessType; |
|||
/** |
|||
* 业务类型数组 |
|||
*/ |
|||
private Integer[] businessTypes; |
|||
/** |
|||
* 请求方法 |
|||
*/ |
|||
private String method; |
|||
/** |
|||
* 请求方式 |
|||
*/ |
|||
private String requestMethod; |
|||
/** |
|||
* 操作类别(0其它 1后台用户 2手机端用户) |
|||
*/ |
|||
private Integer operatorType; |
|||
/** |
|||
* 操作人员 |
|||
*/ |
|||
private String operName; |
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
private String deptName; |
|||
/** |
|||
* 请求url |
|||
*/ |
|||
private String operUrl; |
|||
/** |
|||
* 操作地址 |
|||
*/ |
|||
private String operIp; |
|||
/** |
|||
* 操作地点 |
|||
*/ |
|||
private String operLocation; |
|||
/** |
|||
* 请求参数 |
|||
*/ |
|||
private String operParam; |
|||
/** |
|||
* 返回参数 |
|||
*/ |
|||
private String jsonResult; |
|||
/** |
|||
* 操作状态(0正常 1异常) |
|||
*/ |
|||
private Integer status; |
|||
/** |
|||
* 错误消息 |
|||
*/ |
|||
private String errorMsg; |
|||
/** |
|||
* 操作时间 |
|||
*/ |
|||
private Date operTime; |
|||
/** |
|||
* 更新前值 |
|||
*/ |
|||
private String beforeValue; |
|||
|
|||
/** |
|||
* 更新新后 |
|||
*/ |
|||
private String afterValue; |
|||
|
|||
/** |
|||
* 更新新后 |
|||
*/ |
|||
private Long businessId; |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.inscloudtech.common.core.domain.model; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.Email; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 短信登录对象 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
public class EmailLoginBody { |
|||
/** |
|||
* 邮箱 |
|||
*/ |
|||
@NotBlank(message = "{user.email.not.blank}") |
|||
@Email(message = "{user.email.not.valid}") |
|||
private String email; |
|||
/** |
|||
* 邮箱code |
|||
*/ |
|||
@NotBlank(message = "{email.code.not.blank}") |
|||
private String emailCode; |
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.inscloudtech.common.core.domain.model; |
|||
|
|||
import com.inscloudtech.common.constant.UserConstants; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 用户登录对象 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
public class LoginBody { |
|||
/** |
|||
* 用户名 |
|||
*/ |
|||
@NotBlank(message = "{user.username.not.blank}") |
|||
@Length(min = UserConstants.USERNAME_MIN_LENGTH, max = UserConstants.USERNAME_MAX_LENGTH, message = "{user.username.length.valid}") |
|||
private String username; |
|||
/** |
|||
* 用户密码 |
|||
*/ |
|||
// @NotBlank(message = "{user.password.not.blank}") |
|||
// @Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}") |
|||
private String password; |
|||
/** |
|||
* 验证码 |
|||
*/ |
|||
private String code; |
|||
/** |
|||
* 唯一标识 |
|||
*/ |
|||
private String uuid; |
|||
|
|||
private String role; |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,109 @@ |
|||
package com.inscloudtech.common.core.domain.model; |
|||
|
|||
import com.inscloudtech.common.core.domain.dto.RoleDTO; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import java.util.Set; |
|||
|
|||
/** |
|||
* 登录用户身份权限 |
|||
* |
|||
* @author inscloudtech |
|||
*/ |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
public class LoginUser implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private Long userId; |
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptCode; |
|||
|
|||
/** |
|||
* 部门名 |
|||
*/ |
|||
private String deptName; |
|||
/** |
|||
* 用户唯一标识 |
|||
*/ |
|||
private String token; |
|||
/** |
|||
* 用户类型 |
|||
*/ |
|||
private String userType; |
|||
/** |
|||
* 登录时间 |
|||
*/ |
|||
private Long loginTime; |
|||
/** |
|||
* 过期时间 |
|||
*/ |
|||
private Long expireTime; |
|||
/** |
|||
* 登录IP地址 |
|||
*/ |
|||
private String ipaddr; |
|||
/** |
|||
* 登录地点 |
|||
*/ |
|||
private String loginLocation; |
|||
/** |
|||
* 浏览器类型 |
|||
*/ |
|||
private String browser; |
|||
/** |
|||
* 操作系统 |
|||
*/ |
|||
private String os; |
|||
/** |
|||
* 菜单权限 |
|||
*/ |
|||
private Set<String> menuPermission; |
|||
/** |
|||
* 角色权限 |
|||
*/ |
|||
private Set<String> rolePermission; |
|||
/** |
|||
* 用户名 |
|||
*/ |
|||
private String username; |
|||
/** |
|||
* 角色对象 |
|||
*/ |
|||
private List<RoleDTO> roles; |
|||
/** |
|||
* 数据权限 当前角色ID |
|||
*/ |
|||
private Long roleId; |
|||
/** |
|||
* 获取登录id |
|||
*/ |
|||
public String getLoginId() { |
|||
if (userType == null) { |
|||
throw new IllegalArgumentException("用户类型不能为空"); |
|||
} |
|||
if (userId == null) { |
|||
throw new IllegalArgumentException("用户ID不能为空"); |
|||
} |
|||
return userType + ":" + userId; |
|||
} |
|||
/** |
|||
* nickname |
|||
*/ |
|||
private String nickname; |
|||
|
|||
} |
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue