Commit a682bb8e by 徐高华

log

parent c7f17e70
......@@ -96,19 +96,37 @@ public class LoginController extends WebBaseController {
String userJson = qywxCorpApiService.getLoginUserInfo(config.getCorpid(), auth_code);
if (StringUtils.isBlank(userJson)) {
logger.info("企微登录失败auth_code={}", auth_code);
return this.fail("auth_code解析失败");
String code = "1000" ;
try {
response.sendRedirect("/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
}
return this.fail(this.errMessage(code));
}
UserDTO wxUser = JSON.parseObject(userJson, UserDTO.class);
logger.info("企微登录user={}", JSON.toJSONString(wxUser));
String corpId = wxUser.getCorpid();
if (StringUtils.isBlank(corpId)) {
logger.info("企微登录失败auth_code={}", auth_code);
return this.fail("auth_code解析失败,corpId is null");
String code = "1000" ;
try {
response.sendRedirect("/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
}
return this.fail(this.errMessage(code));
}
WxEnterpriseDTO wxEnterprise = wxEnterpriseApiService.getEnterpriseBycorpId(corpId);
if (null == wxEnterprise) {
logger.info("微信企业不存在corpId={}", corpId);
return this.fail("微信企业不存在,corpId=" + corpId);
String code = "1000" ;
try {
response.sendRedirect("/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
}
return this.fail(this.errMessage(code));
}
logger.info("企微登录wxenterprise={}", JSON.toJSONString(wxEnterprise));
String wxEnterpriseId = wxEnterprise.getWxEnterpriseId();
......@@ -120,18 +138,37 @@ public class LoginController extends WebBaseController {
}
logger.info("企微登录staff={}", JSON.toJSONString(loginStaff));
if (loginStaff == null) {
return this.fail("登录失败,好办管理员不存在");
logger.info("登录失败,好办管理员不存在");
String code = "1000" ;
try {
response.sendRedirect("/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
}
return this.fail(this.errMessage(code));
}
String loginPhoneNumber = loginStaff.getPhoneNumber();
if (StringUtils.isBlank(loginPhoneNumber)) {
logger.info("未配置手机号,staffId ={}", loginStaff.getStaffId());
return this.fail("登录失败,未配置手机号");
String code = "1000" ;
try {
response.sendRedirect("/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
}
return this.fail(this.errMessage(code));
}
List<EnterpriseDetailDTO> list = this.wxEnterpriseRelatedApiService
.listEnterpriseByWxEnterpriseId(wxEnterpriseId, loginPhoneNumber, true);
if (CollectionUtils.isEmpty(list)) {
logger.info("企微下无管理GIC商户");
return this.fail("企微下无管理GIC商户");
String code = "1001" ;
try {
response.sendRedirect("/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
}
return this.fail(this.errMessage(code));
}
String gicEnterpriseId = list.get(0).getEnterpriseId();
HaobanUserDTO dto = this.haobanUserApiService.selectByPhone(wxEnterpriseId,loginPhoneNumber) ;
......
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