“zhifk” 2 years ago
parent
commit
70661e3b90

+ 14 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveFileController.java

@@ -23,7 +23,9 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.evisa.feign.EVisaClient;
 import org.springblade.manager.entity.ArchiveTree;
 import org.springblade.manager.entity.ArchiveTreeContract;
+import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.feign.ArchiveTreeContractClient;
+import org.springblade.manager.feign.ContractClient;
 import org.springblade.manager.feign.WbsTreeContractClient;
 import org.springblade.resource.feign.IOSSClient;
 import org.springframework.web.bind.annotation.*;
@@ -54,6 +56,7 @@ public class ArchiveFileController extends BladeController {
     private final ArchiveTreeContractClient archiveTreeContractClient;
     private final EVisaClient eVisaClient;
     private final WbsTreeContractClient wbsTreeContractClient;
+    private final ContractClient contractClient;
     /**
      * 上传文件
      *
@@ -320,4 +323,15 @@ public class ArchiveFileController extends BladeController {
     public R removeAllocation(@RequestParam String boxName,@RequestParam Integer boxNumber) {
         return R.status(this.archiveFileClient.updateArchiveFileByBoxNameOne(boxName,boxNumber));
     }
+
+    /**
+     * 获取当前责任者
+     */
+    @GetMapping("/getDutyUser")
+    @ApiOperationSupport(order = 15)
+    @ApiOperation(value = "文件收集-上传文件责任者")
+    public R getDutyUser(Long contractId) {
+        ContractInfo contractById = contractClient.getContractById(contractId);
+        return R.data(contractById);
+    }
 }

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ArchiveFileMapper.java

