Commit 04f8fe18 by 宋祥

Merge branch 'dev-sx' of http://129.211.46.84:8800/platform/hp-smart into dev

parents db80b9ef 50efed8b
......@@ -32,9 +32,9 @@ public class UserSessionUtils extends UserSession {
*/
public static User getUser() {
EiInfo eiInfo = new EiInfo();
eiInfo.set("userId", UserSession.getUserId());
eiInfo.set("loginName", UserSession.getLoginName());
eiInfo.set(EiConstant.serviceName, "HPXSUser");
eiInfo.set(EiConstant.methodName, "getUser");
eiInfo.set(EiConstant.methodName, "getUserByLogin");
EiInfo outInfo = XLocalManager.call(eiInfo);
// -1表示报错
if (outInfo.getStatus() == -1) {
......
......@@ -58,6 +58,41 @@ public class ServiceHPXSUser extends ServiceBase {
return outInfo;
}
/**
* 获取用户信息
*
* @param eiInfo
* @return
*/
public EiInfo getUserByLogin(EiInfo eiInfo) {
EiInfo outInfo = new EiInfo();
int status = 0;
String msg = "";
try {
String loginName = eiInfo.getString("loginName");
if (StringUtils.isNotEmpty(loginName)) {
Map map = new HashMap();
map.put("loginName", loginName);
List<User> users = dao.query("HGXSUser.query", map);
if (users != null && users.size() > 0) {
status = 1;
msg = "用户存在!";
outInfo.set("result", users.get(0));
} else {
msg = "用户信息不存在!";
}
} else {
msg = "传入用户名不能为空!";
}
outInfo.setStatus(status);
outInfo.setMsg(msg);
} catch (Exception e) {
LogUtils.setDetailMsg(outInfo, e, "平台调用用户信息异常");
}
return outInfo;
}
/**
* 查询用户下拉框
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment