Bläddra i källkod

大学生快递站

zoujiajian 2 år sedan
förälder
incheckning
e103e4da37
22 ändrade filer med 348 tillägg och 6 borttagningar
  1. 5 0
      netflix-common/src/main/java/com/cyksj/common/constant/Constant.java
  2. 2 0
      netflix-dao/src/main/java/com/cyksj/mapper/GroupsMapper.java
  3. 2 0
      netflix-dao/src/main/java/com/cyksj/mapper/GroupsRelationMapper.java
  4. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/station/CollegeStudentStationClickRecordMapper.java
  5. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/station/CollegeStudentStationUseTicketRecordMapper.java
  6. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/station/CollegeStudentStationUserRelateMapper.java
  7. 6 0
      netflix-dao/src/main/java/com/cyksj/model/dto/AuthRedirect.java
  8. 19 0
      netflix-dao/src/main/java/com/cyksj/model/entity/CollegeStudentStationClickRecord.java
  9. 20 0
      netflix-dao/src/main/java/com/cyksj/model/entity/CollegeStudentStationUseTicketRecord.java
  10. 21 0
      netflix-dao/src/main/java/com/cyksj/model/entity/CollegeStudentStationUserRelate.java
  11. 7 0
      netflix-dao/src/main/resources/mapper/GroupRelationMapper.xml
  12. 9 0
      netflix-dao/src/main/resources/mapper/GroupsMapper.xml
  13. 6 0
      netflix-service/pom.xml
  14. 15 0
      netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAccountServiceImpl.java
  15. 2 0
      netflix-service/src/main/java/com/cyksj/service/relation/GroupRelationFrontService.java
  16. 51 0
      netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java
  17. 13 0
      netflix-service/src/main/java/com/cyksj/service/station/CollegeStudentStationFService.java
  18. 37 0
      netflix-service/src/main/java/com/cyksj/service/station/impl/CollegeStudentStationFServiceImpl.java
  19. 2 1
      netflix-service/src/main/java/com/cyksj/service/user/UserService.java
  20. 40 2
      netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java
  21. 4 3
      netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java
  22. 48 0
      netflix-web/src/main/java/com/cyksj/web/controller/user/CollegeStudentStationController.java

+ 5 - 0
netflix-common/src/main/java/com/cyksj/common/constant/Constant.java

@@ -317,4 +317,9 @@ public interface Constant {
 	 * 设备意向标签组
 	 */
 	String EP_INTENTION_GROUP_NAME= "设备群发标签";
+
+	/**
+	 * 大学生快递站 体验车票规格
+	 */
+	Long GPT_MIRROR_SKU_ID = 429l;
 }

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/mapper/GroupsMapper.java

@@ -41,4 +41,6 @@ public interface GroupsMapper extends BaseMapper<GroupsTrips> {
 	Integer countExpiredNum(Long accountId);
 
 	GroupsTrips selectTicketGroups(@Param("skuId") Long skuId, @Param("status") GroupsTrips.Status status, @Param("maxNum") Integer maxNum, @Param("ip") String ip);
+
+	GroupsTrips selectCollegeStudentUserGptTicket(Long skuId);
 }

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/mapper/GroupsRelationMapper.java

@@ -70,4 +70,6 @@ public interface GroupsRelationMapper extends BaseMapper<GroupsRelation> {
 	PhoneCode getAreaPhoneByUserId(Long userId);
 
 	List<RenewalView> getUserHasPayGoods(@Param("list") List<Long> userIds, @Param("now") DateTime now);
+
+	Long getExperienceTicket(@Param("userId") Long userId, @Param("skuId") Long skuId);
 }

+ 13 - 0
netflix-dao/src/main/java/com/cyksj/mapper/station/CollegeStudentStationClickRecordMapper.java

@@ -0,0 +1,13 @@
+package com.cyksj.mapper.station;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.CollegeStudentStationClickRecord;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: CollegeStudentStationClickRecordMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/5/28 11:55
+ */
+public interface CollegeStudentStationClickRecordMapper extends BaseMapper<CollegeStudentStationClickRecord> {
+}

+ 13 - 0
netflix-dao/src/main/java/com/cyksj/mapper/station/CollegeStudentStationUseTicketRecordMapper.java

