cxd 4 сар өмнө
parent
commit
9f3c2b05ca

+ 7 - 6
gqy-admin/src/main/resources/application-druid.yml

@@ -6,17 +6,18 @@ spring:
         druid:
             # 主库数据源
             master:
-#                url: jdbc:mysql://120.46.190.49:3306/rouyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                #url: jdbc:mysql://60.204.236.53:3306/gqynew?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                #username: root
-                #password: TZPpsyFWLSMTzzFE
-                #password: Gd8XCWEef72GerxE
+##                url: jdbc:mysql://120.46.190.49:3306/rouyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+#                url: jdbc:mysql://60.204.236.53:3306/gqynew?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+#                username: root
+#                password: TZPpsyFWLSMTzzFE
+#                password: Gd8XCWEef72GerxE
 
                 url: jdbc:mysql://localhost:3306/rouyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
                 password: root
 
-            # 从库数据源
+
+            # 从库数据源  600315
             slave:
                 # 从数据源开关/默认关闭
                 enabled: false

+ 13 - 2
gqy-admin/src/main/resources/application.yml

@@ -64,7 +64,7 @@ spring:
   devtools:
     restart:
       # 热部署开关
-      enabled: true
+      enabled: false
   # redis 配置
   redis:
     # 地址
@@ -75,7 +75,7 @@ spring:
     # 数据库索引
     database: 13
     # 密码
-    #password: Iayq@742295
+   # password: Iayq@742295
     # 连接超时时间
     timeout: 10s
     lettuce:
@@ -89,6 +89,17 @@ spring:
         # #连接池最大阻塞等待时间(使用负值表示没有限制)
         max-wait: -1ms
 
+
+  mvc:
+    static-path-pattern: /**
+
+  web:
+    resources:
+      static-locations:
+        - file:${user.dir}/static/
+        - classpath:/static/
+
+
 # token配置
 token:
   # 令牌自定义标识

+ 35 - 0
gqy-common/pom.xml

@@ -127,6 +127,41 @@
             <artifactId>javax.servlet-api</artifactId>
         </dependency>
 
+
+        <dependency>
+            <groupId>org.deeplearning4j</groupId>
+            <artifactId>deeplearning4j-core</artifactId>
+            <version>1.0.0-beta7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.nd4j</groupId>
+            <artifactId>nd4j-native-platform</artifactId>
+            <version>1.0.0-beta7</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.deeplearning4j</groupId>
+            <artifactId>deeplearning4j-nlp</artifactId>
+            <version>1.0.0-beta7</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.hankcs</groupId>
+            <artifactId>hanlp</artifactId>
+            <version>portable-1.8.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.7.36</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>1.2.11</version>
+        </dependency>
+
     </dependencies>
 
 </project>

+ 35 - 0
gqy-common/src/main/java/com/gqy/common/config/LinksDeserializer.java

@@ -0,0 +1,35 @@
+package com.gqy.common.config;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 序列化代码
+ */
+public class LinksDeserializer extends JsonDeserializer<List<String>> {
+    @Override
+    public List<String> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
+        JsonNode node = p.getCodec().readTree(p);
+
+        // 处理字符串形式的空数组 ("[]")
+        if (node.isTextual() && "[]".equals(node.asText())) {
+            return new ArrayList<>();
+        }
+
+        // 处理正常的 JSON 数组
+        if (node.isArray()) {
+            List<String> result = new ArrayList<>();
+            node.forEach(element -> result.add(element.asText()));
+            return result;
+        }
+
+        // 其他情况返回空列表
+        return new ArrayList<>();
+    }
+}

+ 4 - 0
gqy-common/src/main/java/com/gqy/common/constant/Constants.java

@@ -1,6 +1,9 @@
 package com.gqy.common.constant;
 
+import java.util.HashMap;
 import java.util.Locale;
+import java.util.Map;
+
 import io.jsonwebtoken.Claims;
 
 /**
@@ -188,4 +191,5 @@ public class Constants
     public static int status_4=4;
 
 
+
 }

+ 5 - 2
gqy-common/src/main/java/com/gqy/common/utils/hanlp/Word2VecWordSimilarity.java

@@ -253,6 +253,7 @@ public class Word2VecWordSimilarity {
         return Math.pow(ratio, 0.5);  // 使用平方根来减轻惩罚程度
     }
 
+
     /**
      * 判断两个词是否相似
      */
@@ -533,12 +534,14 @@ public class Word2VecWordSimilarity {
         return false;
     }
 
