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

Merge remote-tracking branch 'origin/chatgpt' into dev

# Conflicts:
#	netflix-common/src/main/java/com/cyksj/common/constant/Constant.java
#	netflix-service/src/main/java/com/cyksj/service/mange/goods/CmsGoodsDonSkuServiceImpl.java
chenbiao пре 2 година
родитељ
комит
ed3c8a0d80
26 измењених фајлова са 561 додато и 14 уклоњено
  1. 11 0
      netflix-dao/src/main/java/com/cyksj/mapper/ChatgptSessionMapper.java
  2. 11 0
      netflix-dao/src/main/java/com/cyksj/mapper/ChatgptUserConversationMapper.java
  3. 11 0
      netflix-dao/src/main/java/com/cyksj/mapper/ChatgptUserMapper.java
  4. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/corp/CorpCustomerAcquisitionLinkExtraCustomerMapper.java
  5. 55 0
      netflix-dao/src/main/java/com/cyksj/model/entity/ChatgptSession.java
  6. 64 0
      netflix-dao/src/main/java/com/cyksj/model/entity/ChatgptUser.java
  7. 42 0
      netflix-dao/src/main/java/com/cyksj/model/entity/ChatgptUserConversation.java
  8. 36 0
      netflix-dao/src/main/java/com/cyksj/model/entity/CorpCustomerAcquisitionLinkExtraCustomer.java
  9. 5 0
      netflix-dao/src/main/java/com/cyksj/model/entity/GoodsDonSku.java
  10. 3 2
      netflix-dao/src/main/java/com/cyksj/model/views/CorpCustomerAcquisitionLinkExtraCustomerView.java
  11. 6 0
      netflix-dao/src/main/java/com/cyksj/model/views/RenewalView.java
  12. 15 0
      netflix-service/src/main/java/com/cyksj/service/chatgpt/ChatGptAccountService.java
  13. 107 0
      netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAccountServiceImpl.java
  14. 0 2
      netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAuthServiceImpl.java
  15. 2 2
      netflix-service/src/main/java/com/cyksj/service/corp/CorpCustomerAcquisitionLinkService.java
  16. 1 0
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpCustomerAcquisitionLinkServiceImpl.java
  17. 3 0
      netflix-service/src/main/java/com/cyksj/service/cps/shop/YhShopManageService.java
  18. 38 7
      netflix-service/src/main/java/com/cyksj/service/cps/shop/YhShopManageServiceImpl.java
  19. 6 0
      netflix-service/src/main/java/com/cyksj/service/mange/group/CmsGroupServiceImpl.java
  20. 1 0
      netflix-service/src/main/java/com/cyksj/service/paypal/PayPalService.java
  21. 16 1
      netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java
  22. 65 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpCustomerAcquistionLinkController.java
  23. 9 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/YhShopUserController.java
  24. 41 0
      netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java
  25. 0 0
      netflix-web/src/main/resources/application-dev.yml
  26. 0 0
      netflix-web/src/main/resources/application-prd.yml

+ 11 - 0
netflix-dao/src/main/java/com/cyksj/mapper/ChatgptSessionMapper.java

@@ -0,0 +1,11 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.ChatgptSession;
+
+/**
+ * @author chan
+ * @date 2024/3/19 10:43
+ */
+public interface ChatgptSessionMapper extends BaseMapper<ChatgptSession> {
+}

+ 11 - 0
netflix-dao/src/main/java/com/cyksj/mapper/ChatgptUserConversationMapper.java

@@ -0,0 +1,11 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.ChatgptUserConversation;
+
+/**
+ * @author chan
+ * @date 2024/3/19 10:44
+ */
+public interface ChatgptUserConversationMapper extends BaseMapper<ChatgptUserConversation> {
+}

+ 11 - 0
netflix-dao/src/main/java/com/cyksj/mapper/ChatgptUserMapper.java

@@ -0,0 +1,11 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.ChatgptUser;
+
+/**
+ * @author chan
+ * @date 2024/3/19 10:44
+ */
+public interface ChatgptUserMapper extends BaseMapper<ChatgptUser> {
+}

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

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

+ 55 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/ChatgptSession.java

