lwhhszx 2 роки тому
батько
коміт
8665712306

+ 0 - 205
RMS/RMS.iml

@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
-  <component name="FacetManager">
-    <facet type="web" name="Web">
-      <configuration>
-        <webroots />
-        <sourceRoots>
-          <root url="file://$MODULE_DIR$/src/main/java" />
-          <root url="file://$MODULE_DIR$/src/main/resources" />
-        </sourceRoots>
-      </configuration>
-    </facet>
-    <facet type="Spring" name="Spring">
-      <configuration />
-    </facet>
-  </component>
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
-    <output url="file://$MODULE_DIR$/target/classes" />
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
-    <content url="file://$MODULE_DIR$">
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
-      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
-      <excludeFolder url="file://$MODULE_DIR$/${project.build.directory}/classes" />
-      <excludeFolder url="file://$MODULE_DIR$/${project.build.directory}/test-classes" />
-      <excludeFolder url="file://$MODULE_DIR$/target" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="library" name="Maven: org.springdoc:springdoc-openapi-ui:1.6.6" level="project" />
-    <orderEntry type="library" name="Maven: org.springdoc:springdoc-openapi-webmvc-core:1.6.6" level="project" />
-    <orderEntry type="library" name="Maven: org.springdoc:springdoc-openapi-common:1.6.6" level="project" />
-    <orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-core:2.1.12" level="project" />
-    <orderEntry type="library" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
-    <orderEntry type="library" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.1" level="project" />
-    <orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-annotations:2.1.12" level="project" />
-    <orderEntry type="library" name="Maven: io.swagger.core.v3:swagger-models:2.1.12" level="project" />
-    <orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
-    <orderEntry type="library" name="Maven: org.webjars:swagger-ui:4.5.0" level="project" />
-    <orderEntry type="library" name="Maven: org.webjars:webjars-locator-core:0.48" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.1" level="project" />
-    <orderEntry type="library" name="Maven: io.github.classgraph:classgraph:4.8.138" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.10" level="project" />
-    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.10" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.1" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.1" level="project" />
-    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
-    <orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.29" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.7" level="project" />
-    <orderEntry type="library" name="Maven: com.deepoove:poi-tl:1.10.3" level="project" />
-    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.2" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.2" level="project" />
-    <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.2" level="project" />
-    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.15" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" />
-    <orderEntry type="library" name="Maven: com.zaxxer:SparseBitSet:1.2" level="project" />
-    <orderEntry type="library" name="Maven: com.deepoove:poi-ooxml-schemas-extra:4.1.4" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-transcoder:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-anim:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-css:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-ext:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-parser:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-svg-dom:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-awt-util:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:xmlgraphics-commons:2.6" level="project" />
-    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-bridge:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-script:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-dom:1.14" level="project" />
-    <orderEntry type="library" name="Maven: xalan:xalan:2.7.2" level="project" />
-    <orderEntry type="library" name="Maven: xalan:serializer:2.7.2" level="project" />
-    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-gvt:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-shared-resources:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-svggen:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-util:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-constants:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-i18n:1.14" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-xml:1.14" level="project" />
-    <orderEntry type="library" name="Maven: xml-apis:xml-apis-ext:1.3.04" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlgraphics:batik-codec:1.14" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:dynamic-datasource-spring-boot-starter:3.5.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: cn.dev33:sa-token-spring-boot-starter:1.29.0" level="project" />
-    <orderEntry type="library" name="Maven: cn.dev33:sa-token-servlet:1.29.0" level="project" />
-    <orderEntry type="library" name="Maven: cn.dev33:sa-token-dao-redis-jackson:1.29.0" level="project" />
-    <orderEntry type="library" name="Maven: cn.dev33:sa-token-core:1.29.0" level="project" />
-    <orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.10" level="project" />
-    <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.10" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: com.alibaba:fastjson:2.0.12" level="project" />
-    <orderEntry type="library" name="Maven: com.alibaba.fastjson2:fastjson2-extension:2.0.12" level="project" />
-    <orderEntry type="library" name="Maven: com.alibaba.fastjson2:fastjson2:2.0.12" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.21" level="project" />
-    <orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
-    <orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.0" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.1" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.1" level="project" />
-    <orderEntry type="library" name="Maven: com.ejlchina:okhttps:3.1.1" level="project" />
-    <orderEntry type="library" name="Maven: com.ejlchina:data-core:1.0.1" level="project" />
-    <orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.5" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.15.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.15.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.5.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.6.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.4.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.6.5" level="project" />
-    <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.7" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.3.4" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.3.4" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.3.4" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.3.4" level="project" />
-    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.3.4" level="project" />
-    <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.2" level="project" />
-    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.7" level="project" />
-    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.6" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.6.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.6.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.6.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: io.lettuce:lettuce-core:6.1.6.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-common:4.1.74.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.74.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.74.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.74.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.74.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-tcnative-classes:2.0.48.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.74.Final" level="project" />
-    <orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.15" level="project" />
-    <orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.1" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.1" level="project" />
-    <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.1" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.58" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.58" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.58" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-websocket:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-websocket:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.11.1" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.28" level="project" />
-    <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.22" level="project" />
-    <orderEntry type="library" name="Maven: junit:junit:4.13.2" level="project" />
-    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:2.2" level="project" />
-    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-mail:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.16" level="project" />
-    <orderEntry type="library" name="Maven: com.sun.mail:jakarta.mail:1.6.7" level="project" />
-    <orderEntry type="library" name="Maven: com.sun.activation:jakarta.activation:1.2.2" level="project" />
-    <orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.9.1" level="project" />
-    <orderEntry type="library" name="Maven: io.github.draco1023:poi-tl-ext:0.4.2" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.poi:ooxml-schemas:1.4" level="project" />
-    <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.0.1" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: net.sourceforge.cssparser:cssparser:0.9.29" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: org.w3c.css:sac:1.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: org.jsoup:jsoup:1.15.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: net.sf.saxon:Saxon-HE:11.4" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: org.xmlresolver:xmlresolver:4.4.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.httpcomponents.client5:httpclient5:5.1.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.httpcomponents.core5:httpcore5-h2:5.1.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.httpcomponents.core5:httpcore5:5.1.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: org.xmlresolver:xmlresolver:data:4.4.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: de.rototor.snuggletex:snuggletex-core:1.3.0" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: com.twelvemonkeys.imageio:imageio-batik:3.8.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: com.twelvemonkeys.imageio:imageio-core:3.8.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: com.twelvemonkeys.common:common-lang:3.8.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: com.twelvemonkeys.common:common-io:3.8.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: com.twelvemonkeys.common:common-image:3.8.3" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xmlgraphics:batik-rasterizer-ext:1.15" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xmlgraphics:batik-svgrasterizer:1.15" level="project" />
-    <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.xmlgraphics:batik-extension:1.15" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-amqp:2.6.4" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.amqp:spring-rabbit:2.4.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.amqp:spring-amqp:2.4.2" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.3.1" level="project" />
-    <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
-    <orderEntry type="library" name="Maven: com.rabbitmq:amqp-client:5.13.1" level="project" />
-  </component>
-</module>