@@ -0,0 +1,13 @@
+package com.cyksj.mapper.station;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.CollegeStudentStationUseTicketRecord;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: CollegeStudentStationUseTicketRecordMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/5/29 13:50
+ */
+public interface CollegeStudentStationUseTicketRecordMapper extends BaseMapper<CollegeStudentStationUseTicketRecord> {
+}

+ 13 - 0
netflix-dao/src/main/java/com/cyksj/mapper/station/CollegeStudentStationUserRelateMapper.java

@@ -0,0 +1,13 @@
+package com.cyksj.mapper.station;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.CollegeStudentStationUserRelate;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: CollegeStudentStationUserRelateMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/5/28 11:57
+ */
+public interface CollegeStudentStationUserRelateMapper extends BaseMapper<CollegeStudentStationUserRelate> {
+}

+ 6 - 0
netflix-dao/src/main/java/com/cyksj/model/dto/AuthRedirect.java

@@ -77,4 +77,10 @@ public class AuthRedirect {
      * 跳转url
      */
     private String url;
+
+    /**
+     * 大学生快递站 进入类型
+     * 1.主动 2.被邀请用户
+     */
+    private Integer cst;
 }

+ 19 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/CollegeStudentStationClickRecord.java

@@ -0,0 +1,19 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: CollegeStudentStattionClickRecord
+ * 创建者: JavaZou
+ * 创建时间:2024/5/28 11:55
+ */
+@Getter
+@Setter
+public class CollegeStudentStationClickRecord extends BaseEntity {
+
+	private Long userId;
+
+	private Integer type;
+}

+ 20 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/CollegeStudentStationUseTicketRecord.java

@@ -0,0 +1,20 @@
+package com.cyksj.model.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: CollegeStudentStationUseTicketRecord
+ * 创建者: JavaZou
+ * 创建时间:2024/5/29 12:10
+ */
+@Getter
+@Setter
+public class CollegeStudentStationUseTicketRecord extends BaseEntity{
+	private Long userId;
+
+	@TableField(value = "userToken")
+	private String userToken;
+}

+ 21 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/CollegeStudentStationUserRelate.java

@@ -0,0 +1,21 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: CollegeStudentStationUserRelate
+ * 创建者: JavaZou
+ * 创建时间:2024/5/28 11:56
+ */
+@Getter
+@Setter
+public class CollegeStudentStationUserRelate extends BaseEntity{
+	private Long userId;
+
+	/**
+	 * 1.主动 2.被邀请用户
+	 */
+	private Integer type;
+}

+ 7 - 0
netflix-dao/src/main/resources/mapper/GroupRelationMapper.xml

@@ -340,4 +340,11 @@
         group by g.id,g.title,g.logo
         order by goods_id
     </select>
