commit c32ef2b7e8c4e8ce30adbb165d66858bed5b31cf Author: wxc <191104855@qq.com> Date: Mon Dec 1 14:48:38 2025 +0800 20251201 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..d205c3a --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# 长沙公安政投资审计 +## 技术栈 +- JDK17 +- SpringBoot 3 +- MySQL \ No newline at end of file diff --git a/connect.md b/connect.md new file mode 100644 index 0000000..b76c399 --- /dev/null +++ b/connect.md @@ -0,0 +1,179 @@ +# 项目交接文档 + +## 1. 项目概述 + +- **项目名称**:InvestBoot 政府投资报审系统 +- **项目描述**:政府投资项目报审管理系统,提供项目审批、预警管理、价格信息管理等功能 +- **项目组**:com.biutag.supervision + +## 2. 技术栈 + +### 2.1 核心框架 +- Spring Boot 3.3.2 +- MyBatis Plus 3.5.7 +- Dynamic Datasource 4.3.1(多数据源) +- Redis Reactive + +### 2.2 数据库 +- MySQL(主要数据库) +- PostgreSQL(邮箱相关) +- 支持多种数据库:达梦(DM)、SQL Server、GBase + +### 2.3 文件存储 +- FastDFS 分布式文件系统 + +### 2.4 API文档 +- Knife4j OpenAPI3(基于Swagger) + +### 2.5 工具类 +- Hutool 5.8.29 +- EasyExcel 4.0.1 +- Fastjson 2.0.53 +- Aspose.Words 15.8.0(Word文档处理) + +### 2.6 其他组件 +- Lombok +- Druid 连接池 +- Freemarker 模板引擎 +- Logstash 日志编码 +- JIT AuthSDK 3.0.3(数字证书) + +## 3. 环境配置 + +### 3.1 开发环境 +- JDK 17 +- Maven 3.6+ +- IDE:推荐 IntelliJ IDEA + +### 3.2 配置文件 +- 主配置文件:`application.yml` +- 环境配置文件: + - `application-local.yml`(本地开发环境) + - `application-dev.yml`(开发环境) + - `application-prod.yml`(生产环境) + +### 3.3 数据库配置 +- 主数据源(master):MySQL +- 从数据源(多个):用于不同业务模块 +- Redis:缓存,端口6379 + +### 3.4 文件服务配置 +- FastDFS:分布式文件存储 +- 预览URL配置:`http://172.31.217.20:31664` + +## 4. 项目结构 + +``` +src/main/java/com/biutag/supervision/ +├── InvestBootApplication.java # 应用启动类 +├── common/ # 通用类 +├── config/ # 配置类 +├── constants/ # 常量定义 +├── controller/ # 控制器层 +├── exception/ # 异常处理 +├── flow/ # 流程相关 +├── job/ # 定时任务 +├── mapper/ # 数据访问层 +├── pojo/ # 数据模型 +│ ├── domain/ # 领域模型 +│ ├── dto/ # 数据传输对象 +│ ├── entity/ # 实体类 +│ ├── enums/ # 枚举类 +│ ├── model/ # 模型类 +│ ├── param/ # 参数类 +│ └── vo/ # 视图对象 +├── service/ # 业务逻辑层 +├── support/ # 支持类 +└── util/ # 工具类 +``` + +## 5. 核心功能模块 + +### 5.1 认证与授权 +- 登录认证:`LoginController` +- 用户角色权限管理:基于RBAC模型 +- Token管理:Redis存储,有效期168小时 + +### 5.2 文件管理 +- 文件上传下载:`FileController` +- 文件分类管理:`FileClassService` +- 文件存储:FastDFS分布式存储 + +### 5.3 项目预警管理 +- 预警信息处理 +- 预警相关接口:`controller/warning/` + +### 5.4 价格信息库管理 +- 价格信息录入与查询 +- 相关接口:`controller/price/` + +### 5.5 项目报审、报表管理 +- 相关接口:`controller/report/ReportProjectController.java` + +### 5.6 工作流管理 +- 相关接口:`controller/report/ReportFlowController.java` + +### 5.7 服务单位管理 +- 服务单位信息维护 +- 相关接口:`controller/serviceUnit/` + +## 6. API文档 + +### 6.1 访问地址 + + +### 6.2 接口分组 +- plugin:插件相关接口 +- 各功能模块独立接口组 + +## 7. 关键配置项 + +### 7.1 服务器配置 +- 端口:8080 +- 时区:Asia/Shanghai + +### 7.2 文件上传配置 +- 最大文件大小:100MB +- 最大请求大小:100MB + +### 7.3 缓存配置 +- Redis数据库索引:1 +- 连接超时:10s + +### 7.4 FastDFS配置 +- Tracker列表:172.31.217.20:32060, 172.31.217.20:31882 +- 连接超时:10000ms + +## 8. 部署说明 + +### 8.1 打包方式 +- Maven打包:`mvn clean package` +- 最终生成JAR包:`investBoot.jar` + +### 8.2 环境切换 +- 本地:`-Dspring.profiles.active=local` +- 开发:`-Dspring.profiles.active=dev` +- 生产:`-Dspring.profiles.active=prod` + +### 8.3 运行命令 +``` +java -jar investBoot.jar --spring.profiles.active=环境名称 +``` + +## 9. 注意事项 + +### 9.1 数据库配置 +- 首次部署需要执行SQL脚本初始化数据库 +- SQL脚本位置:`sql/`目录 + +### 9.2 外部依赖 +- 需确保Redis服务正常运行 +- 需确保FastDFS服务正常运行 +- 部分证书相关功能依赖JIT AuthSDK + +### 9.3 特殊配置 +- Word文档处理功能依赖Aspose.Words,需注意许可证配置 +- 视频检查相关功能依赖外部服务 + +## 10. 联系人信息 + diff --git a/libs/authSDK/authSDK-3.0.3.jar b/libs/authSDK/authSDK-3.0.3.jar new file mode 100644 index 0000000..21ea0e0 Binary files /dev/null and b/libs/authSDK/authSDK-3.0.3.jar differ diff --git a/libs/authSDK/installMavenJar.bat b/libs/authSDK/installMavenJar.bat new file mode 100644 index 0000000..303ecfc --- /dev/null +++ b/libs/authSDK/installMavenJar.bat @@ -0,0 +1 @@ +mvn install:install-file -DgroupId=cn.com.jit -DartifactId=authSDK -Dversion=3.0.3 -Dfile="authSDK-3.0.3.jar" -Dpackaging=jar \ No newline at end of file diff --git a/libs/words/installMavenJar.bat b/libs/words/installMavenJar.bat new file mode 100644 index 0000000..c8c3b53 --- /dev/null +++ b/libs/words/installMavenJar.bat @@ -0,0 +1 @@ +mvn install:install-file -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=15.8.0 -Dfile="words-15.8.0.jar" -Dpackaging=jar \ No newline at end of file diff --git a/libs/words/words-15.8.0.jar b/libs/words/words-15.8.0.jar new file mode 100644 index 0000000..c0e699f Binary files /dev/null and b/libs/words/words-15.8.0.jar differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..4b4784c --- /dev/null +++ b/pom.xml @@ -0,0 +1,299 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.3.2 + + + com.biutag + InvestBoot + 0.0.1-SNAPSHOT + InvestBoot + 政府投资报审 + + + + + + + + + + + + + + + 17 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-validation + + + + org.springframework.boot + spring-boot-starter-data-redis-reactive + + + + + + com.dameng + DmJdbcDriver18 + 8.1.3.140 + + + + + + + + + + + + com.mysql + mysql-connector-j + runtime + + + + + com.microsoft.sqlserver + mssql-jdbc + 12.8.1.jre11 + + + javax.xml.bind + jaxb-api + 2.3.0 + + + com.sun.xml.bind + jaxb-impl + 2.3.0 + + + com.sun.xml.bind + jaxb-core + 2.3.0 + + + javax.activation + activation + 1.1.1 + + + + + com.gbase + gbase-jdbc + system + 8.3.81.53-build55.2.1-bin + ${project.basedir}/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar + + + + + + com.dameng + DmJdbcDriver18 + 8.1.3.140 + + + + + org.postgresql + postgresql + 42.7.4 + + + + com.alibaba + druid-spring-boot-starter + 1.2.22 + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + com.baomidou + mybatis-plus-spring-boot3-starter + 3.5.7 + + + + com.alibaba + easyexcel + 4.0.1 + + + + commons-io + commons-io + 2.17.0 + + + + cn.hutool + hutool-core + 5.8.29 + + + cn.hutool + hutool-http + 5.8.29 + + + + com.baomidou + dynamic-datasource-spring-boot3-starter + 4.3.1 + + + + org.freemarker + freemarker + 2.3.32 + + + + org.springframework.security + spring-security-crypto + + + + com.github.tobato + fastdfs-client + 1.27.2 + + + + + com.github.xiaoymin + knife4j-openapi3-jakarta-spring-boot-starter + 4.1.0 + + + + com.alibaba + fastjson + 2.0.53 + + + + net.logstash.logback + logstash-logback-encoder + 4.9 + + + + + com.aspose + aspose-words + 15.8.0 + + + org.springframework.boot + spring-boot-starter-actuator + + + + + cn.com.jit + authSDK + 3.0.3 + + + commons-httpclient + commons-httpclient + 3.0.1 + + + + + + + + src/main/resources + false + + + + src/main/resources + + application.yml + + true + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + true + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + org.projectlombok + lombok + + + + + + + investBoot + + + + + dev + + + dev + + + + true + + + + prod + + prod + + + + + diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..3a57a36 Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/main/java/com/biutag/supervision/InvestBootApplication.java b/src/main/java/com/biutag/supervision/InvestBootApplication.java new file mode 100644 index 0000000..a578888 --- /dev/null +++ b/src/main/java/com/biutag/supervision/InvestBootApplication.java @@ -0,0 +1,21 @@ +package com.biutag.supervision; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; + +@EnableAsync +@EnableCaching +@EnableScheduling +@SpringBootApplication +@EnableAspectJAutoProxy +public class InvestBootApplication { + + public static void main(String[] args) { + SpringApplication.run(InvestBootApplication.class, args); + } + +} diff --git a/src/main/java/com/biutag/supervision/common/UserContextHolder.java b/src/main/java/com/biutag/supervision/common/UserContextHolder.java new file mode 100644 index 0000000..e24e9f5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/common/UserContextHolder.java @@ -0,0 +1,34 @@ +package com.biutag.supervision.common; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.Header; +import com.biutag.supervision.constants.RedisKeyConstants; +import com.biutag.supervision.exception.AuthException; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.util.SpringUtil; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +public class UserContextHolder { + + public static String getCurrentToken() { + HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + return request.getHeader(Header.AUTHORIZATION.getValue()); + } + + public static UserAuth getCurrentUser() { + String authorization = getCurrentToken(); + if (StrUtil.isBlank(authorization)) { + throw new AuthException(); + } + UserAuth userAuth = (UserAuth) SpringUtil.getBean("redisTemplate", RedisTemplate.class).opsForValue().get(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization)); + return userAuth; + } + + public static String getCurrentUserId() { + return getCurrentUser().getUserId(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/common/validation/AddGroup.java b/src/main/java/com/biutag/supervision/common/validation/AddGroup.java new file mode 100644 index 0000000..3be19b8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/common/validation/AddGroup.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.common.validation; + +/** + * @author wxc + * @date 2024/11/7 + */ +public interface AddGroup { +} diff --git a/src/main/java/com/biutag/supervision/common/validation/EditGroup.java b/src/main/java/com/biutag/supervision/common/validation/EditGroup.java new file mode 100644 index 0000000..c1dc093 --- /dev/null +++ b/src/main/java/com/biutag/supervision/common/validation/EditGroup.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.common.validation; + +/** + * @author wxc + * @date 2024/11/7 + */ +public interface EditGroup { +} diff --git a/src/main/java/com/biutag/supervision/config/CorsConfig.java b/src/main/java/com/biutag/supervision/config/CorsConfig.java new file mode 100644 index 0000000..d5d1d13 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/CorsConfig.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +/** + * @author wxc + * @date 2025/4/12 + */ +@Configuration +public class CorsConfig { + + private CorsConfiguration corsConfig() { + CorsConfiguration corsConfiguration = new CorsConfiguration(); + corsConfiguration.addAllowedOriginPattern("*"); //允许所有域名访问 + corsConfiguration.addAllowedHeader("*"); //允许所有请求头 + corsConfiguration.addAllowedMethod("*"); //允许所有的请求类型 + corsConfiguration.setMaxAge(3600L); + corsConfiguration.setAllowCredentials(true); //允许请求携带验证信息(cookie) + return corsConfiguration; + } + + @Bean + public CorsFilter corsFilter() { + //存储request与跨域配置信息的容器,基于url的映射 + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", corsConfig()); + return new CorsFilter(source); + } +} diff --git a/src/main/java/com/biutag/supervision/config/FastDFSConfig.java b/src/main/java/com/biutag/supervision/config/FastDFSConfig.java new file mode 100644 index 0000000..d3aedd2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/FastDFSConfig.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.config; + +import com.github.tobato.fastdfs.domain.conn.TrackerConnectionManager; +import jakarta.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@ComponentScan("com.github.tobato.fastdfs") +@Configuration +public class FastDFSConfig { + + @Autowired + private TrackerConnectionManager trackerConnectionManager; + + @PostConstruct + public void init() { + trackerConnectionManager.initTracker(); + } +} diff --git a/src/main/java/com/biutag/supervision/config/GlobalExceptionHandler.java b/src/main/java/com/biutag/supervision/config/GlobalExceptionHandler.java new file mode 100644 index 0000000..d83bb84 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/GlobalExceptionHandler.java @@ -0,0 +1,62 @@ +package com.biutag.supervision.config; + +import com.biutag.supervision.exception.AuthException; +import com.biutag.supervision.pojo.Result; +import jakarta.validation.ValidationException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.dao.DataAccessException; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +import java.util.stream.Collectors; + +@Slf4j +@ControllerAdvice +public class GlobalExceptionHandler { + + @ResponseStatus(HttpStatus.OK) + @ExceptionHandler(Exception.class) + @ResponseBody + public Result handleException(Exception e) { + log.error("系统异常: {}", e.getMessage(), e); + return Result.failed(e.getMessage()); + } + + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) + @ExceptionHandler(DataAccessException.class) + @ResponseBody + public Result handleDataAccessException(DataAccessException e) { + log.error("数据库异常: {}", e.getMessage(), e); + return Result.failed(String.format("数据库异常:%s", e.getMessage())); + } + + @ResponseStatus(HttpStatus.UNAUTHORIZED) + @ExceptionHandler(AuthException.class) + @ResponseBody + public Result handleAuthException(AuthException e) { + log.error("未授权", e); + return Result.failed(HttpStatus.UNAUTHORIZED.value(), HttpStatus.UNAUTHORIZED.getReasonPhrase()); + } + + @ResponseStatus(HttpStatus.BAD_REQUEST) + @ExceptionHandler(MethodArgumentNotValidException.class) + @ResponseBody + public Result handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { + String message = e.getBindingResult().getFieldErrors().stream().map(item -> "不能为空".equals(item.getDefaultMessage()) ? item.getField() + "-" + item.getDefaultMessage() : item.getDefaultMessage()).collect(Collectors.joining("; ")); + log.error("参数错误: {}", message, e); + return Result.failed(HttpStatus.BAD_REQUEST.value(), String.format("参数错误:%s", message)); + } + + @ResponseStatus(HttpStatus.BAD_REQUEST) + @ExceptionHandler(ValidationException.class) + @ResponseBody + public Result handleValidationException(ValidationException e) { + log.error("参数错误", e); + return Result.failed(HttpStatus.BAD_REQUEST.value(), e.getMessage()); + } + +} diff --git a/src/main/java/com/biutag/supervision/config/InterceptorConfig.java b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java new file mode 100644 index 0000000..debb910 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java @@ -0,0 +1,92 @@ +package com.biutag.supervision.config; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.Header; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.RedisKeyConstants; +import com.biutag.supervision.exception.AuthException; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.util.SpringUtil; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.util.List; +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +/** + * @author wxc + * @date 2024/1/8 + */ +@Slf4j +@Configuration +public class InterceptorConfig implements WebMvcConfigurer { + + @Value("${token.timeout}") + private Integer tokenTimeout; + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(new DefaultInterceptor()) + .addPathPatterns("/**") + .excludePathPatterns("/api/**") + .excludePathPatterns("/crx/ajhc/**") + // 登录 + .excludePathPatterns("/login", "/jit/**", "/app/login") + .excludePathPatterns("/file/stream/**", "/templates/**") + .excludePathPatterns("/datav/risk/**") + .excludePathPatterns("/score/**") + .excludePathPatterns("/common/**") + .excludePathPatterns("/app/**") + // excel导出 + .excludePathPatterns("/serviceUnit/export","/reportProject/excelConditionVo","/data/petitionComplaint12337/export/result","/err","/sampling/export/samplingPoling", "/negative/books/export/**","/data/petitionComplaint/export/**","/confinement/export","/books/dataThread/export") + .excludePathPatterns(List.of("/doc.html", "/webjars/**", "/favicon.ico", "/v3/api-docs/**")); + registry.addInterceptor(new ApiInterceptor()) + .addPathPatterns("/api/jwdc/**"); + } + + class DefaultInterceptor implements HandlerInterceptor { + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + log.info("请求地址:{}", request.getRequestURI()); + String authorization = request.getHeader(Header.AUTHORIZATION.getValue()); + RedisTemplate redisTemplate = SpringUtil.getBean("redisTemplate", RedisTemplate.class); + try { + if (StrUtil.isBlank(authorization) || Objects.isNull(redisTemplate.opsForValue().get(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization)))) { + throw new AuthException(); + } + } catch (RuntimeException e) { + throw new AuthException(e.getMessage()); + } + // 更新 会话 有效期 + redisTemplate.expire(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization), tokenTimeout, TimeUnit.HOURS); + UserAuth user = UserContextHolder.getCurrentUser(); + log.info("请求用户:{}", user.getNickName()); + return true; + } + + } + + static class ApiInterceptor implements HandlerInterceptor { + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + log.info("请求地址【API】:{}", request.getRequestURI()); + String authorization = request.getHeader("Authorization"); + if (!"565318a8ea367e03904e1c241048dd6c".equals(authorization)) { + throw new AuthException(); + } + return true; + } + } + +} diff --git a/src/main/java/com/biutag/supervision/config/MybatisPlusConfig.java b/src/main/java/com/biutag/supervision/config/MybatisPlusConfig.java new file mode 100644 index 0000000..ef5b671 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/MybatisPlusConfig.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.config; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@MapperScan("com.biutag.supervision.mapper") +public class MybatisPlusConfig { + + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); // 如果配置多个插件, 切记分页最后添加 + // 如果有多数据源可以不配具体类型, 否则都建议配上具体的 DbType + return interceptor; + } + +} diff --git a/src/main/java/com/biutag/supervision/config/RedisCacheConfig.java b/src/main/java/com/biutag/supervision/config/RedisCacheConfig.java new file mode 100644 index 0000000..8ffbf0e --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/RedisCacheConfig.java @@ -0,0 +1,31 @@ +package com.biutag.supervision.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.cache.RedisCacheConfiguration; +import org.springframework.data.redis.cache.RedisCacheManager; +import org.springframework.data.redis.connection.RedisConnectionFactory; + +import java.time.Duration; + +/** + * @Auther: sh + * @Date: 2024/12/13 11:03 + * @Description: 针对首页大屏的缓存 + */ +@Configuration +public class RedisCacheConfig { + + @Bean + public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) { + // 配置统一的缓存过期时间 + RedisCacheConfiguration cacheConfiguration = RedisCacheConfiguration.defaultCacheConfig() + .entryTtl(Duration.ofHours(24)); // + + // 创建一个缓存管理器,使用默认配置,并为所有缓存设置统一的过期时间 + RedisCacheManager res = RedisCacheManager.builder(redisConnectionFactory) + .cacheDefaults(cacheConfiguration) // 设置所有缓存的默认过期时间 + .build(); + return res; + } +} diff --git a/src/main/java/com/biutag/supervision/config/ScheduledConfig.java b/src/main/java/com/biutag/supervision/config/ScheduledConfig.java new file mode 100644 index 0000000..705eef7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/ScheduledConfig.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.TaskScheduler; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; + +/** + * @author wxc + * @date 2024/10/17 + */ +@Configuration +public class ScheduledConfig { + + @Bean + public ScheduledTaskRegistrar scheduledTaskRegistrar(TaskScheduler taskScheduler) { + ScheduledTaskRegistrar scheduledTaskRegistrar = new ScheduledTaskRegistrar(); + scheduledTaskRegistrar.setTaskScheduler(taskScheduler); + return scheduledTaskRegistrar; + } + +} diff --git a/src/main/java/com/biutag/supervision/config/SwaggerConfig.java b/src/main/java/com/biutag/supervision/config/SwaggerConfig.java new file mode 100644 index 0000000..a10a27a --- /dev/null +++ b/src/main/java/com/biutag/supervision/config/SwaggerConfig.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.config; + +import io.swagger.v3.oas.models.ExternalDocumentation; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class SwaggerConfig { + + @Bean + public OpenAPI springShopOpenAPI() { + return new OpenAPI() + .info(new Info().title("长沙公安数字督察一体化平台接口文档") + .contact(new Contact()) + .description("长沙公安数字督察一体化平台接口文档") + .version("v1") + .license(new License().name("长沙市公安局").url(""))) + .externalDocs(new ExternalDocumentation() + .description("接口文档")); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/constants/AppConstants.java b/src/main/java/com/biutag/supervision/constants/AppConstants.java new file mode 100644 index 0000000..a71035e --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/AppConstants.java @@ -0,0 +1,32 @@ +package com.biutag.supervision.constants; + +public class AppConstants { + + public static final Integer TREE_ROOT_ID = 0; + + // 单位 + public static final String DICT_CONTENT_ROOT_PARENT_CODE = "-1"; + + public static final String DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE = "-1"; + + // 管理员类型类型(超级管理员) + public static final String USER_TYPE_SUPER = "super"; + + + // 单位 + public static final String DEPART_ROOT_PID = "0"; + + + // 单位根节点ID(长沙市公安局) + public static final String ROOT_DEPART_ID = "12630"; + + public static final String ROOT_DEPART_NAME = "长沙市公安局"; + + + public static final String SIGN_RETURN_ACTION_NAME = "已退回"; + + public static final String UN_DEL = "0"; + + public static final String DEL = "1"; + +} diff --git a/src/main/java/com/biutag/supervision/constants/RedisKeyConstants.java b/src/main/java/com/biutag/supervision/constants/RedisKeyConstants.java new file mode 100644 index 0000000..c1bfe10 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/RedisKeyConstants.java @@ -0,0 +1,6 @@ +package com.biutag.supervision.constants; + +public class RedisKeyConstants { + + public final static String LOGIN_USERINFO_KEY = "login:userinfo:%s"; +} diff --git a/src/main/java/com/biutag/supervision/constants/WorkDynamicConstants.java b/src/main/java/com/biutag/supervision/constants/WorkDynamicConstants.java new file mode 100644 index 0000000..3af0fd3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/WorkDynamicConstants.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.constants; + +/** + * @Auther: sh + * @Date: 2025/1/14 10:27 + * @Description: 动作动态常量 + */ +public class WorkDynamicConstants { + public static final String DCGZDT = "督察工作动态"; + public static final String SJGZDT = "审计工作动态"; +} + diff --git a/src/main/java/com/biutag/supervision/constants/enums/AccountabilityTargetEnum.java b/src/main/java/com/biutag/supervision/constants/enums/AccountabilityTargetEnum.java new file mode 100644 index 0000000..36a8b74 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/AccountabilityTargetEnum.java @@ -0,0 +1,32 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/11/28 + */ +@AllArgsConstructor +public enum AccountabilityTargetEnum { + + PERSONAL("1", "涉及个人"), + DEPARTMENT("2", "涉及单位"), + PERSONAL_AND_DEPARTMENT("3", "涉及个人及单位"); + + @Getter + private String value; + + @Getter + private String label; + + public static String getLabel(String value) { + for (AccountabilityTargetEnum targetEnum : values()) { + if (targetEnum.getValue().equals(value)) { + return targetEnum.getLabel(); + } + } + return ""; + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ApprovalFlowEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ApprovalFlowEnum.java new file mode 100644 index 0000000..5fcd8cd --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ApprovalFlowEnum.java @@ -0,0 +1,25 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum ApprovalFlowEnum { + + // 二级审批 所队一>二级机构 + SECOND_APPROVAL("2", "二级审批"), + // 三级审批 所队一>二級机构一>市局 + THREE_APPROVAL("3", "三级审批"); + + private String value; + private String label; + public static String getLabel(String value) { + for (ApprovalFlowEnum flowEnum : values()) { + if (flowEnum.getValue().equals(value)) { + return flowEnum.getLabel(); + } + } + return ""; + } +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ApproveStateEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ApproveStateEnum.java new file mode 100644 index 0000000..cfd2a41 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ApproveStateEnum.java @@ -0,0 +1,7 @@ +package com.biutag.supervision.constants.enums; + +public enum ApproveStateEnum { + + approved, + rejected +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/BlameType.java b/src/main/java/com/biutag/supervision/constants/enums/BlameType.java new file mode 100644 index 0000000..a082cc4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/BlameType.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.constants.enums; + +/** + * @author wxc + * @date 2024/11/28 + */ +public enum BlameType { + personal, + department +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java new file mode 100644 index 0000000..c257587 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum BusinessTypeEnum { + + JCJ_110("110接处警", "1", "110"), + JCJ_122("122接处警", "2", "122"), + RJCKFW("人境窗口服务", "3", "RJ"), + CJGFF("车驾管服务", "4", "CJG"), + JJCF("交警执法", "5", "JJ"), + ZFBA("执法办案", "6", "CF"), + ZXGZ("专项工作", "7", "ZX"), + ABWW("安保维稳", "8", "AB"), + JAFK("治安防控", "9", "ZA"), + XZGL("行政管理", "10", "XZ"), + FFJC("服务基层", "11", "FF"), + DWGL("队伍管理", "12", "DW"), + JWBZ("警务保障", "14", "SJ"), + QT("其他", "13", "QT"); + + private String label; + + private String value; + + private String key; + + public static BusinessTypeEnum get(String value) { + for (BusinessTypeEnum businessTypeEnum : values()) { + if (businessTypeEnum.value.equals(value)) { + return businessTypeEnum; + } + } + return null; + } + + public static BusinessTypeEnum getByLabel(String label) { + for (BusinessTypeEnum businessTypeEnum : values()) { + if (businessTypeEnum.label.equals(label)) { + return businessTypeEnum; + } + } + return null; + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java b/src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java new file mode 100644 index 0000000..55ce40a --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/10/29 + */ +@AllArgsConstructor +public enum CaseVerifProblemNatureEnum { + + ZFBA("执法办案"), + FWGL("服务管理"), + JJJG("警纪警规"); + + @Getter + private String laebl; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/CaseVerifSource.java b/src/main/java/com/biutag/supervision/constants/enums/CaseVerifSource.java new file mode 100644 index 0000000..1e7ad83 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/CaseVerifSource.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.constants.enums; + +/** + * @author wxc + * @date 2025/1/8 + */ +public enum CaseVerifSource { + + excel_import, + plugin +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ComfortStatus.java b/src/main/java/com/biutag/supervision/constants/enums/ComfortStatus.java new file mode 100644 index 0000000..c9e0f85 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ComfortStatus.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.constants.enums; + +/** + * @author wxc + * @date 2025/2/11 + */ +public enum ComfortStatus { + + approval, + // 已退回 + returned, + + // 待呈报 + to_be_reported, + completed + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/CountersignState.java b/src/main/java/com/biutag/supervision/constants/enums/CountersignState.java new file mode 100644 index 0000000..33e87de --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/CountersignState.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.constants.enums; + +/** + * @author wxc + * @date 2024/11/26 + */ +public enum CountersignState { + + uncompleted, + completed +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DataUpdateMethodEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DataUpdateMethodEnum.java new file mode 100644 index 0000000..b8795c2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DataUpdateMethodEnum.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.constants.enums; + +public enum DataUpdateMethodEnum { + + // 增量更新 + incremental, + // 覆盖更新 + overwrite +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java new file mode 100644 index 0000000..160743f --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/10/29 + */ +@AllArgsConstructor +@Getter +public enum DepartGroupEnum { + + COUNTY_CITY_BUREAUS(3, "分县市局"), + BUREAU_AFFILIATED(4, "局属单位"); + + private Integer id; + + private String label; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DepartGroupIdEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DepartGroupIdEnum.java new file mode 100644 index 0000000..4e4ca50 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DepartGroupIdEnum.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2025/3/6 + */ +@AllArgsConstructor +public enum DepartGroupIdEnum { + + COUNTY_AND_CITY_BUREAUS("3"); + + @Getter + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java new file mode 100644 index 0000000..10e909a --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum DepartLevelEnum { + + FIRST(0), + SECOND_CATEGORY(1), + SECOND(2), + THREE(3); + + private Integer value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DistributionCycleEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DistributionCycleEnum.java new file mode 100644 index 0000000..2130ac6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DistributionCycleEnum.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.constants.enums; + +/** + * @author wxc + * @date 2024/10/17 + */ +public enum DistributionCycleEnum { + day, + weekly +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DistributionFlowEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DistributionFlowEnum.java new file mode 100644 index 0000000..25f8809 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DistributionFlowEnum.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/10/17 + */ +@AllArgsConstructor +@Getter +public enum DistributionFlowEnum { + + SECOND("2"), + THIRD("3"); + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DistributionMethodEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DistributionMethodEnum.java new file mode 100644 index 0000000..76aa7d5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DistributionMethodEnum.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/10/17 + */ +@AllArgsConstructor +@Getter +public enum DistributionMethodEnum { + + // 问题下发 + NEGATIVE_DISTRIBUTE("1"), + // 数据保存 + DATA_SAVE("2"), + // 预警通知 + WARNING_NOTIFICATION("3"); + + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DistributionStateEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DistributionStateEnum.java new file mode 100644 index 0000000..cd2b2e5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DistributionStateEnum.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/10/17 + */ +@AllArgsConstructor +public enum DistributionStateEnum { + + // 未分发 + UNDISTRIBUTED("0"), + // 已分发 + DISTRIBUTED("1"), + // 已处置 + HANDLED("2"); + + @Getter + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/FlowActionEnum.java b/src/main/java/com/biutag/supervision/constants/enums/FlowActionEnum.java new file mode 100644 index 0000000..f8af85c --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/FlowActionEnum.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public enum FlowActionEnum { + + FIRST_DISTRIBUTE("first_distribute", "已下发"), + SECOND_APPROVE("second_approve", "已审批"), + FIRST_APPROVE("first_approve", "已审批"); + + @Getter + private String key; + + @Getter + private String name; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java new file mode 100644 index 0000000..17ef861 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java @@ -0,0 +1,42 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.List; + +@AllArgsConstructor +@Getter +public enum FlowNodeEnum { + + FIRST_DISTRIBUTE("first_distribute"), + SECOND_SIGN("second_sign"), + SECOND_DISTRIBUTE("second_distribute"), + THREE_SIGN("three_sign"), + VERIFY("verify"), + SECOND_APPROVE("second_approve"), + FIRST_APPROVE("first_approve"), + SECOND_EXTENSION_APPROVE("second_extension_approve"), + FIRST_EXTENSION_APPROVE("first_extension_approve"), + COUNTERSIGN("countersign"), + COMPLETED("completed"); + + private String key; + + public static List getSignFlowKeys() { + return List.of(FIRST_DISTRIBUTE.getKey(), SECOND_SIGN.getKey(), SECOND_DISTRIBUTE.getKey(), THREE_SIGN.getKey()); + } + + public static boolean isSignFlow(String flowKey) { + return getSignFlowKeys().contains(flowKey); + } + + /** + * 办结审批 + * @return + */ + public static List getApproveFlowKeys() { + return List.of(FIRST_DISTRIBUTE.getKey(), SECOND_SIGN.getKey(), SECOND_DISTRIBUTE.getKey(), THREE_SIGN.getKey()); + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/HostLevelEnums.java b/src/main/java/com/biutag/supervision/constants/enums/HostLevelEnums.java new file mode 100644 index 0000000..9503eb4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/HostLevelEnums.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum HostLevelEnums { + + FIRST("1", "市局主办"), + SECOND("2", "二级机构主办"), + THREE("3", "三级机构主办"); + + private String value; + private String label; + public static String getLabel(String value) { + for (HostLevelEnums hostLevelEnums : values()) { + if (hostLevelEnums.getValue().equals(value)) { + return hostLevelEnums.getLabel(); + } + } + return ""; + } +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java b/src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java new file mode 100644 index 0000000..8de6cca --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java @@ -0,0 +1,38 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * + * @author wxc + * @date 2024/10/22 + */ +@Getter +@AllArgsConstructor +public enum InitialPetition { + + THE_FIRST("1", "初访"), + + REPEAT("2", "重访"); + + private String value; + + public String label; + + public static String getValue(String str) { + if ("初".equals(str)) { + return THE_FIRST.getValue(); + } + if ("重".equals(str)) { + return REPEAT.getValue(); + } + for (InitialPetition value : values()) { + if (value.getLabel().equals(str)) { + return value.getValue(); + } + } + return null; + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java b/src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java new file mode 100644 index 0000000..669f723 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.constants.enums; + +import cn.hutool.core.util.StrUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum InspectCaseEnum { + + // 属实 + TRUE("1", "属实"), + // 部分属实 + PARTIALLY_TRUE("2", "部分属实"), + // 不属实 + FALSE("3", "不属实"); + + private String value; + + private String label; + + public static boolean isItTure(String value) { + return TRUE.getValue().equals(value) || PARTIALLY_TRUE.getValue().equals(value); + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/InvolveProblemEnum.java b/src/main/java/com/biutag/supervision/constants/enums/InvolveProblemEnum.java new file mode 100644 index 0000000..26be3b4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/InvolveProblemEnum.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/12/4 + */ +@AllArgsConstructor +public enum InvolveProblemEnum { + // 自动回访不满意 + ZDHFBMY("1", "自动回访不满意"); + + + @Getter + private String value; + + private String laebl; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/IsRectifyEnum.java b/src/main/java/com/biutag/supervision/constants/enums/IsRectifyEnum.java new file mode 100644 index 0000000..1397490 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/IsRectifyEnum.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +// 是否整改 +@AllArgsConstructor +@Getter +public enum IsRectifyEnum { + + NOT("0"), + YES("1"); + + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/MailTrendSourcesEnum.java b/src/main/java/com/biutag/supervision/constants/enums/MailTrendSourcesEnum.java new file mode 100644 index 0000000..3718bbf --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/MailTrendSourcesEnum.java @@ -0,0 +1,25 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum MailTrendSourcesEnum { + ONE(1, 21), + TWO(2, 22), + THREE(3, 23), + FOUR(4, 24); + + private final int code; // 前端传来的code + private final int mappedCode; // 后端需要用到的code + + public static int getMappedCodeByCode(int code) { + for (MailTrendSourcesEnum value : MailTrendSourcesEnum.values()) { + if (value.code == code) { + return value.getMappedCode(); + } + } + throw new IllegalArgumentException("Invalid sourcesCode: " + code); + } +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/MenuEnum.java b/src/main/java/com/biutag/supervision/constants/enums/MenuEnum.java new file mode 100644 index 0000000..acee071 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/MenuEnum.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; + +@AllArgsConstructor +public enum MenuEnum { + + CATALOGUE("M"), + MENU("C"), + BUTTON("A"); + + private String value; + + public String value() { + return value; + } +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ModelDataTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ModelDataTypeEnum.java new file mode 100644 index 0000000..347bd33 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ModelDataTypeEnum.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2025/3/7 + */ +@AllArgsConstructor +public enum ModelDataTypeEnum { + + // 预警问题 + YJWT("1"), + // 提醒通知 + TXTZ("2"); + + @Getter + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ModelHandleDepartTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ModelHandleDepartTypeEnum.java new file mode 100644 index 0000000..6dcdc0b --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ModelHandleDepartTypeEnum.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2025/3/7 + * 办理单位类型 + */ +@AllArgsConstructor +public enum ModelHandleDepartTypeEnum { + + // 涉及单位 + SJDW("1"), + // 指定单位 + ZDDW("2"); + + @Getter + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ModelTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ModelTypeEnum.java new file mode 100644 index 0000000..8b7bcc0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ModelTypeEnum.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/12/12 + */ +@AllArgsConstructor +public enum ModelTypeEnum { + + // 内部监督 + NBJD("1"), + + // 个人极端 + GRJD("2"); + + @Getter + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/NegativeLevelEnum.java b/src/main/java/com/biutag/supervision/constants/enums/NegativeLevelEnum.java new file mode 100644 index 0000000..4b05743 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/NegativeLevelEnum.java @@ -0,0 +1,34 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/11/8 + */ +@Getter +@AllArgsConstructor +public enum NegativeLevelEnum { + + GENERAL_IMPACT("一般影响", "1", 0.0), + SERIOUS_IMPACT("严重影响", "2", 0.2), + + SIGNIFICANT_IMPACT("重大影响", "3", 0.5); + + private String lable; + + private String value; + + private Double score; + + public static Double getScore(String value) { + for (NegativeLevelEnum negativeLevelEnum : values()) { + if (negativeLevelEnum.value.equals(value)) { + return negativeLevelEnum.score; + } + } + return 0.0; + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java b/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java new file mode 100644 index 0000000..995993e --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public enum NegativeTaskCategoryEnum { + + // 批量导入 + BATCH_IMPORT("0"), + + // 导入记录 + IMPORT("1"), + + // 导出记录 + EXPORT("2"); + + @Getter + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskStatusEnum.java b/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskStatusEnum.java new file mode 100644 index 0000000..3102a9d --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskStatusEnum.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public enum NegativeTaskStatusEnum { + SUCCESS("0"), + FAIL("1"), + PADDING("2"); + + @Getter + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/OrderEnum.java b/src/main/java/com/biutag/supervision/constants/enums/OrderEnum.java new file mode 100644 index 0000000..b45e459 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/OrderEnum.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.constants.enums; + +/** + * @author wxc + * @date 2024/11/8 + */ +public enum OrderEnum { + // 正序 + ascending, + // 倒叙 + descending +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java new file mode 100644 index 0000000..6b0b164 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java @@ -0,0 +1,55 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.List; +import java.util.Objects; + +/** + * @author wxc + * @date 2024/11/1 + */ +@Getter +@AllArgsConstructor +public enum PersonTypeEnum { + + police("1", "民警"), + works("2", "职工"), + aux("3", "辅警"), + clerk("4", "文员"), + xj("5", "协警"); + private String value; + private String label; + + public static List getAuxPersonType() { + return List.of(works.getValue(), aux.getValue(), clerk.getValue(), xj.getValue()); + } + + public static PersonTypeEnum get(String value) { + for (PersonTypeEnum personTypeEnum : values()) { + if (personTypeEnum.getValue().equals(value)) { + return personTypeEnum; + } + } + return null; + } + + public static PersonTypeEnum getByLabel(String value) { + for (PersonTypeEnum personTypeEnum : values()) { + if (personTypeEnum.getLabel().equals(value)) { + return personTypeEnum; + } + } + return null; + } + + public static String getLabel(String value) { + PersonTypeEnum personTypeEnum = get(value); + if (Objects.isNull(personTypeEnum)) { + return null; + } + return personTypeEnum.getLabel(); + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/PoliceTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/PoliceTypeEnum.java new file mode 100644 index 0000000..0c4ad6c --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/PoliceTypeEnum.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/12/26 + */ +@AllArgsConstructor +@Getter +public enum PoliceTypeEnum { + + JL("警令", "1"), + ZG("政工", "2"), + JB("警保", "3"), + ZJJC("纪检监察", "4"), + JGDW("机关党委", "5"), + JGJW("机关纪委", "6"), + LDZX("六大中心", "7"), + JX("警校", "8"), + XZ("刑侦", "9"), + ZA("治安", "10"); + + + private String label; + private String value; + + public static PoliceTypeEnum getByLabel(String label) { + for (PoliceTypeEnum problemSourcesEnum : values()) { + if (problemSourcesEnum.label.equals(label)) { + return problemSourcesEnum; + } + } + return null; + } +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java new file mode 100644 index 0000000..4c0598f --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java @@ -0,0 +1,59 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum ProblemSourcesEnum { + + XCDC("现场督察", "13"), + LMGZ("灵敏感知", "14"), + ZXDC("专项督察", "15"), + SPDC("视频督察", "16"), + + A12389("12389", "17"), + SLDJB("市局领导交办", "18"), + ZDDJB("支队领导交办", "19"), + SJJB("上级交办", "20"), + + GJXFPT("国家信访平台", "21"), + GABXF("公安部信访", "22"), + JZXX("局长信箱", "23"), + XF12337("12337信访", "24"), + XF_QT("信访投诉/其他", "25"), + + SJJD("审计监督", "26"), + ZFTZSJ("政府投资审计", "27"), + ZFSACFSS("执法活动财物审计", "28"), + JJZRSJ("经济责任审计", "29"), + ZXSJ("专项审计", "30"), + + JWDC("民意感知", "2"), + JYDC("警意调查", "3"), + CFJD("持法监督", "4"), + JCKH("检查考核", "8"), + QT("其他", "9"); + + private String label; + + private String value; + + public static ProblemSourcesEnum get(String value) { + for (ProblemSourcesEnum problemSourcesEnum : values()) { + if (problemSourcesEnum.value.equals(value)) { + return problemSourcesEnum; + } + } + return null; + } + + public static ProblemSourcesEnum getByLabel(String label) { + for (ProblemSourcesEnum problemSourcesEnum : values()) { + if (problemSourcesEnum.label.equals(label)) { + return problemSourcesEnum; + } + } + return null; + } +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ProcessingStatusEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ProcessingStatusEnum.java new file mode 100644 index 0000000..617753f --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ProcessingStatusEnum.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +public enum ProcessingStatusEnum { + + signing("签收中"), + processing("办理中"), + approval("审批中"), + completed("已办结"); + + @Getter + private String label; + + public static String getLabel(String name) { + for (ProcessingStatusEnum value : values()) { + if (value.name().equals(name)) { + return value.getLabel(); + } + } + return null; + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/RepeatEnum.java b/src/main/java/com/biutag/supervision/constants/enums/RepeatEnum.java new file mode 100644 index 0000000..138f893 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/RepeatEnum.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.constants.enums; + + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum RepeatEnum { + + FIRST_MAIL(1, "初访信件"), + REPEAT_MAIL(2, "重访信件"); + + + + + private Integer id; + + private String label; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ReplyStateEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ReplyStateEnum.java new file mode 100644 index 0000000..9ed9621 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ReplyStateEnum.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/12/7 + */ +@AllArgsConstructor +public enum ReplyStateEnum { + + UN_REPLIED("0"), + REPLIED("1"); + + @Getter + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/RoleCodeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/RoleCodeEnum.java new file mode 100644 index 0000000..a75a2d9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/RoleCodeEnum.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum RoleCodeEnum { + + ADMIN("admin"), + FIRST_ADMIN("admin_1"), + SECOND_ADMIN("admin_1_1_1_2"), + THREE_ADMIN("admin_1_1_1_3"); + + private String code; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/RpcApplyTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/RpcApplyTypeEnum.java new file mode 100644 index 0000000..91761c5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/RpcApplyTypeEnum.java @@ -0,0 +1,25 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2025/2/7 + */ +@AllArgsConstructor +public enum RpcApplyTypeEnum { + + // 维权 + RIGHTS_PROTECTION("1"), + + // 抚慰 + COMFORT("2"), + + // 容错 + FAULT_TOLERANT("3"); + + + @Getter + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/SpecialSupervisionEnum.java b/src/main/java/com/biutag/supervision/constants/enums/SpecialSupervisionEnum.java new file mode 100644 index 0000000..cc55287 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/SpecialSupervisionEnum.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/12/24 + */ +@Getter +@AllArgsConstructor +public enum SpecialSupervisionEnum { + + // 黄赌警情 + HDJQ("1"); + + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/StatusEnum.java b/src/main/java/com/biutag/supervision/constants/enums/StatusEnum.java new file mode 100644 index 0000000..a3a847e --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/StatusEnum.java @@ -0,0 +1,15 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum StatusEnum { + + ENABLE("1"), + DISABLE("0"); + + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/TaskStatusEnum.java b/src/main/java/com/biutag/supervision/constants/enums/TaskStatusEnum.java new file mode 100644 index 0000000..d833eff --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/TaskStatusEnum.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.constants.enums; + +/** + * @author wxc + * @date 2025/4/7 + */ +public enum TaskStatusEnum { + todo, + done +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/TaskTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/TaskTypeEnum.java new file mode 100644 index 0000000..ce5e0c7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/TaskTypeEnum.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.constants.enums; + +/** + * @author wxc + * @date 2025/4/7 + */ +public enum TaskTypeEnum { + + // 测酒 + testing_alcohol, + + // 督察任务 + inspection, + + // 自查任务 + selfexamination, + + risk_personal, + + // 问题随拍 + problem_shooting + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/TestingAlcoholStateEnum.java b/src/main/java/com/biutag/supervision/constants/enums/TestingAlcoholStateEnum.java new file mode 100644 index 0000000..acbd329 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/TestingAlcoholStateEnum.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.constants.enums; + +/** + * 测酒状态 + * @author wxc + * @date 2025/4/7 + */ +public enum TestingAlcoholStateEnum { + + // 未饮酒 + not_drinking, + + // 已饮酒 + drink + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java b/src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java new file mode 100644 index 0000000..89b22e8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java @@ -0,0 +1,47 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +// 办理时限 +@Getter +@AllArgsConstructor +public enum TimeLimitEnum { + + WORK_137("137工作制", "3+7", 1, 3, 7), + WORK_177("177工作制", "7+7", 1, 7, 7), + WORK_15_15("15+15工作制", "15+15", 1, 15, 15), + WORK_30_30("30+30工作制", "30+30", 1, 30, 30), + OTHER("其他", "other", null, null, null); + + private String label; + + private String value; + + // 签收时长(天) + private Integer maxSignDuration; + + // 办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + public static TimeLimitEnum get(String value) { + for (TimeLimitEnum timeLimitEnum : values()) { + if (timeLimitEnum.getValue().equals(value)) { + return timeLimitEnum; + } + } + throw new RuntimeException(String.format("办理时限字典[%s]未找到", value)); + } + + public static String getLabel(String value) { + try { + return get(value).getLabel(); + } catch (RuntimeException e) { + return ""; + } + } + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/TrendEnum.java b/src/main/java/com/biutag/supervision/constants/enums/TrendEnum.java new file mode 100644 index 0000000..a45a3a4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/TrendEnum.java @@ -0,0 +1,29 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.Getter; + +/** + * @Auther: sh + * @Date: 2024/11/16 19:34 + * @Description: + */ +@Getter +@AllArgsConstructor +public enum TrendEnum { + + + DAY("日趋势", "1"), + WEEK("周趋势", "2"), + + Month("月趋势", "3"); + + + private String label; + + private String value; + + +} + diff --git a/src/main/java/com/biutag/supervision/constants/enums/WorkStateEnum.java b/src/main/java/com/biutag/supervision/constants/enums/WorkStateEnum.java new file mode 100644 index 0000000..1355805 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/WorkStateEnum.java @@ -0,0 +1,7 @@ +package com.biutag.supervision.constants.enums; + +public enum WorkStateEnum { + + todo, + done +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/WorkStatusEnum.java b/src/main/java/com/biutag/supervision/constants/enums/WorkStatusEnum.java new file mode 100644 index 0000000..d5a6d53 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/WorkStatusEnum.java @@ -0,0 +1,7 @@ +package com.biutag.supervision.constants.enums; + +public enum WorkStatusEnum { + + todo, + done +} diff --git a/src/main/java/com/biutag/supervision/controller/AppController.java b/src/main/java/com/biutag/supervision/controller/AppController.java new file mode 100644 index 0000000..a068d7b --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/AppController.java @@ -0,0 +1,73 @@ +package com.biutag.supervision.controller; + +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.Method; +import io.swagger.v3.oas.annotations.Operation; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.util.Objects; + +/** + * @author wxc + * @date 2025/4/18 + */ +@Slf4j +@RequestMapping("app") +@Controller +public class AppController { + + @Operation(summary = "数据入口") + @ResponseBody + @PostMapping("forward") + public String forward(@RequestBody Request request) { + log.info("APP 请求地址:{} 请求方式:{} 授权码:{}", request.getUrl(), request.getMethod(), request.getToken()); +// if (Objects.nonNull(request.getBody())) { +// log.info("APP 请求参数:{}", request.getBody()); +// } + HttpResponse httpResponse = HttpRequest.of(String.format("http://127.0.0.1:8080" + request.getUrl())) + .method(getMethod(request.getMethod())) + .auth(request.getToken()) + .body(request.body) + .execute(); + return httpResponse.body(); + } + + @Operation(summary = "文件预览") + @GetMapping("file/stream/forward") + public String fileSteamForward(String filepath) { + log.info("APP 文件预览,文件路径:{}", filepath); + return "forward:/file/stream" + filepath; + } + + public Method getMethod(String method) { + if ("GET".equals(method)) { + return Method.GET; + } + if ("DELETE".equals(method)) { + return Method.DELETE; + } + if ("PUT".equals(method)) { + return Method.PUT; + } + return Method.POST; + } + + @Setter + @Getter + public static class Request { + + private String url; + + private String method; + + private String token; + + private String body; + + } +} diff --git a/src/main/java/com/biutag/supervision/controller/AuthController.java b/src/main/java/com/biutag/supervision/controller/AuthController.java new file mode 100644 index 0000000..0f2020f --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/AuthController.java @@ -0,0 +1,42 @@ +package com.biutag.supervision.controller; + +import cn.hutool.core.util.StrUtil; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.exception.AuthException; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.domain.Self; +import com.biutag.supervision.pojo.entity.Menu; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.vo.MenuTree; +import com.biutag.supervision.service.MenuService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@Slf4j +@RequiredArgsConstructor +@RequestMapping("auth") +@RestController +public class AuthController { + + private final MenuService menuService; + + @GetMapping("self") + public Result self() { + String authorization = UserContextHolder.getCurrentToken(); + if (StrUtil.isBlank(authorization)) { + throw new AuthException(); + } + UserAuth user = UserContextHolder.getCurrentUser(); + boolean superFlag = AppConstants.USER_TYPE_SUPER.equals(user.getUserType()); + List menus = superFlag ? menuService.listAll() : menuService.listMenuByCurrentUser(); + List perms = superFlag ? List.of("*") : menuService.listPermsByCurrentUser(); + return Result.success(new Self().setUser(user).setMenus(MenuTree.buildTree(menus)).setPerms(perms)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/CommonOpinionsControllers.java b/src/main/java/com/biutag/supervision/controller/CommonOpinionsControllers.java new file mode 100644 index 0000000..ca71af6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/CommonOpinionsControllers.java @@ -0,0 +1,54 @@ +package com.biutag.supervision.controller; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.CommonOpinions; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.CommonOpinionsQueryParam; +import com.biutag.supervision.service.CommonOpinionsService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; + +@RequestMapping("commonOpinions") +@RestController +@RequiredArgsConstructor +public class CommonOpinionsControllers { + + private final CommonOpinionsService commonOpinionsService; + + @PostMapping + public Result save(@RequestBody CommonOpinions commonOpinions){ + UserAuth user = UserContextHolder.getCurrentUser(); + + commonOpinions.setCrtUser(user.getNickName()); + commonOpinions.setCrtId(user.getUserName()); + commonOpinions.setCrtTime(LocalDateTime.now()); + commonOpinionsService.save(commonOpinions); + return Result.success(); + } + + @GetMapping + public Result> get(CommonOpinionsQueryParam queryParam){ + UserAuth user = UserContextHolder.getCurrentUser(); + List commonOpinions= commonOpinionsService.list(new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(queryParam.getContent()),CommonOpinions::getContent,queryParam.getContent() + ).eq(CommonOpinions::getCrtId,user.getUserName()).last("limit 100")); + return Result.success(commonOpinions); + } + + + @DeleteMapping + public Result del(@RequestBody CommonOpinions commonOpinions){ + commonOpinionsService.remove(new LambdaQueryWrapper().eq(CommonOpinions::getContent,commonOpinions.getContent())); + return Result.success(); + } + + +} diff --git a/src/main/java/com/biutag/supervision/controller/FileController.java b/src/main/java/com/biutag/supervision/controller/FileController.java new file mode 100644 index 0000000..89de957 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/FileController.java @@ -0,0 +1,91 @@ +package com.biutag.supervision.controller; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.StrUtil; +import com.biutag.supervision.mapper.FileBase64Mapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.FileBase64Dto; +import com.biutag.supervision.pojo.entity.FileBase64; +import com.biutag.supervision.pojo.vo.FileVo; +import com.biutag.supervision.service.FileService; +import com.biutag.supervision.util.ImgUtils; +import com.biutag.supervision.util.WordUtil; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Base64; +import java.util.Objects; +import java.util.Optional; + +@Slf4j +@RequiredArgsConstructor +@RequestMapping("file") +@Controller +public class FileController { + + private final FileService fileService; + + private final FileBase64Mapper fileBase64Mapper; + + @ResponseBody + @PostMapping("upload") + public Result upload(@RequestPart("file") MultipartFile file) throws IOException { + log.info("文件上传 upload------------------------------"); + String filePath = fileService.upload(file); + return Result.success(new FileVo() + .setFileName(file.getOriginalFilename()) + .setFilePath(filePath)); + } + + @ResponseBody + @PostMapping("upload/base64") + public Result upload(@RequestBody FileBase64Dto file) { + log.info("文件BASE64上传 upload------------------------------"); + return Result.success(new FileVo() + .setFileName(file.getOriginalFilename()) + .setFilePath(fileService.uploadBase64(file.getBase64(), file.getOriginalFilename()))); + } + + @GetMapping("stream/**") + public void download(HttpServletRequest request, HttpServletResponse response) throws IOException { + String filePath = request.getRequestURI().substring(12); + if (filePath.toLowerCase().endsWith(".pdf")) { + response.setContentType("application/pdf"); + } else { + response.setContentType("application/octet-stream"); + } + InputStream is = fileService.download(filePath); + if (filePath.toLowerCase().endsWith(".doc")) { + is = WordUtil.convertDocx(is); + } + IoUtil.copy(is, response.getOutputStream()); + } + + @ResponseBody + @GetMapping("base64") + public Result getBase64(String filepath) throws IOException { + if (StrUtil.isBlank(filepath)) { + return Result.success(null); + } + FileBase64 fileBase64 = fileBase64Mapper.selectById(filepath); + if (Objects.nonNull(fileBase64)) { + return Result.success(fileBase64.getBase64()); + } + InputStream is = fileService.download(filepath); + String base64 = Base64.getEncoder().encodeToString(is.readAllBytes()); + if (ImgUtils.isImg(filepath)) { + base64 = String.format("data:image/%s;base64,", FileUtil.extName(filepath).toLowerCase()) + base64; + } + return Result.success(base64); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/LoginController.java b/src/main/java/com/biutag/supervision/controller/LoginController.java new file mode 100644 index 0000000..c0b9586 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/LoginController.java @@ -0,0 +1,102 @@ +package com.biutag.supervision.controller; + +import cn.com.jit.JitAuthClient; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.domain.AppUser; +import com.biutag.supervision.pojo.dto.AccountDto; +import com.biutag.supervision.pojo.entity.BaseAccount; +import com.biutag.supervision.pojo.entity.SupPolice; +import com.biutag.supervision.pojo.vo.TokenVo; +import com.biutag.supervision.service.BaseAccountService; +import com.biutag.supervision.service.SupPoliceService; +import com.biutag.supervision.service.UserLoginService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.crypto.bcrypt.BCrypt; +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; +import java.util.Map; + +@Tag(name = "登录接口") +@Slf4j +@RequiredArgsConstructor +@RestController +public class LoginController { + + private final BaseAccountService accountService; + + private final UserLoginService userLoginService; + + private final SupPoliceService policeService; + + @Operation(summary = "登录") + @PostMapping("login") + public Result login(@RequestBody AccountDto account) { + List baseAccounts = accountService.getByLogin(account.getAccount()); + if (baseAccounts.isEmpty()) { + throw new RuntimeException("用户名或密码有误,请重新输入"); + } + BaseAccount baseAccount = baseAccounts.get(0); + try { + if (!BCrypt.checkpw(account.getPassword(), baseAccount.getPassword())) { + throw new RuntimeException(); + } + } catch (RuntimeException e) { + log.error(e.getMessage(), e); + throw new RuntimeException("用户名或密码有误,请重新输入"); + } + String token = userLoginService.login(baseAccount.getAccount()); + return Result.success(new TokenVo().setToken(token)); + } + + @PostMapping("logout") + public Result logout() { + userLoginService.logout(); + return Result.success(); + } + + @Operation(summary ="生成数字证书随机数") + @GetMapping("jit/random") + public Result random() { + String path = "/app/conf/jitMessage.properties"; + JitAuthClient jitAuthClient = new JitAuthClient(path); + String random = jitAuthClient.random(); + return Result.success(random); + } + + @Operation(summary ="数字证书登录") + @PostMapping("jit/p7certAuth") + public Result p7certAuth(@RequestBody JSONObject body) { + String path = "/app/conf/jitMessage.properties"; + JitAuthClient jitAuthClient = new JitAuthClient(path); + Map responseMap = jitAuthClient.authenP7(body.getString("random"), body.getString("signed_data"), ""); + String responseStr = JSON.toJSONString(responseMap); + log.info("返回的结果:{}", responseStr); + JSONObject response = JSON.parseObject(responseStr); + if (!response.getBoolean("isSuccess")) { + throw new RuntimeException(response.getString("errDesc")); + } + String cerSubject = response.getJSONObject("certAttributeNodeMap").getString("_saml_cert_subject"); + log.info("_saml_cert_subject:{}", cerSubject); + String idCode = cerSubject.split(",")[0].split(" ")[1]; + log.info("身份证:{}", idCode); + String token = userLoginService.login(idCode); + return Result.success(new TokenVo().setToken(token)); + } + + @Operation(summary = "App登录") + @PostMapping("app/login") + public Result appLogin(String empNo) { + SupPolice police = policeService.getByEmpNo(empNo); + return Result.success(userLoginService.loginByApp(police.getIdCode())); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/PoliceAvatarController.java b/src/main/java/com/biutag/supervision/controller/PoliceAvatarController.java new file mode 100644 index 0000000..a9f12d4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/PoliceAvatarController.java @@ -0,0 +1,54 @@ +package com.biutag.supervision.controller; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.mapper.SupPoliceMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupPolice; +import com.biutag.supervision.service.FileService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.util.List; + +/** + * @author wxc + * @date 2024/12/24 + */ +@RequestMapping("policeUpdateAvatar") +@Slf4j +@RequiredArgsConstructor +@RestController +public class PoliceAvatarController { + + private final FileService fileService; + + private final SupPoliceMapper policeMapper; + + @RequestMapping + public Result update() throws FileNotFoundException { + List files = FileUtil.loopFiles("/work/POLICE"); + for (File file : files) { + try { + String img = file.getPath().replace("/work/POLICE", ""); + log.info(img); + String idCode = policeMapper.getIdCodeByPoliceAvatar(img); + if (StrUtil.isBlank(idCode) || !policeMapper.exists(new LambdaUpdateWrapper().eq(SupPolice::getIdCode, idCode))) { + continue; + } + String filePath = fileService.upload(new FileInputStream(file), FileUtil.size(file), FileUtil.extName(file.getName())); + policeMapper.update(new LambdaUpdateWrapper().eq(SupPolice::getIdCode, idCode).set(SupPolice::getAvatarUrl, filePath)); + log.info("{} 更新头像 {}", idCode, file.getName()); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + } + return Result.success(); + } +} diff --git a/src/main/java/com/biutag/supervision/controller/invertRecord/invertRecordController.java b/src/main/java/com/biutag/supervision/controller/invertRecord/invertRecordController.java new file mode 100644 index 0000000..deeb8b6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/invertRecord/invertRecordController.java @@ -0,0 +1,129 @@ +package com.biutag.supervision.controller.invertRecord; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.InformMessage; +import com.biutag.supervision.pojo.entity.InvertRecord; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.warning.WarningRecord; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.InvertRecord.InvertRecordQueryParam; +import com.biutag.supervision.pojo.param.entryWindow.EntryWindowQueryParam; +import com.biutag.supervision.pojo.vo.InvertRecord.InvertRecordVo; +import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; +import com.biutag.supervision.service.InformMessageService; +import com.biutag.supervision.service.InvertRecord.InvertRecordService; +import com.biutag.supervision.service.Report.ReportProjectService; +import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.service.Warning.WarningRecordService; +import com.biutag.supervision.util.BigDecimalUtils; +import lombok.RequiredArgsConstructor; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; + +//预警项目相关接口 +@RequiredArgsConstructor +@RestController +@RequestMapping("/invertRecor") +public class invertRecordController { + + private final InvertRecordService invertRecordService; + + private final ReportProjectService projectService; + + private final WarningRecordService recordService; + + private final InformMessageService informMessageService; + + private final SupDepartService departService; + + + @PostMapping("/page") + public Result> page(@RequestBody InvertRecordQueryParam query){ + UserAuth user = UserContextHolder.getCurrentUser(); + QueryWrapper wrapper=new QueryWrapper<>(); + + + + // 权限 + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { + List orgIds =new ArrayList<>(); +// wrapper.in("r.applicant_id",user.getUserName()); + if(!user.getAuthDepartIds().isEmpty()){ + orgIds = departService.getAllNodeIds(user.getAuthDepartIds()); + wrapper.in("r.project_unit_id", orgIds); + }else{ + orgIds = departService.getAllNodeIds(user.getDepartId()); + wrapper.in("r.project_unit_id", orgIds); + } +// wrapper.in("r.project_unit_id", orgIds); + } + if(StrUtil.isNotBlank(query.getName())){ + wrapper.like(" r.report_name",query.getName()); + } + if(StrUtil.isNotBlank(query.getWarningState())){ + wrapper.eq("i.warning_state",query.getWarningState()); + } + wrapper.orderByDesc("i.crt_time"); + return Result.success(invertRecordService.queryPage(new Page<>(query.getCurrent(),query.getSize()),wrapper)); + } + + + @GetMapping("/getDetail/{id}") + public Result getDetail(@PathVariable("id")String id){ + InvertRecord record = invertRecordService.getById(id); + return Result.success(record); + } + + @Transactional(rollbackFor = Exception.class) + @GetMapping("/upWarningStateById/{id}") + public Result upWarningStateById(@PathVariable("id")String id){ + UserAuth user = UserContextHolder.getCurrentUser(); + InvertRecord record = invertRecordService.getById(id); + LambdaUpdateWrapper updateWrapper=new LambdaUpdateWrapper(); + updateWrapper.eq(InvertRecord::getId,id); + if(record.getWarningState().equals("0")){ + updateWrapper.set(InvertRecord::getWarningState,"1"); + //发送通知 + InvertRecord invertRecord = invertRecordService.getById(id); + //获取项目信息 + ReportProject project = projectService.getById(invertRecord.getReportId()); + //获取预警监督人员 + WarningRecord warningRecord = recordService.getById(invertRecord.getWarningId()); + //格式化当前时间 + LocalDateTime now = LocalDateTime.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + String formattedDateTime = now.format(formatter); + //初始化发送信息 + InformMessage informMessage =new InformMessage(); + informMessage.setNode("审计预警项目反馈"); + String message = String.format("%s 于 %s 提交项目 %s",user.getNickName(),formattedDateTime,project.getReportName()); + informMessage.setMessage(message); + informMessage.setCrtUser(user.getNickName()); + informMessage.setCrtUserId(user.getUserName()); + informMessage.setCrtTime(LocalDateTime.now()); + informMessage.setReportId(record.getReportId()); + informMessage.setRecipient(warningRecord.getWarningSupervision()); + informMessage.setRecipientId(warningRecord.getWarningSupervisionId()); + informMessageService.save(informMessage); + }else{ + updateWrapper.set(InvertRecord::getWarningState,"0"); + } + invertRecordService.update(updateWrapper); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/price/PriceInformationController.java b/src/main/java/com/biutag/supervision/controller/price/PriceInformationController.java new file mode 100644 index 0000000..42ba59c --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/price/PriceInformationController.java @@ -0,0 +1,137 @@ +package com.biutag.supervision.controller.price; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.price.PriceFile; +import com.biutag.supervision.pojo.entity.price.PriceInformation; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.Price.PriceInformationQueryParam; +import com.biutag.supervision.pojo.vo.excel.ExcelPriceInformation; +import com.biutag.supervision.pojo.vo.price.PriceInformationVo; +import com.biutag.supervision.service.FileService; +import com.biutag.supervision.service.Price.PriceFileService; +import com.biutag.supervision.service.Price.PriceInformationService; +import com.biutag.supervision.service.SupDepartService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.net.URLEncoder; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * @author weipeng + */ +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/price") +public class PriceInformationController { + + private final PriceInformationService service; + private final FileService fileService; + private final PriceFileService priceFileService; + private final SupDepartService departService; + + @GetMapping + public Result> getPage(PriceInformationQueryParam queryParam){ + UserAuth user = UserContextHolder.getCurrentUser(); + QueryWrapper queryWrapper=new QueryWrapper<>(); + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { + +// wrapper.in("r.applicant_id",user.getUserName()); + List orgIds = departService.getAllNodeIds(user.getAuthDepartIds()); + queryWrapper.in("pi.create_depart", orgIds); + } + queryWrapper.like(StrUtil.isNotBlank(queryParam.getContent()),"pi.information",queryParam.getContent()); + return Result.success(service.queryPage(new Page<>(queryParam.getCurrent(),queryParam.getSize()),queryWrapper)); + } + + @PostMapping("/upData") + public Result upData(@RequestBody PriceInformation information){ + information.setInformationData(); + if(service.updateById(information)){ + return Result.success(); + }else{ + return Result.failed("操作失败"); + } + } + + @DeleteMapping("/{id}") + public Result delById(@PathVariable("id") String id){ + if(service.removeById(id)){ + return Result.success(); + }else{ + return Result.failed("删除失败"); + } + } + + @Transactional(rollbackFor = Exception.class) + @PostMapping("/import") + public Result> importExcel(@RequestPart("file") MultipartFile file) throws IOException { + log.info("文件导入中------------------------------"); + + UserAuth user = UserContextHolder.getCurrentUser(); + String filePath = fileService.upload(file); + String fileNameType = FileUtil.extName(file.getOriginalFilename()); + PriceFile priceFile =new PriceFile(); + priceFile.setFilePath(filePath); + priceFile.setFileName(file.getOriginalFilename()); + priceFile.setCreTime(LocalDateTime.now()); + priceFile.setCreUser(user.getNickName()); + priceFileService.save(priceFile); + if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) { + throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入"); + } + List list = new ArrayList<>(); + ExcelReader excelReader = EasyExcel.read(file.getInputStream(), PriceInformation.class, new ReadListener() { + @Override + public void invoke(PriceInformation data, AnalysisContext analysisContext) { + data.setFileId(priceFile.getId()); + data.setCreateDepart(user.getDepartId()); + data.setInformationData(); + list.add(data); + } + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + } + }).build(); + ReadSheet sheet = EasyExcel.readSheet(0).headRowNumber(2).build(); + excelReader.read(sheet); + excelReader.close(); + service.saveBatch(list); + return Result.success(list); + } + + @GetMapping("/export") + public void export(PriceInformationQueryParam queryParam, HttpServletResponse response) throws IOException{ + queryParam.setCurrent(1); + queryParam.setSize(100000); + QueryWrapper queryWrapper=new QueryWrapper<>(); + queryWrapper.eq(StrUtil.isNotBlank(queryParam.getContent()),"pi.information",queryParam.getContent()); + Page page = service.queryPage(new Page<>(queryParam.getCurrent(),queryParam.getSize()),queryWrapper); + List list = page.getRecords(); + String headerValue = "attachment; filename=\"" + URLEncoder.encode("价格库信息.xlsx", "UTF-8") + "\""; + response.setHeader("Content-Disposition", headerValue); + response.setContentType("application/octet-stream"); + EasyExcel.write(response.getOutputStream(), ExcelPriceInformation.class).inMemory(Boolean.TRUE).sheet("禁闭台帐").doWrite(list); + } +} diff --git a/src/main/java/com/biutag/supervision/controller/report/ReportFlowController.java b/src/main/java/com/biutag/supervision/controller/report/ReportFlowController.java new file mode 100644 index 0000000..5c9d55f --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/report/ReportFlowController.java @@ -0,0 +1,80 @@ +package com.biutag.supervision.controller.report; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.InformMessage; +import com.biutag.supervision.pojo.param.ApprovalFlowQueryParam; +import com.biutag.supervision.pojo.param.Report.FlowQueryParam; +import com.biutag.supervision.service.InformMessageService; +import com.biutag.supervision.service.Report.ReportFlowService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +@RequiredArgsConstructor +@RestController +@RequestMapping("/reportFlow") +public class ReportFlowController { + + private final ReportFlowService flowService; + + private final InformMessageService messageService; + + /** + *审核 + * */ + @PostMapping("/audit") + public Result audit(@RequestBody FlowQueryParam queryParam){ + if(flowService.upFlowState(queryParam)){ + return Result.success(); + }else { + return Result.failed("操作失败"); + } + } + + /** + * 审核(预警) + * */ + @PostMapping("/auditWarning") + public Result auditWarning(@RequestBody FlowQueryParam queryParam){ + if(flowService.upFlowWarning(queryParam)){ + return Result.success(); + }else{ + return Result.failed("操作失败"); + } + } + + /** + * 审核(通知单位) + * */ + @PostMapping("/auditWarningInform") + public Result auditWarningInform(@RequestBody FlowQueryParam queryParam){ + if(flowService.upFlowWarningInform(queryParam)){ + return Result.success(); + }else{ + return Result.failed("操作失败"); + } + } + + + @PostMapping("/getApprovalFlow") + public Result getApprovalFlow(@RequestBody ApprovalFlowQueryParam param){ + return Result.success(flowService.getFlowDta(param)); + } + /** + * 获取进退窗记录 + * */ + @PostMapping("/getEntryWindowRecord") + public Result getEntryWindowRecord(@RequestBody ApprovalFlowQueryParam param){ + List nodes = new ArrayList<>(); + nodes.add("进窗"); + nodes.add("退窗"); + LambdaQueryWrapper messages = new LambdaQueryWrapper(); + messages.eq(InformMessage::getReportId,param.getId()) + .in(InformMessage::getNode,nodes); + return Result.success(messageService.list(messages)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/report/ReportProjectController.java b/src/main/java/com/biutag/supervision/controller/report/ReportProjectController.java new file mode 100644 index 0000000..3a5244d --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/report/ReportProjectController.java @@ -0,0 +1,480 @@ +package com.biutag.supervision.controller.report; + +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.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.support.ExcelTypeEnum; +import com.alibaba.excel.write.handler.CellWriteHandler; +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.fill.FillConfig; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.FlowNodeEnum; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.mapper.Recessed.RecessedLogMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.InformMessage; +import com.biutag.supervision.pojo.entity.recessed.RecessedLog; +import com.biutag.supervision.pojo.entity.report.ReportFlow; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.report.ReportReview; +import com.biutag.supervision.pojo.enums.FlowEnum; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.Recessed.RecessedParam; +import com.biutag.supervision.pojo.param.Report.ReportProjectQueryParam; +import com.biutag.supervision.pojo.param.entryWindow.EntryWindowQueryParam; +import com.biutag.supervision.pojo.param.statement.StatementQueryParam; +import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; +import com.biutag.supervision.pojo.vo.excel.ExcelControlPriceVo; +import com.biutag.supervision.pojo.vo.report.ReportHomeVo; +import com.biutag.supervision.pojo.vo.report.ReportProjectVo; +import com.biutag.supervision.pojo.vo.statement.ConditionExcelVo; +import com.biutag.supervision.pojo.vo.statement.ConditionVo; +import com.biutag.supervision.service.InformMessageService; +import com.biutag.supervision.service.Report.ReportProjectService; +import com.biutag.supervision.service.Report.ReportReviewService; +import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.util.BigDecimalUtils; +import com.biutag.supervision.util.CustomFontLoader; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServletResponse; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.util.IOUtils; +import org.springframework.core.io.ClassPathResource; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.net.URLEncoder; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; + +/** + * @author weipeng + */ +@RequiredArgsConstructor +@RestController +@Slf4j +@RequestMapping("reportProject") +public class ReportProjectController { + + private final ReportProjectService reportProjectService; + + private final SupDepartService departService; + + + private final RecessedLogMapper recessedLogMapper; + + private final InformMessageService informMessageService; + + @PostMapping("/page") + public Result> page(@RequestBody EntryWindowQueryParam query){ + QueryWrapper wrapper=new QueryWrapper<>(); + wrapper.eq(StrUtil.isNotBlank(query.getReportType()),"p.report_type",query.getReportType()) + .like(StrUtil.isNotBlank(query.getReportName()),"p.report_name",query.getReportName()) + .eq(StrUtil.isNotBlank(query.getProjectType()),"p.project_type",query.getProjectType()) + .eq(StrUtil.isNotBlank(query.getAuditUnitId()),"p.audit_unit_id",query.getAuditUnitId()) + .like(StrUtil.isNotBlank(query.getProjectPrincipal()),"p.project_principal",query.getProjectPrincipal()) + .like(StrUtil.isNotBlank(query.getProjectPhone()),"p.project_phone",query.getProjectPhone()) + .eq(StrUtil.isNotBlank(query.getPurchaseMethod()),"p.purchase_method",query.getPurchaseMethod()) + .like(BigDecimalUtils.isNotZeroAndNull(query.getReportMoney()),"p.report_money",query.getReportMoney()) + .like(BigDecimalUtils.isNotZeroAndNull(query.getProjectApprovalMoney()),"p.project_approval_money",query.getProjectApprovalMoney()) + .eq(StrUtil.isNotBlank(query.getPurchaseType()),"p.purchase_type",query.getPurchaseType()) + .like(BigDecimalUtils.isNotZeroAndNull(query.getContractMount()),"p.contract_mount",query.getContractMount()) + .eq(StrUtil.isNotBlank(query.getServiceUnit()),"p.service_unit",query.getServiceUnit()) + .eq(StrUtil.isNotBlank(query.getApplicantId()),"p.applicant_id",query.getApplicantId()); + //报审日期 + if(CollectionUtil.isNotEmpty(query.getApplicantTime())){ + wrapper.between("p.applicant_time",query.getApplicantTime().get(0),query.getApplicantTime().get(1)); + } + + //立项日期 + if(CollectionUtil.isNotEmpty(query.getProjectApprovalTime())){ + wrapper.between("p.project_approval_time",query.getProjectApprovalTime().get(0),query.getProjectApprovalTime().get(1)); + } + //申报政府采购日期 + if(CollectionUtil.isNotEmpty(query.getApplyGovernmentTime())){ + wrapper.between("p.apply_government_time",query.getApplyGovernmentTime().get(0),query.getApplyGovernmentTime().get(1)); + } + //采购日期 + if(CollectionUtil.isNotEmpty(query.getPurchaseTime())){ + wrapper.between("p.purchase_time",query.getPurchaseTime().get(0),query.getPurchaseTime().get(1)); + } + //合同签订日期 + if(CollectionUtil.isNotEmpty(query.getContractTime())){ + wrapper.between("p.contract_time",query.getContractTime().get(0),query.getContractTime().get(1)); + } + //服务日期 + if(query.getServiceStartTime()!= null & query.getServiceEndTime()!= null){ + wrapper.ge("p.service_start_time",query.getServiceStartTime()); + wrapper.le("p.service_end_time",query.getServiceEndTime()); + } +// wrapper.eq("f.approver_state","start" ); + //是否退窗 + if(StrUtil.isNotBlank(query.getCode()) &&!"all".equals(query.getCode()) ){ + wrapper.eq("p.is_recessed",Integer.parseInt(query.getCode())); + } + + + //获取登陆人信息 + UserAuth user = UserContextHolder.getCurrentUser(); + log.info("user",user); + boolean firstAuth = AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) || user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()); + //非超级管理员 && 非市级管理员 + if( !firstAuth ){ + List orgIds = new ArrayList<>(); + + if(!user.getAuthDepartIds().isEmpty()){ + orgIds = departService.getAllNodeIds(user.getAuthDepartIds()); + wrapper.in("p.project_unit_id", orgIds); + }else{ + orgIds = departService.getAllNodeIds(user.getDepartId()); + wrapper.in("p.project_unit_id", orgIds); + } + } + wrapper.orderByDesc("p.crt_time"); + wrapper.groupBy("p.id"); + return Result.success(reportProjectService.getPage(new Page<>(query.getCurrent(),query.getSize()),wrapper)); + } + + //审计情况表报表 + @PostMapping("/pageConditionVo") + public Result> pageConditionVo(@RequestBody StatementQueryParam queryParam){ + QueryWrapper wrapper=new QueryWrapper<>(); + + wrapper.eq(StrUtil.isNotBlank(queryParam.getNode()),"p.node",queryParam.getNode()) + .like(StrUtil.isNotBlank(queryParam.getReportName()),"p.report_name",queryParam.getReportName()) + .like(StrUtil.isNotBlank(queryParam.getProjectType()),"p.project_type",queryParam.getProjectType()) + .eq(StrUtil.isNotBlank(queryParam.getAuditUnitId()),"p.audit_unit_id",queryParam.getAuditUnitId()) + .eq(StrUtil.isNotBlank(queryParam.getProjectUnitId()),"p.project_unit_id",queryParam.getProjectUnitId()) + .eq(StrUtil.isNotBlank(queryParam.getPurchaseMethod()),"p.purchase_method",queryParam.getPurchaseMethod()) + .like(StrUtil.isNotBlank(queryParam.getReferenceNumber()),"p.reference_number",queryParam.getReferenceNumber()); + if(StrUtil.isNotBlank(queryParam.getReportType()) && !"all".equals(queryParam.getReportType())) { + wrapper.eq("p.report_type",queryParam.getReportType()); + } + if(CollectionUtil.isNotEmpty(queryParam.getArchivingTime())){ + wrapper.between("p.archiving",queryParam.getArchivingTime().get(0),queryParam.getArchivingTime().get(1)); + } + if(CollectionUtil.isNotEmpty(queryParam.getPublicationTime())){ + wrapper.between("p.publication_date",queryParam.getPublicationTime().get(0),queryParam.getPublicationTime().get(1)); + } + if(CollectionUtil.isNotEmpty(queryParam.getApplicantDateTime())){ + wrapper.between("p.applicant_time",queryParam.getApplicantDateTime().get(0),queryParam.getApplicantDateTime().get(1)); + } + if(StrUtil.isNotBlank(queryParam.getCode())){ + if(queryParam.getCode().equals("city")){ + wrapper.le("p.report_money",new BigDecimal(200000)); + }else{ + wrapper.ge("p.report_money",new BigDecimal(200000)); + } + } + + + wrapper.groupBy("p.id"); + return Result.success(reportProjectService.getConditionPage(new Page<>(queryParam.getCurrent(),queryParam.getSize()),wrapper)); + + } + + //审计情况表导出 + @GetMapping("/excelConditionVo") + public void excelConditionVo(StatementQueryParam queryParam, HttpServletResponse response) throws Exception { + + ClassPathResource couponOrderTemplateResource = new ClassPathResource("/excelTemplate/政府投资项目审计情况备案表.xlsx"); + InputStream inputStream =couponOrderTemplateResource.getInputStream(); + ServletOutputStream outputStream = null; + try{ + queryParam.setCurrent(1); + queryParam.setSize(10000); + Result> result = pageConditionVo(queryParam); + if(result.getCode() != 200){ + throw new RuntimeException("数据查询失败"); + } + List list = result.getData().getRecords(); + List dataList = BeanUtil.copyToList(list,ConditionExcelVo.class); + dataList.stream().forEach(s->{ + s.setReductionRate(s.getReductionRate().setScale(2,RoundingMode.HALF_UP)); + s.setNode(FlowEnum.contains(s.getNode())); + }); + + //报审金额(元) + BigDecimal reportMoneySum = dataList.stream().map(ConditionExcelVo::getReportMoney).filter(Objects::nonNull) + .reduce(BigDecimal.ZERO,BigDecimal::add); + //审定金额(元) + BigDecimal archivingMoneySum = dataList.stream().map(ConditionExcelVo::getArchivingMoney).filter(Objects::nonNull) + .reduce(BigDecimal.ZERO,BigDecimal::add); + //审减金额(元) + BigDecimal archivingReduceMoneySum=dataList.stream().map(ConditionExcelVo::getArchivingReduceMoney).filter(Objects::nonNull) + .reduce(BigDecimal.ZERO,BigDecimal::add); + //审减率 + BigDecimal bigDecimal =new BigDecimal("100"); + BigDecimal reductionRateSum = (reportMoneySum.compareTo(BigDecimal.ZERO) != 0 ? + archivingReduceMoneySum.divide(reportMoneySum, 4,RoundingMode.HALF_UP): + BigDecimal.ZERO).multiply(bigDecimal).setScale(2, RoundingMode.HALF_UP) ; + + // + + ConditionExcelVo vo=new ConditionExcelVo(); + vo.setProjectUnit("合计"); + vo.setReportMoney(reportMoneySum); + vo.setArchivingMoney(archivingMoneySum); + vo.setArchivingReduceMoney(archivingReduceMoneySum); + vo.setReductionRate(reductionRateSum); + dataList.add(vo); + + + String headerValue = "attachment; filename=\"" + URLEncoder.encode("政府投资项目审计情况备案表.xlsx", "UTF-8") + "\""; + response.setHeader("Content-Disposition", headerValue); + response.setContentType("application/octet-stream"); + + + EasyExcel.write(response.getOutputStream(), ConditionExcelVo.class).inMemory(Boolean.TRUE).sheet("问题台账").doWrite(dataList); + + }catch (Exception e){ + log.info("e",e.getMessage()); + throw new RuntimeException(e.getMessage()); + }finally { + IOUtils.closeQuietly(outputStream); + IOUtils.closeQuietly(inputStream); + } + +// EasyExcel.write(response.getOutputStream(), ConditionVo.class).inMemory(Boolean.TRUE).sheet("政府投资项目审计情况备案表").doWrite(dataList); + } + + + + + //进窗退窗 + @Transactional(rollbackFor = Exception.class) + @PostMapping("RecessedData") + public Result RecessedData(@RequestBody RecessedParam param){ + UserAuth user = UserContextHolder.getCurrentUser(); + ReportProject project = reportProjectService.getById(param.getId()); + LambdaUpdateWrapper updateWrapper =new LambdaUpdateWrapper() + .set(ReportProject::getIsRecessed,(project.getIsRecessed()==0? 1:0)).eq(ReportProject::getId,param.getId()); + //当前时间 + LocalDateTime now = LocalDateTime.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + String formattedDateTime = now.format(formatter); + + //进窗退窗日志 + RecessedLog recessedLog =new RecessedLog(); + recessedLog.setReportId(param.getId()); + recessedLog.setRecessedTime(LocalDateTime.now()); + recessedLog.setCreateUser(user.getNickName()); + recessedLog.setCreateId(user.getUserName()); + recessedLog.setMessage(project.getIsRecessed()==0?(user.getNickName()+"于"+formattedDateTime+"退窗"+project.getReportName()):(user.getNickName()+"于"+formattedDateTime+"重新进窗"+project.getReportName())); + recessedLogMapper.insert(recessedLog); + //进窗退窗信息 + InformMessage message=new InformMessage(); + message.setReportId(param.getId()); + message.setMessage((project.getIsRecessed()==0?param.getMessage():(project.getReportName()+"执行进窗操作"))); + message.setCrtTime(LocalDateTime.now()); + message.setCrtUser(user.getNickName()); + //接收人 + if(project.getIsRecessed()==0){ + message.setNode("退窗"); + message.setRecipientId(project.getApplicantId()); + message.setRecipient(project.getApplicant()); + }else{ + RecessedLog logData = recessedLogMapper.selectOne( + new LambdaQueryWrapper().eq(RecessedLog::getReportId,param.getId()) + .like(RecessedLog::getMessage,"退窗") + .orderByDesc(RecessedLog::getRecessedTime) + .last("limit 1") + ); + //退窗 + message.setNode("重新进窗"); + message.setRecipientId(logData.getCreateId()); + message.setRecipient(logData.getCreateUser()); + } + informMessageService.save(message); + return Result.success(reportProjectService.update(updateWrapper)); + } + + + /** + * 查看详情 + * */ + @GetMapping + public Result getDetail(ReportProjectQueryParam queryParam){ + return Result.success(reportProjectService.getDetail(queryParam.getId())); + } + + /** + * 获取首页数据 + * */ + @GetMapping("/getHomeVo/{id}") + public Result getHomeVo(@PathVariable("id") String id){ + return Result.success(reportProjectService.getReportHomeVo(id)); + } + + + @DeleteMapping("/{id}") + public Result delDetail(@PathVariable("id")String id){ + reportProjectService.removeById(id); + return Result.success(); + } + + + @GetMapping("/getListByName") + public Result> getList(ReportProjectQueryParam queryParam){ + return Result.success(reportProjectService.getProjectList(queryParam)); + } + /** + * 新增或者修改 + * @param queryParam + * */ + + @PostMapping + public Result save(@RequestBody ReportProjectQueryParam queryParam){ + + return Result.success(reportProjectService.addOrUpdate(queryParam)); + + } + + @DeleteMapping + public Result remove(@RequestBody ReportProjectQueryParam queryParam){ + reportProjectService.delData(queryParam); + return Result.success(); + } + + + public Result getDataByPage(@RequestBody EntryWindowQueryParam query){ + QueryWrapper wrapper=new QueryWrapper<>(); + wrapper.eq(StrUtil.isNotBlank(query.getReportType()),"p.report_type",query.getReportType()) + .like(StrUtil.isNotBlank(query.getReportName()),"p.report_name",query.getReportName()) + .eq(StrUtil.isNotBlank(query.getProjectType()),"p.project_type",query.getProjectType()) + .eq(StrUtil.isNotBlank(query.getAuditUnitId()),"p.audit_unit_id",query.getAuditUnitId()) + .like(StrUtil.isNotBlank(query.getProjectPrincipal()),"p.project_principal",query.getProjectPrincipal()) + .like(StrUtil.isNotBlank(query.getProjectPhone()),"p.project_phone",query.getProjectPhone()) + .eq(StrUtil.isNotBlank(query.getPurchaseMethod()),"p.purchase_method",query.getPurchaseMethod()) + .like(BigDecimalUtils.isNotZeroAndNull(query.getReportMoney()),"p.report_money",query.getReportMoney()) + .like(BigDecimalUtils.isNotZeroAndNull(query.getProjectApprovalMoney()),"p.project_approval_money",query.getProjectApprovalMoney()) + .eq(StrUtil.isNotBlank(query.getPurchaseType()),"p.purchase_type",query.getPurchaseType()) + .like(BigDecimalUtils.isNotZeroAndNull(query.getContractMount()),"p.contract_mount",query.getContractMount()) + .eq(StrUtil.isNotBlank(query.getServiceUnit()),"p.service_unit",query.getServiceUnit()) + .eq(StrUtil.isNotBlank(query.getApplicantId()),"p.applicant_id",query.getApplicantId()); + //报审日期 + if(CollectionUtil.isNotEmpty(query.getApplicantTime())){ + wrapper.between("p.applicant_time",query.getApplicantTime().get(0),query.getApplicantTime().get(1)); + } + + //立项日期 + if(CollectionUtil.isNotEmpty(query.getProjectApprovalTime())){ + wrapper.between("p.project_approval_time",query.getProjectApprovalTime().get(0),query.getProjectApprovalTime().get(1)); + } + //申报政府采购日期 + if(CollectionUtil.isNotEmpty(query.getApplyGovernmentTime())){ + wrapper.between("p.apply_government_time",query.getApplyGovernmentTime().get(0),query.getApplyGovernmentTime().get(1)); + } + //采购日期 + if(CollectionUtil.isNotEmpty(query.getPurchaseTime())){ + wrapper.between("p.purchase_time",query.getPurchaseTime().get(0),query.getPurchaseTime().get(1)); + } + //合同签订日期 + if(CollectionUtil.isNotEmpty(query.getContractTime())){ + wrapper.between("p.contract_time",query.getContractTime().get(0),query.getContractTime().get(1)); + } + //服务日期 + if(query.getServiceStartTime()!= null & query.getServiceEndTime()!= null){ + wrapper.ge("p.service_start_time",query.getServiceStartTime()); + wrapper.le("p.service_end_time",query.getServiceEndTime()); + } +// wrapper.eq("f.approver_state","start" ); + //是否退窗 + if(StrUtil.isNotBlank(query.getCode()) &&!"all".equals(query.getCode()) ){ + wrapper.eq("p.is_recessed",Integer.parseInt(query.getCode())); + } + return Result.success(); + } + + + + //上传定案表 + @PostMapping("/upFinalizationPath") + public Result upFinalizationPath(@RequestBody ReportProjectQueryParam queryParam){ + if(reportProjectService.upFinalizationPath(queryParam)){ + return Result.success(); + }else{ + return Result.failed("上传失败"); + } + } + + + + + @PostMapping("/getExcelContrilPrice") + public void getExcelContrilPriceFun(@RequestBody ReportProjectQueryParam queryParam, HttpServletResponse response) throws UnsupportedEncodingException { + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + + ExcelControlPriceVo priceVo = new ExcelControlPriceVo(); + ReportProjectVo vo = reportProjectService.getDetail(queryParam.getId()); + //非空 + if(ObjectUtil.isNotEmpty(vo)){ + ReportProject project = vo.getProject(); + BeanUtil.copyProperties(project,priceVo); + priceVo.setFirstAuditor(vo.getReview().getFirstAuditor()); + priceVo.setSecondAuditor(vo.getReview().getSecondAuditor()); + priceVo.setThirdlyAuditor(vo.getReview().getThirdlyAuditor()); + } + String filePathName ="控制价定案表"; + if ("结算项目".equals(vo.getProject().getProjectType())){ + filePathName = "结算定案表"; + }else{ + filePathName = "控制价定案表"; + } + + String excelFileName =StrUtil.isNotEmpty(filePathName)? URLEncoder.encode(filePathName, "UTF-8"):URLEncoder.encode("定案表", "UTF-8"); + response.setHeader("Content-disposition", "attachment;filename=" + excelFileName + ".xls"); + ClassPathResource couponOrderTemplateResource = new ClassPathResource("/excelTemplate/"+filePathName+".xls"); + + if(! couponOrderTemplateResource.exists()){ + throw new RuntimeException("模板不存在"); + } + InputStream templateInputStream = null; + ServletOutputStream outputStream = null; + ExcelWriter excelWriter = null; + try{ + outputStream = response.getOutputStream(); + templateInputStream = couponOrderTemplateResource.getInputStream(); + FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); + excelWriter = EasyExcel.write(outputStream).withTemplate(templateInputStream) + .inMemory(true) + .excelType(ExcelTypeEnum.XLS).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("汇总表").build(); + excelWriter.fill(priceVo, fillConfig, writeSheet); + //触发计算公式 + Workbook workbook = excelWriter.writeContext().writeWorkbookHolder().getWorkbook(); + workbook.getCreationHelper().createFormulaEvaluator().evaluateAll(); + + excelWriter.finish(); + }catch (Exception e){ + log.info("e",e.getMessage()); + throw new RuntimeException(e.getMessage()); + }finally { + IOUtils.closeQuietly(outputStream); + IOUtils.closeQuietly(templateInputStream); + } + } + + +} diff --git a/src/main/java/com/biutag/supervision/controller/serviceUnit/ServiceUnitController.java b/src/main/java/com/biutag/supervision/controller/serviceUnit/ServiceUnitController.java new file mode 100644 index 0000000..a4942d4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/serviceUnit/ServiceUnitController.java @@ -0,0 +1,83 @@ +package com.biutag.supervision.controller.serviceUnit; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.price.PriceInformation; +import com.biutag.supervision.pojo.entity.serviceUnit.ServiceUnit; +import com.biutag.supervision.pojo.param.Price.PriceInformationQueryParam; +import com.biutag.supervision.pojo.param.ServiceUnit.ServiceUnitQueryParam; +import com.biutag.supervision.pojo.vo.ServiceUnit.ServiceUnitVo; +import com.biutag.supervision.pojo.vo.excel.ExcelPriceInformation; +import com.biutag.supervision.pojo.vo.excel.ExcelServiceUnit; +import com.biutag.supervision.pojo.vo.price.PriceInformationVo; +import com.biutag.supervision.service.ServiceUnit.ServiceUnitService; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@RestController +@RequiredArgsConstructor +@RequestMapping("serviceUnit") +public class ServiceUnitController { + + private final ServiceUnitService service; + + @GetMapping + public Result> getPage(ServiceUnitQueryParam queryParam){ + return Result.success(service.pageList(queryParam)); + } + + @PostMapping("/insertOrUpdate") + public Result insertOrUpdate(@RequestBody ServiceUnit serviceUnit){ + if(service.addOrUpData(serviceUnit)){ + return Result.success(); + }else{ + return Result.failed("操作失败"); + } + } + + @PostMapping("/delData") + public Result delData(@PathVariable("id")String id){ + if(service.delServiceUnit(id)){ + return Result.success(); + }else { + return Result.failed("操作失败"); + } + } + + @GetMapping("/export") + public void export(ServiceUnitQueryParam queryParam, HttpServletResponse response) throws IOException { + queryParam.setCurrent(1); + queryParam.setSize(100000); + Page page = service.pageListData(queryParam); + List list = page.getRecords(); + log.info("服务单位信息库数据量:"+list.size()); + List excelServiceUnitList = new ArrayList<>(); + + if(CollectionUtil.isNotEmpty(list)){ + list.forEach((s)->{ + ExcelServiceUnit unit=new ExcelServiceUnit(); + BeanUtils.copyProperties( s,unit); + excelServiceUnitList.add(unit); + }); + } + String headerValue = "attachment; filename=\"" + URLEncoder.encode("服务单位信息库.xlsx", "UTF-8") + "\""; + response.setHeader("Content-Disposition", headerValue); + response.setContentType("application/octet-stream"); + EasyExcel.write(response.getOutputStream(), ExcelServiceUnit.class).inMemory(Boolean.TRUE).sheet("服务单位信息库").doWrite(excelServiceUnitList); + } + + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/DepartController.java b/src/main/java/com/biutag/supervision/controller/system/DepartController.java new file mode 100644 index 0000000..b406473 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/DepartController.java @@ -0,0 +1,141 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.NumberUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.DepartGroupIdEnum; +import com.biutag.supervision.constants.enums.DepartLevelEnum; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.param.DepartQueryParam; +import com.biutag.supervision.pojo.param.DepartTreeListParam; +import com.biutag.supervision.pojo.vo.DepartTree; +import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.service.SupPoliceService; +import jakarta.validation.ValidationException; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.List; + +@RequestMapping("depart") +@RequiredArgsConstructor +@RestController +public class DepartController { + + private final SupDepartService departService; + + public final SupPoliceService policeService; + + @GetMapping + public Result> treeList(DepartTreeListParam departTreeListParam) { + return Result.success(departService.buildTreeByParam(departTreeListParam)); + } + + @GetMapping("list") + public Result> list(DepartQueryParam departQueryParam) { + return Result.success(departService.page(departQueryParam)); + } + + @GetMapping("getDepartByIds") + public Result> getDepartByIds(DepartQueryParam departQueryParam){ + return Result.success(departService.list(new LambdaQueryWrapper().in(SupDepart::getId,departQueryParam.getIds()))); + } + + + @PostMapping + public Result add(@RequestBody SupDepart supDepart) { + if (departService.existsByName(supDepart.getName())) { + throw new ValidationException("单位全称已存在"); + } + if (departService.existsByCode(supDepart.getCode())) { + throw new ValidationException("单位编码已存在"); + } + SupDepart parent = departService.getById(supDepart.getPid()); + supDepart.setId(String.valueOf(NumberUtil.nullToZero(departService.getMaxId()) + 1)); + supDepart.setLevel(parent.getLevel() + 1); + supDepart.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + departService.save(supDepart); + String pathTrace = departService.getPathTrace(supDepart); + departService.update(new LambdaUpdateWrapper().eq(SupDepart::getId, supDepart.getId()).set(SupDepart::getPathTrace, pathTrace)); + return Result.success(); + } + + @PutMapping + public Result update(@RequestBody SupDepart supDepart) { + if (departService.exists(new LambdaQueryWrapper().eq(SupDepart::getName, supDepart.getName()).ne(SupDepart::getId, supDepart.getId()))) { + throw new ValidationException("单位全称已存在"); + } + if (departService.exists(new LambdaQueryWrapper().eq(SupDepart::getCode, supDepart.getCode()).ne(SupDepart::getId, supDepart.getId()))) { + throw new ValidationException("单位编码已存在"); + } + SupDepart parent = departService.getById(supDepart.getPid()); + supDepart.setLevel(parent.getLevel() + 1); + supDepart.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + String pathTrace = departService.getPathTrace(supDepart); + supDepart.setPathTrace(pathTrace); + return Result.success(departService.updateById(supDepart)); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + if (policeService.exists(id)) { + throw new RuntimeException("该单位下还有警务人员,请移除后再删除"); + } + List orgIds = departService.getAllNodeIds(id); + return Result.success(departService.removeBatchByIds(orgIds)); + } + + @GetMapping("tree") + public Result> tree() { + return Result.success(departService.buildTreeByAuth()); + } + + @GetMapping("treeAll") + public Result> treeAll() { + return Result.success(departService.buildTreeAll()); + } + + @GetMapping("second") + public Result> seconds() { + List supDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND_CATEGORY.getValue(), DepartLevelEnum.SECOND.getValue())); + return Result.success(departService.buildTreeBySecond(supDeparts)); + } + + @GetMapping("firstHost") + public Result> firstHost() { + return Result.success(departService.buildTreeByFirstHost()); + } + + @GetMapping("{departId}/children") + public Result> children(@PathVariable String departId) { + return Result.success(departService.list(new LambdaQueryWrapper().eq(SupDepart::getPid, departId).orderByAsc(SupDepart::getOrderNo))); + } + + /** + * 获取分县市局 + * @return + */ + @GetMapping("tree/countyAndCityBureaus") + public Result> countyAndCityBureaus() { + List children = departService.list(new LambdaQueryWrapper().eq(SupDepart::getStatisticsGroupId, DepartGroupIdEnum.COUNTY_AND_CITY_BUREAUS.getValue()) + .orderByAsc(SupDepart::getOrderNo)) + .stream().map(item -> { + DepartTree departTree = new DepartTree(); + BeanUtils.copyProperties(item, departTree); + return departTree; + }).toList(); + DepartTree root = new DepartTree(); + root.setShortName(AppConstants.ROOT_DEPART_NAME); + root.setId(AppConstants.ROOT_DEPART_ID); + root.setChildren(children); + return Result.success(List.of(root)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/DepartMapingController.java b/src/main/java/com/biutag/supervision/controller/system/DepartMapingController.java new file mode 100644 index 0000000..098bd06 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/DepartMapingController.java @@ -0,0 +1,85 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.entity.SupExternalDepart; +import com.biutag.supervision.pojo.param.DepartMapingQueryParam; +import com.biutag.supervision.service.SupDepartService; + +import com.biutag.supervision.service.SupExternalDepartService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2024/12/30 + */ +@RequiredArgsConstructor +@RequestMapping("depart/maping") +@RestController +public class DepartMapingController { + + private final SupExternalDepartService externalDepartService; + + private final SupDepartService departService; + + @GetMapping("{source}") + public Result> list(@PathVariable String source, DepartMapingQueryParam queryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper + .eq(SupExternalDepart::getSource, source) + .like(StrUtil.isNotBlank(queryParam.getExternalId()), SupExternalDepart::getExternalId, queryParam.getExternalId()) + .like(StrUtil.isNotBlank(queryParam.getExternalName()), SupExternalDepart::getExternalName, queryParam.getExternalName()) + .eq(StrUtil.isNotBlank(queryParam.getInternalId()), SupExternalDepart::getInternalId, queryParam.getInternalId()) + .isNull("noMaping".equals(queryParam.getActiveMaping()), SupExternalDepart::getInternalId); + Page page = externalDepartService.page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + return Result.success(page); + } + + @PostMapping + public Result add(@RequestBody SupExternalDepart data) { + if (externalDepartService.exists(new LambdaQueryWrapper() + .eq(SupExternalDepart::getSource, data.getSource()).eq(SupExternalDepart::getExternalId, data.getExternalId()))) { + throw new RuntimeException(String.format("%s 单位编码【%s】已存在", data.getSource(), data.getExternalId())); + } + data.setUpdateTime(LocalDateTime.now()); + data.setCreateTime(LocalDateTime.now()); + SupDepart depart = departService.getById(data.getInternalId()); + + data.setInternalName(depart.getName()); + data.setInternalShortName(depart.getShortName()); + data.setPid(depart.getPid()); + data.setLevel(depart.getLevel()); + externalDepartService.save(data); + return Result.success(); + } + + @PutMapping + public Result update(@RequestBody SupExternalDepart data) { + if (externalDepartService.exists(new LambdaQueryWrapper() + .eq(SupExternalDepart::getSource, data.getSource()).eq(SupExternalDepart::getExternalId, data.getExternalId()) + .ne(SupExternalDepart::getId, data.getId()))) { + throw new RuntimeException(String.format("%s 单位编码【%s】已存在", data.getSource(), data.getExternalId())); + } + data.setUpdateTime(LocalDateTime.now()); + SupDepart depart = departService.getById(data.getInternalId()); + data.setInternalName(depart.getName()); + data.setInternalShortName(depart.getShortName()); + data.setPid(depart.getPid()); + data.setLevel(depart.getLevel()); + externalDepartService.updateById(data); + return Result.success(); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable Integer id) { + externalDepartService.removeById(id); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/DictContentController.java b/src/main/java/com/biutag/supervision/controller/system/DictContentController.java new file mode 100644 index 0000000..9f617be --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/DictContentController.java @@ -0,0 +1,52 @@ +package com.biutag.supervision.controller.system; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupDictProblemType; +import com.biutag.supervision.pojo.vo.DictContentTree; +import com.biutag.supervision.service.SupDictProblemTypeService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("dict/content") +@RestController +public class DictContentController { + + private final SupDictProblemTypeService dictContentService; + + @GetMapping("tree") + public Result> list() { + return Result.success(dictContentService.buildTree()); + } + + @PostMapping + public Result add(@RequestBody SupDictProblemType dictContent) { + dictContent.setUpdTime(LocalDateTime.now()); + dictContent.setCrtTime(LocalDateTime.now()); + dictContent.setStatus("0"); + dictContentService.save(dictContent); + dictContentService.update(new LambdaUpdateWrapper().eq(SupDictProblemType::getId, dictContent.getId()).set(SupDictProblemType::getCode, dictContent.getId())); + return Result.success(); + } + + @PutMapping + public Result update(@RequestBody SupDictProblemType dictContent) { + dictContent.setUpdTime(LocalDateTime.now()); + dictContentService.updateById(dictContent); + return Result.success(); + } + + @DeleteMapping("{id}") + public Result update(@PathVariable Integer id) { + if (dictContentService.exists(new LambdaQueryWrapper().eq(SupDictProblemType::getParentCode, id))) { + throw new RuntimeException("该节点下还存在子节点,无法删除"); + } + dictContentService.removeById(id); + return Result.success(); + } +} diff --git a/src/main/java/com/biutag/supervision/controller/system/DictController.java b/src/main/java/com/biutag/supervision/controller/system/DictController.java new file mode 100644 index 0000000..d09e789 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/DictController.java @@ -0,0 +1,137 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.DictDataDto; +import com.biutag.supervision.pojo.dto.DictTypeDto; +import com.biutag.supervision.pojo.entity.SupDict12337HandleResult; +import com.biutag.supervision.pojo.entity.SupDictData; +import com.biutag.supervision.pojo.entity.SupDictType; +import com.biutag.supervision.pojo.vo.DictProblemSourceTree; +import com.biutag.supervision.pojo.vo.SelectOption; +import com.biutag.supervision.pojo.vo.SelectOptionGroup; +import com.biutag.supervision.service.SupDict12337HandleResultService; +import com.biutag.supervision.service.SupDictDataService; +import com.biutag.supervision.service.SupDictProblemSourceService; +import com.biutag.supervision.service.SupDictTypeService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@RequiredArgsConstructor +@RequestMapping("dict") +@RestController +public class DictController { + + private final SupDictTypeService dictTypeService; + + private final SupDictDataService dictDataService; + + private final SupDictProblemSourceService dictProblemSourceService; + + private final SupDict12337HandleResultService dict12337HandleResultService; + + @GetMapping + public Result> page(Page page, String dictName, String dictType) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(dictName), SupDictType::getDictName, dictName) + .like(StrUtil.isNotBlank(dictType), SupDictType::getDictType, dictType) + .orderByDesc(SupDictType::getUpdateTime); + return Result.success(dictTypeService.page(page, queryWrapper)); + } + + @PostMapping + public Result add(@RequestBody DictTypeDto dictType) { + return Result.success(dictTypeService.save(dictType)); + } + + @PutMapping + public Result update(@RequestBody DictTypeDto dictType) { + SupDictType supDictType = new SupDictType(); + BeanUtil.copyProperties(dictType, supDictType); + supDictType.setUpdateTime(LocalDateTime.now()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().ne(SupDictType::getDictId, dictType.getDictId()).eq(SupDictType::getDictType, dictType.getDictType()); + if (dictTypeService.exists(queryWrapper)) { + throw new RuntimeException("字典类型已存在"); + } + SupDictType oldSupDictType = dictTypeService.getById(dictType.getDictId()); + if (!oldSupDictType.getDictType().equals(supDictType.getDictType())) { + // 更新 + dictDataService.update(new LambdaUpdateWrapper().eq(SupDictData::getDictType, oldSupDictType.getDictType()).set(SupDictData::getDictType, dictType.getDictType())); + } + return Result.success(dictTypeService.updateById(supDictType)); + } + + @DeleteMapping("{dictId}") + public Result update(@PathVariable Integer dictId) { + return Result.success(dictTypeService.removeById(dictId)); + } + @GetMapping("{dictType}/dictData") + public Result> list(Page page, @PathVariable String dictType) { + return Result.success(dictDataService.page(page, new LambdaQueryWrapper() + .eq(SupDictData::getDictType, dictType) + .orderByAsc(SupDictData::getDictSort))); + } + + @PostMapping("{dictType}/dictData") + public Result add(@RequestBody DictDataDto dictData) { + return Result.success(dictDataService.save(dictData)); + } + + @PutMapping("{dictType}/dictData") + public Result update(@RequestBody DictDataDto dictData) { + SupDictData supDictData = new SupDictData(); + BeanUtil.copyProperties(dictData, supDictData); + return Result.success(dictDataService.updateById(supDictData)); + } + + @DeleteMapping("{dictType}/dictData/{dictCode}") + public Result del(@PathVariable Integer dictCode) { + return Result.success(dictDataService.removeById(dictCode)); + } + + @GetMapping("data/{dictType}") + public Result> list(@PathVariable String dictType) { + return Result.success(dictDataService.list(new LambdaQueryWrapper() + .eq(SupDictData::getDictType, dictType) + .orderByAsc(SupDictData::getDictSort))); + } + + @GetMapping("problemSource") + public Result> listProblemSource() { + return Result.success(dictProblemSourceService.buildTree()); + } + + @GetMapping("12337HandleResult") + public Result> handleResult() { + List list = dict12337HandleResultService.list(); + Map> collect = list.stream().collect(Collectors.groupingBy(SupDict12337HandleResult::getGroupName)); + List groups = List.of("第一种形态", "第二种形态","第三种形态","第四种形态"); + List result = collect.keySet().stream() + // 排序 + .sorted(Comparator.comparingInt(groups::indexOf)) + .map(label -> { + SelectOptionGroup group = new SelectOptionGroup(); + group.setLabel(label); + group.setOptions(collect.get(label).stream().map(o -> { + SelectOption option = new SelectOption(); + option.setText(o.getName()); + option.setValue(o.getName()); + return option; + }).toList()); + return group; + }).toList(); + + return Result.success(result); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/HandleResultMapingController.java b/src/main/java/com/biutag/supervision/controller/system/HandleResultMapingController.java new file mode 100644 index 0000000..cebec52 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/HandleResultMapingController.java @@ -0,0 +1,69 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupDictHandleResultMaping; +import com.biutag.supervision.pojo.param.DepartMapingQueryParam; +import com.biutag.supervision.service.SupDictHandleResultMapingService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2024/12/31 + */ +@RequestMapping("handleResultMaping") +@RequiredArgsConstructor +@RestController +public class HandleResultMapingController { + + private final SupDictHandleResultMapingService handleResultMapingService; + + @GetMapping + public Result> list(DepartMapingQueryParam param) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper + .eq(SupDictHandleResultMaping::getSource, param.getSource()) + .like(StrUtil.isNotBlank(param.getExternalName()), SupDictHandleResultMaping::getExternalName, param.getExternalName()) + .eq(StrUtil.isNotBlank(param.getInternalId()), SupDictHandleResultMaping::getInternalId, param.getInternalId()) + .orderByDesc(SupDictHandleResultMaping::getCreateTime); + return Result.success(handleResultMapingService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper)); + } + + @PostMapping + public Result add(@RequestBody SupDictHandleResultMaping data) { + if (handleResultMapingService.exists(new LambdaQueryWrapper() + .eq(SupDictHandleResultMaping::getExternalName, data.getExternalName()))) { + throw new RuntimeException(String.format("处理结果【%s】已存在", StrUtil.trim(data.getExternalName()))); + } + data.setExternalName(StrUtil.trim(data.getExternalName())); + data.setUpdateTime(LocalDateTime.now()); + data.setCreateTime(LocalDateTime.now()); + handleResultMapingService.save(data); + return Result.success(); + } + + @PutMapping + public Result update(@RequestBody SupDictHandleResultMaping data) { + if (handleResultMapingService.exists(new LambdaQueryWrapper() + .eq(SupDictHandleResultMaping::getExternalName, data.getExternalName()) + .eq(SupDictHandleResultMaping::getSource, data.getSource()) + .ne(SupDictHandleResultMaping::getId, data.getId()))) { + throw new RuntimeException(String.format("处理结果【%s】已存在", data.getExternalName())); + } + data.setUpdateTime(LocalDateTime.now()); + handleResultMapingService.updateById(data); + return Result.success(); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + handleResultMapingService.removeById(id); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/HolidayController.java b/src/main/java/com/biutag/supervision/controller/system/HolidayController.java new file mode 100644 index 0000000..a331b0b --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/HolidayController.java @@ -0,0 +1,71 @@ +package com.biutag.supervision.controller.system; + +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.Holiday; +import com.biutag.supervision.service.HolidayService; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDate; +import java.time.temporal.TemporalAdjusters; +import java.util.ArrayList; +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("holiday") +@RestController +public class HolidayController { + + private final HolidayService holidayService; + + public static final List months = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12); + + @GetMapping("{year}") + public Result> list(@PathVariable Integer year) { + List holidays = holidayService.list(year); + List list = months.stream().map(month -> { + HolidayVo holidayVo = new HolidayVo(); + holidayVo.setMonth(month); + LocalDate beginDay = LocalDate.of(year, month, 1); + int beginDayOfWeek = beginDay.getDayOfWeek().getValue(); + for (int i = 0; i < (beginDayOfWeek != 0 ? beginDayOfWeek - 1 : 6); i++) { + holidayVo.getDays().add(new Day()); + } + LocalDate.of(year, month, 1); + for (int i = 1; i <= beginDay.with(TemporalAdjusters.lastDayOfMonth()).getDayOfMonth(); i++) { + String date = LocalDate.of(year, month, i).toString(); + Boolean flag = holidays.stream().filter(item -> item.getDate().equals(date)).findFirst().map(Holiday::getFlag).orElse(false); + holidayVo.getDays().add(Day.of(i, flag)); + } + return holidayVo; + }).toList(); + return Result.success(list); + } + + @Setter + @Getter + public static class HolidayVo { + private Integer month; + private List days = new ArrayList<>(); + } + + @Setter + @Getter + public static class Day { + private Integer day; + private Boolean flag = false; + + public static Day of(Integer day, Boolean flag) { + Day obj = new Day(); + obj.setDay(day); + obj.setFlag(flag); + return obj; + } + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/MenuController.java b/src/main/java/com/biutag/supervision/controller/system/MenuController.java new file mode 100644 index 0000000..90ac260 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/MenuController.java @@ -0,0 +1,51 @@ +package com.biutag.supervision.controller.system; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.MenuDto; +import com.biutag.supervision.pojo.entity.Menu; +import com.biutag.supervision.pojo.vo.MenuTree; +import com.biutag.supervision.service.MenuService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("menu") +@RestController +public class MenuController { + + private final MenuService menuService; + + @GetMapping + public Result> list() { + List menus = menuService.list(new LambdaQueryWrapper().orderByAsc(Menu::getMenuSort)); + return Result.success(MenuTree.buildTree(menus)); + } + + @PostMapping + public Result add(@RequestBody MenuDto menuDto) { + Menu menu = new Menu(); + BeanUtils.copyProperties(menuDto, menu); + menuService.save(menu); + return Result.success(); + } + + @PutMapping + public Result> update(@RequestBody MenuDto menuDto) { + Menu menu = new Menu(); + BeanUtils.copyProperties(menuDto, menu); + menu.setUpdateTime(LocalDateTime.now()); + menuService.updateById(menu); + return Result.success(); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable Integer id) { + return Result.success(menuService.removeById(id)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/PoliceController.java b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java new file mode 100644 index 0000000..adb9cc1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java @@ -0,0 +1,291 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.domain.PoliceAuth; +import com.biutag.supervision.pojo.dto.PoliceDto; +import com.biutag.supervision.pojo.dto.PoliceImport; +import com.biutag.supervision.pojo.dto.UserDto; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.PoliceModel; +import com.biutag.supervision.pojo.param.PoliceQueryParam; +import com.biutag.supervision.pojo.vo.DepartTree; +import com.biutag.supervision.service.*; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Valid; +import jakarta.validation.Validator; +import lombok.RequiredArgsConstructor; +import org.apache.xmlbeans.UserType; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; + +@RequestMapping("police") +@RequiredArgsConstructor +@RestController +public class PoliceController { + + private final SupPoliceService policeService; + + private final SupDepartService departService; + + private final NegDepartAuthorityService negDepartAuthorityService; + + private final NegSourceAuthorityService negSourceAuthorityService; + + private final BaseUserService baseUserService; + + private final Validator validator; + + @GetMapping + public Result> list(PoliceQueryParam param) { + return Result.success(policeService.page(param)); + } + + @GetMapping("/getAllDepartNode") + public Result> getAllDepartNode(){ + return Result.success(policeService.getALlDepartNode()); + } + + // 异常人员 + @GetMapping("abnormal") + public Result> abnormalList(PoliceQueryParam param) { + return Result.success(policeService.pageByAbnormal(param)); + } + + @PostMapping + public Result add(@Valid @RequestBody PoliceDto policeDto) { + SupPolice policeByEmpNo = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getEmpNo, policeDto.getEmpNo())); + if (Objects.nonNull(policeByEmpNo)) { + SupDepart depart = departService.getById(policeByEmpNo.getOrgId()); + throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", policeDto.getEmpNo(), depart.getName())); + } + SupPolice one = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getIdCode, policeDto.getIdCode())); + if (Objects.nonNull(one)) { + SupDepart depart = departService.getById(one.getOrgId()); + throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", policeDto.getIdCode(), depart.getName())); + } + SupPolice police = new SupPolice(); + BeanUtils.copyProperties(policeDto, police); + police.setId(IdUtil.getSnowflakeNextIdStr()); + police.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + police.setCreatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + policeService.save(police); + if (policeDto.getCreateUserFlag() && !userService.exists(new LambdaQueryWrapper().eq(BaseUser::getUserName, police.getIdCode()))) { + UserDto userDto = new UserDto(); + userDto.setUserName(police.getIdCode()); + userDto.setNickName(police.getName()); + userDto.setPassword(policeDto.getPassword()); + userDto.setUserType("normal"); + userDto.setRoleIds(new ArrayList<>()); + baseUserService.save(userDto); + } + return Result.success(); + } + + @PutMapping + public Result update(@RequestBody SupPolice police) { + SupPolice policeByEmpNo = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getEmpNo, police.getEmpNo()).ne(SupPolice::getId, police.getId())); + if (Objects.nonNull(policeByEmpNo)) { + SupDepart depart = departService.getById(policeByEmpNo.getOrgId()); + throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getEmpNo(), depart.getName())); + } + SupPolice one = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getIdCode, police.getIdCode()).ne(SupPolice::getId, police.getId())); + if (Objects.nonNull(one)) { + SupDepart depart = departService.getById(one.getOrgId()); + throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getIdCode(), depart.getName())); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() + .eq(SupPolice::getId, police.getId()) + .set(SupPolice::getName, police.getName()) + .set(SupPolice::getEmpNo, police.getEmpNo()) + .set(SupPolice::getIdCode, police.getIdCode()) + .set(SupPolice::getOrgId, police.getOrgId()) + .set(SupPolice::getPersonType, police.getPersonType()) + .set(SupPolice::getPosition, police.getPosition()) + .set(SupPolice::getPoliceRole, police.getPoliceRole()) + .set(SupPolice::getMobile, police.getMobile()) + .set(SupPolice::getEmploymentDate, police.getEmploymentDate()) + .set(SupPolice::getAvatarUrl, police.getAvatarUrl()) + .set(SupPolice::getUpdatedAt, DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + return Result.success(policeService.update(updateWrapper)); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id, @RequestBody JSONObject body) { + policeService.update(new LambdaUpdateWrapper().eq(SupPolice::getId, id).set(SupPolice::getDel, AppConstants.DEL) + .set(SupPolice::getDelReason, body.getString("reason"))); + return Result.success(); + } + + @GetMapping("{departId}/all") + public Result> all(@PathVariable String departId) { + return Result.success(policeService.listAllByDepartId(departId)); + } + + @GetMapping("{departId}/leader") + public Result> leader(@PathVariable String departId) { + return Result.success(policeService.listLeaderByDepartId(departId)); + } + + @GetMapping("auth/{idCode}") + public Result auth(@PathVariable String idCode) { + PoliceAuth policeAuth = new PoliceAuth().setDeparts(negDepartAuthorityService.list(idCode).stream().map(NegDepartAuthority::getDepartId).toList()) + .setSources(negSourceAuthorityService.list(idCode).stream().map(NegSourceAuthority::getSource).toList()) + .setRoleIds(userService.getRoleIds(idCode)); + return Result.success(policeAuth); + } + + @PostMapping("auth/{idCode}") + public Result auth(@PathVariable String idCode, @RequestBody PoliceAuth policeAuth) { + negDepartAuthorityService.save(idCode, policeAuth.getDeparts()); + negSourceAuthorityService.save(idCode, policeAuth.getSources()); + userService.updateRoleCodeByUserName(idCode, policeAuth.getRoleIds()); + return Result.success(); + } + + private final BaseUserService userService; + private final BaseAccountService accountService; + private final SupDictProblemSourceService dictProblemSourceService; + + @PostMapping("import") + public Result> importExcel(@RequestPart("file") MultipartFile file) throws IOException { + String fileNameType = FileUtil.extName(file.getOriginalFilename()); + if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) { + throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入"); + } + List list = new ArrayList<>(); + List problemSources = dictProblemSourceService.list(); + ExcelReader excelReader = EasyExcel.read(file.getInputStream(), PoliceImport.class, new ReadListener() { + @Override + public void invoke(PoliceImport data, AnalysisContext analysisContext) { + Set> validate = validator.validate(data); + if (!validate.isEmpty()) { + String message = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining("\n")); + throw new RuntimeException(String.format("第%s条数据的异常:%s", list.size() + 1, message)); + } + list.add(data); + } + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + } + }).build(); + ReadSheet sheet = EasyExcel.readSheet(0).build(); + excelReader.read(sheet); + excelReader.close(); + for (int i = 0; i < list.size(); i++) { + PoliceImport police = list.get(i); + SupDepart depart = departService.getOne(new LambdaQueryWrapper().eq(SupDepart::getShortName, police.getSecondDepartName()).eq(SupDepart::getLevel, 2)); + if (Objects.isNull(depart)) { + throw new RuntimeException(String.format("%s 该单位在系统中未找到,请核实", police.getSecondDepartName())); + } + if (StrUtil.isNotBlank(police.getThirdDepartName())) { + depart = departService.getOne(new LambdaQueryWrapper().eq(SupDepart::getPid, depart.getId()) + .eq(SupDepart::getShortName, police.getThirdDepartName()).eq(SupDepart::getLevel, 3)); + if (Objects.isNull(depart)) { + throw new RuntimeException(String.format("%s/%s 该单位在系统中未找到,请核实", police.getSecondDepartName(), police.getThirdDepartName())); + } + } + SupPolice supPolice = policeService.getByIdCode(list.get(i).getIdCode()); + if (supPolice == null) { + supPolice = new SupPolice(); + } + supPolice.setName(police.getName()); + supPolice.setIdCode(police.getIdCode()); + supPolice.setEmpNo(police.getEmpNo()); + supPolice.setOrgId(depart.getId()); + if (police.getEmpNo().contains("A")) { + supPolice.setPersonType("3"); + } else { + supPolice.setPersonType("1"); + } + policeService.saveOrUpdate(supPolice); + if ("三级机构专班".equals(police.getRole()) || "二级机构专班".equals(police.getRole())) { + String userId = saveOrUpdateUser(police); + // 角色 + addRoleUser(userId, police.getRole()); + // 权限 + addAuth(police.getIdCode(), supPolice.getOrgId(), problemSources); + } + + } + return Result.success(list); + } + + public String saveOrUpdateUser(PoliceImport police) { + BaseUser user = userService.getByUserName(police.getIdCode()); + if (user != null) { + return user.getUserId(); + } + BaseUser baseUser = new BaseUser(); + baseUser.setUserName(police.getIdCode()); + baseUser.setNickName(police.getName()); + baseUser.setUserType("admin"); + baseUser.setCreateTime(LocalDateTime.now()); + baseUser.setUpdateTime(LocalDateTime.now()); + userService.save(baseUser); + BaseAccount account = new BaseAccount(); + account.setAccount(police.getIdCode()); + account.setUserId(baseUser.getUserId()); + account.setAccountType("username"); + account.setDomain("@admin.com"); + account.setPassword("$2a$10$q0NbHH1fbkDotxJ1dT7PbOcV4G47R8n15uVxz2.imTiDqdCwAJYBC"); + account.setDomain("@admin.com"); + account.setCreateTime(LocalDateTime.now()); + account.setUpdateTime(LocalDateTime.now()); + accountService.save(account); + return baseUser.getUserId(); + } + + private final BaseRoleUserService roleUserService; + public void addRoleUser(String userId, String role) { + roleUserService.remove(new LambdaQueryWrapper().eq(BaseRoleUser::getUserId, userId)); + BaseRoleUser baseRoleUser = new BaseRoleUser(); + baseRoleUser.setUserId(userId); + if ("三级机构专班".equals(role)) { + baseRoleUser.setRoleId("5"); + } + if ("二级机构专班".equals(role)) { + baseRoleUser.setRoleId("4"); + } + baseRoleUser.setCreateTime(LocalDateTime.now()); + baseRoleUser.setUpdateTime(LocalDateTime.now()); + roleUserService.save(baseRoleUser); + } + + public void addAuth(String idCode, String orgId, List problemSources) { + negDepartAuthorityService.remove(new LambdaQueryWrapper().eq(NegDepartAuthority::getIdCode, idCode)); + NegDepartAuthority authority = new NegDepartAuthority(); + authority.setDepartId(orgId); + authority.setIdCode(idCode); + negDepartAuthorityService.save(authority); + negSourceAuthorityService.remove(new LambdaQueryWrapper().eq(NegSourceAuthority::getIdCode, idCode)); + + List list = problemSources.stream().map(item -> { + NegSourceAuthority sourceAuthority = new NegSourceAuthority(); + sourceAuthority.setIdCode(idCode); + sourceAuthority.setSource(item.getId()); + return sourceAuthority; + }).toList(); + negSourceAuthorityService.saveBatch(list); + } +} diff --git a/src/main/java/com/biutag/supervision/controller/system/ProblemTypeMapingController.java b/src/main/java/com/biutag/supervision/controller/system/ProblemTypeMapingController.java new file mode 100644 index 0000000..6a5674f --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/ProblemTypeMapingController.java @@ -0,0 +1,66 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.mapper.SupDictProblemTypeMapingMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupDictProblemTypeMaping; +import com.biutag.supervision.pojo.param.DepartMapingQueryParam; +import com.biutag.supervision.pojo.param.PoliceQueryParam; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2024/12/31 + */ +@RequestMapping("problemTypeMaping") +@RequiredArgsConstructor +@RestController +public class ProblemTypeMapingController { + + private final SupDictProblemTypeMapingMapper problemTypeMapingMapper; + + @GetMapping + public Result> list(DepartMapingQueryParam param) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like(StrUtil.isNotBlank(param.getExternalName()), SupDictProblemTypeMaping::getExternalName, param.getExternalName()) + .eq(StrUtil.isNotBlank(param.getInternalId()), SupDictProblemTypeMaping::getInternalId, param.getInternalId()) + .orderByDesc(SupDictProblemTypeMaping::getCreateTime); + return Result.success(problemTypeMapingMapper.selectPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper)); + } + + @PostMapping + public Result add(@RequestBody SupDictProblemTypeMaping data) { + if (problemTypeMapingMapper.exists(new LambdaQueryWrapper() + .eq(SupDictProblemTypeMaping::getExternalName, data.getExternalName()))) { + throw new RuntimeException(String.format("问题类型【%s】已存在", StrUtil.trim(data.getExternalName()))); + } + data.setExternalName(StrUtil.trim(data.getExternalName())); + data.setUpdateTime(LocalDateTime.now()); + data.setCreateTime(LocalDateTime.now()); + problemTypeMapingMapper.insert(data); + return Result.success(); + } + + @PutMapping + public Result update(@RequestBody SupDictProblemTypeMaping data) { + if (problemTypeMapingMapper.exists(new LambdaQueryWrapper() + .eq(SupDictProblemTypeMaping::getExternalName, data.getExternalName()) + .ne(SupDictProblemTypeMaping::getId, data.getId()))) { + throw new RuntimeException(String.format("单位编码【%s】已存在", data.getExternalName())); + } + data.setUpdateTime(LocalDateTime.now()); + problemTypeMapingMapper.updateById(data); + return Result.success(); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + problemTypeMapingMapper.deleteById(id); + return Result.success(); + } +} diff --git a/src/main/java/com/biutag/supervision/controller/system/RoleController.java b/src/main/java/com/biutag/supervision/controller/system/RoleController.java new file mode 100644 index 0000000..7c11ac5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/RoleController.java @@ -0,0 +1,62 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.util.IdUtil; +import com.biutag.supervision.constants.enums.StatusEnum; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.BaseRole; +import com.biutag.supervision.pojo.entity.RoleMenu; +import com.biutag.supervision.pojo.param.RoleQueryParam; +import com.biutag.supervision.service.BaseRoleService; +import com.biutag.supervision.service.RoleMenuService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; + +@RequiredArgsConstructor +@RequestMapping("role") +@RestController +public class RoleController { + + private final BaseRoleService baseRoleService; + + private final RoleMenuService roleMenuService; + + @GetMapping + public Result> list(RoleQueryParam roleQueryParam) { + List roles = baseRoleService.list(roleQueryParam); + return Result.success(roles); + } + + @PostMapping + public Result add(@RequestBody BaseRole role) { + role.setRoleId(String.valueOf(IdUtil.getSnowflakeNextId())); + role.setCreateTime(LocalDateTime.now()); + role.setUpdateTime(LocalDateTime.now()); + role.setStatus(StatusEnum.ENABLE.getValue()); + return Result.success(baseRoleService.save(role)); + } + + @PutMapping + public Result update(@RequestBody BaseRole role) { + role.setUpdateTime(LocalDateTime.now()); + return Result.success(baseRoleService.updateById(role)); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + return Result.success(baseRoleService.removeById(id)); + } + + @GetMapping("{roleCode}/menu") + public Result> add(@PathVariable String roleCode) { + return Result.success(roleMenuService.list(roleCode).stream().map(RoleMenu::getMenuId).toList()); + } + + @PostMapping("{roleCode}/menu") + public Result add(@PathVariable String roleCode, @RequestBody List menuIds) { + return Result.success(roleMenuService.update(roleCode, menuIds)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/UserController.java b/src/main/java/com/biutag/supervision/controller/system/UserController.java new file mode 100644 index 0000000..1774622 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/UserController.java @@ -0,0 +1,56 @@ +package com.biutag.supervision.controller.system; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.UserDto; +import com.biutag.supervision.pojo.dto.UserPasswordDto; +import com.biutag.supervision.pojo.entity.BaseAccount; +import com.biutag.supervision.pojo.model.UserModel; +import com.biutag.supervision.pojo.param.UserQueryParam; +import com.biutag.supervision.service.BaseAccountService; +import com.biutag.supervision.service.BaseUserService; +import lombok.RequiredArgsConstructor; +import org.springframework.security.crypto.bcrypt.BCrypt; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.web.bind.annotation.*; + +@RequiredArgsConstructor +@RequestMapping("user") +@RestController +public class UserController { + + private final BaseUserService baseUserService; + + private final BaseAccountService accountService; + + @GetMapping + public Result> list(UserQueryParam queryParam) { + Page baseUserPage = baseUserService.page(queryParam); + return Result.success(baseUserPage); + } + + @PostMapping + public Result add(@RequestBody UserDto userDto) { + return Result.success(baseUserService.save(userDto)); + } + + @PutMapping + public Result update(@RequestBody UserDto userDto) { + return Result.success(baseUserService.update(userDto)); + } + + @PutMapping("password") + public Result updatePsd(@RequestBody UserPasswordDto userPasswordDto) { + BaseAccount baseAccount = accountService.getByAccount(userPasswordDto.getAccount()); + if (!BCrypt.checkpw(userPasswordDto.getPassword(), baseAccount.getPassword())) { + throw new RuntimeException("密码错误!"); + } + BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); + String passwordEncoder = encoder.encode(userPasswordDto.getNewPassword()); + accountService.update(new LambdaUpdateWrapper().eq(BaseAccount::getAccount, userPasswordDto.getAccount()).set(BaseAccount::getPassword, passwordEncoder)); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/warning/WarningController.java b/src/main/java/com/biutag/supervision/controller/warning/WarningController.java new file mode 100644 index 0000000..7fdcbd5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/warning/WarningController.java @@ -0,0 +1,229 @@ +package com.biutag.supervision.controller.warning; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.InvertRecord; +import com.biutag.supervision.pojo.entity.report.ReportFlow; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.report.ReportReview; +import com.biutag.supervision.pojo.entity.warning.WarningContent; +import com.biutag.supervision.pojo.entity.warning.WarningRecord; +import com.biutag.supervision.pojo.enums.FlowEnum; +import com.biutag.supervision.pojo.enums.FlowStateEnum; +import com.biutag.supervision.pojo.enums.FlowWarningEnum; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.Warning.WarningQueryParam; +import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; +import com.biutag.supervision.pojo.vo.warning.WaringVo; +import com.biutag.supervision.pojo.vo.warning.WarningInformData; +import com.biutag.supervision.service.InvertRecord.InvertRecordService; +import com.biutag.supervision.service.Report.ReportFlowService; +import com.biutag.supervision.service.Report.ReportProjectService; +import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.service.Warning.WarningContentService; +import com.biutag.supervision.service.Warning.WarningRecordService; +import io.lettuce.core.dynamic.annotation.Param; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/warning") +public class WarningController { + + private final ReportProjectService reportProjectService; + private final WarningContentService contentService; + private final WarningRecordService recordService; + private final ReportFlowService reportFlowService; + private final InvertRecordService invertRecordService; + private final SupDepartService departService; + + //预警督察列表 + @PostMapping("/getPage") + public Result> getPage(@RequestBody WarningQueryParam queryParam){ + UserAuth user = UserContextHolder.getCurrentUser(); + QueryWrapper wrapper= new QueryWrapper() + .eq(StrUtil.isNotBlank(queryParam.getProjectUnitId()),"p.project_unit_id",queryParam.getProjectUnitId()) + .eq(StrUtil.isNotBlank(queryParam.getAuditUnitId()),"p.audit_unit_id",queryParam.getAuditUnitId()) + .eq(StrUtil.isNotBlank(queryParam.getReportName()),"p.report_name",queryParam.getReportName()) + .eq("f.report_link","end") + .eq("f.approver_state","end") + .eq(StrUtil.isNotBlank(queryParam.getWarningState()),"p.warning_state",queryParam.getWarningState()) + .eq("p.node",FlowStateEnum.End.getLabel()); + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { + List orgIds =new ArrayList<>(); + if(!user.getAuthDepartIds().isEmpty()){ + orgIds = departService.getAllNodeIds(user.getAuthDepartIds()); + wrapper.in("p.project_unit_id", orgIds); + }else{ + orgIds = departService.getAllNodeIds(user.getDepartId()); + wrapper.in("p.project_unit_id", orgIds); + } +// List orgIds = departService.getAllNodeIds(user.getAuthDepartIds()); +// wrapper.in("p.project_unit_id", orgIds); + } + if(CollectionUtil.isNotEmpty(queryParam.getPublicationDate())){ + wrapper.between(CollectionUtil.isNotEmpty(queryParam.getPublicationDate()),"p.publication_date",queryParam.getPublicationDate().get(0),queryParam.getPublicationDate().get(1)); + } + if(CollectionUtil.isNotEmpty(queryParam.getEndDate())){ + wrapper.between(CollectionUtil.isNotEmpty(queryParam.getEndDate()),"p.archiving",queryParam.getEndDate().get(0),queryParam.getEndDate().get(1)); + } + wrapper.groupBy("p.id"); + Page page= reportProjectService.getPageWarning(new Page<>(queryParam.getCurrent(),queryParam.getSize()),wrapper,queryParam.getWarningState()); + List entryWindowVos = page.getRecords(); + entryWindowVos.forEach(s->{ + List list = recordService.list(new LambdaQueryWrapper().eq(WarningRecord::getReportId,s.getId())); + if(CollectionUtil.isNotEmpty(list)) { + //0的代表已下发问题 + List records= list.stream().filter(x-> "0".equals(x.getFlowState())).toList(); + //为空表示已提交审核 + List auditNumber= list.stream().filter(x-> StrUtil.isEmpty(x.getFlowState())).toList(); + //1 为 已下发问题 ,2 为已提交审核,0为常规 + String stateData = CollectionUtil.isNotEmpty(records)?"1":(CollectionUtil.isNotEmpty(auditNumber)?"2":"0"); + s.setStateData(stateData); + List ids = list.stream().map(x -> x.getId()).toList(); + long counts = contentService.count(new LambdaQueryWrapper().in(WarningContent::getWarningId, ids) + .isNotNull(WarningContent::getRemark)); + s.setWarningContent(counts); + } + }); + page.setRecords(entryWindowVos); + return Result.success(page); + + } + /** + * 获取最新的预警记录 + * @param id 项目id + * */ + @GetMapping("/getWarningRecord/{id}") + public Result getWarningRecord(@PathVariable("id")String id){ + WarningRecord record =recordService.selectDataByDistinct(id); + if(ObjectUtil.isNotEmpty(record)){ + return Result.success(record); + }else { + return Result.success(); + } + + } + + + @GetMapping("getWarningAudit/{id}") + public Result< List> getWarningAudit(@PathVariable("id")String id){ + //获取已下发的预警记录 + List record = recordService.selectDataByAudit(id); + return Result.success(record); + } + + + + + @GetMapping("/getRejectNode/{id}") + public Result> getRejectNode(@PathVariable("id") String id){ + WarningRecord record = recordService.getById(id); + List flows =reportFlowService.list(new LambdaQueryWrapper().eq(ReportFlow::getReportId,id).eq(ReportFlow::getType,"warning")); + flows=flows.stream().filter(s->!s.getApproverState().equals(FlowStateEnum.Reject.getLabel()) && isRejectNodeFlow(record.getNode()).contains(s.getReportLink())) + .collect(Collectors.toMap( + ReportFlow::getReportCode, + Function.identity(), + (existing, replacement) -> existing + )).values().stream().toList(); + + return Result.success(flows); + } + + + + + //预警督察详情 + @GetMapping("/{id}") + public Result getDetail(@PathVariable("id") String id){ + WaringVo vo= recordService.getWarningVoFun(id); + return Result.success(vo); + } + + //保存或者修改 预警督察详情 + @PostMapping("/addOrUpData") + public Result addOrUpData(@RequestBody WaringVo vo){ + vo.getRecord().setReportId(vo.getReportProject().getId()); + UserAuth user = UserContextHolder.getCurrentUser(); + String type="warning"; + vo.getRecord().setCreateTime(LocalDateTime.now()); + if("inform".equals(vo.getCode())){ + type= "inform"; + } + if(StrUtil.isNotBlank(vo.getIsSubmit())){ + if("inform".equals(vo.getCode())){ + vo.getRecord().setInformNode(FlowWarningEnum.state.getLabel()); + }else{ + vo.getRecord().setNode(FlowWarningEnum.state.getLabel()); + } + + recordService.saveOrUpdate(vo.getRecord()); + + List reportFlows = reportFlowService.list( + new LambdaQueryWrapper().eq(ReportFlow::getReportId,vo.getRecord().getId()) + .eq(ReportFlow::getReportLink,FlowWarningEnum.state.getLabel()) + .eq(ReportFlow::getReportCode,FlowWarningEnum.state.getValue()) + .eq(ReportFlow::getApproverState,FlowStateEnum.Start.getLabel()) + .eq(ReportFlow::getType,type) + ); + if(CollectionUtil.isEmpty(reportFlows)){ + ReportFlow flow = new ReportFlow(); + flow.setReportId(vo.getRecord().getId()); + flow.setReportLink(FlowWarningEnum.state.getLabel()); + flow.setReportCode(FlowWarningEnum.state.getValue()); + flow.setAreportTime(LocalDateTime.now()); + flow.setApproverState(FlowStateEnum.Start.getLabel()); + flow.setApprover(user.getNickName()); + flow.setApproverId(user.getUserName()); + flow.setIsInit("1"); + flow.setType(type); + reportFlowService.save(flow); + } + }else{ + recordService.saveOrUpdate(vo.getRecord()); + } + if(CollectionUtil.isNotEmpty(vo.getContents())){ + vo.getContents().forEach(s->{ + s.setWarningId(vo.getRecord().getId()); + }); + contentService.saveOrUpdateBatch(vo.getContents()); + } + return this.getDetail(vo.getRecord().getId()); + + } + + @GetMapping("/getWarningInformList/{id}") + public Result> getWarningInformList(@PathVariable("id")String id){ + List list =recordService.getWarningInformData(id); + return Result.success(list); + } + + + public List isRejectNodeFlow(String node){ + return switch (node) { + case "leader" -> List.of( "state"); + case "end" -> List.of("state", "leader"); + default -> new ArrayList<>(); + }; + } + + +} diff --git a/src/main/java/com/biutag/supervision/controller/work/workController.java b/src/main/java/com/biutag/supervision/controller/work/workController.java new file mode 100644 index 0000000..085a73a --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/work/workController.java @@ -0,0 +1,97 @@ +package com.biutag.supervision.controller.work; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.mapper.InformMessageMapper; +import com.biutag.supervision.mapper.Report.ReportProjectMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.InformMessage; +import com.biutag.supervision.pojo.entity.SupPolice; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.Work.ProjectWorkQueryParam; +import com.biutag.supervision.pojo.vo.work.MessageWorkVo; +import com.biutag.supervision.pojo.vo.work.ProjectTabWorkVo; +import com.biutag.supervision.pojo.vo.work.ProjectWorkVo; +import com.biutag.supervision.service.InformMessageService; +import com.biutag.supervision.service.Report.ReportProjectService; +import com.biutag.supervision.service.SupPoliceService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RequiredArgsConstructor +@RestController +@RequestMapping("/work") +public class workController { + + private final SupPoliceService policeService; + + private final ReportProjectService projectService; + + private final InformMessageMapper informMessageMapper; + //待办事项 + @GetMapping("/{code}") + public Result> getWorkVoList(@PathVariable("code")String code){ + ProjectWorkQueryParam queryParam =new ProjectWorkQueryParam(); + queryParam.setCode(code); + UserAuth user = UserContextHolder.getCurrentUser(); + if(ObjectUtil.isNotEmpty(user)){ + if(!AppConstants.USER_TYPE_SUPER.equals(user.getUserType())){ + queryParam.setUserId(user.getUserName()); + } + } + return Result.success(projectService.getProjectWork(queryParam)); + } + //tab数字 + @GetMapping("/getWorkTab") + public Result getWorkTab(){ + ProjectWorkQueryParam queryParam =new ProjectWorkQueryParam(); + UserAuth user = UserContextHolder.getCurrentUser(); + if(ObjectUtil.isNotEmpty(user)){ + if(!AppConstants.USER_TYPE_SUPER.equals(user.getUserType())){ + queryParam.setUserId(user.getUserName()); + } + } + ProjectTabWorkVo workVo = projectService.getProjectTabWorkVo(queryParam); + if(ObjectUtil.isEmpty(workVo)){ + workVo=new ProjectTabWorkVo(); + } + workVo.setUnread(informMessageMapper.selectCount( + new LambdaUpdateWrapper().eq(InformMessage::getIsRead,"0") + .eq(StrUtil.isNotBlank(queryParam.getUserId()),InformMessage::getRecipientId,queryParam.getUserId()) + )); + workVo.setRead(informMessageMapper.selectCount( + new LambdaUpdateWrapper().eq(InformMessage::getIsRead,"1") + .eq(StrUtil.isNotBlank(queryParam.getUserId()),InformMessage::getRecipientId,queryParam.getUserId()) + )); + + return Result.success(workVo); + } + + @GetMapping("/getMessageWorkList/{code}") + public Result> getMessageWorkList(@PathVariable("code") String code){ + UserAuth user = UserContextHolder.getCurrentUser(); + ProjectWorkQueryParam queryParam=new ProjectWorkQueryParam(); + if(ObjectUtil.isNotEmpty(user)){ + if(!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) ){ + queryParam.setUserId(user.getUserName()); + } + } + queryParam.setCode(code); + return Result.success(informMessageMapper.getMessageWorkReportList(queryParam)); + } + + @GetMapping("/upMessageWork/{id}") + public Result upMessageWork(@PathVariable("id") String id){ + informMessageMapper.update(new LambdaUpdateWrapper().set(InformMessage::getIsRead,"1").eq(InformMessage::getId,id)); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/exception/AuthException.java b/src/main/java/com/biutag/supervision/exception/AuthException.java new file mode 100644 index 0000000..ddb2a45 --- /dev/null +++ b/src/main/java/com/biutag/supervision/exception/AuthException.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.exception; + +public class AuthException extends RuntimeException { + + public AuthException() { + } + + public AuthException(String message) { + super(message); + } +} diff --git a/src/main/java/com/biutag/supervision/flow/action/Action.java b/src/main/java/com/biutag/supervision/flow/action/Action.java new file mode 100644 index 0000000..e5777e2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/Action.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.flow.action; + +import com.biutag.supervision.pojo.dto.ActionDto; + +public interface Action { + + void next(ActionDto actionDto); + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java new file mode 100644 index 0000000..16e453b --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java @@ -0,0 +1,116 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.FirstDistributeData; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.entity.negative.Negative; +import com.biutag.supervision.pojo.entity.negative.NegativeWork; +import com.biutag.supervision.service.Negative.NegativeService; +import com.biutag.supervision.service.Negative.NegativeWorkService; +import com.biutag.supervision.service.SupDepartService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import org.springframework.validation.annotation.Validated; + +import java.time.LocalDateTime; + +/** + * 市局下发 + */ +@Validated +@RequiredArgsConstructor +@Component +public class FirstDistributeAction implements Action { + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + private final SupDepartService departService; + + @Override + public void next(ActionDto actionDto) { + FirstDistributeData firstDistributeData = BeanUtil.toBean(actionDto.getData(), FirstDistributeData.class); + SupDepart depart = departService.getById(firstDistributeData.getDepartId()); + firstDistributeData.setDepartName(depart.getShortName()); + // 三级单位办理 + boolean thirdHandling = DepartLevelEnum.THREE.getValue().equals(depart.getLevel()); + updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), firstDistributeData, thirdHandling); + doneWork(actionDto.getWorkId()); + + addWork(actionDto.getNegativeId(), + thirdHandling ? RoleCodeEnum.THREE_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(), + firstDistributeData.getDepartId(), firstDistributeData.getDepartName()); + } + + public void updateNegative(String negativeId, String nextFlowKey, @Validated FirstDistributeData distributeData, boolean thirdHandling) { + LocalDateTime now = LocalDateTime.now(); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() + .set(Negative::getHostLevel, distributeData.getHostLevel()) + .set(Negative::getTimeLimit, distributeData.getTimeLimit()) + .set(Negative::getApprovalFlow, distributeData.getApprovalFlow()) + // 当前处理对象 + .set(Negative::getCurrentProcessingObject, String.format("%s专班", distributeData.getDepartName())) + .set(Negative::getFirstDistributeTime, now) + .set(Negative::getUpdTime, now) + // 市局下发意见 + .set(Negative::getFirstDistributeComments, distributeData.getFirstDistributeComments()) + .eq(Negative::getId, negativeId); + if (TimeLimitEnum.OTHER.getValue().equals(distributeData.getTimeLimit())) { + updateWrapper.set(Negative::getMaxSignDuration, distributeData.getMaxSignDuration()) + .set(Negative::getMaxHandleDuration, distributeData.getMaxHandleDuration()) + .set(Negative::getMaxExtensionDuration, distributeData.getMaxExtensionDuration()); + } else { + if (StrUtil.isNotBlank(distributeData.getTimeLimit())) { + TimeLimitEnum timeLimitEnum = TimeLimitEnum.get(distributeData.getTimeLimit()); + updateWrapper.set(Negative::getMaxSignDuration, timeLimitEnum.getMaxSignDuration()) + .set(Negative::getMaxHandleDuration, timeLimitEnum.getMaxHandleDuration()) + .set(Negative::getMaxExtensionDuration, timeLimitEnum.getMaxExtensionDuration()); + } + } + if (thirdHandling) { + SupDepart parentDepart = departService.getParentDepart(distributeData.getDepartId()); + updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.THREE_SIGN.getKey()) + .set(Negative::getHandleSecondDepartId, parentDepart.getId()) + .set(Negative::getHandleSecondDepartName, parentDepart.getShortName()) + .set(Negative::getHandleThreeDepartId, distributeData.getDepartId()) + .set(Negative::getHandleThreeDepartName, distributeData.getDepartName()); + } else { + updateWrapper.set(Negative::getFlowKey, nextFlowKey) + .set(Negative::getHandleSecondDepartId, distributeData.getDepartId()) + .set(Negative::getHandleSecondDepartName, distributeData.getDepartName()); + } + negativeService.update(updateWrapper); + } + + public void doneWork(Integer workId) { + workService.update(new LambdaUpdateWrapper() + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) + .set(NegativeWork::getUpdateTime, LocalDateTime.now()) + .eq(NegativeWork::getId, workId)); + } + + public void addWork(String negativeId, String roleCode, String departId, String departName) { + workService.remove(new LambdaQueryWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getRoleCode, roleCode) + .eq(NegativeWork::getDepartId, departId)); + Negative negative = negativeService.getById(negativeId); + NegativeWork work = new NegativeWork() + .setNegativeId(negativeId) + .setRoleCode(roleCode) + .setDepartId(departId) + .setDepartName(departName) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setCreateTime(LocalDateTime.now()) + .setUpdateTime(LocalDateTime.now()) + .setStatus(WorkStatusEnum.todo.name()); + workService.save(work); + } + +} diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java new file mode 100644 index 0000000..01fda44 --- /dev/null +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -0,0 +1,41 @@ +package com.biutag.supervision.job; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.stream.CollectorUtil; +import cn.hutool.core.util.*; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.ComfortStatus; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.constants.enums.RpcApplyTypeEnum; +import com.biutag.supervision.mapper.*; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.service.*; +import com.biutag.supervision.util.CommonUtil; +import com.biutag.supervision.util.TimeUtil; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +import static com.biutag.supervision.util.TimeUtil.SECONDS_OF_A_DAY; + +@Slf4j +@RequiredArgsConstructor +@Component +public class Job { + + +} diff --git a/src/main/java/com/biutag/supervision/mapper/BaseAccountMapper.java b/src/main/java/com/biutag/supervision/mapper/BaseAccountMapper.java new file mode 100644 index 0000000..8867672 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BaseAccountMapper.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BaseAccount; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +@DS("slave") +public interface BaseAccountMapper extends BaseMapper { + + @Select("select a.* from base_account a left join negative.sup_police p on a.account = p.id_code and p.del = 0 where a.account = #{account} or p.emp_no = #{account}") + List selectByLogin(String account); + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/BaseRoleMapper.java b/src/main/java/com/biutag/supervision/mapper/BaseRoleMapper.java new file mode 100644 index 0000000..b78103b --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BaseRoleMapper.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BaseRole; +import org.apache.ibatis.annotations.Mapper; + +@DS("master") + +public interface BaseRoleMapper extends BaseMapper { + +} diff --git a/src/main/java/com/biutag/supervision/mapper/BaseRoleUserMapper.java b/src/main/java/com/biutag/supervision/mapper/BaseRoleUserMapper.java new file mode 100644 index 0000000..705d457 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BaseRoleUserMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BaseRoleUser; + +@DS("master") +public interface BaseRoleUserMapper extends BaseMapper { + +} diff --git a/src/main/java/com/biutag/supervision/mapper/BaseUserMapper.java b/src/main/java/com/biutag/supervision/mapper/BaseUserMapper.java new file mode 100644 index 0000000..d10cc13 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BaseUserMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BaseUser; + +@DS("slave") +public interface BaseUserMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/CommonOpinionsMapper.java b/src/main/java/com/biutag/supervision/mapper/CommonOpinionsMapper.java new file mode 100644 index 0000000..67c5f28 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/CommonOpinionsMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.CommonOpinions; + +public interface CommonOpinionsMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/FeedbackMapper.java b/src/main/java/com/biutag/supervision/mapper/FeedbackMapper.java new file mode 100644 index 0000000..eea17b8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/FeedbackMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.Feedback; + +public interface FeedbackMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/FileBase64Mapper.java b/src/main/java/com/biutag/supervision/mapper/FileBase64Mapper.java new file mode 100644 index 0000000..cf54ea0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/FileBase64Mapper.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.FileBase64; + +/** + * @author wxc + * @date 2025/7/23 + */ +public interface FileBase64Mapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/FileClassMapper.java b/src/main/java/com/biutag/supervision/mapper/FileClassMapper.java new file mode 100644 index 0000000..0baeecf --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/FileClassMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.FileClass; + +public interface FileClassMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/GBaseAJJBXXMapper.java b/src/main/java/com/biutag/supervision/mapper/GBaseAJJBXXMapper.java new file mode 100644 index 0000000..fa6a29f --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/GBaseAJJBXXMapper.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.GBaseAJJBXX; +import org.apache.ibatis.annotations.Mapper; + +@DS("slave2") +@Mapper +public interface GBaseAJJBXXMapper extends BaseMapper { + +} diff --git a/src/main/java/com/biutag/supervision/mapper/GBaseCJDMapper.java b/src/main/java/com/biutag/supervision/mapper/GBaseCJDMapper.java new file mode 100644 index 0000000..515bc29 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/GBaseCJDMapper.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.biutag.supervision.pojo.entity.GBaseCJD; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@DS("slave2") +@Mapper +public interface GBaseCJDMapper extends BaseMapper { + List selectCJDList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); +} diff --git a/src/main/java/com/biutag/supervision/mapper/GBaseJJDMapper.java b/src/main/java/com/biutag/supervision/mapper/GBaseJJDMapper.java new file mode 100644 index 0000000..5eed9dd --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/GBaseJJDMapper.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.biutag.supervision.pojo.entity.GBaseJJD; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@DS("slave2") +@Mapper +public interface GBaseJJDMapper extends BaseMapper { + List selectJJDList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); +} diff --git a/src/main/java/com/biutag/supervision/mapper/HolidayMapper.java b/src/main/java/com/biutag/supervision/mapper/HolidayMapper.java new file mode 100644 index 0000000..e785112 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/HolidayMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.Holiday; + +public interface HolidayMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/InformMessageMapper.java b/src/main/java/com/biutag/supervision/mapper/InformMessageMapper.java new file mode 100644 index 0000000..7e0ed8e --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/InformMessageMapper.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.InformMessage; +import com.biutag.supervision.pojo.param.Work.ProjectWorkQueryParam; +import com.biutag.supervision.pojo.vo.work.MessageWorkVo; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + + +public interface InformMessageMapper extends BaseMapper { + + List getMessageWorkReportList(ProjectWorkQueryParam queryParam); + + +} diff --git a/src/main/java/com/biutag/supervision/mapper/Invest/InvertRecordMapper.java b/src/main/java/com/biutag/supervision/mapper/Invest/InvertRecordMapper.java new file mode 100644 index 0000000..abe06e6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Invest/InvertRecordMapper.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.mapper.Invest; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.InvertRecord; +import com.biutag.supervision.pojo.entity.price.PriceInformation; +import com.biutag.supervision.pojo.param.InvertRecord.InvertRecordQueryParam; +import com.biutag.supervision.pojo.vo.InvertRecord.InvertRecordVo; +import com.biutag.supervision.pojo.vo.price.PriceInformationVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface InvertRecordMapper extends BaseMapper { + + Page page(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); +} diff --git a/src/main/java/com/biutag/supervision/mapper/MenuMapper.java b/src/main/java/com/biutag/supervision/mapper/MenuMapper.java new file mode 100644 index 0000000..2593206 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/MenuMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.Menu; + + +public interface MenuMapper extends BaseMapper { + +} diff --git a/src/main/java/com/biutag/supervision/mapper/ModelClueDataDMMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelClueDataDMMapper.java new file mode 100644 index 0000000..7b62178 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelClueDataDMMapper.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.ModelClue; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +@DS("slave3") // 该注解勿动 +public interface ModelClueDataDMMapper extends BaseMapper { + + @Select("${sql}") + List selectDataByDynamicSql(@org.apache.ibatis.annotations.Param("sql") String sql); + + @Select("${newSql}") + List> selectByUniqueKeys(@org.apache.ibatis.annotations.Param("newSql") String newSql); + +} diff --git a/src/main/java/com/biutag/supervision/mapper/ModelClueDataMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelClueDataMapper.java new file mode 100644 index 0000000..3d1c1a1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelClueDataMapper.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.ModelClue; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +@DS("slave2") // 该注解勿动 +public interface ModelClueDataMapper extends BaseMapper { + + @Select("${sql}") + List selectDataByDynamicSql(@org.apache.ibatis.annotations.Param("sql") String sql); + + @Select("${newSql}") + List> selectByUniqueKeys(@org.apache.ibatis.annotations.Param("newSql") String newSql); + + @Select("SELECT XM, JH FROM dwd_ry_zfba_baryxx WHERE ZJ = #{barID}") + Map selectBAR(String barID); + +} diff --git a/src/main/java/com/biutag/supervision/mapper/ModelClueMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelClueMapper.java new file mode 100644 index 0000000..c9aded1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelClueMapper.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.ModelClue; +import com.biutag.supervision.pojo.model.ModelClueModel; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +public interface ModelClueMapper extends BaseMapper { + + Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + @Select("${newSql}") + List> selectByUniqueKeys(@Param("newSql") String newSql); + + + List selectByModelId(@Param("modelId") int modelId); + + int updateInvolveDepartId(@Param("id") int id, @Param("newDepartId") String newDepartId); +} diff --git a/src/main/java/com/biutag/supervision/mapper/ModelClueRecordMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelClueRecordMapper.java new file mode 100644 index 0000000..41c00b3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelClueRecordMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.ModelClueRecord; + +public interface ModelClueRecordMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/ModelClueTaskMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelClueTaskMapper.java new file mode 100644 index 0000000..1cd9ad9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ModelClueTaskMapper.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.ModelClueTask; +import com.biutag.supervision.pojo.model.ModelClueTaskDepartModel; +import com.biutag.supervision.pojo.model.ModelClueTaskModel; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface ModelClueTaskMapper extends BaseMapper { + + Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + + List selectGroupByDepart(@Param("taskId") Integer taskId); + +} diff --git a/src/main/java/com/biutag/supervision/mapper/NegDepartAuthorityMapper.java b/src/main/java/com/biutag/supervision/mapper/NegDepartAuthorityMapper.java new file mode 100644 index 0000000..f77f880 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegDepartAuthorityMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegDepartAuthority; + +public interface NegDepartAuthorityMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegSourceAuthorityMapper.java b/src/main/java/com/biutag/supervision/mapper/NegSourceAuthorityMapper.java new file mode 100644 index 0000000..d816996 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegSourceAuthorityMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegSourceAuthority; + +public interface NegSourceAuthorityMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/Negative/NegativeExtensionApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeExtensionApplyMapper.java new file mode 100644 index 0000000..7bb0c6b --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeExtensionApplyMapper.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.mapper.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.negative.NegativeExtensionApply; +import org.apache.ibatis.annotations.Mapper; + +@DS("szdczx") +@Mapper +public interface NegativeExtensionApplyMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/Negative/NegativeExtensionApproveMapper.java b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeExtensionApproveMapper.java new file mode 100644 index 0000000..c4595b3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeExtensionApproveMapper.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.mapper.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.negative.NegativeExtensionApprove; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +@DS("szdczx") +public interface NegativeExtensionApproveMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/Negative/NegativeHistoryMapper.java b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeHistoryMapper.java new file mode 100644 index 0000000..f8ccad6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeHistoryMapper.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.mapper.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.negative.NegativeHistory; +import org.apache.ibatis.annotations.Mapper; + + +@DS("szdczx") +public interface NegativeHistoryMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/Negative/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeMapper.java new file mode 100644 index 0000000..f1c388d --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeMapper.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.mapper.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.negative.Negative; +import org.apache.ibatis.annotations.Mapper; + + + +@DS("szdczx") +public interface NegativeMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/Negative/NegativeThingFileMapper.java b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeThingFileMapper.java new file mode 100644 index 0000000..e01f9a3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeThingFileMapper.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.mapper.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.negative.NegativeThingFile; + +@DS("szdczx") +public interface NegativeThingFileMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/Negative/NegativeWorkMapper.java b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeWorkMapper.java new file mode 100644 index 0000000..993007e --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Negative/NegativeWorkMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.negative.NegativeWork; +import org.apache.ibatis.annotations.Mapper; + +@DS("szdczx") +public interface NegativeWorkMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/PriceFileMapper.java b/src/main/java/com/biutag/supervision/mapper/PriceFileMapper.java new file mode 100644 index 0000000..1e16976 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/PriceFileMapper.java @@ -0,0 +1,7 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.price.PriceFile; + +public interface PriceFileMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/PriceInformationMapper.java b/src/main/java/com/biutag/supervision/mapper/PriceInformationMapper.java new file mode 100644 index 0000000..bf4fdd4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/PriceInformationMapper.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.price.PriceInformation; +import com.biutag.supervision.pojo.vo.price.PriceInformationVo; +import org.apache.ibatis.annotations.Param; + + +/** + * 价格信息库 + * + * @author weipeng*/ + +public interface PriceInformationMapper extends BaseMapper { + + Page page(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + +} diff --git a/src/main/java/com/biutag/supervision/mapper/Recessed/RecessedLogMapper.java b/src/main/java/com/biutag/supervision/mapper/Recessed/RecessedLogMapper.java new file mode 100644 index 0000000..aa4ec01 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Recessed/RecessedLogMapper.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.mapper.Recessed; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.recessed.RecessedLog; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface RecessedLogMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/Report/ReportFileMapper.java b/src/main/java/com/biutag/supervision/mapper/Report/ReportFileMapper.java new file mode 100644 index 0000000..780a103 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Report/ReportFileMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper.Report; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.report.ReportFile; + +/** + * 报审项目附件 + * */ +public interface ReportFileMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/Report/ReportFlowMapper.java b/src/main/java/com/biutag/supervision/mapper/Report/ReportFlowMapper.java new file mode 100644 index 0000000..2f72f2b --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Report/ReportFlowMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper.Report; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.report.ReportFlow; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ReportFlowMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/Report/ReportProjectMapper.java b/src/main/java/com/biutag/supervision/mapper/Report/ReportProjectMapper.java new file mode 100644 index 0000000..f8fd2a1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Report/ReportProjectMapper.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.mapper.Report; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.model.DataMigrationModel; +import com.biutag.supervision.pojo.param.Work.ProjectWorkQueryParam; +import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; +import com.biutag.supervision.pojo.vo.statement.ConditionVo; +import com.biutag.supervision.pojo.vo.work.ProjectTabWorkVo; +import com.biutag.supervision.pojo.vo.work.ProjectWorkVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +//报审项目Mapper +public interface ReportProjectMapper extends BaseMapper { + + Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + Page queryPageWarning(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper,String warningState); + + + Page queryPageCondition(@Param("page") Page page,@Param(Constants.WRAPPER)QueryWrapper queryWrapper); + + List getProjectWorkVoList(ProjectWorkQueryParam queryParam); + + ProjectTabWorkVo getProjectTabWorkVo(ProjectWorkQueryParam queryParam); +} diff --git a/src/main/java/com/biutag/supervision/mapper/Report/ReportReviewMapper.java b/src/main/java/com/biutag/supervision/mapper/Report/ReportReviewMapper.java new file mode 100644 index 0000000..a1fb6f1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Report/ReportReviewMapper.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.mapper.Report; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.report.ReportReview; +import lombok.RequiredArgsConstructor; + +//报审内容Mapper +public interface ReportReviewMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/RoleMenuMapper.java b/src/main/java/com/biutag/supervision/mapper/RoleMenuMapper.java new file mode 100644 index 0000000..7938dc3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/RoleMenuMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.RoleMenu; + + +public interface RoleMenuMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java new file mode 100644 index 0000000..ee1826c --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDepartMapper.java @@ -0,0 +1,66 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.dto.LevelAndPid; +import com.biutag.supervision.pojo.entity.SupDepart; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +@DS("szdczx") +public interface SupDepartMapper extends BaseMapper { + + @Select("select d.* from sup_depart d left join sup_depart_jwpy t on d.code = t.depart_code where t.code = #{departCode}") + SupDepart selectByJwpyCode(String departCode); + + @Select("SELECT * from sup_depart where statistics_group_id=3 OR pid =13490 order by order_no") + List selectNursingOrg(); + + @Select("select max(id) from sup_depart") + Integer getMaxId(); + + @Select("") + List> getIdsByDepartIds(List departIds); + + @Select("") + List> getIdsByCode(List departIds); + + + /** + * 按分组查询单位 + * @param groupType + * @return + */ + @Select("select * from sup_depart where statistics_group_id = #{groupType} ") + List selectDepartsByGroupType(Integer groupType); + + /** + * 按pid查询派出所还有它的街道 在街道表里面找的 + * @param departId 所属的单位 Pid + * @return + */ + @Select("SELECT " + + "dept_id AS id, " + + "name AS shortName " + + "FROM county_street_dept WHERE dept_pid=#{departId}") + List selectPoliceDeparts(Integer departId); + + + @Select("SELECT id, `level`, pid " + + "FROM `sup_depart`" + + "WHERE `level`>3 ") + List selectLevelAndPid(); + +} diff --git a/src/main/java/com/biutag/supervision/mapper/SupDepartPoliceSizeMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDepartPoliceSizeMapper.java new file mode 100644 index 0000000..db8f37b --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDepartPoliceSizeMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDepartPoliceSize; + +@DS("szdczx") +public interface SupDepartPoliceSizeMapper extends BaseMapper { + +} diff --git a/src/main/java/com/biutag/supervision/mapper/SupDict12337HandleResultMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDict12337HandleResultMapper.java new file mode 100644 index 0000000..fa29e5a --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDict12337HandleResultMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDict12337HandleResult; + +public interface SupDict12337HandleResultMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictDataMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictDataMapper.java new file mode 100644 index 0000000..c0af7b1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictDataMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictData; + +public interface SupDictDataMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictDataTwoMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictDataTwoMapper.java new file mode 100644 index 0000000..6217ede --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictDataTwoMapper.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictDataTwo; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SupDictDataTwoMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictHandleResultMapingMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictHandleResultMapingMapper.java new file mode 100644 index 0000000..d7b90a4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictHandleResultMapingMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictHandleResultMaping; + +public interface SupDictHandleResultMapingMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictProblemSourceMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictProblemSourceMapper.java new file mode 100644 index 0000000..835c3ca --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictProblemSourceMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictProblemSource; + +public interface SupDictProblemSourceMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictProblemTypeMapingMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictProblemTypeMapingMapper.java new file mode 100644 index 0000000..70775a2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictProblemTypeMapingMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictProblemTypeMaping; + +public interface SupDictProblemTypeMapingMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictProblemTypeMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictProblemTypeMapper.java new file mode 100644 index 0000000..6df1162 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictProblemTypeMapper.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictProblemType; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +public interface SupDictProblemTypeMapper extends BaseMapper { + + @Select("select max(pt.score) from negative_problem_relation r left join sup_dict_problem_type pt on r.threeLevelCode = pt.code " + + "where r.negativeId = #{negativeId} and r.blameId = #{blameId}") + Double selectMaxScore(String negativeId, String blameId); + + SupDictProblemType selectOneByMaxScore(List codes); + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictTypeMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictTypeMapper.java new file mode 100644 index 0000000..189ee81 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictTypeMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictType; + +public interface SupDictTypeMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java new file mode 100644 index 0000000..da8c337 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupExternalDepart; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +/** + * 外部单位表 + */ +@DS("szdczx") +public interface SupExternalDepartMapper extends BaseMapper { + + @Select("") + List> getIdsByDepartIds(List departIds); + + @Select("select level from sup_external_depart where internal_id = #{internalDepartId}") + SupExternalDepart selectLevelByDepartId(String internalDepartId); + + /** + * 根据内部单位ID和源头获取外部单位ID + * @param departId + * @param source + * @return + */ + @Select("SELECT external_id FROM sup_external_depart sed WHERE sed.source=#{source} AND sed.internal_id =#{departId}") + String getExIdByInId(String departId, String source); +} diff --git a/src/main/java/com/biutag/supervision/mapper/SupPhotoMapper.java b/src/main/java/com/biutag/supervision/mapper/SupPhotoMapper.java new file mode 100644 index 0000000..09e7fb9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupPhotoMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupPhoto; + +public interface SupPhotoMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java b/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java new file mode 100644 index 0000000..5f965c9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.SupPolice; +import com.biutag.supervision.pojo.model.PoliceModel; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + +@DS("szdczx") +public interface SupPoliceMapper extends BaseMapper { + + Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + + + @Select("select id_code from sup_police_avatar where img = #{img}") + String getIdCodeByPoliceAvatar(String img); + +} diff --git a/src/main/java/com/biutag/supervision/mapper/UserMapper.java b/src/main/java/com/biutag/supervision/mapper/UserMapper.java new file mode 100644 index 0000000..bef8c27 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/UserMapper.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.User; + + +public interface UserMapper extends BaseMapper { + +} diff --git a/src/main/java/com/biutag/supervision/mapper/Warning/WarningContentMapper.java b/src/main/java/com/biutag/supervision/mapper/Warning/WarningContentMapper.java new file mode 100644 index 0000000..156fa91 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Warning/WarningContentMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper.Warning; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.warning.WarningContent; +import lombok.Data; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface WarningContentMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/mapper/Warning/WarningRecordMapper.java b/src/main/java/com/biutag/supervision/mapper/Warning/WarningRecordMapper.java new file mode 100644 index 0000000..42cf814 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/Warning/WarningRecordMapper.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.mapper.Warning; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.warning.WarningRecord; +import com.biutag.supervision.pojo.vo.warning.WarningInformData; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface WarningRecordMapper extends BaseMapper { + + WarningRecord selectDataByDistinct(String id); + + List selectDataByAudit(String id); + + List getWarningInformData(String id); +} diff --git a/src/main/java/com/biutag/supervision/mapper/WvpDeviceChannelMapper.java b/src/main/java/com/biutag/supervision/mapper/WvpDeviceChannelMapper.java new file mode 100644 index 0000000..c2e5d97 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/WvpDeviceChannelMapper.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.WvpDeviceChannel; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +@DS("wvp") +public interface WvpDeviceChannelMapper extends BaseMapper { + @Select("SELECT status " + + "FROM wvp_device_channel " + + "WHERE parental = 0;") + List getVideoStatus(); +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/ZhkshDutyScheduleDcMapper.java b/src/main/java/com/biutag/supervision/mapper/ZhkshDutyScheduleDcMapper.java new file mode 100644 index 0000000..16f473a --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ZhkshDutyScheduleDcMapper.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.ZhkshDutyScheduleDc; +import org.apache.ibatis.annotations.Select; + +import java.time.LocalDate; +import java.util.List; + +@DS("zbdm") +public interface ZhkshDutyScheduleDcMapper extends BaseMapper { + @Select(" SELECT * FROM V_ZHKSH_DUTY_SCHEDULE_DC " + + " where start_time between #{startTime} and #{endTime} " + + " and PARENT_POST_CODE = 'ZB' ") + List selectList(LocalDate startTime,LocalDate endTime); +} diff --git a/src/main/java/com/biutag/supervision/mapper/serviceUnit/ServiceUnitMapper.java b/src/main/java/com/biutag/supervision/mapper/serviceUnit/ServiceUnitMapper.java new file mode 100644 index 0000000..2abeaf2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/serviceUnit/ServiceUnitMapper.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.mapper.serviceUnit; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.serviceUnit.ServiceUnit; +import com.biutag.supervision.pojo.vo.ServiceUnit.ServiceUnitVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface ServiceUnitMapper extends BaseMapper { + + Page page(@Param("page") Page page,@Param(Constants.WRAPPER) QueryWrapper queryWrapper); +} diff --git a/src/main/java/com/biutag/supervision/pojo/Result.java b/src/main/java/com/biutag/supervision/pojo/Result.java new file mode 100644 index 0000000..8606a18 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/Result.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.pojo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; +import org.springframework.http.HttpStatus; + +import java.io.Serializable; + +@Accessors(chain = true) +@Setter +@Getter +public class Result implements Serializable { + + @Schema(description = "状态码") + private int code; + + @Schema(description = "消息") + private String message; + + @Schema(description = "数据") + private T data; + + public Result(int code) { + this.code = code; + } + + public Result(int code, String message) { + this.code = code; + this.message = message; + } + + public static Result success() { + return new Result<>(HttpStatus.OK.value()); + } + + public static Result success(T data) { + return new Result(HttpStatus.OK.value()).setData(data); + } + + public static Result failed(String message) { + return new Result<>(HttpStatus.INTERNAL_SERVER_ERROR.value(), message); + } + + public static Result failed(int code, String message) { + return new Result<>(code, message); + } + +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/AppUser.java b/src/main/java/com/biutag/supervision/pojo/domain/AppUser.java new file mode 100644 index 0000000..b405b73 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/AppUser.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.pojo.domain; + +import com.biutag.supervision.pojo.model.UserAuth; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2025/4/11 + */ +@AllArgsConstructor +@Setter +@Getter +public class AppUser { + + private String token; + + private UserAuth user; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java b/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java new file mode 100644 index 0000000..0bbff59 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.pojo.domain; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.util.List; + +@Accessors(chain = true) +@Setter +@Getter +public class PoliceAuth { + + private List roleIds; + + private List departs; + + private List sources; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/Self.java b/src/main/java/com/biutag/supervision/pojo/domain/Self.java new file mode 100644 index 0000000..f8b605f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/Self.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.pojo.domain; + +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.vo.MenuTree; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.util.List; + +@Accessors(chain = true) +@Setter +@Getter +public class Self { + + private UserAuth user; + + private List menus; + + private List perms; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/AccountDto.java b/src/main/java/com/biutag/supervision/pojo/dto/AccountDto.java new file mode 100644 index 0000000..c61f4a9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/AccountDto.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.pojo.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class AccountDto { + + @Schema(description = "用户名") + @NotBlank(message = "请您输入用户名") + private String account; + + @Schema(description = "密码") + @NotBlank(message = "请您输入密码") + private String password; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/ActionDto.java b/src/main/java/com/biutag/supervision/pojo/dto/ActionDto.java new file mode 100644 index 0000000..938e2da --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/ActionDto.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Accessors(chain = true) +@Setter +@Getter +public class ActionDto { + + private String negativeId; + + private Integer workId; + + private String actionKey; + + private String nextFlowKey; + + private String actionName; + + private Object data; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DictDataDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DictDataDto.java new file mode 100644 index 0000000..1983ba3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DictDataDto.java @@ -0,0 +1,41 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DictDataDto { + + private Long dictCode; + + // 字典标签 + private String dictLabel; + + // 字典键值 + private String dictValue; + + // 字典类型 + private String dictType; + + // 样式属性(其他样式扩展) + private String cssClass; + + // 表格回显样式 + private String listClass; + + // 是否默认(1是 0否) + private String isDefault; + + + // 字典排序 + private Integer dictSort; + + // 状态(0正常 1停用) + private String status; + + + // 备注 + private String remark; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DictTypeDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DictTypeDto.java new file mode 100644 index 0000000..2769b05 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/DictTypeDto.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DictTypeDto { + + private Long dictId; + + // 字典名称 + private String dictName; + + // 字典类型 + private String dictType; + + // 状态(0正常 1停用) + private String status; + + private String remark; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/FileBase64Dto.java b/src/main/java/com/biutag/supervision/pojo/dto/FileBase64Dto.java new file mode 100644 index 0000000..9a53df8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/FileBase64Dto.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2025/4/15 + */ +@Setter +@Getter +public class FileBase64Dto { + + private String originalFilename; + + private String base64; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/LevelAndPid.java b/src/main/java/com/biutag/supervision/pojo/dto/LevelAndPid.java new file mode 100644 index 0000000..4cb4f29 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/LevelAndPid.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther: sh + * @Date: 2024/12/31 11:17 + * @Description: + */ +@Data +public class LevelAndPid implements Serializable { + private String id; + private long level; + private String pid; +} + diff --git a/src/main/java/com/biutag/supervision/pojo/dto/MenuDto.java b/src/main/java/com/biutag/supervision/pojo/dto/MenuDto.java new file mode 100644 index 0000000..af87396 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/MenuDto.java @@ -0,0 +1,41 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class MenuDto { + + private Integer id; + + private Integer pid; + + // 菜单类型 + private String menuType; + + // 菜单名称 + private String menuName; + + // 菜单图标 + private String icon; + + // 路径 + private String paths; + + private String component; + + // 排序 + private Integer menuSort; + + private String perms; + + private Integer isCache; + + private Integer isShow; + + private Integer isDisable; + + // 是否打开新页面 默认为false + private Boolean openNewPage; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/PoliceDto.java b/src/main/java/com/biutag/supervision/pojo/dto/PoliceDto.java new file mode 100644 index 0000000..51ebc85 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/PoliceDto.java @@ -0,0 +1,53 @@ +package com.biutag.supervision.pojo.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDate; + +/** + * @author wxc + * @date 2025/2/20 + */ +@Setter +@Getter +public class PoliceDto { + + // 姓名 + @NotBlank(message = "姓名不能为空") + private String name; + + @NotBlank(message = "警号不能为空") + private String empNo; + + // 身份证 + @NotBlank(message = "身份证不能为空") + private String idCode; + + // 组织机构id + @NotBlank(message = "所属单位不能为空") + private String orgId; + + // 手机号 + private String mobile; + + // 人员属性 + private String personType; + + // 职位 正职 副职 + private String position; + + // 业务条线 + private String policeRole; + + // 入职日期 + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd") + private LocalDate employmentDate; + + private Boolean createUserFlag = false; + + private String password; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/dto/PoliceImport.java b/src/main/java/com/biutag/supervision/pojo/dto/PoliceImport.java new file mode 100644 index 0000000..f19c0b3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/PoliceImport.java @@ -0,0 +1,39 @@ +package com.biutag.supervision.pojo.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/10/30 + */ +@Setter +@Getter +public class PoliceImport { + + @NotBlank(message = "姓名为空") + @ExcelProperty("姓名") + private String name; + + @NotBlank(message = "警号为空") + @ExcelProperty("警号") + private String empNo; + + @NotBlank(message = "身份证为空") + @ExcelProperty("身份证") + private String idCode; + + @NotBlank(message = "二级单位为空") + @ExcelProperty("二级单位") + private String secondDepartName; + + @ExcelProperty("三级单位") + private String thirdDepartName; + + @NotBlank(message = "角色为空") + @ExcelProperty("角色") + private String role; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/UserDto.java b/src/main/java/com/biutag/supervision/pojo/dto/UserDto.java new file mode 100644 index 0000000..d2855de --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/UserDto.java @@ -0,0 +1,39 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Setter +@Getter +public class UserDto { + + private String userId; + + // 登陆账号 + private String userName; + + // 昵称 + private String nickName; + + // 邮箱 + private String email; + + // 手机号 + private String mobile; + + // 用户类型:super-超级管理员 normal-普通管理员 + private String userType; + + // 描述 + private String userDesc; + + // 状态:0-禁用 1-正常 2-锁定 + private Integer status; + + private List roleIds; + + private String password; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/UserPasswordDto.java b/src/main/java/com/biutag/supervision/pojo/dto/UserPasswordDto.java new file mode 100644 index 0000000..2b5232d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/UserPasswordDto.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class UserPasswordDto { + + private String account; + + private String password; + + private String newPassword; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/common/BarItem.java b/src/main/java/com/biutag/supervision/pojo/dto/common/BarItem.java new file mode 100644 index 0000000..186bc2e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/common/BarItem.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.pojo.dto.common; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +import java.math.BigDecimal; + +/** + * @author wxc + * @date 2024/10/29 + */ +@Setter +@Getter +@AllArgsConstructor +public class BarItem { + + private String label; + private BigDecimal value; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/common/PieItem.java b/src/main/java/com/biutag/supervision/pojo/dto/common/PieItem.java new file mode 100644 index 0000000..0960e65 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/common/PieItem.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.dto.common; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/10/29 + */ +@Setter +@Getter +@AllArgsConstructor +public class PieItem { + + private String name; + private Integer value; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/ApplyCountersignData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/ApplyCountersignData.java new file mode 100644 index 0000000..0ee1fdf --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/ApplyCountersignData.java @@ -0,0 +1,30 @@ +package com.biutag.supervision.pojo.dto.flow; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2024/11/26 + */ +@Setter +@Getter +public class ApplyCountersignData { + + @NotBlank(message = "会签具体要求不能为空") + private String requirement; + + @Size(min = 1, message = "参与会签单位不能少于1个") + private List countersignDeparts = new ArrayList<>(); + + @Setter + @Getter + public class CountersignDepart { + private String id; + } +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/ApproveData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/ApproveData.java new file mode 100644 index 0000000..8895de5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/ApproveData.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.pojo.dto.flow; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class ApproveData { + + private String comments; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/ConfirmationCompletionData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/ConfirmationCompletionData.java new file mode 100644 index 0000000..1c96ff8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/ConfirmationCompletionData.java @@ -0,0 +1,47 @@ +package com.biutag.supervision.pojo.dto.flow; + +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2024/11/8 + */ +@Setter +@Getter +public class ConfirmationCompletionData { + + // 核查办理情况 + private String verifySituation; + + // 佐证材料情况 + private String verifyFileSituation; + + // 认定办结意见 + private String completionComment; + + //督察报告名称 + private String reportNumber; + //督察报告Id + private String reportId; + + private List blames = new ArrayList<>(); + + @Setter + @Getter + public static class Blame { + + private String blameIdCode; + // 严重等级 + private String negativeLevel; + + private Double baseScore = 0.0; + + private Double frequencyScore = 0.0; + + } + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/CountersignData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/CountersignData.java new file mode 100644 index 0000000..818a9c0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/CountersignData.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.dto.flow; + +import com.biutag.supervision.pojo.vo.FileVo; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +/** + * @author wxc + * @date 2024/11/26 + */ +@Setter +@Getter +public class CountersignData { + + @NotBlank(message = "会签具体要求不能为空") + private String comments; + + private List files; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/ExtensionApplyData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/ExtensionApplyData.java new file mode 100644 index 0000000..18a167d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/ExtensionApplyData.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.pojo.dto.flow; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class ExtensionApplyData { + + // 延期天数 + private Integer extensionDays; + + // 延期理由 + private String comments; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java new file mode 100644 index 0000000..efac917 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java @@ -0,0 +1,39 @@ +package com.biutag.supervision.pojo.dto.flow; + +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class FirstDistributeData { + + @NotBlank + private String hostLevel; + + // 办理时限 + @NotBlank + private String timeLimit; + + // 审批流程 + @NotBlank + private String approvalFlow; + + @NotBlank + private String departId; + + private String departName; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 市局下发意见 + private String firstDistributeComments; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/SecondDistributeData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/SecondDistributeData.java new file mode 100644 index 0000000..553b6dc --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/SecondDistributeData.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.pojo.dto.flow; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class SecondDistributeData { + + private String departId; + + private String departName; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/SignReturnData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/SignReturnData.java new file mode 100644 index 0000000..1adc1be --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/SignReturnData.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.pojo.dto.flow; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class SignReturnData { + + private String comments; +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java new file mode 100644 index 0000000..4742f9c --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java @@ -0,0 +1,272 @@ +package com.biutag.supervision.pojo.dto.flow; + +import com.biutag.supervision.pojo.vo.FileVo; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class VerifyData { + + // 核查情况 + @NotBlank + private String checkStatus; + + // 核查情况 + @NotBlank + private String checkStatusName; + + // 是否整改 + @NotBlank + private String isRectifyCode; + + // 是否整改 + @NotBlank + private String isRectifyName; + + // 问题核查情况 + @NotBlank + private String checkStatusDesc; + + // 整改限制天数 + private Integer rectifyRestrictionDays; + + // 追责对象 + @NotBlank + private String accountabilityTarget; + + // 涉及案件/警情编号 + private String caseNumber; + + // 涉及单位 + private String involveDepartId; + + // 问题整改情况 + private String rectifyDesc; + + // 未整改原因 + private String unrectifyReason; + + // 核查时间 + private LocalDateTime verificationTime; + + @Size(min = 1) + private List blames = new ArrayList<>(); + + private List blameLeaders = new ArrayList<>(); + + private List files = new ArrayList<>(); + + // 经办人 + private List handlePolices; + + // 化解情况 + private String resolveSituation; + + // 当前状态 + private String resolveStatus; + + // 接访领导 + private String visitingLeaderName; + + private String visitingLeaderEmpNo; + + @Setter + @Getter + public static class Blame { + + // 涉及姓名 + @NotBlank + private String blameName; + + // 涉及身份证 + @NotBlank + private String blameIdCode; + + // 涉及警号 + @NotBlank + private String blameEmpNo; + + // 警种 + @NotBlank + private String policeTypeName; + + // 警种 + @NotBlank + private String policeTypeCode; + + @NotBlank + private String ivPersonType; + + // 人员属性 + @NotBlank + private String ivPersonTypeCode; + + // 核查情况code + @NotBlank + private String inspectCaseCode; + + // 核查情况 + @NotBlank + private String inspectCaseName; + + + // 督察措施 + @NotBlank + private String superviseMeasuresCode; + + // 督察措施 + @NotBlank + private String superviseMeasuresName; + + //涉及禁闭id + private String confinementId; + + + // 主观方面 + @NotBlank + private String subjectiveAspectCode; + + // 主观方面 + @NotBlank + private String subjectiveAspectName; + + // 责任类别 + @NotBlank + private String responsibilityTypeCode; + + // 责任类别 + @NotBlank + private String responsibilityTypeName; + + // 处理结果 + @NotBlank + private List handleResultCode; + + // 处理结果 + @NotBlank + private String handleResultName; + + // 其他处理结果 + private String handleResultNameOther; + + // 维权容错 + @NotBlank + private String protectRightsCode; + + // 维权容错 + @NotBlank + private String protectRightsName; + + // 问题类型 + private List problems; + + private String type; + + + + } + + @Setter + @Getter + public static class BlameLeader { + + private List blameIdCodes = new ArrayList<>(); + + // 责任领导 + @NotBlank + private String leadName; + + // 责任领导警号 + @NotBlank + private String leadEmpNo; + + // 责任领导身份证 + @NotBlank + private String leadIdCode; + + //领导禁闭id + private String leadConfinementId; + + // 三级机构 + @NotBlank + private String leadThreeDepartName; + + // 领导督察措施 + @NotBlank + private String leadMeasuresName; + + // 领导督察措施 + @NotBlank + private String leadMeasuresCode; + + // 领导责任类别 + @NotBlank + private String leadResponsibilityTypeName; + + // 领导责任类别 + @NotBlank + private String leadResponsibilityTypeCode; + + // 领导处理结果 + @NotBlank + private List leadHandleResultCode; + + // 领导处理结果 + @NotBlank + private String leadHandleResultName; + + // 领导处理结果 + private String leadHandleResultNameOther; + + // 领导维权容错 + @NotBlank + private String leadProtectRightsName; + + // 领导维权容错 + @NotBlank + private String leadProtectRightsCode; + + } + + @Setter + @Getter + public static class Problem { + + @NotBlank + private String oneLevelCode; + + @NotBlank + private String twoLevelCode; + + @NotBlank + private String oneLevelContent; + + @NotBlank + private String twoLevelContent; + + @NotBlank + private String threeLevelCode; + + @NotBlank + private String threeLevelContent; + + private String threeLevelContentOther; + + } + + @Setter + @Getter + public static class HandlePolice { + private String name; + private String idCode; + private String mobile; + } + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BaseAccount.java b/src/main/java/com/biutag/supervision/pojo/entity/BaseAccount.java new file mode 100644 index 0000000..33b7e0e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BaseAccount.java @@ -0,0 +1,55 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@Setter +@Getter +public class BaseAccount implements Serializable { + + // + @TableId + private String accountId; + + // 用户Id + @TableField("user_id") + private String userId; + + // 标识:手机号、邮箱、 用户名、或第三方应用的唯一标识 + @TableField("account") + private String account; + + // 密码凭证:站内的保存密码、站外的不保存或保存token) + @TableField("password") + private String password; + + // 登录类型:password-密码、mobile-手机号、email-邮箱 + @TableField("account_type") + private String accountType; + + // 账户域:@admin.com,@developer.com + @TableField("domain") + private String domain; + + // 注册IP + @TableField("register_ip") + private String registerIp; + + // 注册时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 状态:0-禁用 1-启用 2-锁定 + @TableField("status") + private Integer status; + + // 更新时间 + @TableField("update_time") + private LocalDateTime updateTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BaseRole.java b/src/main/java/com/biutag/supervision/pojo/entity/BaseRole.java new file mode 100644 index 0000000..865d092 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BaseRole.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class BaseRole { + + // 角色ID + @TableId + private String roleId; + + // 角色编码 + @TableField("role_code") + private String roleCode; + + // 角色名称 + @TableField("role_name") + private String roleName; + + // 状态:0-无效 1-有效 + @TableField("status") + private String status; + + // 角色描述 + @TableField("role_desc") + private String roleDesc; + + @TableField("create_time") + private LocalDateTime createTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("update_time") + private LocalDateTime updateTime; + + // 保留数据0-否 1-是 不允许删除 + @TableField("is_persist") + private Integer isPersist; + + // 级别 1:市局管理员层级,2:二级管理员层级,3:三级管理员层级 + @TableField("level") + private Integer level; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BaseRoleUser.java b/src/main/java/com/biutag/supervision/pojo/entity/BaseRoleUser.java new file mode 100644 index 0000000..786b249 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BaseRoleUser.java @@ -0,0 +1,30 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class BaseRoleUser { + + // 用户ID + @TableField("user_id") + private String userId; + + // 角色ID + @TableField("role_id") + private String roleId; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 修改时间 + @TableField("update_time") + private LocalDateTime updateTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BaseUser.java b/src/main/java/com/biutag/supervision/pojo/entity/BaseUser.java new file mode 100644 index 0000000..02fee4f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BaseUser.java @@ -0,0 +1,62 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class BaseUser { + + // 用户ID + @TableId + private String userId; + + // 登陆账号 + @TableField("user_name") + private String userName; + + // 昵称 + @TableField("nick_name") + private String nickName; + + // 头像 + @TableField("avatar") + private String avatar; + + // 邮箱 + @TableField("email") + private String email; + + // 手机号 + @TableField("mobile") + private String mobile; + + // 用户类型:super-超级管理员 admin-普通管理员 + @TableField("user_type") + private String userType; + + // 企业ID + @TableField("company_id") + private String companyId; + + // 描述 + @TableField("user_desc") + private String userDesc; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 更新时间 + @TableField("update_time") + private LocalDateTime updateTime; + + // 状态:0-禁用 1-正常 2-锁定 + @TableField("status") + private Integer status; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Book.java b/src/main/java/com/biutag/supervision/pojo/entity/Book.java new file mode 100644 index 0000000..17a8753 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/Book.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class Book { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 文件名 + @TableField("file_name") + private String fileName; + + // 文件路径 + @TableField("file_path") + private String filePath; + + // 创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @TableField("create_time") + private LocalDateTime createTime; + + // + @TableField("crt_user") + private String crtUser; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BusinessDepart.java b/src/main/java/com/biutag/supervision/pojo/entity/BusinessDepart.java new file mode 100644 index 0000000..a4b040d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BusinessDepart.java @@ -0,0 +1,56 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.Date; + +@Setter +@Getter +public class BusinessDepart { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 日期(天) + @TableField("date") + private Date date; + + // 单位ID + @TableField("depart_id") + private String departId; + + // 单位名称 + @TableField("depart_name") + private String departName; + + // 单位类型ID + @TableField("group_id") + private Long groupId; + + // 单位类型名称 + @TableField("group_name") + private String groupName; + + // 业务类型 + @TableField("business_type") + private String businessType; + + // 业务类型名称 + @TableField("business_type_name") + private String businessTypeName; + + // 业务量 + @TableField("number") + private Integer number; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/CommonOpinions.java b/src/main/java/com/biutag/supervision/pojo/entity/CommonOpinions.java new file mode 100644 index 0000000..bce45ad --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/CommonOpinions.java @@ -0,0 +1,27 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; + +import java.time.LocalDateTime; + +@Data +@Slf4j +public class CommonOpinions { + @TableId + private int id; + //常用意见 + @TableField("content") + private String content; + + @TableField("crtTime") + private LocalDateTime crtTime; + + @TableField("crtUser") + private String crtUser; + + @TableField("crtId") + private String crtId; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/CountyStreetDept.java b/src/main/java/com/biutag/supervision/pojo/entity/CountyStreetDept.java new file mode 100644 index 0000000..af54cd1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/CountyStreetDept.java @@ -0,0 +1,92 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 区县管理机构表 + * @TableName county_street_dept + */ +@TableName(value ="county_street_dept") +@Data +public class CountyStreetDept implements Serializable { + /** + * + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 父级部门名称 + */ + @TableField(value = "dept_pid_name") + private String deptPidName; + + /** + * 父级部门id + */ + @TableField(value = "dept_pid") + private String deptPid; + + /** + * + */ + @TableField(value = "pid") + private String pid; + + /** + * + */ + @TableField(value = "coordinates") + private String coordinates; + + /** + * + */ + @TableField(value = "level") + private String level; + + /** + * + */ + @TableField(value = "name") + private String name; + + /** + * + */ + @TableField(value = "sort") + private Integer sort; + + /** + * + */ + @TableField(value = "geometry") + private String geometry; + + /** + * 所属区域 + */ + @TableField(value = "area_name") + private String areaName; + + /** + * 部门id + */ + @TableField(value = "dept_id") + private String deptId; + + /** + * + */ + @TableField(value = "dept_name") + private String deptName; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DepartNegativeRate.java b/src/main/java/com/biutag/supervision/pojo/entity/DepartNegativeRate.java new file mode 100644 index 0000000..eb2c711 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/DepartNegativeRate.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DepartNegativeRate { + + private String departId; + + // 月份 + private String month; + + // 问题发生率 + @TableField("incidence_rate") + private Double incidenceRate; + + // 问题发生率系数 + @TableField("incidence_factor") + private Double incidenceFactor; + + // 单位平均问题发生率 + @TableField("incidence_rate_tied") + private Double incidenceRateTied; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Feedback.java b/src/main/java/com/biutag/supervision/pojo/entity/Feedback.java new file mode 100644 index 0000000..96a89d5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/Feedback.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class Feedback { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 内容 + @TableField("content") + private String content; + + // + @TableField("create_time") + private LocalDateTime createTime; + + // 创建人 + @TableField("crt_user") + private String crtUser; + + // 创建人所在单位 + @TableField("crt_depart_name") + private String crtDepartName; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/FileBase64.java b/src/main/java/com/biutag/supervision/pojo/entity/FileBase64.java new file mode 100644 index 0000000..c1a6791 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/FileBase64.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2025/7/23 + */ +@Setter +@Getter +public class FileBase64 { + + @TableId + private String filePath; + + private String base64; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/FileClass.java b/src/main/java/com/biutag/supervision/pojo/entity/FileClass.java new file mode 100644 index 0000000..6275bf1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/FileClass.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class FileClass { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("class_title") + private String classTitle; + + // + @TableField("class_remarks") + private String classRemarks; + + // 问题来源 + @TableField("problem_sources_code") + private String problemSourcesCode; + + // + @TableField("sort_id") + private Integer sortId; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/GBaseAJJBXX.java b/src/main/java/com/biutag/supervision/pojo/entity/GBaseAJJBXX.java new file mode 100644 index 0000000..8b59fe2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/GBaseAJJBXX.java @@ -0,0 +1,61 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +@TableName("dwd_asj_zfba_ajjbxx") +public class GBaseAJJBXX { + + // 立案单位编码 + @TableField("LADWBMdm") + private String LADWBMdm; + + // 立案单位名称 + @TableField("LADWBMmc") + private String LADWBMmc; + + // 破案单位编码 + @TableField("PADWBMdm") + private String PADWBMdm; + + // 破案单位名称 + @TableField("PADWBMmc") + private String PADWBMmc; + + // 办案单位编码 + @TableField("BADWIDdm") + private String BADWIDdm; + + // 办案单位名称 + @TableField("BADWIDmc") + private String BADWIDmc; + + // 办案人1ID + @TableField("BAR1ID") + private String BAR1ID; + + // 办案人2ID + @TableField("BAR2ID") + private String BAR2ID; + + // 办案人姓名 + @TableField("XM") + private String XM; + + // 办案人ID + @TableField(exist = false) + private String BARID; + + @TableField(exist = false) + private Integer BADWNum; + + @TableField(exist = false) + private Integer BARNum; + + @TableField(exist = false) + private String JH; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/GBaseCJD.java b/src/main/java/com/biutag/supervision/pojo/entity/GBaseCJD.java new file mode 100644 index 0000000..7c31bd8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/GBaseCJD.java @@ -0,0 +1,36 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; + +@TableName("dwd_asj_zhtx_cjd") +@Setter +@Getter +public class GBaseCJD { + + private Integer cjdxdmTotal; + + // 出警对象名称 + @TableField("cjdxname") + private String cjdxname; + + // 处警时间 + @TableField("cjsj") + private Date cjsj; + + // 出警对象代码 + @TableField("cjdxdm") + private String cjdxdm; + + // 处警对象所属单位代码 + @TableField("cjdxssdwdm") + private String cjdxssdwdm; + + // 处警对象所属单位名称 + @TableField("cjdxssdwmc") + private String cjdxssdwmc; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/GBaseJJD.java b/src/main/java/com/biutag/supervision/pojo/entity/GBaseJJD.java new file mode 100644 index 0000000..98a7e9e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/GBaseJJD.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; + +@TableName("dwd_asj_zhtx_jjd") +@Setter +@Getter +public class GBaseJJD { + + @TableField(exist = false) + private Integer jjdbhTotal; + + // 接警单编号 + @TableField("jjdbh") + private String jjdbh; + + // 创建时间 + @TableField("cjsj") + private Date cjsj; + + // 管辖单位代码 + @TableField("gxdwdm") + private String gxdwdm; + + // 管辖单位名称 + @TableField("gxdwmc") + private String gxdwmc; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Holiday.java b/src/main/java/com/biutag/supervision/pojo/entity/Holiday.java new file mode 100644 index 0000000..6bca422 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/Holiday.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class Holiday { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 日期 + @TableField("date") + private String date; + + // 是否是节假日 + @TableField("flag") + private Boolean flag; + + // 节假日名称 + @TableField("holiday_name") + private String holidayName; + + // 年 + @TableField("year") + private Integer year; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/InformMessage.java b/src/main/java/com/biutag/supervision/pojo/entity/InformMessage.java new file mode 100644 index 0000000..cd447a6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/InformMessage.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class InformMessage { + + @TableId + private String id; + //项目id + @TableField("report_id") + private String reportId; + //通知信息 + @TableField("message") + private String message; + //创建时间 + @TableField("crt_time") + private LocalDateTime crtTime; + //创建用户id + @TableField("crt_user_id") + private String crtUserId; + //创建人 + @TableField("crt_user") + private String crtUser; + //接收人id + @TableField("recipient_id") + private String recipientId; + //接收人 + @TableField("recipient") + private String recipient; + //环节 + @TableField("node") + private String node; + //是否已读 + @TableField("is_read") + private String isRead; + + @TableField("flow_state") + private String flowState; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/InvertRecord.java b/src/main/java/com/biutag/supervision/pojo/entity/InvertRecord.java new file mode 100644 index 0000000..0b130d9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/InvertRecord.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.pojo.entity; + + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class InvertRecord { + + @TableId + private String id; + + @TableField("warning") + private String warning; + + @TableField("report") + private String report; + + @TableField("report_id") + private String reportId; + + @TableField("warning_id") + private String warningId; + + @TableField("warning_state") + private String warningState; + + @TableField("crt_time") + private LocalDateTime crtTime; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Menu.java b/src/main/java/com/biutag/supervision/pojo/entity/Menu.java new file mode 100644 index 0000000..d75eda2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/Menu.java @@ -0,0 +1,74 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class Menu { + + // + @TableId(type = IdType.AUTO) + private Integer id; + + // + @TableField("pid") + private Integer pid; + + // 菜单类型 + @TableField("menu_type") + private String menuType; + + // 菜单名称 + @TableField("menu_name") + private String menuName; + + // 菜单图标 + @TableField("icon") + private String icon; + + // 排序 + @TableField("menu_sort") + private Integer menuSort; + + // + @TableField("perms") + private String perms; + + // 路径 + @TableField("paths") + private String paths; + + // 组件 + @TableField("component") + private String component; + + // 是否缓存 + @TableField("is_cache") + private Integer isCache; + + // + @TableField("is_show") + private Integer isShow; + + // + @TableField("is_disable") + private Integer isDisable; + + // + @TableField("create_time") + private LocalDateTime createTime; + + // + @TableField("update_time") + private LocalDateTime updateTime; + + // 是否打开新页面 默认为false + private Boolean openNewPage; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelClass.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClass.java new file mode 100644 index 0000000..5b09853 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClass.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class ModelClass { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("name") + private String name; + + // + @TableField("sort") + private Integer sort; + + @TableField("status") + private Integer status; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java new file mode 100644 index 0000000..667febc --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java @@ -0,0 +1,101 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Setter +@Getter +public class ModelClue { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("model_id") + private Integer modelId; + + // 涉及单位 + @TableField("involve_depart_name") + private String involveDepartName; + + @TableField("involve_depart_id") + private String involveDepartId; + + // 涉及人员 + @TableField("involve_police_name") + private String involvePoliceName; + + // 涉及人员警号 + @TableField("involve_police_emp_no") + private String involvePoliceEmpNo; + + // 预警内容 + @TableField("thing_desc") + private String thingDesc; + + // 状态 默认 0-未分发 1-已分发 2-已处理 + @TableField("distribution_state") + private String distributionState; + + @TableField("create_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + + @TableField("update_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime updateTime; + + // 数据详情 JSON + private String data; + + // 问题ID + @TableField("negative_id") + private String negativeId; + @TableField("notification_id") + private String notificationId; + + // 问题ID + @TableField("negative_id_ex") + private String negativeIdEx; + + // 外部主键 + @TableField("unique_key") + private String uniqueKey; + + // 任务ID + private Integer taskId; + + // 总警情数 + @TableField(exist = false) + private Long zjjs; + + // 104号模型用 + @TableField(exist = false) + private Long allZjjs; + + // 执法场所登记数 + @TableField(exist = false) + private Long zfcsdjs; + + // 比例 + @TableField(exist = false) + private BigDecimal bl; + + @TableField(exist = false) + private String parentId; + + @TableField(exist = false) + private String thisId; + + @TableField(exist = false) + private Integer departLevel; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelClue18.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClue18.java new file mode 100644 index 0000000..826eaef --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClue18.java @@ -0,0 +1,15 @@ +package com.biutag.supervision.pojo.entity; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class ModelClue18 { + private String zhrq; + private String zhdd; + private String ajbh; + private String zhr; + private String badwIDdm; + private String badwIDmc; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelClueRecord.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClueRecord.java new file mode 100644 index 0000000..e95afca --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClueRecord.java @@ -0,0 +1,42 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class ModelClueRecord { + + // + @TableId(type = IdType.AUTO) + private Integer id; + + // 模型ID + private Integer modelId; + + // 条数 + @TableField("size") + private Integer size; + + // 创建时间 + @TableField("create_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + + // 状态 success-成功 fail-失败 + @TableField("state") + private String state; + + // 异常详情 + @TableField("err_msg") + private String errMsg; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelClueTask.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelClueTask.java new file mode 100644 index 0000000..eb92b2a --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelClueTask.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class ModelClueTask { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 任务名称 + @TableField("task_name") + private String taskName; + + // 模型名称 + @TableField("model_id") + private Integer modelId; + + // 下发时间 + @TableField("distribution_time") + private LocalDateTime distributionTime; + + // 条数 + @TableField("size") + private Integer size; + + private String distributionMethod; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegDepartAuthority.java b/src/main/java/com/biutag/supervision/pojo/entity/NegDepartAuthority.java new file mode 100644 index 0000000..1294186 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegDepartAuthority.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegDepartAuthority { + + // 身份证号 + @TableField("idCode") + private String idCode; + + // 可查看的部门 + @TableField("departId") + private String departId; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java b/src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java new file mode 100644 index 0000000..7440624 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegSourceAuthority { + + // 身份证号 + @TableField("idCode") + private String idCode; + + // 可查看的来源 + private String source; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RoleMenu.java b/src/main/java/com/biutag/supervision/pojo/entity/RoleMenu.java new file mode 100644 index 0000000..86df6a5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/RoleMenu.java @@ -0,0 +1,25 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class RoleMenu { + + @TableId(type = IdType.AUTO) + private Integer id; + + private String roleCode; + + private Integer menuId; + + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDepart.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDepart.java new file mode 100644 index 0000000..3c96f7a --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDepart.java @@ -0,0 +1,87 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class SupDepart { + + // + @TableId + private String id; + + // + @TableField("type") + private String type; + + // + @TableField("category") + private String category; + + // + @TableField("code") + private String code; + + // + @TableField("name") + private String name; + + // + @TableField("short_name") + private String shortName; + + // + @TableField("domain_name") + private String domainName; + + // + @TableField("pid") + private String pid; + + // + @TableField("level") + private Integer level; + + // + @TableField("path_trace") + private String pathTrace; + + // + @TableField("is_hide") + private String isHide; + + // + @TableField("status") + private String status; + + // + @TableField("order_no") + private Integer orderNo; + + // + @TableField("version") + private String version; + + // + @TableField("status_updated_at") + private String statusUpdatedAt; + + // + @TableField("created_at") + private String createdAt; + + // + @TableField("updated_at") + private String updatedAt; + + private Boolean firstHost; + + // + @TableField("statistics_group_id") + private String statisticsGroupId; + + private String img; +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java new file mode 100644 index 0000000..360d7a7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Accessors(chain = true) +@Setter +@Getter +public class SupDepartPoliceSize { + + // + @TableId(value = "depart_id") + private String departId; + + // 民警人数 + @TableField("police_size") + private Long policeSize; + + // 协警人数 + @TableField("aux_size") + private Long auxSize; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDict12337HandleResult.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDict12337HandleResult.java new file mode 100644 index 0000000..612adda --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDict12337HandleResult.java @@ -0,0 +1,31 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@TableName("sup_dict_12337_handle_result") +@Setter +@Getter +public class SupDict12337HandleResult { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("name") + private String name; + + // + @TableField("group_name") + private String groupName; + + private Integer sortId; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictData.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictData.java new file mode 100644 index 0000000..ee889df --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictData.java @@ -0,0 +1,73 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDictData { + + // 字典编码 + @TableId(type = IdType.AUTO) + private Integer dictCode; + + // 字典排序 + @TableField("dict_sort") + private Integer dictSort; + + // 字典标签 + @TableField("dict_label") + private String dictLabel; + + // 字典键值 + @TableField("dict_value") + private String dictValue; + + // 字典类型 + @TableField("dict_type") + private String dictType; + + // 样式属性(其他样式扩展) + @TableField("css_class") + private String cssClass; + + // 表格回显样式 + @TableField("list_class") + private String listClass; + + // 是否默认(1是 0否) + @TableField("is_default") + private String isDefault; + + // 状态(0正常 1停用) + @TableField("status") + private String status; + + // 创建者 + @TableField("create_by") + private String createBy; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 更新者 + @TableField("update_by") + private String updateBy; + + // 更新时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("update_time") + private LocalDateTime updateTime; + + // 备注 + @TableField("remark") + private String remark; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictDataTwo.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictDataTwo.java new file mode 100644 index 0000000..f1205c1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictDataTwo.java @@ -0,0 +1,75 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@DS("szdczx") +@Getter +@Setter +@TableName("sup_dict_data") +public class SupDictDataTwo { + // 字典编码 + @TableId(type = IdType.AUTO) + private Integer dictCode; + + // 字典排序 + @TableField("dict_sort") + private Integer dictSort; + + // 字典标签 + @TableField("dict_label") + private String dictLabel; + + // 字典键值 + @TableField("dict_value") + private String dictValue; + + // 字典类型 + @TableField("dict_type") + private String dictType; + + // 样式属性(其他样式扩展) + @TableField("css_class") + private String cssClass; + + // 表格回显样式 + @TableField("list_class") + private String listClass; + + // 是否默认(1是 0否) + @TableField("is_default") + private String isDefault; + + // 状态(0正常 1停用) + @TableField("status") + private String status; + + // 创建者 + @TableField("create_by") + private String createBy; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 更新者 + @TableField("update_by") + private String updateBy; + + // 更新时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("update_time") + private LocalDateTime updateTime; + + // 备注 + @TableField("remark") + private String remark; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictHandleResultMaping.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictHandleResultMaping.java new file mode 100644 index 0000000..27c5831 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictHandleResultMaping.java @@ -0,0 +1,47 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDictHandleResultMaping { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("external_name") + private String externalName; + + // 处理结论形态 + private String externalType; + + // + @TableField("internal_name") + private String internalName; + + // + @TableField("internal_id") + private String internalId; + + // + @TableField("create_time") + private LocalDateTime createTime; + + // + @TableField("update_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime updateTime; + + // 来源 + private String source; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java new file mode 100644 index 0000000..41919dc --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java @@ -0,0 +1,31 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDictProblemSource { + + // + @TableId(value = "id", type = IdType.AUTO) + private String id; + + // + @TableField("parent_id") + private String parentId; + + // + @TableField("label") + private String label; + + // + @TableField("sort") + private Integer sort; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java new file mode 100644 index 0000000..efc7ab9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java @@ -0,0 +1,90 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDictProblemType { + + @TableId(type = IdType.AUTO) + private String id; + + // 类型名称 + @TableField("name") + private String name; + + // 类型编码 + @TableField("code") + private String code; + + // 父级code + @TableField("parent_code") + private String parentCode; + + // 状态 + @TableField("status") + private String status; + + // 备注 + @TableField("remark") + private String remark; + + // 祖级列表 + @TableField("ancestors") + private String ancestors; + + // + @TableField("level") + private Integer level; + + // 排序 + @TableField("sort") + private Integer sort; + + @TableField("crt_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") + private LocalDateTime crtTime; + + @TableField("crt_user") + private String crtUser; + + // 创建单位 + @TableField("crt_depart_id") + private String crtDepartId; + + @TableField("crt_name") + private String crtName; + + @TableField("crt_host") + private String crtHost; + + // + @TableField("upd_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") + private LocalDateTime updTime; + + // + @TableField("upd_user") + private String updUser; + + // + @TableField("upd_name") + private String updName; + + // + @TableField("upd_host") + private String updHost; + + private Double score; + + // 是否开启严重等级 + private Boolean isActiveLevel; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemTypeMaping.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemTypeMaping.java new file mode 100644 index 0000000..06772b4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemTypeMaping.java @@ -0,0 +1,41 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDictProblemTypeMaping { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("external_name") + private String externalName; + + // + @TableField("internal_name") + private String internalName; + + // + @TableField("internal_id") + private String internalId; + + // + @TableField("create_time") + private LocalDateTime createTime; + + // + @TableField("update_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime updateTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictType.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictType.java new file mode 100644 index 0000000..086038d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictType.java @@ -0,0 +1,53 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDictType { + + // 字典主键 + @TableId(type = IdType.AUTO) + private Long dictId; + + // 字典名称 + @TableField("dict_name") + private String dictName; + + // 字典类型 + @TableField("dict_type") + private String dictType; + + // 状态(0正常 1停用) + @TableField("status") + private String status; + + // 创建者 + @TableField("create_by") + private String createBy; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 更新者 + @TableField("update_by") + private String updateBy; + + // 更新时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("update_time") + private LocalDateTime updateTime; + + // 备注 + @TableField("remark") + private String remark; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupExternalDepart.java b/src/main/java/com/biutag/supervision/pojo/entity/SupExternalDepart.java new file mode 100644 index 0000000..766f289 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupExternalDepart.java @@ -0,0 +1,65 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupExternalDepart { + + // id + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 外部单位id + @TableField("external_id") + private String externalId; + + // 外部单位名称 + @TableField("external_name") + private String externalName; + + // 外部来源 + @TableField("source") + private String source; + + // 内部单位id + @TableField("internal_id") + private String internalId; + + // 内部单位名称 + @TableField("internal_name") + private String internalName; + + // 内部单位短名称 + @TableField("internal_short_name") + private String internalShortName; + + // 单位级别 + @TableField("level") + private Integer level; + + // 上级单位id + @TableField("pid") + private String pid; + + // 状态:0-启用,1-禁用 + @TableField("status") + private Integer status; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + + // 更新时间 + @TableField("update_time") + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private LocalDateTime updateTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupPhoto.java b/src/main/java/com/biutag/supervision/pojo/entity/SupPhoto.java new file mode 100644 index 0000000..3ade2d0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupPhoto.java @@ -0,0 +1,42 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupPhoto { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("file_path") + private String filePath; + + // + @TableField("file_name") + private String fileName; + + // + @TableField("create_time") + private LocalDateTime createTime; + + // + @TableField("date") + private String date; + + // 创建用户 + private String createUsername; + + private Boolean isUse = false; + + private String thumbnailBase64; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java b/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java new file mode 100644 index 0000000..37682dc --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java @@ -0,0 +1,161 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.biutag.supervision.constants.AppConstants; +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDate; + +@Setter +@Getter +public class SupPolice { + + + // + @TableId + private String id; + + // 账号id + @TableField("account_id") + private String accountId; + + // + @TableField("district_id") + private String districtId; + + // 组织机构id + @NotBlank + @TableField("org_id") + private String orgId; + + // 警号 + @NotBlank + @TableField("emp_no") + private String empNo; + + // + @TableField("job") + private String job; + + // 职位类型 + @TableField("job_type") + private String jobType; + + // + @TableField("manager_id") + private String managerId; + + // 电话 + @TableField("phone") + private String phone; + + // + @TableField("fax_no") + private String faxNo; + + // + @TableField("post_title") + private String postTitle; + + // 工作地址 + @TableField("work_address") + private String workAddress; + + // 账号 + @TableField("account") + private String account; + + // 手机号 + @TableField("mobile") + private String mobile; + + // + @TableField("email") + private String email; + + // 身份证 + @NotBlank + @TableField("id_code") + private String idCode; + + // 名称 + @TableField("display_name") + private String displayName; + + // 姓名 + @TableField("name") + private String name; + + // + @TableField("gender") + private String gender; + + // + @TableField("birthday") + private String birthday; + + // + @TableField("avatar_url") + private String avatarUrl; + + // + @TableField("status") + private String status; + + // + @TableField("hired_at") + private String hiredAt; + + // + @TableField("created_at") + private String createdAt; + + // + @TableField("updated_at") + private String updatedAt; + + // 类型 0 原始数据 1 协警 2 文员 3 临时工 + @TableField("type") + private String type; + + // + @TableField("person_status") + private String personStatus; + + // 职位 正职 副职 + private String position; + + // 人员属性 + private String personType; + + // 婚姻状况 + private String maritalStatus; + + // 子女 + private Boolean haveChildren; + + // 学历 + private String education; + + // 入职日期 + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd") + private LocalDate employmentDate; + + // 警员角色 + private String policeRole; + + private Integer sortId; + + // 是否刪除 + @TableLogic(value = AppConstants.UN_DEL, delval = AppConstants.DEL) + private String del; + + // 刪除原因 + private String delReason; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/User.java b/src/main/java/com/biutag/supervision/pojo/entity/User.java new file mode 100644 index 0000000..e1e2269 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/User.java @@ -0,0 +1,59 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class User { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("certificate_num") + private String certificateNum; + + // + @TableField("cert_eff_date") + private String certEffDate; + + // + @TableField("cert_exp_date") + private String certExpDate; + + // + @TableField("certificate_type") + private String certificateType; + + // + @TableField("name") + private String name; + + // + @TableField("phone") + private String phone; + + // + @TableField("real_lvl") + private String realLvl; + + // + @TableField("sex") + private String sex; + + // + @TableField("user_type") + private String userType; + + // + @TableField("yxd_id") + private String yxdId; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/WvpDeviceChannel.java b/src/main/java/com/biutag/supervision/pojo/entity/WvpDeviceChannel.java new file mode 100644 index 0000000..a53f3a5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/WvpDeviceChannel.java @@ -0,0 +1,339 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class WvpDeviceChannel { + + // + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + // 当前单位/设备的id + @TableField("device_id") + private String deviceId; + + // 当前设备名称 + @TableField("name") + private String name; + + // + @TableField("manufacturer") + private String manufacturer; + + // + @TableField("model") + private String model; + + // + @TableField("owner") + private String owner; + + // + @TableField("civil_code") + private String civilCode; + + // + @TableField("block") + private String block; + + // + @TableField("address") + private String address; + + // 为1的是单位,为0的是摄像头设备 + @TableField("parental") + private Integer parental; + + // + @TableField("parent_id") + private String parentId; + + // + @TableField("safety_way") + private Integer safetyWay; + + // + @TableField("register_way") + private Integer registerWay; + + // + @TableField("cert_num") + private String certNum; + + // + @TableField("certifiable") + private Integer certifiable; + + // + @TableField("err_code") + private Integer errCode; + + // + @TableField("end_time") + private String endTime; + + // + @TableField("secrecy") + private Integer secrecy; + + // + @TableField("ip_address") + private String ipAddress; + + // + @TableField("port") + private Integer port; + + // + @TableField("password") + private String password; + + // ON为在线,OFF为离线 + @TableField("status") + private String status; + + // + @TableField("longitude") + private Double longitude; + + // + @TableField("latitude") + private Double latitude; + + // + @TableField("ptz_type") + private Integer ptzType; + + // + @TableField("position_type") + private Integer positionType; + + // + @TableField("room_type") + private Integer roomType; + + // + @TableField("use_type") + private Integer useType; + + // + @TableField("supply_light_type") + private Integer supplyLightType; + + // + @TableField("direction_type") + private Integer directionType; + + // + @TableField("resolution") + private String resolution; + + // + @TableField("business_group_id") + private String businessGroupId; + + // + @TableField("download_speed") + private String downloadSpeed; + + // + @TableField("svc_space_support_mod") + private Integer svcSpaceSupportMod; + + // + @TableField("svc_time_support_mode") + private Integer svcTimeSupportMode; + + // + @TableField("create_time") + private String createTime; + + // + @TableField("update_time") + private String updateTime; + + // + @TableField("sub_count") + private Integer subCount; + + // + @TableField("stream_id") + private String streamId; + + // + @TableField("has_audio") + private Boolean hasAudio; + + // + @TableField("gps_time") + private String gpsTime; + + // + @TableField("stream_identification") + private String streamIdentification; + + // + @TableField("channel_type") + private Integer channelType; + + // + @TableField("gb_device_id") + private String gbDeviceId; + + // + @TableField("gb_name") + private String gbName; + + // + @TableField("gb_manufacturer") + private String gbManufacturer; + + // + @TableField("gb_model") + private String gbModel; + + // + @TableField("gb_owner") + private String gbOwner; + + // + @TableField("gb_civil_code") + private String gbCivilCode; + + // + @TableField("gb_block") + private String gbBlock; + + // + @TableField("gb_address") + private String gbAddress; + + // + @TableField("gb_parental") + private Integer gbParental; + + // + @TableField("gb_parent_id") + private String gbParentId; + + // + @TableField("gb_safety_way") + private Integer gbSafetyWay; + + // + @TableField("gb_register_way") + private Integer gbRegisterWay; + + // + @TableField("gb_cert_num") + private String gbCertNum; + + // + @TableField("gb_certifiable") + private Integer gbCertifiable; + + // + @TableField("gb_err_code") + private Integer gbErrCode; + + // + @TableField("gb_end_time") + private String gbEndTime; + + // + @TableField("gb_secrecy") + private Integer gbSecrecy; + + // + @TableField("gb_ip_address") + private String gbIpAddress; + + // + @TableField("gb_port") + private Integer gbPort; + + // + @TableField("gb_password") + private String gbPassword; + + // + @TableField("gb_status") + private String gbStatus; + + // + @TableField("gb_longitude") + private String gbLongitude; + + // + @TableField("gb_latitude") + private String gbLatitude; + + // + @TableField("gb_business_group_id") + private String gbBusinessGroupId; + + // + @TableField("gb_ptz_type") + private Integer gbPtzType; + + // + @TableField("gb_position_type") + private Integer gbPositionType; + + // + @TableField("gb_room_type") + private Integer gbRoomType; + + // + @TableField("gb_use_type") + private Integer gbUseType; + + // + @TableField("gb_supply_light_type") + private Integer gbSupplyLightType; + + // + @TableField("gb_direction_type") + private Integer gbDirectionType; + + // + @TableField("gb_resolution") + private String gbResolution; + + // + @TableField("gb_download_speed") + private String gbDownloadSpeed; + + // + @TableField("gb_svc_space_support_mod") + private Integer gbSvcSpaceSupportMod; + + // + @TableField("gb_svc_time_support_mode") + private Integer gbSvcTimeSupportMode; + + // + @TableField("record_plan_id") + private Integer recordPlanId; + + // + @TableField("data_type") + private Integer dataType; + + // + @TableField("data_device_id") + private Integer dataDeviceId; + + // 存储子设备的列表 + @TableField(exist = false) + private List children = new ArrayList<>(); +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ZhkshDutyScheduleDc.java b/src/main/java/com/biutag/supervision/pojo/entity/ZhkshDutyScheduleDc.java new file mode 100644 index 0000000..6bf0d42 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/ZhkshDutyScheduleDc.java @@ -0,0 +1,60 @@ +package com.biutag.supervision.pojo.entity; + +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; + +@Getter +@Setter +public class ZhkshDutyScheduleDc { + @TableField("SCHEDULE_ID") + private String scheduleId; + //单位id + @TableField("DEPT_CODE") + private String deptCode; + //单位名称 + @TableField("DEPT_NAME") + private String deptName; + //值班时间 + @TableField("ROTA_TIME") + private Date rotaTime; + //值班人名称 + @TableField("ROTA_PERSON_NAME") + private String rotaPersonName; + //值班人身份证 + @TableField("ID_CODE") + private String idCode; + //值班人警号 + @TableField("POLICE_CODE") + private String policeCode; + //值班人联系方式 + @TableField("PHONE") + private String phone; + //警务通联系方式 + @TableField("JWT_PHONE") + private String jwtPhone; + //值班岗类型 + @TableField("ROTA_STATION") + private String rotaStation; + //值班岗类型code + @TableField("POST_CODE") + private String postCode; + //值班类型 + @TableField("PARENT_POST_CODE") + private String parentPostCode; + //开始时间 + @TableField("START_TIME") + private Date startTime; + //结束时间 + @TableField("END_TIME") + private Date endTime; + + @TableField("DEVICE_CODE") + private String deviceCode; + + @TableField("DEVICE_TYPE") + private String deviceType; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/mailbox/Mail.java b/src/main/java/com/biutag/supervision/pojo/entity/mailbox/Mail.java new file mode 100644 index 0000000..a4115f3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/mailbox/Mail.java @@ -0,0 +1,408 @@ +package com.biutag.supervision.pojo.entity.mailbox; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class Mail { + + @TableId + private String id; + + /** + * 联系人姓名 + */ + private String contactName; + /** + * 联系人性别 M / F + */ + private String contactSex; + /** + * 联系人身份证号码 + */ + private String contactIdCard; + /** + * 联系人手机号 + */ + private String contactPhone; + /** + * 案件编号 + */ + private String caseNumber; + /** + * 内容 + */ + private String content; + /** + * 附件 + */ + private String attachments; + /** + * 创建时间 + */ + private LocalDateTime createTime; + /** + * 更新时间 + */ + private LocalDateTime updateTime; + /** + * 来信时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime mailTime; + + /** + * 来源 + */ + private String source; + + /** + * 满意读(网络) + */ + private String satisfaction; + + /** + * 满意读(短信) + */ + private String satisfactionSms; + + /*-------------------------------*/ + + /** + * 信件状态 + */ + private String mailState; + /** + * 信件当前流程 + */ + private String flowKey; + /** + * 信件当前流程节点 + */ + private String flowBeforeName; + + private String flowName; + + /** + * 流程限时最后操作时间 + */ + private LocalDateTime flowLimitedLastHandlerTime; + + /** + * 信件源数据ID (多个) + */ + private String mailSourceId; + + /** + * 信件类名 + */ + private String mailCategory; + /** + * 信件一级类目 + */ + private String mailFirstCategory; + /** + * 信件二级类目 + */ + private String mailSecondCategory; + /** + * 信件三级类目 + */ + private String mailThreeCategory; + /** + * 信件等级 + */ + private String mailLevel; + + /** + * 二级单位ID(主责) + */ + private Integer secondDeptId; + + private String secondDeptName; + + /** + * 三级单位ID(主责) + */ + private Integer threeDeptId; + + private String threeDeptName; + + /** + * 协办核查民警(String) + */ + private String coHandlingPolices; + /** + * 联系民警名称 + */ + private String contactPoliceName; + /** + * 联系民警 + */ + private String contactPoliceEmpNo; + + /** + * 联系民警职位 + */ + private String contactPolicePost; + + /** + * 联系群众时间 + */ + private LocalDateTime contactTime; + + /** + * 联系时长(秒) + */ + private Long contactDuration; + + /** + * 是否联系群众 + */ + private Boolean contactFlag; + + /** + * 接访形式 + */ + private String interviewType; + /** + * 是否接访一把手 + */ + private Boolean interviewIsLeader; + /** + * 接访人员警号 + */ + private String interviewPoliceEmpNo; + /** + * 接访人员姓名 + */ + private String interviewPoliceName; + /** + * 接访情况 + */ + private String interviewDetails; + /** + * 接访附件(佐证材料) + */ + private String interviewAttachments; + /** + * 核办情况 + */ + private String verifyDetails; + /** + * 核办-是否属实 + */ + private String verifyIsTrue; + /** + * 核办-被举报对象(json) + */ + private String verifyReportedPolices; + /** + * 核办-查证属实问题(json) + */ + private String verifyProblem; + /** + * 核办-是否需要问责 + */ + private Boolean verifyNeedAccountability; + /** + * 核办-责任追究(json) + */ + private String verifyPunish; + + /** + * 核办-群众反映事项解决情况(是否已解决) + */ + private Boolean verifyIsResolved; + + /** + * 核办-办理反馈情况 + */ + private String verifyFeedback; + + /** + * 核办-回访人信息(String) + */ + private String verifyFollowupPolice; + + /** + * 核办-附件(上传佐证) + */ + private String verifyAttachments; + + /** + * 办结方式 + */ + private String completeMethod; + + /** + * 办理合格情况 + */ + private String qualifiedProcessingStatus; + + /** + * 问题解决情况 + */ + private Boolean problemSolvingStatus; + + /** + * 群众回复情况 + */ + private String satisfactionStatus; + + + /** + * 认定办结意见 + */ + private String completionComment; + + /** + * 是否是简易流程 + */ + private Boolean simpleFlowFlag; + + /** + * 涉及单位ID + */ + private Integer involvedDeptId; + + /** + * 涉及单位名称 + */ + private String involvedDeptName; + + /** + * 会签部门总数 + */ + private Integer countersignTotal; + + /** + * 会签完成部门数量 + */ + private Integer countersignCompleted; + + /** + * 会签发起人 + */ + private String countersignPromoterEmpNo; + + /** + * 会签发起姓名 + */ + private String countersignPromoterName; + + /** + * 会签发起部门ID + */ + private Integer countersignPromoterDeptId; + + /** + * 会签发起部门名称 + */ + private String countersignPromoterDeptName; + + /** + * 会签具体要求 + */ + private String countersignRequirement; + + /** + * 信件标签 + */ + private String mailLabels; + + /** + * 当前操作对象 + */ + private String currentOperator; + + /** + * 申请延期ID + */ + private String extensionRequestId; + + /** + * 是否申请延期 + */ + private Boolean extensionFlag; + + /** + * 延期天数 + */ + private Integer extensionDays; + + /** + * 延期理由 + */ + private String extensionReason; + + /** + * 延期状态 + */ + private String extensionState; + + /** + * 无效判定理由 + */ + private String invalidationReason; + + /** + * 市局下发信息 + */ + private String firstDistributeInfo; + + /** + * 二级单位下发信息 + */ + private String secondDistributeInfo; + + /** + * 主办层级 + */ + private Integer mainDeptLevel; + + /** + * 信件后续审批流程 + */ + private String returnOperate; + + /** + * 不满意原因 + */ + private String notSatisfiedReason; + + /** + * 市局专班下发时间 + */ + private LocalDateTime firstDistributeTime; + + /** + * 市局下发意见 + */ + private String firstDistributeComment; + + /** + * 市局下发意见 + */ + private String firstDistributeFiles; + + /** + * 二级机构下发意见 + */ + private String secondDistributeComment; + + private String secondDistributeFiles; + + /** + * 二级机构下发时间 + */ + private LocalDateTime secondDistributeTime; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/mailbox/MailBlame.java b/src/main/java/com/biutag/supervision/pojo/entity/mailbox/MailBlame.java new file mode 100644 index 0000000..d276c84 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/mailbox/MailBlame.java @@ -0,0 +1,46 @@ +package com.biutag.supervision.pojo.entity.mailbox; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2025/2/26 + */ +@Accessors(chain = true) +@Setter +@Getter +public class MailBlame { + + @TableId(type = IdType.AUTO) + private Integer id; + + private String mailId; + + private Integer deptId; + + private String blameName; + + private String blameEmpNo; + + private String blameIdCode; + + /** + * 核办-查证属实问题(json) + */ + private String verifyProblem; + /** + * 核办-责任追究(json) + */ + private String verifyPunish; + + /** + * 创建时间 + */ + private LocalDateTime createTime; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/negative/DataDataPetitionComplainDistribute.java b/src/main/java/com/biutag/supervision/pojo/entity/negative/DataDataPetitionComplainDistribute.java new file mode 100644 index 0000000..cc15843 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/negative/DataDataPetitionComplainDistribute.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.pojo.entity.negative; + +import com.biutag.supervision.pojo.vo.warning.WaringVo; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2024/10/24 + */ +@Setter +@Getter +public class DataDataPetitionComplainDistribute { + + private WaringVo waringVo; + + // 办理时限 + @NotBlank + private String timeLimit; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + private String handleDepartId; + + @NotBlank + private String distributionFlow; + + // 审批流程 + @NotBlank + private String approvalFlow; + + private String businessTypeCode; + + private String businessTypeName; + + private List involveProblem; + + private String policeType; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/negative/DataPetitionComplaint.java b/src/main/java/com/biutag/supervision/pojo/entity/negative/DataPetitionComplaint.java new file mode 100644 index 0000000..16de260 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/negative/DataPetitionComplaint.java @@ -0,0 +1,88 @@ +package com.biutag.supervision.pojo.entity.negative; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class DataPetitionComplaint { + // 信件编号 + @TableId + private String originId; + + // 投诉渠道 + @TableField("channel_for_filing_complaints") + private String channelForFilingComplaints; + + // 受理层级 + @TableField("acceptance_level") + private String acceptanceLevel; + // 登记时间 + + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + @TableField("responder_name") + private String responderName; + + // 投诉人电话 + @TableField("responder_phone") + private String responderPhone; + + // 涉嫌问题 + @TableField("involve_problem") + private String involveProblem; + + // 业务类别 + @TableField("business_type_name") + private String businessTypeName; + + // 涉及警种名称 + @TableField("police_type_name") + private String policeTypeName; + + // 具体内容 + @TableField("thing_desc") + private String thingDesc; + //接访领导单位 + @TableField("receiving_leader_name") + private String receivingLeaderName; + + //--------------------- + + // 涉及单位 二级 + private String secondDepartId; + + private String secondDepartName; + + // 所队 + private String thirdDepartId; + + private String thirdDepartName; + + private LocalDateTime createTime; + + private LocalDateTime updateTime; + + // 来源 + private String problemSourcesCode; + + // 分发状态 + private String distributionState; + + // negativeId + private String negativeId; + + // 信访形式 + private String petitionType; + + // 信访办理情况 + private String petitionProcessingStatus; + + @TableField("involved_issue") + private String involvedIssue; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/negative/Negative.java b/src/main/java/com/biutag/supervision/pojo/entity/negative/Negative.java new file mode 100644 index 0000000..4ec372d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/negative/Negative.java @@ -0,0 +1,339 @@ +package com.biutag.supervision.pojo.entity.negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.Getter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + + + +@Accessors(chain = true) +@Getter +@Data +@DS("szdczx") +public class Negative { + // + @TableId + private String id; + + // 样本来源编号 + @TableField("originId") + private String originId; + + // 编号 + @TableField("serialNumber") + private String serialNumber; + + // 问题发生时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @TableField("happenTime") + private LocalDateTime happenTime; + + // 问题发现时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @TableField("discoveryTime") + private LocalDateTime discoveryTime; + + // 问题来源code + @TableField("problemSourcesCode") + private String problemSourcesCode; + + // 问题来源 + @TableField("problemSources") + private String problemSources; + + + // 业务类型 + @TableField("businessTypeCode") + private String businessTypeCode; + + // 业务类别名称 + @TableField("businessTypeName") + private String businessTypeName; + + // 涉嫌问题JSON + @TableField("involveProblem") + private String involveProblem; + + // 涉及警种名称 + @TableField("policeTypeName") + private String policeTypeName; + + // 涉及警种 + @TableField("policeType") + private String policeType; + + // 涉及单位名称 + @TableField("involveDepartName") + private String involveDepartName; + + // 涉及单位 + @TableField("involveDepartId") + private String involveDepartId; + + // 联系电话 + @TableField("contactPhone") + private String contactPhone; + + // 反映人姓名 + @TableField("responderName") + private String responderName; + + // 涉及人身份证 + @TableField("responderIdCard") + private String responderIdCard; + + // 简要描述 + @TableField("thingDesc") + private String thingDesc; + + // 填写人姓名 + @TableField("fillName") + private String fillName; + + // 填写人部门id + @TableField("fillDepartId") + private String fillDepartId; + + // 填写人部门名称 + @TableField("fillDeaprtName") + private String fillDeaprtName; + + // 审核人姓名 + @TableField("checkName") + private String checkName; + + // 审核人身份证 + @TableField("checkIdCode") + private String checkIdCode; + + // + @TableField("crtTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime crtTime; + + // + @TableField("updName") + private String updName; + + // + @TableField("updUser") + private String updUser; + + // + @TableField("updTime") + private LocalDateTime updTime; + + // 0 正常 1 禁用 + @TableField("status") + private String status; + + // + @TableField("remark") + private String remark; + + // 预留 + @TableField("reserve") + private String reserve; + + // 核查情况 + @TableField("checkStatus") + private String checkStatus; + + // 核查情况 + @TableField("checkStatusName") + private String checkStatusName; + + // 完善状态 0 -- 待完善 1 -- 已完善 + @TableField("completeStatus") + private String completeStatus; + + // 最后编辑人员 + @TableField("lastEditName") + private String lastEditName; + + // + @TableField("taskId") + private String taskId; + + // + @TableField("supervisionSubjectCode") + private String supervisionSubjectCode; + + // + @TableField("supervisionSubjectName") + private String supervisionSubjectName; + + // 是否整改 + @TableField("isRectifyCode") + private String isRectifyCode; + + // 是否整改 + @TableField("isRectifyName") + private String isRectifyName; + + // 办结时间 + @TableField("completeDate") + private LocalDateTime completeDate; + //督察报告id + @TableField("report_id") + private String reportId; + //--------------------------------------------- + + private String flowKey; + + // 主办层级 + private String hostLevel; + + // 办理时限 + private String timeLimit; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 审批流程 + private String approvalFlow; + + // 问题核查情况 + private String checkStatusDesc; + + // 问题整改情况 + private String rectifyDesc; + + + // 整改限制天数 + private Integer rectifyRestrictionDays; + + // 追责对象 + private String accountabilityTarget; + + // 办理状态 + private String processingStatus; + + // 延期申请ID + private Integer negativeExtensionApplyId; + + // 是否能申请延期 true = 能 false = 不能 + private Boolean extensionApplyFlag; + + // 延期天数 + private Integer extensionDays; + + // 市局下发时间 + private LocalDateTime firstDistributeTime; + + // 是否是二级机构办理 true=是 false=否 + private Boolean isSecondHandle; + + private String handleSecondDepartId; + + private String handleSecondDepartName; + + private String handleThreeDepartId; + + private String handleThreeDepartName; + + // 涉及案件/警情编号 + private String caseNumber; + + // 办理超时(秒) + private Long handleTimeout; + + // 申请办结时间 + private LocalDateTime handleTime; + + // 当前处理对象 + private String currentProcessingObject; + + // 专项督察 + private String specialSupervision; + + // 通报期数 + private String reportNumber; + + // 核查办理情况 + private String verifySituation; + + // 佐证材料情况 + private String verifyFileSituation; + + // 单位会签ID + private Integer countersignApplyId; + + // 创建单位层级 (默认为市局) + private Integer crtDepartLevel; + + // 市局下发意见 + private String firstDistributeComments; + + // 是否抽检 + private Boolean spotCheckFlag; + + // 抽检结果 + private String spotCheckResult; + + // 抽检情况 + private String spotCheckDesc; + + // 未整改原因 + private String unrectifyReason; + + // 二级部门 + private String secondInvolveDepartId; + + // 三级部门 + private String threeInvolveDepartId; + + // 经办人 + private String handlePolices; + + // 剩余办理时间 + private Long handleRemainingTime; + + @TableField("sample_id") + private Integer sampleId; + + // 下发问题 + private String problems; + + // 核查时间 + private LocalDateTime verifyTime; + + // 项目名称 + private String projectName; + + // 涉及问题金额 + private Double involveMoney; + + // 化解情况 + private String resolveSituation; + + // 当前状态 + private String resolveStatus; + + // 接访领导 + private String visitingLeaderName; + + private String visitingLeaderEmpNo; + + private String handleResult12337; + + private String handleResult12337Group; + + // 涉及人员是否属于领导班子成员 + private String verifiedIsLeader; + + // 办理结果 + private String processResult; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeExtensionApply.java b/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeExtensionApply.java new file mode 100644 index 0000000..589e7a5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeExtensionApply.java @@ -0,0 +1,47 @@ +package com.biutag.supervision.pojo.entity.negative; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class NegativeExtensionApply { + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("handler_depart_id") + private String handlerDepartId; + + // + @TableField("handler_depart_name") + private String handlerDepartName; + + // + @TableField("handler_user_name") + private String handlerUserName; + + // + @TableField("handler_name") + private String handlerName; + + // 延期理由 + @TableField("comments") + private String comments; + + // 延期天数 + @TableField("extension_days") + private Integer extensionDays; + + // + @TableField("create_time") + private LocalDateTime createTime; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeExtensionApprove.java b/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeExtensionApprove.java new file mode 100644 index 0000000..1744689 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeExtensionApprove.java @@ -0,0 +1,58 @@ +package com.biutag.supervision.pojo.entity.negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.time.LocalDateTime; + +@DS("szdczx") +@Data +public class NegativeExtensionApprove { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("negative_extension_apply_id") + private Integer negativeExtensionApplyId; + + // + @TableField("handler_depart_id") + private String handlerDepartId; + + // + @TableField("handler_depart_name") + private String handlerDepartName; + + // + @TableField("handler_user_name") + private String handlerUserName; + + // + @TableField("handler_name") + private String handlerName; + + // 审批意见/驳回理由 + @TableField("comments") + private String comments; + + // + @TableField("state") + private String state; + + // + @TableField("action_key") + private String actionKey; + + // + @TableField("create_time") + private LocalDateTime createTime; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeHistory.java b/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeHistory.java new file mode 100644 index 0000000..6eebfc6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeHistory.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.pojo.entity.negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.RequiredArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@DS("szdczx") +@Data +@RequiredArgsConstructor +@Accessors(chain = true) +public class NegativeHistory { + // + @TableId("historyId") + private String historyId; + + // 组名 + @TableField("dataJson") + private String dataJson; + + // 类型 + @TableField("negativeId") + private String negativeId; + + // 创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("crtTime") + private LocalDateTime crtTime; + + // 创建人 + @TableField("crtUser") + private String crtUser; + + // + @TableField("crtUserName") + private String crtUserName; + + // + @TableField("crtName") + private String crtName; + + private String actionName; + + private String departName; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeThingFile.java b/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeThingFile.java new file mode 100644 index 0000000..baa44d3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeThingFile.java @@ -0,0 +1,39 @@ +package com.biutag.supervision.pojo.entity.negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@DS("szdczx") +@Getter +@Setter +public class NegativeThingFile { + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // 文件名称 + @TableField("file_name") + private String fileName; + + // 文件路径 + @TableField("file_path") + private String filePath; + + // + @TableField("type") + private String type; + + // + @TableField("create_time") + private LocalDateTime createTime; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeWork.java b/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeWork.java new file mode 100644 index 0000000..605e645 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/negative/NegativeWork.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.pojo.entity.negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@DS("szdczx") +@Getter +@Setter +@Accessors(chain = true) +public class NegativeWork { + // + @TableId(type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("depart_id") + private String departId; + + private String departName; + + // 角色编码 + @TableField("role_code") + private String roleCode; + + // 问题来源 + private String problemSourcesCode; + + private String status; + + @TableField("create_time") + private LocalDateTime createTime; + + // + @TableField("update_time") + private LocalDateTime updateTime; + + private String flowKey; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/price/PriceFile.java b/src/main/java/com/biutag/supervision/pojo/entity/price/PriceFile.java new file mode 100644 index 0000000..411ee72 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/price/PriceFile.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.pojo.entity.price; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class PriceFile { + @TableId + private String id; + + @TableField("file_name") + private String fileName; + + @TableField("file_path") + private String filePath; + + + @TableField("cre_time") + private LocalDateTime creTime; + + @TableField("cre_user") + private String creUser; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/price/PriceInformation.java b/src/main/java/com/biutag/supervision/pojo/entity/price/PriceInformation.java new file mode 100644 index 0000000..63a06f9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/price/PriceInformation.java @@ -0,0 +1,83 @@ +package com.biutag.supervision.pojo.entity.price; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.biutag.supervision.util.BigDecimalUtils; +import com.biutag.supervision.util.DataDisposeUtil; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; + +import java.math.BigDecimal; + +/** + * @author weipeng + */ +@Slf4j +@Data +public class PriceInformation { + @TableId + private String id; + + @ExcelProperty({"项目名称"}) + @TableField("project_name") + private String projectName; + //编码 + @ExcelProperty({"编码"}) + @TableField("code") + private String code; + //名称 + @ExcelProperty({"名称"}) + @TableField("name") + private String name; + //规格型号 + @ExcelProperty({"规格型号"}) + @TableField("model") + private String model; + //单位 + @ExcelProperty({"单位"}) + @TableField("unit") + private String unit; + //数量 + @ExcelProperty({"数量"}) + @TableField("amount") + private String amount; + //单价(元) + @ExcelProperty({"单价(元)"}) + @TableField("univalent") + private BigDecimal univalent; + //合计(元) + @ExcelProperty({"合计(元)"}) + @TableField("total") + private BigDecimal total; + + //备注 + @ExcelProperty({"备注"}) + @TableField("remark") + private String remark; + + //项目id + @TableField("file_id") + private String fileId; + + @TableField("information") + private String information; + + @TableField("create_depart") + private String createDepart; + + public void setInformationData() { + this.information = String.format("项目名称:%s,编码:%s,名称:%s,规格型号:%s,单位:%s,数量:%s,单价(元):%s,合价(元):%s,备注:%s", + DataDisposeUtil.StrNullBlank(this.projectName), + DataDisposeUtil.StrNullBlank(this.code), + DataDisposeUtil.StrNullBlank(this.name), + DataDisposeUtil.StrNullBlank(this.model), + DataDisposeUtil.StrNullBlank(this.unit), + DataDisposeUtil.StrNullBlank(this.amount), + BigDecimalUtils.isNotZeroAndNull(this.univalent)?this.univalent:BigDecimal.ZERO, + BigDecimalUtils.isNotZeroAndNull(this.total)?this.total:BigDecimal.ZERO, + DataDisposeUtil.StrNullBlank(this.remark) + ); + } +} + diff --git a/src/main/java/com/biutag/supervision/pojo/entity/recessed/RecessedLog.java b/src/main/java/com/biutag/supervision/pojo/entity/recessed/RecessedLog.java new file mode 100644 index 0000000..6f334ee --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/recessed/RecessedLog.java @@ -0,0 +1,34 @@ +package com.biutag.supervision.pojo.entity.recessed; + +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +@Data +public class RecessedLog { + @TableId + private String id; + + @TableField("report_id") + private String reportId; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("recessed_time") + private LocalDateTime recessedTime; + + @TableField("create_user") + private String createUser; + + @TableField("create_id") + private String createId; + + @TableField("message") + private String message; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/report/ReportFile.java b/src/main/java/com/biutag/supervision/pojo/entity/report/ReportFile.java new file mode 100644 index 0000000..2307204 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/report/ReportFile.java @@ -0,0 +1,55 @@ +package com.biutag.supervision.pojo.entity.report; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.biutag.supervision.pojo.vo.FileVo; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +/** + * @author weipeng + */ //报审项目附件 +@Getter +@Setter +public class ReportFile { + @TableId + private String id; + //报审项目id + @TableField("report_id") + private String reportId; + //附件类型 + @TableField("type") + private String type; + //附件id + @TableField("file_id") + private String fileId; + //附件地址 + @TableField("files") + private String files; + + + //资料名称 + @TableField("file_name") + private String fileName; + //附件名称 + @TableField("name") + private String name; + //创建人 + @TableField("crt_user") + private String crtUser; + //创建时间 + @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("crt_time") + private LocalDateTime crtTime; + //附件归属环节 + @TableField("file_node") + private String fileNode; + + @TableField("request") + private Boolean request; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/report/ReportFlow.java b/src/main/java/com/biutag/supervision/pojo/entity/report/ReportFlow.java new file mode 100644 index 0000000..e7b6e22 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/report/ReportFlow.java @@ -0,0 +1,57 @@ +package com.biutag.supervision.pojo.entity.report; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import org.springframework.cglib.core.Local; + +import java.time.LocalDateTime; + +@Getter +@Setter +public class ReportFlow { + @TableId + private String id; + //项目id + @TableField("report_id") + private String reportId; + //项目报审环节 + @TableField("report_link") + private String reportLink; + //项目报审环节code + @TableField("report_code") + private String reportCode; + //审批人 + @TableField("approver") + private String approver; + + @TableField("approver_id") + private String approverId; + //报审时间 + @TableField("areport_time") + private LocalDateTime areportTime; + //审批时间 + @TableField("approver_time") + private LocalDateTime approverTime; + //审批意见 + @TableField("approver_message") + private String approverMessage; + //审批状态 + @TableField("approver_state") + private String approverState; + + @TableField("approver_unit") + private String approverUnit; + + @TableField("approver_unit_id") + private String approverUnitId; + + @TableField("type") + private String type; + + @TableField("is_init") + private String isInit; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/report/ReportProject.java b/src/main/java/com/biutag/supervision/pojo/entity/report/ReportProject.java new file mode 100644 index 0000000..0f4169a --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/report/ReportProject.java @@ -0,0 +1,158 @@ +package com.biutag.supervision.pojo.entity.report; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.springframework.cglib.core.Local; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +//报审项目 +@Getter +@Setter +public class ReportProject { + + @TableId + private String id; + //报审类型 + @TableField("report_type") + private String reportType; + //项目名称 + @TableField("report_name") + private String reportName; + //项目类别 + @TableField("project_type") + private String projectType; + //审计单位id + @TableField("audit_unit_id") + private String auditUnitId; + //审计单位 + @TableField("audit_unit") + private String auditUnit; + //项目单位id + @TableField("project_unit_id") + private String projectUnitId; + //项目单位 + @TableField("project_unit") + private String projectUnit; + //项目负责人 + @TableField("project_principal") + private String projectPrincipal; + //负责人联系方式 + @TableField("project_phone") + private String projectPhone; + //采购方式 + @TableField("purchase_method") + private String purchaseMethod; + //报审金额 + @TableField("report_money") + private BigDecimal reportMoney; + //立项金额 + @TableField("project_approval_money") + private BigDecimal projectApprovalMoney; + //立项审批领导 + @TableField("project_approval_lead") + private String projectApprovalLead; + //报审人 + @TableField("applicant") + private String applicant; + //报审人id + @TableField("applicant_id") + private String applicantId; + //报审日期 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("applicant_time") + private LocalDateTime applicantTime; + //立项日期 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("project_approval_time") + private LocalDateTime projectApprovalTime; + //申报政府采购日期 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("apply_government_time") + private LocalDateTime applyGovernmentTime; + //采购方式 + @TableField("purchase_type") + private String purchaseType; + //采购日期 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("purchase_time") + private LocalDateTime purchaseTime; + //合同签订日期 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("contract_time") + private LocalDateTime contractTime; + //合同金额 + @TableField("contract_mount") + private BigDecimal contractMount; + //服务单位 + @TableField("service_unit") + private String serviceUnit; + //服务单位负责人 + @TableField("service_unit_manager") + private String serviceUnitManager; + + @TableField(exist = false) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List serviceTime; + + //服务日期(开始) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("service_start_time") + private LocalDateTime serviceStartTime; + //服务日期(结束) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("service_end_time") + private LocalDateTime serviceEndTime; + //服务单位联系电话 + @TableField("service_unit_phone") + private String serviceUnitPhone; + //文号 + @TableField("reference_number") + private String referenceNumber; + //发文日期 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("publication_date") + private LocalDateTime publicationDate; + + @TableField("node") + private String node; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("crt_time") + private LocalDateTime crtTime; + //(归档时间) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("archiving") + private LocalDateTime archiving; + //审定金额(归档) + @TableField("archiving_money") + private BigDecimal archivingMoney; + //审减金额(归档) + @TableField("archiving_reduce_money") + private BigDecimal archivingReduceMoney; + + @TableField("warning_state") + private String warningState; + //是否退窗 + @TableField("is_recessed") + private int isRecessed; + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/report/ReportReview.java b/src/main/java/com/biutag/supervision/pojo/entity/report/ReportReview.java new file mode 100644 index 0000000..1a46e68 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/report/ReportReview.java @@ -0,0 +1,94 @@ +package com.biutag.supervision.pojo.entity.report; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.springframework.cglib.core.Local; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +//报审信息 +@Getter +@Setter +public class ReportReview { + @TableId + private String id; + //报审项目id + @TableField("report_id") + private String reportId; + //一审金额 + @TableField("first_money") + private BigDecimal firstMoney; + //一审审减金额 + @TableField("first_reduce_money") + private BigDecimal firstReduceMoney; + //一审日期 + @TableField("first_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime firstTime; + //一审审计员 + @TableField("first_auditor") + private String firstAuditor; + //一审审计员警号 + @TableField("first_auditor_empno") + private String firstAuditorEmpNo; + + //二审金额 + @TableField("second_money") + private BigDecimal secondMoney; + //二审审减金额 + @TableField("second_reduce_money") + private BigDecimal secondReduceMoney; + //二审日期 + @TableField("second_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime secondTime; + //二审审计员 + @TableField("second_auditor") + private String secondAuditor; + //二审审计员警号 + @TableField("second_auditor_empno") + private String secondAuditorEmpNo; + //三审金额 + @TableField("thirdly_money") + private BigDecimal thirdlyMoney; + //三审审减金额 + @TableField("thirdly_reduce_money") + private BigDecimal thirdlyReduceMoney; + //三审日期 + @TableField("thirdly_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime thirdlyTime; + //三审审计员 + @TableField("thirdly_auditor") + private String thirdlyAuditor; + //三审审计员警号 + @TableField("thirdly_auditor_empno") + private String thirdlyAuditorEmpNo; + //审查情况 + @TableField("review_status") + private String reviewStatus; + //审计依据 + @TableField("review_gist") + private String reviewGist; + //审计内容 + @TableField("review_content") + private String reviewContent; + //勘探情况 + @TableField("is_exploration") + private String isExploration; + //对审情况 + @TableField("is_cross") + private String isCross; + //定案表地址 + @TableField("finalization_path") + private String finalizationPath; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/serviceUnit/ServiceUnit.java b/src/main/java/com/biutag/supervision/pojo/entity/serviceUnit/ServiceUnit.java new file mode 100644 index 0000000..a9cad3f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/serviceUnit/ServiceUnit.java @@ -0,0 +1,55 @@ +package com.biutag.supervision.pojo.entity.serviceUnit; + +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Builder; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +@Builder +public class ServiceUnit { + + @TableId + private String id; + // 服务单位 + @TableField("service_unit") + private String serviceUnit; + //服务单位负责人 + @TableField("service_unit_manager") + private String serviceUnitManager; + //服务单位联系电话 + @TableField("service_unit_phone") + private String serviceUnitPhone; + + //创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @DateTimeFormat("yyyy-MM-dd HH:mm") + @TableField("crt_time") + private LocalDateTime crtTime; + + //录入人 + @TableField("crt_user") + private String crtUser; + //项目 + @TableField("project") + private String project; + //项目id + @TableField("project_id") + private String projectId; + //采购单位 + @TableField("purchasing_unit") + private String purchasingUnit; + + @TableField("purchasing_unit_id") + private String purchasingUnitId; + //采购单位负责人 + @TableField("purchasing_unit_manager") + private String purchasingUnitManager; + + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/warning/WarningContent.java b/src/main/java/com/biutag/supervision/pojo/entity/warning/WarningContent.java new file mode 100644 index 0000000..9d95346 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/warning/WarningContent.java @@ -0,0 +1,32 @@ +package com.biutag.supervision.pojo.entity.warning; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +@Data +public class WarningContent { + @TableId + private String id; + + @TableField("warning_id") + private String warningId; + + @TableField("genre") + private String genre; + + @TableField("type") + private String type; + + @TableField("title") + private String title; + + @TableField("content") + private String content; + + @TableField("remark") + private String remark; + + @TableField("deduction") + private Double deduction; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/warning/WarningRecord.java b/src/main/java/com/biutag/supervision/pojo/entity/warning/WarningRecord.java new file mode 100644 index 0000000..846f18d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/warning/WarningRecord.java @@ -0,0 +1,67 @@ +package com.biutag.supervision.pojo.entity.warning; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.biutag.supervision.pojo.entity.InvertRecord; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +@Data +public class WarningRecord { + @TableId + private String id; + //预警监督人员 + @TableField("warning_supervision") + private String warningSupervision; + //预警监督人员id + @TableField("warning_supervision_id") + private String warningSupervisionId; + //预警监督日期 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @TableField("supervision_time") + private LocalDateTime supervisionTime; + //通知报审单位(审核流程)节点 + @TableField("inform_node") + private String informNode; + + //通知报审单位(审核流程)状态码 + @TableField("inform_state") + private String informState; + + //证据提供者 + @TableField("evidence_offer") + private String evidenceOffer; + //审核状态 + @TableField("state") + private String state; + //节点 + @TableField("node") + private String node; + //项目id + @TableField("report_id") + private String reportId; + //归档时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("archiving") + private LocalDateTime archiving; + + @TableField("flow_state") + private String flowState; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField("create_time") + private LocalDateTime createTime; + + + @TableField(exist = false) + private String warning; + + @TableField(exist = false) + private String report; + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/enums/FlowEnum.java b/src/main/java/com/biutag/supervision/pojo/enums/FlowEnum.java new file mode 100644 index 0000000..a84b055 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/enums/FlowEnum.java @@ -0,0 +1,36 @@ +package com.biutag.supervision.pojo.enums; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +@AllArgsConstructor +@Getter +@Slf4j +public enum FlowEnum { + + Initial("initial","项目进窗"), + Review("review","进窗报审"), + FirstInstance("first","一审环节"), + SecondInstance("second","二审环节"), + ThirdInstance("third","三审环节"), + LeadInstance("Lead","领导审核"), + OriginalInstance("original","定案表审核"), + AuditInstance("audit","审计报告"), + EndInstance("end","归档"); + + private final String label; + + private final String Code; + + public static String contains(String label) { + for (FlowEnum enums : values()) { + if (label.equals(enums.getLabel())) { + return enums.getCode(); + } + } + log.info("未找到该类型:{}", label); + return null; + } +} diff --git a/src/main/java/com/biutag/supervision/pojo/enums/FlowStateEnum.java b/src/main/java/com/biutag/supervision/pojo/enums/FlowStateEnum.java new file mode 100644 index 0000000..917ac2b --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/enums/FlowStateEnum.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.pojo.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +@Getter +@AllArgsConstructor +@Slf4j +public enum FlowStateEnum { + + Start("start","开始"), + + End("end","结束"), + + Reject("reject","驳回"); + + + private final String label; + + private final String value; + + public static String contains(String label) { + for (FlowStateEnum enums : values()) { + if (label.equals(enums.getLabel())) { + return enums.getValue(); + } + } + return null; + } + +} diff --git a/src/main/java/com/biutag/supervision/pojo/enums/FlowWarningEnum.java b/src/main/java/com/biutag/supervision/pojo/enums/FlowWarningEnum.java new file mode 100644 index 0000000..a537f9a --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/enums/FlowWarningEnum.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.pojo.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +@AllArgsConstructor +@Getter +@Slf4j +public enum FlowWarningEnum { + + + state("state","开始"), + + inform("inform","报审单位签收"), + + leader("leader","领导审核"), + + end("end","结束"); + + + private final String label; + + private final String value; + + public static String contains(String label) { + for (FlowWarningEnum enums : values()) { + if (label.equals(enums.getLabel())) { + return enums.getValue(); + } + } + log.info("未找到该类型:{}", label); + return null; + } +} diff --git a/src/main/java/com/biutag/supervision/pojo/enums/NotificationType.java b/src/main/java/com/biutag/supervision/pojo/enums/NotificationType.java new file mode 100644 index 0000000..ca59b04 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/enums/NotificationType.java @@ -0,0 +1,36 @@ +package com.biutag.supervision.pojo.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +/** + * @author kami on 2024-06-19 13:52:23 + * @version 0.0.1 + * @since 1.8 + */ +@AllArgsConstructor +@Getter +@Slf4j +public enum NotificationType { + + ALARM(1L, "预警问题"), + RISK(2L, "风险问题"), + NOTIFICATION(3L, "提醒通知"); + + private final Long id; + + private final String desc; + + + + public static String contains(long id) { + for (NotificationType enums : values()) { + if (id == enums.getId()) { + return enums.getDesc(); + } + } + log.info("未找到该类型:{}", id); + return null; + } +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/BusinessPoliceModel.java b/src/main/java/com/biutag/supervision/pojo/model/BusinessPoliceModel.java new file mode 100644 index 0000000..8eafa07 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/BusinessPoliceModel.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.pojo.model; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class BusinessPoliceModel { + // 警员姓名 + private String policeName; + + // 警号 + private String empNo; + + // 单位名称 + private String departName; + + // 单位类型 + private String groupName; + + // 110接处警 + private Integer jiechujing110; + + // 122接处警 + private Integer jiechujing122; + + // 身份证业务 + private Integer shenfenzhengyewu; + + // 执法办案(受案) + private Integer zhifabananSA; + + // 执法办案(立案) + private Integer zhifabananLA; + + // 执法办案(破案) + private Integer zhifabananPA; + + // 户口业务 + private Integer hukouyewu; + + // 出入境业务 + private Integer churujingyewu; + + // 车辆上牌 + private Integer cheliangshangpai; + + // 驾驶人考试 + private Integer jiashirenkaoshi; +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/DataMigrationModel.java b/src/main/java/com/biutag/supervision/pojo/model/DataMigrationModel.java new file mode 100644 index 0000000..496ff39 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/DataMigrationModel.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class DataMigrationModel { + private Integer sampleId; + private String name; + private String visitName; + private String visitPhone; + private String orgName; + private String businessName; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime sampleTime; + private String sampleContent; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime visitTime; + private String resultName; +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/DataRightsComfortModel.java b/src/main/java/com/biutag/supervision/pojo/model/DataRightsComfortModel.java new file mode 100644 index 0000000..5683f0e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/DataRightsComfortModel.java @@ -0,0 +1,51 @@ +package com.biutag.supervision.pojo.model; + +import com.biutag.supervision.pojo.dto.common.BarItem; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.vo.EchartsVo; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class DataRightsComfortModel { + // 维权案件总数 + private Integer rightsNumber; + + // 受侵害人数 + private Integer victimNumber; + + // 抚慰人数 + private Long comfortPersonNumber; + // 打击处理人数 + long hitPersonNumber; + // 抚慰金额(万元) + Double comfortMoney; + // 维权案件情况 - 分县市局 + List countyRightsBarList = new ArrayList<>(); +// // 维权案件情况 - 局属单位 + List bureauRightsBarList = new ArrayList<>(); + + // 抚慰金额情况 - 分县市局 + List countyComfortMoneyBarList = new ArrayList<>(); + // 抚慰金额情况 - 局属单位 + List bureauComfortMoneyBarList = new ArrayList<>(); + + // 刑事案件类别占比 + List crownCaseBarList = new ArrayList<>(); + // 行政案件类别占比 + List administrativeCaseList = new ArrayList<>(); + + // 打处情况 + List punishmentSituation = new ArrayList<>(); + // 民辅警抚慰情况占比 + List comfortPoliceTypeProportion = new ArrayList<>(); + // 民辅警受伤情况 + List comfortPoliceInjurySituation = new ArrayList<>(); + // 民辅警受伤类别 + List comfortInjuryCategory = new ArrayList<>(); + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/DepartNegativeModel.java b/src/main/java/com/biutag/supervision/pojo/model/DepartNegativeModel.java new file mode 100644 index 0000000..12ec20c --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/DepartNegativeModel.java @@ -0,0 +1,32 @@ +package com.biutag.supervision.pojo.model; + +import lombok.Getter; +import lombok.Setter; + +import java.math.BigDecimal; + +/** + * @author wxc + * @date 2024/11/1 + */ +@Setter +@Getter +public class DepartNegativeModel { + + private String departId; + private String departName; + private String parentDepartName; + + // + //民警人数 + private Integer policeSize; + // + //协辅警人数 + private Integer auxSize; + // 查实问题涉及人数 + private Integer verifyPoliceSize; + // 查实问题数 + private Integer verifySize; + + private BigDecimal score; +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/ExtensionApproveStepModel.java b/src/main/java/com/biutag/supervision/pojo/model/ExtensionApproveStepModel.java new file mode 100644 index 0000000..ceed26f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/ExtensionApproveStepModel.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2024/11/25 + */ +@AllArgsConstructor +@Setter +@Getter +public class ExtensionApproveStepModel { + + private String title; + + private String comments; + + private String state; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/model/ModelClassModel.java b/src/main/java/com/biutag/supervision/pojo/model/ModelClassModel.java new file mode 100644 index 0000000..6a62c83 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/ModelClassModel.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.model; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/11/13 + */ +@Setter +@Getter +public class ModelClassModel { + + private Integer id; + + private String name; + + private Integer sort; + + private Integer size; + + private String modelType; +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/ModelClueModel.java b/src/main/java/com/biutag/supervision/pojo/model/ModelClueModel.java new file mode 100644 index 0000000..4201e27 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/ModelClueModel.java @@ -0,0 +1,56 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * + * @author wxc + * @date 2024/10/16 + */ +@Setter +@Getter +public class ModelClueModel { + + private Integer id; + + private Integer modelId; + + private String modelName; + + private String involveDepartId; + // 涉及单位 + private String involveDepartName; + + private String involveParentDepartName; + + // 涉及人员 + private String involvePoliceName; + + // 涉及人员警号 + private String involvePoliceEmpNo; + + // 预警内容 + private String thingDesc; + + // 分发状态 + private String distributionState; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + + private String data; + + private String negativeId; + + private String notificationId; + + private String status; + + // 办理状态 + private String processingStatus; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskDepartModel.java b/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskDepartModel.java new file mode 100644 index 0000000..fc42caf --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskDepartModel.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2024/10/17 + */ +@Setter +@Getter +public class ModelClueTaskDepartModel { + + private String departId; + + // 模型名称 + private String departName; + + // 条数 + private Integer size; + + private Integer completedSize; + + private Double completedRate; + + private Integer verifySize; + + private Integer personalSize; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java b/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java new file mode 100644 index 0000000..cfaac56 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java @@ -0,0 +1,40 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2024/10/17 + */ +@Setter +@Getter +public class ModelClueTaskModel { + + private Integer id; + + // 任务名称 + private String taskName; + + // 模型名称 + private String modelName; + + // 下发时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime distributionTime; + + // 条数 + private Integer size; + + private Integer completedSize; + + private Integer verifySize; + + private Integer departSize; + + private Integer personalSize; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/NegativeFavModel.java b/src/main/java/com/biutag/supervision/pojo/model/NegativeFavModel.java new file mode 100644 index 0000000..b6ed5b0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/NegativeFavModel.java @@ -0,0 +1,69 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegativeFavModel { + + private String negativeId; + + private String originId; + + // 问题发生时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题发现时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题来源 + private String problemSources; + + // 问题内容 + private String thingDesc; + + private String responderName; + + // 联系电话 + private String contactPhone; + + // 业务类型 + private String businessTypeCode; + + // 业务类别名称 + private String businessTypeName; + + // 涉及警种名称 + private String policeTypeName; + + // 涉及警种 + private String policeType; + + // 涉及单位名称 + private String involveDepartName; + + // 涉及单位 + private String involveDepartId; + + // 部门ID(工作表) + private String workDepartId; + + private String flowKey; + + // 办理状态 + private String processingStatus; + + private String involveProblem; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime crtTime; + + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java new file mode 100644 index 0000000..a435390 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java @@ -0,0 +1,100 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class NegativeWorkModel { + + private Integer workId; + + private String workFlowKey; + + private String negativeId; + + private String originId; + + // 问题发生时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题发现时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题来源 + private String problemSources; + + // 问题内容 + private String thingDesc; + + // 联系电话 + private String contactPhone; + + private String responderName; + + // 业务类型 + private String businessTypeCode; + + // 业务类别名称 + private String businessTypeName; + + // 涉及警种名称 + private String policeTypeName; + + // 涉及警种 + private String policeType; + + // 涉及单位名称 + private String involveDepartName; + + // 涉及单位 + private String involveDepartId; + + // 部门ID(工作表) + private String workDepartId; + + // 办理状态 + private String processingStatus; + + private String flowKey; + + // 市局下发时间 + private LocalDateTime firstDistributeTime; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 延期天数 + private Integer extensionDays; + + // 办理剩余时长 + private Long remainingDuration; + + private String handleSecondDepartId; + + private String handleSecondDepartName; + + private String handleThreeDepartId; + + private String handleThreeDepartName; + + // 涉嫌问题 + private String involveProblem; + + // 是否能申请延期 true = 能 false = 不能 + private Boolean extensionApplyFlag; + + private String checkStatusName; + + // 当前处理对象 + private String currentProcessingObject; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java b/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java new file mode 100644 index 0000000..9a316ad --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java @@ -0,0 +1,116 @@ +package com.biutag.supervision.pojo.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class PoliceModel { + + private String id; + + // 账号id + private String accountId; + + private String districtId; + + // 组织机构id + private String orgId; + + // 警号 + private String empNo; + + private String job; + + // 职位类型 + private String jobType; + + private String managerId; + + // 电话 + private String phone; + + private String faxNo; + + private String postTitle; + + // 工作地址 + private String workAddress; + + // 账号 + private String account; + + // 手机号 + private String mobile; + + // + private String email; + + // 身份证 + private String idCode; + + // 名称 + private String displayName; + + // 姓名 + @TableField("name") + private String name; + + private String gender; + + private String birthday; + + private String avatarUrl; + + private String status; + + // 类型 0 原始数据 1 协警 2 文员 3 临时工 + private String type; + + private String personStatus; + + // 组织机构名称 + private String departName; + + private String departShortName; + + private String parentDepartShortName; + + private String position; + + // 人员属性 + private String personType; + + // 婚姻状况 + private String maritalStatus; + + // 子女 + private Boolean haveChildren; + + // 学历 + private String education; + + private String createdAt; + + private String updatedAt; + + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDateTime employmentDate; + + // 警员角色 + private String policeRole; + + private Integer level; + + private String role; + + // 刪除原因 + private String delReason; + + private String userId; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java b/src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java new file mode 100644 index 0000000..0983b69 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java @@ -0,0 +1,36 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * @author wxc + * @date 2024/11/1 + */ +@Setter +@Getter +public class PoliceNegativeModel { + + private String name; + private String empNo; + private String IdCode; + private String position; + + // 人员属性 + private String personType; + // 入职日期 + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd") + private LocalDate employmentDate; + + // 查实问题数 + private Integer verifySize; + private String departName; + private String departId; + private String parentDepartName; + + private BigDecimal score; +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/RiskClassModel.java b/src/main/java/com/biutag/supervision/pojo/model/RiskClassModel.java new file mode 100644 index 0000000..2bd7ce8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/RiskClassModel.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.pojo.model; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/11/13 + */ +@Setter +@Getter +public class RiskClassModel { + + private Integer id; + + private Integer pid; + + private String name; + + private Integer sort; + + private Integer size; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java b/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java new file mode 100644 index 0000000..bf6a134 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java @@ -0,0 +1,48 @@ +package com.biutag.supervision.pojo.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +@Accessors(chain = true) +@Setter +@Getter +public class UserAuth implements Serializable { + + private String userId; + + private String userName; + + private String userType; + + private String nickName; + + private String departId; + + private String departName; + + // 职位 + private String position; + + // 警号 + private String empNo; + + // 手机号 + private String mobile; + + private String avatarUrl; + + // 角色编号 + private List roleCodes; + + // 权限(问题来源) + private List authSources; + + private List authDepartIds; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/UserModel.java b/src/main/java/com/biutag/supervision/pojo/model/UserModel.java new file mode 100644 index 0000000..6b6e7ee --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/UserModel.java @@ -0,0 +1,48 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.List; + +@Setter +@Getter +public class UserModel { + + private String userId; + + // 登陆账号 + private String userName; + + // 昵称 + private String nickName; + + // 头像 + private String avatar; + + // 邮箱 + private String email; + + // 手机号 + private String mobile; + + // 用户类型:super-超级管理员 normal-普通管理员 + private String userType; + + // 描述 + private String userDesc; + + // 更新时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + // 状态:0-禁用 1-正常 2-锁定 + private Integer status; + + private List roleIds; + + private List roleNames; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/negative/NegativeDto.java b/src/main/java/com/biutag/supervision/pojo/model/negative/NegativeDto.java new file mode 100644 index 0000000..26ed498 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/negative/NegativeDto.java @@ -0,0 +1,113 @@ +package com.biutag.supervision.pojo.model.negative; + +import com.biutag.supervision.common.validation.AddGroup; +import com.biutag.supervision.common.validation.EditGroup; +import com.biutag.supervision.pojo.dto.flow.VerifyData; +import com.biutag.supervision.pojo.vo.FileVo; +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Data +public class NegativeDto { + @NotBlank(message = "问题来源不能为空", groups = {EditGroup.class}) + private String id; + + private String originId; + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题发现时间 + @NotNull(groups = {AddGroup.class, EditGroup.class}) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题来源 + @NotBlank(message = "问题来源不能为空", groups = {AddGroup.class, EditGroup.class}) + private String problemSourcesCode; + + // 问题来源 + @NotBlank(message = "问题来源不能为空", groups = {AddGroup.class, EditGroup.class}) + private String problemSources; + + // 业务类别 + @NotBlank(message = "业务类别不能为空", groups = {AddGroup.class, EditGroup.class}) + private String businessTypeCode; + + + private String policeTypeName; + + // 涉及警种 + private String policeType; + + // 涉嫌问题 + private List involveProblem = new ArrayList<>(); + + // 反映人姓名 + private String responderName; + + // 联系电话 + private String contactPhone; + + // 简要描述 + @NotBlank(message = "简要描述不能为空", groups = {AddGroup.class, EditGroup.class}) + private String thingDesc; + + private List thingFiles = new ArrayList<>(); + + private String involveDepartName; + + // 涉及单位 + private String involveDepartId; + + @NotBlank(message = "主办层级不能为空", groups = {AddGroup.class}) + private String hostLevel; + + // 办理时限 + @NotBlank(message = "办理时限不能为空", groups = {AddGroup.class}) + private String timeLimit; + + // 审批流程 + @NotBlank(message = "审批流程不能为空", groups = {AddGroup.class}) + private String approvalFlow; + + @NotBlank(message = "指定具体办理单位不能为空", groups = {AddGroup.class}) + private String departId; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 涉及案件/警情编号 + private String caseNumber; + + // 专项督察 + private String specialSupervision; + + // 通报期数 + private String reportNumber; + //督察报告id + private String reportId; + + private String taskId; + + // 项目名称 + private String projectName; + + // 涉及问题金额 + private Double involveMoney; + + // 下发问题 + private List problems; +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/negative/VerifyData.java b/src/main/java/com/biutag/supervision/pojo/model/negative/VerifyData.java new file mode 100644 index 0000000..dd23dca --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/negative/VerifyData.java @@ -0,0 +1,281 @@ +package com.biutag.supervision.pojo.model.negative; + +import com.biutag.supervision.pojo.vo.FileVo; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class VerifyData { + + // 核查情况 + @NotBlank + private String checkStatus; + + // 核查情况 + @NotBlank + private String checkStatusName; + + // 是否整改 + @NotBlank + private String isRectifyCode; + + // 是否整改 + @NotBlank + private String isRectifyName; + + // 问题核查情况 + @NotBlank + private String checkStatusDesc; + + // 整改限制天数 + private Integer rectifyRestrictionDays; + + // 追责对象 + @NotBlank + private String accountabilityTarget; + + // 涉及案件/警情编号 + private String caseNumber; + + // 涉及单位 + private String involveDepartId; + + // 问题整改情况 + private String rectifyDesc; + + // 未整改原因 + private String unrectifyReason; + + // 核查时间 + private LocalDateTime verificationTime; + + @Size(min = 1) + private List blames = new ArrayList<>(); + + private List blameLeaders = new ArrayList<>(); + + private List files = new ArrayList<>(); + + // 经办人 + private List handlePolices; + + // 化解情况 + private String resolveSituation; + + // 当前状态 + private String resolveStatus; + + // 接访领导 + private String visitingLeaderName; + + private String visitingLeaderEmpNo; + + private String handleResult12337; + + private String handleResult12337Group; + + // 办理结果 + private String processResult; + + private String verifiedIsLeader; + + @Setter + @Getter + public static class Blame { + + // 涉及姓名 + @NotBlank + private String blameName; + + // 涉及身份证 + @NotBlank + private String blameIdCode; + + // 涉及警号 + @NotBlank + private String blameEmpNo; + + // 警种 + @NotBlank + private String policeTypeName; + + // 警种 + @NotBlank + private String policeTypeCode; + + @NotBlank + private String ivPersonType; + + // 人员属性 + @NotBlank + private String ivPersonTypeCode; + + // 核查情况code + @NotBlank + private String inspectCaseCode; + + // 核查情况 + @NotBlank + private String inspectCaseName; + + + // 督察措施 + @NotBlank + private String superviseMeasuresCode; + + // 督察措施 + @NotBlank + private String superviseMeasuresName; + + //涉及禁闭id + private String confinementId; + + + // 主观方面 + @NotBlank + private String subjectiveAspectCode; + + // 主观方面 + @NotBlank + private String subjectiveAspectName; + + // 责任类别 + @NotBlank + private String responsibilityTypeCode; + + // 责任类别 + @NotBlank + private String responsibilityTypeName; + + // 处理结果 + @NotBlank + private List handleResultCode; + + // 处理结果 + @NotBlank + private String handleResultName; + + // 其他处理结果 + private String handleResultNameOther; + + // 维权容错 + @NotBlank + private String protectRightsCode; + + // 维权容错 + @NotBlank + private String protectRightsName; + + // 问题类型 + private List problems; + + private String type; + + + + } + + @Setter + @Getter + public static class BlameLeader { + + private List blameIdCodes = new ArrayList<>(); + + // 责任领导 + @NotBlank + private String leadName; + + // 责任领导警号 + @NotBlank + private String leadEmpNo; + + // 责任领导身份证 + @NotBlank + private String leadIdCode; + + //领导禁闭id + private String leadConfinementId; + + // 三级机构 + @NotBlank + private String leadThreeDepartName; + + // 领导督察措施 + @NotBlank + private String leadMeasuresName; + + // 领导督察措施 + @NotBlank + private String leadMeasuresCode; + + // 领导责任类别 + @NotBlank + private String leadResponsibilityTypeName; + + // 领导责任类别 + @NotBlank + private String leadResponsibilityTypeCode; + + // 领导处理结果 + @NotBlank + private List leadHandleResultCode; + + // 领导处理结果 + @NotBlank + private String leadHandleResultName; + + // 领导处理结果 + private String leadHandleResultNameOther; + + // 领导维权容错 + @NotBlank + private String leadProtectRightsName; + + // 领导维权容错 + @NotBlank + private String leadProtectRightsCode; + + } + + @Setter + @Getter + public static class Problem { + + @NotBlank + private String oneLevelCode; + + @NotBlank + private String twoLevelCode; + + @NotBlank + private String oneLevelContent; + + @NotBlank + private String twoLevelContent; + + @NotBlank + private String threeLevelCode; + + @NotBlank + private String threeLevelContent; + + private String threeLevelContentOther; + + } + + @Setter + @Getter + public static class HandlePolice { + private String name; + private String idCode; + private String mobile; + } + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/ApprovalFlowQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/ApprovalFlowQueryParam.java new file mode 100644 index 0000000..abf1495 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/ApprovalFlowQueryParam.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Data; + +@Data +public class ApprovalFlowQueryParam { + + private String id; + + private String code; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/BasePage.java b/src/main/java/com/biutag/supervision/pojo/param/BasePage.java new file mode 100644 index 0000000..c259aec --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/BasePage.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class BasePage { + + private long current = 1; + private long size = 10; + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/CommonOpinionsQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/CommonOpinionsQueryParam.java new file mode 100644 index 0000000..9bac6d5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/CommonOpinionsQueryParam.java @@ -0,0 +1,9 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Data; + +@Data +public class CommonOpinionsQueryParam { + private String content; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/DepartMapingQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DepartMapingQueryParam.java new file mode 100644 index 0000000..d422103 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/DepartMapingQueryParam.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/12/30 + */ +@Setter +@Getter +public class DepartMapingQueryParam extends BasePage { + + private String externalId; + + // 外部单位名称 + private String externalName; + + private String internalId; + + // 是否已映射 + private String activeMaping; + + private String source; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java new file mode 100644 index 0000000..216fd42 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Setter +@Getter +public class DepartQueryParam extends BasePage { + + private String shortName; + + private String name; + + private String code; + + private List ids; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/DepartTreeListParam.java b/src/main/java/com/biutag/supervision/pojo/param/DepartTreeListParam.java new file mode 100644 index 0000000..f2fa5be --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/DepartTreeListParam.java @@ -0,0 +1,13 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DepartTreeListParam { + + private String pid; + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/InvertRecord/InvertRecordQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/InvertRecord/InvertRecordQueryParam.java new file mode 100644 index 0000000..ca13a41 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/InvertRecord/InvertRecordQueryParam.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.pojo.param.InvertRecord; + +import com.biutag.supervision.pojo.param.BasePage; +import lombok.Data; + +@Data +public class InvertRecordQueryParam extends BasePage { + + private String name; + + private String warningState; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java new file mode 100644 index 0000000..9dd1e35 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java @@ -0,0 +1,86 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Setter +@Getter +public class NegativeQueryParam extends BasePage { + + private String originId; + + // 问题发生时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List happenTime = new ArrayList<>(); + + // 问题发现时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List discoveryTime = new ArrayList<>(); + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List crtTime = new ArrayList<>(); + + private String responderKey; + + private String responderValue; + + private String flowKey; + + // 办理状态 + private List processingStatus = new ArrayList<>(); + + private String thingDesc; + + // 问题来源 + private List problemSourcesCode; + + private String businessTypeCode; + + private List checkStatus; + + + private String isRectifyCode; + + // 办结是否超时 + private Boolean timeoutFlag; + + private String involveDepartId; + + private String handleDepartId; + + // 是否延期 + private Boolean extensionFlag; + + // 排序 + private String order; + private String orderProp; + + private String specialSupervision; + + private String reportNumber; + + private Integer crtDepartLevel; + + // 涉及人员 + private String blameKey; + + // 涉及人员 + private String blameValue; + + private List handleResultCode = new ArrayList<>(); + + private String caseNumber; + + private String checkStatusDesc; + + private String initialPetition; + + // 操作人姓名 + private String operator; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/NegativeTaskQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/NegativeTaskQueryParam.java new file mode 100644 index 0000000..b449324 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/NegativeTaskQueryParam.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Setter +@Getter +public class NegativeTaskQueryParam extends BasePage { + + private String taskName; + + private String source; + + private String category; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List crtTime = new ArrayList<>(); + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/NewsQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/NewsQueryParam.java new file mode 100644 index 0000000..276ca55 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/NewsQueryParam.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author wxc + * @date 2024/12/31 + */ +@Setter +@Getter +public class NewsQueryParam extends BasePage { + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List releaseTime = new ArrayList<>(); + + private String source; + + // 动态分类 + private String workType; + + private String contentTxt; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/PoliceQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/PoliceQueryParam.java new file mode 100644 index 0000000..752d9f5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/PoliceQueryParam.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class PoliceQueryParam extends BasePage { + + private String applicantId; + + private String name; + private String empNo; + private String idCode; + private String phone; + private String departId; + // 当前单位及其所有子单位 + private Boolean departBranch; + private String roleId; + // 排序字段 + private String sortField; + // 排序顺序(ASC 或 DESC) + private String sortOrder; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/Price/PriceInformationQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/Price/PriceInformationQueryParam.java new file mode 100644 index 0000000..d4ab066 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/Price/PriceInformationQueryParam.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.pojo.param.Price; + +import com.biutag.supervision.pojo.param.BasePage; +import lombok.Data; + +@Data +public class PriceInformationQueryParam extends BasePage { + + + private String content; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/Recessed/RecessedParam.java b/src/main/java/com/biutag/supervision/pojo/param/Recessed/RecessedParam.java new file mode 100644 index 0000000..a08f823 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/Recessed/RecessedParam.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.pojo.param.Recessed; + +import lombok.Data; + +@Data +public class RecessedParam { + + private String id; + + private String message; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/Report/FlowQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/Report/FlowQueryParam.java new file mode 100644 index 0000000..f2b29b7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/Report/FlowQueryParam.java @@ -0,0 +1,29 @@ +package com.biutag.supervision.pojo.param.Report; + +import com.biutag.supervision.pojo.entity.negative.DataDataPetitionComplainDistribute; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; + +@Data +@Slf4j +public class FlowQueryParam { + //是否通知报审人 + private String isInform; + //项目id + private String reportId; + //审批意见 + private String message; + //下一个环节 + private String nextNode; + //是否通过 + private Boolean isAudit; + //审核人 + private String approver; + //审核人id + private String approverId; + //审核单位 + private String approverUnit; + //审核单位id + private String approverUnitId; + private DataDataPetitionComplainDistribute data; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/Report/ReportProjectQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/Report/ReportProjectQueryParam.java new file mode 100644 index 0000000..1d73672 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/Report/ReportProjectQueryParam.java @@ -0,0 +1,31 @@ +package com.biutag.supervision.pojo.param.Report; + +import com.biutag.supervision.pojo.entity.report.ReportFile; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.report.ReportReview; +import com.biutag.supervision.pojo.vo.report.ReportFileVo; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * @author weipeng + */ +@Data +public class ReportProjectQueryParam { + + //项目id + private String id; + + private String name; + + //项目信息 + public ReportProject project; + //审计信息 + public ReportReview review; + + //附件列表 + public Map> files; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/RoleQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/RoleQueryParam.java new file mode 100644 index 0000000..c897e44 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/RoleQueryParam.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class RoleQueryParam { + + private String roleName; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/ServiceUnit/ServiceUnitQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/ServiceUnit/ServiceUnitQueryParam.java new file mode 100644 index 0000000..c54ad40 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/ServiceUnit/ServiceUnitQueryParam.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.param.ServiceUnit; + +import com.biutag.supervision.pojo.param.BasePage; +import lombok.Data; + +@Data +public class ServiceUnitQueryParam extends BasePage { + //服务项目 + private String project; + //服务单位 + private String serviceUnit; + //服务单位负责人 + private String serviceUnitManager; + //服务单位联系人电话 + private String serviceUnitPhone; + + private String departId; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/SupRotaQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/SupRotaQueryParam.java new file mode 100644 index 0000000..5614e46 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/SupRotaQueryParam.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDate; +import java.util.Date; + +@Getter +@Setter +public class SupRotaQueryParam { + + private String deptId; + + @DateTimeFormat(pattern = "yyyy-MM-dd") + private String date; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/UserQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/UserQueryParam.java new file mode 100644 index 0000000..2080e06 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/UserQueryParam.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Setter +@Getter +public class UserQueryParam extends BasePage { + + private String userName; + private String nickName; + private List roleId; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/Warning/WarningQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/Warning/WarningQueryParam.java new file mode 100644 index 0000000..43f093d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/Warning/WarningQueryParam.java @@ -0,0 +1,34 @@ +package com.biutag.supervision.pojo.param.Warning; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.biutag.supervision.pojo.param.BasePage; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class WarningQueryParam extends BasePage { + + private String id; + //项目名称 + private String reportName; + //项目单位 + private String projectUnitId; + //审计单位 + private String auditUnitId; + //预警监督状志 + private String warningState; + //发文日期 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @TableField("publication_date") + private List publicationDate; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @TableField("publication_date") + public List endDate; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/Work/ProjectWorkQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/Work/ProjectWorkQueryParam.java new file mode 100644 index 0000000..a4a8ac8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/Work/ProjectWorkQueryParam.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.pojo.param.Work; + +import lombok.Data; + +@Data +public class ProjectWorkQueryParam { + //用户id + private String userId; + //状态码 + private String code; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/entryWindow/EntryWindowQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/entryWindow/EntryWindowQueryParam.java new file mode 100644 index 0000000..a851308 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/entryWindow/EntryWindowQueryParam.java @@ -0,0 +1,77 @@ +package com.biutag.supervision.pojo.param.entryWindow; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.biutag.supervision.pojo.param.BasePage; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class EntryWindowQueryParam extends BasePage { + + private String departId; + //报审类型 + private String reportType; + //项目名称 + private String reportName; + //项目类别 + private String projectType; + //审计单位id + private String auditUnitId; + //审计单位 + private String auditUnit; + //项目单位id + private String projectUnitId; + //项目单位 + private String projectUnit; + + private String applicantId; + //项目负责人 + private String projectPrincipal; + //负责人联系方式 + private String projectPhone; + //采购方式 + private String purchaseMethod; + //报审金额 + private BigDecimal reportMoney; + //立项金额 + private BigDecimal projectApprovalMoney; + //是否退窗 + private String code; + + //报审日期 + @DateTimeFormat(pattern = "yyyy-MM-dd") + private List applicantTime; + //立项日期 + @DateTimeFormat(pattern = "yyyy-MM-dd") + private List projectApprovalTime; + //申报政府采购日期 + @DateTimeFormat(pattern = "yyyy-MM-dd") + private List applyGovernmentTime; + //采购方式 + @TableField("purchase_type") + private String purchaseType; + //采购日期 + @DateTimeFormat(pattern = "yyyy-MM-dd") + private List purchaseTime; + //合同签订日期 + @DateTimeFormat(pattern = "yyyy-MM-dd") + private List contractTime; + //合同金额 + @TableField("contract_mount") + private BigDecimal contractMount; + //服务单位 + @TableField("service_unit") + private String serviceUnit; + + //服务日期(开始) + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDateTime serviceStartTime; + + //服务日期(结束) + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDateTime serviceEndTime; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/statement/StatementQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/statement/StatementQueryParam.java new file mode 100644 index 0000000..fd990d6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/statement/StatementQueryParam.java @@ -0,0 +1,62 @@ +package com.biutag.supervision.pojo.param.statement; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.param.BasePage; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class StatementQueryParam extends BasePage { + + @TableId + private String id; + //报审类型 + @TableField("report_type") + private String reportType; + //项目名称 + @TableField("report_name") + private String reportName; + //文号 + @TableField("reference_number") + private String referenceNumber; + //项目类别 + @TableField("project_type") + private String projectType; + //报审单位id + @TableField("project_unit_id") + private String projectUnitId; + //审计单位id + @TableField("audit_unit_id") + private String auditUnitId; + //采购方式 + @TableField("purchase_method") + private String purchaseMethod; + //报审日期 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List applicantDateTime; + //环节 + @TableField("node") + private String node; + //发文日期 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List publicationTime; + + //(归档时间) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List archivingTime; + + //区分审结、审计备案 + private String code; + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DepartTree.java b/src/main/java/com/biutag/supervision/pojo/vo/DepartTree.java new file mode 100644 index 0000000..cb45544 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DepartTree.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class DepartTree { + + private String id; + + private String pid; + + private String type; + + private String category; + + private String code; + + private String name; + + private String shortName; + + private Integer level; + + private String status; + + private Integer orderNo; + + private String updatedAt; + + private String img; + + private List children = new ArrayList<>(); + + private boolean hasChildren = false; + + private Boolean firstHost; + + private String statisticsGroupId; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java b/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java new file mode 100644 index 0000000..db2e569 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java @@ -0,0 +1,48 @@ +package com.biutag.supervision.pojo.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class DictContentTree { + + private String id; + + // 类型名称 + private String name; + + // 类型编码 + private String code; + + // 父级code + private String parentCode; + + // 状态 + private String status; + + // 备注 + private String remark; + + + // + private Integer level; + + // 排序 + private Integer sort; + + private Double score; + + // 是否开启严重等级 + private Boolean isActiveLevel; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updTime; + + private List children = new ArrayList<>(); +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java b/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java new file mode 100644 index 0000000..f8d1845 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class DictProblemSourceTree { + + private String id; + + private String parentId; + + private String label; + + private Integer sort; + + private List children = new ArrayList<>(); + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/EchartsVo.java b/src/main/java/com/biutag/supervision/pojo/vo/EchartsVo.java new file mode 100644 index 0000000..72705b4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/EchartsVo.java @@ -0,0 +1,32 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Auther: sh + * @Date: 2024/11/11 18:21 + * @Description: + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class EchartsVo { + private String name; + private Integer value; + + public static List generateMonthlyData() { + List monthlyData = new ArrayList<>(); + String[] months = {"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"}; + for (String month : months) { + monthlyData.add(new EchartsVo(month, 0)); + } + return monthlyData; + } + +} + diff --git a/src/main/java/com/biutag/supervision/pojo/vo/FileVo.java b/src/main/java/com/biutag/supervision/pojo/vo/FileVo.java new file mode 100644 index 0000000..d5b0b58 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/FileVo.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Accessors(chain = true) +@Setter +@Getter +public class FileVo { + + private String id; + + private String confinementId; + + private String filePath; + + private String fileName; + + private Integer fileClassId; + + private String base64; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/InvertRecord/InvertRecordVo.java b/src/main/java/com/biutag/supervision/pojo/vo/InvertRecord/InvertRecordVo.java new file mode 100644 index 0000000..7d61d1c --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/InvertRecord/InvertRecordVo.java @@ -0,0 +1,41 @@ +package com.biutag.supervision.pojo.vo.InvertRecord; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import lombok.Data; + +@Data +public class InvertRecordVo { + + @TableId + private String id; + + @TableField("warning") + private String warning; + + @TableField("report") + private String report; + + @TableField("report_id") + private String reportId; + + @TableField("warning_id") + private String warningId; + + @TableField("warning_state") + private String warningState; + + private String reportName; + + private String reportType; + + private String projectType; + + private String projectPrincipal; + + private String projectPhone; + + private String warningSupervision; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/MenuTree.java b/src/main/java/com/biutag/supervision/pojo/vo/MenuTree.java new file mode 100644 index 0000000..9df8593 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/MenuTree.java @@ -0,0 +1,67 @@ +package com.biutag.supervision.pojo.vo; + +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.pojo.entity.Menu; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.springframework.beans.BeanUtils; + +import java.time.LocalDateTime; +import java.util.List; + +@Setter +@Getter +public class MenuTree { + + private Integer id; + + private Integer pid; + + // 菜单类型 + private String menuType; + + // 菜单名称 + private String menuName; + + // 菜单图标 + private String icon; + + // 路径 + private String paths; + + private String component; + + // 排序 + private Integer menuSort; + + private String perms; + + private Integer isCache; + + private Integer isShow; + + private Integer isDisable; + + // 是否打开新页面 默认为false + private Boolean openNewPage; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + private List children; + + public static List buildTree(List list) { + return buildTree(list, AppConstants.TREE_ROOT_ID); + } + + public static List buildTree(List list, Integer pid) { + return list.stream().filter(item -> pid.equals(item.getPid())).map(item -> { + MenuTree menuTree = new MenuTree(); + BeanUtils.copyProperties(item, menuTree); + menuTree.setChildren(buildTree(list, item.getId())); + return menuTree; + }).toList(); + } + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/SelectOption.java b/src/main/java/com/biutag/supervision/pojo/vo/SelectOption.java new file mode 100644 index 0000000..3a4f04c --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/SelectOption.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2025/7/25 + */ +@Setter +@Getter +public class SelectOption { + + private String text; + + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/SelectOptionGroup.java b/src/main/java/com/biutag/supervision/pojo/vo/SelectOptionGroup.java new file mode 100644 index 0000000..24303eb --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/SelectOptionGroup.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2025/7/25 + */ +@Setter +@Getter +public class SelectOptionGroup { + + private String label; + + private List options = new ArrayList<>(); + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/ServiceUnit/ServiceUnitVo.java b/src/main/java/com/biutag/supervision/pojo/vo/ServiceUnit/ServiceUnitVo.java new file mode 100644 index 0000000..794f2db --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/ServiceUnit/ServiceUnitVo.java @@ -0,0 +1,39 @@ +package com.biutag.supervision.pojo.vo.ServiceUnit; + +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class ServiceUnitVo { + + + private String id; + + private String project; + + private String projectId; + // 服务单位 + private String serviceUnit; + //服务单位负责人 + private String serviceUnitManager; + //服务单位联系电话 + private String serviceUnitPhone; + //创建时间 + @DateTimeFormat("yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime crtTime; + //创建人 + private String crtUser; + //采购单位id + private String purchasingUnitId; + //采购单位 + private String purchasingUnit; + //采购单位负责人 + private String purchasingUnitManager; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/TokenVo.java b/src/main/java/com/biutag/supervision/pojo/vo/TokenVo.java new file mode 100644 index 0000000..a149800 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/TokenVo.java @@ -0,0 +1,13 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Accessors(chain = true) +@Setter +@Getter +public class TokenVo { + + private String token; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/entryWindow/EntryWindowVo.java b/src/main/java/com/biutag/supervision/pojo/vo/entryWindow/EntryWindowVo.java new file mode 100644 index 0000000..73c5e65 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/entryWindow/EntryWindowVo.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.pojo.vo.entryWindow; + +import com.biutag.supervision.pojo.entity.report.ReportProject; +import lombok.Data; + +/** + * @author weipeng + */ +@Data +public class EntryWindowVo extends ReportProject { + + private String count; + + private String flowUserId; + + private String warningId; + + private String warningState; + //预警问题数 + private Long warningContent; + //是否已下发问题了 + private String stateData; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/excel/ExcelControlPriceVo.java b/src/main/java/com/biutag/supervision/pojo/vo/excel/ExcelControlPriceVo.java new file mode 100644 index 0000000..0867421 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/excel/ExcelControlPriceVo.java @@ -0,0 +1,29 @@ +package com.biutag.supervision.pojo.vo.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class ExcelControlPriceVo { + //项目名称 + private String reportName; + //采购单位 + private String projectUnit; + //送审金额 + private BigDecimal reportMoney; + //审定金额 + private BigDecimal archivingMoney; + //审减金额 + private BigDecimal archivingReduceMoney; + //一审责任人 + private String firstAuditor; + //二审责任人 + private String secondAuditor; + //三审责任人 + private String thirdlyAuditor; + //服务单位 + private String serviceUnit; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/excel/ExcelPriceInformation.java b/src/main/java/com/biutag/supervision/pojo/vo/excel/ExcelPriceInformation.java new file mode 100644 index 0000000..d71d63f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/excel/ExcelPriceInformation.java @@ -0,0 +1,36 @@ +package com.biutag.supervision.pojo.vo.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class ExcelPriceInformation { + //编码 + @ExcelProperty({"编码"}) + private String code; + //名称 + @ExcelProperty({"名称"}) + private String name; + //规格型号 + @ExcelProperty({"规格型号"}) + private String model; + //单位 + @ExcelProperty({"单位"}) + private String unit; + //数量 + @ExcelProperty({"数量"}) + private String amount; + //单价(元) + @ExcelProperty({"单价(元)"}) + private BigDecimal univalent; + //合计(元) + @ExcelProperty({"合计(元)"}) + private BigDecimal total; + + //备注 + @ExcelProperty({"备注"}) + private String remark; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/excel/ExcelServiceUnit.java b/src/main/java/com/biutag/supervision/pojo/vo/excel/ExcelServiceUnit.java new file mode 100644 index 0000000..c51b202 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/excel/ExcelServiceUnit.java @@ -0,0 +1,40 @@ +package com.biutag.supervision.pojo.vo.excel; + + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class ExcelServiceUnit { + + + @ExcelProperty({"项目名称"}) + private String project; + + @ExcelProperty({"服务单位"}) + private String serviceUnit; + //服务单位负责人 + @ExcelProperty({"服务单位负责人"}) + private String serviceUnitManager; + //服务单位联系电话 + @ExcelProperty({"服务单位联系电话"}) + private String serviceUnitPhone; + //采购单位 + @ExcelProperty({"采购单位"}) + private String purchasingUnit; + //采购单位负责人 + @ExcelProperty({"采购单位负责人"}) + private String purchasingUnitManager; + //创建人 + @ExcelProperty({"创建人"}) + private String crtUser; + //创建时间 + @DateTimeFormat("yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @ExcelProperty({"创建时间"}) + private LocalDateTime crtTime; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/price/PriceInformationVo.java b/src/main/java/com/biutag/supervision/pojo/vo/price/PriceInformationVo.java new file mode 100644 index 0000000..33ed568 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/price/PriceInformationVo.java @@ -0,0 +1,43 @@ +package com.biutag.supervision.pojo.vo.price; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class PriceInformationVo { + + private String id; + + private String projectName; + //编码 + private String code; + //名称 + private String name; + //规格型号 + private String model; + //单位 + private String unit; + //数量 + private String amount; + //单价(元) + private BigDecimal univalent; + //合计(元) + private BigDecimal total; + + //备注 + private String remark; + + //项目id + private String fileId; + + private String fileName; + + private String filePath; + + private String information; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/report/ReportFileVo.java b/src/main/java/com/biutag/supervision/pojo/vo/report/ReportFileVo.java new file mode 100644 index 0000000..49711f0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/report/ReportFileVo.java @@ -0,0 +1,39 @@ +package com.biutag.supervision.pojo.vo.report; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.biutag.supervision.pojo.vo.FileVo; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class ReportFileVo { + + private String id; + //报审项目id + private String reportId; + //附件类型 + private String type; + //附件id + private String fileId; + //附件地址 + private List fileData; + //资料名称 + private String fileName; + //附件名称 + private String name; + //创建人 + private String crtUser; + //创建时间 + @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime crtTime; + //附件归属环节 + private String fileNode; + + private Boolean request; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/report/ReportHomeVo.java b/src/main/java/com/biutag/supervision/pojo/vo/report/ReportHomeVo.java new file mode 100644 index 0000000..184c2ca --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/report/ReportHomeVo.java @@ -0,0 +1,32 @@ +package com.biutag.supervision.pojo.vo.report; + +import com.biutag.supervision.pojo.entity.report.ReportFile; +import com.biutag.supervision.pojo.entity.report.ReportFlow; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class ReportHomeVo { + + //项目名称 + private String reportName; + //报审类型 + private String reportType; + //项目类别 + private String projectType; + //报审金额 + private String reportMoney; + //报审日期 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime areportTime; + //审批时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime applicantTime; + //审批状态列表 + private List flows; + + private String node; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/report/ReportProjectVo.java b/src/main/java/com/biutag/supervision/pojo/vo/report/ReportProjectVo.java new file mode 100644 index 0000000..495406f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/report/ReportProjectVo.java @@ -0,0 +1,29 @@ +package com.biutag.supervision.pojo.vo.report; + +import com.biutag.supervision.pojo.entity.report.ReportFile; +import com.biutag.supervision.pojo.entity.report.ReportFlow; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.report.ReportReview; +import com.biutag.supervision.pojo.vo.FileVo; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; +import java.util.Map; + +/** + * @author weipeng + * 报审项目返回结果 + */ +@Data +public class ReportProjectVo { + + private ReportProject project; + + private ReportReview review; + + private Map> files; + + private List flows; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/statement/ConditionExcelVo.java b/src/main/java/com/biutag/supervision/pojo/vo/statement/ConditionExcelVo.java new file mode 100644 index 0000000..d302ba7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/statement/ConditionExcelVo.java @@ -0,0 +1,89 @@ +package com.biutag.supervision.pojo.vo.statement; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +public class ConditionExcelVo { + + @ExcelProperty(value = "报审单位") + private String projectUnit; + + @ExcelProperty(value = "审计单位") + private String auditUnit; + + @ExcelProperty(value = "项目类型") + private String projectType; + + @ExcelProperty(value = "项目名称") + private String reportName; + + //主要内容 + @ExcelProperty(value = "主要内容") + private String content; + + @ExcelProperty(value = "采购方式") + private String purchaseMethod; + + @ExcelProperty(value = "项目立项领导") + private String projectApprovalLead; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelProperty(value = "报审日期") + private LocalDateTime applicantTime; + + @ExcelProperty(value = "报审金额(元)") + private BigDecimal reportMoney; + + @ExcelProperty(value = "审定金额(元)") + private BigDecimal archivingMoney; + + @ExcelProperty(value = "审减金额(元)") + private BigDecimal archivingReduceMoney; + + @ExcelProperty(value = "审减率") + private BigDecimal reductionRate; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelProperty(value = "立项日期") + private LocalDateTime projectApprovalTime; + + @ExcelProperty(value = "施工(服务、供货)单位") + private String serviceUnit; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelProperty(value = "施工(服务)期限起") + private LocalDateTime serviceStartTime; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelProperty(value = "施工(服务)期限止") + private LocalDateTime serviceEndTime; + + //审计报告审批领导 + @ExcelProperty(value = "审计报告审批领导") + private String approvalSupervisor; + + @ExcelProperty(value = "审计报告文号") + private String referenceNumber; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelProperty(value = "发文日期") + private LocalDateTime publicationDate; + + @ExcelProperty(value = "进度") + private String node; + + @ExcelProperty(value = "归档日期") + private String archiving; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/statement/ConditionVo.java b/src/main/java/com/biutag/supervision/pojo/vo/statement/ConditionVo.java new file mode 100644 index 0000000..e096dfe --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/statement/ConditionVo.java @@ -0,0 +1,94 @@ +package com.biutag.supervision.pojo.vo.statement; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableId; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +public class ConditionVo { + @TableId + private String id; + + @ExcelProperty(value = "报审单位") + private String projectUnit; + + @ExcelProperty(value = "审计单位") + private String auditUnit; + + @ExcelProperty(value = "项目类型") + private String projectType; + + @ExcelProperty(value = "项目名称") + private String reportName; + + //主要内容 + @ExcelProperty(value = "主要内容") + private String content; + + @ExcelProperty(value = "采购方式") + private String purchaseMethod; + + private String reportType; + + @ExcelProperty(value = "项目立项领导") + private String projectApprovalLead; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelProperty(value = "报审日期") + private LocalDateTime applicantTime; + + @ExcelProperty(value = "报审金额(元)") + private BigDecimal reportMoney; + + @ExcelProperty(value = "审定金额(元)") + private BigDecimal archivingMoney; + + @ExcelProperty(value = "审减金额(元)") + private BigDecimal archivingReduceMoney; + + @ExcelProperty(value = "审减率") + private BigDecimal reductionRate; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelProperty(value = "立项日期") + private LocalDateTime projectApprovalTime; + + @ExcelProperty(value = "施工(服务、供货)单位") + private String serviceUnit; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelProperty(value = "施工(服务)期限起") + private LocalDateTime serviceStartTime; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelProperty(value = "施工(服务)期限止") + private LocalDateTime serviceEndTime; + + //审计报告审批领导 + @ExcelProperty(value = "审计报告审批领导") + private String approvalSupervisor; + + @ExcelProperty(value = "审计报告文号") + private String referenceNumber; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelProperty(value = "发文日期") + private LocalDateTime publicationDate; + + @ExcelProperty(value = "进度") + private String node; + @ExcelProperty(value = "归档日期") + private LocalDateTime archiving; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/warning/WaringVo.java b/src/main/java/com/biutag/supervision/pojo/vo/warning/WaringVo.java new file mode 100644 index 0000000..5813989 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/warning/WaringVo.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.pojo.vo.warning; + +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.warning.WarningContent; +import com.biutag.supervision.pojo.entity.warning.WarningRecord; +import lombok.Data; + +import java.util.List; + +@Data +public class WaringVo { + //项目信息 + private ReportProject reportProject; + + //预警信息 + private WarningRecord record; + + //预警内容信息 + private List contents; + + private String isSubmit; + + private String code; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/warning/WarningInformData.java b/src/main/java/com/biutag/supervision/pojo/vo/warning/WarningInformData.java new file mode 100644 index 0000000..9bdfe55 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/warning/WarningInformData.java @@ -0,0 +1,13 @@ +package com.biutag.supervision.pojo.vo.warning; + +import lombok.Data; + +@Data +public class WarningInformData { + //信息 + private String message; + //报审单位 + private String unit; + //日期 + private String approverTime; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/work/MessageWorkVo.java b/src/main/java/com/biutag/supervision/pojo/vo/work/MessageWorkVo.java new file mode 100644 index 0000000..5681750 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/work/MessageWorkVo.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.pojo.vo.work; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class MessageWorkVo { + //通知id + private String id; + //项目名称 + private String reportName; + //流程状态 + private String flowState; + //环节 + private String node; + //通知信息 + private String message; + //发送时间 + private LocalDateTime crtTime; + //创建人 + private String crtUser; + //是否已读 + private String isRead; + //是否为审计审核发送的信息 + private String isWarning; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/work/ProjectTabWorkVo.java b/src/main/java/com/biutag/supervision/pojo/vo/work/ProjectTabWorkVo.java new file mode 100644 index 0000000..0d8b833 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/work/ProjectTabWorkVo.java @@ -0,0 +1,15 @@ +package com.biutag.supervision.pojo.vo.work; + +import lombok.Data; + +@Data +public class ProjectTabWorkVo { + //待办 + private int first; + //已办 + private int second; + //未读 + private Long unread; + //已读 + private Long read; +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/work/ProjectWorkVo.java b/src/main/java/com/biutag/supervision/pojo/vo/work/ProjectWorkVo.java new file mode 100644 index 0000000..559cd6a --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/work/ProjectWorkVo.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.pojo.vo.work; + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class ProjectWorkVo { + + //项目名称 + public String reportName; + //项目类型 + public String reportType; + //操作 + public String work; + //报审时间 + public LocalDateTime time; + //报告id + public String reportId; + //状态码 + public String flowState; + //环节状态码 + public String flowCode; + //是否为审计预警状态 + public int isWarning; + //审计预警id + public String warningId; +} diff --git a/src/main/java/com/biutag/supervision/service/BaseAccountService.java b/src/main/java/com/biutag/supervision/service/BaseAccountService.java new file mode 100644 index 0000000..4c3a538 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BaseAccountService.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.BaseAccount; +import com.biutag.supervision.mapper.BaseAccountMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class BaseAccountService extends ServiceImpl { + + public BaseAccount getByAccount(String account) { + return getOne(new LambdaQueryWrapper().eq(BaseAccount::getAccount, account)); + } + + public List getByLogin(String account) { + return baseMapper.selectByLogin(account); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/BaseRoleService.java b/src/main/java/com/biutag/supervision/service/BaseRoleService.java new file mode 100644 index 0000000..e005118 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BaseRoleService.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.enums.StatusEnum; +import com.biutag.supervision.pojo.entity.BaseRole; +import com.biutag.supervision.mapper.BaseRoleMapper; +import com.biutag.supervision.pojo.entity.BaseRoleUser; +import com.biutag.supervision.pojo.param.RoleQueryParam; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +@RequiredArgsConstructor +@Service +public class BaseRoleService extends ServiceImpl { + + private final BaseRoleUserService roleUserService; + + public List listByUserId(String userId) { + List baseRoleUsers = roleUserService.listByUserId(userId); + if (baseRoleUsers.isEmpty()) { + throw new RuntimeException("该用户尚未配置角色,请联系系统管理员!"); + } + return listByIds(baseRoleUsers.stream().map(BaseRoleUser::getRoleId).toList()); + } + + public List list(RoleQueryParam roleQueryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like(StrUtil.isNotBlank(roleQueryParam.getRoleName()), BaseRole::getRoleName, roleQueryParam.getRoleName()) + .eq(BaseRole::getStatus, StatusEnum.ENABLE.getValue()); + return list(queryWrapper); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/BaseRoleUserService.java b/src/main/java/com/biutag/supervision/service/BaseRoleUserService.java new file mode 100644 index 0000000..411dea8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BaseRoleUserService.java @@ -0,0 +1,25 @@ +package com.biutag.supervision.service; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.BaseRole; +import com.biutag.supervision.pojo.entity.BaseRoleUser; +import com.biutag.supervision.mapper.BaseRoleUserMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + + +@Service +public class BaseRoleUserService extends ServiceImpl { + + public List listByUserId(String userId) { + return list(new LambdaQueryWrapper().eq(BaseRoleUser::getUserId, userId)); + } + + public boolean remove(String userId) { + return remove(new LambdaQueryWrapper().eq(BaseRoleUser::getUserId, userId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/BaseUserService.java b/src/main/java/com/biutag/supervision/service/BaseUserService.java new file mode 100644 index 0000000..db0021f --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BaseUserService.java @@ -0,0 +1,164 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.BaseUserMapper; +import com.biutag.supervision.pojo.dto.UserDto; +import com.biutag.supervision.pojo.entity.BaseAccount; +import com.biutag.supervision.pojo.entity.BaseRole; +import com.biutag.supervision.pojo.entity.BaseRoleUser; +import com.biutag.supervision.pojo.entity.BaseUser; +import com.biutag.supervision.pojo.model.UserModel; +import com.biutag.supervision.pojo.param.UserQueryParam; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.security.crypto.bcrypt.BCrypt; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + + + +@RequiredArgsConstructor +@Service +public class BaseUserService extends ServiceImpl { + + private final BaseRoleUserService roleUserService; + + private final BaseRoleService roleService; + + private final BaseAccountService accountService; + + public Page page(UserQueryParam queryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(queryParam.getUserName()), BaseUser::getUserName, queryParam.getUserName()) + .like(StrUtil.isNotBlank(queryParam.getNickName()), BaseUser::getNickName, queryParam.getNickName()); + if (Objects.nonNull(queryParam.getRoleId()) && !queryParam.getRoleId().isEmpty()) { + List userIds = roleUserService.list(new LambdaQueryWrapper() + .in(BaseRoleUser::getRoleId, queryParam.getRoleId())).stream().map(BaseRoleUser::getUserId).toList(); + if (userIds.isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + queryWrapper.in(BaseUser::getUserId, userIds); + } + queryWrapper.orderByDesc(BaseUser::getUpdateTime); + Page baseUserPage = page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + if (baseUserPage.getRecords().isEmpty()) { + return new Page().setRecords(new ArrayList<>()).setTotal(0); + } + List roleUsers = roleUserService.list(new LambdaQueryWrapper() + .in(BaseRoleUser::getUserId, baseUserPage.getRecords().stream().map(BaseUser::getUserId).toList())); + List roleList; + if (!roleUsers.isEmpty()) { + roleList = roleService.listByIds(roleUsers.stream().map(BaseRoleUser::getRoleId).collect(Collectors.toSet())); + } else { + roleList = new ArrayList<>(); + } + List records = baseUserPage.getRecords().stream().map(item -> { + UserModel userModel = new UserModel(); + BeanUtils.copyProperties(item, userModel); + List roleIds = roleUsers.stream().filter(roleUser -> item.getUserId().equals(roleUser.getUserId())).map(BaseRoleUser::getRoleId).toList(); + userModel.setRoleIds(roleIds); + List roleNames = roleList.stream().filter(role -> roleIds.contains(role.getRoleId())).map(BaseRole::getRoleName).toList(); + userModel.setRoleNames(roleNames); + return userModel; + }).toList(); + return new Page().setRecords(records).setTotal(baseUserPage.getTotal()); + } + + public BaseUser getByUserName(String userName) { + return getOne(new LambdaQueryWrapper().eq(BaseUser::getUserName, userName)); + } + + public List getRoleIds(String userName) { + BaseUser user = getByUserName(userName); + List roleUsers = roleUserService.list(new LambdaQueryWrapper() + .eq(BaseRoleUser::getUserId, user.getUserId())); + return roleUsers.stream().map(BaseRoleUser::getRoleId).distinct().toList(); + } + + @DSTransactional(rollbackFor = Exception.class) + public boolean save(UserDto userDto) { + if (exists(new LambdaQueryWrapper().eq(BaseUser::getUserName, userDto.getUserName()))) { + throw new RuntimeException(String.format("该用户[登录名:%s]已存在", userDto.getUserName())); + } + BaseUser baseUser = new BaseUser(); + BeanUtils.copyProperties(userDto, baseUser); + baseUser.setUserId(IdUtil.getSnowflakeNextIdStr()); + baseUser.setUpdateTime(LocalDateTime.now()); + baseUser.setCreateTime(LocalDateTime.now()); + save(baseUser); + if (!userDto.getRoleIds().isEmpty()) { + roleUserService.saveBatch(userDto.getRoleIds().stream().map(roleId -> { + BaseRoleUser baseRoleUser = new BaseRoleUser(); + baseRoleUser.setUserId(baseUser.getUserId()); + baseRoleUser.setRoleId(roleId); + baseRoleUser.setCreateTime(LocalDateTime.now()); + baseRoleUser.setUpdateTime(LocalDateTime.now()); + return baseRoleUser; + }).toList()); + } + BaseAccount account = new BaseAccount(); + BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); + String encode = encoder.encode(userDto.getPassword()); + account.setPassword(encode); + account.setAccount(userDto.getUserName()); + account.setAccountId(IdUtil.getSnowflakeNextIdStr()); + account.setUserId(baseUser.getUserId()); + account.setAccountType("username"); + account.setDomain("@admin.com"); + account.setCreateTime(LocalDateTime.now()); + account.setUpdateTime(LocalDateTime.now()); + return accountService.save(account); + } + + public boolean update(UserDto userDto) { + updateRoleCode(userDto.getUserId(), userDto.getRoleIds()); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() + .eq(BaseUser::getUserId, userDto.getUserId()) + .set(BaseUser::getNickName, userDto.getNickName()) + .set(BaseUser::getEmail, userDto.getEmail()) + .set(BaseUser::getMobile, userDto.getMobile()) + .set(BaseUser::getUserName, userDto.getUserName()) + .set(BaseUser::getUserDesc, userDto.getUserDesc()) + .set(BaseUser::getUpdateTime, LocalDateTime.now()); + if(update(updateWrapper)){ + return updateRoleCode(userDto.getUserId(),userDto.getRoleIds()); + }else{ + return false; + } + } + + public boolean updateRoleCode(String userId, List roleIds) { + roleUserService.remove(new LambdaQueryWrapper().eq(BaseRoleUser::getUserId, userId)); + if (!roleIds.isEmpty()) { + roleUserService.saveBatch(roleIds.stream().map(roleId -> { + BaseRoleUser baseRoleUser = new BaseRoleUser(); + baseRoleUser.setUserId(userId); + baseRoleUser.setRoleId(roleId); + baseRoleUser.setCreateTime(LocalDateTime.now()); + baseRoleUser.setUpdateTime(LocalDateTime.now()); + return baseRoleUser; + }).toList()); + } + return true; + } + + public boolean updateRoleCodeByUserName(String userName, List roleIds) { + BaseUser user = getByUserName(userName); + return updateRoleCode(user.getUserId(), roleIds); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/CommonOpinionsService.java b/src/main/java/com/biutag/supervision/service/CommonOpinionsService.java new file mode 100644 index 0000000..14a0578 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/CommonOpinionsService.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.CommonOpinionsMapper; +import com.biutag.supervision.pojo.entity.CommonOpinions; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class CommonOpinionsService extends ServiceImpl { + + +} diff --git a/src/main/java/com/biutag/supervision/service/FeedbackService.java b/src/main/java/com/biutag/supervision/service/FeedbackService.java new file mode 100644 index 0000000..6c4ab43 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/FeedbackService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.Feedback; +import com.biutag.supervision.mapper.FeedbackMapper; +import org.springframework.stereotype.Service; + +@Service +public class FeedbackService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/FileClassService.java b/src/main/java/com/biutag/supervision/service/FileClassService.java new file mode 100644 index 0000000..e191a97 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/FileClassService.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.FileClass; +import com.biutag.supervision.mapper.FileClassMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FileClassService extends ServiceImpl { + + public List list(String problemSourcesCode) { + return list(new LambdaQueryWrapper().eq(FileClass::getProblemSourcesCode, problemSourcesCode).orderByAsc(FileClass::getSortId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/FileService.java b/src/main/java/com/biutag/supervision/service/FileService.java new file mode 100644 index 0000000..7e50f65 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/FileService.java @@ -0,0 +1,65 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.biutag.supervision.mapper.FileBase64Mapper; +import com.biutag.supervision.pojo.entity.FileBase64; +import com.biutag.supervision.util.ImgUtils; +import com.github.tobato.fastdfs.domain.fdfs.StorePath; +import com.github.tobato.fastdfs.service.FastFileStorageClient; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Base64; + +@RequiredArgsConstructor +@Service +public class FileService { + + private final FastFileStorageClient fastFileStorageClient; + + private final FileBase64Mapper fileBase64Mapper; + + @Value("${fdfs.preview-url}") + private String FDFS_PREVIEW_URL; + + public String upload(MultipartFile file) throws IOException { + return upload(file.getInputStream(), file.getSize(), FileUtil.extName(file.getOriginalFilename())); + } + + public String upload(InputStream is, long size, String fileExtName) { + StorePath storePath = fastFileStorageClient.uploadFile("group1", is, size, fileExtName); + return "/" + storePath.getFullPath(); + } + + public String uploadBase64(String base64, String originalFilename) { + if (base64.contains(",")) { + base64 = base64.substring(base64.indexOf(",") + 1); + } + byte[] decodedBytes = Base64.getDecoder().decode(base64); + ByteArrayInputStream is = new ByteArrayInputStream(decodedBytes); + String extName = FileUtil.extName(originalFilename); + String filePath = upload(is, is.available(), extName); + FileBase64 fileBase64 = new FileBase64(); + fileBase64.setFilePath(filePath); + if (ImgUtils.isImg(originalFilename)) { + base64 = String.format("data:image/%s;base64,", extName.toLowerCase()) + base64; + } + fileBase64.setBase64(base64); + fileBase64Mapper.insert(fileBase64); + return filePath; + } + + public InputStream download(String filePath) { + HttpResponse httpResponse = HttpUtil.createGet(FDFS_PREVIEW_URL + filePath) + .execute(); + return httpResponse.bodyStream(); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/FlowService.java b/src/main/java/com/biutag/supervision/service/FlowService.java new file mode 100644 index 0000000..8cc51e9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/FlowService.java @@ -0,0 +1,73 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.flow.action.Action; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.entity.negative.Negative; +import com.biutag.supervision.pojo.entity.negative.NegativeHistory; +import com.biutag.supervision.pojo.entity.negative.NegativeWork; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.Negative.NegativeHistoryService; +import com.biutag.supervision.service.Negative.NegativeService; +import com.biutag.supervision.service.Negative.NegativeWorkService; +import com.biutag.supervision.util.JSON; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; + +@RequiredArgsConstructor +@Service +@DS("szdczx") +public class FlowService { + + private final List actions; + + private final NegativeHistoryService negativeHistoryService; + + private final NegativeWorkService workService; + + private final SupDepartService departService; + + private final NegativeService negativeService; + + public Boolean execute(ActionDto actionDto) { + Action action = actions + .stream() + .filter(item -> item.getClass().getSimpleName().startsWith(StrUtil.upperFirst(StrUtil.toCamelCase(actionDto.getActionKey())) + "Action")) + .findFirst() + .orElseThrow(() -> new RuntimeException("配置异常,请联系系统管理员")); + action.next(actionDto); + if("confirmationCompletion".equals(actionDto.getActionKey())&& ObjectUtil.isNotEmpty(actionDto.getData())){ + Map maps = (Map) actionDto.getData(); + String reportNumber = StrUtil.isNotBlank(maps.get("reportNumber"))?maps.get("reportNumber"):null; + String reportId = StrUtil.isNotBlank(maps.get("reportId"))?maps.get("reportId"):null; + if(StrUtil.isNotEmpty(actionDto.getNegativeId()) && (StrUtil.isNotEmpty(reportNumber) || StrUtil.isNotEmpty(reportId))){ + negativeService.update(new LambdaUpdateWrapper().eq(Negative::getId,actionDto.getNegativeId()) + .set(StrUtil.isNotEmpty(reportId),Negative::getReportId,reportId) + .set(StrUtil.isNotEmpty(reportNumber),Negative::getReportNumber,reportNumber) + ); + } + } + + NegativeWork work = workService.getById(actionDto.getWorkId()); + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeHistory history = new NegativeHistory().setHistoryId(IdUtil.fastSimpleUUID()) + .setNegativeId(actionDto.getNegativeId()) + .setActionName(actionDto.getActionName()) + .setDepartName(departService.getById(work.getDepartId()).getShortName()) + .setCrtUser(user.getUserId()) + .setCrtUserName(user.getUserName()) + .setCrtName(user.getNickName()) + .setCrtTime(LocalDateTime.now()) + .setDataJson(JSON.toJSONString(actionDto)); + return negativeHistoryService.save(history); + } +} diff --git a/src/main/java/com/biutag/supervision/service/HolidayService.java b/src/main/java/com/biutag/supervision/service/HolidayService.java new file mode 100644 index 0000000..f78b040 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/HolidayService.java @@ -0,0 +1,42 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.HolidayMapper; +import com.biutag.supervision.pojo.entity.Holiday; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +@Slf4j +@RequiredArgsConstructor +@Service +public class HolidayService extends ServiceImpl { + + private final RedisTemplate redisTemplate; + + public List list(Integer year) { + return list(new LambdaQueryWrapper().eq(Holiday::getYear, year)); + } + + public boolean isHoliday(String date) { + long l = System.currentTimeMillis(); + Boolean result = (Boolean) redisTemplate.opsForValue().get(String.format("holiday:%s", date)); + if (Objects.nonNull(result)) { + return result; + } + Holiday holiday = getOne(new LambdaUpdateWrapper().eq(Holiday::getDate, date)); + if (Objects.isNull(holiday)) { + log.error("节假日 {} 数据未找到", date); + return false; + } + redisTemplate.opsForValue().set(String.format("holiday:%s", date), holiday.getFlag()); + return holiday.getFlag(); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/InformMessageService.java b/src/main/java/com/biutag/supervision/service/InformMessageService.java new file mode 100644 index 0000000..8d5f7c1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/InformMessageService.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.InformMessageMapper; +import com.biutag.supervision.pojo.entity.InformMessage; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@RequiredArgsConstructor +@Service +public class InformMessageService extends ServiceImpl{ +} diff --git a/src/main/java/com/biutag/supervision/service/InvertRecord/InvertRecordService.java b/src/main/java/com/biutag/supervision/service/InvertRecord/InvertRecordService.java new file mode 100644 index 0000000..19690be --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/InvertRecord/InvertRecordService.java @@ -0,0 +1,140 @@ +package com.biutag.supervision.service.InvertRecord; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.Invest.InvertRecordMapper; +import com.biutag.supervision.mapper.Report.ReportFileMapper; +import com.biutag.supervision.mapper.Report.ReportFlowMapper; +import com.biutag.supervision.mapper.Report.ReportProjectMapper; +import com.biutag.supervision.mapper.Report.ReportReviewMapper; +import com.biutag.supervision.pojo.entity.InvertRecord; +import com.biutag.supervision.pojo.entity.price.PriceInformation; +import com.biutag.supervision.pojo.entity.report.ReportFile; +import com.biutag.supervision.pojo.entity.report.ReportFlow; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.report.ReportReview; +import com.biutag.supervision.pojo.entity.warning.WarningRecord; +import com.biutag.supervision.pojo.enums.FlowStateEnum; +import com.biutag.supervision.pojo.param.InvertRecord.InvertRecordQueryParam; +import com.biutag.supervision.pojo.vo.FileVo; +import com.biutag.supervision.pojo.vo.InvertRecord.InvertRecordVo; +import com.biutag.supervision.pojo.vo.price.PriceInformationVo; +import com.biutag.supervision.pojo.vo.report.ReportFileVo; +import com.biutag.supervision.pojo.vo.report.ReportProjectVo; +import com.biutag.supervision.pojo.vo.warning.WaringVo; +import com.biutag.supervision.service.Report.ReportProjectService; +import com.biutag.supervision.service.Warning.WarningRecordService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +@RequiredArgsConstructor +@Service +public class InvertRecordService extends ServiceImpl { + + private final WarningRecordService recordService; + + private final ReportProjectMapper projectMapper; + + private final ReportReviewMapper reviewMapper; + + private final ReportFileMapper fileMapper; + + private final ReportFlowMapper flowMapper; + + public Page queryPage(Page page, QueryWrapper queryWrapper){ + return baseMapper.page(page,queryWrapper); + } + + + //归档 + public InvertRecord addInvertRecord(WarningRecord record){ + InvertRecord invertRecord = new InvertRecord(); + invertRecord.setWarningId(record.getId()); + invertRecord.setReportId(record.getReportId()); + + ReportProjectVo vo =new ReportProjectVo(); + //项目信息 + ReportProject project = projectMapper.selectById(record.getReportId()); + if(ObjectUtil.isNotEmpty(project.getServiceStartTime()) && ObjectUtil.isNotEmpty(project.getServiceEndTime())){ + List dateTimes = new ArrayList<>(); + dateTimes.add(project.getServiceStartTime()); + dateTimes.add(project.getServiceEndTime()); + project.setServiceTime(dateTimes); + } + vo.setProject(project); + //审核信息 + ReportReview review = reviewMapper.selectOne(new LambdaQueryWrapper().eq(ReportReview::getReportId,record.getReportId())); + if(ObjectUtil.isNotEmpty(review)){ + vo.setReview(review); + }else{ + review =new ReportReview(); + vo.setReview(review); + } + //项目附件 + List reportFiles = fileMapper.selectList(new LambdaQueryWrapper().eq(ReportFile::getReportId,record.getReportId())); + List reportFileVos = reportFiles.stream().map(s->{ + ReportFileVo vos = new ReportFileVo(); + BeanUtil.copyProperties(s,vos); + vos.setFileData(JSON.parseArray(s.getFiles(), FileVo.class)); + return vos; + }).toList(); + //判断有无附件 + if(CollectionUtil.isNotEmpty(reportFileVos)){ + Map> reportFileMap= reportFileVos.stream() + .collect(Collectors.groupingBy(ReportFileVo::getFileNode)); + vo.setFiles(reportFileMap); + }else{ + Map> reportFileMap =new HashMap<>(); + vo.setFiles(reportFileMap); + } + // + List flows =flowMapper.selectList(new LambdaQueryWrapper().eq(ReportFlow::getReportId,record.getReportId()).eq(ReportFlow::getType,"report")); + flows=flows.stream().filter(s->!s.getApproverState().equals(FlowStateEnum.Reject.getLabel()) && isFileFlow(project.getNode()).contains(s.getReportLink())) + .collect(Collectors.toMap( + ReportFlow::getReportCode, + Function.identity(), + (existing, replacement) -> existing + )).values().stream().toList(); + if(CollectionUtil.isNotEmpty(flows)){ + vo.setFlows(flows); + } + + WaringVo waringVo= recordService.getWarningVoFun(record.getId()); + + invertRecord.setWarning(JSONObject.toJSONString(waringVo)); + invertRecord.setReport(JSONObject.toJSONString(vo)); + invertRecord.setCrtTime(LocalDateTime.now()); + baseMapper.insert(invertRecord) ; + + return invertRecord; + } + + public List isFileFlow(String node){ + return switch (node) { + case "review" -> List.of("initial"); + case "first" -> List.of("review", "initial"); + case "second" -> List.of("review", "initial", "first"); + case "third" -> List.of("second", "review", "initial", "first"); + case "Lead" -> List.of("second", "review", "initial", "first", "third"); + case "original" -> List.of("second", "review", "initial", "first", "third", "Lead"); + case "audit" -> List.of( "original", "second", "review", "initial", "first", "third", "Lead"); + case "end" -> List.of("audit", "original", "second", "review", "initial", "first", "third", "Lead"); + default -> new ArrayList<>(); + }; + } +} diff --git a/src/main/java/com/biutag/supervision/service/MenuService.java b/src/main/java/com/biutag/supervision/service/MenuService.java new file mode 100644 index 0000000..5c30bd5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/MenuService.java @@ -0,0 +1,61 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.MenuEnum; +import com.biutag.supervision.pojo.entity.Menu; +import com.biutag.supervision.mapper.MenuMapper; +import com.biutag.supervision.pojo.entity.RoleMenu; +import com.biutag.supervision.pojo.model.UserAuth; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +@RequiredArgsConstructor +@Service +public class MenuService extends ServiceImpl { + + private final RoleMenuService roleMenuService; + + public List listAll() { + return list(new LambdaQueryWrapper() + .in(Menu::getMenuType, Arrays.asList(MenuEnum.CATALOGUE.value(), MenuEnum.MENU.value())) + .orderByAsc(Menu::getMenuSort)); + } + + public List listMenuByCurrentUser() { + UserAuth user = UserContextHolder.getCurrentUser(); + if (user.getRoleCodes().isEmpty()) { + return new ArrayList<>(); + } + List roleMenus = roleMenuService.list(user.getRoleCodes()); + if (roleMenus.isEmpty()) { + return new ArrayList<>(); + } + return list(new LambdaQueryWrapper() + .in(Menu::getMenuType, Arrays.asList(MenuEnum.CATALOGUE.value(), MenuEnum.MENU.value())) + .in(Menu::getId, roleMenus.stream().map(RoleMenu::getMenuId).collect(Collectors.toSet())) + .orderByAsc(Menu::getMenuSort)); + } + + public List listPermsByCurrentUser() { + UserAuth user = UserContextHolder.getCurrentUser(); + if (user.getRoleCodes().isEmpty()) { + return new ArrayList<>(); + } + List roleMenus = roleMenuService.list(user.getRoleCodes()); + if (roleMenus.isEmpty()) { + return new ArrayList<>(); + } + return list(new LambdaQueryWrapper() + .eq(Menu::getMenuType, MenuEnum.BUTTON.value()) + .in(Menu::getId, roleMenus.stream().map(RoleMenu::getMenuId).collect(Collectors.toSet())) + ).stream().map(Menu::getPerms).toList(); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegDepartAuthorityService.java b/src/main/java/com/biutag/supervision/service/NegDepartAuthorityService.java new file mode 100644 index 0000000..40d9d6b --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegDepartAuthorityService.java @@ -0,0 +1,34 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.NegDepartAuthorityMapper; +import com.biutag.supervision.pojo.entity.NegDepartAuthority; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service +public class NegDepartAuthorityService extends ServiceImpl { + + @Transactional(rollbackFor = Exception.class) + public boolean save(String idCode, List departs) { + remove(new LambdaQueryWrapper().eq(NegDepartAuthority::getIdCode, idCode)); + if (departs.isEmpty()) { + return true; + } + List list = departs.stream().map(departId -> { + NegDepartAuthority authority = new NegDepartAuthority(); + authority.setDepartId(departId); + authority.setIdCode(idCode); + return authority; + }).toList(); + return saveBatch(list); + } + + public List list(String idCode) { + return list(new LambdaQueryWrapper().eq(NegDepartAuthority::getIdCode, idCode)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java b/src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java new file mode 100644 index 0000000..bb2cd45 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java @@ -0,0 +1,36 @@ +package com.biutag.supervision.service; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.NegSourceAuthorityMapper; +import com.biutag.supervision.pojo.entity.NegSourceAuthority; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@DS("master") +@Service +public class NegSourceAuthorityService extends ServiceImpl { + + @Transactional(rollbackFor = Exception.class) + public boolean save(String idCode, List sources) { + remove(new LambdaQueryWrapper().eq(NegSourceAuthority::getIdCode, idCode)); + if (sources.isEmpty()) { + return true; + } + List list = sources.stream().map(source -> { + NegSourceAuthority authority = new NegSourceAuthority(); + authority.setSource(source); + authority.setIdCode(idCode); + return authority; + }).toList(); + return saveBatch(list); + } + + public List list(String idCode) { + return list(new LambdaQueryWrapper().eq(NegSourceAuthority::getIdCode, idCode)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/Negative/NegativeExtensionApplyService.java b/src/main/java/com/biutag/supervision/service/Negative/NegativeExtensionApplyService.java new file mode 100644 index 0000000..1a69704 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Negative/NegativeExtensionApplyService.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.service.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.Negative.NegativeExtensionApplyMapper; +import com.biutag.supervision.pojo.entity.negative.NegativeExtensionApply; +import org.springframework.stereotype.Service; + +@Service +@DS("szdczx") +public class NegativeExtensionApplyService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/Negative/NegativeExtensionApproveService.java b/src/main/java/com/biutag/supervision/service/Negative/NegativeExtensionApproveService.java new file mode 100644 index 0000000..ac523e9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Negative/NegativeExtensionApproveService.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.service.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.Negative.NegativeExtensionApplyMapper; +import com.biutag.supervision.pojo.entity.negative.NegativeExtensionApply; +import org.springframework.stereotype.Service; + +@DS("szdczx") +@Service +public class NegativeExtensionApproveService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/Negative/NegativeHistoryService.java b/src/main/java/com/biutag/supervision/service/Negative/NegativeHistoryService.java new file mode 100644 index 0000000..d19fc08 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Negative/NegativeHistoryService.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.service.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.Negative.NegativeHistoryMapper; +import com.biutag.supervision.pojo.entity.negative.NegativeHistory; +import org.springframework.stereotype.Service; + +@DS("szdczx") +@Service +public class NegativeHistoryService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/Negative/NegativeService.java b/src/main/java/com/biutag/supervision/service/Negative/NegativeService.java new file mode 100644 index 0000000..837de53 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Negative/NegativeService.java @@ -0,0 +1,237 @@ +package com.biutag.supervision.service.Negative; + + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSON; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.mapper.Negative.NegativeMapper; +import com.biutag.supervision.mapper.Report.ReportProjectMapper; +import com.biutag.supervision.mapper.SupDictDataTwoMapper; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.FirstDistributeData; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.entity.SupDictData; +import com.biutag.supervision.pojo.entity.SupDictDataTwo; +import com.biutag.supervision.pojo.entity.negative.DataDataPetitionComplainDistribute; +import com.biutag.supervision.pojo.entity.negative.Negative; +import com.biutag.supervision.pojo.entity.negative.NegativeThingFile; +import com.biutag.supervision.pojo.entity.negative.NegativeWork; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.warning.WarningContent; +import com.biutag.supervision.pojo.entity.warning.WarningRecord; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.model.negative.NegativeDto; +import com.biutag.supervision.pojo.vo.warning.WaringVo; +import com.biutag.supervision.service.FlowService; +import com.biutag.supervision.service.Report.ReportProjectService; +import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.service.SupDictDataTwoService; +import com.biutag.supervision.service.Warning.WarningRecordService; +import com.biutag.supervision.util.SpringUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + + +@RequiredArgsConstructor +@Service +public class NegativeService extends ServiceImpl { + + private final ReportProjectMapper reportProjectMapper; + + private final SupDepartService departService; + + private final WarningRecordService warningRecordService; + + private final SupDictDataTwoService dictDataTwoService; + + private final NegativeThingFileService thingFileService; + + private final NegativeWorkService workService; + public Boolean createNegativeData(DataDataPetitionComplainDistribute dataDistribute){ + WaringVo vo =dataDistribute.getWaringVo(); + ReportProject project = reportProjectMapper.selectById(vo.getRecord().getReportId()); + List contents = vo.getContents().stream().filter(s-> StrUtil.isNotBlank(s.getRemark())).toList(); +// String thingDesc = contents.stream().map(s->s.getRemark()).collect(Collectors.joining(",")); + contents.stream().forEach(x->{ + NegativeDto negativeDto = new NegativeDto(); + negativeDto.setOriginId(vo.getRecord().getId()); + negativeDto.setHappenTime(vo.getRecord().getSupervisionTime()); + negativeDto.setDiscoveryTime(vo.getRecord().getSupervisionTime()); + negativeDto.setProblemSourcesCode("27"); + negativeDto.setBusinessTypeCode(BusinessTypeEnum.QT.getValue()); + negativeDto.setProblemSources(ProblemSourcesEnum.get("27").getLabel()); + negativeDto.setBusinessTypeCode(dataDistribute.getBusinessTypeCode()); + negativeDto.setPoliceType(dataDistribute.getPoliceType()); + negativeDto.setInvolveProblem(dataDistribute.getInvolveProblem()); + negativeDto.setResponderName(vo.getRecord().getWarningSupervision()); + negativeDto.setContactPhone(null); + negativeDto.setThingDesc(x.getRemark()); + + SupDepart depart = departService.getById(project.getProjectUnitId()); + if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) { + negativeDto.setDepartId(project.getProjectUnitId()); + } else if (DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) { + if (DistributionFlowEnum.SECOND.getValue().equals(dataDistribute.getDistributionFlow())) { + negativeDto.setDepartId(depart.getPid()); + } else { + negativeDto.setDepartId(depart.getId()); + } + } else { + throw new RuntimeException("指定办理单位 请选择二级或三级单位"); + } + + + + negativeDto.setInvolveDepartId(project.getProjectUnitId()); + negativeDto.setInvolveDepartName(project.getProjectUnit()); + negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); + negativeDto.setApprovalFlow(dataDistribute.getApprovalFlow()); + negativeDto.setTimeLimit(dataDistribute.getTimeLimit()); + negativeDto.setMaxSignDuration(dataDistribute.getMaxSignDuration()); + negativeDto.setMaxHandleDuration(dataDistribute.getMaxHandleDuration()); + negativeDto.setMaxExtensionDuration(dataDistribute.getMaxExtensionDuration()); + negativeDto.setCaseNumber(vo.getRecord().getId()); + + //已预警 + warningRecordService.update(new LambdaUpdateWrapper().set( + WarningRecord::getFlowState,DistributionStateEnum.DISTRIBUTED.getValue() + ).eq(WarningRecord::getId,vo.getRecord().getId())); + //下发数据 + save(negativeDto); + }); + + return true; + } + + + @DS("szdczx") + public Negative save(NegativeDto negativeDto) { + Negative negative = new Negative(); + BeanUtil.copyProperties(negativeDto, negative); + + if (StrUtil.isBlank(negativeDto.getOriginId())) { + String originId = generateOriginId(negativeDto.getProblemSourcesCode(), negativeDto.getBusinessTypeCode()); + negative.setOriginId(originId); // 如果是空就生成随机的线索源 + } + + if (StrUtil.isNotBlank(negativeDto.getBusinessTypeCode())) { + SupDictDataTwo dictData = dictDataTwoService.get("businessType", negativeDto.getBusinessTypeCode()); + // 业务类型 + negative.setBusinessTypeName(Optional.ofNullable(dictData).map(SupDictDataTwo::getDictLabel).orElse(null)); + } + + // 涉及单位 + SupDepart depart = departService.getById(negative.getInvolveDepartId()); + if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) { + negative.setSecondInvolveDepartId(depart.getId()); + } else if (DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) { + negative.setThreeInvolveDepartId(depart.getId()); + negative.setSecondInvolveDepartId(depart.getPid()); + } else { + throw new RuntimeException("涉及单位请选择二级或三级单位"); + } + LocalDateTime now = LocalDateTime.now(); + UserAuth user = UserContextHolder.getCurrentUser(); + boolean secondFlag = user.getRoleCodes().contains(RoleCodeEnum.SECOND_ADMIN.getCode()); + // negative唯一标识 雪花 + negative.setId(IdUtil.getSnowflakeNextIdStr()) + .setProcessingStatus(ProcessingStatusEnum.signing.name()) + .setFlowKey(FlowNodeEnum.FIRST_DISTRIBUTE.getKey()) + .setCrtDepartLevel(secondFlag ? DepartLevelEnum.SECOND.getValue() : DepartLevelEnum.FIRST.getValue()) + .setCrtTime(now) + .setUpdTime(now); + + if (CollectionUtil.isNotEmpty(negativeDto.getInvolveProblem())) { + negative.setInvolveProblem(String.join(",", negativeDto.getInvolveProblem())); + } else { + negative.setInvolveProblem(null); + } + if (CollectionUtil.isNotEmpty(negativeDto.getProblems())) { + negative.setProblems(JSON.toJSONString(negativeDto.getProblems())); + } + baseMapper.insert(negative); // 添加一条 negative 数据 + negativeDto.setId(negative.getId()); + if (!negativeDto.getThingFiles().isEmpty()) { + List files = negativeDto.getThingFiles().stream().map(item -> { + NegativeThingFile negativeThingFile = new NegativeThingFile(); + BeanUtil.copyProperties(item, negativeThingFile); + negativeThingFile.setNegativeId(negative.getId()); + negativeThingFile.setCreateTime(now); + return negativeThingFile; + }).toList(); + thingFileService.saveBatch(files); + } + String departId = AppConstants.ROOT_DEPART_ID; + String departName = AppConstants.ROOT_DEPART_NAME; + String roleCode = RoleCodeEnum.FIRST_ADMIN.getCode(); + if (secondFlag) { + SupDepart parentDepart = departService.getParentDepart(negativeDto.getDepartId()); + departId = parentDepart.getId(); + departName = parentDepart.getShortName(); + roleCode = RoleCodeEnum.SECOND_ADMIN.getCode(); + } + NegativeWork work = new NegativeWork() + .setNegativeId(negative.getId()) + .setStatus(WorkStatusEnum.todo.name()) + .setDepartId(departId) + .setDepartName(departName) + .setRoleCode(roleCode) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setUpdateTime(now) + .setCreateTime(now); + workService.save(work); // 添加一条 negative_work 数据 工作状态 + + FirstDistributeData firstDistributeData = new FirstDistributeData(); + BeanUtil.copyProperties(negativeDto, firstDistributeData); + firstDistributeData.setDepartId(negativeDto.getDepartId()); + ActionDto actionDto = new ActionDto() + .setActionKey(FlowActionEnum.FIRST_DISTRIBUTE.getKey()) + .setActionName(FlowActionEnum.FIRST_DISTRIBUTE.getName()) + .setNegativeId(negative.getId()) + .setWorkId(work.getId()) + .setNextFlowKey(FlowNodeEnum.SECOND_SIGN.getKey()) + .setData(firstDistributeData); + SpringUtil.getBean(FlowService.class).execute(actionDto); // 创建一条历史数据 + return negative; + } + + /** + * 生成样本源头编号 + * @param problemSourcesCode + * @return + */ + public String generateOriginId(String problemSourcesCode, String businessTypeCode) { + String originId = String.format("%s_%s_%s%s", StrUtil.isBlank(problemSourcesCode) ? "" : ProblemSourcesEnum.get(problemSourcesCode).name(), + StrUtil.isBlank(businessTypeCode) ? "" : BusinessTypeEnum.get(businessTypeCode).getKey(), + DateUtil.format(new Date(), DatePattern.PURE_DATE_FORMAT), + RandomUtil.randomString(4)); + if (exists(originId)) { + return generateOriginId(problemSourcesCode, businessTypeCode); + } + return originId; + } + + public boolean exists(String originId) { + return exists(new LambdaUpdateWrapper().eq(Negative::getOriginId, originId)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/Negative/NegativeThingFileService.java b/src/main/java/com/biutag/supervision/service/Negative/NegativeThingFileService.java new file mode 100644 index 0000000..5bb1478 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Negative/NegativeThingFileService.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.service.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.Negative.NegativeThingFileMapper; +import com.biutag.supervision.pojo.entity.negative.NegativeThingFile; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@DS("szdczx") +@RequiredArgsConstructor +@Service +public class NegativeThingFileService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/Negative/NegativeWorkService.java b/src/main/java/com/biutag/supervision/service/Negative/NegativeWorkService.java new file mode 100644 index 0000000..bad39f8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Negative/NegativeWorkService.java @@ -0,0 +1,14 @@ +package com.biutag.supervision.service.Negative; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.Negative.NegativeWorkMapper; +import com.biutag.supervision.pojo.entity.negative.NegativeWork; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@DS("szdczx") +@Service +@RequiredArgsConstructor +public class NegativeWorkService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/Price/PriceFileService.java b/src/main/java/com/biutag/supervision/service/Price/PriceFileService.java new file mode 100644 index 0000000..ce4b377 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Price/PriceFileService.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.service.Price; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.PriceFileMapper; +import com.biutag.supervision.pojo.entity.price.PriceFile; +import org.springframework.stereotype.Service; + +@Service +public class PriceFileService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/Price/PriceInformationService.java b/src/main/java/com/biutag/supervision/service/Price/PriceInformationService.java new file mode 100644 index 0000000..bf0384f --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Price/PriceInformationService.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.service.Price; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.PriceInformationMapper; +import com.biutag.supervision.pojo.entity.price.PriceInformation; +import com.biutag.supervision.pojo.vo.price.PriceInformationVo; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import org.springframework.stereotype.Service; + +/** + * @author weipeng + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class PriceInformationService extends ServiceImpl { + + public Page queryPage(Page page, QueryWrapper queryWrapper){ + return baseMapper.page(page,queryWrapper); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/ProblemSourceService.java b/src/main/java/com/biutag/supervision/service/ProblemSourceService.java new file mode 100644 index 0000000..03c7b12 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/ProblemSourceService.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.service; + + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + + +/** + * 灵敏感知大屏 + * + * @author kami on 2024-11-16 15:04:16 + * @version 0.0.1 + * @since 1.8 + */ +@Slf4j +@Service +@AllArgsConstructor +public class ProblemSourceService { + + + +} diff --git a/src/main/java/com/biutag/supervision/service/Report/ReportFileService.java b/src/main/java/com/biutag/supervision/service/Report/ReportFileService.java new file mode 100644 index 0000000..c57e0dd --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Report/ReportFileService.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.service.Report; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.Report.ReportFileMapper; +import com.biutag.supervision.pojo.entity.report.ReportFile; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +/** + * @author weipeng + */ +@RequiredArgsConstructor +@Service +public class ReportFileService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/Report/ReportFlowService.java b/src/main/java/com/biutag/supervision/service/Report/ReportFlowService.java new file mode 100644 index 0000000..8342dcc --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Report/ReportFlowService.java @@ -0,0 +1,484 @@ +package com.biutag.supervision.service.Report; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.controller.warning.WarningController; +import com.biutag.supervision.mapper.InformMessageMapper; +import com.biutag.supervision.mapper.Invest.InvertRecordMapper; +import com.biutag.supervision.mapper.Report.ReportFlowMapper; +import com.biutag.supervision.mapper.Report.ReportProjectMapper; +import com.biutag.supervision.mapper.Report.ReportReviewMapper; +import com.biutag.supervision.mapper.Warning.WarningRecordMapper; +import com.biutag.supervision.mapper.serviceUnit.ServiceUnitMapper; +import com.biutag.supervision.pojo.entity.InformMessage; +import com.biutag.supervision.pojo.entity.InvertRecord; +import com.biutag.supervision.pojo.entity.report.ReportFlow; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.report.ReportReview; +import com.biutag.supervision.pojo.entity.serviceUnit.ServiceUnit; +import com.biutag.supervision.pojo.entity.warning.WarningRecord; +import com.biutag.supervision.pojo.enums.FlowEnum; +import com.biutag.supervision.pojo.enums.FlowStateEnum; +import com.biutag.supervision.pojo.enums.FlowWarningEnum; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.ApprovalFlowQueryParam; +import com.biutag.supervision.pojo.param.Report.FlowQueryParam; +import com.biutag.supervision.pojo.vo.warning.WaringVo; +import com.biutag.supervision.service.InformMessageService; +import com.biutag.supervision.service.InvertRecord.InvertRecordService; +import com.biutag.supervision.service.Negative.NegativeService; +import com.biutag.supervision.service.ServiceUnit.ServiceUnitService; +import com.biutag.supervision.service.Warning.WarningRecordService; +import com.biutag.supervision.util.BigDecimalUtils; +import jakarta.validation.constraints.Negative; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.beans.Transient; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; +import java.util.concurrent.Flow; + +/** + * @author weipeng + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class ReportFlowService extends ServiceImpl { + + private final ReportProjectMapper projectMapper; + + private final ReportReviewMapper reviewMapper; + + private final InformMessageMapper informMessageMapper; + + private final InvertRecordService invertRecordService; + + private final WarningRecordMapper warningRecordMapper; + + private final NegativeService negativeService; + + private final ServiceUnitMapper serviceUnitMapper; + + + /** + * 审核 + * @return boolean + * */ + @Transactional(rollbackFor = Exception.class) + public Boolean upFlowState(FlowQueryParam queryParam) { + //获取当前数据的状态 + ReportProject project = projectMapper.selectOne(new LambdaQueryWrapper().eq(ReportProject::getId, queryParam.getReportId())); + if("1".equals(queryParam.getIsInform())){ + postInfoMessage(queryParam,"report",project.getNode(),project.getApplicant(),project.getApplicantId(),project.getReportName()); + } + if (ObjectUtil.isNotEmpty(project)) { + //通过当前状态,并记录当前审核意见 和 审批时间 + ReportFlow reportFlow = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(ReportFlow::getReportId, queryParam.getReportId()) + .eq(ReportFlow::getReportLink, project.getNode()) + .eq(ReportFlow::getApproverState,FlowStateEnum.Start.getLabel()) + .orderByDesc(ReportFlow::getAreportTime) + .last("limit 1")); + reportFlow.setApprover(queryParam.getApprover()); + reportFlow.setApproverTime(LocalDateTime.now()); + reportFlow.setApproverMessage(queryParam.getMessage()); + reportFlow.setApproverState(queryParam.getIsAudit() ? FlowStateEnum.End.getLabel() : FlowStateEnum.Reject.getLabel()); + baseMapper.updateById(reportFlow); + + if (!FlowEnum.Initial.getLabel().equals(project.getNode())) { + //录入新审批记录 + ReportFlow NextFlow = new ReportFlow(); + if (queryParam.getIsAudit()) { + NextFlow.setReportId(queryParam.getReportId()); + + if(project.getNode().equals(FlowEnum.LeadInstance.getLabel())){ + ReportReview review = reviewMapper.selectOne(new LambdaQueryWrapper().eq(ReportReview::getReportId,project.getId())); + BigDecimal archivingMoney =project.getReportMoney() ; + BigDecimal archivingReduceMoney =BigDecimal.ZERO; + //判断三审、二审、一审金额 + if(BigDecimalUtils.isNotZeroAndNull(review.getFirstMoney())){ + archivingMoney=review.getFirstMoney(); + archivingReduceMoney=review.getFirstReduceMoney(); + } + if(BigDecimalUtils.isNotZeroAndNull(review.getSecondMoney())){ + archivingMoney=review.getSecondMoney(); + archivingReduceMoney=review.getSecondReduceMoney(); + } + if(BigDecimalUtils.isNotZeroAndNull(review.getThirdlyMoney())){ + archivingMoney=review.getThirdlyMoney(); + archivingReduceMoney=review.getThirdlyReduceMoney(); + } + //录入归档时间、审定金额、审减金额 + projectMapper.update( + new LambdaUpdateWrapper() + .eq(ReportProject::getId, queryParam.getReportId()) + .set(ReportProject::getArchivingMoney,archivingMoney) + .set(ReportProject::getArchivingReduceMoney,archivingReduceMoney) + .set(ReportProject::getArchiving, LocalDateTime.now()) + ); + } + + if (project.getNode().equals(FlowEnum.AuditInstance.getLabel())) { + NextFlow.setReportLink(FlowEnum.EndInstance.getLabel()); + NextFlow.setApproverState(FlowStateEnum.End.getLabel()); + NextFlow.setApproverTime(LocalDateTime.now()); + NextFlow.setApproverMessage(queryParam.getMessage()); + NextFlow.setApproverState(FlowStateEnum.End.getLabel()); + //录入服务单位信息 + if("结算项目".equals(project.getReportType())){ + ServiceUnit serviceUnit = ServiceUnit.builder() + .serviceUnit(project.getServiceUnit()) + .serviceUnitManager(project.getServiceUnitManager()) + .serviceUnitPhone(project.getServiceUnitPhone()) + .project(project.getReportName()) + .projectId(project.getId()) + .purchasingUnitId(project.getProjectUnitId()) + .purchasingUnit(project.getProjectUnit()) + .purchasingUnitManager(project.getProjectPrincipal()) + .crtTime(LocalDateTime.now()) + .build(); + serviceUnitMapper.insert(serviceUnit); + } + } else { + NextFlow.setReportLink(queryParam.getNextNode()); + NextFlow.setApproverState(FlowStateEnum.Start.getLabel()); + } + NextFlow.setReportCode(FlowEnum.contains(queryParam.getNextNode())); + NextFlow.setAreportTime(LocalDateTime.now()); + NextFlow.setApprover(queryParam.getApprover()); + NextFlow.setApproverId(queryParam.getApproverId()); + NextFlow.setApproverUnit(queryParam.getApproverUnit()); + NextFlow.setApproverUnitId(queryParam.getApproverUnitId()); + } else { + ReportFlow rejectFlow = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(ReportFlow::getReportId, queryParam.getReportId()) + .eq(ReportFlow::getReportLink, queryParam.getNextNode()) + .orderByDesc(ReportFlow::getAreportTime) + .last("limit 1")); + //通知驳回环节人员,如果驳回环节和项目报审人一样,就不通知 + if( StrUtil.isNotBlank(rejectFlow.getApproverId()) && project.getApplicantId().equals(rejectFlow.getApproverId())){ + postRejectInfoMessage(queryParam,"report",project.getNode(),rejectFlow.getApprover(),rejectFlow.getApproverId(),project.getReportName(),queryParam.getMessage()); + } + BeanUtil.copyProperties(rejectFlow, NextFlow); + NextFlow.setId(null); + NextFlow.setIsInit(null); + NextFlow.setApproverTime(null); + NextFlow.setApproverMessage(null); + + NextFlow.setApproverState(FlowStateEnum.Start.getLabel()); + } + NextFlow.setType("report"); + projectMapper.update(new LambdaUpdateWrapper().eq(ReportProject::getId, queryParam.getReportId()).set(ReportProject::getNode, queryParam.getNextNode())); + return baseMapper.insert(NextFlow) > 0; + } + else { + ReportFlow flow = new ReportFlow(); + flow.setReportId(queryParam.getReportId()); + flow.setReportLink(FlowEnum.Review.getLabel()); + flow.setReportCode(FlowEnum.Review.getCode()); + flow.setAreportTime(LocalDateTime.now()); + flow.setApprover(queryParam.getApprover()); + flow.setApproverId(queryParam.getApproverId()); + flow.setApproverState(FlowStateEnum.Start.getLabel()); + flow.setApproverUnit(queryParam.getApproverUnit()); + flow.setApproverUnitId(queryParam.getApproverUnitId()); + flow.setType("report"); + projectMapper.update(new LambdaUpdateWrapper().eq(ReportProject::getId, queryParam.getReportId()).set(ReportProject::getNode, FlowEnum.Review.getLabel())); + return baseMapper.insert(flow) > 0; + } + + }else { + return false; + } + + } + + + @DSTransactional(rollbackFor = Exception.class) + public Boolean upFlowWarning(FlowQueryParam queryParam){ + WarningRecord record = warningRecordMapper.selectOne(new LambdaQueryWrapper().eq(WarningRecord::getId, queryParam.getReportId())); + ReportProject project = projectMapper.selectById(record.getReportId()); + if("1".equals(queryParam.getIsInform())){ + postInfoMessage(queryParam,"warning",record.getNode(),record.getWarningSupervision(),record.getWarningSupervisionId(),project.getReportName()); + } + if(ObjectUtil.isNotEmpty(record)){ + //通过当前状态,并记录当前审核意见 和 审批时间 + ReportFlow reportFlow = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(ReportFlow::getReportId, queryParam.getReportId()) + .eq(ReportFlow::getReportLink, record.getNode()) + .eq(ReportFlow::getApproverState,FlowStateEnum.Start.getLabel()) + .orderByDesc(ReportFlow::getAreportTime) + .last("limit 1")); + reportFlow.setApproverTime(LocalDateTime.now()); + reportFlow.setApproverMessage(queryParam.getMessage()); + reportFlow.setApproverState(queryParam.getIsAudit() ? FlowStateEnum.End.getLabel() : FlowStateEnum.Reject.getLabel()); + baseMapper.updateById(reportFlow); + if (!FlowWarningEnum.state.getLabel().equals(record.getNode())) { + //录入新审批记录 + ReportFlow NextFlow = new ReportFlow(); + if (queryParam.getIsAudit()) { + NextFlow.setReportId(queryParam.getReportId()); + if (record.getNode().equals(FlowWarningEnum.leader.getLabel())) { + NextFlow.setReportLink(FlowWarningEnum.end.getLabel()); + NextFlow.setApproverState(FlowStateEnum.End.getLabel()); + NextFlow.setApproverTime(LocalDateTime.now()); + NextFlow.setApproverMessage(queryParam.getMessage()); + NextFlow.setApproverState(FlowStateEnum.End.getLabel()); + warningRecordMapper.update( + new LambdaUpdateWrapper() + .eq(WarningRecord::getId, queryParam.getReportId()) + .set(WarningRecord::getArchiving, LocalDateTime.now()) + .set(WarningRecord::getFlowState,"0") + .set(WarningRecord::getNode,FlowStateEnum.End.getLabel()) + ); + //版本存储 + InvertRecord invertRecord= invertRecordService.addInvertRecord(record); + WaringVo vo = JSONObject.parseObject(invertRecord.getWarning(),WaringVo.class); + //生成问题 + queryParam.getData().setWaringVo(vo); + negativeService.createNegativeData(queryParam.getData()); + //修改数据状态 + projectMapper.update(new LambdaUpdateWrapper().set(ReportProject::getWarningState,"1").eq(ReportProject::getId,record.getReportId())); + } else { + NextFlow.setReportLink(queryParam.getNextNode()); + NextFlow.setApproverState(FlowStateEnum.Start.getLabel()); + } + NextFlow.setReportCode(FlowWarningEnum.contains(queryParam.getNextNode())); + NextFlow.setAreportTime(LocalDateTime.now()); + NextFlow.setApprover(queryParam.getApprover()); + NextFlow.setApproverId(queryParam.getApproverId()); + NextFlow.setApproverUnit(queryParam.getApproverUnit()); + NextFlow.setApproverUnitId(queryParam.getApproverUnitId()); + } else { + + + ReportFlow rejectFlow = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(ReportFlow::getReportId, queryParam.getReportId()) + .eq(ReportFlow::getReportLink, queryParam.getNextNode()) + .orderByDesc(ReportFlow::getAreportTime) + .last("limit 1")); + BeanUtil.copyProperties(rejectFlow, NextFlow); + NextFlow.setId(null); + NextFlow.setIsInit(null); + NextFlow.setApproverTime(null); + NextFlow.setApproverMessage(null); + + NextFlow.setApproverState(FlowStateEnum.Start.getLabel()); + + //通知驳回环节人员,如果驳回环节和项目报审人一样,就不通知 + if( StrUtil.isNotBlank(rejectFlow.getApproverId()) && project.getApplicantId().equals(rejectFlow.getApproverId())){ + postRejectInfoMessage(queryParam,"warning",project.getNode(),rejectFlow.getApprover(),rejectFlow.getApproverId(),project.getReportName(),queryParam.getMessage()); + } + } + NextFlow.setType("warning"); + warningRecordMapper.update(new LambdaUpdateWrapper() + .eq(WarningRecord::getId, queryParam.getReportId()) + .set(WarningRecord::getNode, queryParam.getNextNode())); + return baseMapper.insert(NextFlow) > 0; + } + else { + ReportFlow flow = new ReportFlow(); + flow.setReportId(queryParam.getReportId()); + flow.setReportLink(FlowWarningEnum.leader.getLabel()); + flow.setReportCode(FlowWarningEnum.leader.getValue()); + flow.setAreportTime(LocalDateTime.now()); + flow.setApprover(queryParam.getApprover()); + flow.setApproverId(queryParam.getApproverId()); + flow.setApproverState(FlowStateEnum.Start.getLabel()); + flow.setApproverUnit(queryParam.getApproverUnit()); + flow.setApproverUnitId(queryParam.getApproverUnitId()); + flow.setType("warning"); + warningRecordMapper.update(new LambdaUpdateWrapper().eq(WarningRecord::getId, queryParam.getReportId()) + .set(WarningRecord::getNode, FlowWarningEnum.leader.getLabel()) + ); + return baseMapper.insert(flow) > 0; + } + + }else{ + return false; + } + } + + + @DSTransactional(rollbackFor = Exception.class) + public Boolean upFlowWarningInform(FlowQueryParam queryParam){ + WarningRecord record = warningRecordMapper.selectOne(new LambdaQueryWrapper().eq(WarningRecord::getId, queryParam.getReportId())); + ReportProject project = projectMapper.selectById(record.getReportId()); + if("1".equals(queryParam.getIsInform())){ + postInfoMessage(queryParam,"inform",record.getInformNode(),record.getWarningSupervision(),record.getWarningSupervisionId(),project.getReportName()); + } + if(ObjectUtil.isNotEmpty(record)){ + //通过当前状态,并记录当前审核意见 和 审批时间 + ReportFlow reportFlow = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(ReportFlow::getReportId, queryParam.getReportId()) + .eq(ReportFlow::getReportLink, record.getInformNode()) + .eq(ReportFlow::getApproverState,FlowStateEnum.Start.getLabel()) + .orderByDesc(ReportFlow::getAreportTime) + .last("limit 1")); + reportFlow.setApproverTime(LocalDateTime.now()); + reportFlow.setApproverMessage(queryParam.getMessage()); + reportFlow.setApproverState(queryParam.getIsAudit() ? FlowStateEnum.End.getLabel() : FlowStateEnum.Reject.getLabel()); + baseMapper.updateById(reportFlow); + if (!FlowWarningEnum.state.getLabel().equals(record.getInformState())) { + //录入新审批记录 + ReportFlow NextFlow = new ReportFlow(); + //是否驳回 + if (queryParam.getIsAudit()) { + NextFlow.setReportId(queryParam.getReportId()); + if (record.getInformNode().equals(FlowWarningEnum.inform.getLabel())) { + NextFlow.setReportLink(FlowWarningEnum.end.getLabel()); + NextFlow.setApproverState(FlowStateEnum.End.getLabel()); + NextFlow.setApproverTime(LocalDateTime.now()); + NextFlow.setApproverMessage(queryParam.getMessage()); + NextFlow.setApproverState(FlowStateEnum.End.getLabel()); + warningRecordMapper.update( + new LambdaUpdateWrapper() + .eq(WarningRecord::getId, queryParam.getReportId()) + .set(WarningRecord::getArchiving, LocalDateTime.now()) + .set(WarningRecord::getInformState,"0") + .set(WarningRecord::getInformNode,FlowWarningEnum.end.getLabel()) + ); + + } else { + NextFlow.setReportLink(FlowWarningEnum.inform.getLabel()); + NextFlow.setApproverState(FlowStateEnum.Start.getLabel()); + } + NextFlow.setReportCode(FlowWarningEnum.contains(FlowWarningEnum.inform.getLabel())); + NextFlow.setAreportTime(LocalDateTime.now()); + NextFlow.setApprover(queryParam.getApprover()); + NextFlow.setApproverId(queryParam.getApproverId()); + NextFlow.setApproverUnit(queryParam.getApproverUnit()); + NextFlow.setApproverUnitId(queryParam.getApproverUnitId()); + } else { + + + ReportFlow rejectFlow = baseMapper.selectOne(new LambdaQueryWrapper() + .eq(ReportFlow::getReportId, queryParam.getReportId()) + .eq(ReportFlow::getReportLink, queryParam.getNextNode()) + .orderByDesc(ReportFlow::getAreportTime) + .last("limit 1")); + BeanUtil.copyProperties(rejectFlow, NextFlow); + NextFlow.setId(null); + NextFlow.setIsInit(null); + NextFlow.setApproverTime(null); + NextFlow.setApproverMessage(null); + + NextFlow.setApproverState(FlowStateEnum.Start.getLabel()); + //通知驳回环节人员,如果驳回环节和项目报审人一样,就不通知 + if( StrUtil.isNotBlank(rejectFlow.getApproverId()) && project.getApplicantId().equals(rejectFlow.getApproverId())){ + postRejectInfoMessage(queryParam,"inform",project.getNode(),rejectFlow.getApprover(),rejectFlow.getApproverId(),project.getReportName(),queryParam.getMessage()); + } + } + NextFlow.setType("inform"); + warningRecordMapper.update(new LambdaUpdateWrapper().eq(WarningRecord::getId, queryParam.getReportId()).set(WarningRecord::getInformNode, queryParam.getNextNode())); + return baseMapper.insert(NextFlow) > 0; + } + else { + ReportFlow flow = new ReportFlow(); + flow.setReportId(queryParam.getReportId()); + flow.setReportLink(FlowWarningEnum.leader.getLabel()); + flow.setReportCode(FlowWarningEnum.leader.getValue()); + flow.setAreportTime(LocalDateTime.now()); + flow.setApprover(queryParam.getApprover()); + flow.setApproverId(queryParam.getApproverId()); + flow.setApproverState(FlowStateEnum.Start.getLabel()); + flow.setApproverUnit(queryParam.getApproverUnit()); + flow.setApproverUnitId(queryParam.getApproverUnitId()); + flow.setType("inform"); + warningRecordMapper.update(new LambdaUpdateWrapper().eq(WarningRecord::getId, queryParam.getReportId()) + .set(WarningRecord::getInformNode, FlowWarningEnum.leader.getLabel()) + ); + return baseMapper.insert(flow) > 0; + } + + }else{ + return false; + } + } + + + + + //发送通知(通知报审人) + public void postInfoMessage(FlowQueryParam queryParam,String type, String node,String recipient,String recipientId,String reportName){ + InformMessage informMessage=new InformMessage(); + UserAuth user = UserContextHolder.getCurrentUser(); + informMessage.setReportId(queryParam.getReportId()); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String newDate = sdf.format(new Date()); + informMessage.setCrtTime(LocalDateTime.now()); + if("report".equals(type)){ + informMessage.setNode(FlowEnum.contains(node) ); + informMessage.setMessage(reportName +"项目于"+newDate+"通过【"+FlowEnum.contains(node)+"】"); + }else{ + informMessage.setNode(FlowWarningEnum.contains(node)); + informMessage.setMessage(reportName +"项目于"+newDate+"通过【"+FlowWarningEnum.contains(node)+"】"); + } + + //创建人 + informMessage.setCrtUserId(StrUtil.isNotBlank(queryParam.getApproverId())?queryParam.getApproverId():user.getUserId()); + informMessage.setCrtUser(StrUtil.isNotBlank(queryParam.getApprover())?queryParam.getApprover():user.getNickName()); + //接收人 + informMessage.setRecipient(recipient); + informMessage.setRecipientId(recipientId); + informMessage.setFlowState(queryParam.getIsAudit() ? FlowStateEnum.End.getLabel() : FlowStateEnum.Reject.getLabel()); + informMessageMapper.insert(informMessage); + } + + //发送通知(驳回环节人员接收) + public void postRejectInfoMessage(FlowQueryParam queryParam,String type, String node,String recipient,String recipientId,String reportName,String message){ + InformMessage informMessage=new InformMessage(); + UserAuth user = UserContextHolder.getCurrentUser(); + informMessage.setReportId(queryParam.getReportId()); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String newDate = sdf.format(new Date()); + informMessage.setCrtTime(LocalDateTime.now()); + if("report".equals(type)){ + informMessage.setNode(FlowEnum.contains(node) ); + informMessage.setMessage(reportName +"项目于"+newDate+"在【"+FlowEnum.contains(node)+"】被驳回。驳回原因:"+message); + }else{ + informMessage.setNode(FlowWarningEnum.contains(node)); + informMessage.setMessage(reportName +"项目于"+newDate+"在【"+FlowWarningEnum.contains(node)+"】被驳回。驳回原因:"+message); + } + + //创建人 + informMessage.setCrtUserId(StrUtil.isNotBlank(queryParam.getApproverId())?queryParam.getApproverId():user.getUserId()); + informMessage.setCrtUser(StrUtil.isNotBlank(queryParam.getApprover())?queryParam.getApprover():user.getNickName()); + //接收人 + informMessage.setRecipient(recipient); + informMessage.setRecipientId(recipientId); + informMessage.setFlowState(FlowStateEnum.End.getLabel()); + informMessageMapper.insert(informMessage); + } + + + + /** + * 审批记录 + * */ + public List getFlowDta(ApprovalFlowQueryParam param){ + List reportFlows= baseMapper.selectList(new LambdaQueryWrapper().eq(ReportFlow::getReportId,param.getId()).eq(ReportFlow::getType,param.getCode())); + reportFlows= reportFlows.stream().peek(s-> s.setApproverState(FlowStateEnum.contains(s.getApproverState()))).toList(); + return reportFlows; + } + + + +} diff --git a/src/main/java/com/biutag/supervision/service/Report/ReportProjectService.java b/src/main/java/com/biutag/supervision/service/Report/ReportProjectService.java new file mode 100644 index 0000000..7cf7654 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Report/ReportProjectService.java @@ -0,0 +1,286 @@ +package com.biutag.supervision.service.Report; + +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.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.fill.FillConfig; +import com.alibaba.excel.write.metadata.fill.FillWrapper; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.mapper.Report.ReportFileMapper; +import com.biutag.supervision.mapper.Report.ReportProjectMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.report.ReportFile; +import com.biutag.supervision.pojo.entity.report.ReportFlow; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.report.ReportReview; +import com.biutag.supervision.pojo.enums.FlowEnum; +import com.biutag.supervision.pojo.enums.FlowStateEnum; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.Report.ReportProjectQueryParam; +import com.biutag.supervision.pojo.param.Work.ProjectWorkQueryParam; +import com.biutag.supervision.pojo.param.entryWindow.EntryWindowQueryParam; +import com.biutag.supervision.pojo.vo.FileVo; +import com.biutag.supervision.pojo.vo.entryWindow.EntryWindowVo; +import com.biutag.supervision.pojo.vo.excel.ExcelControlPriceVo; +import com.biutag.supervision.pojo.vo.report.ReportFileVo; +import com.biutag.supervision.pojo.vo.report.ReportHomeVo; +import com.biutag.supervision.pojo.vo.report.ReportProjectVo; +import com.biutag.supervision.pojo.vo.statement.ConditionVo; +import com.biutag.supervision.pojo.vo.work.ProjectTabWorkVo; +import com.biutag.supervision.pojo.vo.work.ProjectWorkVo; +import io.swagger.v3.core.util.Json; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.poi.util.IOUtils; +import org.springframework.core.io.ClassPathResource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.net.http.HttpResponse; +import java.time.LocalDateTime; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @author weipeng + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class ReportProjectService extends ServiceImpl { + + private final ReportReviewService reportReviewService; + + private final ReportFileService fileService; + + private final ReportFlowService reportFlowService; + + + + public Page getPage(Page page, QueryWrapper lambdaQueryWrapper){ + return baseMapper.queryPage(page,lambdaQueryWrapper); + } + + public Page getPageWarning(Page page, QueryWrapper lambdaQueryWrapper,String warningState){ + return baseMapper.queryPageWarning(page,lambdaQueryWrapper,warningState); + } + + /** + * 获取数据 + * */ + public Page getConditionPage(Page page,QueryWrapper lambdaQueryWrapper){ + return baseMapper.queryPageCondition(page,lambdaQueryWrapper); + } + + /** + * 获取数据详情 + * */ + public List getProjectList(ReportProjectQueryParam queryParam){ + UserAuth user = UserContextHolder.getCurrentUser(); + LambdaQueryWrapper queryWrapper=new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(queryParam.getName()),ReportProject::getReportName,queryParam.getName()).last("limit 100") + .orderByDesc(ReportProject::getCrtTime); + // 权限 + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { + queryWrapper.eq(ReportProject::getApplicantId,user.getUserName()); + } + return baseMapper.selectList(queryWrapper); + } + /** + * 获取报审项目详情 + * */ + public ReportProjectVo getDetail(String id){ + ReportProjectVo vo =new ReportProjectVo(); + //项目信息 + ReportProject project = baseMapper.selectById(id); + if(ObjectUtil.isNotEmpty(project.getServiceStartTime()) && ObjectUtil.isNotEmpty(project.getServiceEndTime())){ + List dateTimes = new ArrayList<>(); + dateTimes.add(project.getServiceStartTime()); + dateTimes.add(project.getServiceEndTime()); + project.setServiceTime(dateTimes); + } + vo.setProject(project); + //审核信息 + ReportReview review = reportReviewService.getOne(new LambdaQueryWrapper().eq(ReportReview::getReportId,id)); + if(ObjectUtil.isNotEmpty(review)){ + vo.setReview(review); + }else{ + review =new ReportReview(); + vo.setReview(review); + } + //项目附件 + List reportFiles = fileService.list(new LambdaQueryWrapper().eq(ReportFile::getReportId,id)); + List reportFileVos = reportFiles.stream().map(s->{ + ReportFileVo vos = new ReportFileVo(); + BeanUtil.copyProperties(s,vos); + vos.setFileData(JSON.parseArray(s.getFiles(),FileVo.class)); + return vos; + }).toList(); + //判断有无附件 + if(CollectionUtil.isNotEmpty(reportFileVos)){ + Map> reportFileMap= reportFileVos.stream() + .collect(Collectors.groupingBy(ReportFileVo::getFileNode)); + vo.setFiles(reportFileMap); + }else{ + Map> reportFileMap =new HashMap<>(); + vo.setFiles(reportFileMap); + } + // + List flows =reportFlowService.list(new LambdaQueryWrapper().eq(ReportFlow::getReportId,id).eq(ReportFlow::getType,"report")); + flows=flows.stream().filter(s->!s.getApproverState().equals(FlowStateEnum.Reject.getLabel()) && isFileFlow(project.getNode()).contains(s.getReportLink())) + .collect(Collectors.toMap( + ReportFlow::getReportCode, + Function.identity(), + (existing, replacement) -> existing + )).values().stream().toList(); + if(CollectionUtil.isNotEmpty(flows)){ + vo.setFlows(flows); + } + return vo; + } + + public List isFileFlow(String node){ + return switch (node) { + case "review" -> List.of("initial"); + case "first" -> List.of("review", "initial"); + case "second" -> List.of("review", "initial", "first"); + case "third" -> List.of("second", "review", "initial", "first"); + case "Lead" -> List.of("second", "review", "initial", "first", "third"); + case "original" -> List.of("second", "review", "initial", "first", "third", "Lead"); + case "audit" -> List.of( "original", "second", "review", "initial", "first", "third", "Lead"); + case "end" -> List.of("audit", "original", "second", "review", "initial", "first", "third", "Lead"); + default -> new ArrayList<>(); + }; + } + + public ReportHomeVo getReportHomeVo(String id){ + ReportHomeVo vo=new ReportHomeVo(); + ReportProject project=baseMapper.selectOne(new LambdaQueryWrapper().eq(ReportProject::getId,id).orderByDesc(ReportProject::getCrtTime)); + BeanUtil.copyProperties(project,vo); + List flows =reportFlowService.list(new LambdaQueryWrapper().eq(ReportFlow::getReportId,id).eq(ReportFlow::getType,"report")); + flows=flows.stream().filter(s->!s.getApproverState().equals(FlowStateEnum.Reject.getLabel()) && isFileFlow(project.getNode()).contains(s.getReportLink())) + .collect(Collectors.toMap( + ReportFlow::getReportCode, + Function.identity(), + (existing, replacement) -> existing + )).values().stream().toList(); + + if(CollectionUtil.isNotEmpty(flows)){ + vo.setFlows(flows); + } + return vo; + } + + /** + * 新增或修改 + * */ + @Transactional(rollbackFor = Exception.class) + public ReportProjectVo addOrUpdate(ReportProjectQueryParam queryParam){ + UserAuth user = UserContextHolder.getCurrentUser(); + if(CollectionUtil.isNotEmpty(queryParam.getProject().getServiceTime())){ + List serviceTime = queryParam.getProject().getServiceTime(); + queryParam.getProject().setServiceStartTime(serviceTime.get(0)); + queryParam.getProject().setServiceEndTime(serviceTime.get(1)); + } + if(!StrUtil.isNotEmpty(queryParam.getProject().getId()) ){ + baseMapper.insertOrUpdate(queryParam.getProject()); + ReportFlow flow = new ReportFlow(); + flow.setReportId(queryParam.getProject().getId()); + flow.setReportLink(FlowEnum.Initial.getLabel()); + flow.setReportCode(FlowEnum.Initial.getCode()); + flow.setAreportTime(LocalDateTime.now()); + flow.setApproverState(FlowStateEnum.Start.getLabel()); + flow.setApprover(user.getNickName()); + flow.setApproverId(user.getUserName()); + flow.setType("report"); + flow.setIsInit("1"); + reportFlowService.save(flow); + }else{ + queryParam.getProject().setCrtTime(LocalDateTime.now()); + baseMapper.insertOrUpdate(queryParam.getProject()); + } + List reportFiles =fileService.list(new LambdaQueryWrapper().eq(ReportFile::getReportId,queryParam.getProject().getId())); + if(CollectionUtil.isNotEmpty(reportFiles)){ + fileService.removeBatchByIds(reportFiles.stream().map(ReportFile::getId).toList()); + } + if(ObjectUtil.isNotEmpty(queryParam.getReview())){ + queryParam.getReview().setReportId(queryParam.getProject().getId()); + reportReviewService.saveOrUpdate(queryParam.getReview()); + } + + + if(CollectionUtil.isNotEmpty(queryParam.getFiles())){ + + + for (String key : queryParam.getFiles().keySet()){ + List files =new ArrayList<>(); + queryParam.getFiles().get(key).forEach(s->{ + ReportFile file =new ReportFile(); + s.setFileNode(key); + s.setReportId(queryParam.getProject().getId()); + BeanUtil.copyProperties(s,file); + file.setFiles(JSONObject.toJSONString(s.getFileData())); + files.add(file); + }); + fileService.saveBatch(files); + } + + } + return getDetail(queryParam.getProject().getId()); + } + /** + * 删除报审项目 + * */ + public Boolean delData(ReportProjectQueryParam queryParam){ + if(CollectionUtil.isNotEmpty(queryParam.getFiles())){ + for (String key : queryParam.getFiles().keySet()){ + fileService.removeBatchByIds(queryParam.getFiles().get(key)); + } + } + return baseMapper.deleteById(queryParam.getId()) > 0; + } + + + public List getProjectWork(ProjectWorkQueryParam queryParam){ + return baseMapper.getProjectWorkVoList(queryParam); + } + + public ProjectTabWorkVo getProjectTabWorkVo(ProjectWorkQueryParam queryParam){ + return baseMapper.getProjectTabWorkVo(queryParam); + } + + + + public boolean upFinalizationPath(ReportProjectQueryParam queryParam){ + + return reportReviewService.update(new LambdaUpdateWrapper() + .set(ReportReview::getFinalizationPath,queryParam.getReview().getFinalizationPath()) + .eq(ReportReview::getId,queryParam.getReview().getId()) + ) ; + + } + +} diff --git a/src/main/java/com/biutag/supervision/service/Report/ReportReviewService.java b/src/main/java/com/biutag/supervision/service/Report/ReportReviewService.java new file mode 100644 index 0000000..adb6e27 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Report/ReportReviewService.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.service.Report; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.Report.ReportReviewMapper; +import com.biutag.supervision.pojo.entity.report.ReportReview; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author weipeng + */ +@RequiredArgsConstructor +@Service +@Slf4j +public class ReportReviewService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/RoleMenuService.java b/src/main/java/com/biutag/supervision/service/RoleMenuService.java new file mode 100644 index 0000000..3a1dbba --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/RoleMenuService.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.service; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.RoleMenuMapper; +import com.biutag.supervision.pojo.entity.RoleMenu; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + + +@Service +public class RoleMenuService extends ServiceImpl { + + @Transactional(rollbackFor = Exception.class) + public boolean update(String roleCode, List menuIds) { + remove(new LambdaQueryWrapper().eq(RoleMenu::getRoleCode, roleCode)); + if (menuIds.isEmpty()) { + return true; + } + List list = menuIds.stream().map(menuId -> new RoleMenu().setRoleCode(roleCode).setMenuId(menuId)).toList(); + return saveBatch(list); + } + + public List list(String roleCode) { + return list(new LambdaQueryWrapper().eq(RoleMenu::getRoleCode, roleCode)); + } + + public List list(List roleCodes) { + return list(new LambdaQueryWrapper().in(RoleMenu::getRoleCode, roleCodes)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/ServiceUnit/ServiceUnitService.java b/src/main/java/com/biutag/supervision/service/ServiceUnit/ServiceUnitService.java new file mode 100644 index 0000000..cd0b2e7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/ServiceUnit/ServiceUnitService.java @@ -0,0 +1,89 @@ +package com.biutag.supervision.service.ServiceUnit; + +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.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.mapper.serviceUnit.ServiceUnitMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.entity.serviceUnit.ServiceUnit; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.ServiceUnit.ServiceUnitQueryParam; +import com.biutag.supervision.pojo.vo.ServiceUnit.ServiceUnitVo; +import com.biutag.supervision.service.SupDepartService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author weipeng + */ +@RequiredArgsConstructor +@Slf4j +@Service +public class ServiceUnitService extends ServiceImpl { + + + private final SupDepartService departService; + + //分页 + public Page pageList(ServiceUnitQueryParam queryParam){ + QueryWrapper queryWrapper =new QueryWrapper<>(); + queryWrapper + .eq(StrUtil.isNotBlank(queryParam.getProject()),"s.project",queryParam.getProject()) + .eq(StrUtil.isNotBlank(queryParam.getServiceUnit()),"s.service_unit",queryParam.getServiceUnit()) + .eq(StrUtil.isNotBlank(queryParam.getServiceUnitPhone()),"s.service_unit_phone",queryParam.getServiceUnitPhone()) + .eq(StrUtil.isNotBlank(queryParam.getServiceUnitManager()),"s.service_unit_manager",queryParam.getServiceUnitManager()); + //获取登陆人信息 + if(ObjectUtil.isNotEmpty(UserContextHolder.getCurrentUser())){ + UserAuth user = UserContextHolder.getCurrentUser(); + //非超级管理员 && 非市级管理员 + // 市局权限 + boolean firstAuth = AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) || user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()); + if( !firstAuth){ + List orgIds = new ArrayList<>(); + if(!user.getAuthDepartIds().isEmpty()){ + orgIds = departService.getAllNodeIds(user.getAuthDepartIds()); + queryWrapper.in("s.purchasing_unit_id", orgIds); + }else{ + orgIds = departService.getAllNodeIds(user.getDepartId()); + queryWrapper.in("s.purchasing_unit_id", orgIds); + } + + } + } + return baseMapper.page(new Page<>(queryParam.getCurrent(),queryParam.getSize()),queryWrapper); + } + + //分页 + public Page pageListData(ServiceUnitQueryParam queryParam){ + QueryWrapper queryWrapper =new QueryWrapper<>(); + queryWrapper + .eq(StrUtil.isNotBlank(queryParam.getProject()),"s.project",queryParam.getProject()) + .eq(StrUtil.isNotBlank(queryParam.getServiceUnit()),"s.service_unit",queryParam.getServiceUnit()) + .eq(StrUtil.isNotBlank(queryParam.getServiceUnitPhone()),"s.service_unit_phone",queryParam.getServiceUnitPhone()) + .eq(StrUtil.isNotBlank(queryParam.getServiceUnitManager()),"s.service_unit_manager",queryParam.getServiceUnitManager()); + //获取登陆人信息 + + return baseMapper.page(new Page<>(queryParam.getCurrent(),queryParam.getSize()),queryWrapper); + } + + //新增或者修改 + public Boolean addOrUpData(ServiceUnit serviceUnit){ + return baseMapper.insertOrUpdate(serviceUnit); + } + + //删除数据 + public Boolean delServiceUnit(String id){ + return baseMapper.deleteById(id) > 0; + } +} diff --git a/src/main/java/com/biutag/supervision/service/SupDepartService.java b/src/main/java/com/biutag/supervision/service/SupDepartService.java new file mode 100644 index 0000000..95a8fc8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDepartService.java @@ -0,0 +1,312 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.constants.enums.StatusEnum; +import com.biutag.supervision.mapper.SupDepartMapper; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.DepartQueryParam; +import com.biutag.supervision.pojo.param.DepartTreeListParam; +import com.biutag.supervision.pojo.vo.DepartTree; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Slf4j +@Service +public class SupDepartService extends ServiceImpl { + + public Page page(DepartQueryParam param) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(param.getShortName()), SupDepart::getShortName, param.getShortName()) + .like(StrUtil.isNotBlank(param.getName()), SupDepart::getName, param.getName()) + .like(StrUtil.isNotBlank(param.getCode()), SupDepart::getCode, param.getCode()) + .ne(SupDepart::getId, AppConstants.ROOT_DEPART_ID) + .orderByAsc(SupDepart::getLevel) + .orderByAsc(SupDepart::getOrderNo); + return page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + + public List getNotPCSDept(){ + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .eq(SupDepart::getLevel,2) + .orderByAsc(SupDepart::getLevel); + return list(queryWrapper); + } + + + public List listEnabledLevel3() { + return list(new LambdaQueryWrapper() + .notIn(SupDepart::getLevel, List.of(4, 5)) + .eq(SupDepart::getStatus, StatusEnum.ENABLE.getValue()) + .orderByAsc(SupDepart::getOrderNo)); + } + + public List listByLevel(List levels) { + return list(new LambdaQueryWrapper().in(SupDepart::getLevel, levels).eq(SupDepart::getStatus, StatusEnum.ENABLE.getValue()).orderByAsc(SupDepart::getOrderNo)); + } + + public List getAllNodeIds(String departId) { + return getAllNodeIds(List.of(departId)); + } + + + + + public List getAllNodeDatas(String departId){ + return getAllNode(List.of(departId)).stream().toList(); + } + + public List getAllNodeIds(Collection departIds) { + return getAllNode(departIds).stream().map(DepartTree::getId).toList(); + } + + public List getAllNode(Collection departIds) { + List treeList = buildTreeAll(); + List nodes = new ArrayList<>(); + getAllNodeRecursive(departIds, treeList, nodes); + return nodes; + } + + public void getAllNodeRecursive(Collection departIds, List treeList, List nodes) { + treeList.forEach(item -> { + if (departIds.contains(item.getId())) { + getAllNodeRecursive(item, nodes); + } else { + getAllNodeRecursive(departIds, item.getChildren(), nodes); + } + }); + } + + private void getAllNodeRecursive(DepartTree tree, List nodes) { + nodes.add(tree); + tree.getChildren().forEach(item -> { + getAllNodeRecursive(item, nodes); + }); + } + + public SupDepart getParentDepart(String departId) { + return Optional.ofNullable(getById(departId)).map(item -> getById(item.getPid())).orElse(null); + } + public SupDepart getByJwpyCode(String departCode) { + return baseMapper.selectByJwpyCode(departCode); + } + + public boolean existsByPid(String pid) { + return exists(new LambdaQueryWrapper().eq(SupDepart::getPid, pid)); + } + + public boolean existsByCode(String code) { + return exists(new LambdaQueryWrapper().eq(SupDepart::getCode, code)); + } + + public boolean existsByName(String name) { + return exists(new LambdaQueryWrapper().eq(SupDepart::getName, name)); + } + + public Integer getMaxId() { + return baseMapper.getMaxId(); + } + + public List buildTreeAll() { + // 所有有效的数据 + List departs = list(new LambdaQueryWrapper() + .orderByAsc(SupDepart::getOrderNo)); + return buildTreeAll(departs); + } + + public List buildTreeAll(List departs) { + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDepart depart : departs) { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + node.setHasChildren(!depart.getLevel().equals(4) && departs.stream().anyMatch(item -> node.getId().equals(item.getPid()))); + List children = childMap.computeIfAbsent(node.getPid(), k -> new ArrayList<>()); + children.add(node); + if (AppConstants.ROOT_DEPART_ID.equals(node.getId())) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + /** + * 市局主办 + * @return + */ + public List buildTreeByFirstHost() { + List departs = listEnabledLevel3(); + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDepart depart : departs) { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + List children = childMap.computeIfAbsent(node.getPid(), k -> new ArrayList<>()); + children.add(node); + if (node.getFirstHost()) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + /** + * 根据角色权限 + * @return + */ + public List buildTreeByAuth() { + // 所有有效的数据 + List departs = listEnabledLevel3(); + return buildTreeByAuth(departs); + } + + /** + * 根据角色权限 + * @param departs + * @return + */ + public List buildTreeByAuth(List departs) { + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + UserAuth user = UserContextHolder.getCurrentUser(); + // 权限 + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && (user.getRoleCodes().isEmpty() || user.getAuthDepartIds().isEmpty())) { + return tree; + } + // 市局权限 + boolean firstAuth = AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) || user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()); + List authDepartIds = new ArrayList<>(); + if (!firstAuth) { + List authDeparts = departs.stream().filter(item -> user.getAuthDepartIds().contains(item.getId())).toList(); + Integer maxLevel = authDeparts.stream().map(SupDepart::getLevel).max(Integer::compareTo).get(); + authDepartIds = authDeparts.stream().filter(item -> maxLevel.equals(item.getLevel())).map(SupDepart::getId).toList(); + } + for (SupDepart depart : departs) { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + node.setHasChildren(!depart.getLevel().equals(4) && departs.stream().anyMatch(item -> node.getId().equals(item.getPid()))); + List children = childMap.computeIfAbsent(node.getPid(), k -> new ArrayList<>()); + children.add(node); + if (firstAuth && AppConstants.ROOT_DEPART_ID.equals(node.getId())) { + tree.add(node); + } else if (authDepartIds.contains(node.getId())) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + public List buildTreeBySecond(List departs) { + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDepart depart : departs) { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + List children = childMap.computeIfAbsent(node.getPid(), k -> new ArrayList<>()); + children.add(node); + if (AppConstants.ROOT_DEPART_ID.equals(node.getPid())) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + public List buildTreeByParam(DepartTreeListParam departTreeListParam) { + if (Objects.nonNull(departTreeListParam.getPid())) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().eq(SupDepart::getPid, departTreeListParam.getPid()).orderByAsc(SupDepart::getOrderNo); + return list(queryWrapper).stream() + .map(depart -> { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + node.setHasChildren(existsByPid(node.getId())); + return node; + }).toList(); + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .in(SupDepart::getLevel, List.of(1)).orderByAsc(SupDepart::getOrderNo); + List departs = list(queryWrapper); + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDepart depart : departs) { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + node.setHasChildren(existsByPid(node.getId())); + List children = childMap.computeIfAbsent(node.getPid(), k -> new ArrayList<>()); + children.add(node); + String pid = node.getPid(); + if (AppConstants.ROOT_DEPART_ID.equals(pid) || pid.equals(departTreeListParam.getPid())) { + tree.add(node); + } + } + for (DepartTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + /** + * 递归构建 + * @param node + * @param childMap + * @return + */ + public static DepartTree buildTreeRecursive(DepartTree node, Map> childMap) { + List children = childMap.get(node.getId()); + if (children != null) { + node.getChildren().addAll(children.stream() + .map(childNode -> buildTreeRecursive(childNode, childMap)) + .toList()); + } + return node; + } + + /** + * 获取部门的 pathTrace + * @param depart + * @return + */ + public String getPathTrace(SupDepart depart) { + List pathTrace = new ArrayList<>(); + buildPathTraceRecursive(depart, pathTrace); + return "/" + String.join("/", pathTrace) + "/"; + } + + public void buildPathTraceRecursive(SupDepart depart, List pathTrace) { + pathTrace.add(0, depart.getId()); + if (AppConstants.ROOT_DEPART_ID.equals(depart.getId())) { + return; + } + if (AppConstants.ROOT_DEPART_ID.equals(depart.getPid())) { + pathTrace.add(0, AppConstants.ROOT_DEPART_ID); + } else { + SupDepart parent = getById(depart.getPid()); + if (Objects.isNull(parent)) { + log.warn("该部门[{} {}]的父级ID不存在,请核实", depart.getName(), depart.getId()); + return; + } + buildPathTraceRecursive(parent, pathTrace); + } + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDict12337HandleResultService.java b/src/main/java/com/biutag/supervision/service/SupDict12337HandleResultService.java new file mode 100644 index 0000000..2c56925 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDict12337HandleResultService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.SupDict12337HandleResult; +import com.biutag.supervision.mapper.SupDict12337HandleResultMapper; +import org.springframework.stereotype.Service; + +@Service +public class SupDict12337HandleResultService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictDataService.java b/src/main/java/com/biutag/supervision/service/SupDictDataService.java new file mode 100644 index 0000000..d2fca5e --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictDataService.java @@ -0,0 +1,37 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.dto.DictDataDto; +import com.biutag.supervision.pojo.dto.DictTypeDto; +import com.biutag.supervision.pojo.entity.SupDictData; +import com.biutag.supervision.mapper.SupDictDataMapper; +import com.biutag.supervision.pojo.entity.SupDictType; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service +public class SupDictDataService extends ServiceImpl { + + public List listByDictType(String dictType) { + return list(new LambdaQueryWrapper().eq(SupDictData::getDictType, dictType)); + } + + public SupDictData get(String dictType, String value) { + return getOne(new LambdaQueryWrapper().eq(SupDictData::getDictType, dictType).eq(SupDictData::getDictValue, value)); + } + + public boolean save(DictDataDto dto) { + if (exists(new LambdaQueryWrapper().eq(SupDictData::getDictType, dto.getDictType()).eq(SupDictData::getDictValue, dto.getDictValue()))) { + throw new RuntimeException("字典值已存在"); + } + SupDictData supDictData = new SupDictData(); + BeanUtils.copyProperties(dto, supDictData); + supDictData.setCreateTime(LocalDateTime.now()); + supDictData.setUpdateTime(LocalDateTime.now()); + return save(supDictData); + } +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictDataTwoService.java b/src/main/java/com/biutag/supervision/service/SupDictDataTwoService.java new file mode 100644 index 0000000..24b0d7b --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictDataTwoService.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.service; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.SupDictDataTwoMapper; +import com.biutag.supervision.pojo.entity.SupDictData; +import com.biutag.supervision.pojo.entity.SupDictDataTwo; +import org.springframework.stereotype.Service; + +@DS("szdczx") +@Service +public class SupDictDataTwoService extends ServiceImpl { + + @DS("szdczx") + public SupDictDataTwo get(String dictType, String value) { + return getOne(new LambdaQueryWrapper().eq(SupDictDataTwo::getDictType, dictType).eq(SupDictDataTwo::getDictValue, value)); + } +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictHandleResultMapingService.java b/src/main/java/com/biutag/supervision/service/SupDictHandleResultMapingService.java new file mode 100644 index 0000000..4927654 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictHandleResultMapingService.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.SupDictHandleResultMaping; +import com.biutag.supervision.mapper.SupDictHandleResultMapingMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class SupDictHandleResultMapingService extends ServiceImpl { + + public List list(List externalNames) { + return list(new LambdaQueryWrapper().in(SupDictHandleResultMaping::getExternalName, externalNames)); + } + + public List listByInternalId(List internalIds) { + return list(new LambdaQueryWrapper().in(SupDictHandleResultMaping::getInternalId, internalIds)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java b/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java new file mode 100644 index 0000000..bf2da8e --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.mapper.SupDictProblemSourceMapper; +import com.biutag.supervision.pojo.entity.SupDictProblemSource; +import com.biutag.supervision.pojo.vo.DictProblemSourceTree; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class SupDictProblemSourceService extends ServiceImpl { + + public List buildTree() { + List dictProblemSources = list(new LambdaQueryWrapper().orderByAsc(SupDictProblemSource::getSort)); + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDictProblemSource dictProblemSource : dictProblemSources) { + DictProblemSourceTree node = new DictProblemSourceTree(); + BeanUtils.copyProperties(dictProblemSource, node); + List children = childMap.computeIfAbsent(node.getParentId(), k -> new ArrayList<>()); + children.add(node); + String parentId = node.getParentId(); + if (AppConstants.DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE.equals(parentId)) { + tree.add(node); + } + } + for (DictProblemSourceTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + private static DictProblemSourceTree buildTreeRecursive(DictProblemSourceTree node, Map> childMap) { + List children = childMap.get(node.getId()); + if (children != null) { + node.getChildren().addAll(children.stream() + .map(childNode -> buildTreeRecursive(childNode, childMap)) + .toList()); + } + return node; + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictProblemTypeMapingService.java b/src/main/java/com/biutag/supervision/service/SupDictProblemTypeMapingService.java new file mode 100644 index 0000000..dfda26c --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictProblemTypeMapingService.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.SupDictHandleResultMaping; +import com.biutag.supervision.pojo.entity.SupDictProblemTypeMaping; +import com.biutag.supervision.mapper.SupDictProblemTypeMapingMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class SupDictProblemTypeMapingService extends ServiceImpl { + + public List list(List externalNames) { + return list(new LambdaQueryWrapper().in(SupDictProblemTypeMaping::getExternalName, externalNames)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictProblemTypeService.java b/src/main/java/com/biutag/supervision/service/SupDictProblemTypeService.java new file mode 100644 index 0000000..3788114 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictProblemTypeService.java @@ -0,0 +1,103 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.mapper.SupDictProblemTypeMapper; +import com.biutag.supervision.pojo.dto.flow.VerifyData; +import com.biutag.supervision.pojo.entity.SupDictProblemType; +import com.biutag.supervision.pojo.vo.DictContentTree; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service +public class SupDictProblemTypeService extends ServiceImpl { + + public List list() { + return list(new LambdaQueryWrapper().orderByAsc(SupDictProblemType::getSort)); + } + + public List buildTree() { + List dictContents = list(); + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDictProblemType dictContent : dictContents) { + DictContentTree node = new DictContentTree(); + BeanUtils.copyProperties(dictContent, node); + List children = childMap.computeIfAbsent(node.getParentCode(), k -> new ArrayList<>()); + children.add(node); + String pCode = node.getParentCode(); + if (AppConstants.DICT_CONTENT_ROOT_PARENT_CODE.equals(pCode)) { + tree.add(node); + } + } + for (DictContentTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + private static DictContentTree buildTreeRecursive(DictContentTree node, Map> childMap) { + List children = childMap.get(node.getCode()); + if (children != null) { + node.getChildren().addAll(children.stream() + .map(childNode -> buildTreeRecursive(childNode, childMap)) + .toList()); + } + return node; + } + + public String getFullName(String code) { + if (StrUtil.isBlank(code)) { + return null; + } + SupDictProblemType three = getById(code); + String fullName = ""; + if (Objects.nonNull(three)) { + fullName = three.getName(); + SupDictProblemType two = getById(three.getParentCode()); + if (Objects.nonNull(two)) { + fullName = two.getName() + "/" + fullName; + SupDictProblemType one = getById(two.getParentCode()); + if (Objects.nonNull(one)) { + fullName = one.getName() + "/" + fullName; + } + } + } + return fullName; + } + + public VerifyData.Problem getProblemByFullName(String fullName) { + String[] arr = fullName.split("/"); + VerifyData.Problem problem = new VerifyData.Problem(); + SupDictProblemType one = getOne(new LambdaQueryWrapper().eq(SupDictProblemType::getName, arr[0])); + if (Objects.isNull(one)) { + return problem; + } + problem.setOneLevelContent(one.getName()); + problem.setOneLevelCode(one.getCode()); + SupDictProblemType two = getOne(new LambdaQueryWrapper() + .eq(SupDictProblemType::getName, arr[1]).eq(SupDictProblemType::getParentCode, one.getCode())); + if (Objects.isNull(two)) { + return problem; + } + problem.setTwoLevelContent(two.getName()); + problem.setTwoLevelCode(two.getCode()); + SupDictProblemType three = getOne(new LambdaQueryWrapper() + .eq(SupDictProblemType::getName, arr[2]).eq(SupDictProblemType::getParentCode, two.getCode())); + if (Objects.isNull(three)) { + return problem; + } + problem.setThreeLevelContent(three.getName()); + problem.setThreeLevelCode(three.getCode()); + return problem; + } + + public List listProblemByFullName(List fullNames) { + return fullNames.stream().map(this::getProblemByFullName).toList(); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictTypeService.java b/src/main/java/com/biutag/supervision/service/SupDictTypeService.java new file mode 100644 index 0000000..e991835 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictTypeService.java @@ -0,0 +1,27 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.dto.DictTypeDto; +import com.biutag.supervision.pojo.entity.SupDictType; +import com.biutag.supervision.mapper.SupDictTypeMapper; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; + +@Service +public class SupDictTypeService extends ServiceImpl { + + public boolean save(DictTypeDto dto) { + if (exists(new LambdaQueryWrapper().eq(SupDictType::getDictType, dto.getDictType()))) { + throw new RuntimeException("字典类型已存在"); + } + SupDictType supDictType = new SupDictType(); + BeanUtils.copyProperties(dto, supDictType); + supDictType.setCreateTime(LocalDateTime.now()); + supDictType.setUpdateTime(LocalDateTime.now()); + return save(supDictType); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupExternalDepartService.java b/src/main/java/com/biutag/supervision/service/SupExternalDepartService.java new file mode 100644 index 0000000..0f21d39 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupExternalDepartService.java @@ -0,0 +1,141 @@ +package com.biutag.supervision.service; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.*; +import com.biutag.supervision.pojo.entity.*; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@RequiredArgsConstructor +@Service +public class SupExternalDepartService extends ServiceImpl { + + private final SupExternalDepartMapper supExternalDepartMapper; + + private final GBaseAJJBXXMapper gBaseAJJBXXMapper; + + private final SupDepartMapper supDepartMapper; + + private final GBaseJJDMapper gBaseJJDMapper; + + private final GBaseCJDMapper gBaseCJDMapper; + + public final ModelClueDataMapper modelClueDataMapper; + + public void insertPreData() { + List supExternalDeparts = new ArrayList<>(); + Set dms = new HashSet<>(); + selectAJJBXX(1, supExternalDeparts, dms); + selectAJJBXX(2, supExternalDeparts, dms); + selectAJJBXX(3, supExternalDeparts, dms); + selectJJDandCJD(dms, supExternalDeparts); + selectWFQYZFRYB(dms, supExternalDeparts); + List supDeparts = supDepartMapper.selectList(new LambdaQueryWrapper().in(SupDepart::getCode, dms)); + for (SupExternalDepart supExternalDepart : supExternalDeparts) { + SupDepart supDepart = supDeparts.stream().filter(item -> item.getCode().equals(supExternalDepart.getExternalId())).findFirst().orElse(null); + if (supDepart != null) { + supExternalDepart.setInternalId(supDepart.getId()); + supExternalDepart.setInternalName(supDepart.getName()); + supExternalDepart.setInternalShortName(supDepart.getShortName()); + supExternalDepart.setLevel(supDepart.getLevel()); + supExternalDepart.setPid(supDepart.getPid()); + } + supExternalDepart.setStatus(0); + supExternalDepart.setCreateTime(LocalDateTime.now()); + } + supExternalDepartMapper.insert(supExternalDeparts); + } + + private void selectJJDandCJD(Set dms, List supExternalDeparts) { + List gBaseJJDS = gBaseJJDMapper.selectList(new QueryWrapper().select("DISTINCT gxdwdm, gxdwmc").ge("bjsj", "2022-10-01")); + if (!gBaseJJDS.isEmpty()) { + gBaseJJDS.forEach(item -> { + if (item != null && item.getGxdwdm() != null && !item.getGxdwdm().isEmpty() && !dms.contains(item.getGxdwdm())) { + SupExternalDepart supExternalDepart = new SupExternalDepart(); + supExternalDepart.setExternalId(item.getGxdwdm()); + supExternalDepart.setExternalName(item.getGxdwmc() == null ? "" : item.getGxdwmc()); + dms.add(item.getGxdwdm()); + supExternalDepart.setSource("情指行"); + supExternalDeparts.add(supExternalDepart); + } + }); + } + List gBaseCJDS = gBaseCJDMapper.selectList(new QueryWrapper().select("DISTINCT cjdxssdwdm, cjdxssdwmc").ge("cjsj", "2022-10-01")); + if (!gBaseCJDS.isEmpty()) { + gBaseCJDS.forEach(item -> { + if (item != null && item.getCjdxssdwdm() != null && !item.getCjdxssdwdm().isEmpty() && !dms.contains(item.getCjdxssdwdm())) { + SupExternalDepart supExternalDepart = new SupExternalDepart(); + supExternalDepart.setExternalId(item.getCjdxssdwdm()); + supExternalDepart.setExternalName(item.getCjdxssdwmc() == null ? "" : item.getCjdxssdwmc()); + dms.add(item.getCjdxssdwdm()); + supExternalDepart.setSource("情指行"); + supExternalDeparts.add(supExternalDepart); + } + }); + } + } + + private void selectWFQYZFRYB(Set dms, List supExternalDeparts) { + List> jjdmaps = modelClueDataMapper.selectByUniqueKeys("SELECT DISTINCT csid, csmc FROM dwd_ry_zfba_zfqywfryb WHERE STR_TO_DATE(djsj, '%Y%m%d%H%i%s') > '2022-10-01';"); + if (!jjdmaps.isEmpty()) { + jjdmaps.forEach(item -> { + if (item != null && item.get("csid") != null && !Objects.equals(item.get("csid"), "") && !dms.contains((String)item.get("csid"))) { + SupExternalDepart supExternalDepart = new SupExternalDepart(); + supExternalDepart.setExternalId((String)item.get("csid")); + supExternalDepart.setExternalName(item.get("csmc") == null ? "" : (String)item.get("csmc")); + dms.add((String)item.get("csid")); + supExternalDepart.setSource("执法办案"); + supExternalDeparts.add(supExternalDepart); + } + }); + } + } + + @DS("slave2") + private void selectAJJBXX(int type, List result, Set dms) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (type == 1) { + queryWrapper.select("DISTINCT LADWBMdm, LADWBMmc").ge("BARQ", "2022-10-01"); + } else if (type == 2) { + queryWrapper.select("DISTINCT PADWBMdm, PADWBMmc").ge("BARQ", "2022-10-01"); + } else if (type == 3) { + queryWrapper.select("DISTINCT BADWIDdm, BADWIDmc").ge("BARQ", "2022-10-01"); + } else { + return; + } + List supExternalDeparts = gBaseAJJBXXMapper.selectList(queryWrapper); + if (!supExternalDeparts.isEmpty()) { + supExternalDeparts.forEach(item -> { + if (item != null && item.getLADWBMdm() != null && !item.getLADWBMdm().isEmpty()) { + SupExternalDepart supExternalDepart = new SupExternalDepart(); + if (type == 1) { + supExternalDepart.setExternalId(item.getLADWBMdm()); + supExternalDepart.setExternalName(item.getLADWBMmc() == null ? "" : item.getLADWBMmc()); + } else if (type == 2 && !dms.contains(item.getPADWBMdm())) { + supExternalDepart.setExternalId(item.getPADWBMdm() == null ? "" : item.getPADWBMdm()); + supExternalDepart.setExternalName(item.getPADWBMmc() == null ? "" : item.getPADWBMmc()); + dms.add(item.getPADWBMdm()); + } else if (type == 3 && !dms.contains(item.getBADWIDdm())) { + supExternalDepart.setExternalId(item.getBADWIDdm() == null ? "" : item.getBADWIDdm()); + supExternalDepart.setExternalName(item.getBADWIDmc() == null ? "" : item.getBADWIDmc()); + dms.add(item.getBADWIDdm()); + } + supExternalDepart.setSource("执法办案"); + result.add(supExternalDepart); + } + }); + } + if (dms.isEmpty() && type == 1) { + dms.addAll(result.stream().map(SupExternalDepart::getExternalId).collect(Collectors.toSet())); + } + } +} diff --git a/src/main/java/com/biutag/supervision/service/SupPhotoService.java b/src/main/java/com/biutag/supervision/service/SupPhotoService.java new file mode 100644 index 0000000..aa323be --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupPhotoService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.SupPhoto; +import com.biutag.supervision.mapper.SupPhotoMapper; +import org.springframework.stereotype.Service; + +@Service +public class SupPhotoService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/SupPoliceService.java b/src/main/java/com/biutag/supervision/service/SupPoliceService.java new file mode 100644 index 0000000..116c9d8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupPoliceService.java @@ -0,0 +1,202 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.mapper.SupPoliceMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.entity.SupPolice; +import com.biutag.supervision.pojo.model.PoliceModel; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.PoliceQueryParam; +import com.biutag.supervision.pojo.vo.DepartTree; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.GetMapping; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@Slf4j +@RequiredArgsConstructor +@Service +public class SupPoliceService extends ServiceImpl { + + private final SupDepartService departService; + + + + public List getALlDepartNode(){ + List GroupPolice = departService.getNotPCSDept(); + return GroupPolice; + } + + public Page page(PoliceQueryParam param) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + UserAuth user = UserContextHolder.getCurrentUser(); + // 权限 + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { + if (user.getAuthDepartIds().isEmpty() || user.getRoleCodes().isEmpty()) { + queryWrapper.eq("p.del", AppConstants.UN_DEL); + + if(StrUtil.isNotBlank(param.getApplicantId())){ + queryWrapper.eq(StrUtil.isNotBlank(param.getApplicantId()),"p.id_code",StrUtil.trim(param.getApplicantId())); + queryWrapper.orderByDesc("d.short_name"); + return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + + queryWrapper.like(StrUtil.isNotBlank(param.getEmpNo()), "p.emp_no", StrUtil.trim(param.getEmpNo())) + .like(StrUtil.isNotBlank(param.getName()), "p.name", StrUtil.trim(param.getName())); + + if (StrUtil.isNotBlank(param.getDepartId())) { + if (Objects.nonNull(param.getDepartBranch()) && param.getDepartBranch()) { + List orgIds = departService.getAllNodeIds(param.getDepartId()); + queryWrapper.in("p.org_id", orgIds); + } else { + queryWrapper.eq("p.org_id", param.getDepartId()); + } + } + + queryWrapper.orderByDesc("d.short_name"); + return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } +// List orgIds = departService.getAllNodeIds(user.getAuthDepartIds()); +// queryWrapper.in("p.org_id", orgIds); + } + queryWrapper.eq("p.del", AppConstants.UN_DEL); + if(StrUtil.isNotBlank(param.getApplicantId())){ + queryWrapper.eq(StrUtil.isNotBlank(param.getApplicantId()),"p.id_code",StrUtil.trim(param.getApplicantId())); + queryWrapper.orderByDesc("d.short_name"); + queryWrapper.orderByAsc("p.position_level").orderByDesc("p.position").orderByAsc("p.sort_id").orderByAsc("d.order_no").orderByAsc("p.person_status"); + return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + queryWrapper.like(StrUtil.isNotBlank(param.getName()), "p.name", StrUtil.trim(param.getName())); + queryWrapper.like(StrUtil.isNotBlank(param.getIdCode()), "p.id_code", StrUtil.trim(param.getIdCode())); + queryWrapper.like(StrUtil.isNotBlank(param.getEmpNo()), "p.emp_no", StrUtil.trim(param.getEmpNo())); + queryWrapper.like(StrUtil.isNotBlank(param.getPhone()), "p.phone", StrUtil.trim(param.getPhone())); + + if (StrUtil.isNotBlank(param.getDepartId())) { + if (Objects.nonNull(param.getDepartBranch()) && param.getDepartBranch()) { + List orgIds = departService.getAllNodeIds(param.getDepartId()); + queryWrapper.in("p.org_id", orgIds); + } else { + queryWrapper.eq("p.org_id", param.getDepartId()); + } + } + + queryWrapper.apply(StrUtil.isNotBlank(param.getRoleId()), String.format("find_in_set( '%s', u.role_id) > 0", param.getRoleId())); + + if (param.getSortField() != null && param.getSortOrder() != null) { + if (param.getSortField().equals("depart")) { + if (param.getSortOrder().equals("ASC")) { + queryWrapper.orderByAsc("d.short_name"); + } else if (param.getSortOrder().equals("DESC")) { + queryWrapper.orderByDesc("d.short_name"); + } + } else if (param.getSortField().equals("property")) { + if (param.getSortOrder().equals("ASC")) { + queryWrapper.orderByAsc("p.person_type"); + } else if (param.getSortOrder().equals("DESC")) { + queryWrapper.orderByDesc("p.person_type"); + } + } + } + queryWrapper.orderByAsc("p.position_level").orderByDesc("p.position").orderByAsc("p.sort_id").orderByAsc("d.order_no").orderByAsc("p.person_status"); + return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + + public Page pageByAbnormal(PoliceQueryParam param) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + UserAuth user = UserContextHolder.getCurrentUser(); + // 权限 + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { + if (user.getAuthDepartIds().isEmpty() || user.getRoleCodes().isEmpty() || !user.getRoleCodes().contains(RoleCodeEnum.SECOND_ADMIN.getCode()) && !user.getRoleCodes().contains(RoleCodeEnum.THREE_ADMIN.getCode())) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + List orgIds = departService.getAllNodeIds(user.getAuthDepartIds()); + queryWrapper.in("p.org_id", orgIds); + } + queryWrapper + .eq("p.del", AppConstants.DEL) + .like(StrUtil.isNotBlank(param.getName()), "p.name", StrUtil.trim(param.getName())); + queryWrapper.like(StrUtil.isNotBlank(param.getIdCode()), "p.id_code", StrUtil.trim(param.getIdCode())); + queryWrapper.like(StrUtil.isNotBlank(param.getEmpNo()), "p.emp_no", StrUtil.trim(param.getEmpNo())); + queryWrapper.like(StrUtil.isNotBlank(param.getPhone()), "p.phone", StrUtil.trim(param.getPhone())); + if (StrUtil.isNotBlank(param.getDepartId())) { + if (Objects.nonNull(param.getDepartBranch()) && param.getDepartBranch()) { + List orgIds = departService.getAllNodeIds(param.getDepartId()); + queryWrapper.in("p.org_id", orgIds); + } else { + queryWrapper.eq("p.org_id", param.getDepartId()); + } + } + queryWrapper.apply(StrUtil.isNotBlank(param.getRoleId()), String.format("find_in_set( '%s', u.role_id) > 0", param.getRoleId())); + if (param.getSortField() != null && param.getSortOrder() != null) { + if (param.getSortField().equals("depart")) { + if (param.getSortOrder().equals("ASC")) { + queryWrapper.orderByAsc("d.short_name"); + } else if (param.getSortOrder().equals("DESC")) { + queryWrapper.orderByDesc("d.short_name"); + } + } else if (param.getSortField().equals("property")) { + if (param.getSortOrder().equals("ASC")) { + queryWrapper.orderByAsc("p.person_type"); + } else if (param.getSortOrder().equals("DESC")) { + queryWrapper.orderByDesc("p.person_type"); + } + } + } + queryWrapper.orderByAsc("p.position_level").orderByDesc("p.position").orderByAsc("p.sort_id").orderByAsc("d.order_no").orderByAsc("p.person_status"); + return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + + public SupPolice getByIdCode(String idCode) { + return getOne(new LambdaQueryWrapper().eq(SupPolice::getIdCode, idCode)); + } + + public SupPolice getByEmpNo(String empNo) { + List polices = list(new LambdaQueryWrapper().eq(SupPolice::getEmpNo, empNo)); + if (polices.isEmpty()) { + return null; + } + if (polices.size() > 1) { + log.error("警号[{}]存在重复", empNo); + } + return polices.get(0); + } + + public List listAllByDepartId(String departId) { + List departIds = departService.getAllNodeIds(List.of(departId)); + return list(new LambdaQueryWrapper().in(SupPolice::getOrgId, departIds).orderByDesc(SupPolice::getPosition)); + } + + public List listLeaderByDepartId(String departId) { + List departIds = departService.getAllNodeIds(List.of(departId)); + return list(new LambdaQueryWrapper().in(SupPolice::getOrgId, departIds).isNotNull(SupPolice::getPhone).orderByDesc(SupPolice::getPosition)); + } + + public Boolean exists(String departId) { + List orgIds = departService.getAllNodeIds(departId); + if (orgIds.isEmpty()) { + return false; + } + return exists(new LambdaQueryWrapper().in(SupPolice::getOrgId, orgIds)); + } + + public Boolean existsByIdCode(String idCode) { + return exists(new LambdaQueryWrapper().in(SupPolice::getIdCode, idCode)); + } + + public long countByOrgIdsAndPersonTypes(List orgIds, List personTypes) { + return count(new LambdaQueryWrapper().in(SupPolice::getOrgId, orgIds).in(SupPolice::getPersonType, personTypes)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/UserLoginService.java b/src/main/java/com/biutag/supervision/service/UserLoginService.java new file mode 100644 index 0000000..b432572 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/UserLoginService.java @@ -0,0 +1,99 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.RedisKeyConstants; +import com.biutag.supervision.constants.enums.DepartLevelEnum; +import com.biutag.supervision.pojo.domain.AppUser; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.UserAuth; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +@RequiredArgsConstructor +@Service +public class UserLoginService { + + private final BaseUserService userService; + + private final BaseRoleService roleService; + + private final SupPoliceService policeService; + + private final SupDepartService departService; + + private final NegDepartAuthorityService negDepartAuthorityService; + + private final NegSourceAuthorityService negSourceAuthorityService; + + private final RedisTemplate redisTemplate; + + @Value("${token.timeout}") + private Integer tokenTimeout; + + public String login(String account) { + UserAuth userAuth = buildUserAuth(account); + String token = IdUtil.fastSimpleUUID(); + redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, token), userAuth, tokenTimeout, TimeUnit.HOURS); + return token; + } + + public AppUser loginByApp(String account) { + UserAuth userAuth = buildUserAuth(account); + String token = IdUtil.fastSimpleUUID(); + redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, token), userAuth, tokenTimeout, TimeUnit.HOURS); + return new AppUser(token, userAuth); + } + + public void logout() { + redisTemplate.opsForValue(); + redisTemplate.delete(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, UserContextHolder.getCurrentToken())); + } + + + @DSTransactional(rollbackFor = Exception.class) + public UserAuth buildUserAuth(String account) { + BaseUser user = userService.getByUserName(account); + SupPolice police = policeService.getByIdCode(account); + SupDepart depart = Optional.ofNullable(police) + .map(item -> departService.getById(item.getOrgId())).orElse(null); + List roles = roleService.listByUserId(user.getUserId()); + List departAuthorities = negDepartAuthorityService.list(user.getUserName()); + List sourceAuthorities = negSourceAuthorityService.list(user.getUserName()); + UserAuth userAuth = new UserAuth() + .setUserId(user.getUserId()) + .setUserName(user.getUserName()) + .setUserType(user.getUserType()) + .setNickName(user.getNickName()) + .setEmpNo(Optional.ofNullable(police).map(SupPolice::getEmpNo).orElse(null)) + .setMobile(Optional.ofNullable(police).map(SupPolice::getMobile).orElse(null)) + .setAvatarUrl(Optional.ofNullable(police).map(SupPolice::getAvatarUrl).orElse(null)) + .setDepartId(Optional.ofNullable(depart).map(SupDepart::getId).orElse(null)) + .setDepartName(Optional.ofNullable(depart).map(SupDepart::getShortName).orElse(null)) + .setRoleCodes(roles.stream().map(BaseRole::getRoleCode).toList()) + .setAuthSources(sourceAuthorities.stream().map(NegSourceAuthority::getSource).toList()) + .setAuthDepartIds(departAuthorities.stream().map(NegDepartAuthority::getDepartId).toList()); + if (Objects.nonNull(depart) && Objects.nonNull(police) && StrUtil.isNotBlank(police.getPosition())) { + if (DepartLevelEnum.FIRST.getValue().equals(depart.getLevel())) { + userAuth.setPosition(String.format("局领导%s", police.getPosition())); + } + if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) { + userAuth.setPosition(String.format("二级机构%s", police.getPosition())); + } + if (DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) { + userAuth.setPosition(String.format("三级机构%s", police.getPosition())); + } + } + return userAuth; + } + +} diff --git a/src/main/java/com/biutag/supervision/service/UserService.java b/src/main/java/com/biutag/supervision/service/UserService.java new file mode 100644 index 0000000..2bcb196 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/UserService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.User; +import com.biutag.supervision.mapper.UserMapper; +import org.springframework.stereotype.Service; + +@Service +public class UserService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/Warning/WarningContentService.java b/src/main/java/com/biutag/supervision/service/Warning/WarningContentService.java new file mode 100644 index 0000000..2ee65ff --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Warning/WarningContentService.java @@ -0,0 +1,15 @@ +package com.biutag.supervision.service.Warning; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.Warning.WarningContentMapper; +import com.biutag.supervision.pojo.entity.warning.WarningContent; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +/** + * @author weipeng + */ +@RequiredArgsConstructor +@Service +public class WarningContentService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/Warning/WarningRecordService.java b/src/main/java/com/biutag/supervision/service/Warning/WarningRecordService.java new file mode 100644 index 0000000..d480740 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/Warning/WarningRecordService.java @@ -0,0 +1,61 @@ +package com.biutag.supervision.service.Warning; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.Report.ReportProjectMapper; +import com.biutag.supervision.mapper.Warning.WarningContentMapper; +import com.biutag.supervision.mapper.Warning.WarningRecordMapper; +import com.biutag.supervision.pojo.entity.report.ReportProject; +import com.biutag.supervision.pojo.entity.warning.WarningContent; +import com.biutag.supervision.pojo.entity.warning.WarningRecord; +import com.biutag.supervision.pojo.vo.warning.WaringVo; +import com.biutag.supervision.pojo.vo.warning.WarningInformData; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author weipeng + */ +@RequiredArgsConstructor +@Service +public class WarningRecordService extends ServiceImpl { + + private final WarningContentMapper contentMapper; + + private final ReportProjectMapper projectMapper; + + //获取签收反馈内容 + public List getWarningInformData(String id){ + return baseMapper.getWarningInformData(id); + } + + + public WarningRecord selectDataByDistinct(String id){ + //查审核数据为空的最新数据 + + + return baseMapper.selectDataByDistinct(id); + } + + public List selectDataByAudit(String id){ + return baseMapper.selectDataByAudit(id); + } + + + public WaringVo getWarningVoFun(String id){ + WaringVo vo=new WaringVo(); + //获取预警信息 + WarningRecord record = baseMapper.selectById(id); + vo.setRecord(record); + //获取预警项 + List content = contentMapper.selectList( + new LambdaQueryWrapper().eq(WarningContent::getWarningId,id) + ); + vo.setContents(content); + ReportProject project = projectMapper.selectById(record.getReportId()); + vo.setReportProject(project); + return vo; + } +} diff --git a/src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java b/src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java new file mode 100644 index 0000000..77d18ee --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java @@ -0,0 +1,46 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.WvpDeviceChannelMapper; +import com.biutag.supervision.pojo.entity.WvpDeviceChannel; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class WvpDeviceChannelService extends ServiceImpl { + + public List getDeviceList() { + List allDevices = list(); + Map deviceMap = allDevices.stream() + .collect(Collectors.toMap(WvpDeviceChannel::getDeviceId, device -> device)); + List hierarchy = new ArrayList<>(); + Queue queue = new LinkedList<>(); + for (WvpDeviceChannel device : allDevices) { + if (device.getParentId() == null) { + hierarchy.add(device); + queue.offer(device); + } + } + while (!queue.isEmpty()) { + WvpDeviceChannel parentDevice = queue.poll(); + List children = deviceMap.values().stream() + .filter(device -> parentDevice.getDeviceId().equals(getParentDeviceId(device.getParentId()))) + .collect(Collectors.toList()); + + if (!children.isEmpty()) { + parentDevice.setChildren(children); + queue.addAll(children); + } + } + return hierarchy; + } + + private String getParentDeviceId(String parentId) { + if (parentId != null && parentId.contains("/")) { + return parentId.substring(parentId.lastIndexOf("/") + 1); + } + return parentId; + } +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/ZhkshDutyScheduleDcService.java b/src/main/java/com/biutag/supervision/service/ZhkshDutyScheduleDcService.java new file mode 100644 index 0000000..e269165 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/ZhkshDutyScheduleDcService.java @@ -0,0 +1,7 @@ +package com.biutag.supervision.service; + +import org.springframework.stereotype.Service; + +@Service +public class ZhkshDutyScheduleDcService { +} diff --git a/src/main/java/com/biutag/supervision/support/ExcelImageConverter.java b/src/main/java/com/biutag/supervision/support/ExcelImageConverter.java new file mode 100644 index 0000000..f445528 --- /dev/null +++ b/src/main/java/com/biutag/supervision/support/ExcelImageConverter.java @@ -0,0 +1,17 @@ +package com.biutag.supervision.support; + +import cn.hutool.core.convert.Converter; + +import java.io.InputStream; +import java.util.List; + +/** + * @author wxc + * @date 2025/3/27 + */ +public class ExcelImageConverter implements Converter> { + @Override + public List convert(Object value, List defaultValue) throws IllegalArgumentException { + return null; + } +} diff --git a/src/main/java/com/biutag/supervision/util/AES.java b/src/main/java/com/biutag/supervision/util/AES.java new file mode 100644 index 0000000..ffe5b6d --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/AES.java @@ -0,0 +1,155 @@ +package com.biutag.supervision.util; + +import cn.hutool.core.codec.Base64Decoder; +import cn.hutool.core.util.StrUtil; +import org.apache.commons.codec.binary.Base64; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.spec.SecretKeySpec; +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; + + +/** + * AES的加密和解密 + * @author libo + */ +public class AES { + //密钥 (需要前端和后端保持一致) + private static final String KEY = "abcdefgabcdefg12"; + //算法 + private static final String ALGORITHMSTR = "AES/ECB/PKCS5Padding"; + + /** + * aes解密 + * @param encrypt 内容 + * @return + * @throws Exception + */ + public static String aesDecrypt(String encrypt) { + try { + return aesDecrypt(encrypt, KEY); + } catch (Exception e) { + e.printStackTrace(); + return ""; + } + } + + /** + * aes加密 + * @param content + * @return + * @throws Exception + */ + public static String aesEncrypt(String content) { + try { + return aesEncrypt(content, KEY); + } catch (Exception e) { + e.printStackTrace(); + return ""; + } + } + + /** + * 将byte[]转为各种进制的字符串 + * @param bytes byte[] + * @param radix 可以转换进制的范围,从Character.MIN_RADIX到Character.MAX_RADIX,超出范围后变为10进制 + * @return 转换后的字符串 + */ + public static String binary(byte[] bytes, int radix){ + return new BigInteger(1, bytes).toString(radix);// 这里的1代表正数 + } + + /** + * base 64 encode + * @param bytes 待编码的byte[] + * @return 编码后的base 64 code + */ + public static String base64Encode(byte[] bytes){ + return Base64.encodeBase64String(bytes); + } + + /** + * base 64 decode + * @param base64Code 待解码的base 64 code + * @return 解码后的byte[] + * @throws Exception + */ + public static byte[] base64Decode(String base64Code) { + return StrUtil.isEmpty(base64Code) ? null : Base64Decoder.decode(base64Code); + } + + + /** + * AES加密 + * @param content 待加密的内容 + * @param encryptKey 加密密钥 + * @return 加密后的byte[] + * @throws Exception + */ + public static byte[] aesEncryptToBytes(String content, String encryptKey) throws Exception { + KeyGenerator kgen = KeyGenerator.getInstance("AES"); + kgen.init(128); + Cipher cipher = Cipher.getInstance(ALGORITHMSTR); + cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(encryptKey.getBytes(), "AES")); + + return cipher.doFinal(content.getBytes(StandardCharsets.UTF_8)); + } + + + /** + * AES加密为base 64 code + * @param content 待加密的内容 + * @param encryptKey 加密密钥 + * @return 加密后的base 64 code + * @throws Exception + */ + public static String aesEncrypt(String content, String encryptKey) throws Exception { + return base64Encode(aesEncryptToBytes(content, encryptKey)); + } + + /** + * AES解密 + * @param encryptBytes 待解密的byte[] + * @param decryptKey 解密密钥 + * @return 解密后的String + * @throws Exception + */ + public static String aesDecryptByBytes(byte[] encryptBytes, String decryptKey) throws Exception { + KeyGenerator kgen = KeyGenerator.getInstance("AES"); + kgen.init(128); + + Cipher cipher = Cipher.getInstance(ALGORITHMSTR); + cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(decryptKey.getBytes(), "AES")); + byte[] decryptBytes = cipher.doFinal(encryptBytes); + return new String(decryptBytes); + } + + + /** + * 将base 64 code AES解密 + * @param encryptStr 待解密的base 64 code + * @param decryptKey 解密密钥 + * @return 解密后的string + * @throws Exception + */ + public static String aesDecrypt(String encryptStr, String decryptKey) throws Exception { + return StrUtil.isEmpty(encryptStr) ? null : aesDecryptByBytes(base64Decode(encryptStr), decryptKey); + } + + /** + * 测试 + */ + public static void main(String[] args) throws Exception { + String content = "123"; + System.out.println("加密前:" + content); + System.out.println("加密密钥和解密密钥:" + KEY); + String encrypt = aesEncrypt(content, KEY); + System.out.println("加密后:" + encrypt); + String decrypt = aesDecrypt(encrypt, KEY); + System.out.println("解密后:" + decrypt); + System.out.println(aesDecrypt("Sy93OjPDF5vwNrkTfL9AyA==")); + } + +} diff --git a/src/main/java/com/biutag/supervision/util/Arrays.java b/src/main/java/com/biutag/supervision/util/Arrays.java new file mode 100644 index 0000000..9c72f05 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/Arrays.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.util; + +/** + * @author wxc + * @date 2025/3/14 + */ +public class Arrays { + + public static T[] array(T... values) { + return values; + } +} diff --git a/src/main/java/com/biutag/supervision/util/BigDecimalUtils.java b/src/main/java/com/biutag/supervision/util/BigDecimalUtils.java new file mode 100644 index 0000000..28f6107 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/BigDecimalUtils.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.util; + +import java.math.BigDecimal; + +public class BigDecimalUtils { + public static boolean isNotZeroAndNull(BigDecimal bg) { + if (null != bg && bg.compareTo(BigDecimal.ZERO) != 0) { + return true; + } + return false; + } + + public static BigDecimal getBigDecimal(BigDecimal bg) { + if (null != bg && bg.compareTo(BigDecimal.ZERO) != 0) { + return bg; + } + return BigDecimal.ZERO; + } +} diff --git a/src/main/java/com/biutag/supervision/util/CommonUtil.java b/src/main/java/com/biutag/supervision/util/CommonUtil.java new file mode 100644 index 0000000..05b9f3a --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/CommonUtil.java @@ -0,0 +1,104 @@ +package com.biutag.supervision.util; + +import org.springframework.beans.BeanUtils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.Period; +import java.util.Calendar; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + +public class CommonUtil { + /** + * 封装BeanUtils.copyProperties 数组转换 + * @param resourceList 源数组 + * @param target 目标对象 + * @param 目标对象类型 + * @return + */ + public static List copyBeanList(List resourceList, Class target){ + List targetList = new LinkedList<>(); + if (null==resourceList||resourceList.isEmpty()){ + return targetList; + } + resourceList.forEach(e->{ + T o = null; + try { + o = target.newInstance(); + } catch (InstantiationException | IllegalAccessException ex) { + ex.printStackTrace(); + } + BeanUtils.copyProperties(e,o); + targetList.add(o); + }); + return targetList; + } + + /** + * 根据出生日期计算年龄 + * @param time 出生日期 + * @return + */ + public static int calculateAge(LocalDateTime time){ + LocalDate birthDate = LocalDate.from(time); + LocalDate currentDate = LocalDate.now(); + + // 计算年龄 + Period period = Period.between(birthDate, currentDate); + int years = period.getYears(); + return years; + } + + + /** + * 根据身份证号码获取年龄 + * + * @param idCardNo 身份证号码 + * @return 年龄,如果身份证号码不合法则返回-1 + */ + public static int getAgeFromIdCard(String idCardNo) { + // 检查身份证号码的长度 + if (idCardNo == null || idCardNo.length() != 18) { + throw new IllegalArgumentException("身份证号码必须是18位"); + } + + // 提取出生日期部分 + String birthDateStr = idCardNo.substring(6, 14); + + // 定义日期格式 + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + Date birthDate = null; + try { + // 将字符串转换为Date对象 + birthDate = sdf.parse(birthDateStr); + } catch (ParseException e) { + throw new RuntimeException("日期格式不正确"); + } + + // 获取当前日期 + Date currentDate = new Date(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(currentDate); + int currentYear = calendar.get(Calendar.YEAR); + int currentMonth = calendar.get(Calendar.MONTH) + 1; // 月份从0开始,需要加1 + int currentDay = calendar.get(Calendar.DAY_OF_MONTH); + + // 获取出生日期的年、月、日 + calendar.setTime(birthDate); + int birthYear = calendar.get(Calendar.YEAR); + int birthMonth = calendar.get(Calendar.MONTH) + 1; // 月份从0开始,需要加1 + int birthDay = calendar.get(Calendar.DAY_OF_MONTH); + + // 计算年龄 + int age = currentYear - birthYear; + if (currentMonth < birthMonth || (currentMonth == birthMonth && currentDay < birthDay)) { + age--; + } + + return age; + } +} diff --git a/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureMine.java b/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureMine.java new file mode 100644 index 0000000..3199620 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureMine.java @@ -0,0 +1,13 @@ +package com.biutag.supervision.util.CompletableUtils; + +/** + * @author kami + * @version 1.0 + * @since 2021/11/22 17:37 + */ +@FunctionalInterface +public interface CompletableFutureMine { + + void run(); + +} diff --git a/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureResult.java b/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureResult.java new file mode 100644 index 0000000..1dc42ab --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureResult.java @@ -0,0 +1,13 @@ +package com.biutag.supervision.util.CompletableUtils; + +/** + * @author kami + * @version 1.0 + * @since 2021/11/22 17:37 + */ +@FunctionalInterface +public interface CompletableFutureResult { + + Boolean run(); + +} diff --git a/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureType.java b/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureType.java new file mode 100644 index 0000000..19ef192 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureType.java @@ -0,0 +1,13 @@ +package com.biutag.supervision.util.CompletableUtils; + +/** + * @author kami + * @version 1.0 + * @since 2021/11/22 17:37 + */ +@FunctionalInterface +public interface CompletableFutureType { + + T run(); + +} diff --git a/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureUtil.java b/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureUtil.java new file mode 100644 index 0000000..d38c5bf --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/CompletableUtils/CompletableFutureUtil.java @@ -0,0 +1,164 @@ +package com.biutag.supervision.util.CompletableUtils; + + +import lombok.extern.slf4j.Slf4j; +import org.slf4j.MDC; + +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +/** + * @author kami + * @version 1.0 + * @since 2021/11/22 17:39 + */ +@Slf4j +public class CompletableFutureUtil { + + private CompletableFutureUtil(){} + + public static final String TRACE_ID = "trace_id"; + + private static void run(CompletableFutureMine completableFutureMine, Map previous) { + if (previous == null) { + MDC.clear(); + } else { + MDC.setContextMap(previous); + } + if (MDC.get(TRACE_ID) == null || MDC.get(TRACE_ID).isEmpty()) { + MDC.put(TRACE_ID, System.nanoTime() + ""); + } + completableFutureMine.run(); + MDC.clear(); + } + + private static Boolean runResult(CompletableFutureResult result, Map previous) { + if (previous == null) { + MDC.clear(); + } else { + MDC.setContextMap(previous); + } + if (MDC.get(TRACE_ID) == null || MDC.get(TRACE_ID).isEmpty()) { + MDC.put(TRACE_ID, System.nanoTime() + ""); + } + Boolean rs = result.run(); + MDC.clear(); + return rs; + } + + public static void runSync(CompletableFutureMine completableFutureMine) { + Map previous = MDC.getCopyOfContextMap(); + CompletableFuture.runAsync(() -> run(completableFutureMine, previous)).exceptionally(e -> { + log.error("",e); + MDC.clear(); + return null; + }); + } + + public static CompletableFuture runSyncObject(CompletableFutureMine completableFutureMine) { + Map previous = MDC.getCopyOfContextMap(); + return CompletableFuture.runAsync(() -> { + if (previous == null) { + MDC.clear(); + } else { + MDC.setContextMap(previous); + } + if (MDC.get(TRACE_ID) == null || MDC.get(TRACE_ID).isEmpty()) { + MDC.put(TRACE_ID, System.nanoTime() + ""); + } + run(completableFutureMine, previous); + MDC.clear(); + }).exceptionally(e -> { + log.error("",e); + MDC.clear(); + return null; + }); + } + + public static void run(CompletableFutureMine completableFutureMine) { + Map previous = MDC.getCopyOfContextMap(); + CompletableFuture.runAsync(() -> run(completableFutureMine, previous)).exceptionally(e -> { + log.error("",e); + MDC.clear(); + return null; + }).join(); + } + + public static void runSyncEach(CompletableFutureResult result, Long time) { + Map previous = MDC.getCopyOfContextMap(); + CompletableFuture.runAsync(() -> { + Boolean goOn = true; + while (Boolean.TRUE.equals(goOn)) { + try { + TimeUnit.SECONDS.sleep(time); + } catch (InterruptedException e) { + log.error("",e); + Thread.currentThread().interrupt(); + } + goOn = runResult(result, previous); + } + }).exceptionally(e -> { + log.error("",e); + MDC.clear(); + return null; + }); + } + + public static void runSyncEach(CompletableFutureResult result, Executor ex, Long time) { + Map previous = MDC.getCopyOfContextMap(); + CompletableFuture.runAsync(() -> { + Boolean goOn = true; + while (goOn) { + try { + TimeUnit.SECONDS.sleep(time); + } catch (InterruptedException e) { + log.error("",e); + Thread.currentThread().interrupt(); + } + goOn = runResult(result, previous); + } + }, ex).exceptionally(e -> { + log.error("",e); + MDC.clear(); + return null; + }); + } + + public static void runSync(CompletableFutureMine completableFutureMine, Executor ex) { + Map previous = MDC.getCopyOfContextMap(); + CompletableFuture.runAsync(() -> run(completableFutureMine, previous), ex).exceptionally(e -> { + log.error("", e); + MDC.clear(); + return null; + }); + } + + public static void runSyncAssert(Boolean assets, CompletableFutureMine completableFutureMine) { + if(Boolean.TRUE.equals(assets)) { + CompletableFuture.runAsync(completableFutureMine::run).exceptionally(e -> { + log.error("",e); + return null; + }); + } + } + + public static CompletableFuture createRunner(CompletableFutureType completableFutureType) { + Map previous = MDC.getCopyOfContextMap(); + return CompletableFuture.supplyAsync(() -> { + if (previous == null) { + MDC.clear(); + } else { + MDC.setContextMap(previous); + } + if (MDC.get(TRACE_ID) == null || MDC.get(TRACE_ID).isEmpty()) { + MDC.put(TRACE_ID, System.nanoTime() + ""); + } + T t = completableFutureType.run(); + MDC.clear(); + return t; + }); + } +} diff --git a/src/main/java/com/biutag/supervision/util/CustomFontLoader.java b/src/main/java/com/biutag/supervision/util/CustomFontLoader.java new file mode 100644 index 0000000..c610430 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/CustomFontLoader.java @@ -0,0 +1,27 @@ +package com.biutag.supervision.util; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.core.io.ClassPathResource; + +import java.awt.*; +import java.io.InputStream; + +@Slf4j +public class CustomFontLoader { + public static void loadCustomFonts() throws Exception { + + ClassPathResource couponOrderTemplateResource = new ClassPathResource("fonts/simsun.ttf"); + InputStream inputStream =couponOrderTemplateResource.getInputStream(); + log.info("寻找字体文件中-------"); + try { + Font customFont = null; + if (inputStream != null) { + customFont = Font.createFont(Font.TRUETYPE_FONT, inputStream); + GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(customFont); + } + + }catch (Exception e){ + throw new Exception(); + } + } +} diff --git a/src/main/java/com/biutag/supervision/util/DataDisposeUtil.java b/src/main/java/com/biutag/supervision/util/DataDisposeUtil.java new file mode 100644 index 0000000..aa0b30c --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/DataDisposeUtil.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.util; + +import cn.hutool.core.util.StrUtil; + +public class DataDisposeUtil { + + public static String StrNullBlank(String value){ + return StrUtil.isNotBlank(value) ?value:""; + } +} diff --git a/src/main/java/com/biutag/supervision/util/DownloadAndZip.java b/src/main/java/com/biutag/supervision/util/DownloadAndZip.java new file mode 100644 index 0000000..ac5893b --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/DownloadAndZip.java @@ -0,0 +1,122 @@ +package com.biutag.supervision.util; + +import com.biutag.supervision.service.FileService; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.nio.file.*; +import java.util.ArrayList; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +public class DownloadAndZip { + + + // 下载文件并保存到指定目录 + public static void downloadFile(InputStream inputStream, String savePath) throws IOException { + + + try ( + FileOutputStream outputStream = new FileOutputStream(savePath)) { + + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + } + } + + // 将文件移动到指定文件夹 + public static void moveFileToFolder(String sourcePath, String folderName) throws IOException { + Path source = Paths.get(sourcePath); + Path targetFolder = Paths.get("downloads/" + folderName); + Path target = targetFolder.resolve(source.getFileName()); + + // 创建目标文件夹(如果不存在) + if (!Files.exists(targetFolder)) { + Files.createDirectories(targetFolder); + } + + // 移动文件 + Files.move(source, target, StandardCopyOption.REPLACE_EXISTING); + } + + // 将多个文件夹打包成zip + public static void zipFolders(List folderNames, String zipFilePath) throws IOException { + try (FileOutputStream fos = new FileOutputStream(zipFilePath); + ZipOutputStream zos = new ZipOutputStream(fos)) { + + for (String folderName : folderNames) { + Path folderPath = Paths.get("downloads/" + folderName); + zipFolder(folderPath, folderName, zos); + } + } + } + + public static void doGet(HttpServletResponse response,String filePath,String zipName) throws IOException { + // 从请求参数中获取文件路径(这里假设文件路径是通过请求参数传递的,实际应用中可能需要更安全的方式) + + if (filePath == null || filePath.isEmpty()) { + response.sendError(HttpServletResponse.SC_BAD_REQUEST, "File path is required"); + return; + } + + // 校验文件路径的合法性(这里只是简单示例,实际应用中需要更严格的校验) + File file = new File(filePath); + if (!file.exists() || !file.isFile()) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, "File not found"); + return; + } + + // 获取MIME类型 + String mimeType = "application/octet-stream"; + + // 设置响应内容类型 + response.setContentType(mimeType); + response.setContentLength((int) file.length()); + + // 设置Content-Disposition头以提示浏览器下载文件 + String headerKey = "Content-Disposition"; + String headerValue = String.format("attachment; filename=\"%s\"", URLEncoder.encode(zipName, StandardCharsets.UTF_8)); + response.setHeader(headerKey, headerValue); + + // 读取文件内容并写入响应输出流 + try (FileInputStream inputStream = new FileInputStream(file); + OutputStream outputStream = response.getOutputStream()) { + + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + } + } + + private static void zipFolder(Path folderPath, String parentFolderName, ZipOutputStream zos) throws IOException { + for (File file : folderPath.toFile().listFiles()) { + Path filePath = folderPath.resolve(file.getName()); + if (Files.isDirectory(filePath)) { + zipFolder(filePath, parentFolderName + "/" + file.getName(), zos); + } else { + try (FileInputStream fis = new FileInputStream(filePath.toFile())) { + ZipEntry zipEntry = new ZipEntry(parentFolderName + "/" + file.getName()); + zos.putNextEntry(zipEntry); + byte[] buffer = new byte[1024]; + int length; + while ((length = fis.read(buffer)) > 0) { + zos.write(buffer, 0, length); + } + } + } + } + } + + +} diff --git a/src/main/java/com/biutag/supervision/util/ExpressionBuilder.java b/src/main/java/com/biutag/supervision/util/ExpressionBuilder.java new file mode 100644 index 0000000..4519ba7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/ExpressionBuilder.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.util; + +import java.util.Optional; + +/** + * @author wxc + * @date 2024/10/17 + */ +public class ExpressionBuilder { + + public static String build(String time) { + return build(time, null); + } + + public static String build(String time, String week) { + String expressionFormat = "%s %s %s * * %s"; + String[] split = time.split(":"); + String weekArg = Optional.ofNullable(week).orElse("*"); + return String.format(expressionFormat, Integer.parseInt(split[2]), Integer.parseInt(split[1]), Integer.parseInt(split[0]), weekArg); + } + +} diff --git a/src/main/java/com/biutag/supervision/util/IDCardInfoExtractor.java b/src/main/java/com/biutag/supervision/util/IDCardInfoExtractor.java new file mode 100644 index 0000000..acdc13c --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/IDCardInfoExtractor.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.util; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.GregorianCalendar; + +public class IDCardInfoExtractor { + // 根据身份证号码获取性别,1表示男性,2表示女性,0表示无法确定 + public static int getGender(String idCard) { + if (idCard == null || idCard.length() < 17) { + return 0; // 身份证号码无效 + } + char genderChar = idCard.charAt(16); // 第17位代表性别 + int gender = genderChar % 2 == 0 ? 2 : 1; // 偶数表示女性,奇数表示男性 + return gender; + } + + // 根据身份证号码获取年龄 + public static int getAge(String idCard) throws ParseException { + if (idCard == null || idCard.length() < 14) { + return -1; // 身份证号码无效 + } + String birthStr = idCard.substring(6, 14); // 提取出生日期部分,格式为YYYYMMDD + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); + Date birthDate = sdf.parse(birthStr); + GregorianCalendar calendar = new GregorianCalendar(); + calendar.setTime(new Date()); + int currentYear = calendar.get(GregorianCalendar.YEAR); + int currentMonth = calendar.get(GregorianCalendar.MONTH) + 1; // 月份从0开始,需要加1 + int currentDay = calendar.get(GregorianCalendar.DAY_OF_MONTH); + + calendar.setTime(birthDate); + int birthYear = calendar.get(GregorianCalendar.YEAR); + int birthMonth = calendar.get(GregorianCalendar.MONTH) + 1; // 月份从0开始,需要加1 + int birthDay = calendar.get(GregorianCalendar.DAY_OF_MONTH); + + int age = currentYear - birthYear; + if (currentMonth < birthMonth || (currentMonth == birthMonth && currentDay < birthDay)) { + age--; // 如果还没到生日,则年龄减1 + } + return age; + } + +} diff --git a/src/main/java/com/biutag/supervision/util/ImgUtils.java b/src/main/java/com/biutag/supervision/util/ImgUtils.java new file mode 100644 index 0000000..900a457 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/ImgUtils.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.util; + +import cn.hutool.core.img.ImgUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; + +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.util.List; + +/** + * @author wxc + * @date 2025/3/27 + */ +public class ImgUtils { + + public final static List IMG_TYPES = List.of("jpg", "jpeg", "png", "gif", "ico", "svg", "webp"); + + public static boolean isImg(String fileName) { + if (StrUtil.isBlank(fileName)) { + return false; + } + return IMG_TYPES.contains(FileUtil.extName(fileName).toLowerCase()); + } + + public static String createSquareThumbnailBase64(InputStream is, int j) { + BufferedImage bufferedImage = ImgUtil.read(is); + int h = Math.min(bufferedImage.getHeight(), bufferedImage.getWidth()); + int x = 0; + int y = 0; + if (bufferedImage.getHeight() >= bufferedImage.getWidth()) { + y = (bufferedImage.getHeight() - bufferedImage.getWidth()) / 2; + } else { + x = (bufferedImage.getWidth() - bufferedImage.getHeight()) / 2; + } + // 裁剪 + Image cutImg = cn.hutool.core.img.ImgUtil.cut(bufferedImage, new Rectangle(x, y, h, h)); + // 缩放 + Image scaleImg = cn.hutool.core.img.ImgUtil.scale(cutImg, (float) NumberUtil.div(j, h)); + return ImgUtil.toBase64(scaleImg, "jpg"); + } + +} diff --git a/src/main/java/com/biutag/supervision/util/JSON.java b/src/main/java/com/biutag/supervision/util/JSON.java new file mode 100644 index 0000000..f0766c6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/JSON.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.util; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.util.List; + +public class JSON { + + private static final ObjectMapper objectMapper = new ObjectMapper(); + + public static String toJSONString(Object object) { + try { + return objectMapper.writeValueAsString(object); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + public static JsonNode readTree(String jsonString) { + try { + return objectMapper.readTree(jsonString); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + public static T readValue(String jsonString, Class valueType) { + try { + return objectMapper.readValue(jsonString, valueType); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + public static List readValueForList(String jsonString, Class valueType) { + try { + return objectMapper.readerForListOf(valueType).readValue(jsonString); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/src/main/java/com/biutag/supervision/util/ScoreRule.java b/src/main/java/com/biutag/supervision/util/ScoreRule.java new file mode 100644 index 0000000..a07d83e --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/ScoreRule.java @@ -0,0 +1,33 @@ +package com.biutag.supervision.util; + +/** + * @author wxc + * @date 2024/11/9 + */ +public class ScoreRule { + + public static Double getFrequencyScore(Integer frequency) { + if (frequency == 2) { + return 0.1; + } + if (frequency >= 3) { + return 0.3; + } + return 0.0; + } + + public static Double getIncidenceFactor(Double incidenceRate, Double incidenceRateTied) { + double b = incidenceRateTied * 0.8; + double b1 = incidenceRateTied * 1.2; + // 中等问题发生率 :平均问题发生率 × 0.8 < 问题发生率 ≤ 平均问题发生率 × 1.2 + if (b < incidenceRate && incidenceRate <= b1) { + return 0.0; + } + // 高问题发生率 问题发生率 > 平均问题发生率 × 1.2 + if (incidenceRate > b1) { + return 0.15; + } + return -0.15; + } + +} diff --git a/src/main/java/com/biutag/supervision/util/SpringUtil.java b/src/main/java/com/biutag/supervision/util/SpringUtil.java new file mode 100644 index 0000000..75fcb1b --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/SpringUtil.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.util; + +import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Component; + +@Component +public class SpringUtil { + + private static ApplicationContext applicationContext; + + public SpringUtil(ApplicationContext applicationContext) { + SpringUtil.applicationContext = applicationContext; + } + + public static ListableBeanFactory getBeanFactory() { + return applicationContext; + } + + public static T getBean(Class clazz) { + return getBeanFactory().getBean(clazz); + } + + public static T getBean(String name, Class clazz) { + return getBeanFactory().getBean(name, clazz); + } + +} diff --git a/src/main/java/com/biutag/supervision/util/SslUtil.java b/src/main/java/com/biutag/supervision/util/SslUtil.java new file mode 100644 index 0000000..228beaf --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/SslUtil.java @@ -0,0 +1,62 @@ +package com.biutag.supervision.util; + +import lombok.experimental.UtilityClass; + +import javax.net.ssl.*; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; + +/** + * @author kami on 2024-02-07 11:17:09 + * @version 0.0.1 + * @since 1.8 + */ +@UtilityClass +public class SslUtil { + + private static void trustAllHttpsCertificates() throws Exception { + TrustManager[] trustAllCerts = new TrustManager[1]; + TrustManager tm = new miTM(); + trustAllCerts[0] = tm; + SSLContext sc = SSLContext.getInstance("SSL"); + sc.init(null, trustAllCerts, null); + HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); + } + + static class miTM implements TrustManager, X509TrustManager { + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + public boolean isServerTrusted(X509Certificate[] certs) { + return true; + } + + public boolean isClientTrusted(X509Certificate[] certs) { + return true; + } + + public void checkServerTrusted(X509Certificate[] certs, String authType) + throws CertificateException { + } + + public void checkClientTrusted(X509Certificate[] certs, String authType) + throws CertificateException { + } + } + + /** + * 忽略HTTPS请求的SSL证书,必须在openConnection之前调用 + * @throws Exception + */ + public static void ignoreSsl() throws Exception{ + HostnameVerifier hv = new HostnameVerifier() { + public boolean verify(String urlHostName, SSLSession session) { + System.out.println("Warning: URL Host: " + urlHostName + " vs. " + session.getPeerHost()); + return true; + } + }; + trustAllHttpsCertificates(); + HttpsURLConnection.setDefaultHostnameVerifier(hv); + } +} diff --git a/src/main/java/com/biutag/supervision/util/TimeUtil.java b/src/main/java/com/biutag/supervision/util/TimeUtil.java new file mode 100644 index 0000000..d08a03f --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/TimeUtil.java @@ -0,0 +1,105 @@ +package com.biutag.supervision.util; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; +import com.biutag.supervision.constants.enums.FlowNodeEnum; +import com.biutag.supervision.service.HolidayService; + +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.temporal.ChronoUnit; +import java.util.Objects; + +public class TimeUtil { + + // 一天86400秒 + public static final Long SECONDS_OF_A_DAY = 86400L; + + /** + * + * @param beginTime + * @param endTime + * @param maxDuration 最大时长(秒) + * @return + */ + public static long getRemainingDuration(LocalDateTime beginTime, LocalDateTime endTime, Long maxDuration) { + if (Objects.isNull(beginTime)) { + return 0; + } + if (maxDuration < SECONDS_OF_A_DAY) { + return maxDuration - ChronoUnit.SECONDS.between(beginTime, endTime); + } + HolidayService holidayService = SpringUtil.getBean(HolidayService.class); + long duration = 0; + for (LocalDateTime time = beginTime; time.isBefore(endTime.with(LocalTime.MAX)); time = time.plusDays(1)) { + // 判断是否是节假日 + if (holidayService.isHoliday(DatePattern.NORM_DATE_FORMATTER.format(time))) { + continue; + } + // 开始时间是否是当天 + if (beginTime.toLocalDate().equals(endTime.toLocalDate())) { + duration += ChronoUnit.SECONDS.between(beginTime, endTime); + } + // 是否是第一天 + else if (time.equals(beginTime)) { + duration += ChronoUnit.SECONDS.between(time, time.with(LocalTime.MAX)); + } + // 当天(开始时间不是当天) + else if (time.toLocalDate().equals(endTime.toLocalDate())) { + duration += ChronoUnit.SECONDS.between(time.with(LocalTime.MIN), endTime); + } + else { + duration += TimeUtil.SECONDS_OF_A_DAY; + } + } + return maxDuration - duration; + } + + /** + * + * @param beginTime + * @param maxDuration 最大时长(秒) + * @return + */ + public static long getRemainingDuration(LocalDateTime beginTime, Long maxDuration) { + return getRemainingDuration(beginTime, LocalDateTime.now(), maxDuration); + } + + /** + * + * @param beginTime + * @param maxDurationDays 最大时长(天) + * @return + */ + public static long getRemainingDuration(LocalDateTime beginTime, Integer maxDurationDays) { + if (Objects.isNull(maxDurationDays)) { + return 0; + } + return getRemainingDuration(beginTime, NumberUtil.mul(maxDurationDays, SECONDS_OF_A_DAY).longValue()); + } + + /** + * + * @param beginTime + * @param maxDuration + * @param extensionDurationDays 延期天数 + * @return + */ + public static long getRemainingDuration(LocalDateTime beginTime, Integer maxDuration, Integer extensionDurationDays) { + return getRemainingDuration(beginTime, maxDuration) + NumberUtil.mul(extensionDurationDays, SECONDS_OF_A_DAY).longValue(); + } + + public static Long getRemainingDuration(LocalDateTime beginTime, Integer maxSignDuration, Integer maxHandleDuration, Integer extensionDurationDays, String flowKey) { + if (StrUtil.isBlank(flowKey)) { + return null; + } + if (FlowNodeEnum.isSignFlow(flowKey)) { + return getRemainingDuration(beginTime, maxSignDuration); + } + if (Objects.isNull(extensionDurationDays)) { + return getRemainingDuration(beginTime, maxHandleDuration); + } + return getRemainingDuration(beginTime, maxHandleDuration, extensionDurationDays); + } +} diff --git a/src/main/java/com/biutag/supervision/util/WordUtil.java b/src/main/java/com/biutag/supervision/util/WordUtil.java new file mode 100644 index 0000000..c268af9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/WordUtil.java @@ -0,0 +1,36 @@ +package com.biutag.supervision.util; + +import com.aspose.words.Document; +import com.aspose.words.License; +import com.aspose.words.SaveFormat; +import lombok.extern.slf4j.Slf4j; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; + +@Slf4j +public class WordUtil { + + public static InputStream convertDocx(InputStream is) { + getLicense(); + try(ByteArrayOutputStream f = new ByteArrayOutputStream()) { + Document doc = new Document(is); + doc.save(f, SaveFormat.DOCX); + return new ByteArrayInputStream(f.toByteArray()); + } catch (Exception e) { + throw new RuntimeException("docx转换异常:" + e.getMessage()); + } + } + + public static boolean getLicense() { + try (InputStream is = WordUtil.class.getResourceAsStream("/license/words.license.xml")){ + License aposeLic = new License(); + aposeLic.setLicense(is); + return true; + } catch (Exception e) { + throw new RuntimeException(e.getMessage()); + } + } + +} diff --git a/src/main/resources/.DS_Store b/src/main/resources/.DS_Store new file mode 100644 index 0000000..93884d9 Binary files /dev/null and b/src/main/resources/.DS_Store differ diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..4ffe95f --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,93 @@ +spring: + datasource: + dynamic: + datasource: + master: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/invert?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + szdczx: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/negative?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + slave: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/open-platform?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + slave2: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/negative?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + slave3: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/negative?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + slave4: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/csga_wdpcdb?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + mailbox: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://58.51.152.18:10642/mailbox?currentSchema=mailbox + username: alphay + password: alphay@123 + wvp: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/wvp2?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + zb: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: dm.jdbc.driver.DmDriver + url: jdbc:dm://65.47.22.243:5236?SCHEMA=JSDZ_4GDB + username: DCZD + password: DCZD@2024 + zbdm: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: dm.jdbc.driver.DmDriver + url: jdbc:dm://65.32.34.9:5237?SCHEMA=CSGA110 + username: dczd_cx + password: dczd#110110 + data: + redis: + host: 172.31.217.20 + # 端口,默认为6379 + port: 31707 + # 数据库索引 + database: 1 + # 连接超时时间 + timeout: 10s + +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +fdfs: + tracker-list: #TrackerList参数,支持多个 + - 172.31.217.20:32060 + preview-url: http://172.31.217.20:31664 + +springdoc: + group-configs: + - group: 'plugin' + paths-to-match: + - '/api/plugin/**' + - '/login' + - '/**' +videoInspection: + url: http://65.47.26.33:8090/ + video-img-url: http://65.47.6.105:18080/ + video-ws: ws://65.47.6.105:80/ +mailbox: + url: http://65.47.60.145/api/ diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..db92e31 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,100 @@ +spring: + datasource: + dynamic: + datasource: + master: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://65.47.6.109:3306/invert?serverTimezone=GMT%2B8&useSSL=false + username: root + password: ip12341234 + szdczx: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://65.47.6.109:3306/negative?serverTimezone=GMT%2B8&useSSL=false + username: root + password: ip12341234 + slave: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://65.47.6.109:3306/open-platform?serverTimezone=GMT%2B8&useSSL=false + username: root + password: ip12341234 + slave2: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.gbase.jdbc.Driver + url: jdbc:gbase://65.47.16.209:5258/csga_dwd + username: csga_wdpc + password: csga_wdpc@123 + slave3: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: dm.jdbc.driver.DmDriver + url: jdbc:dm://65.47.22.243:5236?SCHEMA=JSDZ_4GDB + username: DCZD + password: DCZD@2024 + slave4: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://65.47.6.109:3306/csga_wdpcdb?serverTimezone=GMT%2B8&useSSL=false + username: root + password: ip12341234 + mailbox: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: org.postgresql.Driver + url: jdbc:postgresql://65.47.60.178:5432/mailbox?currentSchema=mailbox + username: dba + password: Ip12341234 + wvp: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://65.47.6.109:3306/wvp2?serverTimezone=GMT%2B8&useSSL=false + username: root + password: ip12341234 + zbdm: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: dm.jdbc.driver.DmDriver + url: jdbc:dm://65.32.34.9:5237?SCHEMA=CSGA110 + username: dczd_cx + password: dczd#110110 + druid: + min-evictable-idle-time-millis: 300000 + test-on-borrow: false + test-on-return: false + initial-size: 10 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + test-while-idle: true + validation-query: select 1 + time-between-eviction-runs-millis: 60000 + max-pool-prepared-statement-per-connection-size: 20 + max-active: 100 + + # druid监控全局配置 + druid: + stat-view-servlet: + enabled: true + url-pattern: /druid/* + wall: + multi-statement-allow: true + data: + redis: + host: 65.47.6.109 + # 端口,默认为6379 + port: 6379 + password: ip1234!@#$ + +fdfs: + tracker-list: + - 65.47.6.110:22122 + preview-url: http://65.47.6.110:81 + +negative: + v1-user-url: http://65.47.6.108:8765/admin/current/user +videoInspection: + url: http://65.47.26.33:8090/ + video-img-url: http://65.47.6.105:18080/ + video-ws: ws://65.47.6.105:80/ + +mailbox: + url: http://65.47.60.145/api/ diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..c5bce62 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,53 @@ +server: + port: 8080 +spring: + cache: + type: redis + profiles: + active: @profiles.active@ +# active: dev + datasource: + dynamic: + primary: master + data: + redis: + # 数据库索引 + database: 1 + # 连接超时时间 + timeout: 10s + + jackson: + time-zone: Asia/Shanghai + servlet: + multipart: + max-file-size: 100MB + max-request-size: 100MB + +mybatis-plus: + # 对应的 XML 文件位置 + mapper-locations: classpath*:mapper/*Mapper.xml + +fdfs: + soTimeout: 1500 # socket连接超时时长 + connectTimeout: 600 # 连接tracker服务器超时时长 + + pool: + #从池中借出的对象的最大数目(配置为-1表示不限制) + max-total: -1 + #获取连接时的最大等待毫秒数(默认配置为5秒) + max-wait-millis: 5000 + #每个key最大连接数 + max-total-per-key: 50 + #每个key对应的连接池最大空闲连接数 + max-idle-per-key: 10 + #每个key对应的连接池最小空闲连接数 + min-idle-per-key: 5 + +knife4j: + setting: + language: zh_cn + +token: + timeout: 168 # 7 * 24 小时 +mailbox: + url: \ No newline at end of file diff --git a/src/main/resources/excelTemplate/控制价定案表.xls b/src/main/resources/excelTemplate/控制价定案表.xls new file mode 100644 index 0000000..ebb7789 Binary files /dev/null and b/src/main/resources/excelTemplate/控制价定案表.xls differ diff --git a/src/main/resources/excelTemplate/政府投资项目审计情况备案表.xlsx b/src/main/resources/excelTemplate/政府投资项目审计情况备案表.xlsx new file mode 100644 index 0000000..043f77f Binary files /dev/null and b/src/main/resources/excelTemplate/政府投资项目审计情况备案表.xlsx differ diff --git a/src/main/resources/excelTemplate/结算定案表.xls b/src/main/resources/excelTemplate/结算定案表.xls new file mode 100644 index 0000000..3d2687c Binary files /dev/null and b/src/main/resources/excelTemplate/结算定案表.xls differ diff --git a/src/main/resources/fonts/simsun.ttf b/src/main/resources/fonts/simsun.ttf new file mode 100644 index 0000000..e0115ab Binary files /dev/null and b/src/main/resources/fonts/simsun.ttf differ diff --git a/src/main/resources/jitMessage.properties b/src/main/resources/jitMessage.properties new file mode 100644 index 0000000..f2a56a5 --- /dev/null +++ b/src/main/resources/jitMessage.properties @@ -0,0 +1,4 @@ +#\u8ba4\u8bc1\u5730\u5740 +authURL=http://172.16.22.243:6180/MessageService +#\u5e94\u7528\u6807\u8bc6,\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\uff0c\u4e0e\u7f51\u5173\u4e2d\u914d\u7f6e\u7684\u5e94\u7528\u6807\u8bc6\u4e00\u81f4 +appId=testApp2 diff --git a/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar b/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar new file mode 100644 index 0000000..778cd39 Binary files /dev/null and b/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar differ diff --git a/src/main/resources/license/words.license.xml b/src/main/resources/license/words.license.xml new file mode 100644 index 0000000..ecd46c1 --- /dev/null +++ b/src/main/resources/license/words.license.xml @@ -0,0 +1,13 @@ + + + + Aspose.Total for Java + Aspose.Words for Java + + Enterprise + 20991231 + 20991231 + 8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7 + + sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU= + diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..8cd7d93 --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,63 @@ + + + logs + + + + + + + + + + + + + ${log.colorPattern} + UTF-8 + + + + + + + ${log.path}/info/info.%d{yyyy-MM-dd}.log + ${log.maxHistory} + + + ${log.pattern} + + + INFO + ACCEPT + DENY + + + + + + ${log.path}/error/error.%d{yyyy-MM-dd}.log + ${log.maxHistory} + + + ${log.pattern} + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/InformMessageMapper.xml b/src/main/resources/mapper/InformMessageMapper.xml new file mode 100644 index 0000000..ec9babd --- /dev/null +++ b/src/main/resources/mapper/InformMessageMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + diff --git a/src/main/resources/mapper/InvertRecordMapper.xml b/src/main/resources/mapper/InvertRecordMapper.xml new file mode 100644 index 0000000..ca278a5 --- /dev/null +++ b/src/main/resources/mapper/InvertRecordMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/src/main/resources/mapper/PriceInformationMapper.xml b/src/main/resources/mapper/PriceInformationMapper.xml new file mode 100644 index 0000000..3d33b0b --- /dev/null +++ b/src/main/resources/mapper/PriceInformationMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/src/main/resources/mapper/RecessedLogMapper.xml b/src/main/resources/mapper/RecessedLogMapper.xml new file mode 100644 index 0000000..9a39157 --- /dev/null +++ b/src/main/resources/mapper/RecessedLogMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/src/main/resources/mapper/ReportProjectMapper.xml b/src/main/resources/mapper/ReportProjectMapper.xml new file mode 100644 index 0000000..a199e91 --- /dev/null +++ b/src/main/resources/mapper/ReportProjectMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/ServiceUnitMapper.xml b/src/main/resources/mapper/ServiceUnitMapper.xml new file mode 100644 index 0000000..278d59a --- /dev/null +++ b/src/main/resources/mapper/ServiceUnitMapper.xml @@ -0,0 +1,14 @@ + + + + + + diff --git a/src/main/resources/mapper/SupDictContentMapper.xml b/src/main/resources/mapper/SupDictContentMapper.xml new file mode 100644 index 0000000..5b3c984 --- /dev/null +++ b/src/main/resources/mapper/SupDictContentMapper.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/SupPoliceMapper.xml b/src/main/resources/mapper/SupPoliceMapper.xml new file mode 100644 index 0000000..3cf01c2 --- /dev/null +++ b/src/main/resources/mapper/SupPoliceMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + diff --git a/src/main/resources/mapper/WarningRecordMapper.xml b/src/main/resources/mapper/WarningRecordMapper.xml new file mode 100644 index 0000000..1a02179 --- /dev/null +++ b/src/main/resources/mapper/WarningRecordMapper.xml @@ -0,0 +1,50 @@ + + + + + + + + + + diff --git a/src/main/resources/static/.DS_Store b/src/main/resources/static/.DS_Store new file mode 100644 index 0000000..a580bdf Binary files /dev/null and b/src/main/resources/static/.DS_Store differ diff --git a/src/main/resources/static/templates/政府投资项目价格信息汇总表模板.xlsx b/src/main/resources/static/templates/政府投资项目价格信息汇总表模板.xlsx new file mode 100644 index 0000000..001713b Binary files /dev/null and b/src/main/resources/static/templates/政府投资项目价格信息汇总表模板.xlsx differ diff --git a/src/main/resources/static/templates/数字督察警员权限导入模板.xlsx b/src/main/resources/static/templates/数字督察警员权限导入模板.xlsx new file mode 100644 index 0000000..fadc15d Binary files /dev/null and b/src/main/resources/static/templates/数字督察警员权限导入模板.xlsx differ