Преглед изворни кода

Merge branch 'mirror_user_create' into pre

# Conflicts:
#	netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java
#	netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java
#	netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonSkuController.java
zoujiajian пре 2 година
родитељ
комит
262bc6474e

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

@@ -519,7 +519,7 @@
         <foreach collection="list" item="id" open="(" close=")" separator=",">
             #{id}
         </foreach>
-        and status not in ('close','noPayment') and sku_id in (select id from goods_don_sku where goods_id = 26 and
+        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>

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

@@ -619,7 +619,7 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
         GroupsTrips groupsTrips = getGroupsTrips(groupsRelation);
         GoodsDonSku goodsDonSku = skuMapper.selectById(groupsTrips.getSkuId());
 
-        if (goodsDonSku != null && goodsDonSku.getIsMirror() && goodsDonSku.getIsCar()) {
+        if (goodsDonSku != null && goodsDonSku.getGoodsId() == 18 && goodsDonSku.getIsMirror() && goodsDonSku.getIsCar()) {
             ChatgptUser chatgptUser = getChatgptCarUser(userId, relationId, groupsRelation, goodsDonSku);
             return true;
         } else {

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

@@ -183,7 +183,7 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
         GroupsTrips groupsTrips = getGroupsTrips(groupsRelation);
         GoodsDonSku goodsDonSku = skuMapper.selectById(groupsTrips.getSkuId());
 
-        if (goodsDonSku != null && goodsDonSku.getIsMirror()) {
+        if (goodsDonSku != null && goodsDonSku.getGoodsId() == 26 && goodsDonSku.getIsMirror()) {
             return getMidjourneyUser(userId, relationId, groupsRelation, goodsDonSku);
         } else {
             throw BusinessRuntimeException.getInstance("服务器出了点问题");

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

@@ -261,7 +261,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				} catch (Exception e) {
 				}
 			}
-			if (ticket.getGoodsId() == 18 && ticket.getIsMirror()) {
+			if (ticket.getGoodsId() == 18 && ticket.getIsCar() && ticket.getExpiryTime() != null) {
 				//gpt用户镜像
 				ChatGptUserView userInfo = chatGptAccountService.getUserInfo(userId, ticket.getRelationId());
 				ticket.setGptUserLimitNum(userInfo.getLimitNum());

+ 13 - 0
netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java

@@ -831,4 +831,17 @@ public class GroupRelationController {
         RenewalView ticketDetail = groupRelationFrontService.getTicketDetail(userId, relationId);
         return GatewayResponse.SUCCESS.newBuilder().toResult(ticketDetail);
     }
+
+    /**
+     * 车票详情
+     */
+    @GetMapping("/get/detail")
+    public Result<RenewalView> getTicketDetail(Long relationId) {
+        if (relationId == null) {
+            return GatewayResponse.SUCCESS.newBuilder().toResult();
+        }
+        long userId = StpUserUtil.getLoginIdAsLong();
+        RenewalView ticketDetail = groupRelationFrontService.getTicketDetail(userId, relationId);
+        return GatewayResponse.SUCCESS.newBuilder().toResult(ticketDetail);
+    }
 }

+ 4 - 4
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonSkuController.java

@@ -171,11 +171,11 @@ public class CmsGoodsDonSkuController {
         //前后两次价格不同 下架店铺低于这个折扣最低价格
         BigDecimal oldPrice = dbSku.getPrice();
         BigDecimal newPrice = sku.getPrice();
-        //规格变化
-        //下架店铺不在平台设置的价格区间
+        //规格新价 变高
+        //下架店铺低于这个规格价格的品
         goodsDonSkuService.setBelowPriceShopSkuDown(skuId, newPrice);
-	    //套餐包关联规格
-	    goodsDonSkuService.handleGptPackageSku(dbSku,sku);
+        //套餐包关联规格
+        goodsDonSkuService.handleGptPackageSku(dbSku,sku);
         refreshCacheService.refreshYhHomePageCache();
         return GatewayResponse.SUCCESS.newBuilder().toResult();
     }

+ 5 - 4
netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java

@@ -1,11 +1,9 @@
 package com.cyksj.web.controller.mirror;
 
 import cn.hutool.core.date.DateUtil;
-import cn.hutool.json.JSONObject;
 import com.cyksj.common.EnvCommonService;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
-import com.cyksj.common.util.IoKit;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.model.entity.ChatgptSession;
@@ -155,7 +153,7 @@ public class MirrorController {
         if (user == null) {
             response.setStatus(401);
         }
-        if(StringUtils.isNotBlank(conversationRequest.getCarId())){
+        if (StringUtils.isNotBlank(conversationRequest.getCarId())) {
             //4.获取gpt-4 的规则限制
             //text-davinci-002-render-sha 3.5
             ConversationLimitResponse conversationLimitResponse = chatGptAccountService.conversationLimit(userToken, conversationRequest.getModel(), conversationRequest.getCarId(), user, isCar);
@@ -165,7 +163,10 @@ public class MirrorController {
                 //String json = "{\"detail\":{\"message\":\"您的账号已达到GPT-4的使用上限。您现在可以继续使用默认模型,或者重试在\",\"code\":\"model_cap_exceeded\",\"clears_in\":2687}}";
                 ChatgptConversionLimitView chatgptConversionLimitView = new ChatgptConversionLimitView();
                 ChatgptConversionLimitView.Detail detail = new ChatgptConversionLimitView.Detail();
-                detail.setMessage("您目前的套餐已达到GPT-4的使用上限。您可以继续使用3.5,预计 " + DateUtil.format(new Date(conversationLimitResponse.getNextAvailableTime()), "yyyy-MM-dd HH:mm:ss") + " 恢复");
+                String url = "[点击此处升级](https://nf.video/ticket?relationId=%d&pType=pay)";
+
+                String format = String.format(url, user.getRelationId());
+                detail.setMessage("您目前的套餐已达到GPT-4的使用上限。您可以继续使用3.5,预计 " + DateUtil.format(new Date(conversationLimitResponse.getNextAvailableTime()), "yyyy-MM-dd HH:mm:ss") + " 恢复" + ",如需增加滚动时间内可询问次数," + format);
                 chatgptConversionLimitView.setDetail(detail);
                 return chatgptConversionLimitView;
             } else {