|
|
@ -5,22 +5,18 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; |
|
|
|
import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.aliyun.dingtalk.module.DingTalkResult; |
|
|
|
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; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.feign.ResultDataResolver; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerDingDingRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; |
|
|
|
import com.epmet.commons.tools.security.dto.GovTokenDto; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.security.password.PasswordUtils; |
|
|
@ -31,8 +27,6 @@ import com.epmet.commons.tools.validator.PhoneValidatorUtils; |
|
|
|
import com.epmet.constant.AuthHttpUrlConstant; |
|
|
|
import com.epmet.constant.SmsTemplateConstant; |
|
|
|
import com.epmet.dto.*; |
|
|
|
import com.epmet.dto.dingres.DingUserDetailDTO; |
|
|
|
import com.epmet.dto.dingres.V2UserGetuserinfoResDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
@ -43,11 +37,6 @@ import com.epmet.jwt.JwtTokenUtils; |
|
|
|
import com.epmet.redis.CaptchaRedis; |
|
|
|
import com.epmet.service.GovWebService; |
|
|
|
import com.epmet.service.ThirdLoginService; |
|
|
|
import com.taobao.api.ApiException; |
|
|
|
import com.taobao.dingtalk.client.DingTalkClientToken; |
|
|
|
import com.taobao.dingtalk.client.DingTalkClientUser; |
|
|
|
import com.taobao.dingtalk.vo.result.AccessTokenResult; |
|
|
|
import com.taobao.dingtalk.vo.result.UserBaseInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
@ -87,10 +76,10 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol |
|
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetMessageOpenFeignClient messageOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private DingTalkClientToken dingTalkClientToken; |
|
|
|
@Autowired |
|
|
|
private DingTalkClientUser dingTalkClientUser; |
|
|
|
// @Autowired
|
|
|
|
// private DingTalkClientToken dingTalkClientToken;
|
|
|
|
// @Autowired
|
|
|
|
// private DingTalkClientUser dingTalkClientUser;
|
|
|
|
@Autowired |
|
|
|
private GovWebService govWebService; |
|
|
|
|
|
|
@ -870,54 +859,54 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol |
|
|
|
* @param formDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO) { |
|
|
|
//获取用户手机号
|
|
|
|
log.info("1、钉钉居民端应用登录入参:"+ JSON.toJSONString(formDTO)); |
|
|
|
ResiDingAppLoginResDTO resDTO= null; |
|
|
|
try { |
|
|
|
resDTO = new ResiDingAppLoginResDTO(); |
|
|
|
resDTO.setCustomerId(getCurrentCustomerId()); |
|
|
|
//1、获取用户手机号
|
|
|
|
String miniAppId = formDTO.getMiniAppId(); |
|
|
|
DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId); |
|
|
|
DingTalkResult<AccessTokenResult> userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret()); |
|
|
|
log.info("2、resiLoginDing userAccessToken:{}",JSON.toJSONString(userAccessToken)); |
|
|
|
if (!userAccessToken.success() || null == userAccessToken.getData()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用微信api异常:" + JSON.toJSONString(userAccessToken), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); |
|
|
|
} |
|
|
|
DingTalkResult<UserBaseInfo> me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken()); |
|
|
|
log.info("3、resiLoginDing me:{}",JSON.toJSONString(me)); |
|
|
|
resDTO.setExtInfo(JSON.toJSONString(me.getData())); |
|
|
|
if (!me.success() || StringUtils.isBlank(me.getData().getMobile())) { |
|
|
|
log.error("resilogin-ding登录接口报错,入参:" + JSON.toJSONString(formDTO) + ";获取手机号为空, userAccessToken.getData().getAccessToken()=" + userAccessToken.getData().getAccessToken()); |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空"); |
|
|
|
} |
|
|
|
// 2、调用userfeign接口获取userId、注册网格相关信息 todo
|
|
|
|
DingLoginResiFormDTO dingLoginResiFormDTO=ConvertUtils.sourceToTarget(me.getData(),DingLoginResiFormDTO.class); |
|
|
|
dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId()); |
|
|
|
Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO); |
|
|
|
if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) { |
|
|
|
//临时打个日志
|
|
|
|
log.error(String.format("resilogin-ding获取epmetUserId异常,入参:%s,user服务返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(loginResiResDTOResult))); |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:" + JSON.toJSONString(loginResiResDTOResult), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); |
|
|
|
} |
|
|
|
DingLoginResiResDTO resiResDTO=loginResiResDTOResult.getData(); |
|
|
|
resDTO.setGridId(resiResDTO.getGridId()); |
|
|
|
resDTO.setGridName(resiResDTO.getGridName()); |
|
|
|
resDTO.setAgencyId(resiResDTO.getAgencyId()); |
|
|
|
resDTO.setEpmetUserId(resiResDTO.getEpmetUserId()); |
|
|
|
resDTO.setRegFlag(resiResDTO.getRegFlag()); |
|
|
|
|
|
|
|
//3.生成token,并且存放Redis
|
|
|
|
String token=this.saveTokenDtoDing(formDTO.getMiniAppId(),AppClientConstant.APP_RESI,AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId()); |
|
|
|
resDTO.setAuthorization(token); |
|
|
|
|
|
|
|
} catch (ApiException e) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getErrMsg(), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); |
|
|
|
} |
|
|
|
return resDTO; |
|
|
|
} |
|
|
|
// @Override
|
|
|
|
// public ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO) {
|
|
|
|
// //获取用户手机号
|
|
|
|
// log.info("1、钉钉居民端应用登录入参:"+ JSON.toJSONString(formDTO));
|
|
|
|
// ResiDingAppLoginResDTO resDTO= null;
|
|
|
|
// try {
|
|
|
|
// resDTO = new ResiDingAppLoginResDTO();
|
|
|
|
// resDTO.setCustomerId(getCurrentCustomerId());
|
|
|
|
// //1、获取用户手机号
|
|
|
|
// String miniAppId = formDTO.getMiniAppId();
|
|
|
|
// DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId);
|
|
|
|
// DingTalkResult<AccessTokenResult> userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret());
|
|
|
|
// log.info("2、resiLoginDing userAccessToken:{}",JSON.toJSONString(userAccessToken));
|
|
|
|
// if (!userAccessToken.success() || null == userAccessToken.getData()) {
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用微信api异常:" + JSON.toJSONString(userAccessToken), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
|
|
|
|
// }
|
|
|
|
// DingTalkResult<UserBaseInfo> me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken());
|
|
|
|
// log.info("3、resiLoginDing me:{}",JSON.toJSONString(me));
|
|
|
|
// resDTO.setExtInfo(JSON.toJSONString(me.getData()));
|
|
|
|
// if (!me.success() || StringUtils.isBlank(me.getData().getMobile())) {
|
|
|
|
// log.error("resilogin-ding登录接口报错,入参:" + JSON.toJSONString(formDTO) + ";获取手机号为空, userAccessToken.getData().getAccessToken()=" + userAccessToken.getData().getAccessToken());
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空");
|
|
|
|
// }
|
|
|
|
// // 2、调用userfeign接口获取userId、注册网格相关信息 todo
|
|
|
|
// DingLoginResiFormDTO dingLoginResiFormDTO=ConvertUtils.sourceToTarget(me.getData(),DingLoginResiFormDTO.class);
|
|
|
|
// dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
|
|
|
|
// Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO);
|
|
|
|
// if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) {
|
|
|
|
// //临时打个日志
|
|
|
|
// log.error(String.format("resilogin-ding获取epmetUserId异常,入参:%s,user服务返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(loginResiResDTOResult)));
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:" + JSON.toJSONString(loginResiResDTOResult), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
|
|
|
|
// }
|
|
|
|
// DingLoginResiResDTO resiResDTO=loginResiResDTOResult.getData();
|
|
|
|
// resDTO.setGridId(resiResDTO.getGridId());
|
|
|
|
// resDTO.setGridName(resiResDTO.getGridName());
|
|
|
|
// resDTO.setAgencyId(resiResDTO.getAgencyId());
|
|
|
|
// resDTO.setEpmetUserId(resiResDTO.getEpmetUserId());
|
|
|
|
// resDTO.setRegFlag(resiResDTO.getRegFlag());
|
|
|
|
//
|
|
|
|
// //3.生成token,并且存放Redis
|
|
|
|
// String token=this.saveTokenDtoDing(formDTO.getMiniAppId(),AppClientConstant.APP_RESI,AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId());
|
|
|
|
// resDTO.setAuthorization(token);
|
|
|
|
//
|
|
|
|
// } catch (ApiException e) {
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getErrMsg(), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
|
|
|
|
// }
|
|
|
|
// return resDTO;
|
|
|
|
// }
|
|
|
|
|
|
|
|
private String saveTokenDtoDing(String miniAppId,String app,String client, String userId,String customerId) { |
|
|
|
//生成token串
|
|
|
@ -943,84 +932,84 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol |
|
|
|
return token; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResiDingAppLoginResDTO resiLoginDingMd(DingAppLoginMdFormDTO formDTO) { |
|
|
|
// 获取用户手机号
|
|
|
|
log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO)); |
|
|
|
ResiDingAppLoginResDTO resDTO = null; |
|
|
|
resDTO = new ResiDingAppLoginResDTO(); |
|
|
|
resDTO.setCustomerId(getCurrentCustomerId()); |
|
|
|
// 1、获取用户手机号
|
|
|
|
DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOMd(formDTO.getMiniAppId(), formDTO.getAuthCode()); |
|
|
|
dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId()); |
|
|
|
// 2、调用userfeign接口获取userId、注册网格相关信息
|
|
|
|
Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO); |
|
|
|
if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) { |
|
|
|
// 临时打个日志
|
|
|
|
log.error(String.format("resiLoginDingMd获取epmetUserId异常,入参:%s,user服务返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(loginResiResDTOResult))); |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:" + JSON.toJSONString(loginResiResDTOResult), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); |
|
|
|
} |
|
|
|
DingLoginResiResDTO resiResDTO = loginResiResDTOResult.getData(); |
|
|
|
resDTO.setGridId(resiResDTO.getGridId()); |
|
|
|
resDTO.setGridName(resiResDTO.getGridName()); |
|
|
|
resDTO.setAgencyId(resiResDTO.getAgencyId()); |
|
|
|
resDTO.setEpmetUserId(resiResDTO.getEpmetUserId()); |
|
|
|
resDTO.setRegFlag(resiResDTO.getRegFlag()); |
|
|
|
|
|
|
|
// 3.生成token,并且存放Redis
|
|
|
|
String token = this.saveTokenDtoDing(formDTO.getMiniAppId(), AppClientConstant.APP_RESI, AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId()); |
|
|
|
resDTO.setAuthorization(token); |
|
|
|
|
|
|
|
return resDTO; |
|
|
|
} |
|
|
|
|
|
|
|
private DingLoginResiFormDTO getDingLoginResiFormDTOMd(String miniAppId, String authCode) { |
|
|
|
DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId); |
|
|
|
|
|
|
|
// 1、服务商获取第三方应用授权企业的access_token,文档地址:https://open.dingtalk.com/document/orgapp-server/obtains-the-enterprise-authorized-credential
|
|
|
|
// 烟台的CorpId: dingaae55cbc47a96845f5bf40eda33b7ba0
|
|
|
|
String yantaiCorpId = "dingaae55cbc47a96845f5bf40eda33b7ba0"; |
|
|
|
DingTalkResult<String> res = dingTalkClientToken.getThirdAuthCorpAccessToken(dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), "abc", yantaiCorpId); |
|
|
|
if (!res.success() || StringUtils.isBlank(res.getData())) { |
|
|
|
log.error(String.format("企业内部应用免登服务商获取第三方应用授权企业的access_token失败,customKey:%s,customSecret:%s,corpId:%s", dingMiniInfo.getSuiteSecret(), dingMiniInfo.getSuiteSecret(), yantaiCorpId)); |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务商获取第三方应用授权企业的access_token", "服务商获取第三方应用授权企业的access_token"); |
|
|
|
} |
|
|
|
String accessToken = res.getData(); |
|
|
|
log.info(String.format("1、服务商获取第三方应用授权企业的access_token返参:%s", accessToken)); |
|
|
|
|
|
|
|
// 2、通过免登码获取用户信息,文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-userid-of-a-user-by-using-the-log-free
|
|
|
|
DingTalkResult<String> v2UserGetuserinfoRes = dingTalkClientToken.getUserInfo(accessToken, authCode); |
|
|
|
if (!v2UserGetuserinfoRes.success() || StringUtils.isBlank(v2UserGetuserinfoRes.getData())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "通过免登码获取用户信息异常", "通过免登码获取用户信息异常"); |
|
|
|
} |
|
|
|
log.info(String.format("2、通过免登码获取用户信息返参:%s", v2UserGetuserinfoRes.getData())); |
|
|
|
V2UserGetuserinfoResDTO v2UserGetuserinfoResDTO = JSON.parseObject(v2UserGetuserinfoRes.getData(), V2UserGetuserinfoResDTO.class); |
|
|
|
if (null == v2UserGetuserinfoResDTO || StringUtils.isBlank(v2UserGetuserinfoResDTO.getUserid())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉用户userid为空", "获取钉钉用户userid为空"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 3、查询用户详情,文档地址:https://open.dingtalk.com/document/isvapp-server/query-user-details
|
|
|
|
DingTalkResult<String> v2UserGetRes = dingTalkClientToken.getUserDetail(v2UserGetuserinfoResDTO.getUserid(), accessToken); |
|
|
|
if (!v2UserGetRes.success() || StringUtils.isBlank(v2UserGetRes.getData())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据userId查询用户详情失败", "根据userId查询用户详情失败"); |
|
|
|
} |
|
|
|
log.info(String.format("3、查询用户详情:%s", v2UserGetRes.getData())); |
|
|
|
DingUserDetailDTO dingUserDetailDTO = JSON.parseObject(v2UserGetRes.getData(), DingUserDetailDTO.class); |
|
|
|
if (null == dingUserDetailDTO || StringUtils.isBlank(dingUserDetailDTO.getMobile())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空"); |
|
|
|
} |
|
|
|
|
|
|
|
DingLoginResiFormDTO dingLoginResiFormDTO = new DingLoginResiFormDTO(); |
|
|
|
dingLoginResiFormDTO.setAvatarUrl(dingUserDetailDTO.getAvatar()); |
|
|
|
dingLoginResiFormDTO.setEmail(dingUserDetailDTO.getOrg_email()); |
|
|
|
dingLoginResiFormDTO.setMobile(dingUserDetailDTO.getMobile()); |
|
|
|
dingLoginResiFormDTO.setNick(dingUserDetailDTO.getName()); |
|
|
|
dingLoginResiFormDTO.setOpenId(StrConstant.EPMETY_STR); |
|
|
|
dingLoginResiFormDTO.setStateCode(dingUserDetailDTO.getState_code()); |
|
|
|
dingLoginResiFormDTO.setUnionId(dingUserDetailDTO.getUnionid()); |
|
|
|
return dingLoginResiFormDTO; |
|
|
|
} |
|
|
|
// @Override
|
|
|
|
// public ResiDingAppLoginResDTO resiLoginDingMd(DingAppLoginMdFormDTO formDTO) {
|
|
|
|
// // 获取用户手机号
|
|
|
|
// log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO));
|
|
|
|
// ResiDingAppLoginResDTO resDTO = null;
|
|
|
|
// resDTO = new ResiDingAppLoginResDTO();
|
|
|
|
// resDTO.setCustomerId(getCurrentCustomerId());
|
|
|
|
// // 1、获取用户手机号
|
|
|
|
// DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOMd(formDTO.getMiniAppId(), formDTO.getAuthCode());
|
|
|
|
// dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
|
|
|
|
// // 2、调用userfeign接口获取userId、注册网格相关信息
|
|
|
|
// Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO);
|
|
|
|
// if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) {
|
|
|
|
// // 临时打个日志
|
|
|
|
// log.error(String.format("resiLoginDingMd获取epmetUserId异常,入参:%s,user服务返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(loginResiResDTOResult)));
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:" + JSON.toJSONString(loginResiResDTOResult), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
|
|
|
|
// }
|
|
|
|
// DingLoginResiResDTO resiResDTO = loginResiResDTOResult.getData();
|
|
|
|
// resDTO.setGridId(resiResDTO.getGridId());
|
|
|
|
// resDTO.setGridName(resiResDTO.getGridName());
|
|
|
|
// resDTO.setAgencyId(resiResDTO.getAgencyId());
|
|
|
|
// resDTO.setEpmetUserId(resiResDTO.getEpmetUserId());
|
|
|
|
// resDTO.setRegFlag(resiResDTO.getRegFlag());
|
|
|
|
//
|
|
|
|
// // 3.生成token,并且存放Redis
|
|
|
|
// String token = this.saveTokenDtoDing(formDTO.getMiniAppId(), AppClientConstant.APP_RESI, AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId());
|
|
|
|
// resDTO.setAuthorization(token);
|
|
|
|
//
|
|
|
|
// return resDTO;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// private DingLoginResiFormDTO getDingLoginResiFormDTOMd(String miniAppId, String authCode) {
|
|
|
|
// DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId);
|
|
|
|
//
|
|
|
|
// // 1、服务商获取第三方应用授权企业的access_token,文档地址:https://open.dingtalk.com/document/orgapp-server/obtains-the-enterprise-authorized-credential
|
|
|
|
// // 烟台的CorpId: dingaae55cbc47a96845f5bf40eda33b7ba0
|
|
|
|
// String yantaiCorpId = "dingaae55cbc47a96845f5bf40eda33b7ba0";
|
|
|
|
// DingTalkResult<String> res = dingTalkClientToken.getThirdAuthCorpAccessToken(dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), "abc", yantaiCorpId);
|
|
|
|
// if (!res.success() || StringUtils.isBlank(res.getData())) {
|
|
|
|
// log.error(String.format("企业内部应用免登服务商获取第三方应用授权企业的access_token失败,customKey:%s,customSecret:%s,corpId:%s", dingMiniInfo.getSuiteSecret(), dingMiniInfo.getSuiteSecret(), yantaiCorpId));
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务商获取第三方应用授权企业的access_token", "服务商获取第三方应用授权企业的access_token");
|
|
|
|
// }
|
|
|
|
// String accessToken = res.getData();
|
|
|
|
// log.info(String.format("1、服务商获取第三方应用授权企业的access_token返参:%s", accessToken));
|
|
|
|
//
|
|
|
|
// // 2、通过免登码获取用户信息,文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-userid-of-a-user-by-using-the-log-free
|
|
|
|
// DingTalkResult<String> v2UserGetuserinfoRes = dingTalkClientToken.getUserInfo(accessToken, authCode);
|
|
|
|
// if (!v2UserGetuserinfoRes.success() || StringUtils.isBlank(v2UserGetuserinfoRes.getData())) {
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "通过免登码获取用户信息异常", "通过免登码获取用户信息异常");
|
|
|
|
// }
|
|
|
|
// log.info(String.format("2、通过免登码获取用户信息返参:%s", v2UserGetuserinfoRes.getData()));
|
|
|
|
// V2UserGetuserinfoResDTO v2UserGetuserinfoResDTO = JSON.parseObject(v2UserGetuserinfoRes.getData(), V2UserGetuserinfoResDTO.class);
|
|
|
|
// if (null == v2UserGetuserinfoResDTO || StringUtils.isBlank(v2UserGetuserinfoResDTO.getUserid())) {
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉用户userid为空", "获取钉钉用户userid为空");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// // 3、查询用户详情,文档地址:https://open.dingtalk.com/document/isvapp-server/query-user-details
|
|
|
|
// DingTalkResult<String> v2UserGetRes = dingTalkClientToken.getUserDetail(v2UserGetuserinfoResDTO.getUserid(), accessToken);
|
|
|
|
// if (!v2UserGetRes.success() || StringUtils.isBlank(v2UserGetRes.getData())) {
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据userId查询用户详情失败", "根据userId查询用户详情失败");
|
|
|
|
// }
|
|
|
|
// log.info(String.format("3、查询用户详情:%s", v2UserGetRes.getData()));
|
|
|
|
// DingUserDetailDTO dingUserDetailDTO = JSON.parseObject(v2UserGetRes.getData(), DingUserDetailDTO.class);
|
|
|
|
// if (null == dingUserDetailDTO || StringUtils.isBlank(dingUserDetailDTO.getMobile())) {
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// DingLoginResiFormDTO dingLoginResiFormDTO = new DingLoginResiFormDTO();
|
|
|
|
// dingLoginResiFormDTO.setAvatarUrl(dingUserDetailDTO.getAvatar());
|
|
|
|
// dingLoginResiFormDTO.setEmail(dingUserDetailDTO.getOrg_email());
|
|
|
|
// dingLoginResiFormDTO.setMobile(dingUserDetailDTO.getMobile());
|
|
|
|
// dingLoginResiFormDTO.setNick(dingUserDetailDTO.getName());
|
|
|
|
// dingLoginResiFormDTO.setOpenId(StrConstant.EPMETY_STR);
|
|
|
|
// dingLoginResiFormDTO.setStateCode(dingUserDetailDTO.getState_code());
|
|
|
|
// dingLoginResiFormDTO.setUnionId(dingUserDetailDTO.getUnionid());
|
|
|
|
// return dingLoginResiFormDTO;
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@ -1043,57 +1032,57 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol |
|
|
|
* @param formDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public ResiDingAppLoginResDTO resiLoginInternalDing(DingAppLoginMdFormDTO formDTO) { |
|
|
|
// 获取用户手机号
|
|
|
|
log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO)); |
|
|
|
ResiDingAppLoginResDTO resDTO = new ResiDingAppLoginResDTO(); |
|
|
|
resDTO.setCustomerId(getCurrentCustomerId()); |
|
|
|
|
|
|
|
// 1、获取用户手机号
|
|
|
|
DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOInternal(formDTO.getMiniAppId(), formDTO.getAuthCode()); |
|
|
|
dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId()); |
|
|
|
resDTO.setRealName(dingLoginResiFormDTO.getNick()); |
|
|
|
// 2、调用userfeign接口获取userId、注册网格相关信息
|
|
|
|
Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO); |
|
|
|
if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) { |
|
|
|
// 临时打个日志
|
|
|
|
log.error(String.format("resiLoginInternalDing获取epmetUserId异常,入参:%s", JSON.toJSONString(dingLoginResiFormDTO))); |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:"+ JSON.toJSONString(loginResiResDTOResult), "获取epmetUserId异常"); |
|
|
|
} |
|
|
|
DingLoginResiResDTO resiResDTO = loginResiResDTOResult.getData(); |
|
|
|
resDTO.setGridId(resiResDTO.getGridId()); |
|
|
|
resDTO.setGridName(resiResDTO.getGridName()); |
|
|
|
resDTO.setAgencyId(resiResDTO.getAgencyId()); |
|
|
|
resDTO.setEpmetUserId(resiResDTO.getEpmetUserId()); |
|
|
|
resDTO.setRegFlag(resiResDTO.getRegFlag()); |
|
|
|
|
|
|
|
// 3.生成token,并且存放Redis
|
|
|
|
String token = this.saveTokenDtoDing(formDTO.getMiniAppId(), AppClientConstant.APP_RESI, AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId()); |
|
|
|
resDTO.setAuthorization(token); |
|
|
|
|
|
|
|
return resDTO; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public UserTokenResultDTO govLoginInternalDing(DingAppLoginMdFormDTO formDTO) { |
|
|
|
// 获取用户手机号
|
|
|
|
log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO)); |
|
|
|
ResiDingAppLoginResDTO resDTO = null; |
|
|
|
resDTO = new ResiDingAppLoginResDTO(); |
|
|
|
resDTO.setCustomerId(getCurrentCustomerId()); |
|
|
|
|
|
|
|
// 1、获取用户手机号
|
|
|
|
DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOInternal(formDTO.getMiniAppId(), formDTO.getAuthCode()); |
|
|
|
dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId()); |
|
|
|
|
|
|
|
|
|
|
|
GovWebLoginFormDTO loginGovParam = new GovWebLoginFormDTO(); |
|
|
|
loginGovParam.setCustomerId(dingLoginResiFormDTO.getCustomerId()); |
|
|
|
loginGovParam.setPhone(dingLoginResiFormDTO.getMobile()); |
|
|
|
|
|
|
|
return govWebService.loginByThirdPlatform(loginGovParam); |
|
|
|
} |
|
|
|
// @Override
|
|
|
|
// public ResiDingAppLoginResDTO resiLoginInternalDing(DingAppLoginMdFormDTO formDTO) {
|
|
|
|
// // 获取用户手机号
|
|
|
|
// log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO));
|
|
|
|
// ResiDingAppLoginResDTO resDTO = new ResiDingAppLoginResDTO();
|
|
|
|
// resDTO.setCustomerId(getCurrentCustomerId());
|
|
|
|
//
|
|
|
|
// // 1、获取用户手机号
|
|
|
|
// DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOInternal(formDTO.getMiniAppId(), formDTO.getAuthCode());
|
|
|
|
// dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
|
|
|
|
// resDTO.setRealName(dingLoginResiFormDTO.getNick());
|
|
|
|
// // 2、调用userfeign接口获取userId、注册网格相关信息
|
|
|
|
// Result<DingLoginResiResDTO> loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO);
|
|
|
|
// if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) {
|
|
|
|
// // 临时打个日志
|
|
|
|
// log.error(String.format("resiLoginInternalDing获取epmetUserId异常,入参:%s", JSON.toJSONString(dingLoginResiFormDTO)));
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:"+ JSON.toJSONString(loginResiResDTOResult), "获取epmetUserId异常");
|
|
|
|
// }
|
|
|
|
// DingLoginResiResDTO resiResDTO = loginResiResDTOResult.getData();
|
|
|
|
// resDTO.setGridId(resiResDTO.getGridId());
|
|
|
|
// resDTO.setGridName(resiResDTO.getGridName());
|
|
|
|
// resDTO.setAgencyId(resiResDTO.getAgencyId());
|
|
|
|
// resDTO.setEpmetUserId(resiResDTO.getEpmetUserId());
|
|
|
|
// resDTO.setRegFlag(resiResDTO.getRegFlag());
|
|
|
|
//
|
|
|
|
// // 3.生成token,并且存放Redis
|
|
|
|
// String token = this.saveTokenDtoDing(formDTO.getMiniAppId(), AppClientConstant.APP_RESI, AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId());
|
|
|
|
// resDTO.setAuthorization(token);
|
|
|
|
//
|
|
|
|
// return resDTO;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
// public UserTokenResultDTO govLoginInternalDing(DingAppLoginMdFormDTO formDTO) {
|
|
|
|
// // 获取用户手机号
|
|
|
|
// log.info("1、钉钉居民端应用登录入参:" + JSON.toJSONString(formDTO));
|
|
|
|
// ResiDingAppLoginResDTO resDTO = null;
|
|
|
|
// resDTO = new ResiDingAppLoginResDTO();
|
|
|
|
// resDTO.setCustomerId(getCurrentCustomerId());
|
|
|
|
//
|
|
|
|
// // 1、获取用户手机号
|
|
|
|
// DingLoginResiFormDTO dingLoginResiFormDTO = getDingLoginResiFormDTOInternal(formDTO.getMiniAppId(), formDTO.getAuthCode());
|
|
|
|
// dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId());
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// GovWebLoginFormDTO loginGovParam = new GovWebLoginFormDTO();
|
|
|
|
// loginGovParam.setCustomerId(dingLoginResiFormDTO.getCustomerId());
|
|
|
|
// loginGovParam.setPhone(dingLoginResiFormDTO.getMobile());
|
|
|
|
//
|
|
|
|
// return govWebService.loginByThirdPlatform(loginGovParam);
|
|
|
|
// }
|
|
|
|
|
|
|
|
@Override |
|
|
|
public UserTokenResultDTO yanTaiSSOLogin(String authCode) { |
|
|
@ -1115,55 +1104,55 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol |
|
|
|
* @param authCode |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private DingLoginResiFormDTO getDingLoginResiFormDTOInternal(String miniAppId, String authCode) { |
|
|
|
DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId); |
|
|
|
if (dingMiniInfo == null){ |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉应用配置异常", "获取钉钉应用配置异常"); |
|
|
|
} |
|
|
|
// 1、获取企业内部应用的accessToken文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-access_token-of-an-internal-app
|
|
|
|
String accessToken = ""; |
|
|
|
DingTalkResult<String> dingTalkResult = dingTalkClientToken.getAppAccessTokenToken(dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret()); |
|
|
|
if (!dingTalkResult.success() || StringUtils.isBlank(dingTalkResult.getData())) { |
|
|
|
log.error(String.format("获取企业内部应用的accessToken失败,customKey:%s,customSecret:%s", dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret())); |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取企业内部应用的accessToken异常", "获取企业内部应用的accessToken"); |
|
|
|
} |
|
|
|
accessToken = dingTalkResult.getData(); |
|
|
|
log.info(String.format("1、获取企业内部应用的accessToken返参:%s", accessToken)); |
|
|
|
|
|
|
|
|
|
|
|
// 2、通过免登码获取用户信息,文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-userid-of-a-user-by-using-the-log-free
|
|
|
|
DingTalkResult<String> v2UserGetuserinfoRes = dingTalkClientToken.getUserInfo(accessToken, authCode); |
|
|
|
if (!v2UserGetuserinfoRes.success() || StringUtils.isBlank(v2UserGetuserinfoRes.getData())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "通过免登码获取用户信息异常", "通过免登码获取用户信息异常"); |
|
|
|
} |
|
|
|
log.info(String.format("2、通过免登码获取用户信息返参:%s", v2UserGetuserinfoRes.getData())); |
|
|
|
V2UserGetuserinfoResDTO v2UserGetuserinfoResDTO = JSON.parseObject(v2UserGetuserinfoRes.getData(), V2UserGetuserinfoResDTO.class); |
|
|
|
if (null == v2UserGetuserinfoResDTO || StringUtils.isBlank(v2UserGetuserinfoResDTO.getUserid())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉用户userid为空", "获取钉钉用户userid为空"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 3、查询用户详情,文档地址:https://open.dingtalk.com/document/isvapp-server/query-user-details
|
|
|
|
DingTalkResult<String> v2UserGetRes = dingTalkClientToken.getUserDetail(v2UserGetuserinfoResDTO.getUserid(), accessToken); |
|
|
|
if (!v2UserGetRes.success() || StringUtils.isBlank(v2UserGetRes.getData())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据userId查询用户详情失败", "根据userId查询用户详情失败"); |
|
|
|
} |
|
|
|
log.info(String.format("3、查询用户详情:%s", v2UserGetRes.getData())); |
|
|
|
DingUserDetailDTO dingUserDetailDTO = JSON.parseObject(v2UserGetRes.getData(), DingUserDetailDTO.class); |
|
|
|
if (null == dingUserDetailDTO || StringUtils.isBlank(dingUserDetailDTO.getMobile())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空"); |
|
|
|
} |
|
|
|
|
|
|
|
DingLoginResiFormDTO dingLoginResiFormDTO = new DingLoginResiFormDTO(); |
|
|
|
dingLoginResiFormDTO.setAvatarUrl(dingUserDetailDTO.getAvatar()); |
|
|
|
dingLoginResiFormDTO.setEmail(dingUserDetailDTO.getOrg_email()); |
|
|
|
dingLoginResiFormDTO.setMobile(dingUserDetailDTO.getMobile()); |
|
|
|
dingLoginResiFormDTO.setNick(dingUserDetailDTO.getName()); |
|
|
|
dingLoginResiFormDTO.setOpenId(StrConstant.EPMETY_STR); |
|
|
|
dingLoginResiFormDTO.setStateCode(dingUserDetailDTO.getState_code()); |
|
|
|
dingLoginResiFormDTO.setUnionId(dingUserDetailDTO.getUnionid()); |
|
|
|
return dingLoginResiFormDTO; |
|
|
|
} |
|
|
|
// private DingLoginResiFormDTO getDingLoginResiFormDTOInternal(String miniAppId, String authCode) {
|
|
|
|
// DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId);
|
|
|
|
// if (dingMiniInfo == null){
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉应用配置异常", "获取钉钉应用配置异常");
|
|
|
|
// }
|
|
|
|
// // 1、获取企业内部应用的accessToken文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-access_token-of-an-internal-app
|
|
|
|
// String accessToken = "";
|
|
|
|
// DingTalkResult<String> dingTalkResult = dingTalkClientToken.getAppAccessTokenToken(dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret());
|
|
|
|
// if (!dingTalkResult.success() || StringUtils.isBlank(dingTalkResult.getData())) {
|
|
|
|
// log.error(String.format("获取企业内部应用的accessToken失败,customKey:%s,customSecret:%s", dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret()));
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取企业内部应用的accessToken异常", "获取企业内部应用的accessToken");
|
|
|
|
// }
|
|
|
|
// accessToken = dingTalkResult.getData();
|
|
|
|
// log.info(String.format("1、获取企业内部应用的accessToken返参:%s", accessToken));
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// // 2、通过免登码获取用户信息,文档地址:https://open.dingtalk.com/document/orgapp-server/obtain-the-userid-of-a-user-by-using-the-log-free
|
|
|
|
// DingTalkResult<String> v2UserGetuserinfoRes = dingTalkClientToken.getUserInfo(accessToken, authCode);
|
|
|
|
// if (!v2UserGetuserinfoRes.success() || StringUtils.isBlank(v2UserGetuserinfoRes.getData())) {
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "通过免登码获取用户信息异常", "通过免登码获取用户信息异常");
|
|
|
|
// }
|
|
|
|
// log.info(String.format("2、通过免登码获取用户信息返参:%s", v2UserGetuserinfoRes.getData()));
|
|
|
|
// V2UserGetuserinfoResDTO v2UserGetuserinfoResDTO = JSON.parseObject(v2UserGetuserinfoRes.getData(), V2UserGetuserinfoResDTO.class);
|
|
|
|
// if (null == v2UserGetuserinfoResDTO || StringUtils.isBlank(v2UserGetuserinfoResDTO.getUserid())) {
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取钉钉用户userid为空", "获取钉钉用户userid为空");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// // 3、查询用户详情,文档地址:https://open.dingtalk.com/document/isvapp-server/query-user-details
|
|
|
|
// DingTalkResult<String> v2UserGetRes = dingTalkClientToken.getUserDetail(v2UserGetuserinfoResDTO.getUserid(), accessToken);
|
|
|
|
// if (!v2UserGetRes.success() || StringUtils.isBlank(v2UserGetRes.getData())) {
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据userId查询用户详情失败", "根据userId查询用户详情失败");
|
|
|
|
// }
|
|
|
|
// log.info(String.format("3、查询用户详情:%s", v2UserGetRes.getData()));
|
|
|
|
// DingUserDetailDTO dingUserDetailDTO = JSON.parseObject(v2UserGetRes.getData(), DingUserDetailDTO.class);
|
|
|
|
// if (null == dingUserDetailDTO || StringUtils.isBlank(dingUserDetailDTO.getMobile())) {
|
|
|
|
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取手机号为空", "获取手机号为空");
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// DingLoginResiFormDTO dingLoginResiFormDTO = new DingLoginResiFormDTO();
|
|
|
|
// dingLoginResiFormDTO.setAvatarUrl(dingUserDetailDTO.getAvatar());
|
|
|
|
// dingLoginResiFormDTO.setEmail(dingUserDetailDTO.getOrg_email());
|
|
|
|
// dingLoginResiFormDTO.setMobile(dingUserDetailDTO.getMobile());
|
|
|
|
// dingLoginResiFormDTO.setNick(dingUserDetailDTO.getName());
|
|
|
|
// dingLoginResiFormDTO.setOpenId(StrConstant.EPMETY_STR);
|
|
|
|
// dingLoginResiFormDTO.setStateCode(dingUserDetailDTO.getState_code());
|
|
|
|
// dingLoginResiFormDTO.setUnionId(dingUserDetailDTO.getUnionid());
|
|
|
|
// return dingLoginResiFormDTO;
|
|
|
|
// }
|
|
|
|
|
|
|
|
/** |
|
|
|
* 客户写死吧 |
|
|
|