bc_zhang 4 年 前
コミット
42d3857007
69 ファイル変更1007 行追加1245 行削除
  1. 13 0
      .idea/libraries/Maven__com_alibaba_fastjson_1_2_32.xml
  2. 1 0
      kg.iml
  3. 11 0
      pom.xml
  4. 1 1
      src/main/java/com/zglc/kg/KnowledgeGraphApplication.java
  5. 1 1
      src/main/java/com/zglc/kg/conf/Swagger2Config.java
  6. 0 26
      src/main/java/com/zglc/kg/controller/CommonController.java
  7. 29 5
      src/main/java/com/zglc/kg/controller/MovieController.java
  8. 0 27
      src/main/java/com/zglc/kg/controller/RepairManualController.java
  9. 0 106
      src/main/java/com/zglc/kg/controller/TechnicalTermController.java
  10. 5 1
      src/main/java/com/zglc/kg/dao/DeptDao.java
  11. 0 20
      src/main/java/com/zglc/kg/dao/IntValueDao.java
  12. 0 3
      src/main/java/com/zglc/kg/dao/RepairManualDao.java
  13. 0 24
      src/main/java/com/zglc/kg/dao/TechnicalTermDao.java
  14. 0 26
      src/main/java/com/zglc/kg/entity/IntValue.java
  15. 0 24
      src/main/java/com/zglc/kg/entity/LogicSearchEntity.java
  16. 0 17
      src/main/java/com/zglc/kg/entity/SingleStaEntity.java
  17. 0 22
      src/main/java/com/zglc/kg/entity/SingleStaResultEntity.java
  18. 0 11
      src/main/java/com/zglc/kg/entity/StatisticEntity.java
  19. 0 46
      src/main/java/com/zglc/kg/entity/TechnicalTermEntity.java
  20. 135 137
      src/main/java/com/zglc/kg/schedule/ScheduleTasks.java
  21. 27 58
      src/main/java/com/zglc/kg/service/CommonService.java
  22. 0 20
      src/main/java/com/zglc/kg/service/RepairManualService.java
  23. 0 132
      src/main/java/com/zglc/kg/service/TechnicalTermService.java
  24. 37 38
      src/main/java/com/zglc/kg/utils/DocToPdf.java
  25. 32 0
      src/main/java/com/zglc/kg/utils/Neo4jConfig.java
  26. 707 0
      src/main/java/com/zglc/kg/utils/Neo4jUtil.java
  27. 0 7
      src/main/resources/mapping/RepairManualDao.xml
  28. 0 52
      src/main/resources/mapping/TechnicalTermDao.xml
  29. BIN
      target/classes/com/zglc/kg/conf/Swagger2Config.class
  30. BIN
      target/classes/com/zglc/kg/controller/ArticleController.class
  31. BIN
      target/classes/com/zglc/kg/controller/CommonController.class
  32. BIN
      target/classes/com/zglc/kg/controller/EquipmentController.class
  33. BIN
      target/classes/com/zglc/kg/controller/FaultRecordController.class
  34. BIN
      target/classes/com/zglc/kg/controller/MovieController.class
  35. BIN
      target/classes/com/zglc/kg/controller/RepairManualController.class
  36. BIN
      target/classes/com/zglc/kg/controller/TechnicalTermController.class
  37. BIN
      target/classes/com/zglc/kg/dao/ArticleDao.class
  38. BIN
      target/classes/com/zglc/kg/dao/EquipmentDao.class
  39. BIN
      target/classes/com/zglc/kg/dao/FaultRecordDao.class
  40. BIN
      target/classes/com/zglc/kg/dao/IntValueDao.class
  41. BIN
      target/classes/com/zglc/kg/dao/RepairManualDao.class
  42. BIN
      target/classes/com/zglc/kg/dao/TechnicalTermDao.class
  43. BIN
      target/classes/com/zglc/kg/entity/AircraftEntity.class
  44. BIN
      target/classes/com/zglc/kg/entity/ArticleEntity.class
  45. BIN
      target/classes/com/zglc/kg/entity/ArticleFind.class
  46. BIN
      target/classes/com/zglc/kg/entity/EquipmentEntity.class
  47. BIN
      target/classes/com/zglc/kg/entity/FaultFind.class
  48. BIN
      target/classes/com/zglc/kg/entity/FaultRecordEntity.class
  49. BIN
      target/classes/com/zglc/kg/entity/FaultRecordStatistics.class
  50. BIN
      target/classes/com/zglc/kg/entity/IntValue.class
  51. BIN
      target/classes/com/zglc/kg/entity/LogicSearchEntity.class
  52. BIN
      target/classes/com/zglc/kg/entity/SingleStaEntity.class
  53. BIN
      target/classes/com/zglc/kg/entity/SingleStaResultEntity.class
  54. BIN
      target/classes/com/zglc/kg/entity/StatisticEntity.class
  55. BIN
      target/classes/com/zglc/kg/entity/TechnicalTermEntity.class
  56. BIN
      target/classes/com/zglc/kg/schedule/ScheduleTasks.class
  57. BIN
      target/classes/com/zglc/kg/service/ArticleService.class
  58. BIN
      target/classes/com/zglc/kg/service/CommonService.class
  59. BIN
      target/classes/com/zglc/kg/service/EquipmentService.class
  60. BIN
      target/classes/com/zglc/kg/service/FaultRecordService.class
  61. BIN
      target/classes/com/zglc/kg/service/RepairManualService.class
  62. BIN
      target/classes/com/zglc/kg/service/TechnicalTermService.class
  63. BIN
      target/classes/com/zglc/kg/utils/DocToPdf.class
  64. 8 11
      target/classes/mapping/AircraftDao.xml
  65. 0 83
      target/classes/mapping/ArticleDao.xml
  66. 0 41
      target/classes/mapping/EquipmentDao.xml
  67. 0 247
      target/classes/mapping/FaultRecordDao.xml
  68. 0 7
      target/classes/mapping/RepairManualDao.xml
  69. 0 52
      target/classes/mapping/TechnicalTermDao.xml

+ 13 - 0
.idea/libraries/Maven__com_alibaba_fastjson_1_2_32.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: com.alibaba:fastjson:1.2.32">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/com/alibaba/fastjson/1.2.32/fastjson-1.2.32.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/com/alibaba/fastjson/1.2.32/fastjson-1.2.32-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/com/alibaba/fastjson/1.2.32/fastjson-1.2.32-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 1 - 0
kg.iml

@@ -191,5 +191,6 @@
     <orderEntry type="library" name="Maven: org.neo4j:neo4j-ogm-bolt-driver:3.2.14" level="project" />
     <orderEntry type="library" name="Maven: org.neo4j.driver:neo4j-java-driver:4.0.2" level="project" />
     <orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.32" level="project" />
   </component>
 </module>

+ 11 - 0
pom.xml

@@ -194,6 +194,17 @@
             <artifactId>spring-boot-starter-data-neo4j</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.32</version>
+        </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>org.neo4j.driver</groupId>-->
+<!--            <artifactId>neo4j-java-driver-spring-boot-starter</artifactId>-->
+<!--        </dependency>-->
+
 
 
     </dependencies>

+ 1 - 1
src/main/java/com/zglc/kg/KnowledgeGraphApplication.java

@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import com.zglc.kg.utils.DocToPdf;
 import com.zglc.kg.utils.Ppt2ToPdf;
 
-
+//@SpringBootApplication(scanBasePackages = {"com.zglc.kg"})
 @SpringBootApplication
 @ServletComponentScan
 @MapperScan("com.zglc.kg.dao")

+ 1 - 1
src/main/java/com/zglc/kg/conf/Swagger2Config.java

