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

Merge remote-tracking branch 'origin/mj_guide_func' into midjourney

# Conflicts:
#	netflix-service/src/main/java/com/cyksj/redis/RedisService.java
#	netflix-web/src/main/java/com/cyksj/web/controller/mirror/MidjourneyController.java
chenbiao 2 лет назад
Родитель
Сommit
3d0c8269b7
99 измененных файлов с 2009 добавлено и 254 удалено
  1. 6 0
      netflix-common/pom.xml
  2. 10 0
      netflix-common/src/main/java/com/cyksj/common/constant/Constant.java
  3. 53 0
      netflix-common/src/main/java/com/cyksj/common/util/SmsUtil.java
  4. 2 2
      netflix-common/src/main/java/com/cyksj/common/util/StringUtil.java
  5. 43 0
      netflix-common/src/main/java/com/cyksj/common/util/TicketCodeCommonUtil.java
  6. 2 0
      netflix-dao/src/main/java/com/cyksj/mapper/GroupsMapper.java
  7. 18 0
      netflix-dao/src/main/java/com/cyksj/mapper/GroupsRelationExpiryNotifyRecordMapper.java
  8. 2 0
      netflix-dao/src/main/java/com/cyksj/mapper/GroupsRelationMapper.java
  9. 17 0
      netflix-dao/src/main/java/com/cyksj/mapper/MidjourneyPaintingPlazaMapper.java
  10. 2 0
      netflix-dao/src/main/java/com/cyksj/mapper/OrderDonMapper.java
  11. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/UserReceiveTrialTicketRecordMapper.java
  12. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/UserTrialTicketJumpPayRecordMapper.java
  13. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/manage/distribute/DistributeExtraRebateConfigMapper.java
  14. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/station/CollegeStudentStationClickRecordMapper.java
  15. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/station/CollegeStudentStationUseTicketRecordMapper.java
  16. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/station/CollegeStudentStationUserRelateMapper.java
  17. 6 0
      netflix-dao/src/main/java/com/cyksj/model/dto/AuthRedirect.java
  18. 19 0
      netflix-dao/src/main/java/com/cyksj/model/entity/CollegeStudentStationClickRecord.java
  19. 20 0
      netflix-dao/src/main/java/com/cyksj/model/entity/CollegeStudentStationUseTicketRecord.java
  20. 21 0
      netflix-dao/src/main/java/com/cyksj/model/entity/CollegeStudentStationUserRelate.java
  21. 20 0
      netflix-dao/src/main/java/com/cyksj/model/entity/DistributeExtraRebateConfig.java
  22. 15 0
      netflix-dao/src/main/java/com/cyksj/model/entity/DistributeWaitingSendPoints.java
  23. 5 0
      netflix-dao/src/main/java/com/cyksj/model/entity/GroupsRelation.java
  24. 24 0
      netflix-dao/src/main/java/com/cyksj/model/entity/GroupsRelationExpiryNotifyRecord.java
  25. 39 0
      netflix-dao/src/main/java/com/cyksj/model/entity/MidjourneyPaintingPlaza.java
  26. 8 0
      netflix-dao/src/main/java/com/cyksj/model/entity/MidjourneyUser.java
  27. 4 0
      netflix-dao/src/main/java/com/cyksj/model/entity/OrderDon.java
  28. 2 0
      netflix-dao/src/main/java/com/cyksj/model/entity/UpgradeOrderDon.java
  29. 1 1
      netflix-dao/src/main/java/com/cyksj/model/entity/UpgradePackage.java
  30. 22 0
      netflix-dao/src/main/java/com/cyksj/model/entity/UserReceiveTrialTicketRecord.java
  31. 16 0
      netflix-dao/src/main/java/com/cyksj/model/entity/UserTrialTicketJumpPayRecord.java
  32. 3 0
      netflix-dao/src/main/java/com/cyksj/model/manage/views/OrderDonSearchView.java
  33. 3 0
      netflix-dao/src/main/java/com/cyksj/model/manage/views/OrderDonView.java
  34. 1 1
      netflix-dao/src/main/java/com/cyksj/model/manage/views/UpgradeOrderDonBackView.java
  35. 1 1
      netflix-dao/src/main/java/com/cyksj/model/manage/views/UpgradeOrderDonSearchView.java
  36. 1 1
      netflix-dao/src/main/java/com/cyksj/model/manage/views/UpgradeOrderDonView.java
  37. 18 0
      netflix-dao/src/main/java/com/cyksj/model/request/ChannelPayReq.java
  38. 5 0
      netflix-dao/src/main/java/com/cyksj/model/request/OrderPayRequest.java
  39. 12 0
      netflix-dao/src/main/java/com/cyksj/model/views/DistributePopularizeOrdersView.java
  40. 42 0
      netflix-dao/src/main/java/com/cyksj/model/views/GoodsDetailView.java
  41. 29 0
      netflix-dao/src/main/java/com/cyksj/model/views/MidjourneyPaintingUserView.java
  42. 30 0
      netflix-dao/src/main/java/com/cyksj/model/views/MidjourneyUserPaintingDayRecordView.java
  43. 36 0
      netflix-dao/src/main/java/com/cyksj/model/views/MidjourneyUserPaintingRecordView.java
  44. 1 1
      netflix-dao/src/main/java/com/cyksj/model/views/RefundUpdradeOrderDonView.java
  45. 18 0
      netflix-dao/src/main/java/com/cyksj/model/views/RenewalView.java
  46. 6 6
      netflix-dao/src/main/java/com/cyksj/model/views/UpgradePackageView.java
  47. 9 1
      netflix-dao/src/main/resources/mapper/GroupRelationMapper.xml
  48. 9 0
      netflix-dao/src/main/resources/mapper/GroupsMapper.xml
  49. 14 0
      netflix-dao/src/main/resources/mapper/GroupsRelationExpiryNotifyRecordMapper.xml
  50. 6 0
      netflix-dao/src/main/resources/mapper/MidjourneyPaintingPlazaMapper.xml
  51. 9 0
      netflix-dao/src/main/resources/mapper/OrderDonMapper.xml
  52. 4 4
      netflix-dao/src/main/resources/mapper/StatisticsExportMapper.xml
  53. 6 0
      netflix-service/pom.xml
  54. 35 7
      netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAccountServiceImpl.java
  55. 1 1
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpCustomerAcquisitionLinkServiceImpl.java
  56. 13 0
      netflix-service/src/main/java/com/cyksj/service/distribute/DistributeExtraRebateService.java
  57. 38 39
      netflix-service/src/main/java/com/cyksj/service/distribute/equipment/impl/EquipmentDistributeServiceImpl.java
  58. 76 0
      netflix-service/src/main/java/com/cyksj/service/distribute/impl/DistributeExtraRebateServiceImpl.java
  59. 1 1
      netflix-service/src/main/java/com/cyksj/service/mail/CuiQiuMailService.java
  60. 20 10
      netflix-service/src/main/java/com/cyksj/service/mail/impl/CuiQiuMailServiceImpl.java
  61. 9 0
      netflix-service/src/main/java/com/cyksj/service/mange/goods/CmsYhShopCommonServiceImpl.java
  62. 21 17
      netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java
  63. 0 3
      netflix-service/src/main/java/com/cyksj/service/midjourney/MidjourneyAccountService.java
  64. 14 0
      netflix-service/src/main/java/com/cyksj/service/midjourney/MidjourneyPaintingPlazaService.java
  65. 10 2
      netflix-service/src/main/java/com/cyksj/service/midjourney/impl/MidJourneyAccountServiceImpl.java
  66. 33 0
      netflix-service/src/main/java/com/cyksj/service/midjourney/impl/MidjourneyPaintingPlazaServiceImpl.java
  67. 58 6
      netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java
  68. 141 87
      netflix-service/src/main/java/com/cyksj/service/pay/impl/TransferFuncServiceImpl.java
  69. 2 1
      netflix-service/src/main/java/com/cyksj/service/paypal/PayPalService.java
  70. 2 0
      netflix-service/src/main/java/com/cyksj/service/relation/GroupRelationFrontService.java
  71. 86 16
      netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java
  72. 13 0
      netflix-service/src/main/java/com/cyksj/service/station/CollegeStudentStationFService.java
  73. 37 0
      netflix-service/src/main/java/com/cyksj/service/station/impl/CollegeStudentStationFServiceImpl.java
  74. 13 0
      netflix-service/src/main/java/com/cyksj/service/ticket/UserReceiveTrialTicketRecordService.java
  75. 148 0
      netflix-service/src/main/java/com/cyksj/service/ticket/impl/UserReceiveTrialTicketRecordServiceImpl.java
  76. 1 1
      netflix-service/src/main/java/com/cyksj/service/user/BadIntentionOpService.java
  77. 7 1
      netflix-service/src/main/java/com/cyksj/service/user/UserService.java
  78. 22 14
      netflix-service/src/main/java/com/cyksj/service/user/impl/BadIntentionOpServiceImpl.java
  79. 2 1
      netflix-service/src/main/java/com/cyksj/service/user/impl/UserPayOrderBlockServiceImpl.java
  80. 60 2
      netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java
  81. 0 1
      netflix-web/src/main/java/com/cyksj/web/controller/cps/CpsPopularizeController.java
  82. 10 1
      netflix-web/src/main/java/com/cyksj/web/controller/distribute/EquipmentDistributeController.java
  83. 4 1
      netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java
  84. 47 0
      netflix-web/src/main/java/com/cyksj/web/controller/group/MidJourneyGuideController.java
  85. 4 4
      netflix-web/src/main/java/com/cyksj/web/controller/landing/CorpFollowActiveCodeController.java
  86. 5 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/distribute/DistributeController.java
  87. 1 1
      netflix-web/src/main/java/com/cyksj/web/controller/manage/distribute/EquipmentController.java
  88. 37 2
      netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonController.java
  89. 107 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/mj/MidjourneyPaintingController.java
  90. 19 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/shop/ShopConfigController.java
  91. 19 1
      netflix-web/src/main/java/com/cyksj/web/controller/manage/upgrade/UpgradePackageController.java
  92. 5 0
      netflix-web/src/main/java/com/cyksj/web/controller/market/TaskFrontController.java
  93. 78 2
      netflix-web/src/main/java/com/cyksj/web/controller/mirror/MidjourneyController.java
  94. 24 6
      netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java
  95. 8 0
      netflix-web/src/main/java/com/cyksj/web/controller/payment/OrderController.java
  96. 4 3
      netflix-web/src/main/java/com/cyksj/web/controller/sys/SysConfigController.java
  97. 6 5
      netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java
  98. 48 0
      netflix-web/src/main/java/com/cyksj/web/controller/user/CollegeStudentStationController.java
  99. 2 0
      netflix-web/src/main/java/com/cyksj/web/controller/user/DistributePopularizeController.java

+ 6 - 0
netflix-common/pom.xml

@@ -104,6 +104,12 @@
             <artifactId>tencentcloud-sdk-java-faceid</artifactId>
             <artifactId>tencentcloud-sdk-java-faceid</artifactId>
             <version>3.1.694</version>
             <version>3.1.694</version>
         </dependency>
         </dependency>
+
+        <dependency>
+            <groupId>com.tencentcloudapi</groupId>
+            <artifactId>tencentcloud-sdk-java</artifactId>
+            <version>4.0.11</version>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
 
 

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

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

+ 53 - 0
netflix-common/src/main/java/com/cyksj/common/util/SmsUtil.java

@@ -4,6 +4,10 @@ import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpResponse;
 import cn.hutool.http.Method;
 import cn.hutool.http.Method;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONObject;
+import com.cyksj.common.exception.BusinessRuntimeException;
+import com.tencentcloudapi.captcha.v20190722.CaptchaClient;
+import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultRequest;
+import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultResponse;
 import com.tencentcloudapi.common.Credential;
 import com.tencentcloudapi.common.Credential;
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
 import com.tencentcloudapi.common.profile.ClientProfile;
 import com.tencentcloudapi.common.profile.ClientProfile;
@@ -48,6 +52,17 @@ public class SmsUtil {
     //账号修改密码国际短信通知
     //账号修改密码国际短信通知
     private static final String TENCENT_SMS_ACCOUNT_INTERNATIONAL_TEMPLATE_ID = "2040574";
     private static final String TENCENT_SMS_ACCOUNT_INTERNATIONAL_TEMPLATE_ID = "2040574";
 
 
+
+    private static final String TENCENT_CAPTCHA_SECRET_ID = "AKIDogNE1uQ3azlVH0582pS0gRD7HZ3aIAYs";
+
+    private static final String TENCENT_CAPTCHA_SECRET_KEY = "Ig2SnIyeHqK5tmrw27kR4bJ727bAsjSX";
+
+    //腾讯云图形认证密钥id
+    private static final Long TENCENT_CAPTCHA_APP_ID = 197694921l;
+
+    //腾讯云图形认证密钥key
+    private static final String TENCENT_CAPTCHA_APP_SECRET_KEY = "vOd32NejzMM2HQX0WtKy7ItvK";
+
     private static final Logger log = LoggerFactory.getLogger(SmsUtil.class);
     private static final Logger log = LoggerFactory.getLogger(SmsUtil.class);
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {
@@ -193,4 +208,42 @@ public class SmsUtil {
         }
         }
         return false;
         return false;
     }
     }
+
+    public static void checkTencentCaptcha(String ticket, String userIp,String randsStr) {
+        try {
+            // 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
+            // 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
+            // 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取
+            Credential cred = new Credential(TENCENT_CAPTCHA_SECRET_ID, TENCENT_CAPTCHA_SECRET_KEY);
+            // 实例化一个http选项,可选的,没有特殊需求可以跳过
+            HttpProfile httpProfile = new HttpProfile();
+            // 推荐使用北极星,相关指引可访问如下链接
+            // https://git.woa.com/tencentcloud-internal/tencentcloud-sdk-java#%E5%8C%97%E6%9E%81%E6%98%9F
+            httpProfile.setEndpoint("captcha.tencentcloudapi.com");
+            // 实例化一个client选项,可选的,没有特殊需求可以跳过
+            ClientProfile clientProfile = new ClientProfile();
+            clientProfile.setHttpProfile(httpProfile);
+            // 实例化要请求产品的client对象,clientProfile是可选的
+            CaptchaClient client = new CaptchaClient(cred, "", clientProfile);
+            // 实例化一个请求对象,每个接口都会对应一个request对象
+            DescribeCaptchaResultRequest req = new DescribeCaptchaResultRequest();
+            req.setCaptchaType(9L);
+            req.setTicket(ticket);
+            req.setUserIp(userIp);
+            req.setRandstr(randsStr);
+            req.setCaptchaAppId(TENCENT_CAPTCHA_APP_ID);
+            req.setAppSecretKey(TENCENT_CAPTCHA_APP_SECRET_KEY);
+
+            // 返回的resp是一个DescribeCaptchaResultResponse的实例,与请求对象对应
+            DescribeCaptchaResultResponse resp = client.DescribeCaptchaResult(req);
+            //1 OK 验证通过
+            Long captchaCode = resp.getCaptchaCode();
+            if (captchaCode != 1) {
+                log.error("腾讯云图形验证错误:{}", resp.getCaptchaMsg());
+                throw BusinessRuntimeException.getInstance("图形验证失败");
+            }
+        } catch (TencentCloudSDKException e) {
+            log.error("腾讯云图形认证异常:{}", StringUtil.getErrorText(e));
+        }
+    }
 }
 }

+ 2 - 2
netflix-common/src/main/java/com/cyksj/common/util/StringUtil.java