+ 31 - 0
RMS/src/main/java/cn/cslg/report/common/model/dto/ConclusionDTO.java

@@ -0,0 +1,31 @@
+package cn.cslg.report.common.model.dto;
+
+import cn.cslg.report.entity.ReportFiles;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+@TableName(value = "REPORT")
+@Schema(description = "报告", required = true)
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder(toBuilder = true)
+public class ConclusionDTO {
+   private Integer reportId;
+    /**
+     * 核心结论
+     */
+    @Schema(description = "核心结论")
+    private String cronConclusion;
+
+    private List<Integer> conclusionIds;
+}

+ 39 - 0
RMS/src/main/java/cn/cslg/report/common/model/vo/VisualReportVO.java

@@ -0,0 +1,39 @@
+package cn.cslg.report.common.model.vo;
+
+
+import cn.cslg.report.common.model.BaseVO;
+import cn.cslg.report.common.model.dto.ReportDTO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author lrj
+ * @date 2022-11-9
+ * @description 任务VO类
+ */
+@Data
+@Accessors(chain = true)
+@Schema(description="任务VO",required = true)
+public class VisualReportVO extends BaseVO {
+    @Schema(description = "报告类型")
+    private String reportType;
+    @Schema(description = "报告类型值")
+    private String typeValue;
+    @Schema(description = "报告数量")
+    private Integer reportNum;
+
+    private List<Conclusions> conclusions;
+    @Data
+    public static class Conclusions{
+        @Schema(description = "状态名称")
+            private String name;
+        @Schema(description = "状态名称")
+        private String value;
+        @Schema(description = "状态数量")
+        private Integer num;
+    }
+}

