Commit 32a50be2 by xugaojun

Merge branch 'fix_02-22_login' into developer

parents a7972961 813fac7b
...@@ -122,15 +122,11 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -122,15 +122,11 @@ public class WxEnterpriseInfoController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_600001); return resultResponse(HaoBanErrCode.ERR_600001);
} }
String phoneNumber = loginStaff.getPhoneNumber(); if (StringUtils.isNotBlank(loginStaff.getPhoneNumber())) {
if (StringUtils.isBlank(phoneNumber)) { DictDTO loginUserId = managerDictService.getSMSDict("app_login_phone_num", loginStaff.getPhoneNumber());
return resultResponse(HaoBanErrCode.ERR_600002); logger.info("伪登录:{},userId:{}", loginStaff.getPhoneNumber(), JSONObject.toJSONString(loginUserId));
} if (null != loginUserId) {
String val = loginUserId.getDictValue();
DictDTO dictDTO = managerDictService.getSMSDict("app_login_phone_num", phoneNumber);
logger.info("伪登录:{},userId:{}", phoneNumber, JSONObject.toJSONString(dictDTO));
if (null != dictDTO) {
String val = dictDTO.getDictValue();
List<StaffDTO> staffDTOS = new ArrayList<>(); List<StaffDTO> staffDTOS = new ArrayList<>();
List<StaffDTO> phoneDtos = staffApiService.listByPhoneNumber(val); List<StaffDTO> phoneDtos = staffApiService.listByPhoneNumber(val);
List<StaffDTO> userDtos = staffApiService.listByWxUserId(val); List<StaffDTO> userDtos = staffApiService.listByWxUserId(val);
...@@ -142,13 +138,14 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -142,13 +138,14 @@ public class WxEnterpriseInfoController extends WebBaseController {
} }
if (CollectionUtils.isNotEmpty(staffDTOS)) { if (CollectionUtils.isNotEmpty(staffDTOS)) {
if (staffDTOS.size() > 1) { if (staffDTOS.size() > 1) {
String dictName = dictDTO.getDictName(); String dictName = loginUserId.getDictName();
loginStaff = staffDTOS.stream().filter(staffDTO -> dictName.indexOf(staffDTO.getWxEnterpriseId()) > 0).findFirst().orElse(loginStaff); loginStaff = staffDTOS.stream().filter(staffDTO -> dictName.indexOf(staffDTO.getWxEnterpriseId()) > 0).findFirst().orElse(loginStaff);
} else { } else {
loginStaff = staffDTOS.get(0); loginStaff = staffDTOS.get(0);
} }
} }
} }
}
String staffId = loginStaff.getStaffId(); String staffId = loginStaff.getStaffId();
//激活状态 //激活状态
if (loginStaff.getActiveFlag() == 0) { if (loginStaff.getActiveFlag() == 0) {
...@@ -163,7 +160,7 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -163,7 +160,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
wellDoneLoginInfoVo.setStaffId(staffId); wellDoneLoginInfoVo.setStaffId(staffId);
wellDoneLoginInfoVo.setWxEnterpriseId(wxEnterpriseId); wellDoneLoginInfoVo.setWxEnterpriseId(wxEnterpriseId);
wellDoneLoginInfoVo.setStaffName(loginStaff.getStaffName()); wellDoneLoginInfoVo.setStaffName(loginStaff.getStaffName());
wellDoneLoginInfoVo.setPhoneNumber(phoneNumber); wellDoneLoginInfoVo.setPhoneNumber(loginStaff.getPhoneNumber());
wellDoneLoginInfoVo.setNationcode(loginStaff.getNationCode()); wellDoneLoginInfoVo.setNationcode(loginStaff.getNationCode());
wellDoneLoginInfoVo.setWxUserId(loginStaff.getWxUserId()); wellDoneLoginInfoVo.setWxUserId(loginStaff.getWxUserId());
wellDoneLoginInfoVo.setPrivacyUseFlag(1); wellDoneLoginInfoVo.setPrivacyUseFlag(1);
......
...@@ -190,7 +190,7 @@ public enum HaoBanErrCode { ...@@ -190,7 +190,7 @@ public enum HaoBanErrCode {
ERR_500001(500001, "该企业没关联好办"), ERR_500001(500001, "该企业没关联好办"),
ERR_500003(500003, "企业corpid不对应,需要重新登录传code"), ERR_500003(500003, "企业corpid不对应,需要重新登录传code"),
ERR_600001(600001, "成员不存在,请联系管理员后台授权通讯录权限"), ERR_600001(600001, "成员不存在,请联系管理员后台授权通讯录权限"),
ERR_600002(600002, "成员无手机号,请联系管理员后台授权通讯录权限"), ERR_600002(600002, "成员无手机号,请在企业微信绑定手机号"),
ERR_600003(600003, "未获取成员openid"), ERR_600003(600003, "未获取成员openid"),
ERR_10004(10004,"成员名称不能为空"), ERR_10004(10004,"成员名称不能为空"),
......
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