|
@@ -1,6 +1,7 @@
|
|
|
package com.jeeplus.business.program.configuration.projectDict.service;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.google.common.collect.Lists;
|
|
@@ -10,8 +11,13 @@ import com.jeeplus.business.program.configuration.projectDict.domain.ProgramProj
|
|
|
import com.jeeplus.business.program.configuration.projectDict.domain.vo.FileDictVo;
|
|
|
import com.jeeplus.business.program.configuration.projectDict.mapper.ProjectDictMapper;
|
|
|
import com.jeeplus.business.program.configuration.projectDict.service.dto.ProjectDictDto;
|
|
|
+import com.jeeplus.business.project.domain.JyProject;
|
|
|
+import com.jeeplus.business.project.mapper.JyProjectArchiveMapper;
|
|
|
+import com.jeeplus.business.project.mapper.JyProjectEiaQualificationMapper;
|
|
|
+import com.jeeplus.business.project.mapper.JyProjectMapper;
|
|
|
import com.jeeplus.business.project.mapper.JyProjectOutinstanceMapper;
|
|
|
import com.jeeplus.common.TokenProvider;
|
|
|
+import com.jeeplus.flowable.feign.IFlowableApi;
|
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
//import com.jeeplus.sys.utils.UserUtils;
|
|
@@ -38,6 +44,15 @@ public class ProjectDictService {
|
|
|
@Resource
|
|
|
private JyProjectOutinstanceMapper jyProjectOutinstanceMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private JyProjectMapper jyProjectMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private JyProjectEiaQualificationMapper jyProjectEiaQualificationMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private JyProjectArchiveMapper jyProjectArchiveMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询
|
|
|
* @param projectDictDto
|
|
@@ -152,9 +167,12 @@ public class ProjectDictService {
|
|
|
/**
|
|
|
* 查询
|
|
|
* @param projectDictDto
|
|
|
+ * @param id
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<FileDictVo> getFileDictList(ProjectDictDto projectDictDto,String projectId) {
|
|
|
+ public List<FileDictVo> getFileDictList(ProjectDictDto projectDictDto, String id, String projectId) {
|
|
|
+ //获取当前登陆人信息
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
List<FileDictVo> list = new ArrayList<>();
|
|
|
if (StringUtils.isNotEmpty(projectDictDto.getAttachmentProjectType())) {
|
|
|
//查询父级
|
|
@@ -168,20 +186,52 @@ public class ProjectDictService {
|
|
|
list.addAll(dictVos);
|
|
|
}
|
|
|
List<WorkAttachmentInfoDTO> fileList = Lists.newArrayList();
|
|
|
+ String stage="";
|
|
|
+ //获取当前项目处于哪个阶段
|
|
|
+ JyProject jyProject = jyProjectMapper.getById(id);
|
|
|
+ //获取当前节点审核人
|
|
|
+ List<String> users = SpringUtil.getBean(IFlowableApi.class).getTaskAuditUsers(jyProject.getTaskIdEia());
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(jyProject.getOutInstanceId()) || StringUtils.isNotBlank(jyProject.getArchiveId()) || StringUtils.isNotBlank(jyProject.getEiaId())){
|
|
|
+ //设置必填项
|
|
|
+ //外审
|
|
|
+ if (jyProject.getOutInstanceId().equals(projectId)){
|
|
|
+ stage="2";
|
|
|
+ }
|
|
|
+ //如果是环评项目,则需要在设置审核阶段的必填项
|
|
|
+ if (jyProject.getEiaId().equals(projectId)){
|
|
|
+ stage="1";
|
|
|
+ //判断当前登录人是否是节点审核人
|
|
|
+ if (ObjectUtil.isNotEmpty(users)){
|
|
|
+ for (String user : users) {
|
|
|
+ if (user.equals(userDTO.getId())){
|
|
|
+ stage= "4";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //归档
|
|
|
+ if (jyProject.getArchiveId().equals(projectId)){
|
|
|
+ stage="3";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
for (FileDictVo dictVo : list) {
|
|
|
- if(StringUtils.isNotBlank(dictVo.getRequiredStage()) && dictVo.getRequiredStage().equals("2")){
|
|
|
+ if(StringUtils.isNotBlank(dictVo.getRequiredStage()) && dictVo.getRequiredStage().equals(stage)){
|
|
|
dictVo.setMustFlag(1);
|
|
|
}else{
|
|
|
dictVo.setMustFlag(0);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(dictVo.getType())){
|
|
|
+ //此处为子集菜单,需根据项目id和附件类型id查询对应附件信息
|
|
|
+ dictVo.setLevelFlag(2);
|
|
|
// 查询附件信息
|
|
|
List<WorkAttachmentInfoDTO> files = jyProjectOutinstanceMapper.getFileListByAttachmentAndModuleType(dictVo.getId(), projectId);
|
|
|
if (CollectionUtils.isNotEmpty(files)) {
|
|
|
fileList.addAll(files);
|
|
|
+ continue;
|
|
|
}
|
|
|
- //此处为子集菜单,需根据项目id和附件类型id查询对应附件信息
|
|
|
- dictVo.setLevelFlag(2);
|
|
|
}else{
|
|
|
dictVo.setLevelFlag(1);
|
|
|
}
|
|
@@ -194,8 +244,8 @@ public class ProjectDictService {
|
|
|
info.setParentId(workAttachmentInfoDTO.getAttachmentId());
|
|
|
info.setAttachmentName(workAttachmentInfoDTO.getAttachmentName());
|
|
|
info.setWorkAttachmentType(workAttachmentInfoDTO.getType());
|
|
|
- info.setSize(workAttachmentInfoDTO.getSize());
|
|
|
- info.setCreateTime(workAttachmentInfoDTO.getCreateTime());
|
|
|
+ info.setFileSize(workAttachmentInfoDTO.getFileSize());
|
|
|
+ info.setCreateDate(workAttachmentInfoDTO.getCreateTime());
|
|
|
info.setUrl(workAttachmentInfoDTO.getUrl());
|
|
|
//此处为子集菜单,需根据项目id和附件类型id查询对应附件信息
|
|
|
info.setLevelFlag(3);
|