瀏覽代碼

Merge branch 'zhifk0606'

“zhifk” 2 年之前
父節點
當前提交
1ae12c74be

+ 22 - 0
blade-service-api/blade-archive-api/src/main/java/org/springblade/archive/feign/ArchiveInspectionInfoClient.java

@@ -0,0 +1,22 @@
+package org.springblade.archive.feign;
+
+import org.springblade.archive.dto.ArchiveInspectionDTO;
+import org.springblade.archive.entity.ArchivesAuto;
+import org.springblade.common.constant.ArchiveConstant;
+import org.springblade.core.tool.api.R;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+import java.util.Map;
+
+@FeignClient(value = ArchiveConstant.APPLICATION_WEATHER_NAME)
+public interface ArchiveInspectionInfoClient {
+    String API_PREFIX = "/api/archive/archiveInspectionInfo";
+
+    @PostMapping(API_PREFIX + "/getAllopinion")
+    Map<String, Map<String,Object>> getAllopinion(@RequestParam String fileIds);
+}

+ 6 - 1
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ArchiveFileVO.java

@@ -89,5 +89,10 @@ public class ArchiveFileVO extends ArchiveFile {
      * 是否更改文件地址 0 未更改,1已更改
      */
     private Integer isUpdateUrl;
-
+    //所有的意见
+    private String allOpinion;
+    /**
+     * 案卷题名
+     */
+    private String archiveName;
 }

+ 3 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveInspectionInfoController.java

@@ -71,6 +71,9 @@ public class ArchiveInspectionInfoController {
         ArchiveInspection archiveInspectionMod = archiveInspectionService.getById(archiveInspection.getId());
         if (archiveInspectionMod!= null ) {
             archiveInspectionMod.setOpinion(archiveInspection.getOpinion());
+        }else{
+            archiveInspection.setId(null);
+            return this.addArchiveInspection(archiveInspection);
         }
         return R.status(archiveInspectionService.saveOrUpdate(archiveInspectionMod));
     }

+ 25 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/feign/ArchiveInspectionInfoClientImpl.java

@@ -0,0 +1,25 @@
+package org.springblade.archive.feign;
+
+import lombok.AllArgsConstructor;
+import org.springblade.archive.dto.ArchiveInspectionDTO;
+import org.springblade.archive.entity.ArchivesAuto;
+import org.springblade.archive.service.IArchiveInspectionService;
+import org.springblade.archive.service.IArchivesAutoService;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@AllArgsConstructor
+public class ArchiveInspectionInfoClientImpl implements ArchiveInspectionInfoClient {
+
+    private IArchiveInspectionService iArchiveInspectionService;
+
+    @Override
+    public Map<String, Map<String,Object>> getAllopinion(String fileIds) {
+        return iArchiveInspectionService.getAllopinion(fileIds);
+    }
+}

+ 5 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/service/IArchiveInspectionService.java

@@ -4,6 +4,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import org.springblade.archive.dto.ArchiveInspectionDTO;
 import org.springblade.archive.entity.ArchiveInspection;
 
+import java.util.List;
+import java.util.Map;
+
 public interface IArchiveInspectionService extends IService<ArchiveInspection> {
     ArchiveInspectionDTO getbyFileId(Long fileId, Long userId);
+
+    Map<String,Map<String,Object>> getAllopinion(String fileIds);
 }

+ 44 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveInspectionServiceImpl.java

@@ -11,7 +11,10 @@ import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @Service
 @AllArgsConstructor
@@ -44,4 +47,45 @@ public class ArchiveInspectionServiceImpl extends BaseServiceImpl<ArchiveInspect
         archiveInspectionDTO.setAllOpinion(allOpinion);
         return archiveInspectionDTO;
     }
