zoujiajian 6 달 전
부모
커밋
9a3f120733

+ 1 - 6
netflix-service/src/main/java/com/cyksj/service/claude/ClaudeCodeService.java

@@ -19,7 +19,6 @@ import com.cyksj.model.views.ClaudeCodeUserInfoView;
 import com.cyksj.model.views.ClaudeCodeUserResetRecordView;
 import com.ejlchina.searcher.SearchResult;
 
-import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -137,9 +136,5 @@ public interface ClaudeCodeService {
 
 	void adjClaudeCodeUserPoints(Long userId, Integer points, String type, String description) throws Exception;
 
-	BigDecimal getCcRemainDeductMoney(long userId);
-
-	void ccRefund(long userId) throws Exception;
-
-	void trans(long userId);
+	void generateOrUpdateClaudeCodeUser(Long relationUserId, Long relationId, Integer claudeDailyLimit, Integer claudePermanentBalance, Date expiryTime, Boolean isUpgrade, Long orderId, Long renewSkuId, Date renewExpiryTime, String planName, List<Long> userIdList);
 }

+ 6 - 99
netflix-service/src/main/java/com/cyksj/service/claude/impl/ClaudeCodeServiceImpl.java

@@ -22,7 +22,10 @@ import com.cyksj.mapper.manage.distribute.DistributeWaitingSendPointsMapper;
 import com.cyksj.model.dto.ClaudeCodeDeductDto;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.manage.views.GroupsRelationView;
-import com.cyksj.model.request.*;
+import com.cyksj.model.request.ClaudeCodeApiKeysReq;
+import com.cyksj.model.request.ClaudeCodeCreditCardUseReq;
+import com.cyksj.model.request.ClaudeCodeDelReq;
+import com.cyksj.model.request.CreditResetReq;
 import com.cyksj.model.request.codex.CodexUserPackageReq;
 import com.cyksj.model.response.ClaudeCodeRewardDetailsResp;
 import com.cyksj.model.response.CreditResetResp;
@@ -33,9 +36,6 @@ import com.cyksj.redis.RedisService;
 import com.cyksj.service.api.ClaudeCodexApiService;
 import com.cyksj.service.claude.ClaudeCodeService;
 import com.cyksj.service.codex.CodexService;
-import com.cyksj.service.order.OrderRefundService;
-import com.cyksj.service.relation.GroupRelationClearService;
-import com.cyksj.service.relation.GroupRelationFrontService;
 import com.cyksj.service.user.UserBindRelationService;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.SearchResult;
@@ -108,14 +108,6 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
 
 	private final ClaudeCodeDeductOrderRelateMapper claudeCodeDeductOrderRelateMapper;
 
-	private final GroupRelationFrontService groupRelationFrontService;
-
-	private final GroupRelationClearService clearService;
-
-	private final GoodsDonSkuMapper goodsDonSkuMapper;
-
-	private final OrderRefundService orderRefundService;
-
 	@Override
 	public void generateOrUpdateClaudeCodeUserInfo(Long orderId, Long relationId, Long userId, GoodsDonSku sku, Integer orderType) {
 		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
@@ -172,7 +164,8 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
 		}
 	}
 
