Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

liuyc 2 éve
szülő
commit
d9114aaddf
15 módosított fájl, 356 hozzáadás és 46 törlés
  1. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/InformationQueryFileDTO.java
  2. 44 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/InformationQueryFile.java
  3. 3 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java
  4. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryFileVO.java
  5. 5 2
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java
  6. 33 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryFileMapper.java
  7. 21 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryFileMapper.xml
  8. 30 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryFileService.java
  9. 4 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java
  10. 34 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryFileServiceImpl.java
  11. 49 7
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  12. 0 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  13. 12 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/bean/TableInfo.java
  14. 29 31
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FirstController.java
  15. 24 4
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/InformationQueryFileDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import org.springblade.business.entity.InformationQueryFile;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-09-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class InformationQueryFileDTO extends InformationQueryFile {
+	private static final long serialVersionUID = 1L;
+
+}

+ 44 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/InformationQueryFile.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2022-09-21
+ */
+@Data
+@TableName("u_information_query_file")
+@EqualsAndHashCode(callSuper = true)
+public class InformationQueryFile extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long queryId;
+	private String name;
+	private String sourceUrl;
+	private String pdfUrl;
+
+
+}

+ 3 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java

@@ -41,6 +41,9 @@ public interface InformationQueryClient {
                                           @RequestParam Integer classify,
                                           @RequestParam Integer sourceType,
                                           @RequestParam String isFirst,
+                                          @RequestParam String sourceUrl,
+                                          @RequestParam String pdfUrl,
+                                          @RequestParam String firstFileName,
                                           @RequestBody List<JSONObject> linkDataList);
 
 }

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryFileVO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import org.springblade.business.entity.InformationQueryFile;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2022-09-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class InformationQueryFileVO extends InformationQueryFile {
+	private static final long serialVersionUID = 1L;
+
+}

+ 5 - 2
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java

@@ -22,7 +22,10 @@ public class InformationQueryClientImpl implements InformationQueryClient {
     }
 
     @Override
-    public void saveOrUpdateInformationQueryData(String wbsId, String tableId, String businessId, String fileName, Integer classify, Integer sourceType, String isFirst, List<JSONObject> linkDataList) {
-        this.iInformationQueryService.saveOrUpdateInformationQueryData(wbsId, tableId, businessId, fileName, classify, sourceType, isFirst, linkDataList);
+    public void saveOrUpdateInformationQueryData(String wbsId, String tableId,
+                                                 String businessId, String fileName,
+                                                 Integer classify, Integer sourceType,
+                                                 String isFirst, String sourceUrl, String pdfUrl, String firstFileName, List<JSONObject> linkDataList) {
+        this.iInformationQueryService.saveOrUpdateInformationQueryData(wbsId, tableId, businessId, fileName, classify, sourceType, isFirst, sourceUrl, pdfUrl, firstFileName, linkDataList);
     }
 }

+ 33 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryFileMapper.java

@@ -0,0 +1,33 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.mapper;
+
+import org.springblade.business.entity.InformationQueryFile;
+import org.springblade.business.vo.InformationQueryFileVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-09-21
+ */
+public interface InformationQueryFileMapper extends BaseMapper<InformationQueryFile> {
+
+}

+ 21 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryFileMapper.xml

@@ -0,0 +1,21 @@
+<?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="org.springblade.business.mapper.InformationQueryFileMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="informationQueryFileResultMap" type="org.springblade.business.entity.InformationQueryFile">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="query_id" property="queryId"/>
+        <result column="name" property="name"/>
+        <result column="source_url" property="sourceUrl"/>
+        <result column="pdf_url" property="pdfUrl"/>
+    </resultMap>
+
+</mapper>

+ 30 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryFileService.java

@@ -0,0 +1,30 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service;
+
+import org.springblade.business.entity.InformationQueryFile;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2022-09-21
+ */
+public interface IInformationQueryFileService extends BaseService<InformationQueryFile> {
+
+}

+ 4 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java

@@ -69,7 +69,10 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
 	 * @param classify 1施工2质检
 	 * @param sourceType 1原生2数据化
 	 */