@@ -0,0 +1,55 @@
+package com.cyksj.model.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Data;
+
+/**
+ * @author chan
+ * @date 2024/3/18 17:10
+ */
+@Data
+@TableName("chatgpt_session")
+@SearchBean(tables = "chatgpt_session")
+public class ChatgptSession extends BaseEntity {
+
+    /**
+     * 邮箱
+     */
+    private String email;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 状态 1有效 1无效
+     */
+    private Integer status;
+
+    /**
+     * 是否为plus会员
+     */
+    @TableField("isPlus")
+    private Integer isPlus;
+
+    /**
+     * accountId
+     */
+    @TableField("accountId")
+    private Long accountId;
+
+    /**
+     * 官方session
+     */
+    @TableField("officialSession")
+    private String officialSession;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 64 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/ChatgptUser.java

@@ -0,0 +1,64 @@
+package com.cyksj.model.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author chan
+ * @date 2024/3/18 17:10
+ */
+@Data
+@TableName("chatgpt_user")
+@SearchBean(tables = "chatgpt_user")
+public class ChatgptUser extends BaseEntity {
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 头像
+     */
+    private String img;
+
+    /**
+     * 用户凭证
+     */
+    @TableField("userToken")
+    private String userToken;
+
+    /**
+     * 过期时间
+     */
+    @TableField("expireTime")
+    private Date expireTime;
+
+    /**
+     * 是否为plus
+     */
+    @TableField("isPlus")
+    private Integer isPlus;
+
+    /**
+     * sessionId
+     */
+    @TableField("sessionId")
+    private Long sessionId;
+
+    /**
+     * 车票id
+     */
+    @TableField("relationId")
+    private Long relationId;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 42 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/ChatgptUserConversation.java

@@ -0,0 +1,42 @@
+package com.cyksj.model.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Data;
+
+/**
+ * @author chan
+ * @date 2024/3/18 17:10
+ */
+@Data
+@TableName("chatgpt_user_conversation")
+@SearchBean(tables = "chatgpt_user_conversation")
+public class ChatgptUserConversation extends BaseEntity {
+
+
+    /**
+     * 凭证
+     */
+    @TableField("userToken")
+    private String userToken;
+
+    /**
+     * 会话id
+     */
+    @TableField("conversationId")
+    private String conversationId;
+
+    /**
+     * gpt账号id
+     */
+    @TableField("chatgptaccountid")
+    private String chatgptaccountid;
+
+    /**
+     * 会话标题
+     */
+    private String title;
+
+
+}

+ 36 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/CorpCustomerAcquisitionLinkExtraCustomer.java

@@ -0,0 +1,36 @@
+package com.cyksj.model.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: CorpCustomerAcquisitionLinkExtraCustomer
+ * 创建者: JavaZou
+ * 创建时间:2024/3/5 11:37
+ */
+@Getter
+@Setter
+public class CorpCustomerAcquisitionLinkExtraCustomer extends BaseEntity{
+	@NotNull
+	private Long acId;
+
+	@NotNull
+	private Integer serviceId;
+
+	/**
+	 * 值班日期
+	 */
+	@NotNull
+	private String dutyDate;
+
+	@NotNull
+	private String startTime;
+
+	@NotNull
+	private String endTime;
+
+	private Boolean deleted;
+}

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

@@ -159,6 +159,11 @@ public class GoodsDonSku extends BaseEntity {
      */
     private Boolean isDp;
 
+    /**
+     * 是否是镜像服务
+     */
+    private Boolean isMirror;
+
     /**
      * 特定价格
      */

+ 3 - 2
netflix-dao/src/main/java/com/cyksj/model/views/CorpCustomerAcquisitionLinkExtraCustomerView.java

@@ -1,8 +1,6 @@
 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;
@@ -33,6 +31,9 @@ public class CorpCustomerAcquisitionLinkExtraCustomerView {
 	@DbField("cc.service_id")
 	private Integer serviceId;
 
+	@DbField("cc.duty_date")
+	private String dutyDate;
+
 	@DbIgnore
 	private String serviceName;
 

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

@@ -166,4 +166,10 @@ public class RenewalView {
 
     @DbIgnore
     private Integer codeNum;
+
+    /**
+     * 是否为镜像服务
+     */
+    @DbField("sku.is_mirror")
+    private Boolean isMirror;
 }

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

@@ -0,0 +1,15 @@
+package com.cyksj.service.chatgpt;
+
+import com.cyksj.model.entity.Account;
+
+/**
+ * @author chan
+ * @date 2024/3/19 11:01
+ */
+public interface ChatGptAccountService {
+    void addAccount(Account account);
+
+    void upAccount(Account account);
+
+    String getLoginUrl(Long userId, Long relationId);
+}

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

@@ -0,0 +1,107 @@
+package com.cyksj.service.chatgpt.impl;
+
+import cn.hutool.core.lang.UUID;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.mapper.*;
+import com.cyksj.model.entity.*;
+import com.cyksj.service.chatgpt.ChatGptAccountService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author chan
+ * @date 2024/3/19 11:01
+ */
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class ChatGptAccountServiceImpl implements ChatGptAccountService{
+
+    @Value("${chatgpt.domain}")
+    private String GPT_DOMAIN;
+
+    private final ChatgptUserMapper chatgptUserMapper;
+
+    private final ChatgptSessionMapper chatgptSessionMapper;
+
+    private final GroupsRelationMapper groupsRelationMapper;
+
+    private final GroupsMapper groupsMapper;
+
+    private final GoodsDonSkuMapper skuMapper;
+
+    private final UserMapper userMapper;
+
+
+    @Override
+    public void addAccount(Account account) {
+        Integer count = chatgptSessionMapper.selectCount(Wrappers.lambdaQuery(ChatgptSession.class).eq(ChatgptSession::getEmail, account.getAccount()));
+        if(count > 0){
+            throw BusinessRuntimeException.getInstance("镜像服务该账号已存在.");
+        }
+        ChatgptSession chatgptSession = new ChatgptSession();
+        chatgptSession.setOfficialSession(account.getGptRefreshToken());
+        chatgptSession.setEmail(account.getAccount());
+        chatgptSession.setPassword(account.getPassword());
+        chatgptSession.setIsPlus(1);
+        chatgptSession.setAccountId(account.getId());
+        chatgptSession.setStatus(1);
+        chatgptSessionMapper.insert(chatgptSession);
+    }
+
+    @Override
+    public void upAccount(Account account) {
+        ChatgptSession chatgptSession = chatgptSessionMapper.selectOne(Wrappers.lambdaQuery(ChatgptSession.class).eq(ChatgptSession::getEmail, account.getAccount()));
+        if(chatgptSession != null){
+            if(StringUtils.isNotBlank(account.getGptRefreshToken())){
+                chatgptSession.setOfficialSession(account.getGptRefreshToken());
+            }
+            chatgptSession.setEmail(account.getAccount());
+            chatgptSession.setPassword(account.getPassword());
+            chatgptSession.setIsPlus(1);
+            chatgptSession.setAccountId(account.getId());
+            chatgptSession.setStatus(1);
+            chatgptSessionMapper.updateById(chatgptSession);
+        }
+    }
+
+    @Override
+    public String getLoginUrl(Long userId, Long relationId) {
+        GroupsRelation groupsRelation = groupsRelationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class).eq(GroupsRelation::getUserId, userId).eq(GroupsRelation::getId, relationId));
+        if (groupsRelation == null) {
+            throw BusinessRuntimeException.getInstance("车票不存在");
+        }
+        GroupsTrips groupsTrips = groupsMapper.selectById(groupsRelation.getGroupsId());
+        if (groupsTrips == null) {
+            throw BusinessRuntimeException.getInstance("车队异常");
+        }
+        GoodsDonSku goodsDonSku = skuMapper.selectById(groupsTrips.getSkuId());
+        if (goodsDonSku != null && goodsDonSku.getIsMirror()) {
+            ChatgptUser chatgptUser = chatgptUserMapper.selectOne(Wrappers.lambdaQuery(ChatgptUser.class).eq(ChatgptUser::getRelationId, relationId));
+            if (chatgptUser == null) {
+                User user = userMapper.selectById(userId);
+                ChatgptSession chatgptSession = chatgptSessionMapper.selectOne(Wrappers.lambdaQuery(ChatgptSession.class).eq(ChatgptSession::getAccountId, groupsTrips.getAccountId()));
+                //第一次访问
+                chatgptUser = new ChatgptUser();
+                chatgptUser.setExpireTime(groupsRelation.getExpiryTime());
+                chatgptUser.setIsPlus(1);
+                chatgptUser.setSessionId(chatgptSession.getId());
+                chatgptUser.setName(user.getNickname());
+                chatgptUser.setImg(user.getHeadimgurl());
+                chatgptUser.setRelationId(groupsRelation.getId());
+                chatgptUser.setUserToken(UUID.randomUUID().toString());
+                chatgptUserMapper.insert(chatgptUser);
+            }
+
+            return GPT_DOMAIN + "/login_token?access_token=" + chatgptUser.getUserToken();
+        }else {
+            throw BusinessRuntimeException.getInstance("服务器出了点问题");
+        }
+    }
+
+}
+

+ 0 - 2
netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAuthServiceImpl.java

@@ -354,6 +354,4 @@ public class ChatGptAuthServiceImpl implements ChatGptAuthService {
         }
 
     }
-
-
 }

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/corp/CorpCustomerAcquisitionLinkService.java