-	private void generateOrUpdateClaudeCodeUser(Long relationUserId, Long relationId, Integer claudeDailyLimit, Integer claudePermanentBalance, Date expiryTime, Boolean isUpgrade, Long orderId, Long renewSkuId, Date renewExpiryTime, String planName, List<Long> userIdList) {
+	@Override
+	public void generateOrUpdateClaudeCodeUser(Long relationUserId, Long relationId, Integer claudeDailyLimit, Integer claudePermanentBalance, Date expiryTime, Boolean isUpgrade, Long orderId, Long renewSkuId, Date renewExpiryTime, String planName, List<Long> userIdList) {
 		ClaudeCodeUser claudeCodeUser = claudeCodeUserMapper.selectOne(Wrappers.lambdaQuery(ClaudeCodeUser.class).eq(ClaudeCodeUser::getRelationId, relationId).last("limit 1"));
 		if (claudeCodeUser == null) {
 			claudeCodeUser = new ClaudeCodeUser();
@@ -1206,70 +1199,6 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
 		}
 	}
 
-	@Override
-	public BigDecimal getCcRemainDeductMoney(long userId) {
-		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
-		GroupsRelationView relationView = beanSearcher.searchFirst(GroupsRelationView.class, MapUtils.builder()
-				.field(GroupsRelationView::getGoodsId, Constant.CLAUDE_CODE_GOODS_ID)
-				.field(GroupsRelationView::getUserId, userIdList).op(Operator.InList)
-				.field(GroupsRelationView::getExpiryTime, DateTime.now()).op(Operator.GreaterThan)
-				.build());
-		if (relationView == null) {
-			return BigDecimal.ZERO;
-		}
-		Long relationId = relationView.getId();
-		ClaudeCodeUser claudeCodeUser = claudeCodeUserMapper.selectOne(Wrappers.lambdaQuery(ClaudeCodeUser.class).eq(ClaudeCodeUser::getRelationId, relationId).last("limit 1"));
-		OrderDon oriOrderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class).eq(OrderDon::getRelationId, relationId).in(OrderDon::getUserId, userIdList).notIn(OrderDon::getStatus, Constant.noOrderAllStatus).eq(OrderDon::getOrderType, 1).orderByDesc(OrderDon::getId).last("limit 1"));
-		ClaudeCodeDeductDto claudeCodeDeductDto = getDeductMoney(relationId, oriOrderDon.getSkuId(), claudeCodeUser.getRenewSkuId(), claudeCodeUser.getRenewOrderId(), claudeCodeUser.getRenewExpiryTime(), relationView.getStartTime(), relationView.getExpiryTime(), DateTime.now(), userIdList, null);
-		return claudeCodeDeductDto.getDeductMoney();
-	}
-
-	@Override
-	public void ccRefund(long userId) throws Exception {
-		BigDecimal ccRemainDeductMoney = getCcRemainDeductMoney(userId);
-		if (ccRemainDeductMoney.compareTo(BigDecimal.ZERO) == 0) {
-			throw BusinessRuntimeException.getInstance("车票剩余价值为0,无法退款");
-		}
-		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
-		ClaudeCodeUser claudeCodeUser = claudeCodeUserMapper.selectOne(Wrappers.lambdaQuery(ClaudeCodeUser.class).in(ClaudeCodeUser::getUserId, userIdList).last("limit 1"));
-		GroupsRelation groupsRelation = relationMapper.selectById(claudeCodeUser.getRelationId());
-
-		Long relationId = groupsRelation.getId();
-		OrderDon oriOrderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class).eq(OrderDon::getRelationId, relationId).in(OrderDon::getUserId, userIdList).notIn(OrderDon::getStatus, Constant.noOrderAllStatus).eq(OrderDon::getOrderType, 1).orderByDesc(OrderDon::getId).last("limit 1"));
-		GoodsDonSku sku = goodsDonSkuMapper.selectById(oriOrderDon.getSkuId());
-		GoodsDon goodsDon = goodsDonMapper.selectById(oriOrderDon.getGoodsId());
-		if (ccRemainDeductMoney.compareTo(oriOrderDon.getMoney()) > 0) {
-			throw BusinessRuntimeException.getInstance("请联系客服退款");
-		} else {
-			//直接退原订单
-			ccRefund(goodsDon, sku, oriOrderDon, ccRemainDeductMoney, BigDecimal.ZERO);
-		}
-		clearService.clearTicket(groupsRelation, UserTicketClearedRecord.Source.refund);
-	}
-
-	@Override
-	@Transactional(rollbackFor = Throwable.class)
-	public void trans(long userId) {
-		BigDecimal ccRemainDeductMoney = getCcRemainDeductMoney(userId);
-		if (ccRemainDeductMoney.compareTo(BigDecimal.ZERO) == 0) {
-			throw BusinessRuntimeException.getInstance("车票剩余价值为0,不可转换");
-		}
-
-		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
-
-		ClaudeCodeUser claudeCodeUser = claudeCodeUserMapper.selectOne(Wrappers.lambdaQuery(ClaudeCodeUser.class).in(ClaudeCodeUser::getUserId, userIdList).last("limit 1"));
-		GroupsRelation groupsRelation = relationMapper.selectById(claudeCodeUser.getRelationId());
-
-		//获取默认规格车票
-		Long skuId = Constant.CC_TRANS_SKU_ID;
-		Long relationId = groupRelationFrontService.getTicket(userId,skuId , false);
-		clearService.clearTicket(groupsRelation, UserTicketClearedRecord.Source.cc_trans_other);
-
-		BigDecimal transDeduct = ccRemainDeductMoney.multiply(BigDecimal.valueOf(1.2));
-		GoodsDonSku sku = goodsDonSkuMapper.selectById(skuId);
-		generateOrUpdateClaudeCodeUser(userId, relationId, sku.getClaudeDailyLimit(), transDeduct.intValue(), DateUtil.offsetMonth(DateTime.now(), sku.getMonths()), false, null, null, null, sku.getSpecVal(), userIdList);
-	}
-
 	/**
 	 * 获取订单单价
 	 */