+
+    <select id="getExperienceTicket" resultType="java.lang.Long">
+        select gr.id
+        from (select id, groups_id from groups_relation where user_id = #{userId}) gr
+                 inner join groups_trips gt on gt.id = gr.groups_id
+        where gt.sku_id = #{skuId} limit 1
+    </select>
 </mapper>

+ 9 - 0
netflix-dao/src/main/resources/mapper/GroupsMapper.xml

@@ -98,4 +98,13 @@
         order by available_num asc
         limit 1
     </select>
+
+    <select id="selectCollegeStudentUserGptTicket" resultType="com.cyksj.model.entity.GroupsTrips">
+        select gt.id
+        from `groups_trips` gt
+        where gt.sku_id = #{skuId}
+          and gt.status = 'validity'
+          and gt.available_num > 0
+        order by rand() limit 1
+    </select>
 </mapper>

+ 6 - 0
netflix-service/pom.xml

@@ -40,6 +40,12 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>com.github.rholder</groupId>
+            <artifactId>guava-retrying</artifactId>
+            <version>2.0.0</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 15 - 0
netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAccountServiceImpl.java

@@ -1,6 +1,7 @@
 package com.cyksj.service.chatgpt.impl;
 
 import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.lang.UUID;
 import cn.hutool.http.HttpRequest;
@@ -15,6 +16,7 @@ import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.common.util.StringUtil;
 import com.cyksj.mapper.*;
+import com.cyksj.mapper.station.CollegeStudentStationUseTicketRecordMapper;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.request.gpt.ConversationRequest;
 import com.cyksj.model.response.ConversationLimitResponse;
@@ -95,6 +97,8 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
 
     private final ChatgptUserCarUsedRecordMapper chatgptUserCarUsedRecordMapper;
 
+    private final CollegeStudentStationUseTicketRecordMapper collegeStudentStationUseTicketRecordMapper;
+
     @Override
     public String addAccount(Account account) {
         if (isAccountExists(account)) {
@@ -355,6 +359,17 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
             chatgptUser.setRelationId(groupsRelation.getId());
             chatgptUser.setUserToken(UUID.randomUUID().toString());
             chatgptUserMapper.insert(chatgptUser);
+
+            //是否是大学生限时车队
+            Date expiryTime = groupsRelation.getExpiryTime();
+            Date startTime = groupsRelation.getStartTime();
+            //大学生站 1天免费试用
+            if (DateUtil.between(startTime, expiryTime, DateUnit.DAY) <= 1) {
+                CollegeStudentStationUseTicketRecord useTicketRecord = new CollegeStudentStationUseTicketRecord();
+                useTicketRecord.setUserId(user.getId());
+                useTicketRecord.setUserToken(chatgptUser.getUserToken());
+                collegeStudentStationUseTicketRecordMapper.insert(useTicketRecord);
+            }
         } catch (DuplicateKeyException e) {
             log.error("重复插入镜像用户:{}token,errmsg:{}", user.getNickname(), StringUtil.getErrorText(e));
         }

+ 2 - 0
netflix-service/src/main/java/com/cyksj/service/relation/GroupRelationFrontService.java

@@ -55,4 +55,6 @@ public interface GroupRelationFrontService {
 	List<RenewalView>  getHasPayGoods(long userId);
 
 	List<RenewalView> getExpiryRenewalNotify(Long userId);
+
+	void getCollegeStudentUserGptTicket(Long userId);
 }

+ 51 - 0
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -39,6 +39,7 @@ import com.ejlchina.searcher.SearchResult;
 import com.ejlchina.searcher.param.Operator;
 import com.ejlchina.searcher.util.MapBuilder;
 import com.ejlchina.searcher.util.MapUtils;
+import com.github.rholder.retry.*;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -48,6 +49,8 @@ import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.*;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
@@ -730,4 +733,52 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		}
 		return code.trim();
 	}
+
+
+	@Override
+	public void getCollegeStudentUserGptTicket(Long userId) {
+		Retryer<Boolean> build = RetryerBuilder.<Boolean>newBuilder()
+				.retryIfException()
+				//运行时异常重试
+				.retryIfRuntimeException()
+				//false重试
+				.retryIfResult(res -> Objects.equals(res, false))
+				//1s 间隔
+				.withWaitStrategy(WaitStrategies.fixedWait(1, TimeUnit.SECONDS))
+				//停止策略 : 尝试请求3次
+				.withStopStrategy(StopStrategies.stopAfterAttempt(3)).build();
+		try {
+			build.call(() -> {
+				//体验规格
+				Long gptMirrorSkuId = Constant.GPT_MIRROR_SKU_ID;
+				GroupsTrips groups = groupsMapper.selectCollegeStudentUserGptTicket(gptMirrorSkuId);
+				GroupsRelation relation = null;
+				if (groups != null) {
+					relation = groupsRelationMapper.selectRandomOneRelationByGroupsId(groups.getId());
+				}
+				if (relation == null) {
+					//生成空车队
+					GoodsDonSku sku = goodsDonSkuMapper.selectById(gptMirrorSkuId);
+					relation = groupsFuncService.createNewGroupsTrips(sku);
+				}
+				DateTime startTime = DateTime.now();
+				DateTime expiryTime = DateUtil.offsetDay(startTime, 1);
+				int update = groupsRelationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
+						.set(GroupsRelation::getUserId, userId)
+						.set(GroupsRelation::getStartTime, startTime)
+						.set(GroupsRelation::getExpiryTime, expiryTime)
+						.set(GroupsRelation::getStatus, GroupsRelation.Status.validity)
+						.eq(GroupsRelation::getId, relation.getId())
+						.eq(GroupsRelation::getUserId, 0));
+				if (update > 0) {
+					groupsMapper.decrAvailableNum(groups.getId());
+					return true;
+				}
+				log.error("发送用户:{} GPT镜像车票体验失败,进行重试", userId);
+				return false;
+			});
+		} catch (ExecutionException | RetryException e) {
+			log.error("发送用户GPT镜像体验失败:{}", StringUtil.getErrorText(e));
+		}
+	}
 }