@@ -3,8 +3,6 @@ package com.cyksj.service.corp;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.cyksj.model.entity.CorpCustomerAcquisitionLink;
 
-import java.util.List;
-
 /**
  * @author chan
  * @date 2023-11-28 15:10
@@ -19,4 +17,6 @@ public interface CorpCustomerAcquisitionLinkService extends IService<CorpCustome
     void up(CorpCustomerAcquisitionLink corpCustomerAcquisitionLink) throws Exception;
 
     void del(Long id) throws Exception;
+
+    void handleCorpLinkSchedulerJob() throws Exception;
 }

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

@@ -127,6 +127,7 @@ public class CorpCustomerAcquisitionLinkServiceImpl extends ServiceImpl<CorpCust
         removeById(id);
     }
 
+    @Override
     public void handleCorpLinkSchedulerJob() throws Exception {
         //立即执行客服值班定时任务
         XxlJobUtil.executeMarkDynamicRuleTagJob(XxlJobInfo.getExecuteTaskInstance(Constant.CORP_LINK_JOB_ID, StrUtil.EMPTY).toString());

+ 3 - 0
netflix-service/src/main/java/com/cyksj/service/cps/shop/YhShopManageService.java

@@ -3,6 +3,7 @@ package com.cyksj.service.cps.shop;
 import cn.hutool.core.date.DateTime;
 import com.cyksj.dto.Result;
 import com.cyksj.model.entity.User;
+import com.cyksj.model.entity.YhShop;
 import com.cyksj.model.request.YhShopApplyMoneyReq;
 import com.cyksj.model.views.YhShopBrokenLineCpsUserWMoneyView;
 import com.cyksj.model.views.YhShopUserWMoneyStatisticsDataView;
@@ -33,4 +34,6 @@ public interface YhShopManageService {
 	User yhShopManageRedirect(long userId);
 
 	Result applyMoney(YhShopApplyMoneyReq applyMoneyReq) throws Exception;
+
+	void addUserShop(YhShop yhShop);
 }

+ 38 - 7
netflix-service/src/main/java/com/cyksj/service/cps/shop/YhShopManageServiceImpl.java

@@ -5,29 +5,31 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.cyksj.common.EnvCommonService;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.util.SmsUtil;
 import com.cyksj.common.util.StringUtil;
 import com.cyksj.dto.Result;
 import com.cyksj.mapper.UserMapper;
-import com.cyksj.mapper.shop.YhShopDistributeMoneyApplyMapper;
+import com.cyksj.mapper.manage.distribute.UserDistributeMapper;
+import com.cyksj.mapper.shop.YhShopApplyRecordMapper;
 import com.cyksj.mapper.shop.YhShopDistributeWaitingSendPointsMapper;
 import com.cyksj.mapper.shop.YhShopMapper;
 import com.cyksj.model.entity.User;
+import com.cyksj.model.entity.UserDistribute;
 import com.cyksj.model.entity.YhShop;
+import com.cyksj.model.entity.YhShopApplyRecord;
 import com.cyksj.model.request.YhShopApplyMoneyReq;
 import com.cyksj.model.views.YhShopBrokenLineCpsUserWMoneyView;
 import com.cyksj.model.views.YhShopUserWMoneyStatisticsDataView;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.mail.MailService;
 import com.cyksj.service.pay.TransferFuncService;
-import com.cyksj.service.user.UserBenefitsService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
+import java.util.Optional;
 
 /*
  *项目名: yhlxj
@@ -48,13 +50,11 @@ public class YhShopManageServiceImpl implements YhShopManageService{
 
 	private final TransferFuncService transferFuncService;
 
-	private final UserBenefitsService userBenefitsService;
-
 	private final YhShopDistributeWaitingSendPointsMapper yhShopDistributeWaitingSendPointsMapper;
 
-	private final YhShopDistributeMoneyApplyMapper yhShopDistributeMoneyApplyMapper;
+	private final YhShopApplyRecordMapper yhShopApplyRecordMapper;
 
-	private final EnvCommonService envCommonService;
+	private final UserDistributeMapper userDistributeMapper;
 
 	@Override
 	public void getLoginCode(Integer type, String login, Integer cid) {
@@ -186,4 +186,35 @@ public class YhShopManageServiceImpl implements YhShopManageService{
 		}
 		return today;
 	}
+
+	@Override
+	@Transactional(rollbackFor = Throwable.class)
+	public void addUserShop(YhShop yhShop) {
+		Long userId = yhShop.getUserId();
+		Integer count = yhShopMapper.selectCount(Wrappers.lambdaQuery(YhShop.class)
+				.eq(YhShop::getUserId, userId));
+		if (count > 0) {
+			return;
+		}
+		yhShop.setVerifyStatus(YhShop.Status.success);
+		Optional.ofNullable(userDistributeMapper.selectOne(Wrappers.lambdaQuery(UserDistribute.class)
+				.eq(UserDistribute::getUserId, userId)
+				.eq(UserDistribute::getDeleted, 1)
+				.last("limit 1"))).ifPresent(e->{
+			yhShop.setBusinessId(e.getBusinessId());
+		});
+		if (yhShop.getBusinessId() != null) {
+			yhShop.setBusinessBindTime(DateTime.now());
+		}
+
+		yhShopMapper.insert(yhShop);
+
+		YhShopApplyRecord yhShopApplyRecord = new YhShopApplyRecord();
+		yhShopApplyRecord.setName(yhShop.getName());
+		yhShopApplyRecord.setUserId(userId);
+		yhShopApplyRecord.setCustomId(yhShop.getCustomId());
+		yhShopApplyRecord.setVerifyStatus(YhShopApplyRecord.Status.success);
+		yhShopApplyRecord.setBusinessId(yhShop.getBusinessId());
+		yhShopApplyRecordMapper.insert(yhShopApplyRecord);
+	}
 }

+ 6 - 0
netflix-service/src/main/java/com/cyksj/service/mange/group/CmsGroupServiceImpl.java

@@ -316,6 +316,12 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
                 throw BusinessRuntimeException.getInstance("该平台下已生成该账号");
             }
         }
+        //Claude3只允许替换一次
+        if (Constant.CALUDE_GOODS_ID.equals(groupsAccountView.getGoodsId())) {
+            Integer count = replaceRecordMapper.selectCount(Wrappers.lambdaQuery(GroupsTripsAccountReplaceRecord.class)
+                    .eq(GroupsTripsAccountReplaceRecord::getGroupsId, groupsAccountView.getGroupsId()));
+            if (count > 0) throw BusinessRuntimeException.getInstance("Claude3账号只允许替换一次");
+        }
         if (afterStartTime == null) {
             afterStartTime = groupsAccountView.getStartTime();
         }

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

@@ -69,6 +69,7 @@ public class PayPalService{
         if("approved".equals(payment.getState())){
             //paypal 交易id
             Sale sale = payment.getTransactions().get(0).getRelatedResources().get(0).getSale();
+            log.info("paypal 支付回调 订单信息:{}", sale);
             Currency transactionFee = sale.getTransactionFee();
             String transationId = sale.getId();
 

+ 16 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java

@@ -36,6 +36,7 @@ import com.cyksj.model.response.ExpiredAccountRep;
 import com.cyksj.model.response.OrderDonAccountRep;
 import com.cyksj.model.views.*;
 import com.cyksj.redis.RedisService;
+import com.cyksj.service.chatgpt.ChatGptAccountService;
 import com.cyksj.service.mange.AccountCommonService;
 import com.cyksj.service.mange.CmsAccountService;
 import com.cyksj.service.mange.CmsGroupService;
@@ -112,6 +113,8 @@ public class CmsAccountController {
 
 	private final AccountBlockedReplaceRecordMapper accountBlockedReplaceRecordMapper;
 
+	private final ChatGptAccountService chatGptAccountService;
+
 	private static final GlobalThreadPoolTaskExecutor TASK_EXECUTOR = GlobalThreadPoolTaskExecutor.getInstance();
 
 	@GetMapping("/get")
@@ -423,7 +426,11 @@ public class CmsAccountController {
 		    if (account.getSkuId() == 178l) {
 			    availableParkingNum = 4;
 		    }
-		    groupsTrips.setAvailableParkingNum(availableParkingNum);
+			GoodsDonSku goodsDonSku = goodsDonSkuMapper.selectById(account.getSkuId());
+			if (goodsDonSku.getIsMirror()) {
+				chatGptAccountService.addAccount(account);
+			}
+			groupsTrips.setAvailableParkingNum(availableParkingNum);
 
 		    groupsTrips.setSkuId(account.getSkuId());
 		    groupsTrips.setAccountId(account.getId());
@@ -590,6 +597,14 @@ public class CmsAccountController {
 				    .eq(GroupsTrips::getStatus, GroupsTrips.Status.down));
 	    }
 	    accountService.updateById(account);
+		//修改镜像服务账号
+		if(db.getSkuId() != null){
+			GoodsDonSku goodsDonSku = goodsDonSkuMapper.selectById(account.getSkuId());
+			if (goodsDonSku.getIsMirror()) {
+				chatGptAccountService.upAccount(account);
+			}
+		}
+
         return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
 

+ 65 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpCustomerAcquistionLinkController.java

@@ -6,21 +6,26 @@ import com.cyksj.common.constant.Constant;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
+import com.cyksj.mapper.corp.CorpCustomerAcquisitionLinkExtraCustomerMapper;
 import com.cyksj.mapper.corp.CorpFollowMapper;
 import com.cyksj.mapper.corp.CorpTagMapper;
 import com.cyksj.mapper.corp.CorpWelcomeTemplateMapper;
 import com.cyksj.model.dto.CorpFollowServiceDto;
 import com.cyksj.model.entity.*;
+import com.cyksj.model.views.CorpCustomerAcquisitionLinkExtraCustomerView;
 import com.cyksj.service.corp.CorpCustomerAcquisitionLinkService;
 import com.cyksj.service.sys.SysConfigService;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.SearchResult;
 import com.ejlchina.searcher.util.MapUtils;
 import lombok.RequiredArgsConstructor;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
+import java.util.Map;
+import java.util.Optional;
 import java.util.stream.Collectors;
 
 /**
@@ -47,6 +52,8 @@ public class CorpCustomerAcquistionLinkController {
 
     private final SysConfigService sysConfigService;
 
+    private final CorpCustomerAcquisitionLinkExtraCustomerMapper corpCustomerAcquisitionLinkExtraCustomerMapper;
+
     /**
      * 新增获客助手链接
      */