@@ -1371,26 +1300,4 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
 		}
 		return deductMoney;
 	}
-
-	public void ccRefund(GoodsDon goodsDon, GoodsDonSku sku, OrderDon orderDon, BigDecimal refundMoney, BigDecimal refundBalance) throws Exception {
-		//调用第三方接口退款
-		OrderRefundReq refundReq = new OrderRefundReq();
-		refundReq.setRefundMoney(refundMoney);
-		refundReq.setRefundType("money");
-		String outNo = orderRefundService.centerRefund(refundReq, orderDon);
-		orderDon.setRefundMoney(refundMoney);
-		orderDon.setStatus(OrderDon.Status.refund);
-		orderDon.setRefundDesc("cc售后退款");
-		orderDonMapper.updateById(orderDon);
-
-		String refundType;
-		if (refundMoney.compareTo(BigDecimal.ZERO) > 0 && refundBalance.compareTo(BigDecimal.ZERO) > 0) {
-			refundType = "bxj";
-		} else if (refundMoney.compareTo(BigDecimal.ZERO) == 0 && refundBalance.compareTo(BigDecimal.ZERO) > 0) {
-			refundType = "balance";
-		} else {
-			refundType = orderDon.getType().name();
-		}
-		orderRefundService.refundRecord(orderDon, refundMoney, null, "系统", goodsDon, sku, outNo, refundType, null);
-	}
 }

+ 0 - 6
netflix-service/src/main/java/com/cyksj/service/distribute/impl/DistributeServiceImpl.java

@@ -25,11 +25,9 @@ import com.cyksj.mapper.shop.YhShopUserPlatDistributeRateMapper;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.request.UserDistributeReq;
 import com.cyksj.redis.RedisService;
-import com.cyksj.service.claude.ClaudeCodeService;
 import com.cyksj.service.distribute.DistributeService;
 import com.cyksj.service.distribute.UserDistributeRateChangeRecordService;
 import com.cyksj.service.market.task.TaskService;
