收敛充电订单开票待办接收人

This commit is contained in:
jsowell
2026-07-17 17:30:29 +08:00
parent c416bdacc9
commit 5c7f4dccec
9 changed files with 112 additions and 7 deletions

View File

@@ -25,6 +25,8 @@ public final class TodoTaskConstants {
public static final int DEFAULT_HOME_LIMIT = 3;
public static final int MAX_HOME_LIMIT = 10;
/** 现有运营商创建流程使用的运营商管理员角色 ID正式环境可通过配置覆盖。 */
public static final long DEFAULT_OPERATOR_ADMIN_ROLE_ID = 3L;
public static boolean isActiveStatus(String status) {
return STATUS_PENDING.equals(status) || STATUS_PROCESSING.equals(status);

View File

@@ -27,6 +27,16 @@ public interface SysUserMapper {
*/
List<Long> selectActiveUserIdsByDeptTree(@Param("deptId") Long deptId);
/**
* 查询部门及下级部门中拥有指定角色的正常用户 ID。
*
* @param deptId 部门 ID
* @param roleId 角色 ID
* @return 用户 ID 集合
*/
List<Long> selectActiveUserIdsByDeptTreeAndRole(@Param("deptId") Long deptId,
@Param("roleId") Long roleId);
/**
* 根据条件分页查询已配用户角色列表
*

View File

@@ -9,4 +9,6 @@ import java.util.List;
*/
public interface TodoTaskAssigneeService {
List<Long> findActiveUserIdsByDeptTree(Long deptId);
List<Long> findActiveOperatorAdminUserIdsByDeptTree(Long deptId);
}

View File

@@ -1,9 +1,11 @@
package com.jsowell.system.service.impl;
import com.jsowell.common.exception.ServiceException;
import com.jsowell.system.constant.TodoTaskConstants;
import com.jsowell.system.mapper.SysUserMapper;
import com.jsowell.system.service.TodoTaskAssigneeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -15,6 +17,9 @@ import java.util.List;
*/
@Service
public class TodoTaskAssigneeServiceImpl implements TodoTaskAssigneeService {
@Value("${todo.operator-admin-role-id:3}")
private Long operatorAdminRoleId;
@Autowired
private SysUserMapper userMapper;
@@ -25,4 +30,14 @@ public class TodoTaskAssigneeServiceImpl implements TodoTaskAssigneeService {
}
return userMapper.selectActiveUserIdsByDeptTree(deptId);
}
@Override
public List<Long> findActiveOperatorAdminUserIdsByDeptTree(Long deptId) {
if (deptId == null || deptId <= 0) {
throw new ServiceException("待办接收部门不能为空");
}
Long roleId = operatorAdminRoleId == null || operatorAdminRoleId <= 0
? TodoTaskConstants.DEFAULT_OPERATOR_ADMIN_ROLE_ID : operatorAdminRoleId;
return userMapper.selectActiveUserIdsByDeptTreeAndRole(deptId, roleId);
}
}

View File

@@ -107,6 +107,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
order by u.user_id
</select>
<select id="selectActiveUserIdsByDeptTreeAndRole" resultType="Long">
select distinct u.user_id
from sys_user u
inner join sys_user_role ur on ur.user_id = u.user_id
inner join sys_role r on r.role_id = ur.role_id
where u.status = '0'
and u.del_flag = '0'
and r.status = '0'
and r.del_flag = '0'
and ur.role_id = #{roleId}
and (
u.dept_id = #{deptId}
or u.dept_id in (
select d.dept_id
from sys_dept d
where find_in_set(#{deptId}, d.ancestors)
and d.status = '0'
)
)
order by u.user_id
</select>
<select id="selectAllocatedList" parameterType="com.jsowell.common.core.domain.entity.SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phone, u.status, u.create_time