|
|
@ -16,8 +16,11 @@ import com.epmet.dataaggre.dto.epmetuser.result.*; |
|
|
|
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO; |
|
|
|
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity; |
|
|
|
import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity; |
|
|
|
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity; |
|
|
|
import com.epmet.dataaggre.entity.epmetuser.StaffRoleEntity; |
|
|
|
import com.epmet.dataaggre.service.epmetuser.EpmetUserService; |
|
|
|
import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService; |
|
|
|
import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService; |
|
|
@ -61,6 +64,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
|
private ResiUserBadgeDao resiUserBadgeDao; |
|
|
|
@Autowired |
|
|
|
private GovProjectService govProjectService; |
|
|
|
@Resource |
|
|
|
private GovStaffRoleDao govStaffRoleDao; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 根据UserIds查询 |
|
|
@ -426,15 +431,28 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
|
|
|
|
|
/** |
|
|
|
* @Param formDTO |
|
|
|
* @Description 通讯录】姓名检索工作人员 |
|
|
|
* @Description 【通讯录】姓名检索工作人员 |
|
|
|
* @author sun |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<ListStaffResultDTO> listStaff(ListStaffFormDTO formDTO) { |
|
|
|
//1.模糊查询用户、角色信息
|
|
|
|
List<ListStaffResultDTO> resultList = customerStaffDao.selectByRealName(formDTO.getCustomerId(), formDTO.getRealName()); |
|
|
|
if (null == resultList || resultList.size() < NumConstant.ONE) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
//2.查询用户注册组织信息
|
|
|
|
List<String> staffIdList = resultList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList()); |
|
|
|
List<StaffOrgNameResultDTO> orgList = govOrgService.getStaffOrgName(staffIdList); |
|
|
|
|
|
|
|
return null; |
|
|
|
//3.封装数据并返回
|
|
|
|
resultList.forEach(re -> orgList.stream().filter(l -> re.getStaffId().equals(l.getStaffId())).forEach(s -> re.setOrgName(s.getOrgName()))); |
|
|
|
|
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 根据角色查询人员列表 |
|
|
|
* |
|
|
@ -446,7 +464,19 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<RoleUsersResultDTO> getRoleUsers(RoleUsersFormDTO formDTO) { |
|
|
|
return null; |
|
|
|
LambdaQueryWrapper<StaffRoleEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(StaffRoleEntity :: getCustomerId, formDTO.getCustomerId()); |
|
|
|
wrapper.eq(StaffRoleEntity::getRoleId, formDTO.getRoleId()); |
|
|
|
List<StaffRoleEntity> staffRoleList = staffRoleDao.selectList(wrapper); |
|
|
|
if (CollectionUtils.isEmpty(staffRoleList)) { |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
return staffRoleList.stream().map(item -> { |
|
|
|
RoleUsersResultDTO dto = new RoleUsersResultDTO(); |
|
|
|
dto.setStaffId(item.getStaffId()); |
|
|
|
//TODO 从redis获取用户信息
|
|
|
|
return dto; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -459,7 +489,28 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<RoleListResultDTO> getRoleList(String customerId) { |
|
|
|
return null; |
|
|
|
//获取角色列表
|
|
|
|
LambdaQueryWrapper<GovStaffRoleEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(GovStaffRoleEntity :: getCustomerId, customerId); |
|
|
|
wrapper.orderByAsc(GovStaffRoleEntity ::getSort); |
|
|
|
List<GovStaffRoleEntity> list = govStaffRoleDao.selectList(wrapper); |
|
|
|
//获取角色人数
|
|
|
|
List<RoleListResultDTO> countList = staffRoleDao.getRoleCountList(customerId); |
|
|
|
Map<String, Integer> map = new HashMap<>(); |
|
|
|
if (CollectionUtils.isNotEmpty(countList)) { |
|
|
|
map = countList.stream().collect(Collectors.toMap(RoleListResultDTO :: getRoleId, RoleListResultDTO :: getStaffNum)); |
|
|
|
} |
|
|
|
Map<String, Integer> finalMap = map; |
|
|
|
//构建返回值
|
|
|
|
return list.stream().map(item -> { |
|
|
|
RoleListResultDTO dto = new RoleListResultDTO(); |
|
|
|
dto.setRoleId(item.getId()); |
|
|
|
dto.setRoleKey(item.getRoleKey()); |
|
|
|
dto.setRoleName(item.getRoleName()); |
|
|
|
dto.setDescription(item.getDescription()); |
|
|
|
dto.setStaffNum(null == finalMap.get(item.getId())?NumConstant.ZERO:finalMap.get(item.getId())); |
|
|
|
return dto; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|