Bläddra i källkod

集成文档上传 解析文件 写入ES库

wukai 2 år sedan
förälder
incheckning
fe2588f0c1

+ 13 - 11
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocInfoServiceImpl.java

@@ -73,20 +73,10 @@ public class DocInfoServiceImpl implements IDocInfoService {
      */
     @Override
     public int insertDocInfo(DocInfo docInfo) {
-        String localFilePath = remoteFileService.localFilePath(docInfo.getDocPath()).getData();
         docInfo.setCreateTime(DateUtils.getNowDate());
 //        docInfo.setCreateYear(DateUtils.getCurrentYear());
-        return docInfoMapper.insertDocInfo(docInfo);
-    }
+        int re = docInfoMapper.insertDocInfo(docInfo);
 
-    /**
-     * 修改文档基本信息
-     *
-     * @param docInfo 文档基本信息
-     * @return 结果
-     */
-    @Override
-    public int updateDocInfo(DocInfo docInfo) {
         String localFilePath = remoteFileService.localFilePath(docInfo.getDocPath()).getData();
         File file = new File(localFilePath);
         //文件大小
@@ -113,6 +103,18 @@ public class DocInfoServiceImpl implements IDocInfoService {
         }
         System.err.println(file.length());
         docInfo.setUpdateTime(DateUtils.getNowDate());
+        return re;
+    }
+
+    /**
+     * 修改文档基本信息
+     *
+     * @param docInfo 文档基本信息
+     * @return 结果
+     */
+    @Override
+    public int updateDocInfo(DocInfo docInfo) {
+
         return docInfoMapper.updateDocInfo(docInfo);
     }