|
@@ -7,6 +7,7 @@ import com.tzld.piaoquan.risk.control.dao.mapper.UserBaseMapper;
|
|
|
import com.tzld.piaoquan.risk.control.model.po.UserBase;
|
|
|
import com.tzld.piaoquan.risk.control.model.po.UserBaseExample;
|
|
|
import com.tzld.piaoquan.risk.control.model.qywx.QwCallBackWrapperData;
|
|
|
+import com.tzld.piaoquan.risk.control.model.qywx.QwNeedVerifyModel;
|
|
|
import com.tzld.piaoquan.risk.control.service.qywx.Constant;
|
|
|
import lombok.Data;
|
|
|
import lombok.NoArgsConstructor;
|
|
@@ -151,27 +152,54 @@ public class QywxUserDataService {
|
|
|
return userBase;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public void loginOtherDevice(String uuid) {
|
|
|
+ public void needVerifyCode(String originalJson) {
|
|
|
+ // 1. 解析外层数据
|
|
|
+ QwCallBackWrapperData wrapperData = JSON.parseObject(originalJson, QwCallBackWrapperData.class);
|
|
|
+ if (StringUtils.isEmpty(wrapperData.getJson())) {
|
|
|
+ log.warn("Empty inner json data, uuid: {}", wrapperData.getUuid());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 2. 解析内层用户数据
|
|
|
+ String uuid = wrapperData.getUuid();
|
|
|
+ //查找库并改写登录状态
|
|
|
UserBaseExample example = new UserBaseExample();
|
|
|
example.createCriteria().andUuidEqualTo(uuid);
|
|
|
List<UserBase> users = userBaseMapper.selectByExample(example);
|
|
|
UserBase user = users.isEmpty() ? null : users.get(0);
|
|
|
+ log.info("needVerifyCode, uuid: {}, user: {}", uuid, user);
|
|
|
if (user != null) {
|
|
|
- user.setLoginStatus(Constant.LOGIN_STATUS_LOGOUT_OTHER_DEVICE);
|
|
|
+ user.setLoginStatus(Constant.LOGIN_STATUS_LOGIN_VERIFY);
|
|
|
userBaseMapper.updateByPrimaryKeySelective(user);
|
|
|
}
|
|
|
}
|
|
|
- public void seconderyVerify(String uuid) {
|
|
|
+
|
|
|
+ public void loginOtherDevice(String originalJson) {
|
|
|
+ QwCallBackWrapperData wrapperData = JSON.parseObject(originalJson, QwCallBackWrapperData.class);
|
|
|
+ if (StringUtils.isEmpty(wrapperData.getJson())) {
|
|
|
+ log.warn("Empty inner json data, uuid: {}", wrapperData.getUuid());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 2. 解析内层用户数据
|
|
|
+ String uuid = wrapperData.getUuid();
|
|
|
UserBaseExample example = new UserBaseExample();
|
|
|
example.createCriteria().andUuidEqualTo(uuid);
|
|
|
List<UserBase> users = userBaseMapper.selectByExample(example);
|
|
|
UserBase user = users.isEmpty() ? null : users.get(0);
|
|
|
if (user != null) {
|
|
|
- user.setLoginStatus(Constant.LOGIN_STATUS_LOGIN_VERIFY);
|
|
|
+ user.setLoginStatus(Constant.LOGIN_STATUS_LOGOUT_OTHER_DEVICE);
|
|
|
userBaseMapper.updateByPrimaryKeySelective(user);
|
|
|
}
|
|
|
}
|
|
|
+ public void seconderyVerify(String originalJson) {
|
|
|
+// UserBaseExample example = new UserBaseExample();
|
|
|
+// example.createCriteria().andUuidEqualTo(uuid);
|
|
|
+// List<UserBase> users = userBaseMapper.selectByExample(example);
|
|
|
+// UserBase user = users.isEmpty() ? null : users.get(0);
|
|
|
+// if (user != null) {
|
|
|
+// user.setLoginStatus(Constant.LOGIN_STATUS_LOGIN_VERIFY);
|
|
|
+// userBaseMapper.updateByPrimaryKeySelective(user);
|
|
|
+// }
|
|
|
+ }
|
|
|
|
|
|
// 根据手机号查询用户
|
|
|
public UserBase getUserByMobile(String mobile) {
|