Commit 813fac7b by xugaojun

修复一个登录问题

parent 897608a0
...@@ -122,30 +122,27 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -122,30 +122,27 @@ 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); List<StaffDTO> staffDTOS = new ArrayList<>();
logger.info("伪登录:{},userId:{}", phoneNumber, JSONObject.toJSONString(dictDTO)); List<StaffDTO> phoneDtos = staffApiService.listByPhoneNumber(val);
if (null != dictDTO) { List<StaffDTO> userDtos = staffApiService.listByWxUserId(val);
String val = dictDTO.getDictValue(); if (CollectionUtils.isNotEmpty(phoneDtos)) {
List<StaffDTO> staffDTOS = new ArrayList<>(); staffDTOS.addAll(phoneDtos);
List<StaffDTO> phoneDtos = staffApiService.listByPhoneNumber(val); }
List<StaffDTO> userDtos = staffApiService.listByWxUserId(val); if (CollectionUtils.isNotEmpty(userDtos)) {
if (CollectionUtils.isNotEmpty(phoneDtos)) { staffDTOS.addAll(userDtos);
staffDTOS.addAll(phoneDtos); }
} if (CollectionUtils.isNotEmpty(staffDTOS)) {
if (CollectionUtils.isNotEmpty(userDtos)) { if (staffDTOS.size() > 1) {
staffDTOS.addAll(userDtos); String dictName = loginUserId.getDictName();
} loginStaff = staffDTOS.stream().filter(staffDTO -> dictName.indexOf(staffDTO.getWxEnterpriseId()) > 0).findFirst().orElse(loginStaff);
if (CollectionUtils.isNotEmpty(staffDTOS)) { } else {
if (staffDTOS.size() > 1) { loginStaff = staffDTOS.get(0);
String dictName = dictDTO.getDictName(); }
loginStaff = staffDTOS.stream().filter(staffDTO -> dictName.indexOf(staffDTO.getWxEnterpriseId()) > 0).findFirst().orElse(loginStaff);
} else {
loginStaff = staffDTOS.get(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);
......
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