@@ -36,7 +36,7 @@ public interface ArchiveFileMapper extends BaseMapper<ArchiveFile> {
 
 	Integer selectArchiveFilePageByBoxNameCount(@Param("vo") ArchiveFileVO vo);
 	/**
-	 * 自定义分页
+	 * 自定义分页 (如果有节点id传入,排序优先级按节点排序)
 	 */
 	List<ArchiveFile> selectArchiveFilePage(@Param("current") Integer current, @Param("size") Integer size, @Param("vo") ArchiveFileVO vo);
 

+ 45 - 33
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ArchiveFileMapper.xml

@@ -67,90 +67,102 @@
     </update>
 
     <select id="selectArchiveFileCount" resultType="java.lang.Integer">
-        select count(id) from u_archive_file where is_deleted = 0
+        select count(u.id) from u_archive_file u
+        <if test="vo.nodeIds != null and vo.nodeIds != ''">
+         left join m_archive_tree_contract t on t.id = u.node_id
+        </if>
+         where u.is_deleted = 0
         <if test="vo.isApprovalValue != null and vo.isApprovalValue != ''">
-            and status = #{vo.isApprovalValue}
+            and u.status = #{vo.isApprovalValue}
         </if>
         <if test="vo.isCertificationValue != null and vo.isCertificationValue != ''">
-            and is_certification = #{vo.isCertificationValue}
+            and u.is_certification = #{vo.isCertificationValue}
         </if>
         <if test="vo.projectId != null and vo.projectId != ''">
-            and project_id = #{vo.projectId}
+            and u.project_id = #{vo.projectId}
         </if>
         <if test="vo.archiveId != null and vo.archiveId != ''">
-            and archive_id = #{vo.archiveId}
+            and u.archive_id = #{vo.archiveId}
         </if>
         <choose>
             <when test="vo.isArchive != null and vo.isArchive != ''">
-                and  is_auto_file = #{vo.isArchive}
+                and  u.is_auto_file = #{vo.isArchive}
             </when>
             <when test="vo.archiveId != null and vo.archiveId != ''">
                 and 1=1
             </when>
             <otherwise>
-                and (is_auto_file is null or is_auto_file != 1)
+                and (u.is_auto_file is null or u.is_auto_file != 1)
             </otherwise>
         </choose>
         <if test="vo.nodeIds != null and vo.nodeIds != ''">
-            and node_id in
+            and u.node_id in
             <foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
                 #{nodeId}
             </foreach>
         </if>
         <if test="vo.queryValue != null and vo.queryValue != ''">
             and (
-                file_name like concat('%',#{vo.queryValue},'%') or
-                file_number like concat('%',#{vo.queryValue},'%') or
-                duty_user like concat('%',#{vo.queryValue},'%') or
-                sheet_source like concat('%',#{vo.queryValue},'%') or
-                drawing_no like concat('%',#{vo.queryValue},'%') or
-                cite_change_number like concat('%',#{vo.queryValue},'%')
+            u.file_name like concat('%',#{vo.queryValue},'%') or
+            u.file_number like concat('%',#{vo.queryValue},'%') or
+            u.duty_user like concat('%',#{vo.queryValue},'%') or
+            u.sheet_source like concat('%',#{vo.queryValue},'%') or
+            u.drawing_no like concat('%',#{vo.queryValue},'%') or
+            u.cite_change_number like concat('%',#{vo.queryValue},'%')
                 )
         </if>
     </select>
 
     <select id="selectArchiveFilePage" resultMap="archiveFileResultMap">
-        select * from u_archive_file where is_deleted = 0
+        select u.* from u_archive_file u
+        <if test="vo.nodeIds != null and vo.nodeIds != ''">
+            left join m_archive_tree_contract t on t.id = u.node_id
+        </if>
+        where u.is_deleted = 0
         <if test="vo.isApprovalValue != null and vo.isApprovalValue != ''">
-            and status = #{vo.isApprovalValue}
+            and u.status = #{vo.isApprovalValue}
         </if>
         <if test="vo.isCertificationValue != null and vo.isCertificationValue != ''">
-            and is_certification = #{vo.isCertificationValue}
+            and u.is_certification = #{vo.isCertificationValue}
         </if>
         <if test="vo.projectId != null and vo.projectId != ''">
-            and project_id = #{vo.projectId}
+            and u.project_id = #{vo.projectId}
         </if>
         <if test="vo.archiveId != null and vo.archiveId != ''">
-            and archive_id = #{vo.archiveId}
+            and u.archive_id = #{vo.archiveId}
         </if>
         <choose>
             <when test="vo.isArchive != null and vo.isArchive != ''">
-                and  is_auto_file = #{vo.isArchive}
+                and  u.is_auto_file = #{vo.isArchive}
             </when>
             <when test="vo.archiveId != null and vo.archiveId != ''">
                 and 1=1
             </when>
             <otherwise>
-                and (is_auto_file is null or is_auto_file != 1)
+                and (u.is_auto_file is null or u.is_auto_file != 1)
             </otherwise>
         </choose>
         <if test="vo.nodeIds != null and vo.nodeIds != ''">
-            and node_id in
+            and u.node_id in
             <foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
                 #{nodeId}
             </foreach>
         </if>
         <if test="vo.queryValue != null and vo.queryValue != ''">
             and (
-                file_name like concat('%',#{vo.queryValue},'%') or
-                file_number like concat('%',#{vo.queryValue},'%') or
-                duty_user like concat('%',#{vo.queryValue},'%') or
-                sheet_source like concat('%',#{vo.queryValue},'%') or
-                drawing_no like concat('%',#{vo.queryValue},'%') or
-                cite_change_number like concat('%',#{vo.queryValue},'%')
+            u.file_name like concat('%',#{vo.queryValue},'%') or
+            u.file_number like concat('%',#{vo.queryValue},'%') or
+            u.duty_user like concat('%',#{vo.queryValue},'%') or
+            u.sheet_source like concat('%',#{vo.queryValue},'%') or
+            u.drawing_no like concat('%',#{vo.queryValue},'%') or
+            u.cite_change_number like concat('%',#{vo.queryValue},'%')
             )
         </if>
-        order by sort,create_time DESC
+        order by
+        <if test="vo.nodeIds != null and vo.nodeIds != ''">
+             t.tree_sort,
+        </if>
+        u.sort,u.create_time
         limit #{current}, #{size}
     </select>
 
@@ -191,7 +203,7 @@
             cite_change_number like concat('%',#{vo.queryValue},'%')
             )
         </if>
-        order by box_number,sort,create_time DESC
+        order by box_number,sort,create_time
 
     </select>
     <select id="selectArchiveFilePageByBoxName" resultMap="archiveFileResultMap">
@@ -231,7 +243,7 @@
             cite_change_number like concat('%',#{vo.queryValue},'%')
             )
         </if>
-        order by box_number,sort,create_time DESC
+        order by box_number,sort,create_time
         limit #{current}, #{size}
     </select>
     <select id="getDeleteDataByIds" resultType="org.springblade.business.entity.ArchiveFile">
@@ -280,7 +292,7 @@
                 #{id}
             </foreach>
         </if>
-        order by sort,create_time DESC
+        order by sort,create_time
     </select>
     <select id="getArchiveFileByFileIds" resultMap="archiveFileResultMap">
         select * from u_archive_file where is_deleted = 0
@@ -290,7 +302,7 @@
                 #{id}
             </foreach>
         </if>
-        order by sort,create_time DESC
+        order by sort,create_time
     </select>
     <select id="getListByProjectId" resultType="org.springblade.business.entity.ArchiveFile">
         select id,project_id as projectId,node_id as nodeId,file_number as fileNumber,file_name as fileName,file_time as fileTime,file_url as fileUrl,pdf_file_url as pdfFileUrl,archive_id as archiveId,status,is_deleted as isDeleted,create_time as createTime

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

@@ -126,7 +126,9 @@ public class ArchiveFileServiceImpl extends BaseServiceImpl<ArchiveFileMapper, A
 			baseMapper.updateArchiveFileByBoxNameOne(boxName,boxNumber);
 			if(map.get("ids") != null ) {
 				String ids = (String) map.get("ids");
-				baseMapper.updateArchiveFileByBoxName(Func.toLongList(ids), boxName, boxNumber);
+				if(!ids.isEmpty()) {
+					baseMapper.updateArchiveFileByBoxName(Func.toLongList(ids), boxName, boxNumber);
+				}
 			}
 		}
 		return true;