@@ -561,9 +561,9 @@ public final class StringUtil {
 	/**
 	/**
 	 * 获取账号登录验证码
 	 * 获取账号登录验证码
 	 */
 	 */
-	public static String getVerifyCodePattern(String code) {
+	public static String getVerifyCodePattern(String code, Integer length) {
 		if (StrUtil.isNotEmpty(code)) {
 		if (StrUtil.isNotEmpty(code)) {
-			Pattern pattern = Pattern.compile("\\d{4,}");
+			Pattern pattern = Pattern.compile(String.format("\\d{%s,}", length));
 			Matcher matcher = pattern.matcher(code);
 			Matcher matcher = pattern.matcher(code);
 			while (matcher.find()) {
 			while (matcher.find()) {
 				return matcher.group();
 				return matcher.group();

+ 43 - 0
netflix-common/src/main/java/com/cyksj/common/util/TicketCodeCommonUtil.java

@@ -0,0 +1,43 @@
+package com.cyksj.common.util;
+
+import cn.hutool.core.util.StrUtil;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: TicketCodeCommonUtil
+ * 创建者: JavaZou
+ * 创建时间:2024/5/24 15:31
+ */
+
+public class TicketCodeCommonUtil {
+	/**
+	 * 车票邮箱验证码
+	 */
+	public static String getTicketCodeStr(String body, Long goodsId) {
+		if (StrUtil.isEmpty(body)) {
+			return body;
+		}
+		String str = null;
+		if (goodsId == 33l) {
+			str = "color:#505050; font-family:adobe-clean, Helvetica Neue, Helvetica, Verdana, Arial, sans-serif;";
+		}
+		if (goodsId == 3l) {
+			str = "letter-spacing:4px; line-height:38px; mso-line-height-rule: exactly";
+		}
+		if (StrUtil.isEmpty(str)) {
+			return str;
+		}
+		int index = body.indexOf(str);
+		if (index == -1) {
+			if (goodsId == 33l) {
+				str = "X-Report-Abuse: abuse@adobe.com";
+			}
+			index = body.indexOf(str);
+		}
+		String code = StrUtil.subWithLength(body, index, 512);
+		if (StrUtil.isNotBlank(code)) {
+			code = code.replace(str, "");
+		}
+		return code;
+	}
+}

+ 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);
 	Integer countExpiredNum(Long accountId);
 
 
 	GroupsTrips selectTicketGroups(@Param("skuId") Long skuId, @Param("status") GroupsTrips.Status status, @Param("maxNum") Integer maxNum, @Param("ip") String ip);
 	GroupsTrips selectTicketGroups(@Param("skuId") Long skuId, @Param("status") GroupsTrips.Status status, @Param("maxNum") Integer maxNum, @Param("ip") String ip);
+
+	GroupsTrips selectCollegeStudentUserGptTicket(Long skuId);
 }
 }

+ 18 - 0
netflix-dao/src/main/java/com/cyksj/mapper/GroupsRelationExpiryNotifyRecordMapper.java

@@ -0,0 +1,18 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.GroupsRelationExpiryNotifyRecord;
+import com.cyksj.model.views.RenewalView;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: GroupsRelationExpiryNotifyRecordMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/5/24 14:56
+ */
+public interface GroupsRelationExpiryNotifyRecordMapper extends BaseMapper<GroupsRelationExpiryNotifyRecord> {
+	void batchInsert(@Param("userId") Long userId, @Param("list") List<RenewalView> expiryTickets);
+}

+ 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);
 	PhoneCode getAreaPhoneByUserId(Long userId);
 
 
 	List<RenewalView> getUserHasPayGoods(@Param("list") List<Long> userIds, @Param("now") DateTime now);
 	List<RenewalView> getUserHasPayGoods(@Param("list") List<Long> userIds, @Param("now") DateTime now);
+
+	Long getExperienceTicket(@Param("userId") Long userId, @Param("skuId") Long skuId);
 }
 }

+ 17 - 0
netflix-dao/src/main/java/com/cyksj/mapper/MidjourneyPaintingPlazaMapper.java

@@ -0,0 +1,17 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.MidjourneyPaintingPlaza;
+import org.apache.ibatis.annotations.Update;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: MidjourneyPaintingPlazaMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 17:22
+ */
+public interface MidjourneyPaintingPlazaMapper extends BaseMapper<MidjourneyPaintingPlaza> {
+
+	@Update("update midjourney_painting_plaza set copy_num = copy_num + 1 where id = #{id}")
+	void updatePaintingCopyNum(Long id);
+}

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

@@ -91,4 +91,6 @@ public interface OrderDonMapper extends BaseMapper<OrderDon> {
 	BigDecimal getTotalRefundAmountTime(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
 	BigDecimal getTotalRefundAmountTime(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
 
 
 	BigDecimal getCouponUsedMoney(Long couponId);
 	BigDecimal getCouponUsedMoney(Long couponId);
+
+	Integer checkUserHasPaidMjMirror(@Param("list") List<Long> userIdList);
 }
 }

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

@@ -0,0 +1,13 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.UserReceiveTrialTicketRecord;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: UserReceiveTrialTicketRecordMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 17:58
+ */
+public interface UserReceiveTrialTicketRecordMapper extends BaseMapper<UserReceiveTrialTicketRecord> {
+}

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

@@ -0,0 +1,13 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.UserTrialTicketJumpPayRecord;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: UserTrialTicketJumpPayRecordMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 18:27
+ */
+public interface UserTrialTicketJumpPayRecordMapper extends BaseMapper<UserTrialTicketJumpPayRecord> {
+}

+ 13 - 0
netflix-dao/src/main/java/com/cyksj/mapper/manage/distribute/DistributeExtraRebateConfigMapper.java

@@ -0,0 +1,13 @@
+package com.cyksj.mapper.manage.distribute;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.DistributeExtraRebateConfig;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: DistributeExtraRebateConfigMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/5/29 15:12
+ */
+public interface DistributeExtraRebateConfigMapper extends BaseMapper<DistributeExtraRebateConfig> {
+}

+ 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
      * 跳转url
      */
      */
     private String 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;
+}

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

@@ -0,0 +1,20 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: DistributeExtraRebateConfig
+ * 创建者: JavaZou
+ * 创建时间:2024/5/29 15:10
+ */
+@Getter
+@Setter
+public class DistributeExtraRebateConfig extends BaseEntity{
+	private BigDecimal multiple;
+
+	private BigDecimal rate;
+}

+ 15 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/DistributeWaitingSendPoints.java

@@ -29,6 +29,21 @@ public class DistributeWaitingSendPoints extends BaseEntity{
 
 
 	private BigDecimal points;
 	private BigDecimal points;
 
 
+	/**
+	 * 额外返利积分(目前只针对普通推广)
+	 */
+	private BigDecimal extraRebate;
+
+	/**
+	 * 倍数
+	 */
+	private BigDecimal extraMultiple;
+
+	/**
+	 * 原本积分奖励
+	 */
+	private BigDecimal oriPoints;
+
 	private BigDecimal refundPoints;
 	private BigDecimal refundPoints;
 
 
 	/**
 	/**

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/GroupsRelation.java

@@ -103,6 +103,11 @@ public class GroupsRelation extends BaseEntity {
     @DbIgnore
     @DbIgnore
     private Integer maxNum;
     private Integer maxNum;
 
 
+    /**
+     * 车票获取类型 默认1购买,2.体验
+     */
+    private Integer aqType;
+
 
 
     @AllArgsConstructor
     @AllArgsConstructor
     @Getter
     @Getter

+ 24 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/GroupsRelationExpiryNotifyRecord.java

@@ -0,0 +1,24 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: GroupsRelationExpiryNotifyRecord
+ * 创建者: JavaZou
+ * 创建时间:2024/5/24 14:55
+ */
+@Getter
+@Setter
+public class GroupsRelationExpiryNotifyRecord extends BaseEntity{
+	private Long userId;
+
+	private Long relationId;
+
+	private Long skuId;
+
+	private Date expiryTime;
+}

+ 39 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/MidjourneyPaintingPlaza.java

@@ -0,0 +1,39 @@
+package com.cyksj.model.entity;
+
+import com.cyksj.model.BaseEntity;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: MidjourneyPaintingPlaza
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 17:19
+ */
+@Getter
+@Setter
+public class MidjourneyPaintingPlaza extends BaseEntity {
+	/**
+	 * 提示词
+	 */
+	private String tips;
+
+	/**
+	 * 图片
+	 */
+	private String img;
+
+	/**
+	 * 备注
+	 */
+	private String remark;
+
+	/**
+	 * 复制次数
+	 */
+	private Integer copyNum;
+
+	private Boolean status;
+
+	private Boolean deleted;
+}

+ 8 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/MidjourneyUser.java

@@ -6,6 +6,7 @@ package com.cyksj.model.entity;
  */
  */
 
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.ejlchina.searcher.bean.DbIgnore;
 import com.ejlchina.searcher.bean.SearchBean;
 import com.ejlchina.searcher.bean.SearchBean;
 import lombok.Data;
 import lombok.Data;
 
 
@@ -54,4 +55,11 @@ public class MidjourneyUser extends BaseEntity{
      * 当前模式 1:fast 2:relax
      * 当前模式 1:fast 2:relax
      */
      */
     private Integer mode;
     private Integer mode;
+
+    /**
+     * 车票类型 2试用
+     */
+    @DbIgnore
+    @TableField(exist = false)
+    private Integer aqType;
 }
 }

+ 4 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/OrderDon.java

@@ -290,6 +290,10 @@ public class OrderDon extends BaseEntity implements Serializable {
      */
      */
     private String phone;
     private String phone;
 
 
+    @DbIgnore
+    @TableField(exist = false)
+    private Boolean isMirror;
+
     public enum Status {
     public enum Status {
         /**
         /**
          * 订单状态
          * 订单状态

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/UpgradeOrderDon.java

@@ -24,6 +24,8 @@ public class UpgradeOrderDon extends BaseEntity {
      */
      */
     private Long goodsId;
     private Long goodsId;
 
 
+    private Long skuId;
+
     /**
     /**
      * 套餐id
      * 套餐id
      */
      */

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/entity/UpgradePackage.java

@@ -24,7 +24,7 @@ public class UpgradePackage extends BaseEntity{
     /**
     /**
      * 商品规格id
      * 商品规格id
      */
      */
-    private Long skuId;
+    private String skuIds;
 
 
     /**
     /**
      * 套餐价格
      * 套餐价格

+ 22 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/UserReceiveTrialTicketRecord.java

@@ -0,0 +1,22 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: UserReceiveTrialTicketRecord
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 17:53
+ */
+@Getter
+@Setter
+public class UserReceiveTrialTicketRecord extends BaseEntity{
+	private Long userId;
+
+	private Long goodsId;
+
+	private Long skuId;
+
+	private Long relationId;
+}

+ 16 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/UserTrialTicketJumpPayRecord.java

@@ -0,0 +1,16 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: UserTrialTicketJumpPayRecord
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 18:26
+ */
+@Getter
+@Setter
+public class UserTrialTicketJumpPayRecord extends BaseEntity {
+	private Long orderId;
+}

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/manage/views/OrderDonSearchView.java

@@ -161,4 +161,7 @@ public class OrderDonSearchView {
 	 */
 	 */
 	@DbField("o.ex_code")
 	@DbField("o.ex_code")
 	private String exCode;
 	private String exCode;
+
+	@DbField("sku.is_mirror")
+	private Boolean isMirror;
 }
 }

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/manage/views/OrderDonView.java

@@ -95,6 +95,9 @@ public class OrderDonView {
     @DbField("o.status")
     @DbField("o.status")
     private OrderDon.Status status;
     private OrderDon.Status status;
 
 
+    @DbField("sku.is_mirror")
+    private Boolean isMirror;
+
     @DbField("o.type")
     @DbField("o.type")
     private OrderDon.Type type;
     private OrderDon.Type type;
 
 

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/manage/views/UpgradeOrderDonBackView.java

@@ -22,7 +22,7 @@ import java.util.List;
 @Setter
 @Setter
 @SearchBean(tables = "upgrade_order_don o left join upgrade_package up on o.package_id = up.id " +
 @SearchBean(tables = "upgrade_order_don o left join upgrade_package up on o.package_id = up.id " +
 		"left join goods_don g on up.goods_id = g.id " +
 		"left join goods_don g on up.goods_id = g.id " +
-		"left join goods_don_sku gds on up.sku_id = gds.id ",
+		"left join goods_don_sku gds on o.sku_id = gds.id ",
 		where = ":condition:"
 		where = ":condition:"
 )
 )
 public class UpgradeOrderDonBackView {
 public class UpgradeOrderDonBackView {

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/manage/views/UpgradeOrderDonSearchView.java

@@ -26,7 +26,7 @@ import java.util.List;
 @Setter
 @Setter
 @SearchBean(tables = "(select * from upgrade_order_don :orderId:) o left join upgrade_package up on o.package_id = up.id " +
 @SearchBean(tables = "(select * from upgrade_order_don :orderId:) o left join upgrade_package up on o.package_id = up.id " +
 		"left join goods_don g on g.id = up.goods_id " +
 		"left join goods_don g on g.id = up.goods_id " +
-		"left join goods_don_sku gs on gs.id = up.sku_id ")
+		"left join goods_don_sku gs on gs.id = o.sku_id ")
 public class UpgradeOrderDonSearchView {
 public class UpgradeOrderDonSearchView {
 	@DbField("o.id")
 	@DbField("o.id")
 	private Long id;
 	private Long id;

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/manage/views/UpgradeOrderDonView.java

@@ -24,7 +24,7 @@ import java.util.List;
 @Setter
 @Setter
 @SearchBean(tables = "upgrade_order_don o left join upgrade_package up on o.package_id = up.id " +
 @SearchBean(tables = "upgrade_order_don o left join upgrade_package up on o.package_id = up.id " +
         "left join goods_don g on g.id = o.goods_id " +
         "left join goods_don g on g.id = o.goods_id " +
-        "left join goods_don_sku sku on up.sku_id = sku.id ")
+        "left join goods_don_sku sku on o.sku_id = sku.id ")
 public class UpgradeOrderDonView {
 public class UpgradeOrderDonView {
 
 
     @DbField("o.id")
     @DbField("o.id")

+ 18 - 0
netflix-dao/src/main/java/com/cyksj/model/request/ChannelPayReq.java

@@ -0,0 +1,18 @@
+package com.cyksj.model.request;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: ChannelPayReq
+ * 创建者: JavaZou
+ * 创建时间:2024/5/31 13:57
+ */
+@Getter
+@Setter
+public class ChannelPayReq {
+	private String wxShopId;
+
+	private String zfbShopId;
+}

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/request/OrderPayRequest.java

@@ -175,4 +175,9 @@ public class OrderPayRequest {
      * 源订单id
      * 源订单id
      */
      */
     private Long originalOrderId;
     private Long originalOrderId;
+
+    /**
+     * 是否是试用车票跳转
+     */
+    private Boolean isTrial;
 }
 }

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

@@ -47,9 +47,21 @@ public class DistributePopularizeOrdersView {
 	@DbField("dw.points")
 	@DbField("dw.points")
 	private BigDecimal points;
 	private BigDecimal points;
 
 
+	@DbField("dw.extra_rebate")
+	private BigDecimal extraRebate;
+
+	/**
+	 * 原本积分奖励
+	 */
+	@DbField("dw.ori_points")
+	private BigDecimal oriPoints;
+
 	@DbIgnore
 	@DbIgnore
 	private BigDecimal waitGetMoney;
 	private BigDecimal waitGetMoney;
 
 
+	@DbIgnore
+	private BigDecimal oriGetMoney;
+
 	@DbField("dw.send_status")
 	@DbField("dw.send_status")
 	private String sendStatus;
 	private String sendStatus;
 
 

+ 42 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDetailView.java

@@ -0,0 +1,42 @@
+package com.cyksj.model.views;
+
+import com.cyksj.model.entity.GoodsDonSku;
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.DbIgnore;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: GoodsDetailView
+ * 创建者: JavaZou
+ * 创建时间:2024/5/31 14:15
+ */
+@Getter
+@Setter
+@SearchBean(tables = "goods_don g", where = ":condition:")
+public class GoodsDetailView {
+	@DbField("g.id")
+	private Long id;
+
+	/**
+	 * 1.虚拟,2.实物,3.潮玩,4.租赁
+	 */
+	@DbField("g.type")
+	private Integer type;
+
+	@DbField("g.title")
+	private String title;
+
+	@DbField("g.status")
+	private Boolean status;
+
+	@DbField("g.deleted")
+	private Boolean deleted;
+
+	@DbIgnore
+	private List<GoodsDonSku> skuList;
+}

+ 29 - 0
netflix-dao/src/main/java/com/cyksj/model/views/MidjourneyPaintingUserView.java

@@ -0,0 +1,29 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: MidjourneyPaintingUserView
+ * 创建者: JavaZou
+ * 创建时间:2024/6/4 13:54
+ */
+@Getter
+@Setter
+@SearchBean(tables = "midjourney_painting_plaza mpp",
+		where = "mpp.status is true and mpp.deleted is true",
+		orderBy = "mpp.update_time desc")
+public class MidjourneyPaintingUserView {
+
+	@DbField("mpp.id")
+	private Long id;
+
+	@DbField("mpp.tips")
+	private String tips;
+
+	@DbField("mpp.img")
+	private String img;
+}

+ 30 - 0
netflix-dao/src/main/java/com/cyksj/model/views/MidjourneyUserPaintingDayRecordView.java

@@ -0,0 +1,30 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.DbIgnore;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: MidjourneyUserPaintingDayRecordView
+ * 创建者: JavaZou
+ * 创建时间:2024/6/4 15:42
+ */
+@Getter
+@Setter
+@SearchBean(tables = "midjourney_user_conversation mc"
+		, where = "mc.status = 'SUCCESS' :condition:"
+		, groupBy = "DATE_FORMAT(mc.created_time,'%Y-%m-%d')",
+		orderBy = "DATE_FORMAT(mc.created_time,'%Y-%m-%d') desc")
+public class MidjourneyUserPaintingDayRecordView {
+
+	@DbField("DATE_FORMAT(mc.created_time,'%Y-%m-%d')")
+	private String date;
+
+	@DbIgnore
+	private List<MidjourneyUserPaintingRecordView> list;
+}

+ 36 - 0
netflix-dao/src/main/java/com/cyksj/model/views/MidjourneyUserPaintingRecordView.java

@@ -0,0 +1,36 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: MidjourneyUserPaintingRecordView
+ * 创建者: JavaZou
+ * 创建时间:2024/6/4 15:40
+ */
+@Getter
+@Setter
+@SearchBean(tables = "midjourney_user_conversation mc",
+		where = "mc.status = 'SUCCESS' :condition: :date:")
+public class MidjourneyUserPaintingRecordView {
+
+	/**
+	 * 提示词
+	 */
+	@DbField("mc.prompt")
+	private String prompt;
+
+	@DbField("mc.image_url")
+	private String imageUrl;
+
+	@DbField("bookmark")
+	private Boolean bookmark;
+
+	@DbField("mc.created_time")
+	private Date createdTime;
+}

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/views/RefundUpdradeOrderDonView.java

@@ -18,7 +18,7 @@ import java.util.Date;
 @Getter
 @Getter
 @Setter
 @Setter
 @SearchBean(tables = "refund_upgrade_order_don rd left join upgrade_order_don o on o.id = rd.order_id " +
 @SearchBean(tables = "refund_upgrade_order_don rd left join upgrade_order_don o on o.id = rd.order_id " +
-		"left join upgrade_package up on up.id = o.package_id left join goods_don_sku s on s.id = up.sku_id")
+		"left join upgrade_package up on up.id = o.package_id left join goods_don_sku s on s.id = o.sku_id")
 public class RefundUpdradeOrderDonView {
 public class RefundUpdradeOrderDonView {
 	@DbField("rd.id")
 	@DbField("rd.id")
 	private Long id;
 	private Long id;

+ 18 - 0
netflix-dao/src/main/java/com/cyksj/model/views/RenewalView.java

@@ -160,6 +160,12 @@ public class RenewalView {
     @DbField("gr.yhs_id")
     @DbField("gr.yhs_id")
     private Long yhsId;
     private Long yhsId;
 
 
+    /**
+     * 车票获取类型 默认1购买,2.体验
+     */
+    @DbField("gr.aq_type")
+    private Integer aqType;
+
     @DbIgnore
     @DbIgnore
     private Date payTime;
     private Date payTime;
 
 
@@ -204,4 +210,16 @@ public class RenewalView {
      */
      */
     @DbIgnore
     @DbIgnore
     private BigDecimal mjPackagePrice;
     private BigDecimal mjPackagePrice;
+
+    /**
+     * 用户 mj fast次数
+     */
+    @DbIgnore
+    private Integer mjUserFastNum;
+
+    /**
+     * 用户 mj relax次数
+     */
+    @DbIgnore
+    private Integer mjUserRelaxNum;
 }
 }

+ 6 - 6
netflix-dao/src/main/java/com/cyksj/model/views/UpgradePackageView.java

@@ -1,7 +1,7 @@
 package com.cyksj.model.views;
 package com.cyksj.model.views;
 
 
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.ejlchina.searcher.bean.DbField;
 import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.DbIgnore;
 import com.ejlchina.searcher.bean.SearchBean;
 import com.ejlchina.searcher.bean.SearchBean;
 import lombok.Data;
 import lombok.Data;
 
 
@@ -12,8 +12,8 @@ import java.math.BigDecimal;
  * @date 2024/4/24 15:20
  * @date 2024/4/24 15:20
  */
  */
 @Data
 @Data
-@SearchBean(tables = "upgrade_package up left join goods_don g on up.goods_id = g.id " +
-        "left join goods_don_sku s on up.sku_id = s.id", where = "up.deleted = true")
+@SearchBean(tables = "upgrade_package up left join goods_don g on up.goods_id = g.id "
+        , where = "up.deleted = true :sku:")
 public class UpgradePackageView {
 public class UpgradePackageView {
     @DbField("up.id")
     @DbField("up.id")
     private Long id;
     private Long id;
@@ -39,13 +39,13 @@ public class UpgradePackageView {
     /**
     /**
      * 商品规格id
      * 商品规格id
      */
      */
-    @DbField("up.sku_id")
-    private Long skuId;
+    @DbField("up.sku_ids")
+    private String skuIds;
 
 
     /**
     /**
      * 商品规格名称
      * 商品规格名称
      */
      */
-    @DbField("s.spec_val")
+    @DbIgnore
     private String specVal;
     private String specVal;
 
 
     /**
     /**

+ 9 - 1
netflix-dao/src/main/resources/mapper/GroupRelationMapper.xml

@@ -17,7 +17,8 @@
         send_time = null,
         send_time = null,
         submit_time = null,
         submit_time = null,
         operator = null,
         operator = null,
-        yhs_id = 0
+        yhs_id = 0,
+        aq_type = 1
         where id = #{entity.id}
         where id = #{entity.id}
         <if test="expireTime != null">
         <if test="expireTime != null">
             and expiry_time = #{expireTime}
             and expiry_time = #{expireTime}
@@ -340,4 +341,11 @@
         group by g.id,g.title,g.logo
         group by g.id,g.title,g.logo
         order by goods_id
         order by goods_id
     </select>
     </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>
 </mapper>

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

@@ -98,4 +98,13 @@
         order by available_num asc
         order by available_num asc
         limit 1
         limit 1
     </select>
     </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>
 </mapper>

+ 14 - 0
netflix-dao/src/main/resources/mapper/GroupsRelationExpiryNotifyRecordMapper.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.cyksj.mapper.GroupsRelationExpiryNotifyRecordMapper">
+
+
+    <insert id="batchInsert">
+        insert into
+        groups_relation_expiry_notify_record(`user_id`,`relation_id`,`sku_id`,`expiry_time`,`created_time`,`update_time`)
+        values
+        <foreach collection="list" item="item" separator=",">
+            (#{userId},#{item.relationId},#{item.skuId},#{item.expiryTimeStr},now(),now())
+        </foreach>
+    </insert>
+</mapper>

+ 6 - 0
netflix-dao/src/main/resources/mapper/MidjourneyPaintingPlazaMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.cyksj.mapper.MidjourneyPaintingPlazaMapper">
+
+
+</mapper>

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

@@ -513,4 +513,13 @@
         from (select id from coupon_user where coupon_id = #{couponId}) cu
         from (select id from coupon_user where coupon_id = #{couponId}) cu
                  inner join order_don o on o.coupon_user_id = cu.id and o.status not in ('close', 'noPayment')
                  inner join order_don o on o.coupon_user_id = cu.id and o.status not in ('close', 'noPayment')
     </select>
     </select>
+
+    <select id="checkUserHasPaidMjMirror" resultType="java.lang.Integer">
+        select count(1) from order_don where user_id in
+        <foreach collection="list" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+        and status not in ('close','noPayment','refund') and sku_id in (select id from goods_don_sku where goods_id = 26 and
+        is_mirror = 1)
+    </select>
 </mapper>
 </mapper>

+ 4 - 4
netflix-dao/src/main/resources/mapper/StatisticsExportMapper.xml

@@ -72,7 +72,7 @@
     </select>
     </select>
 
 
     <select id="getMonthAiExNumOfUser" resultType="java.lang.Integer">
     <select id="getMonthAiExNumOfUser" resultType="java.lang.Integer">
-        select count(distinct buyer_id)
+        select count(distinct user_id)
         from `order_don` od
         from `order_don` od
         where status not in ('close','noPayment')
         where status not in ('close','noPayment')
         and (refund_money is null or refund_money != money)
         and (refund_money is null or refund_money != money)
@@ -84,7 +84,7 @@
     </select>
     </select>
 
 
     <select id="getMonthAiExNumOfUserByType" resultType="java.lang.Integer">
     <select id="getMonthAiExNumOfUserByType" resultType="java.lang.Integer">
-        select count(distinct buyer_id) from (select buyer_id
+        select count(distinct user_id) from (select user_id
         from `order_don` od
         from `order_don` od
         where status not in ('close','noPayment')
         where status not in ('close','noPayment')
         and (refund_money is null or refund_money != money)
         and (refund_money is null or refund_money != money)
@@ -98,7 +98,7 @@
         and (refund_money is null or refund_money != money)
         and (refund_money is null or refund_money != money)
         and created_time between #{thisMonth} and #{nextMonth}
         and created_time between #{thisMonth} and #{nextMonth}
         and order_type = #{type}
         and order_type = #{type}
-        and buyer_id = s.buyer_id
+        and user_id = s.user_id
         and sku_id in
         and sku_id in
         <foreach collection="skuIds" item="item" open="(" separator="," close=")">
         <foreach collection="skuIds" item="item" open="(" separator="," close=")">
             #{item}
             #{item}
@@ -107,7 +107,7 @@
     </select>
     </select>
 
 
     <select id="getMonthAiRenewNumOfUser" resultType="java.lang.Integer">
     <select id="getMonthAiRenewNumOfUser" resultType="java.lang.Integer">
-        select count(distinct buyer_id)
+        select count(distinct user_id)
         from `order_don` od
         from `order_don` od
         where status not in ('close','noPayment')
         where status not in ('close','noPayment')
         and (refund_money is null or refund_money != money)
         and (refund_money is null or refund_money != money)

+ 6 - 0
netflix-service/pom.xml

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

+ 35 - 7
netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAccountServiceImpl.java

@@ -1,6 +1,7 @@
 package com.cyksj.service.chatgpt.impl;
 package com.cyksj.service.chatgpt.impl;
 
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.lang.UUID;
 import cn.hutool.core.lang.UUID;
 import cn.hutool.http.HttpRequest;
 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.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.common.util.StringUtil;
 import com.cyksj.common.util.StringUtil;
 import com.cyksj.mapper.*;
 import com.cyksj.mapper.*;
+import com.cyksj.mapper.station.CollegeStudentStationUseTicketRecordMapper;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.request.gpt.ConversationRequest;
 import com.cyksj.model.request.gpt.ConversationRequest;
 import com.cyksj.model.response.ConversationLimitResponse;
 import com.cyksj.model.response.ConversationLimitResponse;
@@ -95,6 +97,8 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
 
 
     private final ChatgptUserCarUsedRecordMapper chatgptUserCarUsedRecordMapper;
     private final ChatgptUserCarUsedRecordMapper chatgptUserCarUsedRecordMapper;
 
 
+    private final CollegeStudentStationUseTicketRecordMapper collegeStudentStationUseTicketRecordMapper;
+
     @Override
     @Override
     public String addAccount(Account account) {
     public String addAccount(Account account) {
         if (isAccountExists(account)) {
         if (isAccountExists(account)) {
@@ -355,6 +359,17 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
             chatgptUser.setRelationId(groupsRelation.getId());
             chatgptUser.setRelationId(groupsRelation.getId());
             chatgptUser.setUserToken(UUID.randomUUID().toString());
             chatgptUser.setUserToken(UUID.randomUUID().toString());
             chatgptUserMapper.insert(chatgptUser);
             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) {
         } catch (DuplicateKeyException e) {
             log.error("重复插入镜像用户:{}token,errmsg:{}", user.getNickname(), StringUtil.getErrorText(e));
             log.error("重复插入镜像用户:{}token,errmsg:{}", user.getNickname(), StringUtil.getErrorText(e));
         }
         }
@@ -431,11 +446,10 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
     @Override
     @Override
     public void saveConversationRecord(String userToken, ConversationRequest conversationRequest) {
     public void saveConversationRecord(String userToken, ConversationRequest conversationRequest) {
         LambdaQueryWrapper<ChatgptSession> wrapper = Wrappers.lambdaQuery(ChatgptSession.class);
         LambdaQueryWrapper<ChatgptSession> wrapper = Wrappers.lambdaQuery(ChatgptSession.class);
-
+        ChatgptUser chatgptUser = chatgptUserMapper.selectOne(Wrappers.lambdaQuery(ChatgptUser.class).eq(ChatgptUser::getUserToken, userToken));
         if (StringUtils.isNotBlank(conversationRequest.getCarId())) {
         if (StringUtils.isNotBlank(conversationRequest.getCarId())) {
             wrapper.eq(ChatgptSession::getCarId, conversationRequest.getCarId());
             wrapper.eq(ChatgptSession::getCarId, conversationRequest.getCarId());
         } else {
         } else {
-            ChatgptUser chatgptUser = chatgptUserMapper.selectOne(Wrappers.lambdaQuery(ChatgptUser.class).eq(ChatgptUser::getUserToken, userToken));
             if (chatgptUser.getSessionId() != null) {
             if (chatgptUser.getSessionId() != null) {
                 wrapper.eq(ChatgptSession::getId, chatgptUser.getSessionId());
                 wrapper.eq(ChatgptSession::getId, chatgptUser.getSessionId());
             }
             }
@@ -454,6 +468,24 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
         chatgptUserConversationRecord.setModel(conversationRequest.getModel());
         chatgptUserConversationRecord.setModel(conversationRequest.getModel());
         chatgptUserConversationRecordMapper.insert(chatgptUserConversationRecord);
         chatgptUserConversationRecordMapper.insert(chatgptUserConversationRecord);
 
 
+        if(!"text-davinci-002-render-sha".equals(conversationRequest.getModel())){
+            String key = RedisService.key.CHATGPT_CONVERSATION_LIMIT.getName() + ":" + userToken;
+            long currentTimeMillis = System.currentTimeMillis();
+
+            redisService.del();
+            if(redisService.hasKey("chatgpt:team:clears_in:" + chatgptSession.getCarId())){
+                redisService.del("chatgpt:team:clears_in:" + chatgptSession.getCarId());
+            }
+            if (redisService.hasKey("chatgpt:clears_in:" + chatgptSession.getCarId())) {
+                redisService.del("chatgpt:clears_in:" + chatgptSession.getCarId());
+            }
+
+            // 如果未超过限制,记录当前请求的时间戳
+            redisService.zAdd(key, currentTimeMillis, currentTimeMillis);
+            // 设置ZSet的过期时间,窗口大小加上一段冗余时间
+            redisService.expire(key, (chatgptUser.getLimitTime() * 60 * 60) + 20);
+        }
+
         if (StringUtils.isNotBlank(chatgptSession.getCarId())) {
         if (StringUtils.isNotBlank(chatgptSession.getCarId())) {
             updateExperienceAndScore(chatgptSession.getCarId(), !"text-davinci-002-render-sha".equals(conversationRequest.getModel()), System.currentTimeMillis());
             updateExperienceAndScore(chatgptSession.getCarId(), !"text-davinci-002-render-sha".equals(conversationRequest.getModel()), System.currentTimeMillis());
         }
         }
@@ -508,10 +540,6 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
             chatgptUserCarUsedRecordMapper.insert(chatgptUserCarUsedRecord);
             chatgptUserCarUsedRecordMapper.insert(chatgptUserCarUsedRecord);
             return conversationLimitResponse;
             return conversationLimitResponse;
         } else {
         } else {
-            // 如果未超过限制,记录当前请求的时间戳
-            redisService.zAdd(key, currentTimeMillis, currentTimeMillis);
-            // 设置ZSet的过期时间,窗口大小加上一段冗余时间
-            redisService.expire(key, (limitTime * 60 * 60) + 20);
             conversationLimitResponse.setLimited(false);
             conversationLimitResponse.setLimited(false);
             return conversationLimitResponse;
             return conversationLimitResponse;
         }
         }
@@ -791,7 +819,7 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
                     .expireTime(chatgptUser.getExpireTime())
                     .expireTime(chatgptUser.getExpireTime())
                     .limitNum(chatgptUser.getLimitNum())
                     .limitNum(chatgptUser.getLimitNum())
                     .limitTime(chatgptUser.getLimitTime())
                     .limitTime(chatgptUser.getLimitTime())
-                    .use(getConversationCount(chatgptUser.getUserToken(), chatgptUser.getLimitTime()))
+                    .use(Math.min(chatgptUser.getLimitNum(),getConversationCount(chatgptUser.getUserToken(), chatgptUser.getLimitTime())))
                     .build();
                     .build();
         } else {
         } else {
             throw BusinessRuntimeException.getInstance("您还未购买该车票");
             throw BusinessRuntimeException.getInstance("您还未购买该车票");

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpCustomerAcquisitionLinkServiceImpl.java

@@ -80,7 +80,7 @@ public class CorpCustomerAcquisitionLinkServiceImpl extends ServiceImpl<CorpCust
         wxCpLinkUpd.setSkipVerify(corpCustomerAcquisitionLink.getSkipVerify());
         wxCpLinkUpd.setSkipVerify(corpCustomerAcquisitionLink.getSkipVerify());
         Range range = new Range();
         Range range = new Range();
         String userList;
         String userList;
-        if (link.getIsDuty()) {
+        if (corpCustomerAcquisitionLink.getIsDuty()) {
             userList = corpCustomerAcquisitionLink.getChooseDutyUsers();
             userList = corpCustomerAcquisitionLink.getChooseDutyUsers();
         } else {
         } else {
             userList = corpCustomerAcquisitionLink.getUserList();
             userList = corpCustomerAcquisitionLink.getUserList();

+ 13 - 0
netflix-service/src/main/java/com/cyksj/service/distribute/DistributeExtraRebateService.java

@@ -0,0 +1,13 @@
+package com.cyksj.service.distribute;
+
+import com.cyksj.model.entity.DistributeExtraRebateConfig;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: DistributeExtraRebateService
+ * 创建者: JavaZou
+ * 创建时间:2024/5/29 15:24
+ */
+public interface DistributeExtraRebateService {
+	DistributeExtraRebateConfig getRandomExtraRebate();
+}

+ 38 - 39
netflix-service/src/main/java/com/cyksj/service/distribute/equipment/impl/EquipmentDistributeServiceImpl.java

@@ -92,10 +92,10 @@ public class EquipmentDistributeServiceImpl implements EquipmentDistributeServic
 			record.setUserId(userId);
 			record.setUserId(userId);
 			try {
 			try {
 				//发放新用户福利优惠券
 				//发放新用户福利优惠券
-				if (isNewUser) {
-					sendInvitedUserEquipmentCoupon(userId);
-					record.setIsNewUser(true);
-				}
+//				if (isNewUser) {
+//				sendInvitedUserEquipmentCoupon(userId);
+//				}
+				record.setIsNewUser(isNewUser);
 				inviteRecordMapper.insert(record);
 				inviteRecordMapper.insert(record);
 
 
 			} catch (DuplicateKeyException e) {
 			} catch (DuplicateKeyException e) {
@@ -135,48 +135,47 @@ public class EquipmentDistributeServiceImpl implements EquipmentDistributeServic
 	}
 	}
 
 
 	public void saveInviteRecord(Long sharId, Long userId, Long orderId, Integer type) {
 	public void saveInviteRecord(Long sharId, Long userId, Long orderId, Integer type) {
-		EquipmentConfigDto equipmentConfigDto = checkEquipmentConfigDto();
-		Integer benefitsType = 1;
-		if (equipmentConfigDto != null && type == 1) {
-			//配置车票权益
-			if (CollUtil.isNotEmpty(equipmentConfigDto.getSkuList())) {
-				addTicketBenefitsChance(sharId, userId, orderId, EquipmentUserChanceRecord.Status.hasPayment);
-			}
-
-			//已配置余额  实物发货 发送余额
-			if (equipmentConfigDto.getBalance() != null && equipmentConfigDto.getBalance().compareTo(BigDecimal.ZERO) > 0) {
-				addBalanceBenefits(sharId, orderId, equipmentConfigDto.getBalance(), EquipmentUserDistributeTransportBenefits.Status.hasPayment);
-				benefitsType = 2;
-			}
+//		EquipmentConfigDto equipmentConfigDto = checkEquipmentConfigDto();
+		Integer benefitsType = 0;
+		if (type == 1) {
+//			//配置车票权益
+//			if (CollUtil.isNotEmpty(equipmentConfigDto.getSkuList())) {
+//				addTicketBenefitsChance(sharId, userId, orderId, EquipmentUserChanceRecord.Status.hasPayment);
+//			}
+//
+//			//已配置余额  实物发货 发送余额
+//			if (equipmentConfigDto.getBalance() != null && equipmentConfigDto.getBalance().compareTo(BigDecimal.ZERO) > 0) {
+//				addBalanceBenefits(sharId, orderId, equipmentConfigDto.getBalance(), EquipmentUserDistributeTransportBenefits.Status.hasPayment);
+//				benefitsType = 2;
+//			}
 			EquipmentUserPayRecord record = new EquipmentUserPayRecord();
 			EquipmentUserPayRecord record = new EquipmentUserPayRecord();
 			record.setShareId(sharId);
 			record.setShareId(sharId);
 			record.setUserId(userId);
 			record.setUserId(userId);
 			record.setStatus(EquipmentUserPayRecord.Status.hasPayment);
 			record.setStatus(EquipmentUserPayRecord.Status.hasPayment);
 			record.setOrderId(orderId);
 			record.setOrderId(orderId);
-			//1、车票权益,2、余额
+			//0无类型  1、车票权益,2、余额
 			record.setType(benefitsType);
 			record.setType(benefitsType);
 			equipmentUserPayRecordMapper.insert(record);
 			equipmentUserPayRecordMapper.insert(record);
-		}
-		if (type == 2) {
-			//是否有余额权益
-			EquipmentUserDistributeTransportBenefits transportBenefits = transportBenefitsMapper.selectOne(Wrappers.lambdaQuery(EquipmentUserDistributeTransportBenefits.class)
-					.eq(EquipmentUserDistributeTransportBenefits::getOrderId, orderId).last("limit 1"));
-			if (transportBenefits != null && transportBenefits.getStatus() != EquipmentUserDistributeTransportBenefits.Status.complete) {
-				transportBenefits.setStatus(EquipmentUserDistributeTransportBenefits.Status.refund);
-				transportBenefitsMapper.updateById(transportBenefits);
-			}
-			//是否有车票权益
-			int update = equipmentUserChanceRecordMapper.update(null, Wrappers.lambdaUpdate(EquipmentUserChanceRecord.class)
-					.set(EquipmentUserChanceRecord::getStatus, EquipmentUserChanceRecord.Status.refund)
-					.eq(EquipmentUserChanceRecord::getOrderId, orderId)
-					.eq(EquipmentUserChanceRecord::getStatus, EquipmentUserChanceRecord.Status.hasPayment));
-			if (update > 0) {
-				update = equipmentUserChanceMapper.subUserChance(sharId);
-				if (update == 0) {
-					//扣除权益
-					deductUserBenefits(sharId, orderId);
-				}
-			}
+		} else if (type == 2) {
+//			//是否有余额权益
+//			EquipmentUserDistributeTransportBenefits transportBenefits = transportBenefitsMapper.selectOne(Wrappers.lambdaQuery(EquipmentUserDistributeTransportBenefits.class)
+//					.eq(EquipmentUserDistributeTransportBenefits::getOrderId, orderId).last("limit 1"));
+//			if (transportBenefits != null && transportBenefits.getStatus() != EquipmentUserDistributeTransportBenefits.Status.complete) {
+//				transportBenefits.setStatus(EquipmentUserDistributeTransportBenefits.Status.refund);
+//				transportBenefitsMapper.updateById(transportBenefits);
+//			}
+//			//是否有车票权益
+//			int update = equipmentUserChanceRecordMapper.update(null, Wrappers.lambdaUpdate(EquipmentUserChanceRecord.class)
+//					.set(EquipmentUserChanceRecord::getStatus, EquipmentUserChanceRecord.Status.refund)
+//					.eq(EquipmentUserChanceRecord::getOrderId, orderId)
+//					.eq(EquipmentUserChanceRecord::getStatus, EquipmentUserChanceRecord.Status.hasPayment));
+//			if (update > 0) {
+//				update = equipmentUserChanceMapper.subUserChance(sharId);
+//				if (update == 0) {
+//					//扣除权益
+//					deductUserBenefits(sharId, orderId);
+//				}
+//			}
 			equipmentUserPayRecordMapper.update(null, Wrappers.lambdaUpdate(EquipmentUserPayRecord.class)
 			equipmentUserPayRecordMapper.update(null, Wrappers.lambdaUpdate(EquipmentUserPayRecord.class)
 					.set(EquipmentUserPayRecord::getStatus, EquipmentUserPayRecord.Status.refund)
 					.set(EquipmentUserPayRecord::getStatus, EquipmentUserPayRecord.Status.refund)
 					.eq(EquipmentUserPayRecord::getOrderId, orderId)
 					.eq(EquipmentUserPayRecord::getOrderId, orderId)

+ 76 - 0
netflix-service/src/main/java/com/cyksj/service/distribute/impl/DistributeExtraRebateServiceImpl.java

@@ -0,0 +1,76 @@
+package com.cyksj.service.distribute.impl;
+
+import com.cyksj.mapper.manage.distribute.DistributeExtraRebateConfigMapper;
+import com.cyksj.model.entity.DistributeExtraRebateConfig;
+import com.cyksj.service.distribute.DistributeExtraRebateService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.concurrent.ThreadLocalRandom;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: DistributeExtraRebateServiceImpl
+ * 创建者: JavaZou
+ * 创建时间:2024/5/29 15:24
+ */
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class DistributeExtraRebateServiceImpl implements DistributeExtraRebateService {
+	private final DistributeExtraRebateConfigMapper distributeExtraRebateConfigMapper;
+
+	private static BigDecimal sums =  new BigDecimal(0);
+
+	private static List<DistributeExtraRebateConfig> distributeExtraRebateConfigs = null;
+
+	@PostConstruct
+	public void initConfig() {
+		distributeExtraRebateConfigs = distributeExtraRebateConfigMapper.selectList(null);
+
+		distributeExtraRebateConfigs.forEach(e->{
+			sums = sums.add(e.getRate());
+		});
+	}
+
+	@Override
+	public DistributeExtraRebateConfig getRandomExtraRebate() {
+		if (distributeExtraRebateConfigs == null) {
+			return null;
+		}
+		int i = randomProbabilityIndex(distributeExtraRebateConfigs);
+		if (i == -1) {
+			log.info("普通分销 推广奖励倍数异常..");
+			return null;
+		}
+		return distributeExtraRebateConfigs.get(i);
+	}
+
+	public int randomProbabilityIndex(List<DistributeExtraRebateConfig> list) {
+		int random = -1;
+		//总权重
+		Double totalProbability = sums.doubleValue();
+		//产生随机数
+		Double randomNumber = ThreadLocalRandom.current().nextDouble();
+		//根据随机数在所有奖品分布的区域并确定所抽奖品
+		Double d1 = 0d;
+		Double d2 = 0d;
+		for (int i = 0; i < list.size(); i++) {
+			d2 += Double.parseDouble(String.valueOf(list.get(i).getRate())) / totalProbability;
+			if (i == 0) {
+				d1 = 0d;
+			} else {
+				d1 += Double.parseDouble(String.valueOf(list.get(i - 1).getRate())) / totalProbability;
+			}
+			if (randomNumber >= d1 && randomNumber < d2) {
+				random = i;
+				break;
+			}
+		}
+		return random;
+	}
+}

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mail/CuiQiuMailService.java

@@ -11,5 +11,5 @@ public interface CuiQiuMailService {
 	/**
 	/**
 	 * 获取最新邮箱 返回验证码
 	 * 获取最新邮箱 返回验证码
 	 */
 	 */
-	String getVerifyCode(String email) throws Exception;
+	String getVerifyCode(String email, Long goodsId) throws Exception;
 }
 }

+ 20 - 10
netflix-service/src/main/java/com/cyksj/service/mail/impl/CuiQiuMailServiceImpl.java

@@ -9,6 +9,7 @@ import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.http.HttpUtil;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.StringUtil;
 import com.cyksj.common.util.StringUtil;
+import com.cyksj.common.util.TicketCodeCommonUtil;
 import com.cyksj.model.dto.CuiQiuEmailDetailDto;
 import com.cyksj.model.dto.CuiQiuEmailDetailDto;
 import com.cyksj.model.dto.CuiQiuEmailDto;
 import com.cyksj.model.dto.CuiQiuEmailDto;
 import com.cyksj.model.dto.CuiQiuEmailResultDto;
 import com.cyksj.model.dto.CuiQiuEmailResultDto;
@@ -41,8 +42,10 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 	//PS 验证码官方
 	//PS 验证码官方
 	private final static String PS_ADOBE = "Adobe";
 	private final static String PS_ADOBE = "Adobe";
 
 
+	private final static String DISNEY = "Disney+";
+
 	@Override
 	@Override
-	public String getVerifyCode(String email) throws Exception {
+	public String getVerifyCode(String email, Long goodsId) throws Exception {
 		//获取近二十封邮件
 		//获取近二十封邮件
 		String url = "https://domain-open-api.cuiqiu.com/v1/message/list";
 		String url = "https://domain-open-api.cuiqiu.com/v1/message/list";
 
 
@@ -67,8 +70,15 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 		list = list.stream().filter(emailInfo -> {
 		list = list.stream().filter(emailInfo -> {
 			CuiQiuEmailDto.CuiQiuUser from = emailInfo.getFrom().get(0);
 			CuiQiuEmailDto.CuiQiuUser from = emailInfo.getFrom().get(0);
 			CuiQiuEmailDto.CuiQiuUser cuiQiuUser = emailInfo.getTo().get(0);
 			CuiQiuEmailDto.CuiQiuUser cuiQiuUser = emailInfo.getTo().get(0);
-			if (StrUtil.equals(from.getName(), PS_ADOBE) && StrUtil.equals(cuiQiuUser.getAddress(), email)) {
-				return true;
+			if (StrUtil.equalsIgnoreCase(cuiQiuUser.getAddress(), email)) {
+				//PS
+				if (goodsId == 33l && StrUtil.equals(from.getName(), PS_ADOBE)) {
+					return true;
+				}
+				//Disney
+				if (goodsId == 3l && StrUtil.equals(from.getName(), DISNEY)) {
+					return true;
+				}
 			}
 			}
 			return false;
 			return false;
 		}).collect(Collectors.toList());
 		}).collect(Collectors.toList());
@@ -77,7 +87,7 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 			for (CuiQiuEmailDto cuiQiuEmailDto : list) {
 			for (CuiQiuEmailDto cuiQiuEmailDto : list) {
 				Long messageId = cuiQiuEmailDto.getId();
 				Long messageId = cuiQiuEmailDto.getId();
 				try {
 				try {
-					String code = getVerifyCodeByEmail(messageId);
+					String code = getVerifyCodeByEmail(messageId, goodsId);
 					if (StrUtil.isNotBlank(code)) {
 					if (StrUtil.isNotBlank(code)) {
 						return code;
 						return code;
 					}
 					}
@@ -88,7 +98,7 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 		return null;
 		return null;
 	}
 	}
 
 
-	public String getVerifyCodeByEmail(Long messageId) throws Exception {
+	public String getVerifyCodeByEmail(Long messageId, Long goodsId) throws Exception {
 		String url = "https://domain-open-api.cuiqiu.com/v1/message/detail";
 		String url = "https://domain-open-api.cuiqiu.com/v1/message/detail";
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 		params.put("token", CUI_QIU_TOKEN);
 		params.put("token", CUI_QIU_TOKEN);
@@ -102,11 +112,11 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 		CuiQiuEmailDetailDto.Content content = cuiQiuEmailDetailDto.getData().getContent();
 		CuiQiuEmailDetailDto.Content content = cuiQiuEmailDetailDto.getData().getContent();
 
 
 		String contentBody = content.getBody();
 		String contentBody = content.getBody();
-		String str = "color:#505050; font-family:adobe-clean, Helvetica Neue, Helvetica, Verdana, Arial, sans-serif;";
-		String code = StrUtil.subWithLength(contentBody, contentBody.indexOf(str), 512);
-		if (StrUtil.isNotBlank(code)) {
-			code = code.replace(str, "");
+		String code = TicketCodeCommonUtil.getTicketCodeStr(contentBody, goodsId);
+		int length = 4;
+		if (goodsId == 33l) {
+			length = 6;
 		}
 		}
-		return StringUtil.getVerifyCodePattern(code);
+		return StringUtil.getVerifyCodePattern(code, length);
 	}
 	}
 }
 }

+ 9 - 0
netflix-service/src/main/java/com/cyksj/service/mange/goods/CmsYhShopCommonServiceImpl.java

@@ -12,6 +12,7 @@ import com.cyksj.mapper.shop.*;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.request.DistributeApplyMoneyReq;
 import com.cyksj.model.request.DistributeApplyMoneyReq;
 import com.cyksj.model.request.YhShopVerifyReq;
 import com.cyksj.model.request.YhShopVerifyReq;
+import com.cyksj.redis.RedisService;
 import com.cyksj.service.mange.CmsYhShopCommonService;
 import com.cyksj.service.mange.CmsYhShopCommonService;
 import com.cyksj.service.mange.business.UserBusinessRateService;
 import com.cyksj.service.mange.business.UserBusinessRateService;
 import com.cyksj.service.shop.YhShopUserPlatDistributeRateService;
 import com.cyksj.service.shop.YhShopUserPlatDistributeRateService;
@@ -55,6 +56,8 @@ public class CmsYhShopCommonServiceImpl implements CmsYhShopCommonService {
 
 
 	private final YhShopUserPlatDistributeRateMapper yhShopUserPlatDistributeRateMapper;
 	private final YhShopUserPlatDistributeRateMapper yhShopUserPlatDistributeRateMapper;
 
 
+	private final RedisService redisService;
+
 	@Override
 	@Override
 	@Transactional(rollbackFor = Throwable.class)
 	@Transactional(rollbackFor = Throwable.class)
 	public void verifyYhShopApply(YhShopVerifyReq verifyReq) {
 	public void verifyYhShopApply(YhShopVerifyReq verifyReq) {
@@ -193,6 +196,12 @@ public class CmsYhShopCommonServiceImpl implements CmsYhShopCommonService {
 			distributeMoneyApply.setImg(distributeApplyMoneyReq.getImg());
 			distributeMoneyApply.setImg(distributeApplyMoneyReq.getImg());
 		}
 		}
 		yhShopDistributeMoneyApplyMapper.updateById(distributeMoneyApply);
 		yhShopDistributeMoneyApplyMapper.updateById(distributeMoneyApply);
+
+		if (distributeMoneyApply.getVerifyStatus() == YhShopDistributeMoneyApply.Status.fail) {
+			String type = "shop";
+			String key = String.format(RedisService.key.APPLY_MONEY_DAY_LIMIT_KEY.getName(), DateTime.now().toDateStr(), type, distributeMoneyApply.getUserId());
+			redisService.del(key);
+		}
 	}
 	}
 
 
 	@Override
 	@Override

+ 21 - 17
netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java

@@ -861,11 +861,11 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
 
 
             try {
             try {
                 marketFrontService.subSpecificChanceNum(orderDon.getUserId(), orderDon.getId(), orderDon.getGoodsId(), orderDon.getUpdateTime());
                 marketFrontService.subSpecificChanceNum(orderDon.getUserId(), orderDon.getId(), orderDon.getGoodsId(), orderDon.getUpdateTime());
-//                if (goodsDon.getType() == 2) {
-//                    equipmentDistributeService.subDistributeBenefitsChance(orderDon.getUserId(), orderDon.getId());
-//                    //扣除用户自身实物权益
-//                    userRealOrderBenefitsService.deductUserRealGoodsBenefits(orderDon.getId());
-//                }
+                if (goodsDon.getType() == 2 && !orderDon.getIsDistribute()) {
+                    equipmentDistributeService.subDistributeBenefitsChance(orderDon.getUserId(), orderDon.getId());
+                    //扣除用户自身实物权益
+                    userRealOrderBenefitsService.deductUserRealGoodsBenefits(orderDon.getId());
+                }
             } catch (Exception e) {
             } catch (Exception e) {
                 log.error("wx减少抽奖机会错误,orderId:{},error:{}", orderDon.getId(), e);
                 log.error("wx减少抽奖机会错误,orderId:{},error:{}", orderDon.getId(), e);
             }
             }
@@ -1038,16 +1038,18 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
                         thisGoodsRate = Optional.ofNullable(userDistributeMapper.getDistributeGoodsRateByUidAndGid(orderDon.getUserId(), orderDon.getGoodsId())).orElse(0);
                         thisGoodsRate = Optional.ofNullable(userDistributeMapper.getDistributeGoodsRateByUidAndGid(orderDon.getUserId(), orderDon.getGoodsId())).orElse(0);
                     }
                     }
                     if (thisGoodsRate > 0) {
                     if (thisGoodsRate > 0) {
-                        BigDecimal needSubPoints = refundMoney.multiply(BigDecimal.valueOf(thisGoodsRate).divide(BigDecimal.valueOf(100))).multiply(BigDecimal.valueOf(10));
-                        if (needSubPoints.compareTo(points) > 0) {
-                            //全扣除
-                            distributeWaitingSendPoints.setSendStatus(DistributeWaitingSendPoints.Status.close);
-                            needSubPoints = points;
-                        }
+                        BigDecimal refundRate = refundMoney.divide(money, 2, RoundingMode.DOWN);
+                        //退掉比例的提成
+                        BigDecimal needSubPoints = points.multiply(refundRate);
                         distributeWaitingSendPoints.setRefundPoints(needSubPoints);
                         distributeWaitingSendPoints.setRefundPoints(needSubPoints);
                         //剩余积分
                         //剩余积分
                         BigDecimal remainPoints = points.subtract(needSubPoints);
                         BigDecimal remainPoints = points.subtract(needSubPoints);
                         distributeWaitingSendPoints.setPoints(remainPoints);
                         distributeWaitingSendPoints.setPoints(remainPoints);
+                        //原先获取积分也扣除
+                        if (distributeWaitingSendPoints.getOriPoints().compareTo(BigDecimal.ZERO) > 0) {
+                            BigDecimal oriNeedSubPoints = distributeWaitingSendPoints.getOriPoints().multiply(refundRate);
+                            distributeWaitingSendPoints.setOriPoints(distributeWaitingSendPoints.getOriPoints().subtract(oriNeedSubPoints));
+                        }
                         distributeWaitingSendPointsMapper.updateById(distributeWaitingSendPoints);
                         distributeWaitingSendPointsMapper.updateById(distributeWaitingSendPoints);
                     }
                     }
                 } else if (sendStatus == DistributeWaitingSendPoints.Status.success) {
                 } else if (sendStatus == DistributeWaitingSendPoints.Status.success) {
@@ -1067,16 +1069,18 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
                         thisGoodsRate = Optional.ofNullable(userDistributeMapper.getDistributeGoodsRateByUidAndGid(orderDon.getUserId(), orderDon.getGoodsId())).orElse(0);
                         thisGoodsRate = Optional.ofNullable(userDistributeMapper.getDistributeGoodsRateByUidAndGid(orderDon.getUserId(), orderDon.getGoodsId())).orElse(0);
                     }
                     }
                     if (thisGoodsRate > 0) {
                     if (thisGoodsRate > 0) {
-                        BigDecimal needSubPoints = refundMoney.multiply(BigDecimal.valueOf(thisGoodsRate).divide(BigDecimal.valueOf(100))).multiply(BigDecimal.valueOf(10));
-                        if (needSubPoints.compareTo(points) > 0) {
-                            //全扣除
-                            distributeWaitingSendPoints.setSendStatus(DistributeWaitingSendPoints.Status.close);
-                            needSubPoints = points;
-                        }
+                        BigDecimal refundRate = refundMoney.divide(money, 2, RoundingMode.DOWN);
+                        //退掉比例的提成
+                        BigDecimal needSubPoints = points.multiply(refundRate);
                         userBenefitsService.deductDistributePoints(orderDon.getId(), distributeWaitingSendPoints.getSharedId(), needSubPoints);
                         userBenefitsService.deductDistributePoints(orderDon.getId(), distributeWaitingSendPoints.getSharedId(), needSubPoints);
                         //部分退款
                         //部分退款
                         distributeWaitingSendPoints.setRefundPoints(needSubPoints);
                         distributeWaitingSendPoints.setRefundPoints(needSubPoints);
                         distributeWaitingSendPoints.setPoints(points.subtract(needSubPoints));
                         distributeWaitingSendPoints.setPoints(points.subtract(needSubPoints));
+                        //原先获取积分也扣除
+                        if (distributeWaitingSendPoints.getOriPoints().compareTo(BigDecimal.ZERO) > 0) {
+                            BigDecimal oriNeedSubPoints = distributeWaitingSendPoints.getOriPoints().multiply(refundRate);
+                            distributeWaitingSendPoints.setOriPoints(distributeWaitingSendPoints.getOriPoints().subtract(oriNeedSubPoints));
+                        }
                         distributeWaitingSendPointsMapper.updateById(distributeWaitingSendPoints);
                         distributeWaitingSendPointsMapper.updateById(distributeWaitingSendPoints);
                     }
                     }
 
 

+ 0 - 3
netflix-service/src/main/java/com/cyksj/service/midjourney/MidjourneyAccountService.java

@@ -1,12 +1,9 @@
 package com.cyksj.service.midjourney;
 package com.cyksj.service.midjourney;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.cyksj.model.entity.Account;
 import com.cyksj.model.entity.MidjourneyAccount;
 import com.cyksj.model.entity.MidjourneyAccount;
 import com.cyksj.model.entity.MidjourneyUser;
 import com.cyksj.model.entity.MidjourneyUser;
 
 
-import java.util.List;
-
 /**
 /**
  * @author zwhui
  * @author zwhui
  * @date 2024/4/12 15:54
  * @date 2024/4/12 15:54

+ 14 - 0
netflix-service/src/main/java/com/cyksj/service/midjourney/MidjourneyPaintingPlazaService.java

@@ -0,0 +1,14 @@
+package com.cyksj.service.midjourney;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cyksj.model.entity.MidjourneyPaintingPlaza;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: MidjourneyPaintingPlazaService
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 17:32
+ */
+public interface MidjourneyPaintingPlazaService extends IService<MidjourneyPaintingPlaza> {
+	void saveOrUpdatePainting(MidjourneyPaintingPlaza midjourneyPaintingPlaza);
+}

+ 10 - 2
netflix-service/src/main/java/com/cyksj/service/midjourney/impl/MidJourneyAccountServiceImpl.java

@@ -248,8 +248,15 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
         midjourneyUser.setImg(getWxImg(user.getHeadimgurl(), user));
         midjourneyUser.setImg(getWxImg(user.getHeadimgurl(), user));
         midjourneyUser.setRelationId(groupsRelation.getId());
         midjourneyUser.setRelationId(groupsRelation.getId());
         midjourneyUser.setUserToken(UUID.randomUUID().toString());
         midjourneyUser.setUserToken(UUID.randomUUID().toString());
-        midjourneyUser.setMjFastNum(goodsDonSku.getMjFastNum());
-        midjourneyUser.setMjRelaxNum((goodsDonSku.getMjRelaxNum() == null || goodsDonSku.getMjRelaxNum() == 0) ? null : goodsDonSku.getMjRelaxNum());
+        if (groupsRelation.getAqType() == 2) {
+            //fast模式 5次
+            midjourneyUser.setMjFastNum(5);
+            midjourneyUser.setMjRelaxNum(0);
+        } else {
+            midjourneyUser.setMjFastNum(goodsDonSku.getMjFastNum());
+            midjourneyUser.setMjRelaxNum((goodsDonSku.getMjRelaxNum() == null || goodsDonSku.getMjRelaxNum() == 0) ? null : goodsDonSku.getMjRelaxNum());
+        }
+        midjourneyUser.setAqType(groupsRelation.getAqType());
         midjourneyUserMapper.insert(midjourneyUser);
         midjourneyUserMapper.insert(midjourneyUser);
         redisService.set(RedisService.key.MIDJOURNEY_FAST_LIMIT.getName() + midjourneyUser.getId(), midjourneyUser.getMjFastNum(),RedisService.key.MIDJOURNEY_FAST_LIMIT.getTimeout());
         redisService.set(RedisService.key.MIDJOURNEY_FAST_LIMIT.getName() + midjourneyUser.getId(), midjourneyUser.getMjFastNum(),RedisService.key.MIDJOURNEY_FAST_LIMIT.getTimeout());
         redisService.set(RedisService.key.MIDJOURNEY_USER.getName() + midjourneyUser.getUserToken(), midjourneyUser,RedisService.key.MIDJOURNEY_USER.getTimeout());
         redisService.set(RedisService.key.MIDJOURNEY_USER.getName() + midjourneyUser.getUserToken(), midjourneyUser,RedisService.key.MIDJOURNEY_USER.getTimeout());
@@ -264,6 +271,7 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
         midjourneyUser.setImg(getWxImg(user.getHeadimgurl(), user));
         midjourneyUser.setImg(getWxImg(user.getHeadimgurl(), user));
         midjourneyUser.setExpireTime(groupsRelation.getExpiryTime());
         midjourneyUser.setExpireTime(groupsRelation.getExpiryTime());
         midjourneyUserMapper.updateById(midjourneyUser);
         midjourneyUserMapper.updateById(midjourneyUser);
+        midjourneyUser.setAqType(groupsRelation.getAqType());
         redisService.set(RedisService.key.MIDJOURNEY_USER.getName() + midjourneyUser.getUserToken(), midjourneyUser,RedisService.key.MIDJOURNEY_USER.getTimeout());
         redisService.set(RedisService.key.MIDJOURNEY_USER.getName() + midjourneyUser.getUserToken(), midjourneyUser,RedisService.key.MIDJOURNEY_USER.getTimeout());
     }
     }
 
 

+ 33 - 0
netflix-service/src/main/java/com/cyksj/service/midjourney/impl/MidjourneyPaintingPlazaServiceImpl.java

@@ -0,0 +1,33 @@
+package com.cyksj.service.midjourney.impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.mapper.MidjourneyPaintingPlazaMapper;
+import com.cyksj.model.entity.MidjourneyPaintingPlaza;
+import com.cyksj.service.midjourney.MidjourneyPaintingPlazaService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: MidjourneyPaintingPlazaServiceImpl
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 17:32
+ */
+@Service
+@RequiredArgsConstructor
+public class MidjourneyPaintingPlazaServiceImpl extends ServiceImpl<MidjourneyPaintingPlazaMapper, MidjourneyPaintingPlaza> implements MidjourneyPaintingPlazaService {
+	@Override
+	public void saveOrUpdatePainting(MidjourneyPaintingPlaza midjourneyPaintingPlaza) {
+		String tips = midjourneyPaintingPlaza.getTips();
+		if (StrUtil.isEmpty(tips)) {
+			throw BusinessRuntimeException.getInstance("请输入对应的关键词");
+		}
+		String img = midjourneyPaintingPlaza.getImg();
+		if (StrUtil.isEmpty(img)) {
+			throw BusinessRuntimeException.getInstance("图片不为空");
+		}
+		this.saveOrUpdate(midjourneyPaintingPlaza);
+	}
+}

+ 58 - 6
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -70,6 +70,7 @@ import com.cyksj.model.views.*;
 import com.cyksj.redis.RedisService;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.corp.WxCorpOps;
 import com.cyksj.service.corp.WxCorpOps;
 import com.cyksj.service.coupon.CouponFontService;
 import com.cyksj.service.coupon.CouponFontService;
+import com.cyksj.service.distribute.DistributeExtraRebateService;
 import com.cyksj.service.distribute.UserBusinessFrontService;
 import com.cyksj.service.distribute.UserBusinessFrontService;
 import com.cyksj.service.distribute.equipment.EquipmentDistributeService;
 import com.cyksj.service.distribute.equipment.EquipmentDistributeService;
 import com.cyksj.service.exchange.ExchangeCodeService;
 import com.cyksj.service.exchange.ExchangeCodeService;
@@ -302,6 +303,10 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 
 
 	private final MidjourneyUserMapper midjourneyUserMapper;
 	private final MidjourneyUserMapper midjourneyUserMapper;
 
 
+	private final DistributeExtraRebateService distributeExtraRebateService;
+
+	private final UserTrialTicketJumpPayRecordMapper userTrialTicketJumpPayRecordMapper;
+
 	private final List<String> noChekGoodsTemp = List.of("Apple One", "Youtube", "Spotify");
 	private final List<String> noChekGoodsTemp = List.of("Apple One", "Youtube", "Spotify");
 
 
 	@Transactional(rollbackFor = Throwable.class)
 	@Transactional(rollbackFor = Throwable.class)
@@ -614,6 +619,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		recordOrderDonLocationRelate(orderDon.getId(), payRequest.getIp());
 		recordOrderDonLocationRelate(orderDon.getId(), payRequest.getIp());
 		//记录补贴订单关联
 		//记录补贴订单关联
 		recordOrderDonSubsidyRelate(orderDon.getId(), subsidyId);
 		recordOrderDonSubsidyRelate(orderDon.getId(), subsidyId);
+		//试用车票跳转记录
+		recordOrderTrialTicketJumpPay(payRequest.getIsTrial(),orderDon.getId());
 		return orderDon;
 		return orderDon;
 	}
 	}
 
 
@@ -1078,7 +1085,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		String transactionId = params.get("trade_no");
 		String transactionId = params.get("trade_no");
 		String payTimeStr = params.get("gmt_payment");
 		String payTimeStr = params.get("gmt_payment");
 		//买家支付宝账号
 		//买家支付宝账号
-		String buyerId = params.get("buyer_id");
+		String buyerId = Optional.ofNullable(params.get("buyer_id")).orElse(params.get("buyer_open_id"));
 		log.info("支付宝回调信息:{}", Jsons.toJson(params));
 		log.info("支付宝回调信息:{}", Jsons.toJson(params));
 		if (!orderDon.getStatus().equals(OrderDon.Status.noPayment) && !orderDon.getStatus().equals(OrderDon.Status.close)) {
 		if (!orderDon.getStatus().equals(OrderDon.Status.noPayment) && !orderDon.getStatus().equals(OrderDon.Status.close)) {
 			log.info("支付宝已回调,重复修改状态 id:{}", orderDon.getId());
 			log.info("支付宝已回调,重复修改状态 id:{}", orderDon.getId());
@@ -1102,7 +1109,6 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		orderDon.setPayTime(payTime);
 		orderDon.setPayTime(payTime);
 		orderDon.setShopId(appId);
 		orderDon.setShopId(appId);
 		orderDon.setType(OrderDon.Type.ALI_PAY);
 		orderDon.setType(OrderDon.Type.ALI_PAY);
-
 		orderDon.setBuyerId(buyerId);
 		orderDon.setBuyerId(buyerId);
 		//该支付账号id 是否被后台拉黑
 		//该支付账号id 是否被后台拉黑
 		Integer count1 = userPayOrderBlockMapper.selectCount(Wrappers.lambdaQuery(UserPayOrderBlock.class)
 		Integer count1 = userPayOrderBlockMapper.selectCount(Wrappers.lambdaQuery(UserPayOrderBlock.class)
@@ -1605,6 +1611,34 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 					distributeWaitingSendPoints.setSendStatus(DistributeWaitingSendPoints.Status.waiting);
 					distributeWaitingSendPoints.setSendStatus(DistributeWaitingSendPoints.Status.waiting);
 					distributeWaitingSendPoints.setSendTime(DateUtil.offsetDay(order.getPayTime(), 3));
 					distributeWaitingSendPoints.setSendTime(DateUtil.offsetDay(order.getPayTime(), 3));
 					distributeWaitingSendPoints.setRate(rate);
 					distributeWaitingSendPoints.setRate(rate);
+					//普通分销 额外返利
+					if (userDistribute == null && points.compareTo(BigDecimal.ZERO) > 0) {
+						distributeWaitingSendPoints.setOriPoints(points);
+						if (goodsDonSku == null) {
+							goodsDonSku = goodsDonSkuMapper.selectById(order.getSkuId());
+						}
+						if (goodsDonSku.getIsMirror()) {
+							//镜像规格 默认百分之20 提成
+							distributeWaitingSendPoints.setRate(20);
+							//最新返利积分
+							BigDecimal newReturnMoney = orderMoney.multiply(BigDecimal.valueOf(distributeWaitingSendPoints.getRate())).divide(BigDecimal.valueOf(100));
+							points = newReturnMoney.multiply(BigDecimal.valueOf(distributePointsExchangeMoney.getPoints())).divide(distributePointsExchangeMoney.getMoney(), 2, RoundingMode.HALF_DOWN);
+							distributeWaitingSendPoints.setPoints(points);
+						} else {
+							DistributeExtraRebateConfig distributeExtraRebateConfig = distributeExtraRebateService.getRandomExtraRebate();
+							if (distributeExtraRebateConfig != null) {
+								BigDecimal multiple = distributeExtraRebateConfig.getMultiple();
+								if (multiple.compareTo(BigDecimal.ONE) > 0) {
+									//最终奖励
+									BigDecimal finalPoints = points.multiply(multiple);
+									distributeWaitingSendPoints.setPoints(finalPoints);
+
+									distributeWaitingSendPoints.setExtraMultiple(multiple);
+									distributeWaitingSendPoints.setExtraRebate(finalPoints.subtract(points));
+								}
+							}
+						}
+					}
 					distributeWaitingSendPointsMapper.insert(distributeWaitingSendPoints);
 					distributeWaitingSendPointsMapper.insert(distributeWaitingSendPoints);
 					//暂定虚物 商务可首单提成
 					//暂定虚物 商务可首单提成
 					if (businessId != null) {
 					if (businessId != null) {
@@ -1968,6 +2002,11 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 					if ("TRADE_SUCCESS".equals(tradeStatus)) {
 					if ("TRADE_SUCCESS".equals(tradeStatus)) {
 						orderDon.setStatus(goodsDon.getType() == 1 && goodsDon.getSecondType() == 2 ? OrderDon.Status.complete : OrderDon.Status.hasPayment);
 						orderDon.setStatus(goodsDon.getType() == 1 && goodsDon.getSecondType() == 2 ? OrderDon.Status.complete : OrderDon.Status.hasPayment);
 						orderDon.setTransactionId(zfbOrderDetail.getTradeNo());
 						orderDon.setTransactionId(zfbOrderDetail.getTradeNo());
+						Date sendPayDate = zfbOrderDetail.getSendPayDate();
+						orderDon.setPayTime(sendPayDate);
+						//买家支付宝账号
+						String buyerId = Optional.ofNullable(zfbOrderDetail.getBuyerUserId()).orElse(zfbOrderDetail.getBuyerOpenId());
+						orderDon.setBuyerId(buyerId);
 						return updateNoPayment(orderDon, goodsDon);
 						return updateNoPayment(orderDon, goodsDon);
 					}
 					}
 				}
 				}
@@ -2375,9 +2414,10 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 				}
 				}
 				//配置了特定奖池,增加抽奖机会
 				//配置了特定奖池,增加抽奖机会
 				marketFrontService.addSpecificChanceNum(orderDon.getUserId(), orderDon.getId(), orderDon.getGoodsId(), orderDon.getSkuId());
 				marketFrontService.addSpecificChanceNum(orderDon.getUserId(), orderDon.getId(), orderDon.getGoodsId(), orderDon.getSkuId());
-//				if (goodsDon.getType() == 2) {
-//					equipmentDistributeService.addDistributeBenefitsChance(orderDon.getUserId(), orderDon.getId());
-//				}
+				//非分销订单
+				if (goodsDon.getType() == 2 && !orderDon.getIsDistribute()) {
+					equipmentDistributeService.addDistributeBenefitsChance(orderDon.getUserId(), orderDon.getId());
+				}
 				//若该订单使用了规定推广者的兑换码 增加上下级关系
 				//若该订单使用了规定推广者的兑换码 增加上下级关系
 				if (StrUtil.isNotBlank(orderDon.getCouponExCode())) {
 				if (StrUtil.isNotBlank(orderDon.getCouponExCode())) {
 					addDistributeCouponCode(orderDon.getUserId(), orderDon.getCouponExCode());
 					addDistributeCouponCode(orderDon.getUserId(), orderDon.getCouponExCode());
@@ -3216,6 +3256,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			upgradeOrderDon.setPrice(upgradePackage.getPrice());
 			upgradeOrderDon.setPrice(upgradePackage.getPrice());
 			upgradeOrderDon.setNum(upgradePackage.getNum());
 			upgradeOrderDon.setNum(upgradePackage.getNum());
 			upgradeOrderDon.setGoodsId(goodsDonSku.getGoodsId());
 			upgradeOrderDon.setGoodsId(goodsDonSku.getGoodsId());
+			upgradeOrderDon.setSkuId(goodsDonSku.getId());
 			upgradeOrderDon.setMoney(payRequest.getDonMoney());
 			upgradeOrderDon.setMoney(payRequest.getDonMoney());
 			upgradeOrderDon.setStatus(UpgradeOrderDon.Status.noPayment);
 			upgradeOrderDon.setStatus(UpgradeOrderDon.Status.noPayment);
 			upgradeOrderDon.setType(UpgradeOrderDon.Type.ALI_PAY);
 			upgradeOrderDon.setType(UpgradeOrderDon.Type.ALI_PAY);
@@ -3311,7 +3352,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		String transactionId = params.get("trade_no");
 		String transactionId = params.get("trade_no");
 		String payTimeStr = params.get("gmt_payment");
 		String payTimeStr = params.get("gmt_payment");
 		//买家支付宝账号
 		//买家支付宝账号
-		String buyerId = params.get("buyer_id");
+		String buyerId = Optional.ofNullable(params.get("buyer_id")).orElse(params.get("buyer_open_id"));
 		log.info("支付宝回调信息:{}", Jsons.toJson(params));
 		log.info("支付宝回调信息:{}", Jsons.toJson(params));
 		if (!orderDon.getStatus().equals(UpgradeOrderDon.Status.noPayment) && !orderDon.getStatus().equals(UpgradeOrderDon.Status.close)) {
 		if (!orderDon.getStatus().equals(UpgradeOrderDon.Status.noPayment) && !orderDon.getStatus().equals(UpgradeOrderDon.Status.close)) {
 			log.info("支付宝已回调,重复修改状态 id:{}", orderDon.getId());
 			log.info("支付宝已回调,重复修改状态 id:{}", orderDon.getId());
@@ -3469,4 +3510,15 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			}
 			}
         return beanSearcher.searchFirst(UpgradeOrderDetailView.class, builder.build());
         return beanSearcher.searchFirst(UpgradeOrderDetailView.class, builder.build());
 	}
 	}
+
+	/**
+	 * 试用车票跳转购买正式车票订单记录
+	 */
+	public void recordOrderTrialTicketJumpPay(Boolean isTrial, Long orderId) {
+		if (isTrial != null && isTrial) {
+			UserTrialTicketJumpPayRecord userTrialTicketJumpPayRecord = new UserTrialTicketJumpPayRecord();
+			userTrialTicketJumpPayRecord.setOrderId(orderId);
+			userTrialTicketJumpPayRecordMapper.insert(userTrialTicketJumpPayRecord);
+		}
+	}
 }
 }

+ 141 - 87
netflix-service/src/main/java/com/cyksj/service/pay/impl/TransferFuncServiceImpl.java

@@ -19,6 +19,7 @@ import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.snowflake.Sequence;
 import com.cyksj.common.snowflake.Sequence;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.SmsUtil;
 import com.cyksj.common.util.SmsUtil;
+import com.cyksj.common.util.StringUtil;
 import com.cyksj.config.zfb.AliPayClientFactory;
 import com.cyksj.config.zfb.AliPayClientFactory;
 import com.cyksj.config.zfb.ZfbProductCode;
 import com.cyksj.config.zfb.ZfbProductCode;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
@@ -34,7 +35,9 @@ import com.cyksj.model.entity.*;
 import com.cyksj.model.request.ApplyMoneyReq;
 import com.cyksj.model.request.ApplyMoneyReq;
 import com.cyksj.model.request.TransferAccountsReq;
 import com.cyksj.model.request.TransferAccountsReq;
 import com.cyksj.model.request.YhShopApplyMoneyReq;
 import com.cyksj.model.request.YhShopApplyMoneyReq;
+import com.cyksj.redis.RedisService;
 import com.cyksj.service.pay.TransferFuncService;
 import com.cyksj.service.pay.TransferFuncService;
+import com.cyksj.service.sys.SysConfigService;
 import com.cyksj.service.user.UserBenefitsService;
 import com.cyksj.service.user.UserBenefitsService;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
@@ -74,102 +77,50 @@ public class TransferFuncServiceImpl implements TransferFuncService {
 
 
 	private final DistributeMoneyApplyMapper distributeMoneyApplyMapper;
 	private final DistributeMoneyApplyMapper distributeMoneyApplyMapper;
 
 
+	private final RedisService redisService;
+
+	private final SysConfigService sysConfigService;
+
 	@Override
 	@Override
 	public Result distributeApply(ApplyMoneyReq applyMoneyReq) throws Exception {
 	public Result distributeApply(ApplyMoneyReq applyMoneyReq) throws Exception {
 		applyMoneyReq.setMType(DistributeMoneyApply.MType.ds);
 		applyMoneyReq.setMType(DistributeMoneyApply.MType.ds);
-		return commonApplyMoney(applyMoneyReq);
-	}
-
-	@Override
-	public Result yhShopDistributeApply(YhShopApplyMoneyReq applyMoneyReq) throws Exception {
-		Long userId = applyMoneyReq.getUserId();
-		User user = userMapper.selectById(userId);
-		if (user == null) {
-			throw BusinessRuntimeException.getInstance("请先授权登录");
+		String key = String.format(RedisService.key.APPLY_MONEY_DAY_LIMIT_KEY.getName(), DateTime.now().toDateStr(), applyMoneyReq.getMType(), applyMoneyReq.getUserId());
+		if (!redisService.setNx(key, applyMoneyReq.getUserId(), RedisService.key.APPLY_MONEY_DAY_LIMIT_KEY.getTimeout())) {
+			throw BusinessRuntimeException.getInstance("每天仅可提现一次");
 		}
 		}
-		Boolean isTakeAll = applyMoneyReq.getIsTakeAll();
-		YhShopDistributeMoneyApply.Type type = applyMoneyReq.getType();
-		if (type == null) type = YhShopDistributeMoneyApply.Type.zfb;
-		if (type == YhShopDistributeMoneyApply.Type.zfb) {
-			if (ObjectUtil.hasEmpty(applyMoneyReq.getAccount(), applyMoneyReq.getRealName())) {
-				throw BusinessRuntimeException.getInstance("必填项不能为空");
-			}
-			if (applyMoneyReq.getAccount().length() > 255 || applyMoneyReq.getRealName().length() > 32) {
-				throw BusinessRuntimeException.getInstance("请输入正确的账户信息");
-			}
-		}
-		if (type == YhShopDistributeMoneyApply.Type.usdt) {
-			if (StrUtil.isEmpty(applyMoneyReq.getWalletAddr())) {
-				throw BusinessRuntimeException.getInstance("USDT提现钱包地址不能为空");
-			}
-			if (applyMoneyReq.getWalletAddr().length() > 1000) {
-				throw BusinessRuntimeException.getInstance("请输入正确的钱包地址");
-			}
-			if (StrUtil.isNotBlank(applyMoneyReq.getRemark()) && applyMoneyReq.getRemark().length() > 512) {
-				throw BusinessRuntimeException.getInstance("备注过多");
+		try {
+			Result result = commonApplyMoney(applyMoneyReq);
+			if (result.isFlag()) {
+				redisService.set(key, applyMoneyReq.getUserId(), RedisService.key.APPLY_MONEY_DAY_LIMIT_KEY.getTimeout());
+			} else {
+				redisService.del(key);
 			}
 			}
-			isTakeAll = true;
-
-		}
-		YhShopDistributeMoneyApply distributeMoneyApply = null;
-		if (type == YhShopDistributeMoneyApply.Type.pwdRed) {
-			distributeMoneyApply = yhShopMapper.selectRelationBusiness(userId);
-			isTakeAll = true;
+			return result;
+		} catch (Exception e) {
+			redisService.del(key);
+			throw BusinessRuntimeException.getInstance(StringUtil.getErrorMsg(e));
 		}
 		}
+	}
 
 
-		BigDecimal needApplyMoney = user.getYhsMoney();
-		BigDecimal fourHundred = BigDecimal.valueOf(4 * 10000);
-		if (isTakeAll == null || !isTakeAll) {
-			if (needApplyMoney.compareTo(fourHundred) > 0) {
-				needApplyMoney = fourHundred;
-			}
+	@Override
+	public Result yhShopDistributeApply(YhShopApplyMoneyReq applyMoneyReq) throws Exception {
+		String type = "shop";
+		String key = String.format(RedisService.key.APPLY_MONEY_DAY_LIMIT_KEY.getName(), DateTime.now().toDateStr(), type, applyMoneyReq.getUserId());
+		if (!redisService.setNx(key, applyMoneyReq.getUserId(), RedisService.key.APPLY_MONEY_DAY_LIMIT_KEY.getTimeout())) {
+			throw BusinessRuntimeException.getInstance("每天仅可提现一次");
 		}
 		}
-		Integer update = userMapper.subYhsMoney(user.getId(), needApplyMoney);
-		if (update == 1) {
-			distributeMoneyApply = Optional.ofNullable(distributeMoneyApply).orElse(new YhShopDistributeMoneyApply());
-			distributeMoneyApply.setUserId(userId);
-			distributeMoneyApply.setMoney(needApplyMoney);
-			distributeMoneyApply.setAccount(applyMoneyReq.getAccount());
-			distributeMoneyApply.setRealName(applyMoneyReq.getRealName());
-			distributeMoneyApply.setWalletAddr(applyMoneyReq.getWalletAddr());
-			distributeMoneyApply.setRemark(applyMoneyReq.getRemark());
-			distributeMoneyApply.setType(applyMoneyReq.getType());
-			if (isTakeAll != null && isTakeAll) {
-				distributeMoneyApply.setVerifyStatus(YhShopDistributeMoneyApply.Status.verifying);
+		try {
+			Result result = yhShopApplyMoney(applyMoneyReq);
+			if (result.isFlag()) {
+				redisService.set(key, applyMoneyReq.getUserId(), RedisService.key.APPLY_MONEY_DAY_LIMIT_KEY.getTimeout());
 			} else {
 			} else {
-				TransferAccountsReq req = new TransferAccountsReq();
-				req.setMoney(needApplyMoney);
-				req.setAccount(applyMoneyReq.getAccount());
-				req.setName(applyMoneyReq.getRealName());
-				req.setChannelType(2);
-				req.setUserId(userId);
-				req.setRemark("小店提现");
-				AlipayResponse alipayResponse = transferAccounts(req);
-				if (alipayResponse.isSuccess()) {
-					distributeMoneyApply.setVerifyStatus(YhShopDistributeMoneyApply.Status.success);
-				} else {
-					distributeMoneyApply.setVerifyStatus(YhShopDistributeMoneyApply.Status.fail);
-					distributeMoneyApply.setReason(alipayResponse.getSubMsg());
-					userBenefitsService.addYhsMoney(userId, distributeMoneyApply.getMoney());
-					if (StrUtil.equals(alipayResponse.getSubCode(), "SECURITY_CHECK_FAILED")) {
-						return GatewayResponse.FAIL.newBuilder().setMsg("当前支付宝提现人数较多,请稍后再试").toResult();
-					}
-					return GatewayResponse.FAIL.newBuilder().setMsg("目前财务清账中,48小时后可提现").toResult();
-				}
+				redisService.del(key);
 			}
 			}
-			try {
-				yhShopDistributeMoneyApplyMapper.insert(distributeMoneyApply);
-				//大额提现 超过400
-				if (envCommonService.isPrdEnv() && distributeMoneyApply.getVerifyStatus() == YhShopDistributeMoneyApply.Status.verifying && distributeMoneyApply.getMoney().compareTo(fourHundred) > 0) {
-					SmsUtil.sendLuoKey2Msg(Constant.ZK_MOBILE, "小店店铺有大额提现申请【银河录像局】");
-				}
-			} catch (Exception e) {
-				userBenefitsService.addYhsMoney(userId, distributeMoneyApply.getMoney());
-				return GatewayResponse.FAIL.newBuilder().setMsg("网络错误,请重试").toResult();
-			}
-			return GatewayResponse.SUCCESS.newBuilder().toResult(distributeMoneyApply);
+			return result;
+		} catch (Exception e) {
+			redisService.del(key);
+			throw BusinessRuntimeException.getInstance(StringUtil.getErrorMsg(e));
 		}
 		}
-		throw BusinessRuntimeException.getInstance("系统异常,请重新提交提现申请");
 	}
 	}
 
 
 	@Override
 	@Override
@@ -191,7 +142,7 @@ public class TransferFuncServiceImpl implements TransferFuncService {
 			name += "xx";
 			name += "xx";
 		}
 		}
 		Integer scope = transferAccountsReq.getScope();
 		Integer scope = transferAccountsReq.getScope();
-		AlipayClient alipayClient = AliPayClientFactory.getAlipayClient(ShopConfig.DISTRIBUTE_ZFB_DEFAULT_APP_ID);
+		AlipayClient alipayClient = AliPayClientFactory.getAlipayClient(sysConfigService.getDefaultShopConfigByType("zfb"));
 
 
 		AlipayRequest alipayRequest = aliPayTransferAccountsRequest(donNo, account, name, money, remark);
 		AlipayRequest alipayRequest = aliPayTransferAccountsRequest(donNo, account, name, money, remark);
 
 
@@ -381,7 +332,13 @@ public class TransferFuncServiceImpl implements TransferFuncService {
 					if (StrUtil.equals(alipayResponse.getSubCode(), "SECURITY_CHECK_FAILED")) {
 					if (StrUtil.equals(alipayResponse.getSubCode(), "SECURITY_CHECK_FAILED")) {
 						return GatewayResponse.FAIL.newBuilder().setMsg("当前支付宝提现人数较多,请稍后再试").toResult();
 						return GatewayResponse.FAIL.newBuilder().setMsg("当前支付宝提现人数较多,请稍后再试").toResult();
 					}
 					}
-					return GatewayResponse.FAIL.newBuilder().setMsg("目前财务清账中,48小时后可提现").toResult();
+					if (alipayResponse.getSubMsg().contains("冻结")) {
+						return GatewayResponse.FAIL.newBuilder().setMsg("目前财务清账中,48小时后可提现").toResult();
+					}
+					if (alipayResponse.getSubMsg().contains("余额不足")) {
+						return GatewayResponse.FAIL.newBuilder().setMsg("转账失败,请联系客服").toResult();
+					}
+					return GatewayResponse.FAIL.newBuilder().setMsg(alipayResponse.getSubMsg()).toResult();
 				}
 				}
 			}
 			}
 			try {
 			try {
@@ -398,4 +355,101 @@ public class TransferFuncServiceImpl implements TransferFuncService {
 		}
 		}
 		throw BusinessRuntimeException.getInstance("系统异常,请重新提交提现申请");
 		throw BusinessRuntimeException.getInstance("系统异常,请重新提交提现申请");
 	}
 	}
+
+	public Result yhShopApplyMoney(YhShopApplyMoneyReq applyMoneyReq) throws Exception {
+		Long userId = applyMoneyReq.getUserId();
+		User user = userMapper.selectById(userId);
+		if (user == null) {
+			throw BusinessRuntimeException.getInstance("请先授权登录");
+		}
+		Boolean isTakeAll = applyMoneyReq.getIsTakeAll();
+		YhShopDistributeMoneyApply.Type type = applyMoneyReq.getType();
+		if (type == null) type = YhShopDistributeMoneyApply.Type.zfb;
+		if (type == YhShopDistributeMoneyApply.Type.zfb) {
+			if (ObjectUtil.hasEmpty(applyMoneyReq.getAccount(), applyMoneyReq.getRealName())) {
+				throw BusinessRuntimeException.getInstance("必填项不能为空");
+			}
+			if (applyMoneyReq.getAccount().length() > 255 || applyMoneyReq.getRealName().length() > 32) {
+				throw BusinessRuntimeException.getInstance("请输入正确的账户信息");
+			}
+		}
+		if (type == YhShopDistributeMoneyApply.Type.usdt) {
+			if (StrUtil.isEmpty(applyMoneyReq.getWalletAddr())) {
+				throw BusinessRuntimeException.getInstance("USDT提现钱包地址不能为空");
+			}
+			if (applyMoneyReq.getWalletAddr().length() > 1000) {
+				throw BusinessRuntimeException.getInstance("请输入正确的钱包地址");
+			}
+			if (StrUtil.isNotBlank(applyMoneyReq.getRemark()) && applyMoneyReq.getRemark().length() > 512) {
+				throw BusinessRuntimeException.getInstance("备注过多");
+			}
+			isTakeAll = true;
+
+		}
+		YhShopDistributeMoneyApply distributeMoneyApply = null;
+		if (type == YhShopDistributeMoneyApply.Type.pwdRed) {
+			distributeMoneyApply = yhShopMapper.selectRelationBusiness(userId);
+			isTakeAll = true;
+		}
+
+		BigDecimal needApplyMoney = user.getYhsMoney();
+		BigDecimal fourHundred = BigDecimal.valueOf(4 * 10000);
+		if (isTakeAll == null || !isTakeAll) {
+			if (needApplyMoney.compareTo(fourHundred) > 0) {
+				needApplyMoney = fourHundred;
+			}
+		}
+		Integer update = userMapper.subYhsMoney(user.getId(), needApplyMoney);
+		if (update == 1) {
+			distributeMoneyApply = Optional.ofNullable(distributeMoneyApply).orElse(new YhShopDistributeMoneyApply());
+			distributeMoneyApply.setUserId(userId);
+			distributeMoneyApply.setMoney(needApplyMoney);
+			distributeMoneyApply.setAccount(applyMoneyReq.getAccount());
+			distributeMoneyApply.setRealName(applyMoneyReq.getRealName());
+			distributeMoneyApply.setWalletAddr(applyMoneyReq.getWalletAddr());
+			distributeMoneyApply.setRemark(applyMoneyReq.getRemark());
+			distributeMoneyApply.setType(applyMoneyReq.getType());
+			if (isTakeAll != null && isTakeAll) {
+				distributeMoneyApply.setVerifyStatus(YhShopDistributeMoneyApply.Status.verifying);
+			} else {
+				TransferAccountsReq req = new TransferAccountsReq();
+				req.setMoney(needApplyMoney);
+				req.setAccount(applyMoneyReq.getAccount());
+				req.setName(applyMoneyReq.getRealName());
+				req.setChannelType(2);
+				req.setUserId(userId);
+				req.setRemark("小店提现");
+				AlipayResponse alipayResponse = transferAccounts(req);
+				if (alipayResponse.isSuccess()) {
+					distributeMoneyApply.setVerifyStatus(YhShopDistributeMoneyApply.Status.success);
+				} else {
+					distributeMoneyApply.setVerifyStatus(YhShopDistributeMoneyApply.Status.fail);
+					distributeMoneyApply.setReason(alipayResponse.getSubMsg());
+					userBenefitsService.addYhsMoney(userId, distributeMoneyApply.getMoney());
+					if (StrUtil.equals(alipayResponse.getSubCode(), "SECURITY_CHECK_FAILED")) {
+						return GatewayResponse.FAIL.newBuilder().setMsg("当前支付宝提现人数较多,请稍后再试").toResult();
+					}
+					if (alipayResponse.getSubMsg().contains("冻结")) {
+						return GatewayResponse.FAIL.newBuilder().setMsg("目前财务清账中,48小时后可提现").toResult();
+					}
+					if (alipayResponse.getSubMsg().contains("余额不足")) {
+						return GatewayResponse.FAIL.newBuilder().setMsg("转账失败,请联系客服").toResult();
+					}
+					return GatewayResponse.FAIL.newBuilder().setMsg(alipayResponse.getSubMsg()).toResult();
+				}
+			}
+			try {
+				yhShopDistributeMoneyApplyMapper.insert(distributeMoneyApply);
+				//大额提现 超过400
+				if (envCommonService.isPrdEnv() && distributeMoneyApply.getVerifyStatus() == YhShopDistributeMoneyApply.Status.verifying && distributeMoneyApply.getMoney().compareTo(fourHundred) > 0) {
+					SmsUtil.sendLuoKey2Msg(Constant.ZK_MOBILE, "小店店铺有大额提现申请【银河录像局】");
+				}
+			} catch (Exception e) {
+				userBenefitsService.addYhsMoney(userId, distributeMoneyApply.getMoney());
+				return GatewayResponse.FAIL.newBuilder().setMsg("网络错误,请重试").toResult();
+			}
+			return GatewayResponse.SUCCESS.newBuilder().toResult(distributeMoneyApply);
+		}
+		throw BusinessRuntimeException.getInstance("系统异常,请重新提交提现申请");
+	}
 }
 }

+ 2 - 1
netflix-service/src/main/java/com/cyksj/service/paypal/PayPalService.java

@@ -50,12 +50,13 @@ public class PayPalService{
 
 
 
 
     public String successPayment(String paymentId, String payerId,PaypalPayConfig paypalPayConfig) throws Exception {
     public String successPayment(String paymentId, String payerId,PaypalPayConfig paypalPayConfig) throws Exception {
+        log.info("paypal回调 paymentId:{},payerId:{}",paymentId,payerId);
         Payment payment = null;
         Payment payment = null;
         try {
         try {
             payment = this.executePayment(paymentId,payerId,paypalPayConfig.getClientId(),paypalPayConfig.getClientSecret(),paypalPayConfig.getMode());
             payment = this.executePayment(paymentId,payerId,paypalPayConfig.getClientId(),paypalPayConfig.getClientSecret(),paypalPayConfig.getMode());
         } catch (PayPalRESTException e) {
         } catch (PayPalRESTException e) {
             log.error("支付回调失败",e);
             log.error("支付回调失败",e);
-            return paypalPayConfig.getCancelUrl();
+            payment = Payment.get(getAPIContext(paypalPayConfig.getClientId(),paypalPayConfig.getClientSecret(),paypalPayConfig.getMode()), paymentId);
         }
         }
 
 
         PayerInfo payerInfo = payment.getPayer().getPayerInfo();
         PayerInfo payerInfo = payment.getPayer().getPayerInfo();

+ 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>  getHasPayGoods(long userId);
 
 
 	List<RenewalView> getExpiryRenewalNotify(Long userId);
 	List<RenewalView> getExpiryRenewalNotify(Long userId);
+
+	void getCollegeStudentUserGptTicket(Long userId);
 }
 }

+ 86 - 16
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -1,5 +1,6 @@
 package com.cyksj.service.relation.impl;
 package com.cyksj.service.relation.impl;
 
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.BetweenFormater;
 import cn.hutool.core.date.BetweenFormater;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateTime;
@@ -17,6 +18,7 @@ import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.StringUtil;
 import com.cyksj.common.util.StringUtil;
+import com.cyksj.common.util.TicketCodeCommonUtil;
 import com.cyksj.enums.GatewayApiCode;
 import com.cyksj.enums.GatewayApiCode;
 import com.cyksj.mapper.*;
 import com.cyksj.mapper.*;
 import com.cyksj.mapper.sys.SysEmailMapper;
 import com.cyksj.mapper.sys.SysEmailMapper;
@@ -29,8 +31,8 @@ import com.cyksj.service.groups.GroupsFuncService;
 import com.cyksj.service.mail.CuiQiuMailService;
 import com.cyksj.service.mail.CuiQiuMailService;
 import com.cyksj.service.mail.MailService;
 import com.cyksj.service.mail.MailService;
 import com.cyksj.service.mange.coupon.CouponCommonService;
 import com.cyksj.service.mange.coupon.CouponCommonService;
+import com.cyksj.service.midjourney.MidjourneyAccountService;
 import com.cyksj.service.relation.GroupRelationFrontService;
 import com.cyksj.service.relation.GroupRelationFrontService;
-import com.cyksj.service.shop.YhShopFrontService;
 import com.cyksj.service.user.UserBindRelationService;
 import com.cyksj.service.user.UserBindRelationService;
 import com.cyksj.service.user.UserLoginRecordService;
 import com.cyksj.service.user.UserLoginRecordService;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.BeanSearcher;
@@ -38,6 +40,7 @@ import com.ejlchina.searcher.SearchResult;
 import com.ejlchina.searcher.param.Operator;
 import com.ejlchina.searcher.param.Operator;
 import com.ejlchina.searcher.util.MapBuilder;
 import com.ejlchina.searcher.util.MapBuilder;
 import com.ejlchina.searcher.util.MapUtils;
 import com.ejlchina.searcher.util.MapUtils;
+import com.github.rholder.retry.*;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -47,6 +50,8 @@ import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.math.RoundingMode;
 import java.util.*;
 import java.util.*;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
@@ -83,7 +88,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 
 
 	private final OrderDonMapper orderDonMapper;
 	private final OrderDonMapper orderDonMapper;
 
 
-	private final YhShopFrontService yhShopFrontService;
+	private final GroupsRelationExpiryNotifyRecordMapper groupsRelationExpiryNotifyRecordMapper;
 
 
 	private final HttpServletRequest request;
 	private final HttpServletRequest request;
 
 
@@ -107,6 +112,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 
 
 	private final UserCertRecordMapper userCertRecordMapper;
 	private final UserCertRecordMapper userCertRecordMapper;
 
 
+	private final MidjourneyAccountService midjourneyAccountService;
+
 	//脆球邮箱后缀
 	//脆球邮箱后缀
 	private final static String CUI_QIU_EMAIL_SUFFIX = "@kindvd.com";
 	private final static String CUI_QIU_EMAIL_SUFFIX = "@kindvd.com";
 	private final UpgradePackageMapper upgradePackageMapper;
 	private final UpgradePackageMapper upgradePackageMapper;
@@ -231,10 +238,25 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				ticket.setPayTime(payTime);
 				ticket.setPayTime(payTime);
 			}
 			}
 			if (ticket.getGoodsId() == 26 && ticket.getIsMirror()){
 			if (ticket.getGoodsId() == 26 && ticket.getIsMirror()){
-				List<UpgradePackage> upgradePackages = upgradePackageMapper.selectList(Wrappers.lambdaQuery(UpgradePackage.class).eq(UpgradePackage::getSkuId, ticket.getSkuId()).eq(UpgradePackage::getStatus, Boolean.TRUE));
+				List<UpgradePackage> upgradePackages = upgradePackageMapper.selectList(Wrappers.lambdaQuery(UpgradePackage.class).apply("JSON_CONTAINS(sku_ids,'\""+ticket.getSkuId()+"\"')").eq(UpgradePackage::getStatus, Boolean.TRUE));
 				if (CollectionUtil.isNotEmpty(upgradePackages)){
 				if (CollectionUtil.isNotEmpty(upgradePackages)){
 					upgradePackages.stream().map(e -> e.getPrice().divide(BigDecimal.valueOf(e.getNum()), 2, RoundingMode.HALF_UP)).min(BigDecimal::compareTo).ifPresent(ticket::setMjPackagePrice);
 					upgradePackages.stream().map(e -> e.getPrice().divide(BigDecimal.valueOf(e.getNum()), 2, RoundingMode.HALF_UP)).min(BigDecimal::compareTo).ifPresent(ticket::setMjPackagePrice);
 				}
 				}
+				try {
+					MidjourneyUserView search = beanSearcher.searchFirst(MidjourneyUserView.class, MapUtils.flatBuilder(request.getParameterMap())
+							.field(MidjourneyUserView::getUserId, ticket.getUserId()).field(MidjourneyUserView::getRelationId, ticket.getRelationId())
+							.onlySelect(MidjourneyUserView::getMjFastNum, MidjourneyUserView::getMjRelaxNum)
+							.build());
+					if (search == null) {
+						MidjourneyUser midjourneyUser = midjourneyAccountService.getMidjourneyUserToken(ticket.getUserId(), ticket.getRelationId());
+						ticket.setMjUserFastNum(midjourneyUser.getMjFastNum());
+						ticket.setMjUserRelaxNum(midjourneyUser.getMjRelaxNum());
+					} else {
+						ticket.setMjUserFastNum(search.getMjFastNum());
+						ticket.setMjUserRelaxNum(search.getMjRelaxNum());
+					}
+				} catch (Exception e) {
+				}
 			}
 			}
 			List<GroupsRelationUserView> relationUserViews = groupsRelationMapper.getUserRelationUserViews(ticket.getGroupId(), ticket.getRelationId(), ticket.getUserId(), List.of(GroupsRelation.Status.validity, GroupsRelation.Status.outside));
 			List<GroupsRelationUserView> relationUserViews = groupsRelationMapper.getUserRelationUserViews(ticket.getGroupId(), ticket.getRelationId(), ticket.getUserId(), List.of(GroupsRelation.Status.validity, GroupsRelation.Status.outside));
 			ticket.setRelationViews(relationUserViews);
 			ticket.setRelationViews(relationUserViews);
@@ -465,8 +487,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		if (StrUtil.hasEmpty(account, password)) {
 		if (StrUtil.hasEmpty(account, password)) {
 			throw BusinessRuntimeException.getInstance("您的车票账号密码异常,请联系客服...");
 			throw BusinessRuntimeException.getInstance("您的车票账号密码异常,请联系客服...");
 		}
 		}
-		if (renewalView.getGoodsId() == 33l && renewalView.getAccount().contains(CUI_QIU_EMAIL_SUFFIX)) {
-			return cuiQiuMailService.getVerifyCode(renewalView.getAccount());
+		if (renewalView.getAccount().contains(CUI_QIU_EMAIL_SUFFIX)) {
+			return cuiQiuMailService.getVerifyCode(renewalView.getAccount(), renewalView.getGoodsId());
 		}
 		}
 		//获取邮箱密码
 		//获取邮箱密码
 		SysEmail sysEmail = sysEmailMapper.selectOne(Wrappers.lambdaQuery(SysEmail.class)
 		SysEmail sysEmail = sysEmailMapper.selectOne(Wrappers.lambdaQuery(SysEmail.class)
@@ -653,8 +675,9 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		List<RenewalView> list = beanSearcher.searchAll(RenewalView.class, builder
 		List<RenewalView> list = beanSearcher.searchAll(RenewalView.class, builder
 				.field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
 				.field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
 				.field(RenewalView::getUserId, userIds).op(Operator.InList)
 				.field(RenewalView::getUserId, userIds).op(Operator.InList)
-				.field("condition", String.format("(gr.expiry_time is null or gr.expiry_time > '%s')", now))
+				.field(RenewalView::getExpiryTime, now).op(Operator.GreaterThan)
 				.field(RenewalView::getStatus, List.of("validity", "overdue", "outside")).op(Operator.InList)
 				.field(RenewalView::getStatus, List.of("validity", "overdue", "outside")).op(Operator.InList)
+				.field(RenewalView::getAqType, 1)
 				.orderBy(RenewalView::getExpiryTime).asc()
 				.orderBy(RenewalView::getExpiryTime).asc()
 				.onlySelect(RenewalView::getMonths, RenewalView::getExpiryTime, RenewalView::getRelationId, RenewalView::getAccount, RenewalView::getGoodsId, RenewalView::getTitle, RenewalView::getLogo, RenewalView::getImg, RenewalView::getGroupId, RenewalView::getSkuId, RenewalView::getSpecVal, RenewalView::getGoodsStatus, RenewalView::getSkuStatus)
 				.onlySelect(RenewalView::getMonths, RenewalView::getExpiryTime, RenewalView::getRelationId, RenewalView::getAccount, RenewalView::getGoodsId, RenewalView::getTitle, RenewalView::getLogo, RenewalView::getImg, RenewalView::getGroupId, RenewalView::getSkuId, RenewalView::getSpecVal, RenewalView::getGoodsStatus, RenewalView::getSkuStatus)
 				.build());
 				.build());
@@ -685,6 +708,9 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			return false;
 			return false;
 		}).collect(Collectors.toList());
 		}).collect(Collectors.toList());
 		redisService.setNx(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId), userId, RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getTimeout());
 		redisService.setNx(RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getNameFormat(thisDate, userId), userId, RedisService.key.TICKET_EXPIRY_NOTIFY_DAY.getTimeout());
+		if (CollUtil.isNotEmpty(expiryTickets)) {
+			groupsRelationExpiryNotifyRecordMapper.batchInsert(userId, expiryTickets);
+		}
 		return expiryTickets;
 		return expiryTickets;
 	}
 	}
 
 
@@ -712,23 +738,67 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				throw BusinessRuntimeException.getInstance("查询失败,请检查是否发送了登陆码..");
 				throw BusinessRuntimeException.getInstance("查询失败,请检查是否发送了登陆码..");
 			}
 			}
 		}
 		}