+ 13 - 0
netflix-service/src/main/java/com/cyksj/service/station/CollegeStudentStationFService.java

@@ -0,0 +1,13 @@
+package com.cyksj.service.station;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: CollegeStudentStationFService
+ * 创建者: JavaZou
+ * 创建时间:2024/5/28 11:59
+ */
+public interface CollegeStudentStationFService {
+	void saveCollegeStudent(long userId, Integer type);
+
+	Long getExperienceTicket(Long userId);
+}

+ 37 - 0
netflix-service/src/main/java/com/cyksj/service/station/impl/CollegeStudentStationFServiceImpl.java

@@ -0,0 +1,37 @@
+package com.cyksj.service.station.impl;
+
+import com.cyksj.common.constant.Constant;
+import com.cyksj.mapper.GroupsRelationMapper;
+import com.cyksj.mapper.station.CollegeStudentStationClickRecordMapper;
+import com.cyksj.model.entity.CollegeStudentStationClickRecord;
+import com.cyksj.service.station.CollegeStudentStationFService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: CollegeStudentStationFServiceImpl
+ * 创建者: JavaZou
+ * 创建时间:2024/5/28 11:59
+ */
+@Service
+@RequiredArgsConstructor
+public class CollegeStudentStationFServiceImpl implements CollegeStudentStationFService {
+	private final CollegeStudentStationClickRecordMapper collegeStudentStationClickRecordMapper;
+
+	private final GroupsRelationMapper groupsRelationMapper;
+
+	@Override
+	public void saveCollegeStudent(long userId, Integer type) {
+		CollegeStudentStationClickRecord collegeStudentStationClickRecord = new CollegeStudentStationClickRecord();
+		collegeStudentStationClickRecord.setUserId(userId);
+		collegeStudentStationClickRecord.setType(type);
+		collegeStudentStationClickRecordMapper.insert(collegeStudentStationClickRecord);
+	}
+
+	@Override
+	public Long getExperienceTicket(Long userId) {
+		Long relationId = groupsRelationMapper.getExperienceTicket(userId, Constant.GPT_MIRROR_SKU_ID);
+		return relationId;
+	}
+}

+ 2 - 1
netflix-service/src/main/java/com/cyksj/service/user/UserService.java

@@ -2,6 +2,7 @@ package com.cyksj.service.user;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.cyksj.dto.UserSharedDto;
+import com.cyksj.model.dto.AuthRedirect;
 import com.cyksj.model.dto.GzhOAuth2UserInfo;
 import com.cyksj.model.dto.UserWhoami;
 import com.cyksj.model.entity.User;
@@ -17,7 +18,7 @@ import java.util.List;
  */
 public interface UserService extends IService<User> {
 
-	User saveAuth(GzhOAuth2UserInfo userinfo, Long sharedId, Integer dsType, Long pid, User.RegisterEnv registerEnv, String dsCode, String callback, String callbackType, String customId) throws Exception;
+	User saveAuth(GzhOAuth2UserInfo userinfo, AuthRedirect re, User.RegisterEnv registerEnv) throws Exception;
 
     UserWhoami whoami(long userId);
 

+ 40 - 2
netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java

@@ -23,6 +23,7 @@ import com.cyksj.mapper.corp.*;
 import com.cyksj.mapper.manage.cps.UserDistributePopularizeMapper;
 import com.cyksj.mapper.manage.distribute.UserDistributeSharedMapper;
 import com.cyksj.mapper.market.task.UserBindDetailMapper;
+import com.cyksj.mapper.station.CollegeStudentStationUserRelateMapper;
 import com.cyksj.model.dto.*;
 import com.cyksj.model.entity.*;
 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.mange.coupon.CouponCommonService;
 import com.cyksj.service.market.task.BindTaskService;
+import com.cyksj.service.relation.GroupRelationFrontService;
 import com.cyksj.service.shop.YhShopDistributeService;
 import com.cyksj.service.sys.SysConfigService;
 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 BadIntentionOpService badIntentionOpService;
+
+	private final CollegeStudentStationUserRelateMapper collegeStudentStationUserRelateMapper;
+
+	private final GroupRelationFrontService groupRelationFrontService;
+
 	private static final GlobalThreadPoolTaskExecutor TASK_POOL = GlobalThreadPoolTaskExecutor.getInstance();
 
 	@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();
 		if (StrUtil.isEmpty(unionid)) {
 			throw BusinessRuntimeException.getInstance("授权操作异常,请刷新页面");
@@ -206,6 +221,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 		}
 		//每日活跃记录
 		userLoginRecordService.saveUserLoginDayRecord(user.getId());
+		//是否是大学生快递站进来的用户
+		Integer cst = re.getCst();
+		if (cst != null) {
+			TASK_POOL.execute(() -> {
+				handlerCollegeStudentUser(userId, cst);
+			});
+		}
 		return user;
 	}
 
