|
|
@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
+import com.cyksj.common.util.StringUtil;
|
|
|
import com.cyksj.config.corp.WeChatCorpFactory;
|
|
|
import com.cyksj.mapper.*;
|
|
|
import com.cyksj.mapper.corp.CorpFollowMapper;
|
|
|
@@ -74,6 +75,8 @@ public class CorpUserServiceImpl implements CorpUserService {
|
|
|
|
|
|
private final CmsUserMapper cmsUserMapper;
|
|
|
|
|
|
+ private final PhoneCodeMapper phoneCodeMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public YHLXUserDetailView getUserDetailView(String externalUserid, String corpId) throws Exception {
|
|
|
CorpUser corpUser = getExternalUserId(corpId, externalUserid);
|
|
|
@@ -267,6 +270,21 @@ public class CorpUserServiceImpl implements CorpUserService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String getPhoneTmpCode(String phone) {
|
|
|
+ PhoneCode phoneCode = phoneCodeMapper.selectOne(Wrappers.lambdaQuery(PhoneCode.class)
|
|
|
+ .eq(PhoneCode::getPhone, phone).last("limit 1"));
|
|
|
+ if (phoneCode == null) {
|
|
|
+ phoneCode = new PhoneCode();
|
|
|
+ }
|
|
|
+ String code = StringUtil.getRandomCodeStr(null);
|
|
|
+ phoneCode.setCode(code);
|
|
|
+ if (phoneCode.getId() == null) {
|
|
|
+ phoneCodeMapper.insert(phoneCode);
|
|
|
+ } else phoneCodeMapper.updateById(phoneCode);
|
|
|
+ return code;
|
|
|
+ }
|
|
|
+
|
|
|
public CorpUser getExternalUserId(String corpId, String externalUserid) throws Exception {
|
|
|
WxCorpApp wxCorpApp = WeChatCorpFactory.getCorpConfigStrategy(corpId);
|
|
|
|