-		//迪士尼
-		if (goodsId == 3) {
-			int index = body.indexOf("otp_code");
-			if (index == -1) {
-				index = body.indexOf(" 15 ");
-			}
-			code = StrUtil.subWithLength(body, index, 215);
+		if (StrUtil.isEmpty(code)) {
+			code = TicketCodeCommonUtil.getTicketCodeStr(body, goodsId);
 		}
 		}
-		//PS
+		int length = 4;
 		if (goodsId == 33l) {
 		if (goodsId == 33l) {
-			code = StrUtil.subWithLength(body, body.indexOf("ADOBE"), 215);
+			length = 6;
 		}
 		}
-		code = StringUtil.getVerifyCodePattern(code);
+		code = StringUtil.getVerifyCodePattern(code, length);
 		if (!Validator.isNumber(code)) {
 		if (!Validator.isNumber(code)) {
 			log.error("获取账号验证码失败:{}", StrUtil.subSufByLength(code, 512));
 			log.error("获取账号验证码失败:{}", StrUtil.subSufByLength(code, 512));
 			throw BusinessRuntimeException.getInstance("获取验证码失败,请重新获取..");
 			throw BusinessRuntimeException.getInstance("获取验证码失败,请重新获取..");
 		}
 		}
 		return code.trim();
 		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)