-import com.cyksj.service.relation.GroupRelationFrontService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.dao.DuplicateKeyException;
@@ -87,12 +85,8 @@ public class DistributeServiceImpl implements DistributeService {
 
 	private final DistributeGeneralSkuRateMapper generalSkuRateMapper;
 
-	private final ClaudeCodeService claudeCodeService;
-
 	private final UserMapper userMapper;
 
-	private final GroupRelationFrontService groupRelationFrontService;
-
 	private final BusinessDistributeDefaultRateConfigMapper businessDistributeDefaultRateConfigMapper;
 
 	private final BusinessDistributeDefaultSkuRateConfigMapper businessDistributeDefaultSkuRateConfigMapper;

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

@@ -16,6 +16,7 @@ import com.cyksj.model.response.NetflixRefundInfoResp;
 import com.cyksj.model.views.*;
 import com.ejlchina.searcher.SearchResult;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /*
@@ -135,4 +136,10 @@ public interface GroupRelationFrontService {
 	List<GoodsCategorySkuView> getYoutubeReplaceOtherSkus() throws Exception;
 
 	OrderRefundDto getYoutubeRefundInfo(long userId, Long relationId);
+
+	BigDecimal getCcRemainDeductMoney(long userId);
+
+	void ccRefund(long userId) throws Exception;
+
+	void ccTrans(long userId);
 }

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

@@ -30,10 +30,7 @@ import com.cyksj.mapper.sys.SysConfigMapper;
 import com.cyksj.mapper.sys.SysEmailMapper;
 import com.cyksj.mapper.vip.VipGoodsSkuMapper;
 import com.cyksj.mapper.vip.VipUserMapper;
-import com.cyksj.model.dto.ErrorNetflixChangeOtherSkuTicketDto;
-import com.cyksj.model.dto.NetflixRecoverReceivedGptConditionDto;
-import com.cyksj.model.dto.OrderRefundDto;
-import com.cyksj.model.dto.TicketChangeDto;
+import com.cyksj.model.dto.*;
 import com.cyksj.model.entity.*;
 import com.cyksj.model.manage.views.AccountView;
 import com.cyksj.model.manage.views.GroupsRelationView;
@@ -236,6 +233,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 
 	private final NetflixCompensateReceivedRecordMapper netflixCompensateReceivedRecordMapper;
 
+	private final ClaudeCodeUserMapper claudeCodeUserMapper;
 	@Override
 	public SearchResult<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId, String account, String orderNo, Integer cmt) {
 		User u = userMapper.selectById(userId);
@@ -2687,6 +2685,91 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		return null;
 	}
 
+	@Override
+	public BigDecimal getCcRemainDeductMoney(long userId) {
+		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+		GroupsRelationView relationView = beanSearcher.searchFirst(GroupsRelationView.class, MapUtils.builder()
+				.field(GroupsRelationView::getGoodsId, Constant.CLAUDE_CODE_GOODS_ID)
+				.field(GroupsRelationView::getUserId, userIdList).op(Operator.InList)
+				.field(GroupsRelationView::getExpiryTime, DateTime.now()).op(Operator.GreaterThan)
+				.build());
+		if (relationView == null) {
+			return BigDecimal.ZERO;
+		}
+		Long relationId = relationView.getId();
+		ClaudeCodeUser claudeCodeUser = claudeCodeUserMapper.selectOne(Wrappers.lambdaQuery(ClaudeCodeUser.class).eq(ClaudeCodeUser::getRelationId, relationId).last("limit 1"));
+		OrderDon oriOrderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class).eq(OrderDon::getRelationId, relationId).in(OrderDon::getUserId, userIdList).notIn(OrderDon::getStatus, Constant.noOrderAllStatus).eq(OrderDon::getOrderType, 1).orderByDesc(OrderDon::getId).last("limit 1"));
+		ClaudeCodeDeductDto claudeCodeDeductDto = claudeCodeService.getDeductMoney(relationId, oriOrderDon.getSkuId(), claudeCodeUser.getRenewSkuId(), claudeCodeUser.getRenewOrderId(), claudeCodeUser.getRenewExpiryTime(), relationView.getStartTime(), relationView.getExpiryTime(), DateTime.now(), userIdList, null);
+		return claudeCodeDeductDto.getDeductMoney();
+	}
+
+	@Override
+	public void ccRefund(long userId) throws Exception {
+		BigDecimal ccRemainDeductMoney = getCcRemainDeductMoney(userId);
+		if (ccRemainDeductMoney.compareTo(BigDecimal.ZERO) == 0) {
+			throw BusinessRuntimeException.getInstance("车票剩余价值为0,无法退款");
+		}
+		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+		ClaudeCodeUser claudeCodeUser = claudeCodeUserMapper.selectOne(Wrappers.lambdaQuery(ClaudeCodeUser.class).in(ClaudeCodeUser::getUserId, userIdList).last("limit 1"));
+		GroupsRelation groupsRelation = groupsRelationMapper.selectById(claudeCodeUser.getRelationId());
+
+		Long relationId = groupsRelation.getId();
+		OrderDon oriOrderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class).eq(OrderDon::getRelationId, relationId).in(OrderDon::getUserId, userIdList).notIn(OrderDon::getStatus, Constant.noOrderAllStatus).eq(OrderDon::getOrderType, 1).orderByDesc(OrderDon::getId).last("limit 1"));
+		GoodsDonSku sku = goodsDonSkuMapper.selectById(oriOrderDon.getSkuId());
+		GoodsDon goodsDon = goodsDonMapper.selectById(oriOrderDon.getGoodsId());
+		if (ccRemainDeductMoney.compareTo(oriOrderDon.getMoney()) > 0) {
+			throw BusinessRuntimeException.getInstance("请联系客服退款");
+		} else {
+			//直接退原订单
+			ccRefund(goodsDon, sku, oriOrderDon, ccRemainDeductMoney, BigDecimal.ZERO);
+		}
+		clearService.clearTicket(groupsRelation, UserTicketClearedRecord.Source.refund);
+	}
+
+	@Override
+	public void ccTrans(long userId) {
+		BigDecimal ccRemainDeductMoney = getCcRemainDeductMoney(userId);
+		if (ccRemainDeductMoney.compareTo(BigDecimal.ZERO) == 0) {
+			throw BusinessRuntimeException.getInstance("车票剩余价值为0,不可转换");
+		}
+
+		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+
+		ClaudeCodeUser claudeCodeUser = claudeCodeUserMapper.selectOne(Wrappers.lambdaQuery(ClaudeCodeUser.class).in(ClaudeCodeUser::getUserId, userIdList).last("limit 1"));
+		GroupsRelation groupsRelation = groupsRelationMapper.selectById(claudeCodeUser.getRelationId());
+
+		//获取默认规格车票
+		Long skuId = Constant.CC_TRANS_SKU_ID;
+		Long relationId = getTicket(userId,skuId , false);
+		clearService.clearTicket(groupsRelation, UserTicketClearedRecord.Source.cc_trans_other);
+
+		BigDecimal transDeduct = ccRemainDeductMoney.multiply(BigDecimal.valueOf(1.2));
+		GoodsDonSku sku = goodsDonSkuMapper.selectById(skuId);
+		claudeCodeService.generateOrUpdateClaudeCodeUser(userId, relationId, sku.getClaudeDailyLimit(), transDeduct.intValue(), DateUtil.offsetMonth(DateTime.now(), sku.getMonths()), false, null, null, null, sku.getSpecVal(), userIdList);
+	}
+
+	public void ccRefund(GoodsDon goodsDon, GoodsDonSku sku, OrderDon orderDon, BigDecimal refundMoney, BigDecimal refundBalance) throws Exception {
+		//调用第三方接口退款
+		OrderRefundReq refundReq = new OrderRefundReq();
+		refundReq.setRefundMoney(refundMoney);
+		refundReq.setRefundType("money");
+		String outNo = orderRefundService.centerRefund(refundReq, orderDon);
+		orderDon.setRefundMoney(refundMoney);
+		orderDon.setStatus(OrderDon.Status.refund);
+		orderDon.setRefundDesc("cc售后退款");
+		orderDonMapper.updateById(orderDon);
+
+		String refundType;
+		if (refundMoney.compareTo(BigDecimal.ZERO) > 0 && refundBalance.compareTo(BigDecimal.ZERO) > 0) {
+			refundType = "bxj";
+		} else if (refundMoney.compareTo(BigDecimal.ZERO) == 0 && refundBalance.compareTo(BigDecimal.ZERO) > 0) {
+			refundType = "balance";
+		} else {
+			refundType = orderDon.getType().name();
+		}
+		orderRefundService.refundRecord(orderDon, refundMoney, null, "系统", goodsDon, sku, outNo, refundType, null);
+	}
+
 	private GroupsRelationView checkYoutubeTime(Long relationId, Long userId) {
 		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
 		GroupsRelationView relationView = beanSearcher.searchFirst(GroupsRelationView.class, MapUtils.builder()

+ 0 - 31
netflix-web/src/main/java/com/cyksj/web/controller/claude/ClaudeCodeController.java

@@ -42,7 +42,6 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -600,34 +599,4 @@ public class ClaudeCodeController {
 		ClaudeCodeDeductDto claudeCodeDeductDto = claudeCodeService.getDeductSkuMoney(userId, relationId, upgradeSkuId);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(claudeCodeDeductDto);
 	}
-
-	/**
-	 * cc车票剩余价值
-	 */
-	@GetMapping("/get/remain/deductMoney")
-	public Result<BigDecimal> getCcRemainDeductMoney() {
-		long userId = StpUserUtil.getLoginIdAsLong();
-		BigDecimal ccRemainDeductMoney = claudeCodeService.getCcRemainDeductMoney(userId);
-		return GatewayResponse.SUCCESS.newBuilder().toResult(ccRemainDeductMoney);
-	}
-
-	/**
-	 * cc售后退款
-	 */
-	@PutMapping("/cc/refund")
-	public Result<String> ccRefund() throws Exception {
-		long userId = StpUserUtil.getLoginIdAsLong();
-		claudeCodeService.ccRefund(userId);
-		return GatewayResponse.SUCCESS.newBuilder().toResult();
-	}
-
-	/**
-	 * cc 售后量能转化
-	 */
-	@PostMapping("/trans")
-	public Result<String> trans() {
-		long userId = StpUserUtil.getLoginIdAsLong();
-		claudeCodeService.trans(userId);
-		return GatewayResponse.SUCCESS.newBuilder().toResult();
-	}
 }

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

