Просмотр исходного кода

学生认证赠送api额度;adobe验证码

zoujiajian 1 месяц назад
Родитель
Сommit
9e942e6dc1

+ 2 - 0
netflix-common/src/main/java/com/cyksj/dto/RedisKey.java

@@ -76,4 +76,6 @@ public class RedisKey {
     public static String GOODS_SUBSCRIBE_ALERT_KEY = "goods_subscribe_alert_key:";
 
     public static String GPT_API_QUOTA_KEY = "gpt_pay";
+
+    public static String STUDENT_CERT_GPT_API_QUOTA_KEY = "student_cert_gpt_pay";
 }

+ 11 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/UserActivity.java

@@ -50,6 +50,17 @@ public class UserActivity extends BaseEntity {
 	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private String couponIds;
 
+	/**
+	 * 是否发放API站额度券
+	 */
+	private Boolean apiQuotaCouponEnabled;
+
+	/**
+	 * API站额度券额度
+	 */
+	@TableField(updateStrategy = FieldStrategy.IGNORED)
+	private Integer apiQuotaCouponQuota;
+
 	/**
 	 * 图片
 	 */

+ 13 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/UserStudentCertRecord.java

@@ -1,5 +1,6 @@
 package com.cyksj.model.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -15,4 +16,16 @@ public class UserStudentCertRecord extends BaseEntity{
 	private Long userId;
 
 	private String school;
+
+	@TableField(exist = false)
+	private Long apiQuotaRecordId;
+
+	@TableField(exist = false)
+	private Long apiQuotaRelationId;
+
+	@TableField(exist = false)
+	private String apiQuotaRedeemCode;
+
+	@TableField(exist = false)
+	private Integer apiQuota;
 }

+ 11 - 7
netflix-dao/src/main/java/com/cyksj/model/response/AdobeEmailResp.java

@@ -1,5 +1,6 @@
 package com.cyksj.model.response;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -12,15 +13,18 @@ import lombok.Setter;
 @Getter
 @Setter
 public class AdobeEmailResp {
-	private Long id;
+    @JsonProperty("From")
+	private String From;
 
-	private String message_id;
+    @JsonProperty("Date")
+    private String Date;
 
-	private String source;
+    @JsonProperty("Subject")
+    private String Subject;
 
-	private String address;
+    @JsonProperty("To")
+    private String To;
 
-	private String raw;
-
-	private String created_at;
+    @JsonProperty("Body")
+    private String Body;
 }

+ 12 - 0
netflix-dao/src/main/java/com/cyksj/model/views/UserActivityView.java

@@ -50,6 +50,18 @@ public class UserActivityView {
 	@DbField("ua.coupon_ids")
 	private String couponIds;
 
+	/**
+	 * 是否发放API站额度券
+	 */
+	@DbField("ua.api_quota_coupon_enabled")
+	private Boolean apiQuotaCouponEnabled;
+
+	/**
+	 * API站额度券额度
+	 */
+	@DbField("ua.api_quota_coupon_quota")
+	private Integer apiQuotaCouponQuota;
+
 	@DbField("ua.img")
 	private String img;
 

+ 12 - 0
netflix-dao/src/main/java/com/cyksj/model/views/UserBenefitsFrontView.java

@@ -125,6 +125,18 @@ public class UserBenefitsFrontView {
 	@DbIgnore
 	private List<CouponView> couponViews;
 
+	/**
+	 * 是否发放API站额度券
+	 */
+	@DbIgnore
+	private Boolean apiQuotaCouponEnabled;
+
+	/**
+	 * API站额度券额度
+	 */
+	@DbIgnore
+	private Integer apiQuotaCouponQuota;
+
 	@DbIgnore
 	private String goodsSpecJson;
 }

+ 9 - 7
netflix-service/src/main/java/com/cyksj/service/mail/impl/CommonMailServiceImpl.java

@@ -84,18 +84,20 @@ public class CommonMailServiceImpl implements CommonMailService {
 		//Adobe 获取验证码
 		if (goodsId == Constant.ADOBE_GOODS_ID) {
 			try {
-				String url = "https://xinapi.adbacc.top/admin/mails?limit=20&offset=0&email=" + account;
-				HttpRequest post = HttpUtil.createGet(url).header("x-admin-auth", "xin456");
+                String url = String.format("http://www.yxiang6.com/api/GetLastEmails?email=%s&boxType=1&num=2", account);
+                HttpRequest post = HttpUtil.createGet(url).header("x-admin-auth", "xin456");
 				HttpResponse execute = post.execute();
 				JSONObject resp = Jsons.parseObject(execute.body(), JSONObject.class);
-				List<AdobeEmailResp> AdobeEmailResps = Jsons.parseList(resp.getObj("results"), AdobeEmailResp.class);
+				List<AdobeEmailResp> AdobeEmailResps = Jsons.parseList(resp.getObj("data"), AdobeEmailResp.class);
 				if (CollUtil.isNotEmpty(AdobeEmailResps)) {
 					for (AdobeEmailResp adobeEmailResp : AdobeEmailResps) {
 						String str = "Your verification code is";
-						if (StrUtil.equals(adobeEmailResp.getAddress(), account) && StrUtil.isNotBlank(adobeEmailResp.getRaw()) && adobeEmailResp.getRaw().contains(str)) {
-							String code = StrUtil.subAfter(adobeEmailResp.getRaw(), str, false);
-							return StringUtil.getVerifyCodePattern(code, 6);
-						}
+                        String body = adobeEmailResp.getBody();
+                        if (adobeEmailResp.getTo().contains(account) && StrUtil.isNotBlank(body) && body.contains(str)) {
+                            String code = StrUtil.subAfter(body, str, false);
+                            code = code.replaceAll("<[^>]*>", " ");
+                            return StringUtil.getVerifyCodePattern(code, 6);
+                        }
 					}
 				}
 			} catch (Exception e) {

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

@@ -140,4 +140,6 @@ public interface GroupRelationFrontService {
     String getEmailCode(long userId, Long relationId) throws Exception;
 
 	ReceiveGptActivityTicketResp receiveGptActivityTicket(long userId, Long relationId) throws Exception;
+
+	ReceiveGptActivityTicketResp receiveStudentCertGptApiQuotaTicket(long userId, Integer quota) throws Exception;
 }

+ 97 - 6
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -244,6 +244,12 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 
 	private static final Date GPT_ACTIVITY_PAY_TIME_BEGIN = DateUtil.parse("2026-05-01 00:00:00");
 
+	private static final String GPT_ACTIVITY_REDEEM_NAME = "GPT代充/独立赠送";
+
+	private static final String STUDENT_CERT_API_QUOTA_REDEEM_NAME = "大学生认证API站额度券";
+
+	private static final Integer DEFAULT_API_QUOTA = 2500000;
+
 	@Override
 	public SearchResult<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId, String account, String orderNo, Integer cmt) {
 		User u = userMapper.selectById(userId);
@@ -2809,7 +2815,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
             record.setSourceGoodsId(sourceGoodsId);
 			record.setSkuId(Constant.GPT_ACTIVITY_GIFT_SKU_ID);
 			record.setSourceType(RedisKey.GPT_API_QUOTA_KEY);
-			record.setRedeemName("GPT代充/独立赠送");
+			record.setRedeemName(GPT_ACTIVITY_REDEEM_NAME);
 			record.setStatus("processing");
 			record.setRelationExpiryTime(sourceRelation.getExpiryTime());
 			ticketRedemptionCodeRecordMapper.insert(record);
@@ -2828,7 +2834,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 						throw BusinessRuntimeException.getInstance("系统繁忙,请重新领取");
 					}
 				}
-				GptActivityRedeemResult redeemResult = requestGptActivityRedeemCode(Constant.AI_API_SVC_DOMAIN, giftRelation, giftSku);
+				GptActivityRedeemResult redeemResult = requestGptActivityRedeemCode(Constant.AI_API_SVC_DOMAIN, GPT_ACTIVITY_REDEEM_NAME, DEFAULT_API_QUOTA);
 				record.setRelationId(giftRelation.getId());
 				record.setGoodsId(giftSku.getGoodsId());
                 record.setSourceGoodsId(sourceGoodsId);
@@ -2862,6 +2868,89 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		}
 	}
 
+	@Override
+	public ReceiveGptActivityTicketResp receiveStudentCertGptApiQuotaTicket(long userId, Integer quota) throws Exception {
+		List<Long> userIds = userBindRelationService.getRelationUserIdList(userId, null);
+		if (CollUtil.isEmpty(userIds)) {
+			userIds = List.of(userId);
+		}
+		quota = resolveApiQuota(quota);
+		String lockKey = String.format("%s:%s", RedisKey.STUDENT_CERT_GPT_API_QUOTA_KEY, Collections.min(userIds));
+		if (!redisService.setNx(lockKey, userId, 60L)) {
+			throw BusinessRuntimeException.getInstance("领取中,请稍后再试");
+		}
+		try {
+			TicketRedemptionCodeRecord existRecord = ticketRedemptionCodeRecordMapper.selectOne(Wrappers.lambdaQuery(TicketRedemptionCodeRecord.class)
+					.in(TicketRedemptionCodeRecord::getUserId, userIds)
+					.eq(TicketRedemptionCodeRecord::getSkuId, Constant.GPT_ACTIVITY_GIFT_SKU_ID)
+					.eq(TicketRedemptionCodeRecord::getSourceType, RedisKey.STUDENT_CERT_GPT_API_QUOTA_KEY)
+					.eq(TicketRedemptionCodeRecord::getStatus, "success")
+					.orderByDesc(TicketRedemptionCodeRecord::getId)
+					.last("limit 1"));
+			if (existRecord != null) {
+				ReceiveGptActivityTicketResp resp = new ReceiveGptActivityTicketResp();
+				resp.setRelationId(existRecord.getRelationId());
+				resp.setRedeemCode(existRecord.getRedeemCode());
+				return resp;
+			}
+
+			TicketRedemptionCodeRecord record = new TicketRedemptionCodeRecord();
+			record.setUserId(userId);
+			record.setSkuId(Constant.GPT_ACTIVITY_GIFT_SKU_ID);
+			record.setSourceType(RedisKey.STUDENT_CERT_GPT_API_QUOTA_KEY);
+			record.setRedeemName(STUDENT_CERT_API_QUOTA_REDEEM_NAME);
+			record.setStatus("processing");
+			ticketRedemptionCodeRecordMapper.insert(record);
+
+			GoodsDonSku giftSku = goodsDonSkuMapper.selectById(Constant.GPT_ACTIVITY_GIFT_SKU_ID);
+			GroupsRelation giftRelation = null;
+			try {
+				if (giftSku == null) {
+					throw BusinessRuntimeException.getInstance("系统繁忙,请重新领取");
+				}
+				Long giftRelationId = getTicket(userId, giftSku.getId(), Boolean.FALSE);
+				if (giftRelationId == null) {
+					throw BusinessRuntimeException.getInstance("系统繁忙,请重新领取");
+				}
+				giftRelation = groupsRelationMapper.selectById(giftRelationId);
+				if (giftRelation == null) {
+					throw BusinessRuntimeException.getInstance("系统繁忙,请重新领取");
+				}
+
+				GptActivityRedeemResult redeemResult = requestGptActivityRedeemCode(Constant.AI_API_SVC_DOMAIN, STUDENT_CERT_API_QUOTA_REDEEM_NAME, quota);
+				record.setRelationId(giftRelation.getId());
+				record.setGoodsId(giftSku.getGoodsId());
+				record.setRedeemCode(redeemResult.getRedeemCode());
+				record.setQuota(redeemResult.getQuota());
+				record.setRedeemCount(0);
+				record.setExpiredTime(redeemResult.getExpiredTime());
+				record.setStatus("success");
+				record.setRelationExpiryTime(giftRelation.getExpiryTime());
+				record.setApiResponse(redeemResult.getApiResponse());
+				ticketRedemptionCodeRecordMapper.updateById(record);
+
+				ReceiveGptActivityTicketResp resp = new ReceiveGptActivityTicketResp();
+				resp.setRelationId(giftRelation.getId());
+				resp.setRedeemCode(redeemResult.getRedeemCode());
+				return resp;
+			} catch (Exception e) {
+				if (giftSku != null) {
+					record.setGoodsId(giftSku.getGoodsId());
+				}
+				record.setStatus("error");
+				record.setErrorMsg(StringUtil.getErrorText(e));
+				if (giftRelation != null) {
+					record.setRelationId(giftRelation.getId());
+					record.setRelationExpiryTime(giftRelation.getExpiryTime());
+				}
+				ticketRedemptionCodeRecordMapper.updateById(record);
+				throw e;
+			}
+		} finally {
+			redisService.del(lockKey);
+		}
+	}
+
     private boolean isGptApiQuotaSourceTicket(OrderDon orderDon, Long goodsId, Integer skuNum) {
         if (orderDon == null) {
             return false;
@@ -2885,11 +2974,13 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
         }
         return null;
     }
-	private GptActivityRedeemResult requestGptActivityRedeemCode(String apiDomain, GroupsRelation giftRelation, GoodsDonSku giftSku) throws Exception {
-        //默认5刀额度
-        Integer quota = 2500000;
+	private Integer resolveApiQuota(Integer quota) {
+		return quota == null || quota <= 0 ? DEFAULT_API_QUOTA : quota;
+	}
+
+	private GptActivityRedeemResult requestGptActivityRedeemCode(String apiDomain, String redeemName, Integer quota) throws Exception {
 		Map<String, Object> params = new HashMap<>();
-		params.put("name", "GPT代充/独立赠送");
+		params.put("name", redeemName);
 		params.put("count", 1);
 		params.put("quota", quota);
 		String apiUrl = StrUtil.removeSuffix(apiDomain, "/") + "/api/redemption/";

+ 17 - 0
netflix-service/src/main/java/com/cyksj/service/user/impl/UserActivityServiceImpl.java

@@ -10,7 +10,9 @@ import com.cyksj.mapper.UserActivityRankRobotMapper;
 import com.cyksj.mapper.UserMapper;
 import com.cyksj.mapper.UserStudentCertRecordMapper;
 import com.cyksj.model.entity.*;
+import com.cyksj.model.response.ReceiveGptActivityTicketResp;
 import com.cyksj.service.mange.coupon.CouponCommonService;
+import com.cyksj.service.relation.GroupRelationFrontService;
 import com.cyksj.service.user.UserActivityService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -37,6 +39,8 @@ public class UserActivityServiceImpl extends ServiceImpl<UserActivityMapper, Use
 	private final UserStudentCertRecordMapper userStudentCertRecordMapper;
 
 	private final UserActivityRankRobotMapper UserActivityRankRobotMapper;
+
+	private final GroupRelationFrontService groupRelationFrontService;
 	@Override
 	public void sendStudentCertActivity(User user, String dsCode, String school) throws Exception {
 		UserActivity activity = getById(1);
@@ -56,11 +60,24 @@ public class UserActivityServiceImpl extends ServiceImpl<UserActivityMapper, Use
 				couponCommonService.sendCouponToUser(sendUserId, couponId, 0l, 0l, 0l, CouponUser.Channel.student_cert);
 			}
 		}
+		ReceiveGptActivityTicketResp apiQuotaTicketResp = null;
+		if (Boolean.TRUE.equals(activity.getApiQuotaCouponEnabled())) {
+			try {
+				apiQuotaTicketResp = groupRelationFrontService.receiveStudentCertGptApiQuotaTicket(sendUserId, activity.getApiQuotaCouponQuota());
+				log.info("uid:{}大学生认证成功,发放API站额度券:{}", sendUserId, apiQuotaTicketResp.getRedeemCode());
+			} catch (Exception e) {
+				log.error("uid:{}大学生认证发放API站额度券失败", sendUserId, e);
+			}
+		}
 		try {
 			UserStudentCertRecord record = new UserStudentCertRecord();
 			//记录发送用户
 			record.setUserId(sendUserId);
 			record.setSchool(school);
+			if (apiQuotaTicketResp != null) {
+				record.setApiQuotaRelationId(apiQuotaTicketResp.getRelationId());
+				record.setApiQuotaRedeemCode(apiQuotaTicketResp.getRedeemCode());
+			}
 			userStudentCertRecordMapper.insert(record);
 		} catch (DuplicateKeyException e) {
 		}

+ 19 - 0
netflix-service/src/main/java/com/cyksj/service/user/impl/UserIdentCertServiceImpl.java

@@ -4,13 +4,17 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.EnvCommonService;
+import com.cyksj.common.constant.Constant;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.snowflake.Sequence;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.StringUtil;
+import com.cyksj.dto.RedisKey;
+import com.cyksj.mapper.TicketRedemptionCodeRecordMapper;
 import com.cyksj.mapper.UserCertRecordMapper;
 import com.cyksj.mapper.UserMapper;
 import com.cyksj.mapper.UserStudentCertRecordMapper;
+import com.cyksj.model.entity.TicketRedemptionCodeRecord;
 import com.cyksj.model.dto.UserWxIndentDto;
 import com.cyksj.model.entity.User;
 import com.cyksj.model.entity.UserCertRecord;
@@ -47,6 +51,8 @@ public class UserIdentCertServiceImpl implements UserIdentCertService {
 
 	private final UserStudentCertRecordMapper userStudentCertRecordMapper;
 
+	private final TicketRedemptionCodeRecordMapper ticketRedemptionCodeRecordMapper;
+
 	private final UserMapper userMapper;
 
 	private final RedisService redisService;
@@ -107,6 +113,19 @@ public class UserIdentCertServiceImpl implements UserIdentCertService {
 		if (record == null) {
 			return null;
 		}
+		TicketRedemptionCodeRecord apiQuotaRecord = ticketRedemptionCodeRecordMapper.selectOne(Wrappers.lambdaQuery(TicketRedemptionCodeRecord.class)
+				.in(TicketRedemptionCodeRecord::getUserId, userIdList)
+				.eq(TicketRedemptionCodeRecord::getSkuId, Constant.GPT_ACTIVITY_GIFT_SKU_ID)
+				.eq(TicketRedemptionCodeRecord::getSourceType, RedisKey.STUDENT_CERT_GPT_API_QUOTA_KEY)
+				.eq(TicketRedemptionCodeRecord::getStatus, "success")
+				.orderByDesc(TicketRedemptionCodeRecord::getId)
+				.last("limit 1"));
+		if (apiQuotaRecord != null) {
+			record.setApiQuotaRecordId(apiQuotaRecord.getId());
+			record.setApiQuotaRelationId(apiQuotaRecord.getRelationId());
+			record.setApiQuotaRedeemCode(apiQuotaRecord.getRedeemCode());
+			record.setApiQuota(apiQuotaRecord.getQuota());
+		}
 		return record;
 	}
 

+ 42 - 36
netflix-web/src/main/java/com/cyksj/web/controller/user/UserBenefitsFrontController.java

@@ -175,45 +175,51 @@ public class UserBenefitsFrontController {
 							.eq(UserActivity::getType, 0)
 							.eq(UserActivity::getDeleted, 1)
 							.last("limit 1"));
-					String couponIdsStr = userActivity.getCouponIds();
-					List<Long> couponIds = Jsons.parseList(couponIdsStr, Long.class);
-					//优惠券使用详情
-					if (fhCount > 0) {
-						List<CouponUserView> couponUserViews = couponUserMapper.couponPersonalByCouponIds(List.of(userId), couponIds);
-						couponUserViews.forEach(couponUserView -> {
-							String str = couponSkuMapper.selectGoodsSkuStr(couponUserView.getCouponId());
-							couponUserView.setGoodsSkuStr(str.replaceAll(",", "/").replaceAll(";", ""));
-							List<CouponSkuView> couponSkus = couponSkuMapper.getGoodsSkuByCouponId(couponUserView.getCouponId());
-							try {
-								couponUserView.setGoodsSkuIds(Jsons.toJson(couponSkus));
-								if (StrUtil.isEmpty(couponUserView.getGoodsImg())) {
-									Long goodsId = couponSkus.get(0).getGoodsId();
-									GoodsDon goodsDon = beanSearcher.searchFirst(GoodsDon.class, MapUtils.builder().field(GoodsDon::getId, goodsId).build());
-									couponUserView.setGoodsImg(goodsDon.getImg());
-								}
-							} catch (Exception e) {
+					data.setApiQuotaCouponEnabled(Boolean.FALSE);
+					if (userActivity != null) {
+						data.setApiQuotaCouponEnabled(userActivity.getApiQuotaCouponEnabled());
+						data.setApiQuotaCouponQuota(userActivity.getApiQuotaCouponQuota());
+
+						String couponIdsStr = userActivity.getCouponIds();
+						List<Long> couponIds = Jsons.parseList(couponIdsStr, Long.class);
+						//优惠券使用详情
+						if (fhCount > 0) {
+							List<CouponUserView> couponUserViews = couponUserMapper.couponPersonalByCouponIds(List.of(userId), couponIds);
+							couponUserViews.forEach(couponUserView -> {
+								String str = couponSkuMapper.selectGoodsSkuStr(couponUserView.getCouponId());
+								couponUserView.setGoodsSkuStr(str.replaceAll(",", "/").replaceAll(";", ""));
+								List<CouponSkuView> couponSkus = couponSkuMapper.getGoodsSkuByCouponId(couponUserView.getCouponId());
+								try {
+									couponUserView.setGoodsSkuIds(Jsons.toJson(couponSkus));
+									if (StrUtil.isEmpty(couponUserView.getGoodsImg())) {
+										Long goodsId = couponSkus.get(0).getGoodsId();
+										GoodsDon goodsDon = beanSearcher.searchFirst(GoodsDon.class, MapUtils.builder().field(GoodsDon::getId, goodsId).build());
+										couponUserView.setGoodsImg(goodsDon.getImg());
+									}
+								} catch (Exception e) {
 
-							}
-						});
-						data.setCouponUserViews(couponUserViews);
-					} else {
-						List<CouponView> couponViews = beanSearcher.searchAll(CouponView.class, MapUtils.builder().field(CouponView::getId, couponIds).op(Operator.InList).build());
-						couponViews.forEach(couponView -> {
-							String str = couponSkuMapper.selectGoodsSkuStr(couponView.getId());
-							couponView.setGoodsSkuStr(str.replaceAll(",", "/").replaceAll(";", ""));
-							List<CouponSkuView> couponSkus = couponSkuMapper.getGoodsSkuByCouponId(couponView.getId());
-							try {
-								couponView.setGoodsSkuIds(Jsons.toJson(couponSkus));
-								if (StrUtil.isEmpty(couponView.getGoodsImg())) {
-									Long goodsId = couponSkus.get(0).getGoodsId();
-									GoodsDon goodsDon = beanSearcher.searchFirst(GoodsDon.class, MapUtils.builder().field(GoodsDon::getId, goodsId).build());
-									couponView.setGoodsImg(goodsDon.getImg());
 								}
-							} catch (Exception e) {
+							});
+							data.setCouponUserViews(couponUserViews);
+						} else {
+							List<CouponView> couponViews = beanSearcher.searchAll(CouponView.class, MapUtils.builder().field(CouponView::getId, couponIds).op(Operator.InList).build());
+							couponViews.forEach(couponView -> {
+								String str = couponSkuMapper.selectGoodsSkuStr(couponView.getId());
+								couponView.setGoodsSkuStr(str.replaceAll(",", "/").replaceAll(";", ""));
+								List<CouponSkuView> couponSkus = couponSkuMapper.getGoodsSkuByCouponId(couponView.getId());
+								try {
+									couponView.setGoodsSkuIds(Jsons.toJson(couponSkus));
+									if (StrUtil.isEmpty(couponView.getGoodsImg())) {
+										Long goodsId = couponSkus.get(0).getGoodsId();
+										GoodsDon goodsDon = beanSearcher.searchFirst(GoodsDon.class, MapUtils.builder().field(GoodsDon::getId, goodsId).build());
+										couponView.setGoodsImg(goodsDon.getImg());
+									}
+								} catch (Exception e) {
 
-							}
-						});
-						data.setCouponViews(couponViews);
+								}
+							});
+							data.setCouponViews(couponViews);
+						}
 					}
 				} catch (Exception e) {
 					log.error("解析大学生认证json错误,:{}", StringUtil.getErrorText(e));