allen před 2 roky
rodič
revize
014f6029ae
32 změnil soubory, kde provedl 991 přidání a 98 odebrání
  1. 2 2
      kgraph-admin/src/main/java/com/kgraph/web/controller/common/CommonController.java
  2. 1 1
      kgraph-admin/src/main/resources/application-druid.yml
  3. 4 0
      kgraph-common/src/main/java/com/kgraph/common/config/KgraphConfig.java
  4. 18 18
      kgraph-common/src/main/java/com/kgraph/common/utils/poi/ExcelUtil.java
  5. 4 0
      kgraph-graph/pom.xml
  6. 0 2
      kgraph-graph/src/main/java/com/kgraph/graph/neo4j/controller/KgController.java
  7. 1 1
      kgraph-graph/src/main/java/com/kgraph/graph/suport/controller/DataManageController.java
  8. 3 4
      kgraph-graph/src/main/java/com/kgraph/graph/suport/controller/UploadManageController.java
  9. 48 48
      kgraph-graph/src/main/java/com/kgraph/graph/suport/domain/DataManage.java
  10. 1 1
      kgraph-graph/src/main/java/com/kgraph/graph/suport/mapper/DataManageMapper.java
  11. 3 1
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/IDataManageService.java
  12. 1 1
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/IUploadManageService.java
  13. 42 1
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/DataManageServiceImpl.java
  14. 2 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/ExtractKnowledgeSubTaskServiceImpl.java
  15. 47 9
      kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/UploadManageServiceImpl.java
  16. 217 0
      kgraph-graph/src/main/java/com/kgraph/graph/suport/utils/DataManageUploadUtils.java
  17. 12 0
      kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/constants/UploadConstants.java
  18. 88 0
      kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/controller/UploadDetailController.java
  19. 96 0
      kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/domain/Accident.java
  20. 30 0
      kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/domain/UploadDetailBaseDomain.java
  21. 11 0
      kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/mapper/AccidentMapper.java
  22. 13 0
      kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/mapper/IUploadDetailBaseMapper.java
  23. 13 0
      kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/service/IUploadDetailBaseService.java
  24. 74 0
      kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/service/impl/UploadDetailBaseServiceImpl.java
  25. 12 6
      kgraph-graph/src/main/resources/mapper/upload/DataManageMapper.xml
  26. 1 0
      kgraph-graph/src/main/resources/mapper/upload/UploadManageMapper.xml
  27. 172 0
      kgraph-graph/src/main/resources/mapper/uploadDetail/AccidentMapper.xml
  28. 2 0
      kgraph-system/src/main/java/com/kgraph/system/mapper/SysDictDataMapper.java
  29. 4 1
      kgraph-system/src/main/java/com/kgraph/system/service/ISysDictDataService.java
  30. 5 0
      kgraph-system/src/main/java/com/kgraph/system/service/impl/SysDictDataServiceImpl.java
  31. 7 1
      kgraph-system/src/main/resources/mapper/system/SysDictDataMapper.xml
  32. 57 1
      sql/system.sql

+ 2 - 2
kgraph-admin/src/main/java/com/kgraph/web/controller/common/CommonController.java

@@ -54,8 +54,8 @@ public class CommonController
             }
             String realFileName = FileUtils.getFileNameByPath(fileName);
 
-            if(fileName.startsWith("/profile/upload")){
-                fileName = fileName.substring(15);
+            if(fileName.startsWith(KgraphConfig.UPLOAD_HEAD_PATH)){
+                fileName = fileName.substring(KgraphConfig.UPLOAD_HEAD_PATH_LENGTH);
             }
             String filePath = KgraphConfig.getUploadPath() + fileName;
 

+ 1 - 1
kgraph-admin/src/main/resources/application-druid.yml

@@ -6,7 +6,7 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://47.108.150.237:3306/kgraph2?userUnicode=ture&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false#
+                url: jdbc:mysql://47.108.150.237:3306/kgraph2?userUnicode=ture&characterEncoding=utf8&&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false#
                 username: root
                 password: w.cf123321
             # 从库数据源

+ 4 - 0
kgraph-common/src/main/java/com/kgraph/common/config/KgraphConfig.java

@@ -131,4 +131,8 @@ public class KgraphConfig
     {
         return getProfile() + "/upload";
     }
+
+    public static final String UPLOAD_HEAD_PATH = "/profile/upload";
+    public static final int UPLOAD_HEAD_PATH_LENGTH = UPLOAD_HEAD_PATH.length();
+
 }

+ 18 - 18
kgraph-common/src/main/java/com/kgraph/common/utils/poi/ExcelUtil.java

@@ -92,7 +92,7 @@ import com.kgraph.common.utils.file.ImageUtils;
  */
 public class ExcelUtil<T>
 {
-    private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class);
+    protected static final Logger log = LoggerFactory.getLogger(ExcelUtil.class);
 
     public static final String FORMULA_REGEX_STR = "=|-|\\+|@";
 
@@ -106,82 +106,82 @@ public class ExcelUtil<T>
     /**
      * 工作表名称
      */
-    private String sheetName;
+    protected String sheetName;
 
     /**
      * 导出类型(EXPORT:导出数据;IMPORT:导入模板)
      */
-    private Type type;
+    protected Type type;
 
     /**
      * 工作薄对象
      */
-    private Workbook wb;
+    protected Workbook wb;
 
     /**
      * 工作表对象
      */
-    private Sheet sheet;
+    protected Sheet sheet;
 
     /**
      * 样式列表
      */
-    private Map<String, CellStyle> styles;
+    protected Map<String, CellStyle> styles;
 
     /**
      * 导入导出数据列表
      */
-    private List<T> list;
+    protected List<T> list;
 
     /**
      * 注解列表
      */
-    private List<Object[]> fields;
+    protected List<Object[]> fields;
 
     /**
      * 当前行号
      */
-    private int rownum;
+    protected int rownum;
 
     /**
      * 标题
      */
-    private String title;
+    protected String title;
 
     /**
      * 最大高度
      */
-    private short maxHeight;
+    protected short maxHeight;
 
     /**
      * 合并后最后行数
      */
-    private int subMergedLastRowNum = 0;
+    protected int subMergedLastRowNum = 0;
 
     /**
      * 合并后开始行数
      */
-    private int subMergedFirstRowNum = 1;
+    protected int subMergedFirstRowNum = 1;
 
     /**
      * 对象的子列表方法
      */
-    private Method subMethod;
+    protected Method subMethod;
 
     /**
      * 对象的子列表属性
      */
-    private List<Field> subFields;
+    protected List<Field> subFields;
 
     /**
      * 统计列表
      */
-    private Map<Integer, Double> statistics = new HashMap<Integer, Double>();
+    protected Map<Integer, Double> statistics = new HashMap<Integer, Double>();
 
     /**
      * 数字格式
      */
-    private static final DecimalFormat DOUBLE_FORMAT = new DecimalFormat("######0.00");
+    protected static final DecimalFormat DOUBLE_FORMAT = new DecimalFormat("######0.00");
 
     /**
      * 实体对象
@@ -1500,7 +1500,7 @@ public class ExcelUtil<T>
      * @param row 判断的行
      * @return
      */