+
+
     // 使用示例
     public static void main(String[] args) {
         try {
             // 计算相似度
-            String word1 = "你穿的是什么颜色的衣服?";
-            String word2 = "我穿的是卫衣";
+            String word1 = "你要选择什么产品?";
+            String word2 = "产品名称";
           //  double similarity = calculateSimilarity(word1, word2);
             //System.out.println("相似度: " + similarity);
 

+ 38 - 0
gqy-framework/src/main/java/com/gqy/framework/config/StaticResourceConfig.java

@@ -0,0 +1,38 @@
+package com.gqy.framework.config;
+
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.ResourceLoader;
+
+import java.io.File;
+
+@Configuration
+public class StaticResourceConfig {
+
+    @Bean
+    public CommandLineRunner initStaticDirectories(ResourceLoader resourceLoader) {
+        return args -> {
+            try {
+                // 获取项目根目录
+                String projectRoot = System.getProperty("user.dir");
+                
+                // 创建静态资源目录
+                File staticDir = new File(projectRoot + "/static");
+                if (!staticDir.exists()) {
+                    staticDir.mkdirs();
+                }
+                
+                // 创建水印图片目录
+                File watermarkDir = new File(staticDir, "watermark");
+                if (!watermarkDir.exists()) {
+                    watermarkDir.mkdirs();
+                }
+                
+                System.out.println("静态资源目录创建成功:" + watermarkDir.getAbsolutePath());
+            } catch (Exception e) {
+                System.err.println("创建静态资源目录失败:" + e.getMessage());
+            }
+        };
+    }
+} 

+ 199 - 0
gqy-system/src/main/java/com/gqy/document/domain/DcDesign.java

@@ -0,0 +1,199 @@
+package com.gqy.document.domain;
+
+public class DcDesign {
+
+    /**
+     * 设计表id
+     */
+    private String deId;
+
+    /**
+     * 系统识别码/系统id
+     */
+    private String deSysId;
+
+    /**
+     * 产品识别码/产品id
+     */
+    private String dePId;
+
+    /**
+     * 问题编号
+     */
+    private String deQaNo;
+
+    /**
+     * 问答版本条件
+     */
+    private String deQaTj;
+
+    /**
+     * 问答返回位置
+     */
+    private String deQaFn;
+
+    /**
+     * 问题内容
+     */
+    private String deQaQNr;
+
+    /**
+     * 问题结果类型
+     */
+    private String deQaAType;
+
+    /**
+     * 问题结果表名/结果名
+     */
+    private String deQaABl;
+
+    /**
+     * 问题结果表类型
+     */
+    private String deQaABltb;
+
+    /**
+     * 问题结果表类型说明
+     */
+    private String deQaABlsm;
+
+    /**
+     * 问题结果值(默认值)
+     */
+    private String deQaABlz;
+
+    /**
+     * 合法性要求(约束条件)
+     */
+    private String deQaHf;
+
+    /**
+     * 操作(选择分支、计算、筛选函数)
+     */
+    private String deQaCz;
+
+    /**
+     * 前置条件
+     */
+    private String dePre;
+
+    public String getDeId() {
+        return deId;
+    }
+
+    public void setDeId(String deId) {
+        this.deId = deId;
+    }
+
+    public String getDeSysId() {
+        return deSysId;
+    }
+
+    public void setDeSysId(String deSysId) {
+        this.deSysId = deSysId;
+    }
+
+    public String getDePId() {
+        return dePId;
+    }
+
+    public void setDePId(String dePId) {
+        this.dePId = dePId;
+    }
+
+    public String getDeQaNo() {
+        return deQaNo;
+    }
+
+    public void setDeQaNo(String deQaNo) {
+        this.deQaNo = deQaNo;
+    }
+
+    public String getDeQaTj() {
+        return deQaTj;
+    }
+
+    public void setDeQaTj(String deQaTj) {
+        this.deQaTj = deQaTj;
+    }
+
+    public String getDeQaFn() {
+        return deQaFn;
+    }
+
+    public void setDeQaFn(String deQaFn) {
+        this.deQaFn = deQaFn;
+    }
+
+    public String getDeQaQNr() {
+        return deQaQNr;
+    }
+
+    public void setDeQaQNr(String deQaQNr) {
+        this.deQaQNr = deQaQNr;
+    }
+
+    public String getDeQaAType() {
+        return deQaAType;
+    }
+
+    public void setDeQaAType(String deQaAType) {
+        this.deQaAType = deQaAType;
+    }
+
+    public String getDeQaABl() {
+        return deQaABl;
+    }
+
+    public void setDeQaABl(String deQaABl) {
+        this.deQaABl = deQaABl;
+    }
+
+    public String getDeQaABltb() {
+        return deQaABltb;
+    }
+
+    public void setDeQaABltb(String deQaABltb) {
+        this.deQaABltb = deQaABltb;
+    }
+
+    public String getDeQaABlsm() {
+        return deQaABlsm;
+    }
+
+    public void setDeQaABlsm(String deQaABlsm) {
+        this.deQaABlsm = deQaABlsm;
+    }
+
+    public String getDeQaABlz() {
+        return deQaABlz;
+    }
+
+    public void setDeQaABlz(String deQaABlz) {
+        this.deQaABlz = deQaABlz;
+    }
+
+    public String getDeQaHf() {
+        return deQaHf;
+    }
+
+    public void setDeQaHf(String deQaHf) {
+        this.deQaHf = deQaHf;
+    }
+
+    public String getDeQaCz() {
+        return deQaCz;
+    }
+
+    public void setDeQaCz(String deQaCz) {
+        this.deQaCz = deQaCz;
+    }
+
+    public String getDePre() {
+        return dePre;
+    }
+
+    public void setDePre(String dePre) {
+        this.dePre = dePre;
+    }
+}

+ 8 - 0
gqy-system/src/main/java/com/gqy/document/mapper/DcDesignMapper.java

@@ -0,0 +1,8 @@
+package com.gqy.document.mapper;
+
+import com.gqy.document.domain.DcDesign;
+
+public interface DcDesignMapper {
+
+    public int insertDcDesign(DcDesign dcDesign);
+}

+ 34 - 0
gqy-system/src/main/java/com/gqy/document/service/impl/IDcDesigerServiceImpl.java

@@ -0,0 +1,34 @@
+package com.gqy.document.service.impl;
+
+import com.gqy.document.domain.DcDesign;
+import com.gqy.document.mapper.DcDesignMapper;
+import com.gqy.document.service.IDcDesigerService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+/**
+ * @author gqy
+ *
+ * 添加设计
+ */
+@Service
+public class IDcDesigerServiceImpl implements IDcDesigerService {
+
+    @Autowired
+    private DcDesignMapper dcDesignMapper;
+
+    /**
+     *
+     * @param map
+     */
+    public void add(Map map) {
+        DcDesign  dcDesign = new DcDesign();
+        dcDesign.setDeSysId(map.get("deSysId").toString());
+        dcDesign.setDePId(map.get("dePId").toString());
+        dcDesign.setDeQaNo(map.get("deQaNo").toString());
+        dcDesign.setDeQaTj(map.get("deQaTj").toString());
+        dcDesignMapper.insertDcDesign(dcDesign);
+    }
+}

+ 128 - 0
gqy-system/src/main/resources/mapper/document/DcDesignMapper.xml

@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.gqy.document.mapper.DcDesignMapper">
+
+    <resultMap type="DcDesign" id="DcDesignResult">
+        <id     property="deId"       column="de_id"        />
+        <result property="deSysId"    column="de_sys_id"    />
+        <result property="dePId"      column="de_p_id"      />
+        <result property="deQaNo"     column="de_qa_no"     />
+        <result property="deQaTj"     column="de_qa_tj"     />
+        <result property="deQaFn"     column="de_qa_fn"     />
+        <result property="deQaQNr"    column="de_qa_q_nr"   />
+        <result property="deQaAType"  column="de_qa_a_type" />
+        <result property="deQaABl"    column="de_qa_a_bl"   />
+        <result property="deQaABltb"  column="de_qa_a_bltb" />
+        <result property="deQaABlsm"  column="de_qa_a_blsm" />
+        <result property="deQaABlz"   column="de_qa_a_blz"  />
+        <result property="deQaHf"     column="de_qa_hf"     />
+        <result property="deQaCz"     column="de_qa_cz"     />
+        <result property="dePre"      column="de_pre"       />
+    </resultMap>
+
+    <sql id="selectDcDesignVo">
+        select de_id, de_sys_id, de_p_id, de_qa_no, de_qa_tj, de_qa_fn, de_qa_q_nr,
+               de_qa_a_type, de_qa_a_bl, de_qa_a_bltb, de_qa_a_blsm, de_qa_a_blz, de_qa_hf,
+               de_qa_cz, de_pre
+        from dc_design
+    </sql>
+
+    <select id="selectDcDesignById" parameterType="String" resultMap="DcDesignResult">
+        <include refid="selectDcDesignVo"/>
+        where de_id = #{deId}
+    </select>
+
+    <select id="selectDcDesignList" parameterType="DcDesign" resultMap="DcDesignResult">
+        <include refid="selectDcDesignVo"/>
+        <where>
+            <if test="deSysId != null and deSysId != ''">
+                AND de_sys_id = #{deSysId}
+            </if>
+            <if test="dePId != null and dePId != ''">
+                AND de_p_id = #{dePId}
+            </if>
+            <if test="deQaNo != null and deQaNo != ''">
+                AND de_qa_no = #{deQaNo}
+            </if>
+            <if test="deQaAType != null and deQaAType != ''">
+                AND de_qa_a_type = #{deQaAType}
+            </if>
+            <if test="dePre != null and dePre != ''">
+                AND de_pre = #{dePre}
+            </if>
+        </where>
+    </select>
+
+    <insert id="insertDcDesign" parameterType="DcDesign">
+        insert into dc_design
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="deId != null">de_id,</if>
+            <if test="deSysId != null">de_sys_id,</if>
+            <if test="dePId != null">de_p_id,</if>
+            <if test="deQaNo != null">de_qa_no,</if>
+            <if test="deQaTj != null">de_qa_tj,</if>
+            <if test="deQaFn != null">de_qa_fn,</if>
+            <if test="deQaQNr != null">de_qa_q_nr,</if>
+            <if test="deQaAType != null">de_qa_a_type,</if>
+            <if test="deQaABl != null">de_qa_a_bl,</if>
+            <if test="deQaABltb != null">de_qa_a_bltb,</if>
+            <if test="deQaABlsm != null">de_qa_a_blsm,</if>
+            <if test="deQaABlz != null">de_qa_a_blz,</if>
+            <if test="deQaHf != null">de_qa_hf,</if>
+            <if test="deQaCz != null">de_qa_cz,</if>
+            <if test="dePre != null">de_pre,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="deId != null">#{deId},</if>
+            <if test="deSysId != null">#{deSysId},</if>
+            <if test="dePId != null">#{dePId},</if>
+            <if test="deQaNo != null">#{deQaNo},</if>
+            <if test="deQaTj != null">#{deQaTj},</if>
+            <if test="deQaFn != null">#{deQaFn},</if>
+            <if test="deQaQNr != null">#{deQaQNr},</if>
+            <if test="deQaAType != null">#{deQaAType},</if>
+            <if test="deQaABl != null">#{deQaABl},</if>
+            <if test="deQaABltb != null">#{deQaABltb},</if>
+            <if test="deQaABlsm != null">#{deQaABlsm},</if>
+            <if test="deQaABlz != null">#{deQaABlz},</if>
+            <if test="deQaHf != null">#{deQaHf},</if>
+            <if test="deQaCz != null">#{deQaCz},</if>
+            <if test="dePre != null">#{dePre},</if>
+        </trim>
+    </insert>
+
+    <update id="updateDcDesign" parameterType="DcDesign">
+        update dc_design
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deSysId != null">de_sys_id = #{deSysId},</if>
+            <if test="dePId != null">de_p_id = #{dePId},</if>
+            <if test="deQaNo != null">de_qa_no = #{deQaNo},</if>
+            <if test="deQaTj != null">de_qa_tj = #{deQaTj},</if>
+            <if test="deQaFn != null">de_qa_fn = #{deQaFn},</if>
+            <if test="deQaQNr != null">de_qa_q_nr = #{deQaQNr},</if>
+            <if test="deQaAType != null">de_qa_a_type = #{deQaAType},</if>
+            <if test="deQaABl != null">de_qa_a_bl = #{deQaABl},</if>
+            <if test="deQaABltb != null">de_qa_a_bltb = #{deQaABltb},</if>
+            <if test="deQaABlsm != null">de_qa_a_blsm = #{deQaABlsm},</if>
+            <if test="deQaABlz != null">de_qa_a_blz = #{deQaABlz},</if>
+            <if test="deQaHf != null">de_qa_hf = #{deQaHf},</if>
+            <if test="deQaCz != null">de_qa_cz = #{deQaCz},</if>
+            <if test="dePre != null">de_pre = #{dePre},</if>
+        </trim>
+        where de_id = #{deId}
+    </update>
+
+    <delete id="deleteDcDesignById" parameterType="String">
+        delete from dc_design where de_id = #{deId}
+    </delete>
+
+    <delete id="deleteDcDesignByIds" parameterType="String">
+        delete from dc_design where de_id in
+        <foreach item="deId" collection="array" open="(" separator="," close=")">
+            #{deId}
+        </foreach>
+    </delete>
+
+</mapper>

+ 4 - 3
pom.xml

@@ -3,13 +3,13 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
-	
+
     <groupId>com.gqy</groupId>
     <artifactId>gqy</artifactId>
     <version>3.8.8</version>
 
     <description>旷视可以GQY系统</description>
-    
+
     <properties>
         <gqy.version>3.8.8</gqy.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -180,6 +180,7 @@
                 <version>${gqy.version}</version>
             </dependency>
 
+
         </dependencies>
     </dependencyManagement>
 
@@ -233,4 +234,4 @@
         </pluginRepository>
     </pluginRepositories>
 
-</project>
+</project>