+						.set(GroupsRelation::getAqType, 2)
+						.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;
+	}
+}

+ 13 - 0
netflix-service/src/main/java/com/cyksj/service/ticket/UserReceiveTrialTicketRecordService.java

@@ -0,0 +1,13 @@
+package com.cyksj.service.ticket;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: UserReceiveTrialTicketRecordService
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 17:55
+ */
+public interface UserReceiveTrialTicketRecordService {
+	void sendTicketAndRecord(Long userId, Long trialSkuId);
+
+	Boolean isReceiveTrialTicket(long userId, Long trialSkuId);
+}

+ 148 - 0
netflix-service/src/main/java/com/cyksj/service/ticket/impl/UserReceiveTrialTicketRecordServiceImpl.java

@@ -0,0 +1,148 @@
+package com.cyksj.service.ticket.impl;
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.common.util.StringUtil;
+import com.cyksj.mapper.*;
+import com.cyksj.model.entity.GoodsDonSku;
+import com.cyksj.model.entity.GroupsRelation;
+import com.cyksj.model.entity.GroupsTrips;
+import com.cyksj.model.entity.UserReceiveTrialTicketRecord;
+import com.cyksj.service.groups.GroupsFuncService;
+import com.cyksj.service.ticket.UserReceiveTrialTicketRecordService;
+import com.cyksj.service.user.UserBindRelationService;
+import com.github.rholder.retry.*;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: UserReceiveTrialTicketRecordServiceImpl
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 17:55
+ */
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class UserReceiveTrialTicketRecordServiceImpl implements UserReceiveTrialTicketRecordService {
+	private final UserBindRelationService userBindRelationService;
+
+	private final UserReceiveTrialTicketRecordMapper userReceiveTrialTicketRecordMapper;
+
+	private final GroupsMapper groupsMapper;
+
+	private final GroupsRelationMapper groupsRelationMapper;
+
+	private final GoodsDonSkuMapper goodsDonSkuMapper;
+
+	private final GroupsFuncService groupsFuncService;
+
+	private final OrderDonMapper orderDonMapper;
+
+	@Override
+	public void sendTicketAndRecord(Long userId, Long trialSkuId) {
+		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+		GoodsDonSku sku = goodsDonSkuMapper.selectById(trialSkuId);
+		if (sku == null) {
+			throw BusinessRuntimeException.getInstance("系统异常,请联系客服..");
+		}
+		Long goodsId = sku.getGoodsId();
+		//是否购买过mj镜像
+		Integer count = orderDonMapper.checkUserHasPaidMjMirror(userIdList);
+		if (count > 0) {
+			throw BusinessRuntimeException.getInstance("您不符合领取条件");
+		}
+
+		Integer selectCount = userReceiveTrialTicketRecordMapper.selectCount(Wrappers.lambdaQuery(UserReceiveTrialTicketRecord.class)
+				.in(UserReceiveTrialTicketRecord::getUserId, userIdList)
+				.eq(UserReceiveTrialTicketRecord::getSkuId, trialSkuId));
+		if (selectCount > 0) {
+			throw BusinessRuntimeException.getInstance("您已领取该试用车票");
+		}
+
+		try {
+			UserReceiveTrialTicketRecord userReceiveTrialTicketRecord = new UserReceiveTrialTicketRecord();
+			userReceiveTrialTicketRecord.setUserId(userId);
+			userReceiveTrialTicketRecord.setGoodsId(goodsId);
+			userReceiveTrialTicketRecord.setSkuId(trialSkuId);
+
+			userReceiveTrialTicketRecordMapper.insert(userReceiveTrialTicketRecord);
+
+			Long relationId = getTrialTicketByUserIdAndGoodsId(userId, trialSkuId);
+			userReceiveTrialTicketRecord.setRelationId(relationId);
+			userReceiveTrialTicketRecordMapper.updateById(userReceiveTrialTicketRecord);
+
+		} catch (DuplicateKeyException e) {
+			throw BusinessRuntimeException.getInstance("您已领取该试用车票");
+		}
+	}
+
+	@Override
+	public Boolean isReceiveTrialTicket(long userId, Long trialSkuId) {
+		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+		//是否购买过mj镜像
+		Integer count = orderDonMapper.checkUserHasPaidMjMirror(userIdList);
+		if (count > 0) {
+			return true;
+		}
+		Integer selectCount = userReceiveTrialTicketRecordMapper.selectCount(Wrappers.lambdaQuery(UserReceiveTrialTicketRecord.class)
+				.in(UserReceiveTrialTicketRecord::getUserId, userIdList)
+				.eq(UserReceiveTrialTicketRecord::getSkuId, trialSkuId));
+		return selectCount > 0 ? true : false;
+	}
+
+	public Long getTrialTicketByUserIdAndGoodsId(Long userId, Long trialSkuId) {
+		Retryer<Long> build = RetryerBuilder.<Long>newBuilder()
+				.retryIfException()
+				//运行时异常重试
+				.retryIfRuntimeException()
+				//false重试
+				.retryIfResult(res -> res == null)
+				//1s 间隔
+				.withWaitStrategy(WaitStrategies.fixedWait(1, TimeUnit.SECONDS))
+				//停止策略 : 尝试请求3次
+				.withStopStrategy(StopStrategies.stopAfterAttempt(3)).build();
+		try {
+			return build.call(() -> {
+				//体验规格
+				GroupsTrips groups = groupsMapper.selectCollegeStudentUserGptTicket(trialSkuId);
+				GroupsRelation relation = null;
+				if (groups != null) {
+					relation = groupsRelationMapper.selectRandomOneRelationByGroupsId(groups.getId());
+				}
+				if (relation == null) {
+					//生成空车队
+					GoodsDonSku sku = goodsDonSkuMapper.selectById(trialSkuId);
+					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)
+						.set(GroupsRelation::getAqType, 2)
+						.eq(GroupsRelation::getId, relation.getId())
+						.eq(GroupsRelation::getUserId, 0));
+				if (update > 0) {
+					groupsMapper.decrAvailableNum(groups.getId());
+					return relation.getId();
+				}
+				log.error("发送用户:{} GPT镜像车票体验失败,进行重试", userId);
+				return null;
+			});
+		} catch (ExecutionException | RetryException e) {
+			log.error("发送用户GPT镜像体验失败:{}", StringUtil.getErrorText(e));
+			return null;
+		}
+	}
+}

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