@@ -123,4 +130,62 @@ public class CorpCustomerAcquistionLinkController {
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);
     }
 
+    /**
+     * 针对获客链接添加额外客服
+     */
+    @PostMapping("/add/extra/service")
+    public Result<String> addExtraService(@RequestBody @Validated CorpCustomerAcquisitionLinkExtraCustomer extraCustomer) throws Exception {
+	    corpCustomerAcquisitionLinkExtraCustomerMapper.insert(extraCustomer);
+        corpCustomerAcquisitionLinkService.handleCorpLinkSchedulerJob();
+        return GatewayResponse.SUCCESS.newBuilder().toResult();
+    }
+
+    /**
+     * 修改获客链接添加额外客服
+     */
+    @PutMapping("/update/extra/service")
+    public Result<String> updateExtraService(@RequestBody @Validated CorpCustomerAcquisitionLinkExtraCustomer extraCustomer) throws Exception {
+	    corpCustomerAcquisitionLinkExtraCustomerMapper.updateById(extraCustomer);
+        corpCustomerAcquisitionLinkService.handleCorpLinkSchedulerJob();
+        return GatewayResponse.SUCCESS.newBuilder().toResult();
+    }
+
+    /**
+     * 删除获客链接添加额外客服
+     */
+    @DeleteMapping("/del/extra/service/{id}")
+    public Result<String> delExtraService(@PathVariable Long id) {
+	    Optional.ofNullable(corpCustomerAcquisitionLinkExtraCustomerMapper.selectById(id))
+			    .ifPresent(e -> {
+				    if (e.getDeleted()) {
+                        try {
+                            e.setDeleted(false);
+                            corpCustomerAcquisitionLinkExtraCustomerMapper.updateById(e);
+                            corpCustomerAcquisitionLinkService.handleCorpLinkSchedulerJob();
+                        } catch (Exception ex) {
+                        }
+                    }
+			    });
+	    return GatewayResponse.SUCCESS.newBuilder().toResult();
+    }
+
+    /**
+     * 获取获客链接添加额外客服
+     */
+    @GetMapping("/get/extra/service")
+    public Result<SearchResult<CorpCustomerAcquisitionLinkExtraCustomerView>> getExtraService() throws Exception {
+        SearchResult<CorpCustomerAcquisitionLinkExtraCustomerView> search = beanSearcher.search(CorpCustomerAcquisitionLinkExtraCustomerView.class, MapUtils.flatBuilder(request.getParameterMap())
+                .orderBy(CorpCustomerAcquisitionLinkExtraCustomerView::getAcId).asc()
+                .orderBy(CorpCustomerAcquisitionLinkExtraCustomerView::getCreatedTime).desc()
+                .build());
+        SysConfig config = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class)
+                .eq(SysConfig::getSysKey, Constant.serviceKeys.get(1)).last("limit 1"));
+        Map<Integer, List<CorpFollowServiceDto>> serviceMap = Jsons.parseList(config.getSysValue(), CorpFollowServiceDto.class).stream().collect(Collectors.groupingBy(CorpFollowServiceDto::getIndx));
+        search.getDataList().forEach(e->{
+            Optional.ofNullable(serviceMap.get(e.getServiceId()))
+                    .ifPresent(service -> e.setServiceName(service.get(0).getName()));
+        });
+        return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+    }
+
 }