@@ -55,7 +55,7 @@ public class Swagger2Config {
 
     private ApiInfo apiInfo() {
         return new ApiInfoBuilder()
-                .title("故障信息管理系统API文档")
+                .title("知识图谱系统API文档")
                 .description("后端API接口")
                 .version("1.0")
                //.contact(new Contact("王超飞", "http://127.0.0.1:" + serverPort, "mnhwa@163.com"))

+ 0 - 26
src/main/java/com/zglc/kg/controller/CommonController.java

@@ -3,7 +3,6 @@ package com.zglc.kg.controller;
 import com.zglc.kg.anno.PassToken;
 import com.zglc.kg.base.Result;
 import com.zglc.kg.constant.ErrorCode;
-import com.zglc.kg.entity.LogicSearchEntity;
 import com.zglc.kg.entity.LoginVO;
 import com.zglc.kg.entity.UserEntity;
 import com.zglc.kg.service.CommonService;
@@ -92,31 +91,6 @@ public class CommonController {
         return Result.success("success!");
     }
 
-    @ApiOperation("搜索")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("find")
-    public Result<Map<String, Object>> find(String keyword,String type){
-        return commonService.find(keyword, type);
-    }
 
-    @ApiOperation("二次搜索")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("refind")
-    public Result<Map<String, Object>> refind(String keyword1,String keyword2,String type){
-        return commonService.refind(keyword1,keyword2,type);
-    }
-
-    @ApiOperation("逻辑搜索")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("logicSearch")
-    public Result<Map<String, Object>> logicSearch(LogicSearchEntity logicSearchEntity){
-        return commonService.logicSearch(logicSearchEntity);
-    }
 
 }

+ 29 - 5
src/main/java/com/zglc/kg/controller/MovieController.java

@@ -1,9 +1,6 @@
 package com.zglc.kg.controller;
 
 import com.zglc.kg.base.Result;
-import com.zglc.kg.dao.DeptDao;
-import com.zglc.kg.dao.RelationShipDao;
-import com.zglc.kg.entity.DeleteEntity;
 import com.zglc.kg.entity.MovieEntity;
 import com.zglc.kg.entity.PersonEntity;
 import com.zglc.kg.service.MovieService;
@@ -11,19 +8,33 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
+import org.neo4j.driver.Driver;
+import org.neo4j.driver.Session;
+
 import javax.annotation.Resource;
-import java.util.Optional;
+import java.util.List;
 
 @Api(tags = "电影图谱接口")
 @RequestMapping("api/movie")
-@CrossOrigin(allowCredentials = "true")
+//@CrossOrigin(allowCredentials = "true")
 @RestController
 public class MovieController {
     @Resource
     private MovieService movieService;
 
+
+
+    private final Driver driver;
+
+    public MovieController(Driver driver) {
+        this.driver = driver;
+    }
+
+
+
     @ApiOperation("增加电影节点")
     @ApiResponses({
             @ApiResponse(code = 0, message = "成功")
@@ -90,4 +101,17 @@ public class MovieController {
 
 
 
+
+
+    @GetMapping(path = "/movies", produces = MediaType.APPLICATION_JSON_VALUE)
+    public List<String> getMovieTitles() {
+
+        try (Session session = driver.session()) {
+            return session.run("MATCH (m:Movie) RETURN m ORDER BY m.name ASC")
+                    .list(r -> r.get("m").asNode().get("title").asString());
+        }
+    }
+
+
+
 }

+ 0 - 27
src/main/java/com/zglc/kg/controller/RepairManualController.java

@@ -74,34 +74,7 @@ public class RepairManualController {
     public Result<String> delete(@RequestBody DeleteEntity deleteEntity){
         return  repairManualService.delete(deleteEntity.getIds());}
 
-    @ApiOperation("修改案例")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("edit")
-    public Result<String> edit( @RequestBody RepairManualEntity data){return  repairManualService.edit(data);}
-
-    @ApiOperation("查找")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("findByFault")
-    public Result<List<RepairManualEntity>> findByFault(@RequestBody FaultFind faultFind){
 
-        return repairManualService.findByFault(faultFind);
-    }
-
-
-    @ApiOperation("逻辑搜索")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("advanceSearch")
-    public Result<List<RepairManualEntity>> advanceSearch(@RequestBody LogicSearchEntity logicSearchEntity){
-        if (logicSearchEntity.getSize()> 0)
-            PageHelper.startPage(logicSearchEntity.getPage(), logicSearchEntity.getSize(), "id desc");
-        return Result.success(repairManualService.advanceSearch(logicSearchEntity));
-    }
 
     @ApiOperation("导入图片")
     @ApiResponses({

+ 0 - 106
src/main/java/com/zglc/kg/controller/TechnicalTermController.java

@@ -1,106 +0,0 @@
-package com.zglc.kg.controller;
-
-
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import com.zglc.kg.base.Result;
-import com.zglc.kg.entity.DeleteEntity;
-import com.zglc.kg.entity.TechnicalTermEntity;
-import com.zglc.kg.service.TechnicalTermService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.util.List;
-
-@Api(tags = "专业术语接口")
-@RequestMapping("api/technicalterm")
-@CrossOrigin(allowCredentials = "true")
-@RestController
-public class TechnicalTermController {
-
-    @Resource
-    private final TechnicalTermService technicalTermService;
-    @Autowired(required = false)
-    public TechnicalTermController(TechnicalTermService technicalTermService){
-        this.technicalTermService = technicalTermService;
-    }
-
-
-    @ApiOperation("列出所有专业术语")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("listAll")
-    public Result<List<TechnicalTermEntity>> listAll() {
-        return Result.success(technicalTermService.listAll());
-    }
-
-    @ApiOperation("分页列出所有专业术语")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("listpage")
-    public Result<PageInfo<TechnicalTermEntity>> listpage(Integer page, Integer size) {
-        PageHelper.startPage(page, size, "id desc");
-        return Result.success(new PageInfo<>(technicalTermService.getAllTechnicalTerm()));
-    }
-
-    @ApiOperation("按专业术语ID查找")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("get")
-    public  Result<TechnicalTermEntity> get(@RequestParam Integer id){return  Result.success(technicalTermService.getTechnicalTerm(id));}
-
-    @ApiOperation("按中文名称查询专业术语")
-    @GetMapping("findByCnName")
-    public Result<List<TechnicalTermEntity>> findByCnName(@RequestParam("name") String name){
-        return technicalTermService.findByCnName(name);
-    }
-
-    @ApiOperation("按英文名称查询专业术语")
-    @GetMapping("findByEngName")
-    public Result<List<TechnicalTermEntity>> findByEngName(@RequestParam("name") String name){
-        return technicalTermService.findByEngName(name);
-    }
-
-    @ApiOperation("增添专业术语")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("add")
-    public Result<String> add(@RequestBody TechnicalTermEntity data){return  technicalTermService.add(data);}
-
-    @ApiOperation("删除专业术语")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("delete")
-    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  technicalTermService.delete(deleteEntity.getIds());}
-
-    @ApiOperation("修改专业术语")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("edit")
-    public Result<String> edit( @RequestBody TechnicalTermEntity data){return  technicalTermService.edit(data);}
-
-
-    @ApiOperation("批量导入专业术语")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("addBatch")
-    public Result<Boolean> importFile(HttpServletRequest request, @RequestParam("file") MultipartFile file) throws IOException {
-        return Result.success(technicalTermService.getExcelContext(file));
-    }
-
-}

+ 5 - 1
src/main/java/com/zglc/kg/dao/DeptDao.java

@@ -5,7 +5,11 @@ import org.springframework.data.neo4j.repository.Neo4jRepository;
 import org.springframework.stereotype.Repository;
 
 @Repository
-public interface DeptDao extends Neo4jRepository<DeptEntity,Long> {
+public interface DeptDao extends Neo4jRepository<DeptEntity, Long> {
 
 }
 
+
+
+
+

+ 0 - 20
src/main/java/com/zglc/kg/dao/IntValueDao.java

@@ -1,20 +0,0 @@
-package com.zglc.kg.dao;
-
-import com.zglc.kg.entity.IntValue;
-import org.springframework.stereotype.Repository;
-import tk.mybatis.mapper.common.Mapper;
-
-/**
- *
- * 
- * @author wcf
- * @email mnhwa@163.com
- * @date 2020-02-14 01:33:53
- * @description Refactoring 1st
- *
- */
-@Repository
-public interface IntValueDao extends Mapper<IntValue> {
-
-	
-}

+ 0 - 3
src/main/java/com/zglc/kg/dao/RepairManualDao.java

@@ -1,6 +1,5 @@
 package com.zglc.kg.dao;
 
-import com.zglc.kg.entity.FaultFind;
 import com.zglc.kg.entity.RepairManualEntity;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -19,8 +18,6 @@ public interface RepairManualDao extends Mapper<RepairManualEntity> {
 
     List<RepairManualEntity> refindByName(@Param("name1") String name1,@Param("name2") String name2);
 
-    List<RepairManualEntity> findByFault(FaultFind faultFind);
-
     List<RepairManualEntity> findByHmc(@Param("name") String name);
 
     List<RepairManualEntity> findByMfl(@Param("name") String name);

+ 0 - 24
src/main/java/com/zglc/kg/dao/TechnicalTermDao.java

@@ -1,24 +0,0 @@
-package com.zglc.kg.dao;
-
-import com.zglc.kg.entity.TechnicalTermEntity;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-import tk.mybatis.mapper.common.Mapper;
-
-import java.util.List;
-
-@Repository
-public interface TechnicalTermDao extends Mapper<TechnicalTermEntity> {
-
-    List<TechnicalTermEntity> listAll();
-
-    Integer getCount();
-
-    List<TechnicalTermEntity> findByCnName(@Param("name") String name);
-
-    List<TechnicalTermEntity> findByEngName(@Param("name") String name);
-
-    Integer addBatch(List<TechnicalTermEntity> list);
-
-
-}

+ 0 - 26
src/main/java/com/zglc/kg/entity/IntValue.java

@@ -1,26 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Data;
-
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-@Data
-public class IntValue {
-
-    /**
-     *
-     */
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private Integer id;
-
-    /**
-     *
-     */
-    @Column(name = "v")
-    private String iv;
-}

+ 0 - 24
src/main/java/com/zglc/kg/entity/LogicSearchEntity.java

@@ -1,24 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Data;
-
-@Data
-public class LogicSearchEntity {
-
-    private String masterKey;//搜索主题
-    private String firstKey;//第一个逻辑关键字
-    private String secondKey;//二无则为-1
-    private String thirdKey;//三
-
-    private int firstLogic;//and ,or ,nor第一个逻辑类别
-    private int secondLogic;
-    private int thirdLogic;
-
-    private int searchType;//主搜索类别 记录,案例,文章
-    private int firstType;//第一个搜索类别 机型,专业,系统
-    private int secondType;
-    private int thirdType;
-
-    private int page;
-    private int size;
-}

+ 0 - 17
src/main/java/com/zglc/kg/entity/SingleStaEntity.java

@@ -1,17 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Data;
-
-import java.util.Date;
-
-@Data
-public class SingleStaEntity {
-    private String department1;//单位名
-    private int departmentLevle;//单位级别分别 为0,1,2,3,只搜索指定级别,其它级别不进行搜索
-    private String airType;
-    private String airNo;
-    private String major;
-    private String systemName;
-    private Date startTime;
-    private Date endTme;
-}

+ 0 - 22
src/main/java/com/zglc/kg/entity/SingleStaResultEntity.java

@@ -1,22 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class SingleStaResultEntity {
-    private int faultCount;//故障数量
-    private int seriousCount;//严重数量
-    private String topMajor;//高发专业
-    private String topSystem;//高发系统,专业统计
-    private String topOPT;//高发时机
-    List<StatisticEntity> airTypeSta;//机型分布
-    List<StatisticEntity> airNoSta;//机号分布
-    List<StatisticEntity> systemSta;//系统分布
-    List<StatisticEntity> majorSta;//专业分布
-    List<StatisticEntity> optSta;//时机分布
-    List<StatisticEntity> deviceSta;//故障件分布
-    List<StatisticEntity> seriousSta;//级别分布
-
-}

+ 0 - 11
src/main/java/com/zglc/kg/entity/StatisticEntity.java

@@ -1,11 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Data;
-
-import java.io.Serializable;
-@Data
-public class StatisticEntity implements Serializable {
-
-    private String parentName;
-    private int recordCount;
-}

+ 0 - 46
src/main/java/com/zglc/kg/entity/TechnicalTermEntity.java

@@ -1,46 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Data;
-
-import javax.persistence.*;
-
-
-@Data
-@Table(name = "t_technicalterm")
-public class TechnicalTermEntity {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     *id
-     */
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private Integer id;
-
-    /**
-     * 中文名称
-     */
-    @Column(name = "cn_name")
-    private String cn_name;
-
-
-    /**
-     * 英文名称
-     */
-    @Column(name = "eng_name")
-    private String eng_name;
-
-    /**
-     * 内容
-     */
-    @Column(name = "content")
-    private String content;
-
-    /**
-     * 备注
-     */
-    @Column(name = "remarks")
-    private String remarks;
-
-}

+ 135 - 137
src/main/java/com/zglc/kg/schedule/ScheduleTasks.java

@@ -4,7 +4,6 @@ package com.zglc.kg.schedule;
 import com.zglc.kg.dao.AircraftDao;
 import com.zglc.kg.dao.DeviceDao;
 import com.zglc.kg.dao.RepairManualDao;
-import com.zglc.kg.dao.ArticleDao;
 import com.zglc.kg.entity.*;
 import com.zglc.kg.exceptions.BusinessException;
 import com.zglc.kg.utils.*;
@@ -36,8 +35,7 @@ public class ScheduleTasks {
     private DeviceDao deviceDao;
     @Autowired
     private RepairManualDao repairManualDao;
-    @Autowired
-    private ArticleDao articleDao;
+
 
     @Value("${spring.fault.sourcePath}")
     private String sourcePath; //targetPath
@@ -73,10 +71,10 @@ public class ScheduleTasks {
                 getMannel(f);
                 deleteDir(new File(uploadPath+"/manuel"));
             }
-            if (na.equals("article")){
-                getArticle(f);
-                deleteDir(new File(uploadPath+"/article"));
-            }
+//            if (na.equals("article")){
+//                getArticle(f);
+//                deleteDir(new File(uploadPath+"/article"));
+//            }
         }
     }
 
@@ -183,7 +181,7 @@ public class ScheduleTasks {
             AircraftEntity aircraft = new AircraftEntity();
             aircraft.setAircraft_type(ExcelUtils.getCeilValue(sheet, 0, 1));
             SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
-            aircraft.setInput_time(date.format(new Date()));
+//            aircraft.setInput_time(date.format(new Date()));
             aircraftDao.addNotExist(aircraft);
         }
         repairManual.setAircraft(ExcelUtils.getCeilValue(sheet, 0, 1));
@@ -212,136 +210,136 @@ public class ScheduleTasks {
         return list;
     }
 
-    private void getArticle(File file) {
-        String sourcePath1;
-        sourcePath1 = "d:\\source";
-        File[] files = file.listFiles();
-        boolean flag = false;
-        for (File f : files) {
-            if (f.isDirectory()) {
-                flag = true;
-                getMannel(f);
-            }
-        }
-        if (!flag) {
-            Map<String, String> fileparams = new HashMap<>();
-            for (File f : files) {
-                if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
-                    MultipartFile mfile = transtTo(f);
-
-                    String extName = ""; // 扩展名格式:
-                    extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
-                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime()  + extName);
-//                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
-                    //转为pdf
-                    DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
-                    if (f.getName().endsWith(ExcelUtils.DOC))  {
-//                        filePath = filePath.replaceAll( "doc","pdf");
-                        filePath = filePath.replaceAll( "d:","");
-                    }
-                    if (f.getName().endsWith(ExcelUtils.DOCX))  {
-//                        filePath = filePath.replaceAll( "docx","pdf");
-                        filePath = filePath.replaceAll( "d:","");
-                    }
-                    String name = null;
-                    if (f.getName().endsWith(ExcelUtils.DOC)) {
-                        name = f.getName().replace(ExcelUtils.DOC, "");
-                    } else {
-                        name = f.getName().replace(ExcelUtils.DOCX, "");
-                    }
-                    System.out.println(f.getName());
-                    fileparams.put(name, filePath);
-                }
-                if (f.getName().endsWith(ExcelUtils.PPT) || f.getName().endsWith(ExcelUtils.PPTX)) {
-                    MultipartFile mfile = transtTo(f);
-
-                    String extName = ""; // 扩展名格式:
-                    extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
-                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime()  + extName);
-//                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
-                    //转为pdf
-                    Ppt2ToPdf.convertPpt2Pdf(filePath, sourcePath1);
-                    if (f.getName().endsWith(ExcelUtils.PPT))  {
-//                        filePath = filePath.replaceAll( "doc","pdf");
-                        filePath = filePath.replaceAll( "d:","");
-                    }
-                    if (f.getName().endsWith(ExcelUtils.PPTX))  {
-//                        filePath = filePath.replaceAll( "docx","pdf");
-                        filePath = filePath.replaceAll( "d:","");
-                    }
-                    String name = null;
-                    if (f.getName().endsWith(ExcelUtils.PPT)) {
-                        name = f.getName().replace(ExcelUtils.PPT, "");
-                    } else {
-                        name = f.getName().replace(ExcelUtils.PPTX, "");
-                    }
-                    System.out.println(f.getName());
-                    fileparams.put(name, filePath);
-                }
-                if (f.getName().endsWith(ExcelUtils.PDF)) {
-                    MultipartFile mfile = transtTo(f);
-                    String extName = ""; // 扩展名格式:
-                    extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
-                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime()  + extName);
-                    filePath = filePath.replaceAll( "d:","");
-                    String name = null;
-                    if (f.getName().endsWith(ExcelUtils.PDF)) {
-                        name = f.getName().replace(ExcelUtils.PDF, "");
-                    }
-                    System.out.println(f.getName());
-                    fileparams.put(name, filePath);
-                }
-
-            }
-            for (File f : files) {
-                if (f.getName().endsWith(ExcelUtils.XLS) || f.getName().endsWith(ExcelUtils.XLSX)) {
-                    String name = null;
-                    if (f.getName().endsWith(ExcelUtils.XLS)) {
-                        name = f.getName().replace(ExcelUtils.XLS, "");
-                    } else {
-                        name = f.getName().replace(ExcelUtils.XLSX, "");
-                    }
-
-                    List<ArticleEntity> list = getAllArticle(f, file.getName(), fileparams.get(name), name);
-                    if (list != null && list.size() > 0) {
-                        articleDao.addBatch(list);
-                    }
-                }
-            }
-        }
-    }
+//    private void getArticle(File file) {
+//        String sourcePath1;
+//        sourcePath1 = "d:\\source";
+//        File[] files = file.listFiles();
+//        boolean flag = false;
+//        for (File f : files) {
+//            if (f.isDirectory()) {
+//                flag = true;
+//                getMannel(f);
+//            }
+//        }
+//        if (!flag) {
+//            Map<String, String> fileparams = new HashMap<>();
+//            for (File f : files) {
+//                if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
+//                    MultipartFile mfile = transtTo(f);
+//
+//                    String extName = ""; // 扩展名格式:
+//                    extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
+//                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime()  + extName);
+////                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
+//                    //转为pdf
+//                    DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
+//                    if (f.getName().endsWith(ExcelUtils.DOC))  {
+////                        filePath = filePath.replaceAll( "doc","pdf");
+//                        filePath = filePath.replaceAll( "d:","");
+//                    }
+//                    if (f.getName().endsWith(ExcelUtils.DOCX))  {
+////                        filePath = filePath.replaceAll( "docx","pdf");
+//                        filePath = filePath.replaceAll( "d:","");
+//                    }
+//                    String name = null;
+//                    if (f.getName().endsWith(ExcelUtils.DOC)) {
+//                        name = f.getName().replace(ExcelUtils.DOC, "");
+//                    } else {
+//                        name = f.getName().replace(ExcelUtils.DOCX, "");
+//                    }
+//                    System.out.println(f.getName());
+//                    fileparams.put(name, filePath);
+//                }
+//                if (f.getName().endsWith(ExcelUtils.PPT) || f.getName().endsWith(ExcelUtils.PPTX)) {
+//                    MultipartFile mfile = transtTo(f);
+//
+//                    String extName = ""; // 扩展名格式:
+//                    extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
+//                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime()  + extName);
+////                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
+//                    //转为pdf
+//                    Ppt2ToPdf.convertPpt2Pdf(filePath, sourcePath1);
+//                    if (f.getName().endsWith(ExcelUtils.PPT))  {
+////                        filePath = filePath.replaceAll( "doc","pdf");
+//                        filePath = filePath.replaceAll( "d:","");
+//                    }
+//                    if (f.getName().endsWith(ExcelUtils.PPTX))  {
+////                        filePath = filePath.replaceAll( "docx","pdf");
+//                        filePath = filePath.replaceAll( "d:","");
+//                    }
+//                    String name = null;
+//                    if (f.getName().endsWith(ExcelUtils.PPT)) {
+//                        name = f.getName().replace(ExcelUtils.PPT, "");
+//                    } else {
+//                        name = f.getName().replace(ExcelUtils.PPTX, "");
+//                    }
+//                    System.out.println(f.getName());
+//                    fileparams.put(name, filePath);
+//                }
+//                if (f.getName().endsWith(ExcelUtils.PDF)) {
+//                    MultipartFile mfile = transtTo(f);
+//                    String extName = ""; // 扩展名格式:
+//                    extName = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
+//                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime()  + extName);
+//                    filePath = filePath.replaceAll( "d:","");
+//                    String name = null;
+//                    if (f.getName().endsWith(ExcelUtils.PDF)) {
+//                        name = f.getName().replace(ExcelUtils.PDF, "");
+//                    }
+//                    System.out.println(f.getName());
+//                    fileparams.put(name, filePath);
+//                }
+//
+//            }
+//            for (File f : files) {
+//                if (f.getName().endsWith(ExcelUtils.XLS) || f.getName().endsWith(ExcelUtils.XLSX)) {
+//                    String name = null;
+//                    if (f.getName().endsWith(ExcelUtils.XLS)) {
+//                        name = f.getName().replace(ExcelUtils.XLS, "");
+//                    } else {
+//                        name = f.getName().replace(ExcelUtils.XLSX, "");
+//                    }
+//
+//                    List<ArticleEntity> list = getAllArticle(f, file.getName(), fileparams.get(name), name);
+//                    if (list != null && list.size() > 0) {
+//                        articleDao.addBatch(list);
+//                    }
+//                }
+//            }
+//        }
+//    }
 
-    private List<ArticleEntity> getAllArticle(File file, String deviceType, String filePath, String name) {
-        Workbook wb = ExcelUtils.readExcel(file);
-        Sheet sheet = ExcelUtils.getSheet(wb, sheetName);
-        if (sheet == null || sheet.getLastRowNum() < 1) {
-            return null;
-        }
-        List<ArticleEntity> list = new ArrayList<>();
-        ArticleEntity article = new ArticleEntity();
-        article.setTitle(name);
-        article.setAircraft(ExcelUtils.getCeilValue(sheet, 0, 1));
-        article.setMajor_name(ExcelUtils.getCeilValue(sheet, 1, 1));
-        article.setAircraft_system(ExcelUtils.getCeilValue(sheet, 2, 1));
-        article.setAuthor(ExcelUtils.getCeilValue(sheet, 4, 1));
-        article.setArticle_type(ExcelUtils.getCeilValue(sheet, 5, 1));
-        article.setArticle_number(ExcelUtils.getCeilValue(sheet, 6, 1));
-        article.setHmc(ExcelUtils.getCeilValue(sheet, 7, 1));
-        article.setMfl(ExcelUtils.getCeilValue(sheet, 8, 1));
-        article.setPfl(ExcelUtils.getCeilValue(sheet, 9, 1));
-        article.setGmp(ExcelUtils.getCeilValue(sheet, 10, 1));
-        article.setKeywords(ExcelUtils.getCeilValue(sheet, 11, 1));
-        article.setFile_path(filePath);
-        SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
-        article.setInput_time(date.format(new Date()));
-        list.add(article);
-        try {
-            wb.close();
-        } catch (IOException e) {
-            throw new BusinessException("关闭文件错误!", e);
-        }
-        return list;
-    }
+//    private List<ArticleEntity> getAllArticle(File file, String deviceType, String filePath, String name) {
+//        Workbook wb = ExcelUtils.readExcel(file);
+//        Sheet sheet = ExcelUtils.getSheet(wb, sheetName);
+//        if (sheet == null || sheet.getLastRowNum() < 1) {
+//            return null;
+//        }
+//        List<ArticleEntity> list = new ArrayList<>();
+//        ArticleEntity article = new ArticleEntity();
+//        article.setTitle(name);
+//        article.setAircraft(ExcelUtils.getCeilValue(sheet, 0, 1));
+//        article.setMajor_name(ExcelUtils.getCeilValue(sheet, 1, 1));
+//        article.setAircraft_system(ExcelUtils.getCeilValue(sheet, 2, 1));
+//        article.setAuthor(ExcelUtils.getCeilValue(sheet, 4, 1));
+//        article.setArticle_type(ExcelUtils.getCeilValue(sheet, 5, 1));
+//        article.setArticle_number(ExcelUtils.getCeilValue(sheet, 6, 1));
+//        article.setHmc(ExcelUtils.getCeilValue(sheet, 7, 1));
+//        article.setMfl(ExcelUtils.getCeilValue(sheet, 8, 1));
+//        article.setPfl(ExcelUtils.getCeilValue(sheet, 9, 1));
+//        article.setGmp(ExcelUtils.getCeilValue(sheet, 10, 1));
+//        article.setKeywords(ExcelUtils.getCeilValue(sheet, 11, 1));
+//        article.setFile_path(filePath);
+//        SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
+//        article.setInput_time(date.format(new Date()));
+//        list.add(article);
+//        try {
+//            wb.close();
+//        } catch (IOException e) {
+//            throw new BusinessException("关闭文件错误!", e);
+//        }
+//        return list;
+//    }
 
 
     private void deleteDir(File file) {

+ 27 - 58
src/main/java/com/zglc/kg/service/CommonService.java

@@ -10,72 +10,41 @@ import java.util.Map;
 
 @Service
 public class CommonService {
-    @Autowired
-    private ArticleService articleService;
 
-    @Autowired
-    private RepairManualService repairManualService;
 
     @Autowired
-    private FaultRecordService faultRecordService;
+    private RepairManualService repairManualService;
 
-    public Result<Map<String, Object>> find(String keyword,String type){
-        Map<String, Object> map = new HashMap<>();
-        if (type == null || "".equals(type) || "all".equals(type)){
-            map.put("article", articleService.findByName(keyword));
-            map.put("repairManual", repairManualService.findByName(keyword));
-            map.put("faultRecord", faultRecordService.findByName(keyword));
-        }else if("faultRecord".equals(type)){
-            map.put("faultRecord", faultRecordService.findByName(keyword));
-        }else if("repairManual".equals(type)){
-            map.put("repairManual", repairManualService.findByName(keyword));
-        }else if("article".equals(type)){
-            map.put("article", articleService.findByName(keyword));
-        }
-        return Result.success(map);
-    }
 
-    public Result<Map<String, Object>> refind(String keyword1,String keyword2,String type){
-        Map<String, Object> map = new HashMap<>();
-        if (type == null || "".equals(type) || "all".equals(type)){
-            map.put("faultRecord", faultRecordService.refindByName(keyword1,keyword2));
-            map.put("repairManual", repairManualService.refindByName(keyword1,keyword2));
-            map.put("article", articleService.refindByName(keyword1,keyword2));
-        }else if("faultRecord".equals(type)){
-            map.put("faultRecord", faultRecordService.refindByName(keyword1,keyword2));
-        }else if("repairManual".equals(type)){
-            map.put("repairManual", repairManualService.refindByName(keyword1,keyword2));
-          }
-        else if("article".equals(type)){
-            map.put("article", articleService.refindByName(keyword1,keyword2));
-        }
-        return Result.success(map);
-    }
 
-    public Result<Map<String, Object>> logicSearch(LogicSearchEntity logicSearchEntity){
-        Map<String, Object> map = new HashMap<>();
-        switch (logicSearchEntity.getSearchType())
-        {
-            case 0:{
 
-            }break;
-            case 1:{
 
-            }break;
-            case 2:{
 
-            }break;
-            default:
-        }
 
-       /*if("faultRecord".equals(type)){
-            map.put("faultRecord", faultRecordService.refindByName(keyword1,keyword2));
-        }else if("repairManual".equals(type)){
-            map.put("repairManual", repairManualService.refindByName(keyword1,keyword2));
-        }
-        else if("article".equals(type)){
-            map.put("article", articleService.refindByName(keyword1,keyword2));
-        }*/
-        return Result.success(map);
-    }
+//    public Result<Map<String, Object>> logicSearch(LogicSearchEntity logicSearchEntity){
+//        Map<String, Object> map = new HashMap<>();
+//        switch (logicSearchEntity.getSearchType())
+//        {
+//            case 0:{
+//
+//            }break;
+//            case 1:{
+//
+//            }break;
+//            case 2:{
+//
+//            }break;
+//            default:
+//        }
+//
+//       /*if("faultRecord".equals(type)){
+//            map.put("faultRecord", faultRecordService.refindByName(keyword1,keyword2));
+//        }else if("repairManual".equals(type)){
+//            map.put("repairManual", repairManualService.refindByName(keyword1,keyword2));
+//        }
+//        else if("article".equals(type)){
+//            map.put("article", articleService.refindByName(keyword1,keyword2));
+//        }*/
+//        return Result.success(map);
+//    }
 }

+ 0 - 20
src/main/java/com/zglc/kg/service/RepairManualService.java

@@ -100,10 +100,6 @@ public class RepairManualService {
         return Result.success(list);
     }
 
-    public Result<List<RepairManualEntity>> findByFault(FaultFind faultFind){
-        List<RepairManualEntity> list = repairManualDao.findByFault(faultFind);
-        return Result.success(list);
-    }
 
     public static final String SEARCHTYPE[] = {"aircraft","manual_system","major"};
     public void setLogicString(int nType ,Example.Criteria criteria,int nKey,String v)
@@ -117,22 +113,6 @@ public class RepairManualService {
         }
     }
 
-    public List<RepairManualEntity> advanceSearch(LogicSearchEntity logicSearchEntity) {
-        Example example = new Example(RepairManualEntity.class);
-        Example.Criteria criteria = example.createCriteria();
-        criteria.andLike("manual_name","%"+logicSearchEntity.getMasterKey()+"%");
-        if (logicSearchEntity.getFirstLogic() != -1)
-        {
-            setLogicString(logicSearchEntity.getFirstLogic(),criteria,logicSearchEntity.getFirstType(),logicSearchEntity.getFirstKey());
-            if (logicSearchEntity.getSecondLogic() != -1)
-            {
-                setLogicString(logicSearchEntity.getSecondLogic(),criteria,logicSearchEntity.getSearchType(),logicSearchEntity.getSecondKey());
-                if (logicSearchEntity.getThirdLogic() != -1)
-                    setLogicString(logicSearchEntity.getThirdLogic(),criteria,logicSearchEntity.getThirdType(),logicSearchEntity.getThirdKey());
-            }
-        }
-        return repairManualDao.selectByExample(example);
-    }
 
     public Result<List<RepairManualEntity>> findByHmc(String name) {
         if (name == null || "".equals(name)) {

+ 0 - 132
src/main/java/com/zglc/kg/service/TechnicalTermService.java

@@ -1,132 +0,0 @@
-package com.zglc.kg.service;
-
-import com.zglc.kg.base.Result;
-import com.zglc.kg.dao.TechnicalTermDao;
-import com.zglc.kg.entity.TechnicalTermEntity;
-import com.zglc.kg.utils.ExcelUtils;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-import tk.mybatis.mapper.entity.Example;
-
-import java.util.*;
-
-@Service
-
-public class TechnicalTermService {
-
-    private TechnicalTermDao technicalTermDao;
-
-    public TechnicalTermService(TechnicalTermDao faultDetectDao) {
-        this.technicalTermDao = faultDetectDao;
-    }
-
-    public List<TechnicalTermEntity> listAll() {
-        return technicalTermDao.listAll();
-    }
-
-    public Integer getCount() {
-        return technicalTermDao.getCount();
-    }
-
-    public Result<String> add(TechnicalTermEntity data) {
-        data.setId(null);
-        boolean flag = true;
-        String msg = "";
-        int index = technicalTermDao.insertSelective(data);
-        if (index == 0) {
-            flag = false;
-            msg = "添加专业术语失败!";
-        } else {
-            msg = "添加专业术语成功!";
-        }
-
-        return Result.result(flag, msg, msg);
-    }
-
-    public Result<String> delete(List<Integer> ids) {
-        boolean flag = true;
-        String msg = "";
-        Iterator iter = ids.iterator();
-        while(iter.hasNext()) {
-            Integer id = (Integer)iter.next();
-            int index = technicalTermDao.deleteByPrimaryKey(id);
-            if (index == 0) {
-                flag = false;
-                msg += "专业术语删除失败!" + id + ";";
-            } else {
-                msg += "专业术语删除成功!" + id + ";";
-            }
-        }
-        return Result.result(flag, msg, msg);
-    }
-
-    public Result<String> edit(TechnicalTermEntity data) {
-        boolean flag = true;
-        String msg = "";
-        TechnicalTermEntity tmpData = technicalTermDao.selectByPrimaryKey(data.getId());
-        if (tmpData != null) {
-            int index = technicalTermDao.updateByPrimaryKeySelective(data);
-            if (index == 0) {
-                flag = false;
-                msg = "专业术语修改失败";
-            } else {
-                msg = "专业术语修改成功";
-            }
-        } else {
-            flag = false;
-            msg = "专业术语不存在!";
-        }
-        return Result.result(flag, msg, msg);
-    }
-
-    public Result<List<TechnicalTermEntity>> findByCnName(String name){
-        if (name == null ||"".equals(name)){
-            return Result.result(false, "名称不能为空" ,null);
-        }
-        List<TechnicalTermEntity> list = technicalTermDao.findByCnName("%" + name + "%");
-        return Result.success(list);
-    }
-
-    public Result<List<TechnicalTermEntity>> findByEngName(String name){
-        if (name == null ||"".equals(name)){
-            return Result.result(false, "名称不能为空" ,null);
-        }
-        List<TechnicalTermEntity> list = technicalTermDao.findByEngName("%" + name + "%");
-        return Result.success(list);
-    }
-
-    public TechnicalTermEntity getTechnicalTerm(Integer id) {
-        return technicalTermDao.selectByPrimaryKey(id);
-    }
-
-    public List<TechnicalTermEntity> getAllTechnicalTerm() {
-        String msg = "";
-        Example example = new Example(TechnicalTermEntity.class);
-        example.createCriteria();
-        return technicalTermDao.selectByExample(example);
-    }
-
-    public String getExcelContext(MultipartFile file){
-        String msg = "";
-        Workbook wb = ExcelUtils.readExcel(file);
-        Sheet sheet = ExcelUtils.getSheet(wb, "sheet1");
-        Map<String, Integer> heads = ExcelUtils.getHeads(sheet);
-        List<TechnicalTermEntity> list = new ArrayList<>();
-        for(int i = 1; i<= sheet.getLastRowNum(); i++) {
-            TechnicalTermEntity term = new TechnicalTermEntity();
-            term.setCn_name(ExcelUtils.getCeilValue(sheet,i,heads.get("中文名称")));
-            term.setEng_name(ExcelUtils.getCeilValue(sheet,i,heads.get("英文名称")));
-            term.setContent(ExcelUtils.getCeilValue(sheet,i,heads.get("内容")));
-//            if (ExcelUtils.getCeilValue(sheet,i,heads.get("备注")) != null){
-                term.setRemarks(ExcelUtils.getCeilValue(sheet,i,heads.get("备注")));
-//            }
-            list.add(term);
-        }
-        technicalTermDao.addBatch(list);
-        msg = "批量导入成功!";
-        return msg;
-    }
-
-}

+ 37 - 38
src/main/java/com/zglc/kg/utils/DocToPdf.java

@@ -1,7 +1,6 @@
 package com.zglc.kg.utils;
 
 import com.aspose.words.*;
-import com.zglc.kg.entity.StatisticEntity;
 
 import java.io.File;
 import java.io.InputStream;
@@ -15,43 +14,43 @@ public class DocToPdf {
         GetDoccatalogue("d:\\test.docx");
     }
 */
-    public static List<StatisticEntity> GetDoccatalogue(String filePath) throws Exception {
-        List<StatisticEntity> lst = new ArrayList<>();
-        Document document = new Document(filePath);
-        String tmp,txt,lastTmp;
-        String title = "";
-        tmp = "";
-        lastTmp = "";
-        int index ;
-        for(Object object: (Iterable)document.getChildNodes(NodeType.FIELD_START, true)) {
-            FieldStart field = (FieldStart )object;
-            Paragraph tocItem = (Paragraph) field.getAncestor(NodeType.PARAGRAPH);
-            if (tocItem != null) {
-                txt = tocItem.getText();
-                index = txt.indexOf("_Toc");
-                if (index <=0) continue;
-                tmp = txt.substring(index,txt.indexOf(" ",index));
-                if (tmp .compareTo( lastTmp)==0) continue;
-                lastTmp = tmp;
-                index = txt.indexOf("HYPERLINK");
-                index = txt.indexOf("\u0014",index);
-                title = txt.substring(index + 1,txt.indexOf("\t",index));
-                index = txt.indexOf("PAGEREF");
-                index = txt.indexOf("\u0014",index);
-                tmp = txt.substring(index + 1,txt.indexOf("\u0015",index));
-                StatisticEntity statisticEntity = new StatisticEntity();
-                statisticEntity.setParentName(title);
-                statisticEntity.setRecordCount(Integer.parseInt(tmp));
-                lst.add(statisticEntity);
-                System.out.println(title + "  :" + tmp);
-               /*for (Run run : tocItem.getRuns()) {
-                    System.out.println(run.getText());
-                }*/
-
-            }
-        }
-        return lst;
-    }
+//    public static List<StatisticEntity> GetDoccatalogue(String filePath) throws Exception {
+//        List<StatisticEntity> lst = new ArrayList<>();
+//        Document document = new Document(filePath);
+//        String tmp,txt,lastTmp;
+//        String title = "";
+//        tmp = "";
+//        lastTmp = "";
+//        int index ;
+//        for(Object object: (Iterable)document.getChildNodes(NodeType.FIELD_START, true)) {
+//            FieldStart field = (FieldStart )object;
+//            Paragraph tocItem = (Paragraph) field.getAncestor(NodeType.PARAGRAPH);
+//            if (tocItem != null) {
+//                txt = tocItem.getText();
+//                index = txt.indexOf("_Toc");
+//                if (index <=0) continue;
+//                tmp = txt.substring(index,txt.indexOf(" ",index));
+//                if (tmp .compareTo( lastTmp)==0) continue;
+//                lastTmp = tmp;
+//                index = txt.indexOf("HYPERLINK");
+//                index = txt.indexOf("\u0014",index);
+//                title = txt.substring(index + 1,txt.indexOf("\t",index));
+//                index = txt.indexOf("PAGEREF");
+//                index = txt.indexOf("\u0014",index);
+//                tmp = txt.substring(index + 1,txt.indexOf("\u0015",index));
+//                StatisticEntity statisticEntity = new StatisticEntity();
+//                statisticEntity.setParentName(title);
+//                statisticEntity.setRecordCount(Integer.parseInt(tmp));
+//                lst.add(statisticEntity);
+//                System.out.println(title + "  :" + tmp);
+//               /*for (Run run : tocItem.getRuns()) {
+//                    System.out.println(run.getText());
+//                }*/
+//
+//            }
+//        }
+//        return lst;
+//    }
 
     public static void loadLicense() {
         final InputStream is = DocToPdf.class.getClassLoader().getResourceAsStream("license.xml");

+ 32 - 0
src/main/java/com/zglc/kg/utils/Neo4jConfig.java

@@ -0,0 +1,32 @@
+//package com.zglc.kg.utils;
+//
+//import org.neo4j.driver.AuthTokens;
+//import org.neo4j.driver.Driver;
+//import org.neo4j.driver.GraphDatabase;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//
+//@Configuration
+//public class Neo4jConfig {
+//	@Value("${spring.neo4j.url}")
+//	private String url;
+//
+//	@Value("${spring.neo4j.username}")
+//	private String username;
+//
+//	@Value("${spring.neo4j.password}")
+//	private String password;
+//
+//	/**
+//	 * 图数据库驱动模式
+//	 *
+//	 * @return
+//	 */
+//
+//	@Bean
+//	public Driver neo4jDriver() {
+//		return GraphDatabase.driver(url, AuthTokens.basic(username, password));
+//	}
+//
+//}

+ 707 - 0
src/main/java/com/zglc/kg/utils/Neo4jUtil.java

@@ -0,0 +1,707 @@
+//package com.zglc.kg.utils;
+//
+//import com.alibaba.fastjson.JSON;
+//import org.neo4j.driver.*;
+//import org.neo4j.driver.types.Node;
+//import org.neo4j.driver.types.Path;
+//import org.neo4j.driver.types.Relationship;
+//import org.neo4j.driver.util.Pair;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Component;
+//
+//import java.lang.reflect.Field;
+//import java.util.*;
+//import java.util.Map.Entry;
+//
+//@Component
+//public class Neo4jUtil {
+//	@Autowired
+//	private Driver neo4jDriver;
+//
+//	public boolean isNeo4jOpen() {
+//		try (Session session = neo4jDriver.session()) {
+//			System.out.println("连接成功:" + session.isOpen());
+//			return session.isOpen();
+//		} catch (Exception e) {
+//
+//		}
+//		return false;
+//	}
+//
+////	public StatementResult excuteCypherSql(String cypherSql) {
+////		StatementResult result = null;
+////		try (Session session = neo4jDriver.session()) {
+////			System.out.println(cypherSql);
+////			result = session.run(cypherSql);
+////			session.close();
+////		} catch (Exception e) {
+////			throw e;
+////		}
+////		return result;
+////	}
+////
+////
+////	public HashMap<String, Object> GetEntityMap(String cypherSql) {
+////		HashMap<String, Object> rss = new HashMap<String, Object>();
+////		try {
+////			StatementResult result = excuteCypherSql(cypherSql);
+////			if (result.hasNext()) {
+////				List<Record> records = result.list();
+////				for (Record recordItem : records) {
+////					for (Value value : recordItem.values()) {
+////						if (value.type().name().equals("NODE")) {// 结果里面只要类型为节点的值
+////							Node noe4jNode = value.asNode();
+////							Map<String, Object> map = noe4jNode.asMap();
+////							for (Entry<String, Object> entry : map.entrySet()) {
+////								String key = entry.getKey();
+////								if (rss.containsKey(key)) {
+////									String oldValue = rss.get(key).toString();
+////									String newValue = oldValue + "," + entry.getValue();
+////									rss.replace(key, newValue);
+////								} else {
+////									rss.put(key, entry.getValue());
+////								}
+////							}
+////
+////						}
+////					}
+////				}
+////			}
+////
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////		return rss;
+////	}
+////
+////	public List<HashMap<String, Object>> GetGraphNode(String cypherSql) {
+////		List<HashMap<String, Object>> ents = new ArrayList<HashMap<String, Object>>();
+////		try {
+////			StatementResult result = excuteCypherSql(cypherSql);
+////			if (result.hasNext()) {
+////				List<Record> records = result.list();
+////				for (Record recordItem : records) {
+////					List<Pair<String, Value>> f = recordItem.fields();
+////					for (Pair<String, Value> pair : f) {
+////						HashMap<String, Object> rss = new HashMap<String, Object>();
+////						String typeName = pair.value().type().name();
+////						if (typeName.equals("NODE")) {
+////							Node noe4jNode = pair.value().asNode();
+////							String uuid = String.valueOf(noe4jNode.id());
+////							Map<String, Object> map = noe4jNode.asMap();
+////							for (Entry<String, Object> entry : map.entrySet()) {
+////								String key = entry.getKey();
+////								rss.put(key, entry.getValue());
+////							}
+////							rss.put("uuid", uuid);
+////							ents.add(rss);
+////						}
+////					}
+////
+////				}
+////			}
+////
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////		return ents;
+////	}
+////
+////	public List<HashMap<String, Object>> GetGraphRelationShip(String cypherSql) {
+////		List<HashMap<String, Object>> ents = new ArrayList<HashMap<String, Object>>();
+////		try {
+////			StatementResult result = excuteCypherSql(cypherSql);
+////			if (result.hasNext()) {
+////				List<Record> records = result.list();
+////				for (Record recordItem : records) {
+////					List<Pair<String, Value>> f = recordItem.fields();
+////					for (Pair<String, Value> pair : f) {
+////						HashMap<String, Object> rss = new HashMap<String, Object>();
+////						String typeName = pair.value().type().name();
+////						if (typeName.equals("RELATIONSHIP")) {
+////							Relationship rship = pair.value().asRelationship();
+////							String uuid = String.valueOf(rship.id());
+////							String sourceid = String.valueOf(rship.startNodeId());
+////							String targetid = String.valueOf(rship.endNodeId());
+////							Map<String, Object> map = rship.asMap();
+////							for (Entry<String, Object> entry : map.entrySet()) {
+////								String key = entry.getKey();
+////								rss.put(key, entry.getValue());
+////							}
+////							rss.put("uuid", uuid);
+////							rss.put("sourceid", sourceid);
+////							rss.put("targetid", targetid);
+////							ents.add(rss);
+////						}
+////					}
+////				}
+////			}
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////		return ents;
+////	}
+////	public List<HashMap<String, Object>> GetGraphItem(String cypherSql) {
+////		List<HashMap<String, Object>> ents = new ArrayList<HashMap<String, Object>>();
+////		List<String> nodeids = new ArrayList<String>();
+////		List<String> shipids = new ArrayList<String>();
+////		try {
+////			StatementResult result = excuteCypherSql(cypherSql);
+////			if (result.hasNext()) {
+////				List<Record> records = result.list();
+////				for (Record recordItem : records) {
+////					List<Pair<String, Value>> f = recordItem.fields();
+////					HashMap<String, Object> rss = new HashMap<String, Object>();
+////					for (Pair<String, Value> pair : f) {
+////						String typeName = pair.value().type().name();
+////						if (typeName.equals("NODE")) {
+////							Node noe4jNode = pair.value().asNode();
+////							String uuid = String.valueOf(noe4jNode.id());
+////							if(!nodeids.contains(uuid)) {
+////								Map<String, Object> map = noe4jNode.asMap();
+////								for (Entry<String, Object> entry : map.entrySet()) {
+////									String key = entry.getKey();
+////									rss.put(key, entry.getValue());
+////								}
+////								rss.put("uuid", uuid);
+////							}
+////						}else if (typeName.equals("RELATIONSHIP")) {
+////							Relationship rship = pair.value().asRelationship();
+////							String uuid = String.valueOf(rship.id());
+////							if (!shipids.contains(uuid)) {
+////								String sourceid = String.valueOf(rship.startNodeId());
+////								String targetid = String.valueOf(rship.endNodeId());
+////								Map<String, Object> map = rship.asMap();
+////								for (Entry<String, Object> entry : map.entrySet()) {
+////									String key = entry.getKey();
+////									rss.put(key, entry.getValue());
+////								}
+////								rss.put("uuid", uuid);
+////								rss.put("sourceid", sourceid);
+////								rss.put("targetid", targetid);
+////							}
+////						}else {
+////							rss.put(pair.key(),pair.value().toString());
+////						}
+////					}
+////					ents.add(rss);
+////				}
+////			}
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////		return ents;
+////	}
+////	/*
+////	 * 获取值类型的结果,如count,uuid
+////	 * @return 1 2 3 等数字类型
+////	 */
+////	public long GetGraphValue(String cypherSql) {
+////		long val=0;
+////		try {
+////			StatementResult cypherResult = excuteCypherSql(cypherSql);
+////			if (cypherResult.hasNext()) {
+////				Record record = cypherResult.next();
+////				for (Value value : record.values()) {
+////					val = value.asLong();
+////				}
+////			}
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////		return val;
+////	}
+////
+////	public HashMap<String, Object> GetGraphNodeAndShip(String cypherSql) {
+////		HashMap<String, Object> mo = new HashMap<String, Object>();
+////		try {
+////			StatementResult result = excuteCypherSql(cypherSql);
+////			if (result.hasNext()) {
+////				List<Record> records = result.list();
+////				List<HashMap<String, Object>> ents = new ArrayList<HashMap<String, Object>>();
+////				List<HashMap<String, Object>> ships = new ArrayList<HashMap<String, Object>>();
+////				List<String> uuids = new ArrayList<String>();
+////				List<String> shipids = new ArrayList<String>();
+////				for (Record recordItem : records) {
+////					List<Pair<String, Value>> f = recordItem.fields();
+////					for (Pair<String, Value> pair : f) {
+////						HashMap<String, Object> rships = new HashMap<String, Object>();
+////						HashMap<String, Object> rss = new HashMap<String, Object>();
+////						String typeName = pair.value().type().name();
+////						if (typeName.equals("NULL")) {
+////							continue;
+////						} else if (typeName.equals("NODE")) {
+////							Node noe4jNode = pair.value().asNode();
+////                            Map<String, Object> map = noe4jNode.asMap();
+////                            String uuid = String.valueOf(noe4jNode.id());
+////                            if (!uuids.contains(uuid)) {
+////                                for (Entry<String, Object> entry : map.entrySet()) {
+////                                    String key = entry.getKey();
+////                                    rss.put(key, entry.getValue());
+////                                }
+////                                rss.put("uuid", uuid);
+////                                uuids.add(uuid);
+////                            }
+////                            if (rss != null && !rss.isEmpty()) {
+////                                ents.add(rss);
+////                            }
+////						} else if (typeName.equals("RELATIONSHIP")) {
+////							Relationship rship = pair.value().asRelationship();
+////                            String uuid = String.valueOf(rship.id());
+////                            if (!shipids.contains(uuid)) {
+////                                String sourceid = String.valueOf(rship.startNodeId());
+////                                String targetid = String.valueOf(rship.endNodeId());
+////                                Map<String, Object> map = rship.asMap();
+////                                for (Entry<String, Object> entry : map.entrySet()) {
+////                                    String key = entry.getKey();
+////                                    rships.put(key, entry.getValue());
+////                                }
+////                                rships.put("uuid", uuid);
+////                                rships.put("sourceid", sourceid);
+////                                rships.put("targetid", targetid);
+////								shipids.add(uuid);
+////                                if (rships != null && !rships.isEmpty()) {
+////                                    ships.add(rships);
+////                                }
+////                            }
+////
+////						} else if (typeName.equals("PATH")) {
+////							Path path = pair.value().asPath();
+////							Map<String, Object> startNodemap = path.start().asMap();
+////							String startNodeuuid = String.valueOf(path.start().id());
+////							if (!uuids.contains(startNodeuuid)) {
+////								rss=new HashMap<String, Object>();
+////								for (Entry<String, Object> entry : startNodemap.entrySet()) {
+////									String key = entry.getKey();
+////									rss.put(key, entry.getValue());
+////								}
+////								rss.put("uuid", startNodeuuid);
+////								uuids.add(startNodeuuid);
+////								if (rss != null && !rss.isEmpty()) {
+////									ents.add(rss);
+////								}
+////							}
+////
+////							Map<String, Object> endNodemap = path.end().asMap();
+////							String endNodeuuid = String.valueOf(path.end().id());
+////							if (!uuids.contains(endNodeuuid)) {
+////								rss=new HashMap<String, Object>();
+////								for (Entry<String, Object> entry : endNodemap.entrySet()) {
+////									String key = entry.getKey();
+////									rss.put(key, entry.getValue());
+////								}
+////								rss.put("uuid", endNodeuuid);
+////								uuids.add(endNodeuuid);
+////								if (rss != null && !rss.isEmpty()) {
+////									ents.add(rss);
+////								}
+////							}
+////							Iterator<Node> allNodes = path.nodes().iterator();
+////							while (allNodes.hasNext()) {
+////								Node next = allNodes.next();
+////								String uuid = String.valueOf(next.id());
+////								if (!uuids.contains(uuid)) {
+////									rss=new HashMap<String, Object>();
+////									Map<String, Object> map = next.asMap();
+////									for (Entry<String, Object> entry : map.entrySet()) {
+////										String key = entry.getKey();
+////										rss.put(key, entry.getValue());
+////									}
+////									rss.put("uuid", uuid);
+////									uuids.add(uuid);
+////									if (rss != null && !rss.isEmpty()) {
+////										ents.add(rss);
+////									}
+////								}
+////							}
+////							Iterator<Relationship> reships = path.relationships().iterator();
+////							while (reships.hasNext()) {
+////								Relationship next = reships.next();
+////								String uuid = String.valueOf(next.id());
+////								if (!shipids.contains(uuid)) {
+////									rships=new HashMap<String, Object>();
+////									String sourceid = String.valueOf(next.startNodeId());
+////									String targetid = String.valueOf(next.endNodeId());
+////									Map<String, Object> map = next.asMap();
+////									for (Entry<String, Object> entry : map.entrySet()) {
+////										String key = entry.getKey();
+////										rships.put(key, entry.getValue());
+////									}
+////									rships.put("uuid", uuid);
+////									rships.put("sourceid", sourceid);
+////									rships.put("targetid", targetid);
+////									shipids.add(uuid);
+////									if (rships != null && !rships.isEmpty()) {
+////										ships.add(rships);
+////									}
+////								}
+////							}
+////						} else if (typeName.contains("LIST")) {
+////							Iterable<Value> val=pair.value().values();
+////                            Value next = val.iterator().next();
+////                            String type=next.type().name();
+////                            if (type.equals("RELATIONSHIP")) {
+////                                Relationship rship = next.asRelationship();
+////                                String uuid = String.valueOf(rship.id());
+////                                if (!shipids.contains(uuid)) {
+////                                    String sourceid = String.valueOf(rship.startNodeId());
+////                                    String targetid = String.valueOf(rship.endNodeId());
+////                                    Map<String, Object> map = rship.asMap();
+////                                    for (Entry<String, Object> entry : map.entrySet()) {
+////                                        String key = entry.getKey();
+////                                        rships.put(key, entry.getValue());
+////                                    }
+////                                    rships.put("uuid", uuid);
+////                                    rships.put("sourceid", sourceid);
+////                                    rships.put("targetid", targetid);
+////									shipids.add(uuid);
+////                                    if (rships != null && !rships.isEmpty()) {
+////                                        ships.add(rships);
+////                                    }
+////                                }
+////                            }
+////						} else if (typeName.contains("MAP")) {
+////							rss.put(pair.key(), pair.value().asMap());
+////						} else {
+////							rss.put(pair.key(), pair.value().toString());
+////                            if (rss != null && !rss.isEmpty()) {
+////                                ents.add(rss);
+////                            }
+////						}
+////
+////					}
+////				}
+////				mo.put("node", ents);
+////				mo.put("relationship", ships);
+////			}
+////
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////			throw e;
+////		}
+////		return mo;
+////	}
+////	/**
+////	 * 匹配所有类型的节点,可以是节点,关系,数值,路径
+////	 * @param cypherSql
+////	 * @return
+////	 */
+////	public List<HashMap<String, Object>> GetEntityList(String cypherSql) {
+////		List<HashMap<String, Object>> ents = new ArrayList<HashMap<String, Object>>();
+////		try {
+////			StatementResult result = excuteCypherSql(cypherSql);
+////			if (result.hasNext()) {
+////				List<Record> records = result.list();
+////				for (Record recordItem : records) {
+////					HashMap<String, Object> rss = new HashMap<String, Object>();
+////					List<Pair<String, Value>> f = recordItem.fields();
+////					for (Pair<String, Value> pair : f) {
+////						String typeName = pair.value().type().name();
+////						if (typeName.equals("NULL")) {
+////							continue;
+////						} else if (typeName.equals("NODE")) {
+////							Node noe4jNode = pair.value().asNode();
+////							Map<String, Object> map = noe4jNode.asMap();
+////							for (Entry<String, Object> entry : map.entrySet()) {
+////								String key = entry.getKey();
+////								rss.put(key, entry.getValue());
+////							}
+////						} else if (typeName.equals("RELATIONSHIP")) {
+////							Relationship rship = pair.value().asRelationship();
+////							Map<String, Object> map = rship.asMap();
+////							for (Entry<String, Object> entry : map.entrySet()) {
+////								String key = entry.getKey();
+////								rss.put(key, entry.getValue());
+////							}
+////						} else if (typeName.equals("PATH")) {
+////
+////						} else if (typeName.contains("LIST")) {
+////							rss.put(pair.key(), pair.value().asList());
+////						} else if (typeName.contains("MAP")) {
+////							rss.put(pair.key(), pair.value().asMap());
+////						} else {
+////							rss.put(pair.key(), pair.value().toString());
+////						}
+////					}
+////					ents.add(rss);
+////				}
+////			}
+////
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////		return ents;
+////	}
+////
+////	public <T> List<T> GetEntityItemList(String cypherSql, Class<T> type) {
+////		List<HashMap<String, Object>> ents=GetGraphNode(cypherSql);
+////		List<T> model = HashMapToObject(ents, type);
+////		return model;
+////	}
+////
+////	public <T> T GetEntityItem(String cypherSql, Class<T> type) {
+////		HashMap<String, Object> rss = new HashMap<String, Object>();
+////		try {
+////			StatementResult result = excuteCypherSql(cypherSql);
+////			if (result.hasNext()) {
+////				Record record = result.next();
+////				for (Value value : record.values()) {
+////					if (value.type().name().equals("NODE")) {// 结果里面只要类型为节点的值
+////						Node noe4jNode = value.asNode();
+////						Map<String, Object> map = noe4jNode.asMap();
+////						for (Entry<String, Object> entry : map.entrySet()) {
+////							String key = entry.getKey();
+////							if (rss.containsKey(key)) {
+////								String oldValue = rss.get(key).toString();
+////								String newValue = oldValue + "," + entry.getValue();
+////								rss.replace(key, newValue);
+////							} else {
+////								rss.put(key, entry.getValue());
+////							}
+////						}
+////
+////					}
+////				}
+////			}
+////
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////		T model = HashMapToObjectItem(rss, type);
+////		return model;
+////	}
+////
+////	public HashMap<String, Object> GetEntity(String cypherSql) {
+////		HashMap<String, Object> rss = new HashMap<String, Object>();
+////		try {
+////			StatementResult result = excuteCypherSql(cypherSql);
+////			if (result.hasNext()) {
+////				Record record = result.next();
+////				for (Value value : record.values()) {
+////					String t = value.type().name();
+////					if (value.type().name().equals("NODE")) {// 结果里面只要类型为节点的值
+////						Node noe4jNode = value.asNode();
+////						Map<String, Object> map = noe4jNode.asMap();
+////						for (Entry<String, Object> entry : map.entrySet()) {
+////							String key = entry.getKey();
+////							if (rss.containsKey(key)) {
+////								String oldValue = rss.get(key).toString();
+////								String newValue = oldValue + "," + entry.getValue();
+////								rss.replace(key, newValue);
+////							} else {
+////								rss.put(key, entry.getValue());
+////							}
+////						}
+////
+////					}
+////				}
+////			}
+////
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////		return rss;
+////	}
+////
+////	public Integer executeScalar(String cypherSql) {
+////		Integer count = 0;
+////		try {
+////			StatementResult result = excuteCypherSql(cypherSql);
+////			if (result.hasNext()) {
+////				Record record = result.next();
+////				for (Value value : record.values()) {
+////					String t = value.type().name();
+////					if (t.equals("INTEGER")) {
+////						count = Integer.valueOf(value.toString());
+////						break;
+////					}
+////				}
+////			}
+////
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////		return count;
+////	}
+////
+////	public HashMap<String, Object> GetRelevantEntity(String cypherSql) {
+////		HashMap<String, Object> rss = new HashMap<String, Object>();
+////		try {
+////			StatementResult resultNode = excuteCypherSql(cypherSql);
+////			if (resultNode.hasNext()) {
+////				List<Record> records = resultNode.list();
+////				for (Record recordItem : records) {
+////					Map<String, Object> r = recordItem.asMap();
+////					System.out.println(JSON.toJSONString(r));
+////					String key = r.get("key").toString();
+////					if (rss.containsKey(key)) {
+////						String oldValue = rss.get(key).toString();
+////						String newValue = oldValue + "," + r.get("value");
+////						rss.replace(key, newValue);
+////					} else {
+////						rss.put(key, r.get("value"));
+////					}
+////				}
+////			}
+////
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////		}
+////		return rss;
+////	}
+////
+////
+////
+////	public String getFilterPropertiesJson(String jsonStr) {
+////		String propertiesString = jsonStr.replaceAll("\"(\\w+)\"(\\s*:\\s*)", "$1$2"); // 去掉key的引号
+////		return propertiesString;
+////	}
+////	public <T>String getkeyvalCyphersql(T obj) {
+////		 Map<String, Object> map = new HashMap<String, Object>();
+////		 List<String> sqlList=new ArrayList<String>();
+////	        // 得到类对象
+////	        Class userCla = obj.getClass();
+////	        /* 得到类中的所有属性集合 */
+////	        Field[] fs = userCla.getDeclaredFields();
+////	        for (int i = 0; i < fs.length; i++) {
+////	            Field f = fs[i];
+////	            Class type = f.getType();
+////
+////	            f.setAccessible(true); // 设置些属性是可以访问的
+////	            Object val = new Object();
+////	            try {
+////	                val = f.get(obj);
+////	                if(val==null) {
+////	                	val="";
+////	                }
+////	                String sql="";
+////	                String key=f.getName();
+////	                System.out.println("key:"+key+"type:"+type);
+////	                if ( val instanceof   Integer ){
+////	                	// 得到此属性的值
+////		                map.put(key, val);// 设置键值
+////		                sql="n."+key+"="+val;
+////	    			}
+////	                else if ( val instanceof   String[] ){
+////	    				//如果为true则强转成String数组
+////	    				String [] arr = ( String[] ) val ;
+////	    				String v="";
+////	    				for ( int j = 0 ; j < arr.length ; j++ ){
+////	    					arr[j]="'"+ arr[j]+"'";
+////	    				}
+////	    				v=String.join(",", arr);
+////	    				sql="n."+key+"=["+val+"]";
+////	    			}
+////	                else if (val instanceof List){
+////	    				//如果为true则强转成String数组
+////	                	List<String> arr = ( ArrayList<String> ) val ;
+////	                	List<String> aa=new ArrayList<String>();
+////	    				String v="";
+////	    				for (String s : arr) {
+////	    					s="'"+ s+"'";
+////	    					aa.add(s);
+////						}
+////	    				v=String.join(",", aa);
+////	    				sql="n."+key+"=["+v+"]";
+////	    			}
+////	                else {
+////	                	// 得到此属性的值
+////		                map.put(key, val);// 设置键值
+////		                sql="n."+key+"='"+val+"'";
+////	                }
+////
+////	                sqlList.add(sql);
+////	            } catch (IllegalArgumentException e) {
+////	                e.printStackTrace();
+////	            } catch (IllegalAccessException e) {
+////	                e.printStackTrace();
+////	            }
+////	        }
+////	        String finasql=String.join(",",sqlList);
+////	        System.out.println("单个对象的所有键值==反射==" + map.toString());
+////		return finasql;
+////	}
+////	public <T> List<T> HashMapToObject(List<HashMap<String, Object>> maps, Class<T> type) {
+////		try {
+////			List<T> list = new ArrayList<T>();
+////			for (HashMap<String, Object> r : maps) {
+////				T t = type.newInstance();
+////				Iterator iter = r.entrySet().iterator();// 该方法获取列名.获取一系列字段名称.例如name,age...
+////				while (iter.hasNext()) {
+////					Entry entry = (Entry) iter.next();// 把hashmap转成Iterator再迭代到entry
+////					String key = entry.getKey().toString(); // 从iterator遍历获取key
+////					Object value = entry.getValue(); // 从hashmap遍历获取value
+////					if("serialVersionUID".toLowerCase().equals(key.toLowerCase()))continue;
+////					Field field = type.getDeclaredField(key);// 获取field对象
+////					if (field != null) {
+////						field.setAccessible(true);
+////						if (field.getType() == int.class || field.getType() == Integer.class) {
+////							if (value==null||StringUtil.isBlank(value.toString())) {
+////								field.set(t, 0);// 设置值
+////							} else {
+////								field.set(t, Integer.parseInt(value.toString()));// 设置值
+////							}
+////						}
+////						 else if (field.getType() == long.class||field.getType() == Long.class ) {
+////								if (value==null||StringUtil.isBlank(value.toString())) {
+////									field.set(t, 0);// 设置值
+////								} else {
+////									field.set(t, Long.parseLong(value.toString()));// 设置值
+////								}
+////
+////						}
+////						 else {
+////							field.set(t, value);// 设置值
+////						}
+////					}
+////
+////				}
+////				list.add(t);
+////			}
+////
+////			return list;
+////		} catch (Exception e) {
+////			throw new RuntimeException(e);
+////		}
+////	}
+////
+////	public <T> T HashMapToObjectItem(HashMap<String, Object> map, Class<T> type) {
+////		try {
+////			T t = type.newInstance();
+////			Iterator iter = map.entrySet().iterator();
+////			while (iter.hasNext()) {
+////				Entry entry = (Entry) iter.next();// 把hashmap转成Iterator再迭代到entry
+////				String key = entry.getKey().toString(); // 从iterator遍历获取key
+////				Object value = entry.getValue(); // 从hashmap遍历获取value
+////				if("serialVersionUID".toLowerCase().equals(key.toLowerCase()))continue;
+////				Field field = type.getDeclaredField(key);// 获取field对象
+////				if (field != null) {
+////					field.setAccessible(true);
+////					if (field.getType() == int.class || field.getType() == Integer.class) {
+////						if (value==null||StringUtil.isBlank(value.toString())) {
+////							field.set(t, 0);// 设置值
+////						} else {
+////							field.set(t, Integer.parseInt(value.toString()));// 设置值
+////						}
+////					}
+////					 else if (field.getType() == long.class||field.getType() == Long.class ) {
+////							if (value==null||StringUtil.isBlank(value.toString())) {
+////								field.set(t, 0);// 设置值
+////							} else {
+////								field.set(t, Long.parseLong(value.toString()));// 设置值
+////							}
+////
+////					}
+////					 else {
+////						field.set(t, value);// 设置值
+////					}
+////				}
+////
+////			}
+////
+////			return t;
+////		} catch (Exception e) {
+////			throw new RuntimeException(e);
+////		}
+////	}
+//}

+ 0 - 7
src/main/resources/mapping/RepairManualDao.xml

@@ -45,13 +45,6 @@
         select * from (select * from t_repair_manual where manual_name like #{name1} ) as a where manual_name like #{name2}
     </select>
 
-    <select id="findByFault" parameterType="com.zglc.kg.entity.FaultFind" resultMap="userMap">
-        select * from t_repair_manual
-        where 1=1
-        <if test="faultName != null">
-            and manual_name like (CONCAT(CONCAT('%',#{faultName}),'%'))
-        </if>
-    </select>
 
     <select id="findByHmc" parameterType="String" resultMap="userMap">
             select *  from t_repair_manual where  hmc like #{name}

+ 0 - 52
src/main/resources/mapping/TechnicalTermDao.xml

@@ -1,52 +0,0 @@
-<?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.zglc.kg.dao.TechnicalTermDao">
-
-	<!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="com.zglc.kg.entity.TechnicalTermEntity" id="termMap">
-        <result property="id" column="id"/>
-        <result property="cn_name" column="cn_name"/>
-        <result property="eng_name" column="eng_name"/>
-        <result property="content" column="content"/>
-        <result property="remarks" column="remarks"/>
-    </resultMap>
-
-    <select id="listAll" resultMap="termMap">
-        select id,cn_name,eng_name,content,remarks
-        from t_technicalterm
-        where id > 0
-    </select>
-
-    <select id="getCount" resultType="java.lang.Integer">
-        select count(1)
-        from t_technicalterm
-        where id > 1
-    </select>
-
-<!--    <insert id="batchAdd" parameterType="java.util.List">-->
-<!--        <foreach collection="list" item="equ" separator=";">-->
-<!--            insert into t_equipment (equipment_type)-->
-<!--            SELECT #{equ.equipment_type}-->
-<!--            FROM DUAL WHERE NOT EXISTS (SELECT equipment_type FROM  t_equipment WHERE equipment_type = #{equ.equipment_type})-->
-<!--        </foreach>-->
-<!--    </insert>-->
-
-    <select id="findByCnName" parameterType="String" resultMap="termMap">
-        select id,cn_name,eng_name,content,remarks from t_technicalterm where cn_name
-        like #{name}
-    </select>
-
-    <select id="findByEngName" parameterType="String" resultMap="termMap">
-        select id,cn_name,eng_name,content,remarks from t_technicalterm where eng_name
-        like #{name}
-    </select>
-
-    <insert id="addBatch" parameterType="java.util.ArrayList">
-        insert into t_technicalterm (cn_name,eng_name,content,remarks) values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.cn_name},#{item.eng_name},#{item.content},#{item.remarks})
-        </foreach>
-    </insert>
-
-</mapper>

BIN
target/classes/com/zglc/kg/conf/Swagger2Config.class


BIN
target/classes/com/zglc/kg/controller/ArticleController.class


BIN
target/classes/com/zglc/kg/controller/CommonController.class


BIN
target/classes/com/zglc/kg/controller/EquipmentController.class


BIN
target/classes/com/zglc/kg/controller/FaultRecordController.class


BIN
target/classes/com/zglc/kg/controller/MovieController.class


BIN
target/classes/com/zglc/kg/controller/RepairManualController.class


BIN
target/classes/com/zglc/kg/controller/TechnicalTermController.class


BIN
target/classes/com/zglc/kg/dao/ArticleDao.class


BIN
target/classes/com/zglc/kg/dao/EquipmentDao.class


BIN
target/classes/com/zglc/kg/dao/FaultRecordDao.class


BIN
target/classes/com/zglc/kg/dao/IntValueDao.class


BIN
target/classes/com/zglc/kg/dao/RepairManualDao.class


BIN
target/classes/com/zglc/kg/dao/TechnicalTermDao.class


BIN
target/classes/com/zglc/kg/entity/AircraftEntity.class


BIN
target/classes/com/zglc/kg/entity/ArticleEntity.class


BIN
target/classes/com/zglc/kg/entity/ArticleFind.class


BIN
target/classes/com/zglc/kg/entity/EquipmentEntity.class


BIN
target/classes/com/zglc/kg/entity/FaultFind.class


BIN
target/classes/com/zglc/kg/entity/FaultRecordEntity.class


BIN
target/classes/com/zglc/kg/entity/FaultRecordStatistics.class


BIN
target/classes/com/zglc/kg/entity/IntValue.class


BIN
target/classes/com/zglc/kg/entity/LogicSearchEntity.class


BIN
target/classes/com/zglc/kg/entity/SingleStaEntity.class


BIN
target/classes/com/zglc/kg/entity/SingleStaResultEntity.class


BIN
target/classes/com/zglc/kg/entity/StatisticEntity.class


BIN
target/classes/com/zglc/kg/entity/TechnicalTermEntity.class


BIN
target/classes/com/zglc/kg/schedule/ScheduleTasks.class


BIN
target/classes/com/zglc/kg/service/ArticleService.class


BIN
target/classes/com/zglc/kg/service/CommonService.class


BIN
target/classes/com/zglc/kg/service/EquipmentService.class


BIN
target/classes/com/zglc/kg/service/FaultRecordService.class


BIN
target/classes/com/zglc/kg/service/RepairManualService.class


BIN
target/classes/com/zglc/kg/service/TechnicalTermService.class


BIN
target/classes/com/zglc/kg/utils/DocToPdf.class


+ 8 - 11
target/classes/mapping/AircraftDao.xml

@@ -4,27 +4,24 @@
 <mapper namespace="com.zglc.kg.dao.AircraftDao">
 
     <!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="com.zglc.kg.entity.AircraftEntity" id="userMap">
+    <resultMap type="com.zglc.kg.entity.AircraftEntity" id="aircraftMap">
         <result property="id" column="id"/>
         <result property="aircraft_type" column="aircraft_type"/>
-        <result property="aircraft_descripte" column="aircraft_descripte"/>
-        <result property="ending_time" column="ending_time"/>
-        <result property="input_time" column="input_time"/>
-        <result property="file_path" column="file_path"/>
+        <result property="aircraft_describe" column="aircraft_describe"/>
     </resultMap>
 
     <insert id="addNotExist" parameterType="com.zglc.kg.entity.AircraftEntity">
-        INSERT INTO t_aircraft (aircraft_type, aircraft_descripte, ending_time, input_time, file_path)
-        SELECT #{aircraft_type},#{aircraft_descripte},#{ending_time},#{input_time},#{file_path}
+        INSERT INTO t_aircraft (aircraft_type,aircraft_describe)
+        SELECT #{aircraft_type},#{aircraft_describe}
         FROM DUAL WHERE NOT EXISTS (SELECT id FROM t_aircraft WHERE t_aircraft.aircraft_type = #{aircraft_type})
     </insert>
 
-    <select id="findByName" parameterType="String" resultMap="userMap">
-        select  id, aircraft_type, aircraft_descripte, ending_time, input_time, file_path from t_aircraft
+    <select id="findByName" parameterType="String" resultMap="aircraftMap">
+        select  * from t_aircraft
         where aircraft_type like #{name}
     </select>
-    <select id="listAll" resultMap="userMap">
-        select  id, aircraft_type, aircraft_descripte, ending_time, input_time, file_path from t_aircraft
+    <select id="listAll" resultMap="aircraftMap">
+        select  * from t_aircraft
     </select>
 
     <select id="findMinId" resultType="Integer">

+ 0 - 83
target/classes/mapping/ArticleDao.xml

@@ -1,83 +0,0 @@
-<?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.zglc.kg.dao.ArticleDao">
-
-    <!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="com.zglc.kg.entity.ArticleEntity" id="article">
-        <result property="id" column="id"/>
-        <result property="title" column="title"/>
-        <result property="author" column="author"/>
-        <result property="input_time" column="input_time"/>
-        <result property="keywords" column="keywords"/>
-        <result property="aircraft" column="aircraft"/>
-        <result property="aircraft_system" column="aircraft_system"/>
-        <result property="article_number" column="article_number"/>
-        <result property="major_name" column="major_name"/>
-        <result property="article_type" column="article_type"/>
-        <result property="file_path" column="file_path"/>
-        <result property="hmc" column="hmc"/>
-        <result property="mfl" column="mfl"/>
-        <result property="pfl" column="pfl"/>
-        <result property="gmp" column="gmp"/>
-    </resultMap>
-
-    <select id="find" parameterType="com.zglc.kg.entity.ArticleFind" resultMap="article">
-        select * from t_article where 1=1
-        <if test="userName != null">
-            and author like (CONCAT(CONCAT('%',#{userName}),'%'))
-        </if>
-        <if test="keyword != null">
-            and keywords like (CONCAT(CONCAT('%',#{keyword}),'%'))
-        </if>
-<!--        <if test="startTime != null">-->
-<!--            and input_time <![CDATA[>=]]> #{startTime}-->
-<!--        </if>-->
-<!--        <if test="endTime != null">-->
-<!--            and input_time <![CDATA[<=]]> {endTime}-->
-<!--        </if>-->
-    </select>
-
-    <select id="find1" parameterType="com.zglc.kg.entity.ArticleFind" resultMap="article">
-        select * from t_article where 1=1
-        <if test="userName != null">
-            and author like (CONCAT(CONCAT('%',#{userName}),'%'))
-        </if>
-        <if test="keyword != null">
-            and title like (CONCAT(CONCAT('%',#{keyword}),'%'))
-        </if>
-
-    </select>
-
-    <select id="findByName" parameterType="String" resultMap="article">
-        select * from t_article where title like #{name}
-    </select>
-
-    <select id="refindByName" parameterType="String" resultMap="article">
-        select * from (select * from t_article where title like #{name1} ) as a where title like #{name2}
-    </select>
-
-    <select id="multFind" parameterType="com.zglc.kg.entity.ArticleFind" resultMap="article">
-        select * from (select * from t_article where )
-        <if test="userName != null">
-            and author like (CONCAT(CONCAT('%',#{userName}),'%'))
-        </if>
-        <if test="keyword != null">
-            and keywords like (CONCAT(CONCAT('%',#{keyword}),'%'))
-        </if>
-
-    </select>
-
-    <insert id="add" parameterType="com.zglc.kg.entity.ArticleEntity">
-        insert into t_article (title,author,input_time,keywords,aircraft,aircraft_system,article_number,major_name,article_type,file_path,hmc,mfl,pfl,gmp) values
-        (#{title},#{author},#{input_time},#{keywords},#{aircraft},#{aircraft_system},#{article_number},#{major_name},#{article_type},#{file_path},#{item.hmc},#{item.mfl},#{item.pfl},#{item.gmp})
-    </insert>
-
-    <insert id="addBatch" parameterType="java.util.ArrayList">
-        insert into t_article(title,author,input_time,keywords,aircraft,aircraft_system,article_number,major_name,article_type,file_path,hmc,mfl,pfl,gmp) values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.title},#{item.author},#{item.input_time},#{item.keywords},#{item.aircraft},#{item.aircraft_system},#{item.article_number},#{item.major_name},#{item.article_type},#{item.file_path},#{item.hmc},#{item.mfl},#{item.pfl},#{item.gmp})
-        </foreach>
-    </insert>
-
-</mapper>

+ 0 - 41
target/classes/mapping/EquipmentDao.xml

@@ -1,41 +0,0 @@
-<?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.zglc.kg.dao.EquipmentDao">
-
-	<!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="com.zglc.kg.entity.EquipmentEntity" id="userMap">
-        <result property="id" column="id"/>
-        <result property="equipment_name" column="equipment_name"/>
-        <result property="equipment_type" column="equipment_type"/>
-        <result property="equipment_time" column="equipment_time"/>
-        <result property="retirement_time" column="retirement_time"/>
-        <result property="mark" column="mark"/>
-    </resultMap>
-
-    <select id="listAll" resultMap="userMap">
-        select id,equipment_name,equipment_type,equipment_time,retirement_time,mark
-        from t_equipment
-        where id > 1
-    </select>
-
-    <select id="getCount" resultType="java.lang.Integer">
-        select count(1)
-        from t_equipment
-        where id > 1
-    </select>
-
-    <insert id="batchAdd" parameterType="java.util.List">
-        <foreach collection="list" item="equ" separator=";">
-            insert into t_equipment (equipment_type)
-            SELECT #{equ.equipment_type}
-            FROM DUAL WHERE NOT EXISTS (SELECT equipment_type FROM  t_equipment WHERE equipment_type = #{equ.equipment_type})
-        </foreach>
-    </insert>
-
-    <select id="findByName" parameterType="String" resultMap="userMap">
-        select id,equipment_name,equipment_type, equipment_time, retirement_time,mark from t_equipment where equipment_type
-        like #{name}
-    </select>
-
-</mapper>

+ 0 - 247
target/classes/mapping/FaultRecordDao.xml

@@ -1,247 +0,0 @@
-<?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.zglc.kg.dao.FaultRecordDao">
-
-	<!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="com.zglc.kg.entity.FaultRecordEntity" id="userMap">
-        <result property="id" column="id"/>
-        <result property="equipment_id" column="equipment_id"/>
-        <result property="equipment_name" column="equipment_name"/>
-        <result property="device_id" column="device_id"/>
-        <result property="device_name" column="device_name"/>
-        <result property="fault_content" column="fault_content"/>
-        <result property="repair_method" column="repair_method"/>
-        <result property="fault_time" column="fault_time"/>
-        <result property="repaired_time" column="repaired_time"/>
-        <result property="fault_status" column="fault_status"/>
-        <result property="major" column="major"/>
-        <result property="faultparts_system" column="faultparts_system"/>
-        <result property="is_error" column="is_error"/>
-        <result property="discover_opportunity" column="discover_opportunity"/>
-        <result property="mark" column="mark"/>
-    </resultMap>
-
-    <resultMap type="com.zglc.kg.entity.StatisticEntity" id="staMap">
-        <result property="parentName" column="parentName"/>
-        <result property="recordCount" column="recordCount"/>
-    </resultMap>
-
-    <select id="listAll" resultMap="userMap">
-        select *
-        from t_faultrecord
-        where id > 1
-    </select>
-
-    <select id="getCount" resultType="java.lang.Integer">
-        select count(1)
-        from t_faultrecord
-        where id > 1
-    </select>
-
-    <select id="findByName" parameterType="String" resultMap="userMap">
-            select *  from t_faultrecord where  device_name like #{name}
-    </select>
-
-    <select id="refindByName" parameterType="String" resultMap="userMap">
-        select * from (select * from t_faultrecord where device_name like #{name1} ) as a where device_name like #{name2}
-    </select>
-
-    <select id="statistics" parameterType="java.util.Map" resultType="Integer">
-        select count(1) from t_faultrecord where device_id = #{device}
-            and fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-    </select>
-
-    <select id="staByAirType" parameterType="java.util.Map" resultMap="staMap">
-        select aircraft_type as parentName,count(id)  as recordCount from t_faultrecord
-        where
-            fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-            group by aircraft_type
-    </select>
-
-    <select id="staByDevice" parameterType="java.util.Map" resultMap="staMap">
-        select device_name as parentName,count(id) as recordCount from t_faultrecord
-        where aircraft_type = #{aircraftType}
-            and fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-            group by device_name
-    </select>
-
-    <select id="sortByDevice" parameterType="java.util.Map" resultMap="userMap">
-        select * from t_faultrecord
-        where aircraft_type = #{aircraftType}
-            and fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-            order by fault_time,fault_time desc
-    </select>
-
-<!--    <select id="faultsta" parameterType="java.util.Map" resultType="Integer">-->
-    <select id="faultsta" parameterType="com.zglc.kg.entity.FaultFind" resultMap="userMap">
-        select * from t_faultrecord where device_name = #{device_name}
-            and fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-    </select>
-
-    <select id="faultsta1" parameterType="com.zglc.kg.entity.FaultFind" resultMap="userMap">
-        select * where device_name = #{device_name}
-            and fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-    </select>
-
-    <select id="faultFind" parameterType="com.zglc.kg.entity.FaultFind" resultMap="userMap">
-        select  * from t_faultrecord where 1=1
-<!--        <if test="aircraft != null">-->
-<!--            and device_id in (select id from t_device where aircraft_type = #{aircraft})-->
-<!--        </if>-->
-<!--        <if test="firstDevice != null">-->
-<!--            and device_id in (select id from t_device where parent = #{firstDevice})-->
-<!--        </if>-->
-<!--        <if test="secondDevice !=null">-->
-<!--            and device_id = #{secondDevice}-->
-<!--        </if>-->
-        <if test="startTime != null">
-            and fault_time <![CDATA[>=]]> #{startTime}
-        </if>
-        <if test="endTime != null">
-            and fault_time <![CDATA[<=]]> {endTime}
-        </if>
-        <if test="device_name != null">
-            and device_name like (CONCAT(CONCAT('%',#{device_name}),'%'))
-        </if>
-    </select>
-
-    <select id="findAllDevice" parameterType="Integer" resultType="java.util.Map">
-        SELECT DISTINCT(id), device_type as 'device_name' FROM t_device where aircraft_id = #{deviceId}
-    </select>
-
-    <insert id="addBatch" parameterType="java.util.ArrayList">
-        insert into t_faultrecord (fault_time,aircraft_type,aircraft_no,product_no,major,faultparts_system,device_name,device_type, info_sources,
-        fault_content,fault_reason,discover_opportunity,diagnosis_method,war_zone,army,division,brigade,up_down,
-        discoverer,is_falsealarm,fault_degree,fault_consequence,missflight_times,impact_times,device_productor,device_no,
-        fault_liability,fault_location,reviewer,review_time,repair_time,repair_hours,repair_peoplenum,repaired_time,classification,is_grounded,reporting_department,
-        replace_device,replace_type,diagnosis_people,faultparts_date,faultparts_hours,faultparts_worktimes,faultparts_renovation_manu,
-        faultparts_renovation_hours,faultparts_renovation_times,repair_method,repair_person,replace_device_hours,replace_device_repairhours,replace_device_repairtimes,replace_device_applytimes,replace_device_manufacturer,
-        is_history,inspector,handling_opinions,hmc,mfl,pfl,gmp,is_almost,is_error,is_undefined,is_done,remark,is_hide) values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.fault_time},#{item.aircraft_type},#{item.aircraft_no},#{item.product_no},#{item.major},#{item.faultparts_system}, #{item.device_name},#{item.device_type},#{item.info_sources},
-            #{item.fault_content},#{item.fault_reason},#{item.discover_opportunity},#{item.diagnosis_method},#{item.war_zone},#{item.army},#{item.division},#{item.brigade},#{item.up_down},
-            #{item.discoverer},#{item.is_falsealarm},#{item.fault_degree},#{item.fault_consequence},#{item.missflight_times},#{item.impact_times},#{item.device_productor},#{item.device_no},
-            #{item.fault_liability},#{item.fault_location},#{item.reviewer},#{item.review_time},#{item.repair_time},#{item.repair_hours},#{item.repair_peoplenum},#{item.repaired_time},#{item.classification},#{item.is_grounded},#{item.reporting_department},
-            #{item.replace_device},#{item.replace_type},#{item.diagnosis_people},#{item.faultparts_date},#{item.faultparts_hours},#{item.faultparts_worktimes},#{item.faultparts_renovation_manu},
-            #{item.faultparts_renovation_hours},#{item.faultparts_renovation_times},#{item.repair_method},#{item.repair_person},#{item.replace_device_hours},#{item.replace_device_repairhours},#{item.replace_device_repairtimes},#{item.replace_device_applytimes},#{item.replace_device_manufacturer},
-            #{item.is_history},#{item.inspector},#{item.handling_opinions},#{item.hmc},#{item.mfl},#{item.pfl},#{item.gmp},#{item.is_almost},#{item.is_error},#{item.is_undefined},#{item.is_done},#{item.remark},#{item.is_hide})
-        </foreach>
-    </insert>
-
-    <select id="staBySystem" parameterType="java.util.ArrayList" resultMap="staMap">
-        select faultparts_system as parentName,count(id)  as recordCount from t_faultrecord
-        where
-            fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-            group by faultparts_system
-    </select>
-
-    <select id="findByHmc" parameterType="String" resultMap="userMap">
-            select *  from t_faultrecord where  hmc like #{name}
-    </select>
-
-    <select id="findByMfl" parameterType="String" resultMap="userMap">
-            select *  from t_faultrecord where  mfl like #{name}
-    </select>
-
-    <select id="findByPfl" parameterType="String" resultMap="userMap">
-            select *  from t_faultrecord where  pfl like #{name}
-    </select>
-
-    <select id="findByGmp" parameterType="String" resultMap="userMap">
-            select *  from t_faultrecord where  gmp like #{name}
-    </select>
-
-    <select id="singleSta" parameterType="java.util.ArrayList" resultMap="userMap">
-            select device_name,faultparts_system,is_error,major,discover_opportunity from t_faultrecord
-            where aircraft_type = #{aircraft_type}
-                <if test="airNo != '-1'">
-                    and aircraft_no = #{airNo}
-                </if>
-                and fault_time <![CDATA[>=]]> #{startTime}
-                and fault_time <![CDATA[<=]]> #{endTime}
-    </select>
-
-    <select id="singleStaAll" parameterType="java.util.ArrayList" resultMap="staMap">
-        select aircraft_no as parentName,count(id)  as recordCount from t_faultrecord
-        where aircraft_type = #{aircraft_type}
-        and fault_time <![CDATA[>=]]> #{startTime}
-        and fault_time <![CDATA[<=]]> #{endTime}
-        group by aircraft_no
-    </select>
-
-    <select id="getD1" resultMap="staMap">
-        select war_zone as parentName,count(id)  as recordCount from t_faultrecord
-        group by war_zone
-    </select>
-
-    <select id="getD2" parameterType="String" resultMap="staMap">
-        select army as parentName,count(id)  as recordCount from t_faultrecord
-        where war_zone = #{war_zone}
-        group by army
-    </select>
-
-    <select id="getD3" parameterType="String" resultMap="staMap">
-        select dimision as parentName,count(id)  as recordCount from t_faultrecord
-        where army = #{army}
-        group by dimision
-    </select>
-
-    <select id="getD4" parameterType="String" resultMap="staMap">
-        select brigade as parentName,count(id)  as recordCount from t_faultrecord
-        where dimision = #{dimision}
-        group by brigade
-    </select>
-
-    <select id="getAirNo" parameterType="String" resultMap="staMap">
-        select aircraft_no as parentName,count(id)  as recordCount from t_faultrecord
-        where aircraft_type = #{aircraft_type}
-        group by aircraft_no
-    </select>
-
-    <select id="getAirType"  resultMap="staMap">
-        select aircraft_type as parentName,count(id)  as recordCount from t_faultrecord
-        group by aircraft_type
-    </select>
-
-    <select id="getSystem" parameterType="String" resultMap="staMap">
-        select faultparts_system as parentName,count(id)  as recordCount from t_faultrecord
-        where major = #{major}
-        group by faultparts_system
-    </select>
-
-    <select id="getMajor" parameterType="String" resultMap="staMap">
-        select major as parentName,count(id)  as recordCount from t_faultrecord
-        where aircraft_type = #{aircraft_type}
-        group by major
-    </select>
-
-    <select id="getDevice" parameterType="String" resultMap="staMap">
-        select device_name as parentName,count(id)  as recordCount from t_faultrecord
-        where faultparts_system = #{faultparts_system}
-        group by major
-    </select>
-
-    <select id="majorSta" parameterType="java.util.ArrayList" resultMap="userMap">
-        select faultparts_system,device_name,is_error,discover_opportunity from t_faultrecord
-        where aircraft_type = #{aircraft_type}
-        and major = #{major}
-        and fault_time <![CDATA[>=]]> #{startTime}
-        and fault_time <![CDATA[<=]]> #{endTime}
-    </select>
-
-    <select id="majorStaAll" parameterType="java.util.ArrayList" resultMap="staMap">
-        select major as parentName,count(id) as recordCount from t_faultrecord
-        where aircraft_type = #{aircraft_type}
-        and fault_time <![CDATA[>=]]> #{startTime}
-        and fault_time <![CDATA[<=]]> #{endTime}
-        group by major
-    </select>
-</mapper>

+ 0 - 7
target/classes/mapping/RepairManualDao.xml

@@ -45,13 +45,6 @@
         select * from (select * from t_repair_manual where manual_name like #{name1} ) as a where manual_name like #{name2}
     </select>
 
-    <select id="findByFault" parameterType="com.zglc.kg.entity.FaultFind" resultMap="userMap">
-        select * from t_repair_manual
-        where 1=1
-        <if test="faultName != null">
-            and manual_name like (CONCAT(CONCAT('%',#{faultName}),'%'))
-        </if>
-    </select>
 
     <select id="findByHmc" parameterType="String" resultMap="userMap">
             select *  from t_repair_manual where  hmc like #{name}

+ 0 - 52
target/classes/mapping/TechnicalTermDao.xml

@@ -1,52 +0,0 @@
-<?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.zglc.kg.dao.TechnicalTermDao">
-
-	<!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="com.zglc.kg.entity.TechnicalTermEntity" id="termMap">
-        <result property="id" column="id"/>
-        <result property="cn_name" column="cn_name"/>
-        <result property="eng_name" column="eng_name"/>
-        <result property="content" column="content"/>
-        <result property="remarks" column="remarks"/>
-    </resultMap>
-
-    <select id="listAll" resultMap="termMap">
-        select id,cn_name,eng_name,content,remarks
-        from t_technicalterm
-        where id > 0
-    </select>
-
-    <select id="getCount" resultType="java.lang.Integer">
-        select count(1)
-        from t_technicalterm
-        where id > 1
-    </select>
-
-<!--    <insert id="batchAdd" parameterType="java.util.List">-->
-<!--        <foreach collection="list" item="equ" separator=";">-->
-<!--            insert into t_equipment (equipment_type)-->
-<!--            SELECT #{equ.equipment_type}-->
-<!--            FROM DUAL WHERE NOT EXISTS (SELECT equipment_type FROM  t_equipment WHERE equipment_type = #{equ.equipment_type})-->
-<!--        </foreach>-->
-<!--    </insert>-->
-
-    <select id="findByCnName" parameterType="String" resultMap="termMap">
-        select id,cn_name,eng_name,content,remarks from t_technicalterm where cn_name
-        like #{name}
-    </select>
-
-    <select id="findByEngName" parameterType="String" resultMap="termMap">
-        select id,cn_name,eng_name,content,remarks from t_technicalterm where eng_name
-        like #{name}
-    </select>
-
-    <insert id="addBatch" parameterType="java.util.ArrayList">
-        insert into t_technicalterm (cn_name,eng_name,content,remarks) values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.cn_name},#{item.eng_name},#{item.content},#{item.remarks})
-        </foreach>
-    </insert>
-
-</mapper>