-	void saveOrUpdateInformationQueryData(String wbsId, String tableId, String businessId, String fileName, Integer classify, Integer sourceType, String isFirst, List<JSONObject> linkDataList);
+	void saveOrUpdateInformationQueryData(String wbsId, String tableId,
+										  String businessId, String fileName,
+										  Integer classify, Integer sourceType,
+										  String isFirst, String sourceUrl, String pdfUrl, String firstFileName, List<JSONObject> linkDataList);
 
 	/**
 	 * 获取当前合同段下所有的上报批次

+ 34 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryFileServiceImpl.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import org.springblade.business.entity.InformationQueryFile;
+import org.springblade.business.mapper.InformationQueryFileMapper;
+import org.springblade.business.service.IInformationQueryFileService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2022-09-21
+ */
+@Service
+public class InformationQueryFileServiceImpl extends BaseServiceImpl<InformationQueryFileMapper, InformationQueryFile> implements IInformationQueryFileService {
+
+}

+ 49 - 7
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -6,12 +6,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
 import org.apache.http.client.utils.DateUtils;
-import org.springblade.business.entity.FirstInformation;
-import org.springblade.business.entity.InformationQuery;
-import org.springblade.business.entity.Task;
-import org.springblade.business.entity.TaskParallel;
+import org.springblade.business.entity.*;
 import org.springblade.business.feign.TaskClient;
 import org.springblade.business.service.IFirstInformationService;
+import org.springblade.business.service.IInformationQueryFileService;
 import org.springblade.business.service.ITaskParallelService;
 import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.FileUserVO;
@@ -61,6 +59,8 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
 	private final NewIOSSClient newIOSSClient;
 
+	private final IInformationQueryFileService informationQueryFileService;
+
 	@Override
 	public List<String> queryBusinessTableData(String formDataId) {
 		//获取具体业务数据
@@ -158,7 +158,11 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
 	}
 