@@ -3,7 +3,7 @@ package com.cyksj.service.user;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 
 
 public interface BadIntentionOpService {
 public interface BadIntentionOpService {
-    void checkHandleBadUserOp(String phone, String verifyCode);
+    void checkHandleBadUserOp(String phone, String verifyCode, String ticket, String randStr, HttpServletRequest request);
 
 
     void isBadOpLoginPhone(HttpServletRequest request, String phone);
     void isBadOpLoginPhone(HttpServletRequest request, String phone);
 }
 }

+ 7 - 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.baomidou.mybatisplus.extension.service.IService;
 import com.cyksj.dto.UserSharedDto;
 import com.cyksj.dto.UserSharedDto;
+import com.cyksj.model.dto.AuthRedirect;
 import com.cyksj.model.dto.GzhOAuth2UserInfo;
 import com.cyksj.model.dto.GzhOAuth2UserInfo;
 import com.cyksj.model.dto.UserWhoami;
 import com.cyksj.model.dto.UserWhoami;
 import com.cyksj.model.entity.User;
 import com.cyksj.model.entity.User;
@@ -17,7 +18,7 @@ import java.util.List;
  */
  */
 public interface UserService extends IService<User> {
 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);
     UserWhoami whoami(long userId);
 
 
@@ -59,4 +60,9 @@ public interface UserService extends IService<User> {
 	Long getSharedIdByUserId(Long userId);
 	Long getSharedIdByUserId(Long userId);
 
 
 	void bindUserDistributeShared(Long userId, String dsCode);
 	void bindUserDistributeShared(Long userId, String dsCode);
+
+	/**
+	 * 实物好友邀请分销
+	 */
+	void saveEpDistributeShared(Long userId, String dsCode);
 }
 }