-    private boolean isRowEmpty(Row row)
+    protected boolean isRowEmpty(Row row)
     {
         if (row == null)
         {

+ 4 - 0
kgraph-graph/pom.xml

@@ -55,6 +55,10 @@
 			<artifactId>swagger-models</artifactId>
 			<version>1.6.2</version>
 		</dependency>
+        <dependency>
+            <groupId>com.kgraph</groupId>
+            <artifactId>kgraph-system</artifactId>
+        </dependency>
 
     </dependencies>
 

+ 0 - 2
kgraph-graph/src/main/java/com/kgraph/graph/neo4j/controller/KgController.java

@@ -3,10 +3,8 @@ package com.kgraph.graph.neo4j.controller;
 import com.kgraph.common.core.controller.BaseController;
 import com.kgraph.common.core.domain.AjaxResult;
 import com.kgraph.graph.neo4j.DTO.KgDTO;
-import com.kgraph.graph.neo4j.DTO.KgDocDTO;
 import com.kgraph.graph.neo4j.seavice.IKgService;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 

+ 1 - 1
kgraph-graph/src/main/java/com/kgraph/graph/suport/controller/DataManageController.java

@@ -25,7 +25,7 @@ import com.kgraph.common.core.page.TableDataInfo;;
  * 数据管理Controller
  * 
  * @author Allen
- * @date 2023-03-20
+ * @date 2023-04-02
  */
 @RestController
 @RequestMapping("/upload/dataManage")

+ 3 - 4
kgraph-graph/src/main/java/com/kgraph/graph/suport/controller/UploadManageController.java

@@ -74,8 +74,7 @@ public class UploadManageController extends BaseController
     @PreAuthorize("@ss.hasPermi('upload:uploadManage:add')")
     @Log(title = "上传管理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody UploadManage uploadManage)
-    {
+    public AjaxResult add(@RequestBody UploadManage uploadManage) throws Exception {
         uploadManage.setCreateBy(getUsername());
         return toAjax(uploadManageService.insertUploadManage(uploadManage));
     }
@@ -127,8 +126,8 @@ public class UploadManageController extends BaseController
             }
             String realFileName = FileUtils.getFileNameByPath(filePath);
 
-            if(filePath.startsWith("/profile/upload")){
-                filePath = filePath.substring(15);
+            if(filePath.startsWith(KgraphConfig.UPLOAD_HEAD_PATH)){
+                filePath = filePath.substring(KgraphConfig.UPLOAD_HEAD_PATH_LENGTH);
             }
             String filePathFinal = KgraphConfig.getUploadPath() + filePath;
 

+ 48 - 48
kgraph-graph/src/main/java/com/kgraph/graph/suport/domain/DataManage.java

@@ -9,7 +9,7 @@ import com.kgraph.common.core.domain.BaseEntity;;
  * 数据管理对象 t_data_manage
  * 
  * @author Allen
- * @date 2023-03-20
+ * @date 2023-04-02
  */
 public class DataManage extends BaseEntity
 {
@@ -19,87 +19,87 @@ public class DataManage extends BaseEntity
     private Long id;
 
     /** 上传管理主键 */
-    @Excel(name = "上传管理主键")
-    private Long tUploadId;
+//    @Excel(name = "上传管理主键")
+    private Long uploadId;
 
-    /** 额外存储1 */
-    @Excel(name = "额外存储1")
+    /** 额外存储1,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储1,具体内容跟由模板类型定义")
     private String extra1;
 
-    /** 额外存储2 */
-    @Excel(name = "额外存储2")
+    /** 额外存储2,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储2,具体内容跟由模板类型定义")
     private String extra2;
 
-    /** 额外存储3 */
-    @Excel(name = "额外存储3")
+    /** 额外存储3,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储3,具体内容跟由模板类型定义")
     private String extra3;
 
-    /** 额外存储4 */
-    @Excel(name = "额外存储4")
+    /** 额外存储4,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储4,具体内容跟由模板类型定义")
     private String extra4;
 
-    /** 额外存储5 */
-    @Excel(name = "额外存储5")
+    /** 额外存储5,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储5,具体内容跟由模板类型定义")
     private String extra5;
 
-    /** 额外存储6 */
-    @Excel(name = "额外存储6")
+    /** 额外存储6,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储6,具体内容跟由模板类型定义")
     private String extra6;
 
-    /** 额外存储7 */
-    @Excel(name = "额外存储7")
+    /** 额外存储7,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储7,具体内容跟由模板类型定义")
     private String extra7;
 
-    /** 额外存储8 */
-    @Excel(name = "额外存储8")
+    /** 额外存储8,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储8,具体内容跟由模板类型定义")
     private String extra8;
 
-    /** 额外存储9 */
-    @Excel(name = "额外存储9")
+    /** 额外存储9,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储9,具体内容跟由模板类型定义")
     private String extra9;
 
-    /** 额外存储10 */
-    @Excel(name = "额外存储10")
+    /** 额外存储10,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储10,具体内容跟由模板类型定义")
     private String extra10;
 
-    /** 额外存储11 */
-    @Excel(name = "额外存储11")
+    /** 额外存储11,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储11,具体内容跟由模板类型定义")
     private String extra11;
 
-    /** 额外存储12 */
-    @Excel(name = "额外存储12")
+    /** 额外存储12,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储12,具体内容跟由模板类型定义")
     private String extra12;
 
-    /** 额外存储13 */
-    @Excel(name = "额外存储13")
+    /** 额外存储13,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储13,具体内容跟由模板类型定义")
     private String extra13;
 
-    /** 额外存储14 */
-    @Excel(name = "额外存储14")
+    /** 额外存储14,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储14,具体内容跟由模板类型定义")
     private String extra14;
 
-    /** 额外存储15 */
-    @Excel(name = "额外存储15")
+    /** 额外存储15,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储15,具体内容跟由模板类型定义")
     private String extra15;
 
-    /** 额外存储16 */
-    @Excel(name = "额外存储16")
+    /** 额外存储16,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储16,具体内容跟由模板类型定义")
     private String extra16;
 
-    /** 额外存储17 */
-    @Excel(name = "额外存储17")
+    /** 额外存储17,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储17,具体内容跟由模板类型定义")
     private String extra17;
 
-    /** 额外存储18 */
-    @Excel(name = "额外存储18")
+    /** 额外存储18,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储18,具体内容跟由模板类型定义")
     private String extra18;
 
-    /** 额外存储19 */
-    @Excel(name = "额外存储19")
+    /** 额外存储19,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储19,具体内容跟由模板类型定义")
     private String extra19;
 
-    /** 额外存储20 */
-    @Excel(name = "额外存储20")
+    /** 额外存储20,具体内容跟由模板类型定义 */
+    @Excel(name = "额外存储20,具体内容跟由模板类型定义")
     private String extra20;
 
     public void setId(Long id) 
@@ -111,14 +111,14 @@ public class DataManage extends BaseEntity
     {
         return id;
     }
-    public void settUploadId(Long tUploadId) 
+    public void setUploadId(Long uploadId) 
     {
-        this.tUploadId = tUploadId;
+        this.uploadId = uploadId;
     }
 
-    public Long gettUploadId() 
+    public Long getUploadId() 
     {
-        return tUploadId;
+        return uploadId;
     }
     public void setExtra1(String extra1) 
     {
@@ -305,7 +305,7 @@ public class DataManage extends BaseEntity
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
-            .append("tUploadId", gettUploadId())
+            .append("uploadId", getUploadId())
             .append("extra1", getExtra1())
             .append("extra2", getExtra2())
             .append("extra3", getExtra3())

+ 1 - 1
kgraph-graph/src/main/java/com/kgraph/graph/suport/mapper/DataManageMapper.java

@@ -7,7 +7,7 @@ import com.kgraph.graph.suport.domain.DataManage;
  * 数据管理Mapper接口
  * 
  * @author Allen
- * @date 2023-03-20
+ * @date 2023-04-02
  */
 public interface DataManageMapper 
 {

+ 3 - 1
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/IDataManageService.java

@@ -7,7 +7,7 @@ import com.kgraph.graph.suport.domain.DataManage;
  * 数据管理Service接口
  * 
  * @author Allen
- * @date 2023-03-20
+ * @date 2023-04-02
  */
 public interface IDataManageService 
 {
@@ -58,4 +58,6 @@ public interface IDataManageService
      * @return 结果
      */
     public int deleteDataManageById(Long id);
+
+    public long importByUpload(Long uploadId, String path, String type) throws Exception;
 }

+ 1 - 1
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/IUploadManageService.java

@@ -34,7 +34,7 @@ public interface IUploadManageService
      * @param uploadManage 上传管理
      * @return 结果
      */
-    public int insertUploadManage(UploadManage uploadManage);
+    public int insertUploadManage(UploadManage uploadManage) throws Exception;
 
     /**
      * 修改上传管理

+ 42 - 1
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/DataManageServiceImpl.java

@@ -1,7 +1,15 @@
 package com.kgraph.graph.suport.service.impl;
 
+import java.io.*;
 import java.util.List;
+
+import com.kgraph.common.config.KgraphConfig;
+import com.kgraph.common.core.domain.entity.SysDictData;
 import com.kgraph.common.utils.DateUtils;;
+import com.kgraph.graph.suport.utils.DataManageUploadUtils;
+import com.kgraph.system.service.ISysDictDataService;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.kgraph.graph.suport.mapper.DataManageMapper;
@@ -12,13 +20,15 @@ import com.kgraph.graph.suport.service.IDataManageService;
  * 数据管理Service业务层处理
  * 
  * @author Allen
- * @date 2023-03-20
+ * @date 2023-04-02
  */
 @Service
 public class DataManageServiceImpl implements IDataManageService 
 {
     @Autowired
     private DataManageMapper dataManageMapper;
+    @Autowired
+    private ISysDictDataService dictDataService;
 
     /**
      * 查询数据管理
@@ -93,4 +103,35 @@ public class DataManageServiceImpl implements IDataManageService
     {
         return dataManageMapper.deleteDataManageById(id);
     }
+
+    @Override
+    public long importByUpload(Long uploadId, String path, String type) throws Exception {
+        long returnValue = 0;
+        if(path.startsWith(KgraphConfig.UPLOAD_HEAD_PATH)){
+            path = path.substring(KgraphConfig.UPLOAD_HEAD_PATH_LENGTH);
+        }
+        String filePath = KgraphConfig.getUploadPath() + path;
+        File file = new File(filePath);
+        if (!file.exists())
+        {
+            throw new FileNotFoundException(filePath);
+        }
+        SysDictData sysDictData = dictDataService.getDictDataByTypeAndValue("kg_upload_type", type);
+        if(sysDictData == null || StringUtils.isEmpty(sysDictData.getRemark())) {
+            throw new Exception("数据字典配置不正确");
+        }
+        String[] columnNames = sysDictData.getRemark().replaceAll(",", ",").split(",");
+        try(FileInputStream fis = new FileInputStream(file)) {
+            DataManageUploadUtils dataManageUploadUtils = new DataManageUploadUtils();
+
+            List<DataManage> dataManages = dataManageUploadUtils.importDataManage(fis, columnNames);
+            if(CollectionUtils.isNotEmpty(dataManages)) {
+                returnValue = dataManages.size();
+                dataManages.forEach(dataManage -> {
+                    dataManage.setUploadId(uploadId);
+                });
+            }
+        }
+        return returnValue;
+    }
 }

+ 2 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/ExtractKnowledgeSubTaskServiceImpl.java

@@ -174,9 +174,11 @@ public class ExtractKnowledgeSubTaskServiceImpl implements IExtractKnowledgeSubT
     @Transactional
     public void approveSubTask(Long id, String status) {
         extractKnowledgeSubTaskMapper.updateSubTaskStatusById(id, status,null, null);
+        // TODO 以下逻辑可优化成异步执行
         if(ExtractKnowledgeSubTask.REVIEWED.equals(status)){
             List<KgDTO> kgDTOList = tripletInfoService.getKgDTO(id);
             kgService.create(kgDTOList);
+            extractKnowledgeSubTaskMapper.updateSubTaskStatusById(id, ExtractKnowledgeSubTask.DOWN,null, null);
         }
         extractKnowledgeSubTaskMapper.updateTaskStatusBySubTaskId(id);
     }

+ 47 - 9
kgraph-graph/src/main/java/com/kgraph/graph/suport/service/impl/UploadManageServiceImpl.java

@@ -1,13 +1,24 @@
 package com.kgraph.graph.suport.service.impl;
 
-import java.util.List;
-import com.kgraph.common.utils.DateUtils;;
+import com.kgraph.common.config.KgraphConfig;
+import com.kgraph.common.utils.DateUtils;
+import com.kgraph.common.utils.poi.ExcelUtil;
+import com.kgraph.graph.suport.domain.UploadManage;
+import com.kgraph.graph.suport.mapper.UploadManageMapper;
+import com.kgraph.graph.suport.service.IUploadManageService;
 import com.kgraph.graph.suport.vo.UploadManageOptionVO;
+import com.kgraph.graph.uploadDetail.constants.UploadConstants;
+import com.kgraph.graph.uploadDetail.domain.UploadDetailBaseDomain;
+import com.kgraph.graph.uploadDetail.service.IUploadDetailBaseService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.kgraph.graph.suport.mapper.UploadManageMapper;
-import com.kgraph.graph.suport.domain.UploadManage;
-import com.kgraph.graph.suport.service.IUploadManageService;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.util.List;
+
+;
 
 /**
  * 上传管理Service业务层处理
@@ -21,6 +32,9 @@ public class UploadManageServiceImpl implements IUploadManageService
     @Autowired
     private UploadManageMapper uploadManageMapper;
 
+    @Autowired
+    private IUploadDetailBaseService uploadDetailBaseService;
+
     /**
      * 查询上传管理
      * 
@@ -52,15 +66,39 @@ public class UploadManageServiceImpl implements IUploadManageService
      * @return 结果
      */
     @Override
-    public int insertUploadManage(UploadManage uploadManage)
-    {
+    public int insertUploadManage(UploadManage uploadManage) throws Exception {
+
+        // check file
+        String path = uploadManage.getFilePath();
+        if(path.startsWith(KgraphConfig.UPLOAD_HEAD_PATH)){
+            path = path.substring(KgraphConfig.UPLOAD_HEAD_PATH_LENGTH);
+        }
+        String filePath = KgraphConfig.getUploadPath() + path;
+        File file = new File(filePath);
+        if (!file.exists())
+        {
+            throw new FileNotFoundException(filePath);
+        }
+
         String[] filePaths = uploadManage.getFilePath().split("/");
         String fileFullName = filePaths[filePaths.length - 1];
 
-        uploadManage.setName(fileFullName.split("\\.")[0]);
+        String[] fileFullNames = fileFullName.split("\\.");
+        String fileType = fileFullNames[1];
+        uploadManage.setFileType(fileType);
+        uploadManage.setName(fileFullNames[0]);
         uploadManage.setCreateTime(DateUtils.getNowDate());
         uploadManageMapper.insertUploadManage(uploadManage);
-        // TODO process upload
+
+        if("xls".equals(fileType) || "xlsx".equals(fileType)){
+            ExcelUtil<UploadDetailBaseDomain> util = new ExcelUtil<>(UploadConstants.CLASS_MAP.get(uploadManage.getDataType()));
+            List<UploadDetailBaseDomain> domainList;
+            try(FileInputStream fis = new FileInputStream(file)) {
+                domainList = util.importExcel(fis);
+            }
+            uploadDetailBaseService.importDomain(uploadManage.getDataType(), uploadManage.getId(), domainList);
+            uploadManage.setAmount((long) domainList.size());
+        }
         uploadManage.setStatus(UploadManage.SUCCESS);
         return uploadManageMapper.updateUploadManage(uploadManage);
     }

+ 217 - 0
kgraph-graph/src/main/java/com/kgraph/graph/suport/utils/DataManageUploadUtils.java

@@ -0,0 +1,217 @@
+package com.kgraph.graph.suport.utils;
+
+import com.kgraph.common.annotation.Excel;
+import com.kgraph.common.core.text.Convert;
+import com.kgraph.common.utils.DateUtils;
+import com.kgraph.common.utils.StringUtils;
+import com.kgraph.common.utils.file.FileUtils;
+import com.kgraph.common.utils.poi.ExcelHandlerAdapter;
+import com.kgraph.common.utils.poi.ExcelUtil;
+import com.kgraph.common.utils.reflect.ReflectUtils;
+import com.kgraph.graph.suport.domain.DataManage;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.util.*;
+
+;
+
+/**
+ * 数据管理对象 t_data_manage
+ * 
+ * @author Allen
+ * @date 2023-03-20
+ */
+public class DataManageUploadUtils extends ExcelUtil<DataManage>
+{
+    public DataManageUploadUtils() {
+        super(DataManage.class);
+    }
+    /**
+     * 对DataManage excel表单指定表格索引名转换成list
+     *
+     * @param is 输入流
+     * @return 转换后集合
+     */
+    public List<DataManage> importDataManage(InputStream is,String[] columnNames) throws Exception
+    {
+        int titleNum = 0;
+        this.type = Excel.Type.IMPORT;
+        this.wb = WorkbookFactory.create(is);
+        List<DataManage> list = new ArrayList<DataManage>();
+        // 如果指定sheet名,则取指定sheet中的内容 否则默认指向第1个sheet
+        Sheet sheet = wb.getSheetAt(0);
+        if (sheet == null)
+        {
+            throw new IOException("文件sheet不存在");
+        }
+        boolean isXSSFWorkbook = !(wb instanceof HSSFWorkbook);
+        Map<String, PictureData> pictures;
+        if (isXSSFWorkbook)
+        {
+            pictures = getSheetPictures07((XSSFSheet) sheet, (XSSFWorkbook) wb);
+        }
+        else
+        {
+            pictures = getSheetPictures03((HSSFSheet) sheet, (HSSFWorkbook) wb);
+        }
+        // 获取最后一个非空行的行下标,比如总行数为n,则返回的为n-1
+        int rows = sheet.getLastRowNum();
+
+        if (rows > 0)
+        {
+            // 定义一个map用于存放excel列的序号和field.
+            Map<String, Integer> cellMap = new HashMap<String, Integer>();
+            // 获取表头
+            Row heard = sheet.getRow(titleNum);
+            for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++)
+            {
+                Cell cell = heard.getCell(i);
+                if (StringUtils.isNotNull(cell))
+                {
+                    String value = this.getCellValue(heard, i).toString();
+                    cellMap.put(value, i);
+                }
+                else
+                {
+                    cellMap.put(null, i);
+                }
+            }
+            // 有数据时才处理 得到类的所有field.
+            List<Object[]> fields = this.getFields();
+            Map<Integer, Object[]> fieldsMap = new HashMap<Integer, Object[]>();
+            for (Object[] objects : fields)
+            {
+//                Excel attr = (Excel) objects[1];
+                Field field = (Field) objects[0];
+                String index = field.getName().replace("extra","");
+                Integer column = Integer.valueOf(index);
+//                if (column != null)
+//                {
+                    fieldsMap.put(column, objects);
+//                }
+            }
+            for (int i = titleNum + 1; i <= rows; i++)
+            {
+                // 从第2行开始取数据,默认第一行是表头.
+                Row row = sheet.getRow(i);
+                // 判断当前行是否是空行
+                if (isRowEmpty(row))
+                {
+                    continue;
+                }
+                DataManage entity = null;
+                for (Map.Entry<Integer, Object[]> entry : fieldsMap.entrySet())
+                {
+                    Object val = this.getCellValue(row, entry.getKey());
+
+                    // 如果不存在实例则新建.
+                    entity = (entity == null ? clazz.newInstance() : entity);
+                    // 从map中得到对应列的field.
+                    Field field = (Field) entry.getValue()[0];
+                    Excel attr = (Excel) entry.getValue()[1];
+                    // 取得类型,并根据对象类型设置值.
+                    Class<?> fieldType = field.getType();
+                    if (String.class == fieldType)
+                    {
+                        String s = Convert.toStr(val);
+                        if (StringUtils.endsWith(s, ".0"))
+                        {
+                            val = StringUtils.substringBefore(s, ".0");
+                        }
+                        else
+                        {
+                            String dateFormat = field.getAnnotation(Excel.class).dateFormat();
+                            if (StringUtils.isNotEmpty(dateFormat))
+                            {
+                                val = parseDateToStr(dateFormat, val);
+                            }
+                            else
+                            {
+                                val = Convert.toStr(val);
+                            }
+                        }
+                    }
+                    else if ((Integer.TYPE == fieldType || Integer.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val)))
+                    {
+                        val = Convert.toInt(val);
+                    }
+                    else if ((Long.TYPE == fieldType || Long.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val)))
+                    {
+                        val = Convert.toLong(val);
+                    }
+                    else if (Double.TYPE == fieldType || Double.class == fieldType)
+                    {
+                        val = Convert.toDouble(val);
+                    }
+                    else if (Float.TYPE == fieldType || Float.class == fieldType)
+                    {
+                        val = Convert.toFloat(val);
+                    }
+                    else if (BigDecimal.class == fieldType)
+                    {
+                        val = Convert.toBigDecimal(val);
+                    }
+                    else if (Date.class == fieldType)
+                    {
+                        if (val instanceof String)
+                        {
+                            val = DateUtils.parseDate(val);
+                        }
+                        else if (val instanceof Double)
+                        {
+                            val = DateUtil.getJavaDate((Double) val);
+                        }
+                    }
+                    else if (Boolean.TYPE == fieldType || Boolean.class == fieldType)
+                    {
+                        val = Convert.toBool(val, false);
+                    }
+                    if (StringUtils.isNotNull(fieldType))
+                    {
+                        String propertyName = field.getName();
+                        if (StringUtils.isNotEmpty(attr.targetAttr()))
+                        {
+                            propertyName = field.getName() + "." + attr.targetAttr();
+                        }
+                        else if (StringUtils.isNotEmpty(attr.readConverterExp()))
+                        {
+                            val = reverseByExp(Convert.toStr(val), attr.readConverterExp(), attr.separator());
+                        }
+                        else if (StringUtils.isNotEmpty(attr.dictType()))
+                        {
+                            val = reverseDictByExp(Convert.toStr(val), attr.dictType(), attr.separator());
+                        }
+                        else if (!attr.handler().equals(ExcelHandlerAdapter.class))
+                        {
+                            val = dataFormatHandlerAdapter(val, attr);
+                        }
+                        else if (Excel.ColumnType.IMAGE == attr.cellType() && StringUtils.isNotEmpty(pictures))
+                        {
+                            PictureData image = pictures.get(row.getRowNum() + "_" + entry.getKey());
+                            if (image == null)
+                            {
+                                val = "";
+                            }
+                            else
+                            {
+                                byte[] data = image.getData();
+                                val = FileUtils.writeImportBytes(data);
+                            }
+                        }
+                        ReflectUtils.invokeSetter(entity, propertyName, val);
+                    }
+                }
+                list.add(entity);
+            }
+        }
+        return list;
+    }
+}

+ 12 - 0
kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/constants/UploadConstants.java

@@ -0,0 +1,12 @@
+package com.kgraph.graph.uploadDetail.constants;
+
+import com.kgraph.graph.uploadDetail.domain.Accident;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class UploadConstants {
+    public static final Map<String, Class> CLASS_MAP = new HashMap(8){
+        {put("4", Accident.class);}
+    };
+}

+ 88 - 0
kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/controller/UploadDetailController.java

@@ -0,0 +1,88 @@
+package com.kgraph.graph.uploadDetail.controller;
+
+import com.kgraph.common.annotation.Log;
+import com.kgraph.common.core.controller.BaseController;
+import com.kgraph.common.core.domain.AjaxResult;
+import com.kgraph.common.core.domain.entity.SysDictData;
+import com.kgraph.common.core.page.TableDataInfo;
+import com.kgraph.common.enums.BusinessType;
+import com.kgraph.common.utils.poi.ExcelUtil;
+import com.kgraph.common.utils.spring.SpringUtils;
+import com.kgraph.graph.uploadDetail.constants.UploadConstants;
+import com.kgraph.graph.uploadDetail.domain.UploadDetailBaseDomain;
+import com.kgraph.graph.uploadDetail.mapper.IUploadDetailBaseMapper;
+import com.kgraph.graph.uploadDetail.service.IUploadDetailBaseService;
+import com.kgraph.system.service.ISysDictDataService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 数据管理Controller
+ *
+ * @author Allen
+ * @date 2023-04-02
+ */
+@RestController
+@RequestMapping("/upload/dataDetail")
+public class UploadDetailController extends BaseController {
+
+    @Autowired
+    IUploadDetailBaseService service;
+
+    @Autowired
+    private ISysDictDataService dictDataService;
+
+    private IUploadDetailBaseMapper getMapper(String typeValue) {
+        SysDictData data = dictDataService.getDictDataByTypeAndValue("kg_upload_type", typeValue);
+        if (data == null || StringUtils.isEmpty(data.getRemark())) {
+            throw new RuntimeException("没有配置对应的mapper");
+        }
+        return SpringUtils.getBean(data.getRemark() + "Mapper");
+    }
+
+    /**
+     * 查询数据管理列表
+     */
+    @GetMapping("/{type}/list")
+    public TableDataInfo list(@PathVariable("type") String typeValue, UploadDetailBaseDomain domain) {
+        List list = service.getDomainList(typeValue, domain);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取数据管理详细信息
+     */
+    @GetMapping(value = "/{type}/{id}")
+    public AjaxResult getInfo(@PathVariable("type") String typeValue, @PathVariable("id") Long id) {
+        return success(service.getDomain(typeValue, id));
+    }
+
+    /**
+     * 修改数据管理
+     */
+    @Log(title = "数据详情", businessType = BusinessType.UPDATE)
+    @PutMapping("/{type}")
+    public AjaxResult edit(@PathVariable("type") String typeValue, @RequestBody UploadDetailBaseDomain domain) {
+        return success(service.save(typeValue, domain));
+    }
+
+    /**
+     * 删除数据管理
+     */
+    @Log(title = "数据详情", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{type}/{ids}")
+    public AjaxResult remove(@PathVariable("type") String typeValue, @PathVariable Long[] ids) {
+        return toAjax(service.delete(typeValue, ids));
+    }
+
+    @PostMapping("/downloadTemplate/{type}")
+    public void downloadTemplate(@PathVariable("type") String typeValue, HttpServletResponse response)
+    {
+        ExcelUtil util = new ExcelUtil<>(UploadConstants.CLASS_MAP.get(typeValue));
+        util.importTemplateExcel(response, "template");
+    }
+}

+ 96 - 0
kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/domain/Accident.java

@@ -0,0 +1,96 @@
+package com.kgraph.graph.uploadDetail.domain;
+
+import com.kgraph.common.annotation.Excel;
+import com.kgraph.common.utils.bean.BeanUtils;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 事故信息对象 t_accident
+ * 
+ * @author Allen
+ * @date 2023-04-03
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class Accident extends UploadDetailBaseDomain
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 上传管理主键 */
+    private Long uploadId;
+
+    /** 事故来源文件名称 */
+    @Excel(name = "事故来源文件名称")
+    private String extra1;
+
+    /** 事故来源文件期数 */
+    @Excel(name = "事故来源文件期数")
+    private String extra2;
+
+    /** 事故名称,事故纯文本 */
+    @Excel(name = "事故名称,事故纯文本")
+    private String extra3;
+
+    /** 事故过程描述 */
+    @Excel(name = "事故过程描述")
+    private String extra4;
+
+    /** 事故可能原因 */
+    @Excel(name = "事故可能原因")
+    private String extra5;
+
+    /** 事故影响因素 */
+    @Excel(name = "事故影响因素")
+    private String extra6;
+
+    /** 调查报告结论 */
+    @Excel(name = "调查报告结论")
+    private String extra7;
+
+    /** 事故详细后果 */
+    @Excel(name = "事故详细后果")
+    private String extra8;
+
+    /** 措施建议详情 */
+    @Excel(name = "措施建议详情")
+    private String extra9;
+
+    /** 事故描表述 */
+    @Excel(name = "事故描表述")
+    private String extra10;
+
+    /** 事故详细过程与后果 */
+    @Excel(name = "事故详细过程与后果")
+    private String extra11;
+
+    /** 原因总结 */
+    @Excel(name = "原因总结")
+    private String extra12;
+
+    /** 详细原因 */
+    @Excel(name = "详细原因")
+    private String extra13;
+
+    /** 第一段文本 */
+    @Excel(name = "第一段文本")
+    private String extra14;
+
+    /** 事理图谱文本 */
+    @Excel(name = "事理图谱文本")
+    private String extra15;
+
+    public UploadDetailBaseDomain accident2Domain() {
+        // todo?
+        return null;
+    }
+
+    public static Accident domain2Accident(UploadDetailBaseDomain domain) {
+        Accident accident = new Accident();
+        BeanUtils.copyBeanProp(domain,accident);
+        return accident;
+    }
+}

+ 30 - 0
kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/domain/UploadDetailBaseDomain.java

@@ -0,0 +1,30 @@
+package com.kgraph.graph.uploadDetail.domain;
+
+import com.kgraph.common.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+public class UploadDetailBaseDomain extends BaseEntity {
+    private Long id;
+    private Long uploadId;
+    private String extra1;
+    private String extra2;
+    private String extra3;
+    private String extra4;
+    private String extra5;
+    private String extra6;
+    private String extra7;
+    private String extra8;
+    private String extra9;
+    private String extra10;
+    private String extra11;
+    private String extra12;
+    private String extra13;
+    private String extra14;
+    private String extra15;
+    private String extra16;
+    private String extra17;
+    private String extra18;
+    private String extra19;
+    private String extra20;
+}

+ 11 - 0
kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/mapper/AccidentMapper.java

@@ -0,0 +1,11 @@
+package com.kgraph.graph.uploadDetail.mapper;
+
+/**
+ * 事故信息Mapper接口
+ * 
+ * @author Allen
+ * @date 2023-04-03
+ */
+public interface AccidentMapper extends IUploadDetailBaseMapper
+{
+}

+ 13 - 0
kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/mapper/IUploadDetailBaseMapper.java

@@ -0,0 +1,13 @@
+package com.kgraph.graph.uploadDetail.mapper;
+
+import com.kgraph.graph.uploadDetail.domain.UploadDetailBaseDomain;
+
+import java.util.List;
+
+public interface IUploadDetailBaseMapper {
+    UploadDetailBaseDomain selectById(Long id);
+    List<UploadDetailBaseDomain> selectList(UploadDetailBaseDomain domain);
+    int insert(UploadDetailBaseDomain domain);
+    int deleteByIds(Long[] ids);
+    int update(UploadDetailBaseDomain domain);
+}

+ 13 - 0
kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/service/IUploadDetailBaseService.java

@@ -0,0 +1,13 @@
+package com.kgraph.graph.uploadDetail.service;
+
+import com.kgraph.graph.uploadDetail.domain.UploadDetailBaseDomain;
+
+import java.util.List;
+
+public interface IUploadDetailBaseService {
+    int save(String typeValue, UploadDetailBaseDomain domain);
+    Boolean importDomain(String typeValue, Long uploadId, List<UploadDetailBaseDomain> domain);
+    UploadDetailBaseDomain getDomain(String typeValue, Long id);
+    List getDomainList(String typeValue, UploadDetailBaseDomain domain);
+    int delete(String typeValue, Long[] ids);
+}

+ 74 - 0
kgraph-graph/src/main/java/com/kgraph/graph/uploadDetail/service/impl/UploadDetailBaseServiceImpl.java

@@ -0,0 +1,74 @@
+package com.kgraph.graph.uploadDetail.service.impl;
+
+import com.kgraph.common.core.domain.entity.SysDictData;
+import com.kgraph.common.utils.PageUtils;
+import com.kgraph.common.utils.spring.SpringUtils;
+import com.kgraph.graph.uploadDetail.domain.UploadDetailBaseDomain;
+import com.kgraph.graph.uploadDetail.mapper.IUploadDetailBaseMapper;
+import com.kgraph.graph.uploadDetail.service.IUploadDetailBaseService;
+import com.kgraph.system.service.ISysDictDataService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+;
+
+/**
+ * 事故信息Service业务层处理
+ * 
+ * @author Allen
+ * @date 2023-04-03
+ */
+@Service
+@Primary
+public class UploadDetailBaseServiceImpl implements IUploadDetailBaseService
+{
+
+    @Autowired
+    private ISysDictDataService dictDataService;
+
+    private IUploadDetailBaseMapper getMapper(String typeValue) {
+        SysDictData data = dictDataService.getDictDataByTypeAndValue("kg_upload_type", typeValue);
+        if (data == null || StringUtils.isEmpty(data.getRemark())) {
+            throw new RuntimeException("没有配置对应的mapper");
+        }
+        return SpringUtils.getBean(data.getRemark() + "Mapper");
+    }
+
+    @Override
+    public int save(String typeValue, UploadDetailBaseDomain domain) {
+        domain.setUpdateTime(new Date());
+        return getMapper(typeValue).update(domain);
+    }
+
+    @Override
+    public Boolean importDomain(String typeValue, Long uploadId, List<UploadDetailBaseDomain> domainList) {
+        domainList.forEach(domain -> {
+            domain.setUploadId(uploadId);
+            domain.setCreateTime(new Date());
+            getMapper(typeValue).insert(domain);
+        });
+        return Boolean.TRUE;
+    }
+
+    @Override
+    public UploadDetailBaseDomain getDomain(String typeValue, Long id) {
+        return getMapper(typeValue).selectById(id);
+    }
+
+    @Override
+    public List getDomainList(String typeValue, UploadDetailBaseDomain domain) {
+        IUploadDetailBaseMapper mapper = getMapper(typeValue);
+        PageUtils.startPage();
+        return mapper.selectList(domain);
+    }
+
+    @Override
+    public int delete(String typeValue, Long[] ids) {
+        return getMapper(typeValue).deleteByIds(ids);
+    }
+}

+ 12 - 6
kgraph-graph/src/main/resources/mapper/upload/DataManageMapper.xml

@@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="DataManage" id="DataManageResult">
         <result property="id"    column="id"    />
-        <result property="tUploadId"    column="t_upload_id"    />
+        <result property="uploadId"    column="upload_id"    />
         <result property="extra1"    column="extra1"    />
         <result property="extra2"    column="extra2"    />
         <result property="extra3"    column="extra3"    />
@@ -34,13 +34,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectDataManageVo">
-        select id, t_upload_id, extra1, extra2, extra3, extra4, extra5, extra6, extra7, extra8, extra9, extra10, extra11, extra12, extra13, extra14, extra15, extra16, extra17, extra18, extra19, extra20, create_by, create_time, update_by, update_time from t_data_manage
+        select id, upload_id, extra1, extra2, extra3, extra4, extra5, extra6, extra7, extra8, extra9, extra10, extra11, extra12, extra13, extra14, extra15, extra16, extra17, extra18, extra19, extra20, create_by, create_time, update_by, update_time from t_data_manage
     </sql>
 
     <select id="selectDataManageList" parameterType="DataManage" resultMap="DataManageResult">
         <include refid="selectDataManageVo"/>
         <where>  
-            <if test="tUploadId != null "> and t_upload_id = #{tUploadId}</if>
+            <if test="uploadId != null "> and upload_id = #{uploadId}</if>
             <if test="extra1 != null  and extra1 != ''"> and extra1 = #{extra1}</if>
             <if test="extra2 != null  and extra2 != ''"> and extra2 = #{extra2}</if>
             <if test="extra3 != null  and extra3 != ''"> and extra3 = #{extra3}</if>
@@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertDataManage" parameterType="DataManage" useGeneratedKeys="true" keyProperty="id">
         insert into t_data_manage
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="tUploadId != null">t_upload_id,</if>
+            <if test="uploadId != null">upload_id,</if>
             <if test="extra1 != null">extra1,</if>
             <if test="extra2 != null">extra2,</if>
             <if test="extra3 != null">extra3,</if>
@@ -95,9 +95,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="extra20 != null">extra20,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="tUploadId != null">#{tUploadId},</if>
+            <if test="uploadId != null">#{uploadId},</if>
             <if test="extra1 != null">#{extra1},</if>
             <if test="extra2 != null">#{extra2},</if>
             <if test="extra3 != null">#{extra3},</if>
@@ -120,13 +122,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="extra20 != null">#{extra20},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
          </trim>
     </insert>
 
     <update id="updateDataManage" parameterType="DataManage">
         update t_data_manage
         <trim prefix="SET" suffixOverrides=",">
-            <if test="tUploadId != null">t_upload_id = #{tUploadId},</if>
+            <if test="uploadId != null">upload_id = #{uploadId},</if>
             <if test="extra1 != null">extra1 = #{extra1},</if>
             <if test="extra2 != null">extra2 = #{extra2},</if>
             <if test="extra3 != null">extra3 = #{extra3},</if>
@@ -147,6 +151,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="extra18 != null">extra18 = #{extra18},</if>
             <if test="extra19 != null">extra19 = #{extra19},</if>
             <if test="extra20 != null">extra20 = #{extra20},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
         </trim>

+ 1 - 0
kgraph-graph/src/main/resources/mapper/upload/UploadManageMapper.xml

@@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="fileType != null  and fileType != ''"> and file_type = #{fileType}</if>
             <if test="status != null  and status != ''"> and status = #{status}</if>
         </where>
+        ORDER BY create_time DESC
     </select>
     
     <select id="selectUploadManageById" parameterType="Long" resultMap="UploadManageResult">

+ 172 - 0
kgraph-graph/src/main/resources/mapper/uploadDetail/AccidentMapper.xml

@@ -0,0 +1,172 @@
+<?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.kgraph.graph.uploadDetail.mapper.AccidentMapper">
+    <resultMap type="Accident" id="AccidentResult">
+        <result property="id"    column="id"    />
+        <result property="uploadId"    column="upload_id"    />
+        <result property="extra1"    column="extra1"    />
+        <result property="extra2"    column="extra2"    />
+        <result property="extra3"    column="extra3"    />
+        <result property="extra4"    column="extra4"    />
+        <result property="extra5"    column="extra5"    />
+        <result property="extra6"    column="extra6"    />
+        <result property="extra7"    column="extra7"    />
+        <result property="extra8"    column="extra8"    />
+        <result property="extra9"    column="extra9"    />
+        <result property="extra10"    column="extra10"    />
+        <result property="extra11"    column="extra11"    />
+        <result property="extra12"    column="extra12"    />
+        <result property="extra13"    column="extra13"    />
+        <result property="extra14"    column="extra14"    />
+        <result property="extra15"    column="extra15"    />
+        <result property="extra16"    column="extra16"    />
+        <result property="extra17"    column="extra17"    />
+        <result property="extra18"    column="extra18"    />
+        <result property="extra19"    column="extra19"    />
+        <result property="extra20"    column="extra20"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectAccidentVo">
+        select id, upload_id, extra1, extra2, extra3, extra4, extra5, extra6, extra7, extra8, extra9, extra10, extra11, extra12, extra13, extra14, extra15, extra16, extra17, extra18, extra19, extra20, create_by, create_time, update_by, update_time from t_accident
+    </sql>
+
+    <select id="selectList" parameterType="Accident" resultMap="AccidentResult">
+        <include refid="selectAccidentVo"/>
+        <where>  
+            <if test="uploadId != null "> and upload_id = #{uploadId}</if>
+            <if test="extra1 != null  and extra1 != ''"> and extra1 = #{extra1}</if>
+            <if test="extra2 != null  and extra2 != ''"> and extra2 = #{extra2}</if>
+            <if test="extra3  != null  and extra3 != ''"> and extra3 = #{extra3}</if>
+            <if test="extra4 != null  and extra4 != ''"> and extra4 = #{extra4}</if>
+            <if test="extra5 != null  and extra5 != ''"> and extra5 = #{extra5}</if>
+            <if test="extra6 != null  and extra6 != ''"> and extra6 = #{extra6}</if>
+            <if test="extra7 != null  and extra7 != ''"> and extra7 = #{extra7}</if>
+            <if test="extra8 != null  and extra8 != ''"> and extra8 = #{extra8}</if>
+            <if test="extra9 != null  and extra9 != ''"> and extra9 = #{extra9}</if>
+            <if test="extra10 != null  and extra10 != ''"> and extra10 = #{extra10}</if>
+            <if test="extra11 != null  and extra11 != ''"> and extra11 = #{extra11}</if>
+            <if test="extra12 != null  and extra12 != ''"> and extra12 = #{extra12}</if>
+            <if test="extra13 != null  and extra13 != ''"> and extra13 = #{extra13}</if>
+            <if test="extra14 != null  and extra14 != ''"> and extra14 = #{extra14}</if>
+            <if test="extra15 != null  and extra15 != ''"> and extra15 = #{extra15}</if>
+            <if test="extra16 != null  and extra16 != ''"> and extra16 = #{extra16}</if>
+            <if test="extra17 != null  and extra17 != ''"> and extra17 = #{extra17}</if>
+            <if test="extra18 != null  and extra18 != ''"> and extra18 = #{extra18}</if>
+            <if test="extra19 != null  and extra19 != ''"> and extra19 = #{extra19}</if>
+            <if test="extra20 != null  and extra20 != ''"> and extra20 = #{extra20}</if>
+        </where>
+        ORDER BY create_time ASC
+    </select>
+    
+    <select id="selectById" parameterType="Long" resultMap="AccidentResult">
+        <include refid="selectAccidentVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insert" useGeneratedKeys="true" keyProperty="id">
+        insert into t_accident
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="uploadId != null">upload_id,</if>
+            <if test="extra1 != null">extra1,</if>
+            <if test="extra2 != null">extra2,</if>
+            <if test="extra3 != null">extra3,</if>
+            <if test="extra4 != null">extra4,</if>
+            <if test="extra5 != null">extra5,</if>
+            <if test="extra6 != null">extra6,</if>
+            <if test="extra7 != null">extra7,</if>
+            <if test="extra8 != null">extra8,</if>
+            <if test="extra9 != null">extra9,</if>
+            <if test="extra10 != null">extra10,</if>
+            <if test="extra11 != null">extra11,</if>
+            <if test="extra12 != null">extra12,</if>
+            <if test="extra13 != null">extra13,</if>
+            <if test="extra14 != null">extra14,</if>
+            <if test="extra15 != null">extra15,</if>
+            <if test="extra16 != null">extra16,</if>
+            <if test="extra17 != null">extra17,</if>
+            <if test="extra18 != null">extra18,</if>
+            <if test="extra19 != null">extra19,</if>
+            <if test="extra20 != null">extra20,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="uploadId != null">#{uploadId},</if>
+            <if test="extra1 != null">#{extra1},</if>
+            <if test="extra2 != null">#{extra2},</if>
+            <if test="extra3 != null">#{extra3},</if>
+            <if test="extra4 != null">#{extra4},</if>
+            <if test="extra5 != null">#{extra5},</if>
+            <if test="extra6 != null">#{extra6},</if>
+            <if test="extra7 != null">#{extra7},</if>
+            <if test="extra8 != null">#{extra8},</if>
+            <if test="extra9 != null">#{extra9},</if>
+            <if test="extra10 != null">#{extra10},</if>
+            <if test="extra11 != null">#{extra11},</if>
+            <if test="extra12 != null">#{extra12},</if>
+            <if test="extra13 != null">#{extra13},</if>
+            <if test="extra14 != null">#{extra14},</if>
+            <if test="extra15 != null">#{extra15},</if>
+            <if test="extra16 != null">#{extra16},</if>
+            <if test="extra17 != null">#{extra17},</if>
+            <if test="extra18 != null">#{extra18},</if>
+            <if test="extra19 != null">#{extra19},</if>
+            <if test="extra20 != null">#{extra20},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="update" parameterType="Accident">
+        update t_accident
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="uploadId != null">upload_id = #{uploadId},</if>
+            <if test="extra1 != null">extra1 = #{extra1},</if>
+            <if test="extra2 != null">extra2 = #{extra2},</if>
+            <if test="extra3 != null">extra3 = #{extra3},</if>
+            <if test="extra4 != null">extra4 = #{extra4},</if>
+            <if test="extra5 != null">extra5 = #{extra5},</if>
+            <if test="extra6 != null">extra6 = #{extra6},</if>
+            <if test="extra7 != null">extra7 = #{extra7},</if>
+            <if test="extra8 != null">extra8 = #{extra8},</if>
+            <if test="extra9 != null">extra9 = #{extra9},</if>
+            <if test="extra10 != null">extra10 = #{extra10},</if>
+            <if test="extra11 != null">extra11 = #{extra11},</if>
+            <if test="extra12 != null">extra12 = #{extra12},</if>
+            <if test="extra13 != null">extra13 = #{extra13},</if>
+            <if test="extra14 != null">extra14 = #{extra14},</if>
+            <if test="extra15 != null">extra15 = #{extra15},</if>
+            <if test="extra16 != null">extra16 = #{extra16},</if>
+            <if test="extra17 != null">extra17 = #{extra17},</if>
+            <if test="extra18 != null">extra18 = #{extra18},</if>
+            <if test="extra19 != null">extra19 = #{extra19},</if>
+            <if test="extra20 != null">extra20 = #{extra20},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteById" parameterType="Long">
+        delete from t_accident where id = #{id}
+    </delete>
+
+    <delete id="deleteByIds" parameterType="String">
+        delete from t_accident where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 2 - 0
kgraph-system/src/main/java/com/kgraph/system/mapper/SysDictDataMapper.java

@@ -93,4 +93,6 @@ public interface SysDictDataMapper
      * @return 结果
      */
     public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
+
+    public SysDictData getDictDataByTypeAndValue(@Param("dictType") String dictType, @Param("dictValue") String value);
 }

+ 4 - 1
kgraph-system/src/main/java/com/kgraph/system/service/ISysDictDataService.java

@@ -1,8 +1,9 @@
 package com.kgraph.system.service;
 
-import java.util.List;
 import com.kgraph.common.core.domain.entity.SysDictData;
 
+import java.util.List;
+
 /**
  * 字典 业务层
  * 
@@ -57,4 +58,6 @@ public interface ISysDictDataService
      * @return 结果
      */
     public int updateDictData(SysDictData dictData);
+
+    public SysDictData getDictDataByTypeAndValue(String dictType, String value);
 }

+ 5 - 0
kgraph-system/src/main/java/com/kgraph/system/service/impl/SysDictDataServiceImpl.java

@@ -109,4 +109,9 @@ public class SysDictDataServiceImpl implements ISysDictDataService
         }
         return row;
     }
+
+    @Override
+    public SysDictData getDictDataByTypeAndValue(String dictType, String value) {
+        return dictDataMapper.getDictDataByTypeAndValue(dictType, value);
+    }
 }

+ 7 - 1
kgraph-system/src/main/resources/mapper/system/SysDictDataMapper.xml

@@ -120,5 +120,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			sysdate()
  		)
 	</insert>
-	
+
+	<select id="getDictDataByTypeAndValue" resultMap="SysDictDataResult">
+		<include refid="selectDictDataVo"/>
+			WHERE dict_type = #{dictType} AND dict_value = #{dictValue}
+	</select>
+
+
 </mapper> 

+ 57 - 1
sql/system.sql

@@ -1009,7 +1009,7 @@ IF
 	EXISTS t_data_manage;
 CREATE TABLE t_data_manage (
 	id BIGINT ( 20 ) NOT NULL auto_increment COMMENT '编号',
-	t_upload_id BIGINT ( 20 ) NOT NULL COMMENT '上传管理主键',
+	upload_id BIGINT ( 20 ) NOT NULL COMMENT '上传管理主键',
 	extra1 TEXT COMMENT '额外存储1,具体内容跟由模板类型定义',
 	extra2 TEXT COMMENT '额外存储2,具体内容跟由模板类型定义',
 	extra3 TEXT COMMENT '额外存储3,具体内容跟由模板类型定义',
@@ -1123,6 +1123,39 @@ CREATE TABLE t_similarity_info (
 PRIMARY KEY ( id )
 ) ENGINE = INNODB auto_increment = 1 COMMENT = '三元组信息';
 
+DROP TABLE
+IF
+	EXISTS t_accident;
+CREATE TABLE t_accident (
+	id BIGINT ( 20 ) NOT NULL auto_increment COMMENT '编号',
+	upload_id BIGINT ( 20 ) NOT NULL COMMENT '上传管理主键',
+	extra1 TEXT COMMENT '事故来源文件名称',
+	extra2 TEXT COMMENT '事故来源文件期数',
+	extra3 TEXT COMMENT '事故名称,事故纯文本',
+	extra4 TEXT COMMENT '事故过程描述',
+	extra5 TEXT COMMENT '事故可能原因',
+	extra6 TEXT COMMENT '事故影响因素',
+	extra7 TEXT COMMENT '调查报告结论',
+	extra8 TEXT COMMENT '事故详细后果',
+	extra9 TEXT COMMENT '措施建议详情',
+	extra10 TEXT COMMENT '事故描表述',
+	extra11 TEXT COMMENT '事故详细过程与后果',
+	extra12 TEXT COMMENT '原因总结',
+	extra13 TEXT COMMENT '详细原因',
+	extra14 TEXT COMMENT '第一段文本',
+	extra15 TEXT COMMENT '事理图谱文本',
+	extra16 TEXT COMMENT '额外存储16,具体内容跟由模板类型定义',
+	extra17 TEXT COMMENT '额外存储17,具体内容跟由模板类型定义',
+	extra18 TEXT COMMENT '额外存储18,具体内容跟由模板类型定义',
+	extra19 TEXT COMMENT '额外存储19,具体内容跟由模板类型定义',
+	extra20 TEXT COMMENT '额外存储20,具体内容跟由模板类型定义',
+	create_by VARCHAR ( 64 ) DEFAULT '' COMMENT '创建者',
+	create_time datetime COMMENT '创建时间',
+	update_by VARCHAR ( 64 ) DEFAULT '' COMMENT '更新者',
+	update_time datetime COMMENT '更新时间',
+PRIMARY KEY ( id )
+) ENGINE = INNODB auto_increment = 1 COMMENT = '事故信息';
+
 
 -- 上传管理 菜单 SQL
 insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
@@ -1262,4 +1295,27 @@ values('三元组信息删除', @parentId, '4',  '#', '', 1, 0, 'F', '0', '0', '
 insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
 values('三元组信息导出', @parentId, '5',  '#', '', 1, 0, 'F', '0', '0', 'extract:info:export',       '#', 'admin', sysdate(), '', null, '');
 
+-- 事故信息 菜单 SQL
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('事故信息', '2176', '1', 'accident', 'uploadDetail/accident/index', 1, 0, 'C', '0', '0', 'uploadDetail:accident:list', '#', 'admin', sysdate(), '', null, '事故信息菜单');
+
+-- 按钮父菜单ID
+SELECT @parentId := LAST_INSERT_ID();
+
+-- 按钮 SQL
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('事故信息查询', @parentId, '1',  '#', '', 1, 0, 'F', '0', '0', 'uploadDetail:accident:query',        '#', 'admin', sysdate(), '', null, '');
+
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('事故信息新增', @parentId, '2',  '#', '', 1, 0, 'F', '0', '0', 'uploadDetail:accident:add',          '#', 'admin', sysdate(), '', null, '');
+
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('事故信息修改', @parentId, '3',  '#', '', 1, 0, 'F', '0', '0', 'uploadDetail:accident:edit',         '#', 'admin', sysdate(), '', null, '');
+
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('事故信息删除', @parentId, '4',  '#', '', 1, 0, 'F', '0', '0', 'uploadDetail:accident:remove',       '#', 'admin', sysdate(), '', null, '');
+
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('事故信息导出', @parentId, '5',  '#', '', 1, 0, 'F', '0', '0', 'uploadDetail:accident:export',       '#', 'admin', sysdate(), '', null, '');
+
 -- 添加数据字典  kg_upload_type  kg_upload_template file_upload_status kg_extract_status extract_sub_task_list extract_sub_task_status