|
|
|
@ -174,30 +174,34 @@ public class ExpertController extends JeecgController<Expert, IExpertService> { |
|
|
|
|
//开始对比两个List获取相同部分,获取的交叉id就是需要的id
|
|
|
|
|
List<String> commonElements = idlistss.stream().filter(userbyrole::contains).collect(Collectors.toList()); |
|
|
|
|
//根据查询的userid去获取username
|
|
|
|
|
List<SysUser> sysUserList = sysUserService.query().in("id",commonElements).list(); |
|
|
|
|
//根据查询的结果获取username的list
|
|
|
|
|
List<String> usernames = sysUserList.stream().map(SysUser::getUsername).collect(Collectors.toList()); |
|
|
|
|
//用于查看本公司下面的专家信息无论是否审核,无论哪个部门
|
|
|
|
|
QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap()); |
|
|
|
|
queryWrapper.eq("isdone","Y"); |
|
|
|
|
queryWrapper.in("seusername",usernames); |
|
|
|
|
Page<Expert> page = new Page<Expert>(pageNo, pageSize); |
|
|
|
|
IPage<Expert> pageList = expertService.page(page, queryWrapper); |
|
|
|
|
pageList.getRecords().forEach(experttemp -> { |
|
|
|
|
//开始用于修改数据
|
|
|
|
|
SysUser sysUser = sysUserService.query().eq("username",experttemp.getSeusername()).one(); |
|
|
|
|
String depid = expertService.getdeps(sysUser.getId()); |
|
|
|
|
SysDepart sysDepart = sysDepartService.getById(depid); |
|
|
|
|
experttemp.setRealname(sysUser.getRealname()); |
|
|
|
|
experttemp.setWorkon(sysUser.getWorkNo()); |
|
|
|
|
experttemp.setSex(sysUser.getSex()); |
|
|
|
|
experttemp.setTopPic(sysUser.getAvatar()); |
|
|
|
|
experttemp.setPhone(sysUser.getPhone()); |
|
|
|
|
experttemp.setEmails(sysUser.getEmail()); |
|
|
|
|
experttemp.setSsdep(sysDepart.getDepartName()); |
|
|
|
|
experttemp.setPsd(sysUser.getPassword()); |
|
|
|
|
}); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
if (commonElements.isEmpty()){ |
|
|
|
|
return Result.error("请添加专家"); |
|
|
|
|
}else { |
|
|
|
|
List<SysUser> sysUserList = sysUserService.query().in("id", commonElements).list(); |
|
|
|
|
//根据查询的结果获取username的list
|
|
|
|
|
List<String> usernames = sysUserList.stream().map(SysUser::getUsername).collect(Collectors.toList()); |
|
|
|
|
//用于查看本公司下面的专家信息无论是否审核,无论哪个部门
|
|
|
|
|
QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap()); |
|
|
|
|
queryWrapper.eq("isdone", "Y"); |
|
|
|
|
queryWrapper.in("seusername", usernames); |
|
|
|
|
Page<Expert> page = new Page<Expert>(pageNo, pageSize); |
|
|
|
|
IPage<Expert> pageList = expertService.page(page, queryWrapper); |
|
|
|
|
pageList.getRecords().forEach(experttemp -> { |
|
|
|
|
//开始用于修改数据
|
|
|
|
|
SysUser sysUser = sysUserService.query().eq("username", experttemp.getSeusername()).one(); |
|
|
|
|
String depid = expertService.getdeps(sysUser.getId()); |
|
|
|
|
SysDepart sysDepart = sysDepartService.getById(depid); |
|
|
|
|
experttemp.setRealname(sysUser.getRealname()); |
|
|
|
|
experttemp.setWorkon(sysUser.getWorkNo()); |
|
|
|
|
experttemp.setSex(sysUser.getSex()); |
|
|
|
|
experttemp.setTopPic(sysUser.getAvatar()); |
|
|
|
|
experttemp.setPhone(sysUser.getPhone()); |
|
|
|
|
experttemp.setEmails(sysUser.getEmail()); |
|
|
|
|
experttemp.setSsdep(sysDepart.getDepartName()); |
|
|
|
|
experttemp.setPsd(sysUser.getPassword()); |
|
|
|
|
}); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiOperation(value="专家管理-分页列表查询/公司管理员角色", notes="专家管理-分页列表查询/公司管理员角色") |
|
|
|
@ -623,8 +627,8 @@ public class ExpertController extends JeecgController<Expert, IExpertService> { |
|
|
|
|
@GetMapping(value = "handleadminback") |
|
|
|
|
public Result<String> handleadminback(@RequestParam(name="id",required=true) String id) { |
|
|
|
|
Expert expert =expertService.getById(id); |
|
|
|
|
expert.setAdminopen("1"); |
|
|
|
|
expert.setCompopen("1"); |
|
|
|
|
expert.setAdminopen("3"); |
|
|
|
|
expert.setCompopen("3"); |
|
|
|
|
expert.setIsdone("N"); |
|
|
|
|
expertService.updateById(expert); |
|
|
|
|
return Result.OK("驳回成功!请到编辑页面确定问题数据并填写驳回原因"); |
|
|
|
|