|
@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -94,19 +95,11 @@ public class LoginServiceImpl implements LoginService {
|
|
|
String md5Password = Md5Util.md5(password);
|
|
|
String dbPassword = baseUser.getPassword();
|
|
|
if (md5Password.equals(dbPassword)) {
|
|
|
- /**
|
|
|
- * 登录成功
|
|
|
- *
|
|
|
- */
|
|
|
- Integer userId = baseUser.getUserId();
|
|
|
- SuperVipDto end = findEnd(userId);
|
|
|
- Integer vipFlag = end.getVipFlag();
|
|
|
if (baseUser.getUserIdentity() == 1) {
|
|
|
// 协销登录
|
|
|
return ResponseJson.success(baseUser);
|
|
|
} else {
|
|
|
// 返回登录校验结果
|
|
|
- baseUser.setVipFlag(vipFlag);
|
|
|
return logonVerify(baseUser);
|
|
|
}
|
|
|
}
|
|
@@ -302,22 +295,7 @@ public class LoginServiceImpl implements LoginService {
|
|
|
}
|
|
|
}
|
|
|
if (null != loginUser.getUserIdentity() && (2 == loginUser.getUserIdentity() || 4 == loginUser.getUserIdentity())) {
|
|
|
- Integer id = clubMapper.findLoginBeans(loginUser.getUserId());
|
|
|
- if (id == null) {
|
|
|
- //登录赠送10采美豆
|
|
|
- UserVo user = baseMapper.getUserByUserId(loginUser.getUserId());
|
|
|
- UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|
|
|
- beansHistory.setUserId(user.getUserId());
|
|
|
- beansHistory.setBeansType(12);
|
|
|
- beansHistory.setType(1);
|
|
|
- beansHistory.setNum(10);
|
|
|
- beansHistory.setPushStatus(0);
|
|
|
- beansHistory.setAddTime(new Date());
|
|
|
- registerMapper.insertBeansHistory(beansHistory);
|
|
|
- Integer userBeans = user.getUserBeans();
|
|
|
- userBeans = userBeans == null ? 10 : userBeans + 10;
|
|
|
- clubMapper.updateUserBeans(loginUser.getUserId(), userBeans);
|
|
|
- }
|
|
|
+ loginUpdateBeans(loginUser.getUserId());
|
|
|
}
|
|
|
SuperVipDto end = findEnd(loginUser.getUserId());
|
|
|
loginUser.setVipFlag(end.getVipFlag());
|
|
@@ -336,6 +314,26 @@ public class LoginServiceImpl implements LoginService {
|
|
|
return ResponseJson.success("登录成功", loginUser);
|
|
|
}
|
|
|
|
|
|
+ @Async
|
|
|
+ void loginUpdateBeans(Integer userId) {
|
|
|
+ Integer id = clubMapper.findLoginBeans(userId);
|
|
|
+ if (id == null) {
|
|
|
+ //登录赠送10采美豆
|
|
|
+ UserVo user = baseMapper.getUserByUserId(userId);
|
|
|
+ UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|
|
|
+ beansHistory.setUserId(user.getUserId());
|
|
|
+ beansHistory.setBeansType(12);
|
|
|
+ beansHistory.setType(1);
|
|
|
+ beansHistory.setNum(10);
|
|
|
+ beansHistory.setPushStatus(0);
|
|
|
+ beansHistory.setAddTime(new Date());
|
|
|
+ registerMapper.insertBeansHistory(beansHistory);
|
|
|
+ Integer userBeans = user.getUserBeans();
|
|
|
+ userBeans = userBeans == null ? 10 : userBeans + 10;
|
|
|
+ clubMapper.updateUserBeans(userId, userBeans);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取生成微信二维码的参数(www)
|
|
|
*
|