Browse Source

/auth/thirdlogin/worklogin+/getmyorg

dev
yinzuomei 3 years ago
parent
commit
936bab1596
  1. 18
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

18
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -10,6 +10,7 @@ import com.epmet.auth.constants.AuthOperationConstants;
import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.rocketmq.messages.LoginMQMsg;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.EnvEnum;
@ -192,6 +193,19 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
throw new RenException(EpmetErrorCode.PLEASE_LOGIN.getCode());
}
StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = latestStaffWechat.getData();
//2022.11.24校验下用户是否被禁用
//2.1根据手机号查询到用户信息
ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO();
dto.setCustomerId(staffLatestAgencyResultDTO.getCustomerId());
dto.setMobile(staffLatestAgencyResultDTO.getMobile());
Result<List<CustomerStaffDTO>> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto);
if (!customerStaffResult.success()) {
logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", staffLatestAgencyResultDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg()));
throw new RenException(customerStaffResult.getCode());
}
if("disabled".equals(customerStaffResult.getData().get(NumConstant.ZERO).getEnableFlag())){
throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg());
}
//3.记录staff_wechat
this.savestaffwechat(staffLatestAgencyResultDTO.getStaffId(), userWechatDTO.getWxOpenId(), staffLatestAgencyResultDTO.getCustomerId());
@ -538,7 +552,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg()));
throw new RenException(customerStaffResult.getCode());
}
if("disabled".equals(customerStaffResult.getData().get(NumConstant.ZERO).getEnableFlag())){
throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg());
}
//3、查询用户所有的组织信息
List<String> customerIdList = new ArrayList<>();
for (CustomerStaffDTO customerStaffDTO : customerStaffResult.getData()) {

Loading…
Cancel
Save