+
+    @Override
+    public Map<String,Map<String,Object>> getAllopinion(String fileIds) {
+
+        LambdaQueryWrapper<ArchiveInspection> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.in(ArchiveInspection::getFileId, fileIds.split(","))
+                .eq(ArchiveInspection::getIsDeleted, 0);
+        List<ArchiveInspection> archiveInspectionList = archiveInspectionMapper.selectList(queryWrapper);
+        if(archiveInspectionList == null || archiveInspectionList.isEmpty()) {
+            return null;
+        }
+        Map<String,List<ArchiveInspection>> listMap = new HashMap<>();
+        for(ArchiveInspection archiveInspection : archiveInspectionList){
+            List<ArchiveInspection> list = null;
+            if(listMap.get(archiveInspection.getFileId().toString()) != null){
+                list = listMap.get(archiveInspection.getFileId().toString());
+            }else{
+                list = new ArrayList<>();
+            }
+            list.add(archiveInspection);
+            listMap.put(archiveInspection.getFileId().toString(),list);
+        }
+        Map<String,Map<String,Object>> map = new HashMap<>();
+        String allOpinion = "";
+        for(String key : listMap.keySet()) {
+            List<ArchiveInspection> inspections = listMap.get(key);
+            int count = 1;
+            for (ArchiveInspection archiveInspection : inspections) {
+                String opinion = archiveInspection.getOpinion();
+                if (opinion != null && !opinion.trim().isEmpty()) {
+                    allOpinion += count + ". " + opinion.trim() + " ; ";
+                    count++;
+                }
+            }
+            Map<String,Object> map1 = new HashMap<>();
+            map1.put("allOpinion",allOpinion);
+            map1.put("ArchiveName",inspections.get(0).getArchiveName());
+            map.put(key,map1);
+        }
+        return map;
+    }
 }

+ 20 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ArchiveFileServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
+import org.springblade.archive.feign.ArchiveInspectionInfoClient;
 import org.springblade.business.entity.ArchiveFile;
 import org.springblade.business.vo.ArchiveFileVO;
 import org.springblade.business.mapper.ArchiveFileMapper;
@@ -36,6 +37,7 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
     private final NewIOSSClient iossClient;
 
     private ExecutorService executorService;
+    private final ArchiveInspectionInfoClient archiveInspectionInfoClient;
 
     @Override
     public IPage<ArchiveFileVO> selectArchiveFilePage(ArchiveFileVO vo) {
@@ -60,7 +62,7 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
 
         //获取业务字典
         List<DictBiz> sheetSourceList = this.dictBizClient.getList("sheet_source", "notRoot").getData();
-
+        StringBuffer fileIds = new StringBuffer();
         pageVoList.forEach(vos -> {
             vos.setIsApprovalValue(new Integer("0").equals(vos.getStatus()) ? "未上报" : new Integer("1").equals(vos.getStatus()) ? "待审批" : new Integer("2").equals(vos.getStatus()) ? "已审批" : "已废除");
             vos.setIsCertificationValue(new Integer("1").equals(vos.getIsCertification()) ? "已认证" : "未认证");
@@ -71,8 +73,25 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
                     }
                 });
             }
+            fileIds.append(vos.getId()+",");
         });
+        if(vo.getRectification() != null &&(vo.getRectification() == 1 || vo.getRectification() == 2)) {
+            Map<String, Map<String, Object>> allopinion = archiveInspectionInfoClient.getAllopinion(fileIds.toString());
+            if (allopinion != null) {
+                pageVoList.forEach(vos -> {
+                    Map<String, Object> map = allopinion.get(vos.getId().toString());
+                    if (map != null) {
+                        if (map.get("ArchiveName") != null) {
+                            vos.setArchiveName(map.get("ArchiveName").toString());
+                        }
+                        if (map.get("allOpinion") != null) {
+                            vos.setAllOpinion(map.get("allOpinion").toString());
+                        }
+                    }
 
+                });
+            }
+        }
         return iPage.setRecords(pageVoList);
     }
 

+ 6 - 3
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/MetadataClassificationServiceImpl.java

@@ -235,7 +235,10 @@ public class MetadataClassificationServiceImpl
 
             /**聚合层次**/
             ArchiveTreeContract archiveTreeContractById = archiveTreeContractClient.getArchiveTreeContractById(Long.parseLong(byId.getNodeId()));
-            List<ArchiveTreeContract> list = archiveTreeContractClient.getArchiveTreeContractListByIds(archiveTreeContractById.getAncestors());
+            String ancestors = archiveTreeContractById.getAncestors();
+            ancestors = ancestors.substring(ancestors.indexOf(","));
+            ancestors = ancestors + "," + archiveTreeContractById.getId();
+            List<ArchiveTreeContract> list = archiveTreeContractClient.getArchiveTreeContractListByIds(ancestors);
             StringBuffer nameStr = new StringBuffer();
             for (ArchiveTreeContract treeContract : list) {
                 nameStr.append(treeContract.getNodeName());
@@ -269,10 +272,10 @@ public class MetadataClassificationServiceImpl
             keyValue.put("题名", byId.getFileName());
             /**关键词**/
             String keyWords = "";
-            if (byId.getFileName().length() < 8) {
+            if (byId.getFileName().length() < 9) {
                 keyWords = byId.getFileName();
             } else {
-                keyWords = byId.getFileName().substring(0, 7);
+                keyWords = byId.getFileName().substring(0, 8);
             }
             keyValue.put("关键词", keyWords);
             /**摘要**/