Selaa lähdekoodia

文件收集不显示档案收集新增的文件,档案调整,档案预警显示。新增接口在档案收集编辑时替换档案URL

qianxb 2 vuotta sitten
vanhempi
commit
7d2a53ac9f

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

@@ -134,4 +134,7 @@ public interface ArchiveFileClient {
 
     @PostMapping(API_PREFIX + "/getListByContractId")
     List<ArchiveFile> getListByContractId(@RequestParam Long contractId);
+
+    @PostMapping(API_PREFIX + "/updateById2")
+    void updateById2(@RequestBody ArchiveFile archiveFile);
 }

+ 27 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveFileAutoController.java

@@ -135,7 +135,34 @@ ArchiveFileAutoController extends BladeController {
                     if (archivesAuto!= null ) {
                         archive.setAutoFileSort(archivesAuto.getAutoFileSort());
                     }
+                    //如果有替换文件,则替换
+                    List<ArchivesAutoVO.ApprovalFile> list = archive.getApprovalFileList();
+                    if (list != null && list.size() > 0) {
+                        //修改档案下的文件
+                        ArchivesAutoVO.ApprovalFile file = list.get(0);
+                        List<ArchiveFile> files = archiveFileClient.getArchiveFileByArchiveID(archive.getId());
+                        if (files != null && files.size() > 0){
+                            //档案收集的只会生成一个文件
+                            ArchiveFile archiveFile = files.get(0);
+                            archiveFile.setFileUrl(file.getFileUrl());
+                            archiveFile.setPdfFileUrl(file.getPdfFileUrl());
+                            archiveFile.setFilePage(file.getFilePage());
+                            archiveFile.setFileSize(file.getFileSize());
+                            //因为案卷提名可能修改,所以修改文件的名称
+                            archiveFile.setFileName(archive.getName());
+                            archiveFile.setDutyUser(archive.getUnit());
+                            //如果当前档案状态为待整改,则修改为已整改
+                            if (archiveFile.getRectification() != null && archiveFile.getRectification() == 1){
+                                archiveFile.setRectification(2);
+                            }
+                            //只修改档案的文件大小和页数
+                            archive.setPageN(file.getFilePage());
+                            archive.setFileSize(file.getFileSize());
+                            archiveFileClient.updateById2(archiveFile);
+                        }
+                    }
                     archivesAutoService.updateById(archive);
+
                 }
             }
         } catch (NumberFormatException e) {

+ 5 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ArchiveFileClientImpl.java

@@ -315,4 +315,9 @@ public class ArchiveFileClientImpl implements ArchiveFileClient {
         return fileMapper.getListByContractId(contractId);
     }
 
+    @Override
+    public void updateById2(ArchiveFile archiveFile) {
+        iArchiveFileService.updateById(archiveFile);
+    }
+
 }

+ 17 - 11
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ArchiveFileMapper.xml

@@ -88,17 +88,20 @@
         <if test="vo.rectification != null and vo.rectification != ''">
             and u.rectification = #{vo.rectification}
         </if>
-        <choose>
-            <when test="vo.isArchive != null and vo.isArchive != ''">
-                and u.is_auto_file = #{vo.isArchive}
-            </when>
-            <when test="vo.archiveId != null and vo.archiveId != ''">
-                and 1=1
-            </when>
-            <otherwise>
-                and (u.is_auto_file is null or u.is_auto_file != 1)
-            </otherwise>
-        </choose>
+        <if test="vo.rectification == null and vo.archiveId == null">
+            and (u.is_auto_file is null or u.is_auto_file != 1)
+        </if>
+<!--        <choose>-->
+<!--            <when test="vo.isArchive != null and vo.isArchive != ''">-->
+<!--                and u.is_auto_file = #{vo.isArchive}-->
+<!--            </when>-->
+<!--            <when test="vo.archiveId != null and vo.archiveId != ''">-->
+<!--                and 1=1-->
+<!--            </when>-->
+<!--            <otherwise>-->
+<!--                and (u.is_auto_file is null or u.is_auto_file != 1)-->
+<!--            </otherwise>-->
+<!--        </choose>-->
         <if test="vo.nodeIds != null and vo.nodeIds != ''">
             and u.node_id in
             <foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
@@ -138,6 +141,9 @@
         <if test="vo.rectification != null and vo.rectification != ''">
             and u.rectification = #{vo.rectification}
         </if>
+        <if test="vo.rectification == null and vo.archiveId == null">
+            and (u.is_auto_file is null or u.is_auto_file != 1)
+        </if>
 <!--        <choose>-->
 <!--            <when test="vo.isArchive != null and vo.isArchive != ''">-->
 <!--                and u.is_auto_file = #{vo.isArchive}-->