+ 9 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/YhShopUserController.java

@@ -264,4 +264,13 @@ public class YhShopUserController {
 		applyMoneyReq.setUserId(userId);
 		return yhShopManageService.applyMoney(applyMoneyReq);
 	}
+
+	/**
+	 * 后台添加用户店铺
+	 */
+	@PostMapping("/add/user/shop")
+	public Result<String> addUserShop(@RequestBody YhShop yhShop) {
+		yhShopManageService.addUserShop(yhShop);
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
 }

+ 41 - 0
netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java

@@ -0,0 +1,41 @@
+package com.cyksj.web.controller.mirror;
+
+import com.cyksj.service.chatgpt.ChatGptAccountService;
+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.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * /server/镜像服务
+ * @author chan
+ * @date 2024/3/19 14:41
+ */
+@Slf4j
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/applets/mirror")
+public class MirrorController {
+
+    private final ChatGptAccountService chatGptAccountService;
+
+    private final HttpServletResponse response;
+
+
+    /**
+     * GPT车票跳转登录
+     * @param relationId 车票id
+     */
+    @GetMapping("/chatGptMirror/{relationId}")
+    public void chatGptMirror(@PathVariable Long relationId) throws IOException {
+        Long userId = StpUserUtil.getLoginIdAsLong();
+
+        response.sendRedirect(chatGptAccountService.getLoginUrl(userId, relationId));
+    }
+}

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
netflix-web/src/main/resources/application-dev.yml


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
netflix-web/src/main/resources/application-prd.yml


Неке датотеке нису приказане због велике количине промена