Memory_LG 1 рік тому
батько
коміт
37f6ce8f2f

+ 11 - 0
data-ui/src/views/data/housingconstruction/enterpriseproductionreport/index.vue

@@ -1,6 +1,16 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="所属企业" prop="enterpriseId">
+        <el-select v-model="queryParams.enterpriseId" placeholder="请选择所属企业">
+          <el-option
+            v-for="data in enterpriseList"
+            :key="data.id"
+            :label="data.enterpriseName"
+            :value="data.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="报告类型" prop="reportType">
         <el-select v-model="queryParams.reportType" placeholder="请选择报告类型" clearable size="small">
           <el-option
@@ -170,6 +180,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         reportType: null,
+        enterpriseId: null,
       },
       // 表单参数
       form: {

+ 3 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/service/ICenterdataTHousingconstructionAttachService.java

@@ -34,4 +34,7 @@ public interface ICenterdataTHousingconstructionAttachService {
     int addAttach(List<Map<String, Object>> attachList, String busId);
     //查询附件;响应:List<Map<String>>
     Map<String, Object> getAttachToMap(String busId);
+
+
+    String replasePathToFile(String busId,String type);
 }

+ 33 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/service/impl/CenterdataTHousingconstructionAttachServiceImpl.java

@@ -13,6 +13,8 @@ import org.springframework.stereotype.Service;
 
 import java.util.*;
 
+import static com.sooka.sponest.data.utils.DataConstants.DOWNLOAD_URL;
+
 /**
  * 住建-附件Service业务层处理
  *
@@ -217,4 +219,35 @@ public class CenterdataTHousingconstructionAttachServiceImpl implements ICenterd
             }
         });
     }
+
+    @Override
+    public String replasePathToFile(String busId,String type){
+        List<CenterdataTHousingconstructionAttach> attachList = getAttachPathToEntityArray(busId);
+
+        StringBuilder newDiles = new StringBuilder();
+
+        String fileurl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey(DOWNLOAD_URL).getData();
+
+        attachList.forEach(attach->{
+            if(StringUtils.isNotEmpty(type)){
+                if(type.equals(attach.getDictType())){
+                    String filename = attach.getFileName(); //新建 Microsoft Excel 工作表 (2).xlsx
+                    String url = attach.getAttachPath().substring(attach.getAttachPath().indexOf("group1"),attach.getAttachPath().length()); //group1/M00/00/84/wKgKEGawNfGAW7bwAAAxRySSUAM25.xlsx
+                    String group = url.substring(0, url.indexOf('/')); //group1
+                    newDiles.append(fileurl + "Download?fileName=" + filename + "&&group=" + group + "&&path=" + url.substring(url.indexOf('/') + 1) + "+" + filename + ",");
+                }
+            }else{
+                if(type.equals(attach.getDictValue())){
+                    String filename = attach.getFileName(); //新建 Microsoft Excel 工作表 (2).xlsx
+                    String url = attach.getAttachPath().substring(attach.getAttachPath().indexOf("group1"),attach.getAttachPath().length()); //group1/M00/00/84/wKgKEGawNfGAW7bwAAAxRySSUAM25.xlsx
+                    String group = url.substring(0, url.indexOf('/')); //group1
+                    newDiles.append(fileurl + "Download?fileName=" + filename + "&&group=" + group + "&&path=" + url.substring(url.indexOf('/') + 1) + "+" + filename + ",");
+                }
+            }
+        });
+        if(newDiles.length() > 0){
+            newDiles.deleteCharAt(newDiles.length() - 1);
+        }
+        return newDiles.toString();
+    }
 }

+ 3 - 3
src/main/java/com/sooka/sponest/data/housingconstruction/service/impl/CenterdataTHousingconstructionEnterpriseproductionreportServiceImpl.java

@@ -43,7 +43,7 @@ public class CenterdataTHousingconstructionEnterpriseproductionreportServiceImpl
     public CenterdataTHousingconstructionEnterpriseproductionreport selectCenterdataTHousingconstructionEnterpriseproductionreportById(String id) {
         CenterdataTHousingconstructionEnterpriseproductionreport report = centerdataTHousingconstructionEnterpriseproductionreportMapper.selectCenterdataTHousingconstructionEnterpriseproductionreportById(id);
 
-        List<CenterdataTHousingconstructionAttach> attachList = attachService.getAttachPathToEntityArray(id);
+        /*List<CenterdataTHousingconstructionAttach> attachList = attachService.getAttachPathToEntityArray(id);
         StringBuilder newDiles = new StringBuilder();
 
         String fileurl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey(DOWNLOAD_URL).getData();
@@ -58,8 +58,8 @@ public class CenterdataTHousingconstructionEnterpriseproductionreportServiceImpl
         });
         if(newDiles.length() > 0){
             newDiles.deleteCharAt(newDiles.length() - 1);
-        }
-        report.setFileUrl(newDiles.toString());
+        }*/
+        report.setFileUrl(attachService.replasePathToFile(id,null));
         return report;
     }
 

+ 3 - 3
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionEnterpriseproductionreportMapper.xml

@@ -25,11 +25,11 @@
             resultMap="CenterdataTHousingconstructionEnterpriseproductionreportResult">
         <include refid="selectCenterdataTHousingconstructionEnterpriseproductionreportVo"/>
         <where>
-            <if test="enterpriseName != null and enterpriseName != ''">
-                enterprise_name like concat('%', #{enterpriseName}, '%')
+            <if test="enterpriseId != null and enterpriseId != ''">
+                and enterprise_id = #{enterpriseId}
             </if>
             <if test="reportType != null and reportType != ''">
-                report_type = #{reportType}
+                and report_type = #{reportType}
             </if>
         </where>
         order by create_time desc