|
@@ -13,7 +13,6 @@ import com.cyksj.mapper.UserMapper;
|
|
|
import com.cyksj.model.dto.UserWxIndentDto;
|
|
import com.cyksj.model.dto.UserWxIndentDto;
|
|
|
import com.cyksj.model.entity.User;
|
|
import com.cyksj.model.entity.User;
|
|
|
import com.cyksj.model.entity.UserCertRecord;
|
|
import com.cyksj.model.entity.UserCertRecord;
|
|
|
-import com.cyksj.model.request.UserBindInfoReq;
|
|
|
|
|
import com.cyksj.model.request.UserIndentCertReq;
|
|
import com.cyksj.model.request.UserIndentCertReq;
|
|
|
import com.cyksj.model.response.WxCertAuthTokenResp;
|
|
import com.cyksj.model.response.WxCertAuthTokenResp;
|
|
|
import com.cyksj.redis.RedisService;
|
|
import com.cyksj.redis.RedisService;
|
|
@@ -101,27 +100,27 @@ public class UserIdentCertServiceImpl implements UserIdentCertService {
|
|
|
Long userId = indentCertReq.getUserId();
|
|
Long userId = indentCertReq.getUserId();
|
|
|
String redirectUrl = indentCertReq.getRedirectUrl();
|
|
String redirectUrl = indentCertReq.getRedirectUrl();
|
|
|
List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
- String bindState = indentCertReq.getBindState();
|
|
|
|
|
- if (userIdList.size() == 1 && StrUtil.isNotEmpty(bindState)) {
|
|
|
|
|
- User user = userMapper.selectById(userId);
|
|
|
|
|
- if (StrUtil.isEmpty(user.getOpenId())) {
|
|
|
|
|
- String key = RedisService.key.WX_INDENT_BIND_KEY.getEnvName() + bindState;
|
|
|
|
|
- Object bindInfo = redisService.get(key);
|
|
|
|
|
- if (bindInfo == null) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("认证信息已失效,请重新操作..");
|
|
|
|
|
- }
|
|
|
|
|
- Long bindUserId = Long.parseLong(bindInfo.toString());
|
|
|
|
|
- User bindUser = userMapper.selectById(bindUserId);
|
|
|
|
|
- //绑定微信端用户
|
|
|
|
|
- UserBindInfoReq request = new UserBindInfoReq();
|
|
|
|
|
- request.setType(StrUtil.isNotBlank(bindUser.getLoginPhone()) ? 1 : 2);
|
|
|
|
|
- request.setUserId(userId);
|
|
|
|
|
- request.setAccount(request.getType() == 1 ? bindUser.getLoginPhone() : bindUser.getEmail());
|
|
|
|
|
- bindTaskService.bindOtherAccount(request);
|
|
|
|
|
- userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
|
|
- redisService.del(key);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// String bindState = indentCertReq.getBindState();
|
|
|
|
|
+// if (userIdList.size() == 1 && StrUtil.isNotEmpty(bindState)) {
|
|
|
|
|
+// User user = userMapper.selectById(userId);
|
|
|
|
|
+// if (StrUtil.isEmpty(user.getOpenId())) {
|
|
|
|
|
+// String key = RedisService.key.WX_INDENT_BIND_KEY.getEnvName() + bindState;
|
|
|
|
|
+// Object bindInfo = redisService.get(key);
|
|
|
|
|
+// if (bindInfo == null) {
|
|
|
|
|
+// throw BusinessRuntimeException.getInstance("认证信息已失效,请重新操作..");
|
|
|
|
|
+// }
|
|
|
|
|
+// Long bindUserId = Long.parseLong(bindInfo.toString());
|
|
|
|
|
+// User bindUser = userMapper.selectById(bindUserId);
|
|
|
|
|
+// //绑定微信端用户
|
|
|
|
|
+// UserBindInfoReq request = new UserBindInfoReq();
|
|
|
|
|
+// request.setType(StrUtil.isNotBlank(bindUser.getLoginPhone()) ? 1 : 2);
|
|
|
|
|
+// request.setUserId(userId);
|
|
|
|
|
+// request.setAccount(request.getType() == 1 ? bindUser.getLoginPhone() : bindUser.getEmail());
|
|
|
|
|
+// bindTaskService.bindOtherAccount(request);
|
|
|
|
|
+// userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
|
|
+// redisService.del(key);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
Integer count = userCertRecordMapper.selectCount(Wrappers.lambdaQuery(UserCertRecord.class)
|
|
Integer count = userCertRecordMapper.selectCount(Wrappers.lambdaQuery(UserCertRecord.class)
|
|
|
.in(UserCertRecord::getUserId, userIdList));
|
|
.in(UserCertRecord::getUserId, userIdList));
|