yaoh.wu
7 years ago
13 changed files with 77 additions and 178 deletions
@ -1,72 +0,0 @@
|
||||
package com.fr.design.remote; |
||||
|
||||
import com.fr.general.Inter; |
||||
|
||||
public class RemoteMember { |
||||
|
||||
public static final RemoteMember DEFAULT_MEMBER = |
||||
new RemoteMember(Inter.getLocText("FR-Designer_Remote_Design_Loading")); |
||||
|
||||
|
||||
private String username; |
||||
private String realName; |
||||
private String userId; |
||||
|
||||
private boolean selected; |
||||
|
||||
public RemoteMember() { |
||||
|
||||
} |
||||
|
||||
public RemoteMember(String username) { |
||||
this.username = username; |
||||
} |
||||
|
||||
public RemoteMember username(String username) { |
||||
this.username = username; |
||||
return this; |
||||
} |
||||
|
||||
public RemoteMember realName(String realName) { |
||||
this.realName = realName; |
||||
return this; |
||||
} |
||||
|
||||
public RemoteMember userId(String userId) { |
||||
this.userId = userId; |
||||
return this; |
||||
} |
||||
|
||||
public String getRealName() { |
||||
return realName; |
||||
} |
||||
|
||||
public void setRealName(String realName) { |
||||
this.realName = realName; |
||||
} |
||||
|
||||
public String getUserId() { |
||||
return userId; |
||||
} |
||||
|
||||
public void setUserId(String userId) { |
||||
this.userId = userId; |
||||
} |
||||
|
||||
public String getUsername() { |
||||
return username; |
||||
} |
||||
|
||||
public void setUsername(String username) { |
||||
this.username = username; |
||||
} |
||||
|
||||
|
||||
public boolean isSelected() { |
||||
return selected; |
||||
} |
||||
|
||||
public void setSelected(boolean selected) { |
||||
this.selected = selected; |
||||
} |
||||
} |
@ -1,47 +0,0 @@
|
||||
package com.fr.design.remote; |
||||
|
||||
import com.fr.base.FRContext; |
||||
import com.fr.decision.webservice.bean.user.UserAdditionBean; |
||||
import com.fr.decision.webservice.v10.user.UserService; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Collection; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public class Utils { |
||||
|
||||
|
||||
private Utils() { |
||||
} |
||||
|
||||
public static Collection<? extends RemoteMember> getRemoteMember(String keyword) { |
||||
|
||||
List<UserAdditionBean> userBeans = new ArrayList<>(); |
||||
try { |
||||
Map<String, Object> result = |
||||
UserService.getInstance().getAllUsers( |
||||
FRContext.getCurrentEnv().getUser(), |
||||
1, |
||||
10, |
||||
keyword, |
||||
"", |
||||
true); |
||||
userBeans = (List<UserAdditionBean>) result.get("items"); |
||||
} catch (Exception e) { |
||||
FRContext.getLogger().error(e.getMessage()); |
||||
} |
||||
|
||||
List<RemoteMember> res = new ArrayList<>(); |
||||
|
||||
for (UserAdditionBean userBean : userBeans) { |
||||
res.add( |
||||
new RemoteMember() |
||||
.username(userBean.getUsername()) |
||||
.realName(userBean.getRealName()) |
||||
.userId(userBean.getId()) |
||||
); |
||||
} |
||||
return res; |
||||
} |
||||
} |
Loading…
Reference in new issue