+ 22 - 14
netflix-service/src/main/java/com/cyksj/service/user/impl/BadIntentionOpServiceImpl.java

@@ -1,15 +1,16 @@
 package com.cyksj.service.user.impl;
 package com.cyksj.service.user.impl;
 
 
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.servlet.ServletUtil;
 import cn.hutool.extra.servlet.ServletUtil;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONObject;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.common.util.SmsUtil;
 import com.cyksj.common.util.StringUtil;
 import com.cyksj.common.util.StringUtil;
 import com.cyksj.redis.RedisService;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.user.BadIntentionOpService;
 import com.cyksj.service.user.BadIntentionOpService;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -38,23 +39,30 @@ public class BadIntentionOpServiceImpl implements BadIntentionOpService {
     private static final String VERIFY_URL =  "https://captcha.luosimao.com/api/site_verify";
     private static final String VERIFY_URL =  "https://captcha.luosimao.com/api/site_verify";
 
 
     @Override
     @Override
-    public void checkHandleBadUserOp(String phone, String verifyCode) {
+    public void checkHandleBadUserOp(String phone, String verifyCode, String ticket, String randStr, HttpServletRequest request) {
         if ("13662979985".equals(phone)) {
         if ("13662979985".equals(phone)) {
             throw BusinessRuntimeException.getInstance("异常手机号");
             throw BusinessRuntimeException.getInstance("异常手机号");
         }
         }
-        if (StringUtils.isBlank(verifyCode)) {
-            throw BusinessRuntimeException.getInstance("人机校验不通过");
+//        if (StringUtils.isBlank(verifyCode)) {
+//            throw BusinessRuntimeException.getInstance("人机校验不通过");
+//        } else {
+//            //银河官网
+//            JSONObject res = checkVerifyCode(apiKey, verifyCode);
+//            if (!res.getStr("res").equals("success")) {
+//                //小店域名
+//                res = checkVerifyCode(shoppingApikey, verifyCode);
+//                if (!res.getStr("res").equals("success")) {
+//                    log.error("手机号:{}验证码校验不通过 res:{}", phone, res);
+//                    throw BusinessRuntimeException.getInstance("人机校验不通过");
+//                }
+//            }
+//        }
+        if (ObjectUtil.hasEmpty(ticket, randStr)) {
+            throw BusinessRuntimeException.getInstance("请先完成图形认证");
         } else {
         } else {
-            //银河官网
-            JSONObject res = checkVerifyCode(apiKey, verifyCode);
-            if (!res.getStr("res").equals("success")) {
-                //小店域名
-                res = checkVerifyCode(shoppingApikey, verifyCode);
-                if (!res.getStr("res").equals("success")) {
-                    log.error("手机号:{}验证码校验不通过 res:{}", phone, res);
-                    throw BusinessRuntimeException.getInstance("人机校验不通过");
-                }
-            }
+            //腾讯云图形验证
+            String ip = StringUtil.getInternalAddressByIP(ServletUtil.getClientIP(request));
+            SmsUtil.checkTencentCaptcha(ticket, ip, randStr);
         }
         }
         String dayKey = RedisService.key.PHONE_CODE_USER_NUM_KEY_DAY.getName() + phone;
         String dayKey = RedisService.key.PHONE_CODE_USER_NUM_KEY_DAY.getName() + phone;
         if (redisService.hasKey(RedisService.key.PHONE_CODE_BALCK_KEY.getName() + phone)) {
         if (redisService.hasKey(RedisService.key.PHONE_CODE_BALCK_KEY.getName() + phone)) {

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

@@ -17,6 +17,7 @@ import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Optional;
 
 
 /**
 /**
  * 项目名: yhlxj
  * 项目名: yhlxj
@@ -57,7 +58,7 @@ public class UserPayOrderBlockServiceImpl extends ServiceImpl<UserPayOrderBlockM
 				if (orderDon.getType() == OrderDon.Type.ALI_PAY) {
 				if (orderDon.getType() == OrderDon.Type.ALI_PAY) {
 					AlipayTradeQueryResponse zfbOrderDetail = orderDonService.getZfbOrderDetail(orderDon.getShopId(), orderDon.getOrderNo());
 					AlipayTradeQueryResponse zfbOrderDetail = orderDonService.getZfbOrderDetail(orderDon.getShopId(), orderDon.getOrderNo());
 					if (zfbOrderDetail != null) {
 					if (zfbOrderDetail != null) {
-						buyerId = zfbOrderDetail.getBuyerUserId();
+						buyerId = Optional.ofNullable(zfbOrderDetail.getBuyerUserId()).orElse(zfbOrderDetail.getBuyerOpenId());
 					}
 					}
 				}
 				}
 			}
 			}

+ 60 - 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.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,40 @@ 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);
 	}
 	}
+
+	@Override
+	public void saveEpDistributeShared(Long userId, String dsCode) {
+		if (StrUtil.isEmpty(dsCode)) {
+			log.info("设备好友邀请userId:{},code为空", userId);
+			return;
+		}
+		User user = getById(userId);
+		Date createdTime = user.getCreatedTime();
+		String createDate = new DateTime(createdTime).toDateStr();
+		Boolean isNewUser = false;
+		if (StrUtil.equals(createDate, DateTime.now().toDateStr())) {
+			isNewUser = true;
+		}
+		UserSharedDto userSharedDto = getUserShredDtoByDsCode(dsCode);
+		if (userSharedDto != null) {
+			log.info("实物好友分销邀请sharedId:{},被邀请用户id:{}", userSharedDto.getSharedId(), userId);
+			equipDistributeService.saveDistributionInvitation(userSharedDto.getSharedId(), isNewUser, user.getId());
+		}
+	}
+
+	/**
+	 * 处理大学生快递站用户
+	 */
+	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) {
+		}
+	}
 }
 }

+ 0 - 1
netflix-web/src/main/java/com/cyksj/web/controller/cps/CpsPopularizeController.java

@@ -155,5 +155,4 @@ public class CpsPopularizeController {
 		long cpsUserId = StpCpsManageUser.getLoginIdAsLong();
 		long cpsUserId = StpCpsManageUser.getLoginIdAsLong();
 		return GatewayResponse.SUCCESS.newBuilder().toResult(cpsPopularizeService.getServiceCodeUrl(cpsUserId));
 		return GatewayResponse.SUCCESS.newBuilder().toResult(cpsPopularizeService.getServiceCodeUrl(cpsUserId));
 	}
 	}