@@ -519,7 +541,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 		String json = Codec.DoBase64.custom().setData(state).decodeAsText();
 		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) {
 			throw BusinessRuntimeException.getInstance("系统错误,请重新授权");
 		}
@@ -765,4 +787,20 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 		log.info("建立用户userId:{}与sharedId:{}绑定关系", userId, sharedId);
 		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) {
+		}
+	}
 }

+ 4 - 3
netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java

@@ -93,7 +93,7 @@ public class AuthorizationController {
     private final TemplateCommonService templateCommonService;
 
     @GetMapping(value = "/weChat")
-    public void base(String url, String dsCode, Long sharedId, Integer dsType, Long popularizeId, String authType, String callbackType, String callback, String customId, HttpServletResponse response) throws Exception {
+    public void base(String url, String dsCode, Long sharedId, Integer dsType, Long popularizeId, String authType, String callbackType, String callback, String customId, Integer cst, HttpServletResponse response) throws Exception {
 
         log.info("微信授权转跳. url: {},authType:{}", url, authType);
 
@@ -109,7 +109,8 @@ public class AuthorizationController {
         AuthRedirect redirect = new AuthRedirect().setMappingId(mappingId).setSharedId(sharedId).setDsType(dsType).setPid(popularizeId).setDsCode(dsCode)
                 .setCd(customId)
                 .setCk(callback)
-                .setCt(callbackType);
+                .setCt(callbackType)
+                .setCst(cst);
         String state = Codec.DoBase64.custom().setData(Jsons.toJson(redirect)).encodeAsText();
 
         response.sendRedirect(authorizationService.createUrl(state, authType));
@@ -463,7 +464,7 @@ public class AuthorizationController {
         GzhOAuth2UserInfo userinfo = weChatService.getUserInfo(token.getAccessToken(), token.getOpenid());
 
         //保存用户信息
-        User user = userService.saveAuth(userinfo, re.getSharedId(), re.getDsType(), re.getPid(), registerEnv, re.getDsCode(), re.getCk(), re.getCt(), re.getCd());
+        User user = userService.saveAuth(userinfo, re, registerEnv);
         if (user == null) {
             throw BusinessRuntimeException.getInstance("系统错误,请重新授权");
         }

+ 48 - 0
netflix-web/src/main/java/com/cyksj/web/controller/user/CollegeStudentStationController.java

@@ -0,0 +1,48 @@
+package com.cyksj.web.controller.user;
+
+import com.cyksj.dto.Result;
+import com.cyksj.enums.GatewayResponse;
+import com.cyksj.service.station.CollegeStudentStationFService;
+import com.cyksj.web.util.StpUserUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: CollegeStudentStationController
+ * 创建者: JavaZou
+ * 创建时间:2024/5/28 11:50
+ */
+@Slf4j
+@RestController
+@RequestMapping("/applet/college/student")
+@RequiredArgsConstructor
+public class CollegeStudentStationController {
+	private final CollegeStudentStationFService collegeStudentStationService;
+
+
+	/**
+	 * 大学生 扫码记录
+	 */
+	@PostMapping("/post")
+	public Result<String> saveCollegeStudent(Integer type) {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		collegeStudentStationService.saveCollegeStudent(userId, type);
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
+
+	/**
+	 * 体验车票id
+	 */
+	@GetMapping("/get")
+	public Result<Long> getExperienceTicket() {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		Long relationId = collegeStudentStationService.getExperienceTicket(userId);
+		return GatewayResponse.SUCCESS.newBuilder().toResult(relationId);
+	}
+}