1.1.7 合同订单待办默认查询后端改为本人是项目经理与合同激活创建人,添加待办人检索框:本人创建、本人项目经理、全部。

dev
yinq 3 months ago
parent 16c783c70a
commit 4977712d0b

@ -89,6 +89,11 @@ public class ErpProjectInfoBo extends BaseEntity {
*/
private Long managerId;
/**
* create manager all
*/
private String todoOwnerType;
/**
*
*/

@ -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());

Loading…
Cancel
Save