-
 }
 }

+ 10 - 1
netflix-web/src/main/java/com/cyksj/web/controller/distribute/EquipmentDistributeController.java

@@ -77,7 +77,6 @@ public class EquipmentDistributeController {
 	private final EquipmentDistributeService equipDistributeService;
 	private final EquipmentDistributeService equipDistributeService;
 
 
 	private final EquipmentUserDistributeInviteRecordMapper inviteRecordMapper;
 	private final EquipmentUserDistributeInviteRecordMapper inviteRecordMapper;
-
 	/**
 	/**
 	 * 个人实物分销详情
 	 * 个人实物分销详情
 	 */
 	 */
@@ -249,4 +248,14 @@ public class EquipmentDistributeController {
 		}
 		}
 		return GatewayResponse.SUCCESS.newBuilder().toResult(true);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(true);
 	}
 	}
+
+	/**
+	 * 实物分销绑定
+	 */
+	@GetMapping("/equipment/invite/bind")
+	public Result<String> equipmentInviteBind(String dsCode) {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		userService.saveEpDistributeShared(userId, dsCode);
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
 }
 }

+ 4 - 1
netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java

@@ -1252,9 +1252,12 @@ public class GoodsDonController {
 	 * 获取套餐列表
 	 * 获取套餐列表
 	 */
 	 */
 	@GetMapping("/get/upgradePackage")
 	@GetMapping("/get/upgradePackage")
-	public Result<SearchResult<UpgradePackageView>> list() {
+	public Result<SearchResult<UpgradePackageView>> list(Long skuId) {
 		log.info("获取套餐列表");
 		log.info("获取套餐列表");
 		Map<String, Object> build = MapUtils.flatBuilder(request.getParameterMap()).build();
 		Map<String, Object> build = MapUtils.flatBuilder(request.getParameterMap()).build();
+		if (skuId != null) {
+			build.put("sku", String.format(" and JSON_CONTAINS(up.sku_ids,'\"%s\"')", skuId));
+		}
 		SearchResult<UpgradePackageView> search = beanSearcher.search(UpgradePackageView.class, build);
 		SearchResult<UpgradePackageView> search = beanSearcher.search(UpgradePackageView.class, build);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}
 	}

+ 47 - 0
netflix-web/src/main/java/com/cyksj/web/controller/group/MidJourneyGuideController.java

@@ -0,0 +1,47 @@
+package com.cyksj.web.controller.group;
+
+import com.cyksj.common.constant.Constant;
+import com.cyksj.dto.Result;
+import com.cyksj.enums.GatewayResponse;
+import com.cyksj.service.ticket.UserReceiveTrialTicketRecordService;
+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;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: MidJourneyGuideController
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 17:46
+ */
+@Slf4j
+@RequestMapping("/applets/mj")
+@RestController
+@RequiredArgsConstructor
+public class MidJourneyGuideController {
+	private final UserReceiveTrialTicketRecordService userReceiveTrialTicketRecordService;
+
+	/**
+	 * 领取mj试用车票
+	 */
+	@PostMapping("/receive/trial")
+	public Result<String> receiveTrialTicket() {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		userReceiveTrialTicketRecordService.sendTicketAndRecord(userId, Constant.MIDJOURNEY_TRIAL_SKU_ID);
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
+	/**
+	 * 是否已领取mj试用车票
+	 */
+	@GetMapping("/hasReceived")
+	public Result<Boolean> isReceiveTrialTicket() {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		Boolean flag = userReceiveTrialTicketRecordService.isReceiveTrialTicket(userId, Constant.MIDJOURNEY_TRIAL_SKU_ID);
+		return GatewayResponse.SUCCESS.newBuilder().toResult(flag);
+	}
+}

+ 4 - 4
netflix-web/src/main/java/com/cyksj/web/controller/landing/CorpFollowActiveCodeController.java

@@ -4,13 +4,11 @@ import cn.hutool.core.util.StrUtil;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.service.corp.CorpFollowActiveCodeFrontService;
 import com.cyksj.service.corp.CorpFollowActiveCodeFrontService;
+import com.cyksj.service.distribute.equipment.EquipmentDistributeService;
 import com.cyksj.service.user.UserService;
 import com.cyksj.service.user.UserService;
 import com.cyksj.web.util.StpUserUtil;
 import com.cyksj.web.util.StpUserUtil;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 
 /**
 /**
  * 项目名: yhlxj
  * 项目名: yhlxj
@@ -26,6 +24,8 @@ public class CorpFollowActiveCodeController {
 
 
 	private final UserService userService;
 	private final UserService userService;
 
 
+	private final EquipmentDistributeService equipDistributeService;
+
 	/**
 	/**
 	 * 活动活码落地页 获取对应客服二维码
 	 * 活动活码落地页 获取对应客服二维码
 	 */
 	 */

+ 5 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/distribute/DistributeController.java

@@ -479,6 +479,11 @@ public class DistributeController {
 			distributeMoneyApply.setImg(distributeApplyMoneyReq.getImg());
 			distributeMoneyApply.setImg(distributeApplyMoneyReq.getImg());
 		}
 		}
 		distributeMoneyApplyMapper.updateById(distributeMoneyApply);
 		distributeMoneyApplyMapper.updateById(distributeMoneyApply);
+
+		if (distributeMoneyApply.getVerifyStatus() == DistributeMoneyApply.Status.fail) {
+			String key = String.format(RedisService.key.APPLY_MONEY_DAY_LIMIT_KEY.getName(), DateTime.now().toDateStr(), DistributeMoneyApply.MType.ds.name(), distributeMoneyApply.getUserId());
+			redisService.del(key);
+		}
 		return GatewayResponse.SUCCESS.newBuilder().toResult("审核操作成功");
 		return GatewayResponse.SUCCESS.newBuilder().toResult("审核操作成功");
 	}
 	}
 
 

+ 1 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/distribute/EquipmentController.java

@@ -105,7 +105,7 @@ public class EquipmentController {
 		}
 		}
 		BigDecimal money = verifyRecord.getMoney();
 		BigDecimal money = verifyRecord.getMoney();
 		String img = verifyRecord.getImg();
 		String img = verifyRecord.getImg();