-	private void saveOrUpdateFirstInformationQueryData(String primaryKeyId, String tableId, String businessId, String fileName, Integer classify, Integer sourceType, List<JSONObject> linkDataList){
+	private void saveOrUpdateFirstInformationQueryData(String primaryKeyId, String tableId,
+													   String businessId, String fileName,
+													   Integer classify, Integer sourceType,
+													   String sourceUrl,
+													   String pdfUrl, String firstFileName, List<JSONObject> linkDataList){
 
 		BladeUser user = AuthUtil.getUser();
 		//获取绑定的节点信息
@@ -190,6 +194,29 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 			//重新添加并处理合并的pdf
 			this.updateLinkMergePdfUrl(linkDataList, oldData, businessId);
 
+			//找到关联附件
+			InformationQueryFile file = this.informationQueryFileService.getOne(Wrappers.<InformationQueryFile>lambdaQuery().eq(InformationQueryFile::getQueryId, businessId));
+			if(file != null){
+				file.setName(firstFileName);
+				file.setPdfUrl(pdfUrl);
+				file.setSourceUrl(sourceUrl);
+
+				file.setUpdateTime(new Date());
+				file.setUpdateUser(AuthUtil.getUserId());
+				//修改
+				this.informationQueryFileService.updateById(file);
+			} else {
+				file = new InformationQueryFile();
+				file.setQueryId(Long.parseLong(businessId));
+				file.setName(firstFileName);
+				file.setPdfUrl(pdfUrl);
+				file.setSourceUrl(sourceUrl);
+				file.setCreateUser(AuthUtil.getUserId());
+				file.setCreateTime(new Date());
+
+				this.informationQueryFileService.save(file);
+			}
+
 			//修改数据
 			this.baseMapper.updateById(oldData);
 
@@ -228,6 +255,17 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
 			newData.setTableId(tableId);
 
+			//新增附件
+			InformationQueryFile file = new InformationQueryFile();
+			file.setQueryId(Long.parseLong(businessId));
+			file.setName(firstFileName);
+			file.setPdfUrl(pdfUrl);
+			file.setSourceUrl(sourceUrl);
+			file.setCreateUser(AuthUtil.getUserId());
+			file.setCreateTime(new Date());
+
+			this.informationQueryFileService.save(file);
+
 			//保存数据
 			this.baseMapper.insert(newData);
 
@@ -236,11 +274,15 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 	}
 
 	@Override
-	public void saveOrUpdateInformationQueryData(String primaryKeyId, String tableId, String businessId, String fileName, Integer classify, Integer sourceType, String isFirst, List<JSONObject> linkDataList) {
+	public void saveOrUpdateInformationQueryData(String primaryKeyId, String tableId,
+												 String businessId, String fileName,
+												 Integer classify, Integer sourceType,
+												 String isFirst, String sourceUrl,
+												 String pdfUrl, String firstFileName, List<JSONObject> linkDataList) {
 		BladeUser user = AuthUtil.getUser();
 
 		if(StringUtils.isNotEmpty(isFirst) && "true".equals(isFirst)){
-			this.saveOrUpdateFirstInformationQueryData(primaryKeyId, tableId, businessId, fileName, classify, sourceType, linkDataList);
+			this.saveOrUpdateFirstInformationQueryData(primaryKeyId, tableId, businessId, fileName, classify, sourceType, sourceUrl, pdfUrl, firstFileName, linkDataList);
 		} else {
 			//首先根据wbsId获取合同段ID和项目ID
 			WbsTreeContract contractTree = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(primaryKeyId));

+ 0 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -31,7 +31,6 @@ import org.springblade.flow.core.feign.NewFlowClient;
 import org.springblade.flow.core.utils.FlowUtil;
 import org.springblade.flow.core.utils.TaskUtil;
 import org.springblade.flow.core.vo.FlowProcessVO;
-import org.springblade.manager.feign.WbsTreeContractClient;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 

+ 12 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/bean/TableInfo.java

@@ -40,6 +40,18 @@ public class TableInfo {
      */
     private List<Object> linkProcessList;
 
+    /**
+     * 源文件路径
+     */
+    private String sourceUrl;
+
+    /**
+     * pdfUrl
+     */
+    private String pdfUrl;
+
+    private String firstFileName;
+
     // =============================== 首件相关 end ===============================
 
     // =============================== 日志相关 start ===============================

+ 29 - 31
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FirstController.java

@@ -128,41 +128,39 @@ public class FirstController extends BladeController {
             @ApiImplicitParam(name = "file", value = "file", required = true),
             @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
     })
-    public R addBussFile(@RequestParam("file") MultipartFile file, Long pkeyId) {
-
-        // 直接删除以前记录
-        tableFileService.getBaseMapper().delete(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId,pkeyId).eq(TableFile::getType,3));
-
-        R<BladeFile> bladeFile = iossClient.addFileInfo(file);
-        BladeFile bladeFile1 = bladeFile.getData();
-        TableFile tableFile = new TableFile();
-        String fileExtension = FileUtil.getFileExtension(bladeFile1.getName());
-        tableFile.setTabId(pkeyId+"");
-        tableFile.setName(file.getOriginalFilename());
-        tableFile.setType(3); // 表示首件的附件
-        tableFile.setDomainUrl(bladeFile1.getLink());
-        tableFile.setIsDeleted(0);
-        tableFile.setExtension(fileExtension);
-
-        NewBladeFile newBladeFile = new NewBladeFile();
-        if(fileExtension.contains("xlsx")){
+    public R<JSONObject> addBussFile(@RequestParam("file") MultipartFile file, Long pkeyId) {
+        //上传源文件
+        R<BladeFile> sourceFileList = iossClient.addFileInfo(file);
+        BladeFile sourceFile = sourceFileList.getData();
+        //源文件路径
+        String sourceUrl = sourceFile.getLink();
+        //pdfUrl路径
+        String pdfUrl = "";
+        //文件名称
+        String fileExtension = StringUtils.isNotEmpty(file.getOriginalFilename()) ? file.getOriginalFilename() : FileUtil.getFileExtension(sourceFile.getName());
+
+        NewBladeFile newBladeFile = null;
+        if(fileExtension.contains("pdf")){
+            pdfUrl = sourceUrl;
+        } else if(fileExtension.contains("xls") || fileExtension.contains("xlsx")){
             newBladeFile = this.commonFileClient.excelToPdf(file);
-            tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
-        } else if(fileExtension.contains("xls")){
-            newBladeFile = this.commonFileClient.excelToPdf(file);
-            tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
         } else if(fileExtension.contains("docx")){
             newBladeFile = this.commonFileClient.wordToPdf(file);
-            tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
-        } else if(fileExtension.contains("png") || file.getOriginalFilename().contains("jpg")){
+        } else if(fileExtension.contains("png") || (StringUtils.isNotEmpty(file.getOriginalFilename()) && file.getOriginalFilename().contains("jpg"))){
             newBladeFile = this.commonFileClient.pngOrJpgToPdf(file);
-            tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
-        } else if(fileExtension.contains("pdf")){
-            tableFile.setDomainPdfUrl(bladeFile1.getLink());
         }
-        tableFile.setStatus("finished");
-        tableFileService.saveOrUpdate(tableFile);
-        return R.data(tableFile.getId());
+
+        if(newBladeFile != null){
+            pdfUrl = newBladeFile.getPdfUrl();
+        }
+
+        //返回数据
+        JSONObject result = new JSONObject();
+        result.put("sourceUrl", sourceUrl);
+        result.put("pdfUrl", pdfUrl);
+        result.put("fileName", file.getOriginalFilename());
+
+        return R.data(result);
     }
 
 
@@ -171,7 +169,7 @@ public class FirstController extends BladeController {
     @ApiOperationSupport(order = 3)
     @ApiOperation(value = "首件-pdf预览", notes = "首件列表ID")
     @ApiImplicitParam(name = "firstId", value = "pkeyId", required = true)
-    public R<String> getBussPdfInfo(String firstId) throws Exception {
+    public R<String> getBussPdfInfo(String firstId) {
         if(StringUtils.isNotEmpty(firstId)){
             //PDF路径集合
             List<String> pdfUrls = new ArrayList<>();

+ 24 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -160,7 +160,18 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 		if(dataInfo2.containsKey("firstId")){
 			tableInfo.setFirstId(dataInfo2.getString("firstId"));
 		}
-
+		//源文件
+		if(dataInfo2.containsKey("sourceUrl")){
+			tableInfo.setSourceUrl(dataInfo2.getString("sourceUrl"));
+		}
+		//pdfUrl
+		if(dataInfo2.containsKey("pdfUrl")){
+			tableInfo.setPdfUrl(dataInfo2.getString("pdfUrl"));
+		}
+		//文件名称
+		if(dataInfo2.containsKey("firstFileName")){
+			tableInfo.setFirstFileName(dataInfo2.getString("firstFileName"));
+		}
 	}
 
 	/**
@@ -231,6 +242,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 						 .fluentRemove("linkTabIds")
 						 .fluentRemove("recordTime")
 						 .fluentRemove("businessId")
+						 .fluentRemove("sourceUrl")
+						 .fluentRemove("pdfUrl")
+						 .fluentRemove("firstFileName")
 				         .fluentRemove("");
 				// 计算数据
 				LinkedHashMap<String,List<String>> dataMap =dataInfo2.keySet().stream().filter(e->e.contains("__")).collect(Collectors.groupingBy(e->e.split("__")[0], LinkedHashMap<String,List<String>>::new,Collectors.toList()));
@@ -430,6 +444,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 		} else {
 			firstId = SnowFlakeUtil.getId() + "";
 		}
+
+		//获取上传的文件相关
+		String sourceUrl = tableInfoList.get(0).getSourceUrl(),
+				pdfUrl = tableInfoList.get(0).getPdfUrl(),
+				firstFileName = tableInfoList.get(0).getFirstFileName();
+
 		//新增数据
 		for(TableInfo tableInfo : tableInfoList){
 			//获取字段信息
@@ -457,7 +477,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
 		try{
 			//新增或修改首件记录
-			this.informationQueryClient.saveOrUpdateInformationQueryData(firstNodeId, tableInfoList.get(0).getPkeyId() + "", firstId, "文件名称", Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "true", linkProcessList);
+			this.informationQueryClient.saveOrUpdateInformationQueryData(firstNodeId, tableInfoList.get(0).getPkeyId() + "", firstId, "文件名称", Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "true", sourceUrl, pdfUrl, firstFileName, linkProcessList);
 		}catch (Exception e){
 			e.printStackTrace();
 		}
@@ -512,7 +532,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 					fileName = StringUtils.isNotEmpty(fileName) ? fileName : "缺少文件提名配置";
 
 					//huangjn 保存成功后调用生成资料查询列表数据
-					this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId()+"", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfo.getClassify()), 2,"是否是首件(临时,暂时没用到)", new ArrayList<>());
+					this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId()+"", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfo.getClassify()), 2,"是否是首件(临时,暂时没用到)", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
 				}
 
 				UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
@@ -536,7 +556,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 					fileName = StringUtils.isNotEmpty(fileName) ? fileName : "缺少文件提名配置";
 
 					//huangjn 保存成功后调用生成资料查询列表数据
-					this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId()+"", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfoList.get(0).getClassify()), 2,"false", new ArrayList<>());
+					this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId()+"", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfoList.get(0).getClassify()), 2,"false", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
 				}catch (Exception e){
 					e.printStackTrace();
 				}