| | |
| | | import com.ycl.dto.UpdateAdminPasswordParam; |
| | | import com.ycl.entity.depart.UmsDepart; |
| | | import com.ycl.entity.user.*; |
| | | import com.ycl.exception.ApiException; |
| | | import com.ycl.exception.Asserts; |
| | | import com.ycl.mapper.user.UmsAdminLoginLogMapper; |
| | | import com.ycl.mapper.user.UmsAdminMapper; |
| | | import com.ycl.mapper.user.UmsResourceMapper; |
| | | import com.ycl.mapper.user.UmsRoleMapper; |
| | | import com.ycl.mapper.user.*; |
| | | import com.ycl.service.depart.UmsDepartService; |
| | | import com.ycl.service.user.UmsDepartManageService; |
| | | import com.ycl.service.redis.RedisService; |
| | | import com.ycl.service.user.UmsAdminCacheService; |
| | | import com.ycl.service.user.UmsAdminRoleRelationService; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 后台管理员管理Service实现类 |
| | |
| | | @Resource |
| | | private UmsDepartService departService; |
| | | @Resource |
| | | private UmsDepartManageService umsAdminDepartService; |
| | | @Resource |
| | | private RedisService redisService; |
| | | @Resource |
| | | private UmsDepartManageMapper umsDepartManageMapper; |
| | | |
| | | @Override |
| | | public UmsAdmin getAdminByUsername(String username) { |
| | |
| | | getCacheService().delBatchAdmin(ids); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public List<UmsAdmin> getDepartUser(Long departId) { |
| | | QueryWrapper<UmsDepartManage> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda().eq(UmsDepartManage::getDepartId, departId); |
| | | List<UmsDepartManage> list = umsDepartManageMapper.selectList(wrapper); |
| | | List<Long> userIds = list.stream().map(UmsDepartManage::getUserId).collect(Collectors.toList()); |
| | | QueryWrapper<UmsAdmin> wrapperUser = new QueryWrapper<>(); |
| | | wrapperUser.in("id", userIds); |
| | | List<UmsAdmin> adminList = baseMapper.selectList(wrapperUser); |
| | | return adminList; |
| | | } |
| | | |
| | | @Override |
| | | public String getTargetTo(String ids, String sendType) { |
| | | String str = null; |
| | | String[] arr = ids.split(","); |
| | | QueryWrapper<UmsAdmin> wrapperUser = new QueryWrapper<>(); |
| | | wrapperUser.in("id", arr); |
| | | List<UmsAdmin> adminList = baseMapper.selectList(wrapperUser); |
| | | if (adminList == null||adminList.isEmpty()) { |
| | | throw new ApiException("未查询到用户"); |
| | | } |
| | | if ("02".equals(sendType)) { |
| | | str = adminList.stream().map(UmsAdmin::getEmail).collect(Collectors.joining(",")); |
| | | } else { |
| | | str = adminList.stream().map(UmsAdmin::getMobile).collect(Collectors.joining(",")); |
| | | } |
| | | return str; |
| | | } |
| | | } |