Kaynağa Gözat

文件待审核问题修改

QuYueTing 2 ay önce
ebeveyn
işleme
74480d965a

+ 8 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskFilesController.java

@@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.*;
 import com.management.platform.mapper.*;
-import com.management.platform.service.CompanyDingdingService;
-import com.management.platform.service.ProjectDocumentService;
-import com.management.platform.service.TaskFilesService;
-import com.management.platform.service.WxCorpInfoService;
+import com.management.platform.service.*;
 import com.management.platform.task.SFTPAsyncUploader;
 import com.management.platform.util.DocumentTypeUtil;
 import com.management.platform.util.FileUtil;
@@ -86,6 +83,10 @@ public class TaskFilesController {
     private TaskFilesService taskFilesService;
     @Autowired
     private TaskExecutorMapper taskExecutorMapper;
+    @Autowired
+    private PermissionService permissionService;
+    @Autowired
+    private SysFunctionService sysFunctionService;
 
     @PostMapping("/reUploadFile")
     public HttpRespMsg reUploadFile(@RequestParam Integer projectId,
@@ -598,9 +599,10 @@ public class TaskFilesController {
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",user.getCompanyId()));
         CompanyDingding dingding = companyDingdingService.getOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, user.getCompanyId()));
 
-        //审核通过的  或者是老文件 所有人都能看到
+        //审核通过的  或者是老文件 所有人都能看到;或是有查看待审核文件的权限的人
+        boolean canViewAuditFile = sysFunctionService.hasPriviledge(user.getRoleId(), "查看他人审核文件");
         //审核不通过的需要判断 登录人 是否是 文件上传人/审核人一、二中的一个 ,能则可以看到
-        List<TaskFiles> list = taskFilesMapper.getTaskFiles(taskId,user.getId());
+        List<TaskFiles> list = taskFilesMapper.getTaskFiles(taskId,user.getId(), canViewAuditFile);
 
         List<String> allIds = new ArrayList<>();
         List<String> chargeOneIds = list.stream().filter(t -> org.apache.commons.lang3.StringUtils.isNotBlank(t.getChargeOneId()))

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/OtherTaskFileInfoVO.java

@@ -14,6 +14,7 @@ public class OtherTaskFileInfoVO {
     private String creatorName;
 
     private String documentName;
+    private String url;
     private String finalChargeId;
     private String finalChargeName;
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/TaskFilesMapper.java

@@ -18,7 +18,7 @@ public interface TaskFilesMapper extends BaseMapper<TaskFiles> {
 
     List<Integer> getAllNeedChargeTaskIds();
 
-    List<TaskFiles> getTaskFiles(@Param("taskId") Integer taskId, @Param("userId") String userId);
+    List<TaskFiles> getTaskFiles(@Param("taskId") Integer taskId, @Param("userId") String userId, @Param("canViewAuditFiles") Boolean canViewAuditFiles);
 
     List<TaskFiles> getAllNeedChargeTaskFiles();
 

+ 0 - 24
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -1009,35 +1009,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 .eq(User::getIsActive, 1)
         );
 
-//        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",user.getCompanyId()));
-//        CompanyDingding dingding = companyDingdingService.getOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, user.getCompanyId()));
-
         if(CollectionUtils.isNotEmpty(list)){
             Map<String, User> userMap = users.stream().collect(Collectors.toMap(User::getId, t -> t));
             for (OtherTaskFileInfoVO otherTaskFileInfoVO : list) {
                 User chargeUser = userMap.getOrDefault(otherTaskFileInfoVO.getFinalChargeId(), null);
                 otherTaskFileInfoVO.setFinalChargeName(null==chargeUser?"":chargeUser.getName());
-//                User createrUser = userMap.get(otherTaskFileInfoVO.getCreatorId());
-//                User finalChargeUser = userMap.get(otherTaskFileInfoVO.getFinalChargeId());
-//                String createrUserWxId = "";
-//                String chargeUserWxId = "";
-//                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-//                    createrUserWxId = createrUser.getCorpwxRealUserid();
-//                    chargeUserWxId = finalChargeUser.getCorpwxRealUserid();
-//                }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
-//                    createrUserWxId = createrUser.getDingdingUserid();
-//                    chargeUserWxId = finalChargeUser.getDingdingUserid();
-//                }
-//                if(StringUtils.isNotBlank(createrUserWxId)){
-//                    otherTaskFileInfoVO.setCreatorName("$userName=" + createrUserWxId + "$");
-//                }else{
-//                    otherTaskFileInfoVO.setCreatorName(createrUser.getName());
-//                }
-//                if(StringUtils.isNotBlank(chargeUserWxId)){
-//                    otherTaskFileInfoVO.setFinalChargeName("$userName=" + chargeUserWxId + "$");
-//                }else{
-//                    otherTaskFileInfoVO.setFinalChargeName(finalChargeUser.getName());
-//                }
             }
         }
 

+ 5 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskFilesMapper.xml

@@ -32,11 +32,13 @@
         select *
         from task_files
         where task_id = #{taskId}
-          and (
+        <if test="!canViewAuditFiles">
+            and (
             charge_one_id = #{userId} or charge_two_id = #{userId} or creator_id = #{userId}
-                or need_file_charge = 0
-                or final_charge_status = 1
+            or need_file_charge = 0
+            or final_charge_status = 1
             )
+        </if>
         ORDER BY indate desc
     </select>
     <select id="getAllNeedChargeTaskFiles" resultType="com.management.platform.entity.TaskFiles">

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml

@@ -741,7 +741,7 @@
         group by project_id
     </select>
     <select id="getOtherTaskChargePage" resultType="com.management.platform.entity.vo.OtherTaskFileInfoVO">
-        select tf.task_id,task.name as taskName
+        select tf.task_id,task.name as taskName,tf.url
         ,p.id as projectId,p.project_name,task.group_id
         ,tf.creator_id,tf.creator_name,tf.document_name
         ,case tf.charge_stage

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -249,7 +249,7 @@
                             </div>
                         </template>
                     </el-table-column>
-                    <el-table-column label="文件名称" v-if="documentRadios == '待他人审核'">
+                    <el-table-column label="文件名称" v-if="documentRadios == '待他人审核'" prop="documentName">
                         <template slot-scope="scope">
                             <el-link @click.stop.native="viewOnline(scope.row)">
                                 {{scope.row.documentName}}