| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | }catch (Exception e){ |
| | | throw new ErrorException(e.getMessage()); |
| | | } |
| | | return companies.stream().filter(ob->{ |
| | | /*return companies.stream().filter(ob->{ |
| | | if(ob.getStatus().equals("enabled")) return true; |
| | | return false; |
| | | }).collect(Collectors.toList()); |
| | | }).collect(Collectors.toList());*/ |
| | | return companies; |
| | | } |
| | | |
| | | public List<Person> userUrl(String companyId) { |
| | |
| | | throw new ErrorException(e.getMessage()); |
| | | } |
| | | return person.stream().filter(ob->{ |
| | | if(Objects.equals(ob.getStatus(), "enabled")) { |
| | | ob.setIsLive(userMapper.selectCount(Wrappers.<User>lambdaQuery().eq(User::getAccount, ob.getEmployeeID()))); |
| | | return true; |
| | | } |
| | | return false; |
| | | ob.setIsLive(userMapper.selectCount(Wrappers.<User>lambdaQuery().eq(User::getAccount, ob.getEmployeeID()))); |
| | | return true; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public String getPassword(String employeeId) { |
| | | String accessToken = getAccessToken(); |
| | | HttpRequest request = HttpRequest.get(AuthApi.password + employeeId) |
| | | .header("Authorization", "Bearer " + accessToken); |
| | | System.out.println(AuthApi.password + employeeId); |
| | | System.out.println(request.execute().body()); |
| | | return JSON.parseObject(request.execute().body()).get("originalPwd").toString(); |
| | | } |
| | | } |