|
|
|
|
@ -132,6 +132,7 @@ public class ErpContractOrderServiceImpl implements IErpContractOrderService {
|
|
|
|
|
public List<ErpProjectInfoVo> queryTodoList(ErpProjectInfoBo bo) {
|
|
|
|
|
// 先取基础列表,再按“真实项目经理 / 合同创建人”在内存中过滤
|
|
|
|
|
Long filterManagerId = bo.getManagerId();
|
|
|
|
|
String todoOwnerType = bo.getTodoOwnerType();
|
|
|
|
|
bo.setManagerId(null);
|
|
|
|
|
MPJLambdaWrapper<ErpProjectInfo> lqw = buildQueryWrapper(bo);
|
|
|
|
|
List<ErpProjectInfoVo> baseList = projectInfoMapper.selectCustomErpProjectInfoVoList(lqw);
|
|
|
|
|
@ -139,9 +140,6 @@ public class ErpContractOrderServiceImpl implements IErpContractOrderService {
|
|
|
|
|
return baseList;
|
|
|
|
|
}
|
|
|
|
|
Long currentUserId = LoginHelper.getUserId();
|
|
|
|
|
if (StringUtils.isNull(filterManagerId)) {
|
|
|
|
|
return baseList;
|
|
|
|
|
}
|
|
|
|
|
// 1) 批量取合同ID
|
|
|
|
|
Set<Long> contractIds = baseList.stream()
|
|
|
|
|
.map(ErpProjectInfoVo::getContractId)
|
|
|
|
|
@ -156,11 +154,21 @@ public class ErpContractOrderServiceImpl implements IErpContractOrderService {
|
|
|
|
|
Long contractId = row.getContractId();
|
|
|
|
|
Long realManagerId = contractId != null ? contractId2ManagerId.get(contractId) : null;
|
|
|
|
|
Long contractCreateBy = contractId != null ? contractId2CreateBy.get(contractId) : null;
|
|
|
|
|
// 过滤条件:页面选择的项目经理(按真实项目经理)
|
|
|
|
|
if (filterManagerId != null) {
|
|
|
|
|
return Objects.equals(filterManagerId, realManagerId);
|
|
|
|
|
|
|
|
|
|
if (filterManagerId != null && !Objects.equals(filterManagerId, realManagerId)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// 待办权限:真实项目经理 或 合同激活创建人
|
|
|
|
|
|
|
|
|
|
if ("all".equals(todoOwnerType)) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if ("create".equals(todoOwnerType)) {
|
|
|
|
|
return Objects.equals(currentUserId, contractCreateBy);
|
|
|
|
|
}
|
|
|
|
|
if ("manager".equals(todoOwnerType)) {
|
|
|
|
|
return Objects.equals(currentUserId, realManagerId);
|
|
|
|
|
}
|
|
|
|
|
// 默认:本人是项目经理或合同激活创建人
|
|
|
|
|
return Objects.equals(currentUserId, realManagerId) || Objects.equals(currentUserId, contractCreateBy);
|
|
|
|
|
})
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|