合并分支 'feature_dev_20221008_TODO' 到 'dev_2nd_period_test'
Feature dev 20221008 todo 查看合并请求 laws-nio/laws-weilai!232
This commit is contained in:
+1
@@ -684,6 +684,7 @@ public class SysPermissionController {
|
||||
//项目参数任务
|
||||
if(StringUtils.equals(permission.getId(), SysPermissionEnum.PROJECT_PARAMETER_TASKS.getId())){
|
||||
boolean existTaskFlag = false;
|
||||
existTaskFlag = sysPermissionService.judgeToDo();
|
||||
meta.put("existTask",existTaskFlag);
|
||||
}
|
||||
json.put("meta", meta);
|
||||
|
||||
+7
@@ -2,6 +2,7 @@ package com.jero.modules.system.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -11,4 +12,10 @@ import java.util.Map;
|
||||
**/
|
||||
public interface TodoCenterMapper {
|
||||
int todoCenterTaskCount(@Param("params") Map<String, Object> params);
|
||||
|
||||
List<String> listInfoHomo(@Param("userId") String userId, @Param("state") String state);
|
||||
|
||||
Integer countSdtDre(@Param("userName") String userName);
|
||||
|
||||
Integer countState(@Param("manifestId") String manifestId);
|
||||
}
|
||||
|
||||
+35
@@ -18,4 +18,39 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="listInfoHomo" resultType="java.lang.String">
|
||||
SELECT pm.id
|
||||
FROM params_manifest pm
|
||||
JOIN ( SELECT id FROM
|
||||
( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id
|
||||
FROM
|
||||
project_library_base a
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
|
||||
WHERE user_id = #{userId}) a ON pm.project_id = a.id
|
||||
where pm.state = #{state}
|
||||
</select>
|
||||
|
||||
<select id="countSdtDre" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from (
|
||||
SELECT DISTINCT pcm.params_manifest_id AS pm
|
||||
FROM params_collect_manifest pcm
|
||||
WHERE sdt = #{userName}
|
||||
and state in ('2', '5')
|
||||
|
||||
UNION
|
||||
SELECT DISTINCT pcm.params_manifest_id AS pm
|
||||
FROM params_collect_manifest pcm
|
||||
WHERE dre = #{userName}
|
||||
and state in ('4', '7')
|
||||
) temp
|
||||
</select>
|
||||
|
||||
<select id="countState" resultType="java.lang.Integer">
|
||||
select count(1) from params_collect_manifest
|
||||
where params_manifest_id = ${manifestId} and id not in(
|
||||
select id from params_collect_manifest where params_manifest_id = ${manifestId} and state in('7','8')
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+4
-4
@@ -1,13 +1,11 @@
|
||||
package com.jero.modules.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.system.entity.SysPermission;
|
||||
import com.jero.modules.system.model.TreeModel;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -61,4 +59,6 @@ public interface ISysPermissionService extends IService<SysPermission> {
|
||||
* @return
|
||||
*/
|
||||
public boolean hasPermission(String username, String url);
|
||||
|
||||
boolean judgeToDo();
|
||||
}
|
||||
|
||||
+37
-14
@@ -1,33 +1,32 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.system.entity.SysPermission;
|
||||
import com.jero.modules.system.entity.SysPermissionDataRule;
|
||||
import com.jero.modules.system.mapper.SysDepartPermissionMapper;
|
||||
import com.jero.modules.system.mapper.SysDepartRolePermissionMapper;
|
||||
import com.jero.modules.system.mapper.SysPermissionMapper;
|
||||
import com.jero.modules.system.mapper.SysRolePermissionMapper;
|
||||
import com.jero.modules.system.mapper.*;
|
||||
import com.jero.modules.system.model.TreeModel;
|
||||
import com.jero.modules.system.service.ISysPermissionDataRuleService;
|
||||
import com.jero.modules.system.service.ISysPermissionService;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -55,6 +54,9 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
||||
@Resource
|
||||
private SysDepartRolePermissionMapper sysDepartRolePermissionMapper;
|
||||
|
||||
@Autowired
|
||||
private TodoCenterMapper todoCenterMapper;
|
||||
|
||||
@Override
|
||||
public List<TreeModel> queryListByParentId(String parentId) {
|
||||
return sysPermissionMapper.queryListByParentId(parentId);
|
||||
@@ -263,4 +265,25 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean judgeToDo() {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
int count = todoCenterMapper.countSdtDre(loginUser.getUsername());
|
||||
if (count > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
List<String> manifestIdList = todoCenterMapper.listInfoHomo(loginUser.getId(),"收集中");
|
||||
if(CollectionUtil.isNotEmpty(manifestIdList)) {
|
||||
for (int i = 0; i < manifestIdList.size(); i++) {
|
||||
int coutState = todoCenterMapper.countState(manifestIdList.get(i));
|
||||
if (coutState > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -17,6 +17,8 @@ import java.util.Map;
|
||||
public interface ParamsCollectManifestEOMapper extends BaseMapper<ParamsCollectManifestEO> {
|
||||
|
||||
List<ParamsCollectManifestEO> listInfo(@Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO);
|
||||
|
||||
List<ParamsCollectManifestEO> listInfoOfTodoCenter(@Param("manifestIdList") List<String> manifestIdList);
|
||||
List<Map<String, Object>> listInfoForExport(@Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO, @Param("ids") String ids);
|
||||
List<ParamsCollectManifestEO> listInfoOfTodoCenter();
|
||||
|
||||
|
||||
+3
@@ -31,4 +31,7 @@ public interface ParamsManifestEOMapper extends BaseMapper<ParamsManifestEO> {
|
||||
ParamsManifestVO getProjectById(@Param("projectId") String projectId);
|
||||
|
||||
List<Map<String, String>> labelListForProjectDetails(@Param("projectId") String projectId);
|
||||
|
||||
List<String> listInfoHomo(@Param("userId") String userId, @Param("state") String state);
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -86,6 +86,10 @@
|
||||
|
||||
<select id="listInfoOfTodoCenter" resultMap="ParamsCollectManifestEOResultMap">
|
||||
select id,nio_number,state,sdt,dre,params_manifest_id from params_collect_manifest
|
||||
where params_manifest_id in
|
||||
<foreach collection="manifestIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="listInfoForExport" resultType="java.util.LinkedHashMap">
|
||||
|
||||
+29
-1
@@ -136,12 +136,28 @@
|
||||
left join project_year_name_info as pyni on plb.year_name_id=pyni.id
|
||||
) tmp_tb
|
||||
where 1=1 and state = #{state}
|
||||
and id in(
|
||||
SELECT pm.id AS pm FROM params_manifest pm
|
||||
JOIN ( SELECT id FROM
|
||||
( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id
|
||||
FROM
|
||||
project_library_base a
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
|
||||
WHERE user_id = #{userId}) a ON pm.project_id = a.id
|
||||
|
||||
UNION
|
||||
SELECT DISTINCT pcm.params_manifest_id AS pm FROM params_collect_manifest pcm WHERE sdt = #{userName} and state in('2','5')
|
||||
|
||||
UNION
|
||||
SELECT DISTINCT pcm.params_manifest_id AS pm FROM params_collect_manifest pcm WHERE dre = #{userName} and state in('4','7')
|
||||
)
|
||||
<if test="projectName !=null and projectName !=''">
|
||||
AND project_name LIKE CONCAT(CONCAT('%',#{projectName}),'%')
|
||||
</if>
|
||||
<if test="title !=null and title !=''">
|
||||
AND title LIKE CONCAT(CONCAT('%',#{title}),'%')
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getProjectById" resultMap="ParamsManifestEOResultMapForCopy">
|
||||
@@ -164,4 +180,16 @@
|
||||
where project_id = #{projectId}
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
<select id="listInfoHomo" resultType="java.lang.String">
|
||||
SELECT pm.id
|
||||
FROM params_manifest pm
|
||||
JOIN ( SELECT id FROM
|
||||
( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id
|
||||
FROM
|
||||
project_library_base a
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
|
||||
WHERE user_id = #{userId}) a ON pm.project_id = a.id
|
||||
where pm.state = #{state}
|
||||
</select>
|
||||
</mapper>
|
||||
+64
-274
@@ -2,31 +2,24 @@ package com.jero.modules.todoCenter.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
|
||||
import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
|
||||
import com.jero.modules.cert.collect.enums.CollectManifestUserTypeEnum;
|
||||
import com.jero.modules.cert.collect.enums.ManifestStateEnum;
|
||||
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper;
|
||||
import com.jero.modules.cert.collect.mapper.ParamsManifestEOMapper;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
|
||||
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.todoCenter.entity.ParamsManifestTodoCenterEO;
|
||||
import com.jero.modules.todoCenter.service.IParamsManifestTodoCenterService;
|
||||
import com.jero.modules.todoCenter.vo.ParamsManifestTodoCenterEOPage;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -36,15 +29,6 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoCenterService {
|
||||
@Autowired
|
||||
private ProjectLibraryBaseMapper projectLibraryBaseMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Autowired
|
||||
private IProjectRelatedPersonnelService projectRelatedPersonnelService;
|
||||
|
||||
@Autowired
|
||||
private ParamsCollectManifestEOMapper paramsCollectManifestEOMapper;
|
||||
|
||||
@@ -53,27 +37,28 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
|
||||
|
||||
@Override
|
||||
public IPage queryPage(ParamsManifestTodoCenterEOPage pageVO) {
|
||||
|
||||
// 查询所有项目下的 状态为收集中的清单
|
||||
pageVO.setState(ManifestStateEnum.COLLECTING.getValue());
|
||||
List<ParamsManifestTodoCenterEO> paramsManifestEOListAll = paramsManifestEOMapper.listForTodoCenter(pageVO);
|
||||
|
||||
// 筛选出当前登录人能在清单中是homo/sdt/dre角色的清单,并分页
|
||||
LambdaQueryWrapper<ProjectLibraryBase> projectLibraryBaseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
List<ProjectLibraryBase> projectLibraryBaseListAll = projectLibraryBaseMapper.selectList(projectLibraryBaseLambdaQueryWrapper);
|
||||
int pageNo = pageVO.getPageNo();
|
||||
int pageSize = pageVO.getPageSize();
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
List<ParamsManifestTodoCenterEO> paramsManifestEOList = new ArrayList<>();
|
||||
List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
|
||||
Map<String, Boolean> manifestUserTypeOfHomo = new HashMap<>();
|
||||
Map<String, Boolean> manifestUserTypeOfSdt = new HashMap<>();
|
||||
Map<String, Boolean> manifestUserTypeOfDre = new HashMap<>();
|
||||
Map<String, List<ParamsCollectManifestEO>> paramsManifestEOListMap = new HashMap<>();
|
||||
// 查询所有项目下的 状态为收集中的清单
|
||||
pageVO.setState(ManifestStateEnum.COLLECTING.getValue());
|
||||
pageVO.setUserId(loginUser.getId());
|
||||
pageVO.setUserName(loginUser.getUsername());
|
||||
List<ParamsManifestTodoCenterEO> paramsManifestEOListAll = paramsManifestEOMapper.listForTodoCenter(pageVO);
|
||||
|
||||
// 查询清单的所有参数项
|
||||
List<ParamsCollectManifestEO> pcmListAll = paramsCollectManifestEOMapper.listInfoOfTodoCenter();
|
||||
List<String> manifestIdList = paramsManifestEOListAll.stream().map(ParamsManifestTodoCenterEO::getId).collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(manifestIdList)) {
|
||||
return page;
|
||||
}
|
||||
List<ParamsCollectManifestEO> pcmListAll = paramsCollectManifestEOMapper.listInfoOfTodoCenter(manifestIdList);
|
||||
if (CollectionUtil.isEmpty(pcmListAll)) {
|
||||
return page;
|
||||
}
|
||||
|
||||
String userType = "";
|
||||
List<String> manifestIdListHomo = paramsManifestEOMapper.listInfoHomo(loginUser.getId(), ManifestStateEnum.COLLECTING.getValue());// 获取当前登录人 拥有认证工程师角色的清单
|
||||
for(ParamsManifestTodoCenterEO paramsManifestEO : paramsManifestEOListAll) {
|
||||
// 查询清单的所有参数项
|
||||
List<ParamsCollectManifestEO> pcmList = pcmListAll.stream().filter(e->paramsManifestEO.getId().equals(e.getParamsManifestId())).collect(Collectors.toList());
|
||||
@@ -83,44 +68,57 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
|
||||
continue;
|
||||
}
|
||||
|
||||
// 判断是不是homo角色
|
||||
projectLibraryBaseList = projectLibraryBaseListAll.stream().filter(e->paramsManifestEO.getProjectId().equals(e.getId())).collect(Collectors.toList());
|
||||
userType = getLoginUserTypeOfHomo(projectLibraryBaseList, loginUser);
|
||||
if(StringUtils.isNotBlank(userType)) {
|
||||
paramsManifestEOList.add(paramsManifestEO);
|
||||
manifestUserTypeOfHomo.put(paramsManifestEO.getId(), true);
|
||||
paramsManifestEOListMap.put(paramsManifestEO.getId(), pcmList);
|
||||
continue;
|
||||
int count = 0;
|
||||
|
||||
if(CollectionUtil.isNotEmpty(manifestIdListHomo) && manifestIdListHomo.contains(paramsManifestEO.getId())) { // 认证工程师 可以看到三种数量
|
||||
// 统计待发起数量 包括状态:待发起收集,变更,工程接口人退回
|
||||
count = (int) pcmList.stream().filter(e -> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.SDT_BACK.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.CHANGE.getValue().equals(e.getState())).count();
|
||||
if (count > 0) {
|
||||
paramsManifestEO.setWaitCollectNum(count);
|
||||
}
|
||||
|
||||
// 统计待分配数量 包括状态:待工程接口人处理,填写人退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))).count();
|
||||
if (count > 0) {
|
||||
paramsManifestEO.setWaitSdtNum(count);
|
||||
}
|
||||
|
||||
// 统计待填写数量 包括状态:待填写,认证工程师退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))).count();
|
||||
if (count > 0) {
|
||||
paramsManifestEO.setWaitFillNum(count);
|
||||
}
|
||||
} else { // 工程接口人和填写人 只能看到 工程接口人是自己 或 填写人是自己 的数量
|
||||
// 统计待分配数量 包括状态:待工程接口人处理,填写人退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))
|
||||
&& loginUser.getUsername().equals(e.getSdt())).count();
|
||||
if (count > 0) {
|
||||
paramsManifestEO.setWaitSdtNum(count);
|
||||
}
|
||||
|
||||
// 统计待填写数量 包括状态:待填写,认证工程师退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))
|
||||
&& loginUser.getUsername().equals(e.getDre())).count();
|
||||
if (count > 0) {
|
||||
paramsManifestEO.setWaitFillNum(count);
|
||||
}
|
||||
}
|
||||
|
||||
// 判断是不是sdt角色
|
||||
userType = getLoginUserTypeOfSdt(pcmList, loginUser);
|
||||
if(StringUtils.isNotBlank(userType)) {
|
||||
paramsManifestEOList.add(paramsManifestEO);
|
||||
manifestUserTypeOfSdt.put(paramsManifestEO.getId(), true);
|
||||
paramsManifestEOListMap.put(paramsManifestEO.getId(), pcmList);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 判断是不是dre角色
|
||||
userType = getLoginUserTypeOfDre(pcmList, loginUser);
|
||||
if(StringUtils.isNotBlank(userType)) {
|
||||
paramsManifestEOList.add(paramsManifestEO);
|
||||
manifestUserTypeOfDre.put(paramsManifestEO.getId(), true);
|
||||
paramsManifestEOListMap.put(paramsManifestEO.getId(), pcmList);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 分页
|
||||
paramsManifestEOList = paramsManifestEOList.stream()
|
||||
List<ParamsManifestTodoCenterEO> paramsManifestEOList =paramsManifestEOListAll.stream()
|
||||
.filter(e->ObjectUtil.isNotNull(e.getWaitCollectNum()) || ObjectUtil.isNotNull(e.getWaitSdtNum()) || ObjectUtil.isNotNull(e.getWaitFillNum()))
|
||||
.sorted(Comparator.comparing(ParamsManifestTodoCenterEO::getCreateTime).reversed())
|
||||
.collect(Collectors.toList());
|
||||
List<ParamsManifestTodoCenterEO> result = new ArrayList<>();
|
||||
int pageNo = pageVO.getPageNo();
|
||||
int pageSize = pageVO.getPageSize();
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
page.setTotal(paramsManifestEOList.size());
|
||||
|
||||
int subSize = pageVO.getPageSize(); // 每页记录数
|
||||
int subCount = paramsManifestEOList.size(); // 总记录数
|
||||
@@ -134,217 +132,9 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
|
||||
result = new ArrayList();
|
||||
}
|
||||
|
||||
// 统计清单中的待办参数数据
|
||||
List<ParamsManifestTodoCenterEO> records = getStatistics(result, manifestUserTypeOfHomo, manifestUserTypeOfSdt, manifestUserTypeOfDre, paramsManifestEOListMap,loginUser);
|
||||
page.setRecords(records);
|
||||
page.setTotal(paramsManifestEOList.size());
|
||||
page.setRecords(result);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
public List<ParamsManifestTodoCenterEO> getStatistics(List<ParamsManifestTodoCenterEO> paramsManifestEOList, Map<String, Boolean> manifestUserTypeOfHomo
|
||||
,Map<String, Boolean> manifestUserTypeOfSdt, Map<String, Boolean> manifestUserTypeOfDre, Map<String, List<ParamsCollectManifestEO>> paramsManifestEOListMap, LoginUser loginUser) {
|
||||
List<ParamsManifestTodoCenterEO> paramsManifestTodoCenterEOList = new ArrayList<>();
|
||||
|
||||
for(ParamsManifestTodoCenterEO paramsManifestTodoCenterEO : paramsManifestEOList) {
|
||||
// 查询清单的所有参数项
|
||||
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
|
||||
paramsCollectManifestEO.setParamsManifestId(paramsManifestTodoCenterEO.getId());
|
||||
List<ParamsCollectManifestEO> pcmList = paramsManifestEOListMap.get(paramsManifestTodoCenterEO.getId());
|
||||
int count = 0;
|
||||
|
||||
if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId())
|
||||
&& ObjectUtil.isNotEmpty(manifestUserTypeOfHomo.get(paramsManifestTodoCenterEO.getId()))) {
|
||||
// 统计待发起数量 包括状态:待发起收集,变更,工程接口人退回
|
||||
count = (int) pcmList.stream().filter(e-> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.SDT_BACK.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.CHANGE.getValue().equals(e.getState())).count();
|
||||
if (count > 0) {
|
||||
paramsManifestTodoCenterEO.setWaitCollectNum(count);
|
||||
}
|
||||
// 统计待分配数量 包括状态:待工程接口人处理,填写人退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))).count();
|
||||
if (count > 0) {
|
||||
paramsManifestTodoCenterEO.setWaitSdtNum(count);
|
||||
}
|
||||
// 统计待填写数量 包括状态:待填写,认证工程师退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))).count();
|
||||
if (count > 0) {
|
||||
paramsManifestTodoCenterEO.setWaitFillNum(count);
|
||||
}
|
||||
} else if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId())
|
||||
&& ObjectUtil.isNotEmpty(manifestUserTypeOfSdt.get(paramsManifestTodoCenterEO.getId()))) {
|
||||
// 统计待分配数量 包括状态:待工程接口人处理,填写人退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))
|
||||
&& loginUser.getUsername().equals(e.getSdt())).count();
|
||||
if (count > 0) {
|
||||
paramsManifestTodoCenterEO.setWaitSdtNum(count);
|
||||
}
|
||||
// 统计待填写数量 包括状态:待填写,认证工程师退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))).count();
|
||||
if (count > 0) {
|
||||
paramsManifestTodoCenterEO.setWaitFillNum(count);
|
||||
}
|
||||
|
||||
} else if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId())
|
||||
&& ObjectUtil.isNotEmpty(manifestUserTypeOfDre.get(paramsManifestTodoCenterEO.getId()))) {
|
||||
// 统计待填写数量 包括状态:待填写,认证工程师退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))
|
||||
&& loginUser.getUsername().equals(e.getDre())).count();
|
||||
if (count > 0) {
|
||||
paramsManifestTodoCenterEO.setWaitFillNum(count);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
paramsManifestTodoCenterEOList.add(paramsManifestTodoCenterEO);
|
||||
}
|
||||
return paramsManifestTodoCenterEOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目id,清单id查询当前登录人的Homo角色
|
||||
* @param projectId
|
||||
* @param paramsManifestId
|
||||
* @return
|
||||
*/
|
||||
public List<String> getLoginUserTypes(String projectId, String paramsManifestId, LoginUser loginUser) {
|
||||
|
||||
List<String> userTypeList = new ArrayList<>(); // 一个用户可以有多个用户类型
|
||||
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
|
||||
// 查询项目下所有责任领域下的 homo人员
|
||||
List<ProjectLibraryBase> projectLibraryBaseList = projectLibraryBaseMapper.queryById(projectId);
|
||||
List<String> homoList = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(projectLibraryBaseList)) {
|
||||
String homoIdStr = projectLibraryBaseList.get(0).getCertificationEngineer();
|
||||
if (StringUtils.isNotEmpty(homoIdStr)) {
|
||||
List<String> homoIdList = Arrays.asList(homoIdStr.split(",")).stream().distinct().collect(Collectors.toList());
|
||||
homoList = sysUserService.listByIds(homoIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
// 查询项目下所有责任领域下的 sdt人员
|
||||
List<String> sdtList = new ArrayList<>();
|
||||
LambdaQueryWrapper<ProjectRelatedPersonnel> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ProjectRelatedPersonnel::getProjectId, projectId);
|
||||
List<ProjectRelatedPersonnel> prpList = projectRelatedPersonnelService.list(queryWrapper);
|
||||
// String homoIdStr = prpList.stream().map(e -> e.getCertificationEngineer()).collect(Collectors.joining(","));
|
||||
String sdtIdStr = prpList.stream().map(e -> e.getEngineeringInterfacePerson()).collect(Collectors.joining(","));
|
||||
// 项目下有homo-->不一定有sdt
|
||||
if(StringUtils.isNotBlank(sdtIdStr)) {
|
||||
List<String> sdtIdList = Arrays.asList(sdtIdStr.split(",")).stream().distinct().collect(Collectors.toList());
|
||||
sdtList = sysUserService.listByIds(sdtIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 查询项目下参数清单下收集参数项中的 sdt,dre人员
|
||||
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
|
||||
paramsCollectManifestEO.setParamsManifestId(paramsManifestId);
|
||||
List<ParamsCollectManifestEO> pcmList = paramsCollectManifestEOMapper.listInfo(paramsCollectManifestEO);
|
||||
List<String> sdtListOfPCM = pcmList.stream()
|
||||
.filter(e->StringUtils.isNotEmpty(e.getSdt()))
|
||||
.map(ParamsCollectManifestEO::getSdt)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
sdtList.addAll(sdtListOfPCM); // 需要取并集,因为存在参数项开始收集但 人员相关名单中sdt被修改的情况
|
||||
|
||||
List<String> dreListOfPCM = pcmList.stream()
|
||||
.filter(e->StringUtils.isNotEmpty(e.getDre()))
|
||||
.map(ParamsCollectManifestEO::getDre)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
String loginUserName = loginUser.getUsername().toLowerCase();
|
||||
|
||||
homoList = toLowerCaseOfList(homoList);
|
||||
sdtList = toLowerCaseOfList(sdtList);
|
||||
dreListOfPCM = toLowerCaseOfList(dreListOfPCM);
|
||||
|
||||
|
||||
if (homoList.contains(loginUserName)) {
|
||||
userTypeList.add(CollectManifestUserTypeEnum.HOMO.getValue());
|
||||
}
|
||||
|
||||
if (sdtList.contains(loginUserName)) {
|
||||
userTypeList.add(CollectManifestUserTypeEnum.SDT.getValue());
|
||||
}
|
||||
|
||||
if (dreListOfPCM.contains(loginUserName)) {
|
||||
userTypeList.add(CollectManifestUserTypeEnum.DRE.getValue());
|
||||
}
|
||||
|
||||
return userTypeList;
|
||||
}
|
||||
|
||||
public String getLoginUserTypeOfHomo(List<ProjectLibraryBase> projectLibraryBaseList, LoginUser loginUser) {
|
||||
|
||||
String userType = ""; // 一个用户可以有多个用户类型
|
||||
|
||||
// 查询项目下的 homo人员
|
||||
List<String> homoList = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(projectLibraryBaseList)) {
|
||||
String homoIdStr = projectLibraryBaseList.get(0).getCertificationEngineer();
|
||||
if (StringUtils.isNotEmpty(homoIdStr)) {
|
||||
List<String> homoIdList = Arrays.asList(homoIdStr.split(",")).stream().distinct().collect(Collectors.toList());
|
||||
homoList = sysUserService.listByIds(homoIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
String loginUserName = loginUser.getUsername().toLowerCase();
|
||||
homoList = toLowerCaseOfList(homoList);
|
||||
if (homoList.contains(loginUserName)) {
|
||||
userType = CollectManifestUserTypeEnum.HOMO.getValue();
|
||||
}
|
||||
return userType;
|
||||
}
|
||||
|
||||
public String getLoginUserTypeOfSdt(List<ParamsCollectManifestEO> pcmList, LoginUser loginUser) {
|
||||
|
||||
String userType = ""; // 一个用户可以有多个用户类型
|
||||
|
||||
List<String> sdtListOfPCM = pcmList.stream()
|
||||
.filter(e->StringUtils.isNotEmpty(e.getSdt()))
|
||||
.map(ParamsCollectManifestEO::getSdt)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
String loginUserName = loginUser.getUsername().toLowerCase();
|
||||
sdtListOfPCM = toLowerCaseOfList(sdtListOfPCM);
|
||||
if (sdtListOfPCM.contains(loginUserName)) {
|
||||
userType = CollectManifestUserTypeEnum.SDT.getValue();
|
||||
}
|
||||
return userType;
|
||||
}
|
||||
|
||||
public String getLoginUserTypeOfDre(List<ParamsCollectManifestEO> pcmList, LoginUser loginUser) {
|
||||
|
||||
String userType = ""; // 一个用户可以有多个用户类型
|
||||
|
||||
List<String> dreListOfPCM = pcmList.stream()
|
||||
.filter(e->StringUtils.isNotEmpty(e.getDre()))
|
||||
.map(ParamsCollectManifestEO::getDre)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
String loginUserName = loginUser.getUsername().toLowerCase();
|
||||
dreListOfPCM = toLowerCaseOfList(dreListOfPCM);
|
||||
if (dreListOfPCM.contains(loginUserName)) {
|
||||
userType = CollectManifestUserTypeEnum.DRE.getValue();
|
||||
}
|
||||
return userType;
|
||||
}
|
||||
|
||||
private List<String> toLowerCaseOfList(List<String> list) {
|
||||
List<String> newList = list;
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
newList = list.stream().map(String::toLowerCase).collect(Collectors.toList());
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -42,4 +42,8 @@ public class ParamsManifestTodoCenterEOPage {
|
||||
private int pageNo;
|
||||
private int pageSize;
|
||||
private String state;
|
||||
|
||||
private String userId;
|
||||
private String userName;
|
||||
|
||||
}
|
||||
|
||||
@@ -684,12 +684,11 @@
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.$route.query)
|
||||
this.GetgetLoginUserType()
|
||||
console.log(this.currentPersonRole)
|
||||
if(this.$route.query.type == '1'){
|
||||
this.handleOkRoleSwitching()
|
||||
}
|
||||
this.GetgetLoginUserType()
|
||||
console.log(this.currentPersonRole)
|
||||
setTimeout(() => {
|
||||
if (this.currentPersonRole == 'dre') {
|
||||
this.handlePreservation()
|
||||
@@ -724,7 +723,7 @@
|
||||
handleOkRoleSwitching() {
|
||||
if(this.$route.query.type == '1'){
|
||||
let query = {
|
||||
userType:this.$route.query.userType,
|
||||
userType:this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType,
|
||||
paramsManifestId: this.$route.query.id,
|
||||
projectId: this.$route.query.projectId,
|
||||
userId: this.userInfo().id
|
||||
@@ -732,10 +731,10 @@
|
||||
this.confirmLoadingRoleSwitching = true
|
||||
postAction('/params/userTypeLog/edit', query).then((res) => {
|
||||
if (res.success) {
|
||||
this.currentPersonRole = this.$route.query.userType
|
||||
this.currentPersonRole = this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType
|
||||
this.visibleRoleSwitching = false
|
||||
this.confirmLoadingRoleSwitching = false
|
||||
localStorage.setItem('currentPersonRole', JSON.stringify(this.$route.query.userType))
|
||||
localStorage.setItem('currentPersonRole', JSON.stringify(this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType))
|
||||
this.RoleType.forEach((item,index) => {
|
||||
if(item.value == this.currentPersonRole){
|
||||
this.rolename = item.label
|
||||
|
||||
@@ -167,42 +167,97 @@
|
||||
},
|
||||
//待填写数量
|
||||
waitFillClick(item) {
|
||||
let _this = this
|
||||
item.type = '1'
|
||||
item.userType = 'dre'
|
||||
console.log(item)
|
||||
let newUrl = _this.$router.resolve({
|
||||
path: '/ParameterItemCollection',
|
||||
query: item
|
||||
// projectName:this.$route.query.projectName
|
||||
let query = {
|
||||
paramsManifestId: item.id,
|
||||
projectId: item.projectId
|
||||
}
|
||||
this.loading = true
|
||||
let userType = ''
|
||||
let valueList = []
|
||||
getAction('params/collectManifest/getLoginUserType', query).then((res) => {
|
||||
if(res.result){
|
||||
res.result.find((item,index) => {
|
||||
if(item.value){
|
||||
valueList.push(item.value)
|
||||
}
|
||||
})
|
||||
let flag = valueList.find((item,index) => {
|
||||
return item == 'dre'
|
||||
})
|
||||
let _this = this
|
||||
item.type = '1'
|
||||
item.userType = _this.flag == undefined ? valueList[0] : 'dre'
|
||||
let newUrl = _this.$router.resolve({
|
||||
path: '/ParameterItemCollection',
|
||||
query: item
|
||||
// projectName:this.$route.query.projectName
|
||||
})
|
||||
window.open(newUrl.href, '_blank')
|
||||
}
|
||||
})
|
||||
window.open(newUrl.href, '_blank')
|
||||
},
|
||||
//待分配填写人数量
|
||||
waitSdtClick(item) {
|
||||
let _this = this
|
||||
item.type = '1'
|
||||
item.userType = 'sdt'
|
||||
console.log(item)
|
||||
let newUrl = _this.$router.resolve({
|
||||
path: '/ParameterItemCollection',
|
||||
query: item
|
||||
// projectName:this.$route.query.projectName
|
||||
let query = {
|
||||
paramsManifestId: item.id,
|
||||
projectId: item.projectId
|
||||
}
|
||||
this.loading = true
|
||||
let userType = ''
|
||||
let valueList = []
|
||||
getAction('params/collectManifest/getLoginUserType', query).then((res) => {
|
||||
if(res.result){
|
||||
res.result.find((item,index) => {
|
||||
if(item.value){
|
||||
valueList.push(item.value)
|
||||
}
|
||||
})
|
||||
let flag = valueList.find((item,index) => {
|
||||
return item == 'sdt'
|
||||
})
|
||||
let _this = this
|
||||
item.type = '1'
|
||||
item.userType = _this.flag == undefined ? valueList[0] : 'sdt'
|
||||
let newUrl = _this.$router.resolve({
|
||||
path: '/ParameterItemCollection',
|
||||
query: item
|
||||
// projectName:this.$route.query.projectName
|
||||
})
|
||||
window.open(newUrl.href, '_blank')
|
||||
}
|
||||
})
|
||||
window.open(newUrl.href, '_blank')
|
||||
|
||||
},
|
||||
//参数待发起数量
|
||||
waitCollectClick(item) {
|
||||
let _this = this
|
||||
item.type = '1'
|
||||
item.userType = 'homo'
|
||||
console.log(item)
|
||||
let newUrl = _this.$router.resolve({
|
||||
path: '/ParameterItemCollection',
|
||||
query: item
|
||||
// projectName:this.$route.query.projectName
|
||||
let query = {
|
||||
paramsManifestId: item.id,
|
||||
projectId: item.projectId
|
||||
}
|
||||
this.loading = true
|
||||
let userType = ''
|
||||
let valueList = []
|
||||
getAction('params/collectManifest/getLoginUserType', query).then((res) => {
|
||||
if(res.result){
|
||||
res.result.find((item,index) => {
|
||||
if(item.value){
|
||||
valueList.push(item.value)
|
||||
}
|
||||
})
|
||||
let flag = valueList.find((item,index) => {
|
||||
return item == 'homo'
|
||||
})
|
||||
let _this = this
|
||||
item.type = '1'
|
||||
item.userType = _this.flag == undefined ? valueList[0] : 'homo'
|
||||
let newUrl = _this.$router.resolve({
|
||||
path: '/ParameterItemCollection',
|
||||
query: item
|
||||
// projectName:this.$route.query.projectName
|
||||
})
|
||||
window.open(newUrl.href, '_blank')
|
||||
}
|
||||
})
|
||||
window.open(newUrl.href, '_blank')
|
||||
},
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageNo = 1
|
||||
|
||||
Reference in New Issue
Block a user