Commit c8faea3e authored by Quxl's avatar Quxl

x

parent 07dd3671
......@@ -815,36 +815,27 @@ public class UserServiceImpl implements UserService {
ResultMutil result = jdbcTemplate.executeMutil(sql, orgNo, openId, mobile, name);
List<List<Map<String, Object>>> datas = result.getDatas();
List<Map<String, Object>> uList = datas.get(0);
List<Map<String, Object>> shopList = datas.get(3);
if(StringUtil.isBlank(mobile) && uList.size() == 0) {
throw new XException("账户不存在", 201);
}
if(shopList.size() == 0) {
throw new XException("该账号暂未绑定门店");
}
Map<String, Object> uMap = uList.get(0);
Object Status = uMap.get("Status");
Object ErrorMsg = uMap.get("ErrorMsg");
Map<String, Object> map = new HashMap<String, Object>();
if(Status != null) {
Integer code = ((Number)Status).intValue();
if(code != 0) {
throw throwLoginError(ErrorMsg);
} else {
map.put("userinfo", uMap);
map.put("customer", datas.get(1).get(0));
map.put("bankList", datas.get(2));
map.put("shopList", datas.get(3));
return map;
}
Integer code = ((Number)Status).intValue();
if(code != 0) {
throw throwLoginError(ErrorMsg, ((Number)Status).intValue());
} else {
throw throwLoginError(ErrorMsg);
Map<String, Object> map = new HashMap<String, Object>();
List<Map<String, Object>> shopList = datas.get(3);
if(shopList.size() == 0) {
throw new XException("该账号暂未绑定门店");
}
map.put("userinfo", uMap);
map.put("customer", datas.get(1).get(0));
map.put("bankList", datas.get(2));
map.put("shopList", shopList);
return map;
}
}
private XException throwLoginError(Object errorMsg) {
private XException throwLoginError(Object errorMsg, Integer code) {
if(StringUtil.isBlank(errorMsg)) {
errorMsg = "登陆失败";
}
......
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