|
@@ -23,6 +23,7 @@ import com.cyksj.mapper.corp.*;
|
|
|
import com.cyksj.mapper.manage.cps.UserDistributePopularizeMapper;
|
|
import com.cyksj.mapper.manage.cps.UserDistributePopularizeMapper;
|
|
|
import com.cyksj.mapper.manage.distribute.UserDistributeSharedMapper;
|
|
import com.cyksj.mapper.manage.distribute.UserDistributeSharedMapper;
|
|
|
import com.cyksj.mapper.market.task.UserBindDetailMapper;
|
|
import com.cyksj.mapper.market.task.UserBindDetailMapper;
|
|
|
|
|
+import com.cyksj.mapper.station.CollegeStudentStationUserRelateMapper;
|
|
|
import com.cyksj.model.dto.*;
|
|
import com.cyksj.model.dto.*;
|
|
|
import com.cyksj.model.entity.*;
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.request.LoginReq;
|
|
import com.cyksj.model.request.LoginReq;
|
|
@@ -34,6 +35,7 @@ import com.cyksj.service.distribute.equipment.EquipmentDistributeService;
|
|
|
import com.cyksj.service.exchange.ExchangeCodeService;
|
|
import com.cyksj.service.exchange.ExchangeCodeService;
|
|
|
import com.cyksj.service.mange.coupon.CouponCommonService;
|
|
import com.cyksj.service.mange.coupon.CouponCommonService;
|
|
|
import com.cyksj.service.market.task.BindTaskService;
|
|
import com.cyksj.service.market.task.BindTaskService;
|
|
|
|
|
+import com.cyksj.service.relation.GroupRelationFrontService;
|
|
|
import com.cyksj.service.shop.YhShopDistributeService;
|
|
import com.cyksj.service.shop.YhShopDistributeService;
|
|
|
import com.cyksj.service.sys.SysConfigService;
|
|
import com.cyksj.service.sys.SysConfigService;
|
|
|
import com.cyksj.service.user.BadIntentionOpService;
|
|
import com.cyksj.service.user.BadIntentionOpService;
|
|
@@ -120,10 +122,23 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
private final UserDistributeSharedMapper userDistributeSharedMapper;
|
|
private final UserDistributeSharedMapper userDistributeSharedMapper;
|
|
|
|
|
|
|
|
private final BadIntentionOpService badIntentionOpService;
|
|
private final BadIntentionOpService badIntentionOpService;
|
|
|
|
|
+
|
|
|
|
|
+ private final CollegeStudentStationUserRelateMapper collegeStudentStationUserRelateMapper;
|
|
|
|
|
+
|
|
|
|
|
+ private final GroupRelationFrontService groupRelationFrontService;
|
|
|
|
|
+
|
|
|
private static final GlobalThreadPoolTaskExecutor TASK_POOL = GlobalThreadPoolTaskExecutor.getInstance();
|
|
private static final GlobalThreadPoolTaskExecutor TASK_POOL = GlobalThreadPoolTaskExecutor.getInstance();
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public User saveAuth(GzhOAuth2UserInfo info, Long sharedId, Integer dsType, Long pid, User.RegisterEnv registerEnv, String dsCode, String callback, String callbackType, String customId) throws Exception {
|
|
|
|
|
|
|
+ public User saveAuth(GzhOAuth2UserInfo info, AuthRedirect re, User.RegisterEnv registerEnv) throws Exception {
|
|
|
|
|
+ Long sharedId = re.getSharedId();
|
|
|
|
|
+ Integer dsType = re.getDsType();
|
|
|
|
|
+ Long pid = re.getPid();
|
|
|
|
|
+ String dsCode = re.getDsCode();
|
|
|
|
|
+ String callback = re.getCk();
|
|
|
|
|
+ String callbackType = re.getCt();
|
|
|
|
|
+ String customId = re.getCd();
|
|
|
|
|
+
|
|
|
final String unionid = info.getUnionid();
|
|
final String unionid = info.getUnionid();
|
|
|
if (StrUtil.isEmpty(unionid)) {
|
|
if (StrUtil.isEmpty(unionid)) {
|
|
|
throw BusinessRuntimeException.getInstance("授权操作异常,请刷新页面");
|
|
throw BusinessRuntimeException.getInstance("授权操作异常,请刷新页面");
|
|
@@ -206,6 +221,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
}
|
|
}
|
|
|
//每日活跃记录
|
|
//每日活跃记录
|
|
|
userLoginRecordService.saveUserLoginDayRecord(user.getId());
|
|
userLoginRecordService.saveUserLoginDayRecord(user.getId());
|
|
|
|
|
+ //是否是大学生快递站进来的用户
|
|
|
|
|
+ Integer cst = re.getCst();
|
|
|
|
|
+ if (cst != null) {
|
|
|
|
|
+ TASK_POOL.execute(() -> {
|
|
|
|
|
+ handlerCollegeStudentUser(userId, cst);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
return user;
|
|
return user;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -519,7 +541,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
String json = Codec.DoBase64.custom().setData(state).decodeAsText();
|
|
String json = Codec.DoBase64.custom().setData(state).decodeAsText();
|
|
|
AuthRedirect re = Jsons.parseObject(json, AuthRedirect.class);
|
|
AuthRedirect re = Jsons.parseObject(json, AuthRedirect.class);
|
|
|
//保存用户信息
|
|
//保存用户信息
|
|
|
- User user = saveAuth(userinfo, re.getSharedId(), re.getDsType(), re.getPid(), User.RegisterEnv.pc, re.getDsCode(), re.getCk(), re.getCt(), re.getCd());
|
|
|
|
|
|
|
+ User user = saveAuth(userinfo, re, User.RegisterEnv.pc);
|
|
|
if (user == null) {
|
|
if (user == null) {
|
|
|
throw BusinessRuntimeException.getInstance("系统错误,请重新授权");
|
|
throw BusinessRuntimeException.getInstance("系统错误,请重新授权");
|
|
|
}
|
|
}
|
|
@@ -765,4 +787,20 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
log.info("建立用户userId:{}与sharedId:{}绑定关系", userId, sharedId);
|
|
log.info("建立用户userId:{}与sharedId:{}绑定关系", userId, sharedId);
|
|
|
distributeService.saveDistributionInvitation(sharedId, user.getId(), dsPopularizeId);
|
|
distributeService.saveDistributionInvitation(sharedId, user.getId(), dsPopularizeId);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理大学生快递站用户
|
|
|
|
|
+ */
|
|
|
|
|
+ public void handlerCollegeStudentUser(Long userId, Integer cst) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ CollegeStudentStationUserRelate cstRelate = new CollegeStudentStationUserRelate();
|
|
|
|
|
+ cstRelate.setType(cst);
|
|
|
|
|
+ cstRelate.setUserId(userId);
|
|
|
|
|
+ collegeStudentStationUserRelateMapper.insert(cstRelate);
|
|
|
|
|
+
|
|
|
|
|
+ //赠送1天的GPT镜像车票
|
|
|
|
|
+ groupRelationFrontService.getCollegeStudentUserGptTicket(userId);
|
|
|
|
|
+ } catch (DuplicateKeyException e) {
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|