@@ -40,6 +40,7 @@ import com.cyksj.model.response.NetflixRefundInfoResp;
 import com.cyksj.model.views.*;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.chatgpt.ChatGptAuthService;
+import com.cyksj.service.claude.ClaudeCodeService;
 import com.cyksj.service.mange.CmsOrderDonService;
 import com.cyksj.service.mange.coupon.CouponCommonService;
 import com.cyksj.service.mange.ticket.TicketAdvertiseConfigClickRecordService;
@@ -156,6 +157,8 @@ public class GroupRelationController {
 
     private final GroupsMapper groupsMapper;
 
+    private final ClaudeCodeService claudeCodeService;
+
     private final static Sequence SEQUENCE = new Sequence(0);
 
     @RequestMapping("/get/renewal")
@@ -1625,4 +1628,34 @@ public class GroupRelationController {
         OrderRefundDto orderRefundDto = groupRelationFrontService.getYoutubeRefundInfo(userId, relationId);
         return GatewayResponse.SUCCESS.newBuilder().toResult(orderRefundDto);
     }
+
+    /**
+     * cc车票剩余价值
+     */
+    @GetMapping("/get/remain/deductMoney")
+    public Result<BigDecimal> getCcRemainDeductMoney() {
+        long userId = StpUserUtil.getLoginIdAsLong();
+        BigDecimal ccRemainDeductMoney = groupRelationFrontService.getCcRemainDeductMoney(userId);
+        return GatewayResponse.SUCCESS.newBuilder().toResult(ccRemainDeductMoney);
+    }
+
+    /**
+     * cc售后退款
+     */
+    @PutMapping("/cc/refund")
+    public Result<String> ccRefund() throws Exception {
+        long userId = StpUserUtil.getLoginIdAsLong();
+        groupRelationFrontService.ccRefund(userId);
+        return GatewayResponse.SUCCESS.newBuilder().toResult();
+    }
+
+    /**
+     * cc 售后量能转化
+     */
+    @PostMapping("/trans")
+    public Result<String> trans() {
+        long userId = StpUserUtil.getLoginIdAsLong();
+        groupRelationFrontService.ccTrans(userId);
+        return GatewayResponse.SUCCESS.newBuilder().toResult();
+    }
 }