+ 3 - 0
RMS/src/main/java/cn/cslg/report/common/utils/StringUtils.java

@@ -240,6 +240,9 @@ public class StringUtils {
     public static List<String> changeStringToString(String str, String code) {
         String[] split = split(str, code);
         List<String> lnums = new ArrayList<>();
+        if(split==null){
+            return lnums;
+        }
         for (String s : split) {
             //long lnum = getLong(s, 0l);
             lnums.add(s);

+ 24 - 0
RMS/src/main/java/cn/cslg/report/controller/ReportController.java

@@ -1,6 +1,7 @@
 package cn.cslg.report.controller;
 
 import cn.cslg.report.common.core.base.Constants;
+import cn.cslg.report.common.model.dto.ConclusionDTO;
 import cn.cslg.report.common.model.dto.ReportDTO;
 import cn.cslg.report.common.model.vo.FileVO;
 import cn.cslg.report.common.model.vo.ReportVO;
@@ -120,4 +121,27 @@ public class ReportController {
         return Response.success();
     }
 
+    @PostMapping (value = "reportVisual")
+    @Operation(summary = "报告可视化")
+    @Transactional(rollbackFor = Exception.class)
+    public String reportVisual(@RequestBody ReportVO reportVO) throws IOException {
+        return Response.success( reportService.reportVisual(reportVO));
+    }
+
+    @GetMapping (value = "getPermession")
+    @Operation(summary = "获得报告权限")
+    @Transactional(rollbackFor = Exception.class)
+    public String  getPermession() throws IOException {
+        return Response.success( reportService.getPermession());
+    }
+    @PostMapping (value = "addConclusions")
+    @Operation(summary = "添加核心结论")
+    @Transactional(rollbackFor = Exception.class)
+    public String  addConclusions(@RequestBody ConclusionDTO conclusionDTO) throws IOException {
+        Boolean flag =reportService.addConclusions(conclusionDTO);
+        if(flag){return Response.success("添加成功" );}
+        return Response.error("添加失败");
+    }
+
+
 }

+ 4 - 1
RMS/src/main/java/cn/cslg/report/entity/SysDictItem.java

@@ -25,6 +25,9 @@ public class SysDictItem extends BaseEntity<SysDictItem> {
   private String dictChildLabel;
   @TableField(value = "DICT_CHILD_VALUE")
   private String dictChildValue;
-
+  @TableField(value = "GROUP_ID")
+  private String groupId;
+  @TableField(value = "PARENT_ID")
+  private String parentId;
 
 }

+ 194 - 15
RMS/src/main/java/cn/cslg/report/service/business/ReportService.java

@@ -1,11 +1,9 @@
 package cn.cslg.report.service.business;
 
 import cn.cslg.report.common.core.base.Constants;
+import cn.cslg.report.common.model.dto.ConclusionDTO;
 import cn.cslg.report.common.model.dto.ReportDTO;
-import cn.cslg.report.common.model.vo.ClientVO;
-import cn.cslg.report.common.model.vo.PersonnelVO;
-import cn.cslg.report.common.model.vo.ReportVO;
-import cn.cslg.report.common.model.vo.SystemDictVO;
+import cn.cslg.report.common.model.vo.*;
 import cn.cslg.report.common.utils.*;
 import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
 import cn.cslg.report.common.utils.SecurityUtils.SecurityUtils;
@@ -24,6 +22,7 @@ import com.alibaba.fastjson.JSONArray;
 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.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import io.swagger.v3.oas.annotations.Operation;
@@ -37,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.awt.geom.IllegalPathStateException;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -70,6 +70,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
     private final CopyService copyService;
     private final SystemDictItemService systemDictItemService;
     private final AssoReportPersonService assoReportPersonService;
+
     private Report loadReport(ReportDTO reportDto) {
         Report report = new Report();
         //装载基本信息
@@ -104,7 +105,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
         report.setCronConclusion(reportDto.getCronConclusion());
         //装载核心结论
         if (reportDto.getConclusionIds() != null) {
-            report.setScenarioId(StringUtils.join(reportDto.getConclusionIds(), ","));
+            report.setConclusionId(StringUtils.join(reportDto.getConclusionIds(), "/"));
         }
         //装载承担部门
         report.setDepartmentId(reportDto.getDepartmentId());
@@ -205,7 +206,8 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
         //分页
         if (reportVO.getSize() != null && reportVO.getCurrent() != null) {
             SecurityUtils.startDataScope("/pcs/report/query");
-            List<Report> reports = this.page(new Page<>(reportVO.getCurrent(), reportVO.getSize()), queryWrapper).getRecords();
+            IPage<Report> records = this.page(new Page<>(reportVO.getCurrent(), reportVO.getSize()), queryWrapper);
+            List<Report> reports = records.getRecords();
             reports = this.reportData(reports);
             SecurityUtils.startDataScope("/pcs/report/query");
             Long count = this.count(queryWrapper);
@@ -228,12 +230,12 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
      */
     public List<Report> reportData(List<Report> reports) throws IOException {
         PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
-          //根据登录人id获得登录人被分享的报告id
-        LambdaQueryWrapper<AssoReportPerson> wrapper =new LambdaQueryWrapper<>();
+        //根据登录人id获得登录人被分享的报告id
+        LambdaQueryWrapper<AssoReportPerson> wrapper = new LambdaQueryWrapper<>();
         wrapper.select(AssoReportPerson::getReportId);
-        wrapper.eq(AssoReportPerson::getPersonId,personnelVO.getId());
-        Function<Object,Integer> f = (o -> Integer.parseInt(o.toString())) ;
-        List<Integer> shareIds =assoReportPersonService.listObjs(wrapper,f);
+        wrapper.eq(AssoReportPerson::getPersonId, personnelVO.getId());
+        Function<Object, Integer> f = (o -> Integer.parseInt(o.toString()));
+        List<Integer> shareIds = assoReportPersonService.listObjs(wrapper, f);
 
         //提出报告Id
         List<Integer> reportIds = reports.stream().map(Report::getId).collect(Collectors.toList());
@@ -279,14 +281,14 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
         //过滤报告
         for (Report item : reports) {
             //装载登录人在报告中的角色
-            List<Integer> roles =new ArrayList<>();
-            if(item.getCreatePersonId().equals(personnelVO.getId())){
+            List<Integer> roles = new ArrayList<>();
+            if (item.getCreatePersonId().equals(personnelVO.getId())) {
                 roles.add(0);
             }
-            if(item.getPersonId()!=null&&item.getPersonId().equals(personnelVO.getId())){
+            if (item.getPersonId() != null && item.getPersonId().equals(personnelVO.getId())) {
                 roles.add(1);
             }
-            if(shareIds.contains(item.getId())){
+            if (shareIds.contains(item.getId())) {
                 roles.add(2);
             }
             item.setLoginRole(roles);
@@ -354,6 +356,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
     @Transactional(rollbackFor = Exception.class)
     public Boolean updateReport(ReportDTO reportDto, List<MultipartFile> files) throws IOException {
         Report report = this.loadReport(reportDto);
+        report.setId(reportDto.getId());
         // 根据报告Id查询对应的附件Id
         LambdaQueryWrapper<AssoReportFile> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(AssoReportFile::getReportId, reportDto.getId());
@@ -460,5 +463,181 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
 
     }
 
+    @Transactional
+    public List<VisualReportVO> reportVisual(ReportVO reportVO) throws IOException {
+        Integer id = loginUtils.getId();
+        LambdaQueryWrapper<Report> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.ne(Report::getId, 0);
+        if (reportVO.getName() != null) {
+            queryWrapper.like(Report::getName, reportVO.getName());
+        }
+        if (reportVO.getReportId() != null) {
+            queryWrapper.eq(Report::getId, reportVO.getReportId());
+        }
+        if (reportVO.getSignPatentNo() != null && reportVO.getSignPatentNo() != "") {
+            queryWrapper.like(Report::getSignPatentNo, reportVO.getSignPatentNo());
+        }
+        if (reportVO.getTypes() != null && reportVO.getTypes().size() > 0) {
+            queryWrapper.in(Report::getType, reportVO.getTypes());
+        }
+        if (reportVO.getCronIds() != null && reportVO.getCronIds().size() > 0) {
+            StringBuilder strs = new StringBuilder();
+            for (int i = 0; i < reportVO.getCronIds().size(); i++) {
+                Integer item = reportVO.getCronIds().get(i);
+                if (i == 0) {
+                    strs.append("(FIND_IN_SET(" + item + ",REPLACE(CONCLUSION_ID, '/', ','))");
+                } else {
+                    strs.append("or FIND_IN_SET(" + item + ",REPLACE(CONCLUSION_ID, '/', ','))");
+                }
+            }
+            strs.append(")");
+            queryWrapper.apply(strs.toString());
+        }
+        SecurityUtils.startDataScope("/pcs/report/query");
+        List<Report> reports = this.list(queryWrapper);
+        List<Map<String, Object>> map = new ArrayList<>();
+        List<VisualReportVO> reportVOS = this.loadVisualReport();
+        for (Report report : reports) {
+            VisualReportVO reportDTO = reportVOS.stream().filter(item -> item.getTypeValue().equals(report.getType() + "")).findFirst().orElse(null);
+            if (reportDTO != null) {
+                reportDTO.setReportNum(reportDTO.getReportNum() + 1);
+                //获得核心结论值
+                if (report.getConclusionId() == null) {
+                    report.setConclusionId("");
+                }
+                List<String> ids = StringUtils.changeStringToString(report.getConclusionId(), "/");
+                List<VisualReportVO.Conclusions> conclusions = reportDTO.getConclusions().stream().filter(item -> ids.contains(item.getValue())).collect(Collectors.toList());
+                conclusions.forEach(item -> {
+                    item.setNum(item.getNum() + 1);
+                });
+                //获得未完成的结论
+                VisualReportVO.Conclusions noComplate = reportDTO.getConclusions().stream().filter(item -> item.getValue().equals("-1")).findFirst().orElse(null);
+                if (noComplate != null) {
+                    List<Integer> status = new ArrayList<>(Arrays.asList(0, 1, 2));
+                    if (status.contains(report.getStatus())) {
+                        noComplate.setNum(noComplate.getNum() + 1);
+                    }
+                }
+
+            }
+        }
+        return reportVOS;
+    }
+
+    private List<VisualReportVO> loadVisualReport() {
+        List<VisualReportVO> reportVOS = new ArrayList<>();
+        //获得所有报告的分类
+        LambdaQueryWrapper<SysDictItem> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(SysDictItem::getDictParentKey, "REPORT_TYPE");
+        List<SysDictItem> reportTypes = systemDictItemService.list(wrapper);
+        //获得所有报告的核心结论
+        List<Integer> ids = reportTypes.stream().map(SysDictItem::getId).collect(Collectors.toList());
+        List<SysDictItem> conclusions = new ArrayList<>();
+        if (ids.size() != 0) {
+            LambdaQueryWrapper<SysDictItem> wrapper1 = new LambdaQueryWrapper<>();
+            wrapper1.in(SysDictItem::getParentId, ids)
+                    .eq(SysDictItem::getGroupId, 1);
+            conclusions = systemDictItemService.list(wrapper1);
+        }
+        for (SysDictItem item : reportTypes) {
+            VisualReportVO reportVO = new VisualReportVO();
+            reportVO.setReportType(item.getDictChildLabel());
+            reportVO.setTypeValue(item.getDictChildValue());
+            reportVO.setReportNum(0);
+            //获得不同报告类别的核心结论字典
+            List<SysDictItem> sysDictItems = conclusions.stream().filter(tem -> tem.getParentId().equals(item.getId() + "")).collect(Collectors.toList());
+            List<VisualReportVO.Conclusions> conclusions1 = new ArrayList<>();
+            VisualReportVO.Conclusions noComplate = new VisualReportVO.Conclusions();
+            noComplate.setName("未完成");
+            noComplate.setValue("-1");
+            noComplate.setNum(0);
+            conclusions1.add(noComplate);
+            sysDictItems.forEach(
+                    tem -> {
+                        VisualReportVO.Conclusions conclusion = new VisualReportVO.Conclusions();
+                        conclusion.setName(tem.getDictChildLabel());
+                        conclusion.setValue(tem.getDictChildValue());
+                        conclusion.setNum(0);
+                        conclusions1.add(conclusion);
+                    }
+            );
+            reportVO.setConclusions(conclusions1);
+            reportVOS.add(reportVO);
+        }
+        return reportVOS;
+    }
+
+
+    public Map<Integer, List<Integer>> getPermession() {
+        Map<Integer, List<Integer>> map = new HashMap<>();
+        Integer id = loginUtils.getId();
+        //查询登录人创建的报告
+        LambdaQueryWrapper<Report> createWrapper = new LambdaQueryWrapper<>();
+        createWrapper.select(Report::getId);
+        createWrapper.eq(Report::getCreatePersonId, id);
+        List<Report> creates = this.list(createWrapper);
+        creates.forEach(
+                item -> {
+                    if (map.get(item.getId()) == null) {
+                        List<Integer> roles = new ArrayList<>(0);
+                        map.put(item.getId(), roles);
+                    } else {
+                        List<Integer> roles = map.get(item.getId());
+                        if (!roles.contains(0)) {
+                            roles.add(0);
+                            map.put(item.getId(), roles);
+                        }
+                    }
+                }
+        );
+        //查询登录人负责的报告
+        LambdaQueryWrapper<Report> dutyWrapper = new LambdaQueryWrapper<>();
+        dutyWrapper.select(Report::getId);
+        dutyWrapper.eq(Report::getPersonId, id);
+        List<Report> dutys = this.list(dutyWrapper);
+        dutys.forEach(
+                item -> {
+                    if (map.get(item.getId()) == null) {
+                        List<Integer> roles = new ArrayList<>(1);
+                        map.put(item.getId(), roles);
+                    } else {
+                        List<Integer> roles = map.get(item.getId());
+                        if (!roles.contains(1)) {
+                            roles.add(1);
+                            map.put(item.getId(), roles);
+                        }
+                    }
+                }
+        );
+        //查询登录人被分享的报告
+        LambdaQueryWrapper<AssoReportPerson> shareWrapper = new LambdaQueryWrapper<>();
+        shareWrapper.select(AssoReportPerson::getReportId);
+        shareWrapper.eq(AssoReportPerson::getPersonId, id);
+        List<AssoReportPerson> shares = assoReportPersonService.list(shareWrapper);
+        shares.forEach(
+                item -> {
+                    if (map.get(item.getReportId()) == null) {
+                        List<Integer> roles = new ArrayList<>(2);
+                        map.put(item.getId(), roles);
+                    } else {
+                        List<Integer> roles = map.get(item.getReportId());
+                        if (!roles.contains(2)) {
+                            roles.add(2);
+                            map.put(item.getId(), roles);
+                        }
+                    }
+                }
+        );
+        return map;
+    }
+
+    public Boolean addConclusions(ConclusionDTO conclusionDTO) {
+        Report report = this.getById(conclusionDTO.getReportId());
+        report.setCronConclusion(conclusionDTO.getCronConclusion());
+        if (report.getConclusionIds() != null) {
+            report.setConclusionId(StringUtils.join(conclusionDTO.getConclusionIds(), ","));
+        }
+        return report.updateById();
 
+    }
 }