-		if (StrUtil.isNotBlank(img)) {
+		if (StrUtil.isEmpty(img)) {
 			throw BusinessRuntimeException.getInstance("转账截图不为空");
 			throw BusinessRuntimeException.getInstance("转账截图不为空");
 		}
 		}
 		if (money == null) {
 		if (money == null) {

+ 37 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonController.java

@@ -4,19 +4,21 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.annotation.Log;
 import com.cyksj.common.annotation.Log;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.BusinessType;
 import com.cyksj.enums.BusinessType;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.enums.GatewayResponse;
+import com.cyksj.mapper.GoodsDonSkuMapper;
 import com.cyksj.model.entity.GoodsDon;
 import com.cyksj.model.entity.GoodsDon;
 import com.cyksj.model.entity.GoodsDonCategory;
 import com.cyksj.model.entity.GoodsDonCategory;
 import com.cyksj.model.entity.GoodsDonSku;
 import com.cyksj.model.entity.GoodsDonSku;
 import com.cyksj.model.manage.request.ReqGoodsSpuInsert;
 import com.cyksj.model.manage.request.ReqGoodsSpuInsert;
 import com.cyksj.model.manage.views.GoodsDonViewer;
 import com.cyksj.model.manage.views.GoodsDonViewer;
+import com.cyksj.model.views.GoodsDetailView;
 import com.cyksj.model.views.GoodsDonCategoryDetailView;
 import com.cyksj.model.views.GoodsDonCategoryDetailView;
-import com.cyksj.model.views.UpgradePackageView;
 import com.cyksj.service.mange.CmsGoodsDonService;
 import com.cyksj.service.mange.CmsGoodsDonService;
 import com.cyksj.service.mange.GoodsDonCategoryService;
 import com.cyksj.service.mange.GoodsDonCategoryService;
 import com.cyksj.service.mange.RefreshCacheService;
 import com.cyksj.service.mange.RefreshCacheService;
@@ -33,7 +35,6 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import java.util.HashSet;
 import java.util.HashSet;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
@@ -58,6 +59,8 @@ public class CmsGoodsDonController {
 
 
     private final GoodsDonCategoryService goodsDonCategoryService;
     private final GoodsDonCategoryService goodsDonCategoryService;
 
 
+    private final GoodsDonSkuMapper skuMapper;
+
     @GetMapping("/get")
     @GetMapping("/get")
     public Result<SearchResult<GoodsDonCategoryDetailView>> get(){
     public Result<SearchResult<GoodsDonCategoryDetailView>> get(){
         SearchResult<GoodsDonCategoryDetailView> search = beanSearcher.search(GoodsDonCategoryDetailView.class, MapUtils.flatBuilder(request.getParameterMap())
         SearchResult<GoodsDonCategoryDetailView> search = beanSearcher.search(GoodsDonCategoryDetailView.class, MapUtils.flatBuilder(request.getParameterMap())
@@ -226,4 +229,36 @@ public class CmsGoodsDonController {
         return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDon);
         return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDon);
     }
     }
 
 
+    /**
+     * 获取所有平台以及其规格
+     */
+    @GetMapping("/get/all/goods/sku")
+    public Result<List<GoodsDetailView>> getAllGoodsDetail(Boolean isNoBuyout) {
+        MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
+        //过滤买断制 平台
+        String conditionSql;
+        if (isNoBuyout != null && isNoBuyout) {
+            mapBuilder.field(GoodsDon::getSpecialType).op(Operator.IsNull);
+            conditionSql = "(select count(*) from goods_don_sku sku where sku.goods_id = g.id and sku.months = 300) = 0";
+        } else {
+            conditionSql = "(special_type is null or special_type != 'giftCard')";
+        }
+        conditionSql += "  and exists (select id from goods_don_sku sku where sku.goods_id = g.id limit 1)";
+
+        List<GoodsDetailView> goodsDons = beanSearcher.searchAll(GoodsDetailView.class, mapBuilder
+                .put("condition", conditionSql)
+                .field(GoodsDetailView::getType, 1)
+                .field(GoodsDetailView::getStatus, 1)
+                .field(GoodsDetailView::getDeleted, true)
+                .onlySelect(GoodsDetailView::getId, GoodsDetailView::getTitle)
+                .build());
+        goodsDons.forEach(e->{
+            List<GoodsDonSku> donSkus = skuMapper.selectList(Wrappers.lambdaQuery(GoodsDonSku.class)
+                    .eq(GoodsDonSku::getGoodsId, e.getId())
+                    .eq(GoodsDonSku::getStatus, 1).select(GoodsDonSku::getId, GoodsDonSku::getSpecVal));
+            e.setSkuList(donSkus);
+        });
+        return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDons);
+    }
+
 }
 }

+ 107 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/mj/MidjourneyPaintingController.java

@@ -0,0 +1,107 @@
+package com.cyksj.web.controller.manage.mj;
+
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.dto.Result;
+import com.cyksj.enums.GatewayResponse;
+import com.cyksj.model.entity.MidjourneyPaintingPlaza;
+import com.cyksj.service.midjourney.MidjourneyPaintingPlazaService;
+import com.ejlchina.searcher.BeanSearcher;
+import com.ejlchina.searcher.SearchResult;
+import com.ejlchina.searcher.util.MapUtils;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: MidjourneyPaintingController
+ * 创建者: JavaZou
+ * 创建时间:2024/6/3 17:24
+ */
+@Slf4j
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/manage/mj/painting")
+public class MidjourneyPaintingController {
+	private final MidjourneyPaintingPlazaService midjourneyPaintingPlazaService;
+
+	private final BeanSearcher beanSearcher;
+
+	private final HttpServletRequest request;
+
+	/**
+	 * 新增记录
+	 */
+	@PostMapping("/post")
+	public Result<String> savePainting(@RequestBody MidjourneyPaintingPlaza midjourneyPaintingPlaza) {
+		midjourneyPaintingPlazaService.saveOrUpdatePainting(midjourneyPaintingPlaza);
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
+	/**
+	 * 删除记录
+	 */
+	@DeleteMapping("/delete/{id}")
+	public Result<String> deleteById(@PathVariable Long id) {
+		MidjourneyPaintingPlaza byId = midjourneyPaintingPlazaService.getById(id);
+		if (byId != null && byId.getDeleted()) {
+			byId.setDeleted(false);
+			midjourneyPaintingPlazaService.updateById(byId);
+		}
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
+
+	/**
+	 * 修改记录
+	 */
+	@PutMapping("/update")
+	public Result<String> updatePainting(@RequestBody MidjourneyPaintingPlaza midjourneyPaintingPlaza) {
+		midjourneyPaintingPlazaService.saveOrUpdatePainting(midjourneyPaintingPlaza);
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
+	/**
+	 * 列表
+	 */
+	@GetMapping("/get")
+	public Result<SearchResult<MidjourneyPaintingPlaza>> saveOrUpdatePainting() {
+		SearchResult<MidjourneyPaintingPlaza> search = beanSearcher.search(MidjourneyPaintingPlaza.class, MapUtils.flatBuilder(request.getParameterMap())
+				.field(MidjourneyPaintingPlaza::getDeleted, 1)
+				.build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+	}
+
+	/**
+	 * 上下架
+	 */
+	@PutMapping("/update/status/{id}")
+	public Result<String> updateStatus(@PathVariable Long id) {
+		MidjourneyPaintingPlaza byId = midjourneyPaintingPlazaService.getById(id);
+		if (byId != null) {
+			byId.setStatus(!byId.getStatus());
+			midjourneyPaintingPlazaService.updateById(byId);
+		}
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+
+	/**
+	 * 批量上下架
+	 */
+	@PutMapping("/update/status")
+	public Result<String> updateStatus(@RequestParam(value = "ids") List<Long> ids, Boolean status) {
+		if (CollUtil.isEmpty(ids) || status == null) {
+			throw BusinessRuntimeException.getInstance("参数错误");
+		}
+		midjourneyPaintingPlazaService.update(null, Wrappers.lambdaUpdate(MidjourneyPaintingPlaza.class)
+				.set(MidjourneyPaintingPlaza::getStatus, status)
+				.in(MidjourneyPaintingPlaza::getId, ids)
+				.ne(MidjourneyPaintingPlaza::getStatus, status));
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
+}

+ 19 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/shop/ShopConfigController.java

@@ -1,11 +1,13 @@
 package com.cyksj.web.controller.manage.shop;
 package com.cyksj.web.controller.manage.shop;
 
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.model.entity.Channel;
 import com.cyksj.model.entity.Channel;
 import com.cyksj.model.entity.ShopConfig;
 import com.cyksj.model.entity.ShopConfig;
+import com.cyksj.model.request.ChannelPayReq;
 import com.cyksj.service.mange.channel.ChannelService;
 import com.cyksj.service.mange.channel.ChannelService;
 import com.cyksj.service.mange.shop.ShopConfigService;
 import com.cyksj.service.mange.shop.ShopConfigService;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.BeanSearcher;
@@ -62,4 +64,21 @@ public class ShopConfigController {
         shopConfigService.removeById(id);
         shopConfigService.removeById(id);
        return GatewayResponse.SUCCESS.newBuilder().toResult();
        return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
     }
+
+    /**
+     * 更换渠道支付方式
+     */
+    @PutMapping("/update/channel/pay")
+    @SaCheckPermission("merchant:updateChannelShop")
+    public Result<String> updateChannelPay(@RequestBody ChannelPayReq req) {
+        String wxShopId = req.getWxShopId();
+        String zfbShopId = req.getZfbShopId();
+        if (StrUtil.isAllEmpty(wxShopId, zfbShopId)) {
+            return GatewayResponse.SUCCESS.newBuilder().toResult();
+        }
+        channelService.update(Wrappers.lambdaUpdate(Channel.class)
+                .eq(StrUtil.isNotBlank(wxShopId), Channel::getWxShopId, wxShopId)
+                .eq(StrUtil.isNotBlank(zfbShopId), Channel::getZfbShopId, zfbShopId));
+        return GatewayResponse.SUCCESS.newBuilder().toResult();
+    }
 }
 }

+ 19 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/upgrade/UpgradePackageController.java

@@ -2,11 +2,15 @@ package com.cyksj.web.controller.manage.upgrade;
 
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.map.MapUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.annotation.Log;
 import com.cyksj.common.annotation.Log;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.common.util.Jsons;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.BusinessType;
 import com.cyksj.enums.BusinessType;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.enums.GatewayResponse;
+import com.cyksj.mapper.GoodsDonSkuMapper;
+import com.cyksj.model.entity.GoodsDonSku;
 import com.cyksj.model.entity.UpgradePackage;
 import com.cyksj.model.entity.UpgradePackage;
 import com.cyksj.model.views.UpgradePackageView;
 import com.cyksj.model.views.UpgradePackageView;
 import com.cyksj.service.mange.upgrade.UpgradePackageService;
 import com.cyksj.service.mange.upgrade.UpgradePackageService;
@@ -20,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 
 
 
 /**
 /**
@@ -38,6 +43,8 @@ public class UpgradePackageController {
 
 
     private final BeanSearcher beanSearcher;
     private final BeanSearcher beanSearcher;
 
 
+    private final GoodsDonSkuMapper goodsDonSkuMapper;
+
     /**
     /**
      * 新增套餐
      * 新增套餐
      */
      */
@@ -110,10 +117,21 @@ public class UpgradePackageController {
      * 获取套餐列表
      * 获取套餐列表
      */
      */
     @GetMapping
     @GetMapping
-    public Result<SearchResult<UpgradePackageView>> list() {
+    public Result<SearchResult<UpgradePackageView>> list(Long skuId) {
         log.info("获取套餐列表");
         log.info("获取套餐列表");
         Map<String, Object> build = MapUtils.flatBuilder(request.getParameterMap()).build();
         Map<String, Object> build = MapUtils.flatBuilder(request.getParameterMap()).build();
+        if (skuId != null) {
+            build.put("sku", String.format(" and JSON_CONTAINS(up.sku_ids,'\"%s\"')", skuId));
+        }
         SearchResult<UpgradePackageView> search = beanSearcher.search(UpgradePackageView.class, build);
         SearchResult<UpgradePackageView> search = beanSearcher.search(UpgradePackageView.class, build);
+        search.getDataList().forEach(upgradePackageView -> {
+            try {
+                String specVal = goodsDonSkuMapper.selectList(Wrappers.lambdaQuery(GoodsDonSku.class).in(GoodsDonSku::getId, Jsons.parseList(upgradePackageView.getSkuIds(), Long.class))).stream().map(GoodsDonSku::getSpecVal).collect(Collectors.joining(","));
+                upgradePackageView.setSpecVal(specVal);
+            } catch (Exception e) {
+                throw BusinessRuntimeException.getInstance("获取套餐规格失败");
+            }
+        });
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);
     }
     }
 
 

+ 5 - 0
netflix-web/src/main/java/com/cyksj/web/controller/market/TaskFrontController.java

@@ -1,6 +1,8 @@
 package com.cyksj.web.controller.market;
 package com.cyksj.web.controller.market;
 
 
+import cn.hutool.core.util.StrUtil;
 import com.cyksj.common.annotation.NoSubmit;
 import com.cyksj.common.annotation.NoSubmit;
+import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.mapper.UserMapper;
 import com.cyksj.mapper.UserMapper;
@@ -94,6 +96,9 @@ public class TaskFrontController {
 			badIntentionOpService.isBadOpLoginPhone(request, phoneReq.getPhone());
 			badIntentionOpService.isBadOpLoginPhone(request, phoneReq.getPhone());
 		}
 		}
 		User user = userMapper.selectById(userId);
 		User user = userMapper.selectById(userId);
+		if (StrUtil.isEmpty(phoneReq.getCode())) {
+			throw BusinessRuntimeException.getInstance("请输入验证码");
+		}
 		bindTaskService.bindPhone(user, phoneReq.getPhone(), phoneReq.getCode());
 		bindTaskService.bindPhone(user, phoneReq.getPhone(), phoneReq.getCode());
 		return GatewayResponse.SUCCESS.newBuilder().toResult("绑定手机号成功");
 		return GatewayResponse.SUCCESS.newBuilder().toResult("绑定手机号成功");
 	}
 	}

+ 78 - 2
netflix-web/src/main/java/com/cyksj/web/controller/mirror/MidjourneyController.java

@@ -1,17 +1,31 @@
 package com.cyksj.web.controller.mirror;
 package com.cyksj.web.controller.mirror;
 
 
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.annotation.NoSubmit;
 import com.cyksj.common.annotation.NoSubmit;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.util.IoKit;
 import com.cyksj.common.util.IoKit;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
-import com.cyksj.model.dto.*;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.enums.GatewayResponse;
+import com.cyksj.mapper.GroupsRelationMapper;
+import com.cyksj.mapper.MidjourneyPaintingPlazaMapper;
 import com.cyksj.mapper.MidjourneyUserMapper;
 import com.cyksj.mapper.MidjourneyUserMapper;
+import com.cyksj.model.dto.*;
+import com.cyksj.model.entity.GroupsRelation;
+import com.cyksj.model.entity.MidjourneyPaintingPlaza;
+import com.cyksj.model.entity.GroupsRelation;
+import com.cyksj.model.entity.MidjourneyPaintingPlaza;
 import com.cyksj.model.entity.MidjourneyUser;
 import com.cyksj.model.entity.MidjourneyUser;
 import com.cyksj.model.entity.MidjourneyUserConversation;
 import com.cyksj.model.entity.MidjourneyUserConversation;
 import com.cyksj.model.response.SubmitResult;
 import com.cyksj.model.response.SubmitResult;
+import com.cyksj.model.views.MidjourneyPaintingUserView;
+import com.cyksj.model.views.MidjourneyUserPaintingDayRecordView;
+import com.cyksj.model.views.MidjourneyUserPaintingRecordView;
+import com.cyksj.model.views.MidjourneyPaintingUserView;
+import com.cyksj.model.views.MidjourneyUserPaintingDayRecordView;
+import com.cyksj.model.views.MidjourneyUserPaintingRecordView;
 import com.cyksj.redis.RedisService;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.midjourney.MidjourneyService;
 import com.cyksj.service.midjourney.MidjourneyService;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.BeanSearcher;
@@ -29,7 +43,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
-/**
+/** server/镜像服务/mj绘画
  * @author zwhui
  * @author zwhui
  * @date 2024/4/23 10:31
  * @date 2024/4/23 10:31
  */
  */
@@ -49,6 +63,10 @@ public class MidjourneyController {
     
     
     private final RedisService redisService;
     private final RedisService redisService;
 
 
+    private final GroupsRelationMapper groupsRelationMapper;
+
+    private final MidjourneyPaintingPlazaMapper midjourneyPaintingPlazaMapper;
+
     public MidjourneyUser getUser(){
     public MidjourneyUser getUser(){
         String userToken = request.getHeader("user-token");
         String userToken = request.getHeader("user-token");
 
 
@@ -64,6 +82,9 @@ public class MidjourneyController {
         if(!redisService.hasKey(RedisService.key.MIDJOURNEY_RELAX_LIMIT.getName() + midjourneyUser.getId())){
         if(!redisService.hasKey(RedisService.key.MIDJOURNEY_RELAX_LIMIT.getName() + midjourneyUser.getId())){
             redisService.set(RedisService.key.MIDJOURNEY_RELAX_LIMIT.getName() + midjourneyUser.getId(),midjourneyUser.getMjRelaxNum());
             redisService.set(RedisService.key.MIDJOURNEY_RELAX_LIMIT.getName() + midjourneyUser.getId(),midjourneyUser.getMjRelaxNum());
         }
         }
+        Long relationId = midjourneyUser.getRelationId();
+        GroupsRelation relation = groupsRelationMapper.selectById(relationId);
+        midjourneyUser.setAqType(relation.getAqType());
 
 
         return midjourneyUser;
         return midjourneyUser;
 
 
@@ -361,4 +382,59 @@ public class MidjourneyController {
         String json = new String(bytes, StandardCharsets.UTF_8);
         String json = new String(bytes, StandardCharsets.UTF_8);
         midjourneyService.notifyHook(json);
         midjourneyService.notifyHook(json);
     }
     }
+
+
+
+    /**
+     * mj绘画广场
+     */
+    @GetMapping("/get/painting")
+    public Result<SearchResult<MidjourneyPaintingUserView>> getPaintingCollect() {
+        SearchResult<MidjourneyPaintingUserView> search = beanSearcher.search(MidjourneyPaintingUserView.class, MapUtils.flatBuilder(request.getParameterMap())
+                .build());
+        return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+    }
+
+    /**
+     * 复制mj绘画广场 提示词
+     */
+    @PostMapping("/painting/copy/{id}")
+    public Result<String> resetPaintingCopyNum(@PathVariable Long id) {
+        MidjourneyPaintingPlaza midjourneyPaintingPlaza = midjourneyPaintingPlazaMapper.selectById(id);
+        if (midjourneyPaintingPlaza != null) {
+            midjourneyPaintingPlazaMapper.updatePaintingCopyNum(id);
+        }
+        return GatewayResponse.SUCCESS.newBuilder().toResult();
+    }
+
+    /**
+     * 用户绘画记录
+     */
+    @GetMapping("/get/painting/record")
+    public Result<SearchResult<MidjourneyUserPaintingDayRecordView>> getPaintingRecord(String prompt, Boolean bookmark) {
+        MidjourneyUser user = getUser();
+        String condition = String.format(" and mc.user_id = %s", user.getId());
+        if (StrUtil.isNotBlank(prompt)) {
+            condition += String.format(" and mc.prompt like '%%%s%%'", prompt);
+        }
+        if (bookmark != null) {
+            condition += String.format(" and mc.bookmark is %s", bookmark);
+        }
+        SearchResult<MidjourneyUserPaintingDayRecordView> search = beanSearcher.search(MidjourneyUserPaintingDayRecordView.class, MapUtils.flatBuilder(request.getParameterMap())
+                .put("condition", condition)
+                .orderBy(MidjourneyUserPaintingRecordView::getCreatedTime).desc()
+                .build());
+        String dateSql;
+        for (MidjourneyUserPaintingDayRecordView e : search.getDataList()) {
+            String date = e.getDate();
+            dateSql = String.format(" and DATE_FORMAT(mc.created_time,'%%Y-%%m-%%d') = '%s'", date);
+            List<MidjourneyUserPaintingRecordView> list = beanSearcher.searchAll(MidjourneyUserPaintingRecordView.class, MapUtils.builder()
+                    .put("condition", condition)
+                    .put("date", dateSql)
+                    .orderBy(MidjourneyUserPaintingRecordView::getCreatedTime).desc()
+                    .build());
+            e.setList(list);
+        }
+        return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+    }
 }
 }

+ 24 - 6
netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java

@@ -34,7 +34,6 @@ import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
-import java.io.OutputStream;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.math.RoundingMode;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
@@ -171,10 +170,6 @@ public class MirrorController {
                 return chatgptConversionLimitView;
                 return chatgptConversionLimitView;
             } else {
             } else {
                 response.setStatus(200);
                 response.setStatus(200);
-                //记录提问时间,车次,标题和模型
-                TASK_EXECUTOR.execute(() -> {
-                    chatGptAccountService.saveConversationRecord(userToken, conversationRequest);
-                });
             }
             }
             //5.获取 conversationRequest 中的model 字段,判断是否为 gpt-4 如果为gpt-4 执行 查看是否达到限制方法
             //5.获取 conversationRequest 中的model 字段,判断是否为 gpt-4 如果为gpt-4 执行 查看是否达到限制方法
             //6.如果达到限制,返回状态码 429 并返回文本 xxx
             //6.如果达到限制,返回状态码 429 并返回文本 xxx
@@ -183,6 +178,29 @@ public class MirrorController {
         return new ChatgptConversionLimitView();
         return new ChatgptConversionLimitView();
     }
     }
 
 
+    /**
+     * 对话成功后记录次数
+     */
+    @RequestMapping("/gpt/conversation/notifyUrl")
+    public void conversationNotifyUrl(@RequestParam(value = "isCar", defaultValue = "false") Boolean isCar, @RequestBody ConversationRequest conversationRequest) {
+        //1.从request获取请求头Authorization 并取 值内 'Bearer ' 后的值为usertoken
+        String authorization = request.getHeader("Authorization");
+        String carid = request.getHeader("Carid");
+        conversationRequest.setCarId(carid);
+        String userToken = authorization.substring(7);
+        //2.根据usertoken 查询 chatgpt_user 表中的记录
+        ChatgptUser user = chatGptAccountService.findByUserTokenAndExpireTimeAfter(userToken, LocalDateTime.now());
+        //3.如果记录不存在,返回状态码 401
+        if (user == null) {
+            return;
+        }
+        if(StringUtils.isNotBlank(conversationRequest.getCarId())){
+            TASK_EXECUTOR.execute(() -> {
+                chatGptAccountService.saveConversationRecord(userToken, conversationRequest);
+            });
+        }
+    }
+
 
 
     /**
     /**
      * 获取车队列表
      * 获取车队列表
@@ -239,7 +257,7 @@ public class MirrorController {
      * oai触发车队限制
      * oai触发车队限制
      */
      */
     @GetMapping("/gpt/car/limited")
     @GetMapping("/gpt/car/limited")
-    public Result<String> carLimited(String carId, Long expTime, Boolean isTeam) {
+    public Result<String> carLimited(String carId, Long expTime, @RequestParam(defaultValue = "false") Boolean isTeam) {
         String authorization = request.getHeader("Authorization");
         String authorization = request.getHeader("Authorization");
         String userToken = "";
         String userToken = "";
         if(StringUtils.isNotBlank(authorization)){
         if(StringUtils.isNotBlank(authorization)){

+ 8 - 0
netflix-web/src/main/java/com/cyksj/web/controller/payment/OrderController.java

@@ -19,6 +19,7 @@ import com.cyksj.config.zfb.ZfbProductCode;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayApiCode;
 import com.cyksj.enums.GatewayApiCode;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.enums.GatewayResponse;
+import com.cyksj.mapper.GoodsDonSkuMapper;
 import com.cyksj.mapper.OrderDonWaybillMapper;
 import com.cyksj.mapper.OrderDonWaybillMapper;
 import com.cyksj.mapper.UserMapper;
 import com.cyksj.mapper.UserMapper;
 import com.cyksj.mapper.channel.UserPayEquipmentAvailableBenefitsMapper;
 import com.cyksj.mapper.channel.UserPayEquipmentAvailableBenefitsMapper;
@@ -124,6 +125,9 @@ public class OrderController {
     @Autowired
     @Autowired
     private MidjourneyAccountService midjourneyAccountService;
     private MidjourneyAccountService midjourneyAccountService;
 
 
+    @Autowired
+    private GoodsDonSkuMapper skuMapper;
+
     /**
     /**
      * 支付
      * 支付
      * @author chan
      * @author chan
@@ -165,6 +169,10 @@ public class OrderController {
             cookie.setPath("/");
             cookie.setPath("/");
             response.addCookie(userInfo);
             response.addCookie(userInfo);
         }
         }
+        if (orderDon.getGoodsId() != null && orderDon.getGoodsId() == 26l) {
+            GoodsDonSku sku = skuMapper.selectById(orderDon.getSkuId());
+            orderDon.setIsMirror(sku.getIsMirror());
+        }
 
 
         return GatewayResponse.SUCCESS.newBuilder().toResult(orderDon);
         return GatewayResponse.SUCCESS.newBuilder().toResult(orderDon);
     }
     }

+ 4 - 3
netflix-web/src/main/java/com/cyksj/web/controller/sys/SysConfigController.java

@@ -20,7 +20,10 @@ import com.cyksj.mapper.manage.help.HelpQuestionClassificationMapper;
 import com.cyksj.mapper.manage.help.HelpQuestionMapper;
 import com.cyksj.mapper.manage.help.HelpQuestionMapper;
 import com.cyksj.model.dto.EquipmentConfigDto;
 import com.cyksj.model.dto.EquipmentConfigDto;
 import com.cyksj.model.dto.SysServiceChangeDto;
 import com.cyksj.model.dto.SysServiceChangeDto;
-import com.cyksj.model.entity.*;
+import com.cyksj.model.entity.HelpQuestion;
+import com.cyksj.model.entity.HelpQuestionClassification;
+import com.cyksj.model.entity.SysConfig;
+import com.cyksj.model.entity.SysConfigChangeRecord;
 import com.cyksj.model.views.HelpQuestionClassificationView;
 import com.cyksj.model.views.HelpQuestionClassificationView;
 import com.cyksj.redis.RedisService;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.sys.SysConfigChangeRecordService;
 import com.cyksj.service.sys.SysConfigChangeRecordService;
@@ -34,7 +37,6 @@ import com.ejlchina.searcher.param.Operator;
 import com.ejlchina.searcher.util.MapUtils;
 import com.ejlchina.searcher.util.MapUtils;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
@@ -88,7 +90,6 @@ public class SysConfigController {
 
 
 	@PutMapping("/update")
 	@PutMapping("/update")
 	@Log(module = "系统设置/编辑配置", businessType = BusinessType.PUT, isSaveRequestData = true)
 	@Log(module = "系统设置/编辑配置", businessType = BusinessType.PUT, isSaveRequestData = true)
-	@Transactional(rollbackFor = Throwable.class)
 	public Result<SysConfig> update(@RequestBody SysConfig sysConfig) throws Exception {
 	public Result<SysConfig> update(@RequestBody SysConfig sysConfig) throws Exception {
 		long adminId = StpUtil.getLoginIdAsLong();
 		long adminId = StpUtil.getLoginIdAsLong();
 		Long id = sysConfig.getId();
 		Long id = sysConfig.getId();

+ 6 - 5
netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java

@@ -93,7 +93,7 @@ public class AuthorizationController {
     private final TemplateCommonService templateCommonService;
     private final TemplateCommonService templateCommonService;
 
 
     @GetMapping(value = "/weChat")
     @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);
         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)
         AuthRedirect redirect = new AuthRedirect().setMappingId(mappingId).setSharedId(sharedId).setDsType(dsType).setPid(popularizeId).setDsCode(dsCode)
                 .setCd(customId)
                 .setCd(customId)
                 .setCk(callback)
                 .setCk(callback)
-                .setCt(callbackType);
+                .setCt(callbackType)
+                .setCst(cst);
         String state = Codec.DoBase64.custom().setData(Jsons.toJson(redirect)).encodeAsText();
         String state = Codec.DoBase64.custom().setData(Jsons.toJson(redirect)).encodeAsText();
 
 
         response.sendRedirect(authorizationService.createUrl(state, authType));
         response.sendRedirect(authorizationService.createUrl(state, authType));
@@ -365,7 +366,7 @@ public class AuthorizationController {
      */
      */
     @GetMapping("/get/phone/code")
     @GetMapping("/get/phone/code")
     @NoSubmit
     @NoSubmit
-    public Result<String> getPhoneCode(String phone, Integer digit, @RequestParam(defaultValue = "0") Boolean isFree, Integer cid, String verifyCode) throws Exception {
+    public Result<String> getPhoneCode(String phone, Integer digit, @RequestParam(defaultValue = "0") Boolean isFree, Integer cid, String verifyCode, String ticket,String randStr) throws Exception {
         if (cid == null) cid = 86;
         if (cid == null) cid = 86;
         if (StrUtil.isBlank(phone) || (86 == cid && !Validator.isMobile(phone))) {
         if (StrUtil.isBlank(phone) || (86 == cid && !Validator.isMobile(phone))) {
             throw BusinessRuntimeException.getInstance("请输入正确的手机号");
             throw BusinessRuntimeException.getInstance("请输入正确的手机号");
@@ -379,7 +380,7 @@ public class AuthorizationController {
             throw BusinessRuntimeException.getInstance("短信验证码未失效");
             throw BusinessRuntimeException.getInstance("短信验证码未失效");
         }
         }
         //是否是恶意用户
         //是否是恶意用户
-        badIntentionOpService.checkHandleBadUserOp(phone, verifyCode);
+        badIntentionOpService.checkHandleBadUserOp(phone, verifyCode, ticket, randStr, request);
         String code = StringUtil.getRandomCodeStr(digit);
         String code = StringUtil.getRandomCodeStr(digit);
         Boolean isFlag;
         Boolean isFlag;
         if (!isFree) {
         if (!isFree) {
@@ -463,7 +464,7 @@ public class AuthorizationController {
         GzhOAuth2UserInfo userinfo = weChatService.getUserInfo(token.getAccessToken(), token.getOpenid());
         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) {
         if (user == null) {
             throw BusinessRuntimeException.getInstance("系统错误,请重新授权");
             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);
+	}
+}

+ 2 - 0
netflix-web/src/main/java/com/cyksj/web/controller/user/DistributePopularizeController.java

@@ -110,6 +110,8 @@ public class DistributePopularizeController {
 				data.setSpecVal(goodsDonSku.getSpecVal());
 				data.setSpecVal(goodsDonSku.getSpecVal());
 			}
 			}
 			data.setWaitGetMoney(data.getPoints().divide(points).multiply(money).divide(oneHundred, 2, RoundingMode.DOWN));
 			data.setWaitGetMoney(data.getPoints().divide(points).multiply(money).divide(oneHundred, 2, RoundingMode.DOWN));
+			//原先奖励
+			data.setOriGetMoney(data.getOriPoints().divide(points).multiply(money).divide(oneHundred, 2, RoundingMode.DOWN));
 		});
 		});
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}
 	}