Browse Source

新增生成数据库字典依赖、修复检索无效的问题

LiuChangLan 4 years ago
parent
commit
9f7b6d39b7

+ 54 - 0
pom.xml

@@ -157,7 +157,61 @@
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
             </plugin>
+
+<!--            <plugin>-->
+<!--                <groupId>cn.smallbun.screw</groupId>-->
+<!--                <artifactId>screw-maven-plugin</artifactId>-->
+<!--                <version>1.0.3</version>-->
+<!--                <dependencies>-->
+<!--                    &lt;!&ndash; HikariCP &ndash;&gt;-->
+<!--                    <dependency>-->
+<!--                        <groupId>com.zaxxer</groupId>-->
+<!--                        <artifactId>HikariCP</artifactId>-->
+<!--                        <version>3.4.5</version>-->
+<!--                    </dependency>-->
+<!--                    &lt;!&ndash;mysql driver&ndash;&gt;-->
+<!--                    <dependency>-->
+<!--                        <groupId>mysql</groupId>-->
+<!--                        <artifactId>mysql-connector-java</artifactId>-->
+<!--                        <version>8.0.20</version>-->
+<!--                    </dependency>-->
+<!--                </dependencies>-->
+<!--                <configuration>-->
+<!--                    &lt;!&ndash;username&ndash;&gt;-->
+<!--                    <username>root</username>-->
+<!--                    &lt;!&ndash;password&ndash;&gt;-->
+<!--                    <password>abcd123456!@#</password>-->
+<!--                    &lt;!&ndash;driver&ndash;&gt;-->
+<!--                    <driverClassName>com.mysql.cj.jdbc.Driver</driverClassName>-->
+<!--                    &lt;!&ndash;jdbc url&ndash;&gt;-->
+<!--                    <jdbcUrl><![CDATA[jdbc:mysql://115.159.38.225:3306/guihua_archives?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8]]></jdbcUrl>-->
+<!--                    &lt;!&ndash;生成文件类型&ndash;&gt;-->
+<!--                    <fileType>WORD</fileType>-->
+<!--                    &lt;!&ndash;打开文件输出目录&ndash;&gt;-->
+<!--                    <openOutputDir>false</openOutputDir>-->
+<!--                    &lt;!&ndash;生成模板&ndash;&gt;-->
+<!--                    <produceType>freemarker</produceType>-->
+<!--                    &lt;!&ndash;文档名称 为空时:将采用[数据库名称-描述-版本号]作为文档名称&ndash;&gt;-->
+<!--&lt;!&ndash;                    <fileName>111</fileName>&ndash;&gt;-->
+<!--                    &lt;!&ndash;描述&ndash;&gt;-->
+<!--                    <description>数据库文档生成</description>-->
+<!--                    &lt;!&ndash;版本&ndash;&gt;-->
+<!--                    <version>${project.version}</version>-->
+<!--                    &lt;!&ndash;标题&ndash;&gt;-->
+<!--                    <title>数据库文档</title>-->
+<!--                </configuration>-->
+<!--                <executions>-->
+<!--                    <execution>-->
+<!--                        <phase>compile</phase>-->
+<!--                        <goals>-->
+<!--                            <goal>run</goal>-->
+<!--                        </goals>-->
+<!--                    </execution>-->
+<!--                </executions>-->
+<!--            </plugin>-->
         </plugins>
     </build>
 
+
+
 </project>

+ 3 - 1
src/main/java/com/gz/service/archive/impl/ArchiveServiceImpl.java

@@ -117,6 +117,7 @@ public class ArchiveServiceImpl implements ArchiveService {
     public PageInfo<ArchiveRVO> selectByPage(SearchArchiveVO vo) {
         PageInfo<ArchiveRVO> result = new PageInfo<>();
         if (StrUtil.isNotEmpty(vo.getAllDocument()) && "on".equals(vo.getAllDocument())) {
+            // 全文检索
             ClientInterface restClient = ElasticSearchHelper.getConfigRestClientUtil("elasticsearch/archive.xml");
             ESDatas<ArchiveRVO> mapESDatas = restClient.searchList("/hp_es/_doc/_search", "query", vo, ArchiveRVO.class);
             result = new PageInfo<>(mapESDatas.getDatas());
@@ -141,7 +142,7 @@ public class ArchiveServiceImpl implements ArchiveService {
                     } else {
                         sql += params.get("join_" + i) + " ";
                     }
-                    sql += params.get("field_" + i);
+                    sql += "a." + params.get("field_" + i);
                     if ("like".equals(params.get("condition_" + i))) {
                         sql += " like" + " '%" + params.get("variable_" + i) + "%'";
                     } else {
@@ -173,6 +174,7 @@ public class ArchiveServiceImpl implements ArchiveService {
         }
         return result;
     }
+
     private String getSql(String javaMethodAddress, Object param) {
         Map<String, Object> stringObjectMap = ObjectUtils.objToMap(param);
         BoundSql boundSql = sqlSessionFactory.getConfiguration()

+ 3 - 3
src/main/resources/application-dev.yml

@@ -1,5 +1,5 @@
 server:
-  port: 9093
+  port: 9858
 spring:
   resources:
     static-locations: classpath:/static,classpath:/public,classpath:/resources,classpath:/META-INF/resources,file:${upload-file.file-root-directory},file:${upload-file.archive-file-root-directory}
@@ -58,7 +58,7 @@ spring:
   # redis配置
   redis:
     # redis地址
-    host: 192.168.113.5
+    host: 127.0.0.1
     # redis端口
     port: 6379
     # redis库
@@ -74,7 +74,7 @@ spring:
         # 连接池中的最小空闲连接
         min-idle: 2
     # 密码
-    password: 123456
+#    password: 123456
     # 连接超时时间(毫秒)
     timeout: 30000
   rabbitmq:

+ 3 - 1
src/main/resources/mapper/archiveMapper.xml

@@ -36,7 +36,7 @@
                 AND (a.wjbh like concat(concat('%',#{wjbh}),'%') OR sa.wh like concat(concat('%',#{wjbh}),'%'))
             </if>
             <if test="ml != null and ml != ''">
-                AND a.ml = #{ml} or a.ml in (select `code` FROM tab_archives_tree where parent_id = (SELECT id FROM `tab_archives_tree` where code = #{ml}))
+                AND (a.ml = #{ml} or a.ml in (select `code` FROM tab_archives_tree where parent_id = (SELECT id FROM `tab_archives_tree` where code = #{ml})))
             </if>
             <if test="bgqx != null and bgqx != ''">
                 <choose>
@@ -67,9 +67,11 @@
                 ${sql}
             </if>
         </where>
+        group by a.id
         <if test="field != null and field != '' and order != null and order != ''">
             order by ${field} ${order}
         </if>
+
     </select>
 
 

+ 6 - 6
src/main/resources/static/page/admin/edit.html

@@ -53,9 +53,9 @@
     </div>
 
     <div class="layui-form-item">
-        <label class="layui-form-label required">身份证号</label>
+        <label class="layui-form-label">身份证号</label>
         <div class="layui-input-block">
-            <input type="text" name="idCard" lay-verify="idCard" lay-verify="identity" lay-reqtext="身份证号不能为空"
+            <input type="text" name="idCard"
                    placeholder="请输入身份证号"
                    value="" class="layui-input">
         </div>
@@ -63,9 +63,9 @@
 
 
     <div class="layui-form-item">
-        <label class="layui-form-label required">邮箱</label>
+        <label class="layui-form-label">邮箱</label>
         <div class="layui-input-block">
-            <input type="text" name="email" lay-verify="email" lay-reqtext="邮箱不能为空" placeholder="请输入邮箱"
+            <input type="text" name="email" placeholder="请输入邮箱"
                    value="" class="layui-input">
         </div>
     </div>
@@ -108,7 +108,7 @@
 
             //保存方法
         let save = function (data) {
-                http.post('borrow/archiveBorrow/', data, true, function (res) {
+                http.post(id == '' ? 'system/admin/insert' : 'system/admin/update', data, true, function (res) {
                     if (res.code == 200) {
                         let index = layer.alert('保存成功!', {
                             title: id == '' ? '添加' : '修改' + '信息'
@@ -179,8 +179,8 @@
         /**事-------------------------------件-------------------------------绑-------------------------------定*/
 
         initSelect()
-        initData()
         initDept()
+        initData()
 
         //监听提交
         form.on('submit(saveBtn)', function (data) {

+ 1 - 0
src/test/java/com/gz/ESTest.java

@@ -18,6 +18,7 @@ import java.util.Map;
  */
 @SpringBootTest
 public class ESTest {
+//    5179-WS2019-001-0000-0494
 
     @Resource
     private BBossESStarter bbossESStarter;

+ 1 - 0
src/test/java/com/gz/OcrTest.java

@@ -70,6 +70,7 @@ public class OcrTest {
             ocrBean.setFileUrl(serverFileUrlPrefix + archiveFileDTO.getFilePath() + "/" + archiveFileDTO.getFileName());
             log.info("【ocr识别】发起识别队列,参数[{}]", JSON.toJSONString(ocrBean));
             rabbitTemplate.convertAndSend(dataExchangeName, ocrBindingKey, JSON.toJSONString(ocrBean));
+            return;
         }
 //        Integer i = Integer.valueOf(stringRedisTemplate.opsForValue().get("sdfsdf"));
 //        ArchiveFileDTO archiveFileDTO = archiveFileDTOS.get(0);