Sfoglia il codice sorgente

添加hiboy pro渠道

zoujiajian 4 mesi fa
parent
commit
043d65bd2c

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

@@ -823,6 +823,16 @@ public interface Constant {
      */
     Long HIBOY_CHANNEL_ID = 10L;
 
+    /**
+     * hiboy-pro$100
+     */
+    Long HIBOY_PRO_ONE_CHANNEL_ID = 11L;
+
+    /**
+     * HIBOY-pro$200
+     */
+    Long HIBOY_PRO_TWO_CHANNEL_ID = 12L;
+
 	/**
 	 * Adobe 全家桶
 	 */

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

@@ -389,4 +389,9 @@ public class GoodsDonSku extends BaseEntity {
      * 2.活动代充类型
      */
     private Integer rechargeType;
+
+    /**
+     * 指定代充渠道ID
+     */
+    private Integer rechargeChannelId;
 }

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

@@ -83,6 +83,12 @@ public class UserInvoiceApplyRecordView {
 	@DbField("group_concat(ifnull(o.order_no,ifnull(uod.order_no,vod.order_no)))")
 	private String orderNoStr;
 
+    /**
+     * 默认1普通订单,2是增值订单,3.会员订单
+     */
+    @DbField("any_value(uor.type)")
+    private Integer type;
+
 	@DbField("uar.created_time")
 	private Date createdTime;
 

+ 10 - 6
netflix-service/src/main/java/com/cyksj/server/recharge/impl/GptProxyRechargeServiceImpl.java

@@ -275,6 +275,10 @@ public class GptProxyRechargeServiceImpl implements GptProxyRechargeService {
         if (sku.getRechargeType() == 2) {
             specificChannel = 8;
             subRechargeNum = 12;
+        }
+        //指定了代充渠道 直接用这个渠道 其他不能用
+        if (sku.getRechargeChannelId() != null) {
+            specificChannel = sku.getRechargeChannelId();
         }
 		try {
 			int updateRemainNum = relationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
@@ -327,15 +331,15 @@ public class GptProxyRechargeServiceImpl implements GptProxyRechargeService {
 					.eq(GptRechargeCardKey::getType, gptRechargeCardKeyType)
 					.eq(GptRechargeCardKey::getStatus, Boolean.FALSE)
                     .eq(specificChannel != null, GptRechargeCardKey::getChannelId, specificChannel)
-                    .ne(specificChannel == null, GptRechargeCardKey::getChannelId, Constant.YEAR_AF_DIAN_CHANNEL_ID)
+                    .notIn(specificChannel == null, GptRechargeCardKey::getChannelId, List.of(Constant.YEAR_AF_DIAN_CHANNEL_ID, Constant.HIBOY_PRO_ONE_CHANNEL_ID, Constant.HIBOY_PRO_TWO_CHANNEL_ID))
                     .last("order by channel_id desc, rand() limit 1"));
 			//季、年付卡密不存在 从月付代充卡密中获取
 			if (gptRechargeCardKey == null && gptRechargeCardKeyType == 1) {
-				gptRechargeCardKey = gptRechargeCardKeyMapper.selectOne(Wrappers.lambdaQuery(GptRechargeCardKey.class)
-						.eq(GptRechargeCardKey::getType, 0)
-						.eq(GptRechargeCardKey::getStatus, Boolean.FALSE)
+                gptRechargeCardKey = gptRechargeCardKeyMapper.selectOne(Wrappers.lambdaQuery(GptRechargeCardKey.class)
+                        .eq(GptRechargeCardKey::getType, 0)
+                        .eq(GptRechargeCardKey::getStatus, Boolean.FALSE)
                         .eq(specificChannel != null, GptRechargeCardKey::getChannelId, specificChannel)
-                        .ne(specificChannel == null, GptRechargeCardKey::getChannelId, Constant.YEAR_AF_DIAN_CHANNEL_ID)
+                        .notIn(specificChannel == null, GptRechargeCardKey::getChannelId, List.of(Constant.YEAR_AF_DIAN_CHANNEL_ID, Constant.HIBOY_PRO_ONE_CHANNEL_ID, Constant.HIBOY_PRO_TWO_CHANNEL_ID))
                         .last("order by channel_id desc, rand() limit 1"));
 			}
 			if (gptRechargeCardKey == null) {
@@ -373,7 +377,7 @@ public class GptProxyRechargeServiceImpl implements GptProxyRechargeService {
                 return goAfDianRechargeService.confirmRecharge(relation, gptCardKey, null);
             }
             //hiboy
-            if (channelId == Constant.HIBOY_CHANNEL_ID) {
+            if (channelId == Constant.HIBOY_CHANNEL_ID || channelId == Constant.HIBOY_PRO_ONE_CHANNEL_ID || channelId == Constant.HIBOY_PRO_TWO_CHANNEL_ID) {
                 return hiBoyRechargeService.confirmRecharge(relation, gptCardKey, null);
             }
 			//校验卡密是否可用

+ 7 - 3
netflix-service/src/main/java/com/cyksj/service/mange/gpt/impl/GptRechargeServiceImpl.java

@@ -159,6 +159,10 @@ public class GptRechargeServiceImpl implements GptRechargeService {
         if (sku.getRechargeType() == 2) {
             specificChannel = 8;
             subRechargeNum = 12;
+        }
+        //指定了代充渠道 直接用这个渠道 其他不能用
+        if (sku.getRechargeChannelId() != null) {
+            specificChannel = sku.getRechargeChannelId();
         }
 		try {
 			int updateRemainNum = relationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
@@ -207,7 +211,7 @@ public class GptRechargeServiceImpl implements GptRechargeService {
 					.eq(GptRechargeCardKey::getStatus, Boolean.FALSE)
 					.eq(GptRechargeCardKey::getType, gptRechargeCardKeyType)
                     .eq(specificChannel != null, GptRechargeCardKey::getChannelId, specificChannel)
-                    .ne(specificChannel == null, GptRechargeCardKey::getChannelId, Constant.YEAR_AF_DIAN_CHANNEL_ID)
+                    .notIn(specificChannel == null, GptRechargeCardKey::getChannelId, List.of(Constant.YEAR_AF_DIAN_CHANNEL_ID, Constant.HIBOY_PRO_ONE_CHANNEL_ID, Constant.HIBOY_PRO_TWO_CHANNEL_ID))
                     .last("order by channel_id desc, rand() limit 1"));
 			//季、年付卡密不存在 从月付代充卡密中获取
 			if (gptRechargeCardKey == null && gptRechargeCardKeyType == 1) {
@@ -215,7 +219,7 @@ public class GptRechargeServiceImpl implements GptRechargeService {
                         .eq(GptRechargeCardKey::getType, 0)
                         .eq(GptRechargeCardKey::getStatus, Boolean.FALSE)
                         .eq(specificChannel != null, GptRechargeCardKey::getChannelId, specificChannel)
-                        .ne(specificChannel == null, GptRechargeCardKey::getChannelId, Constant.YEAR_AF_DIAN_CHANNEL_ID)
+                        .notIn(specificChannel == null, GptRechargeCardKey::getChannelId, List.of(Constant.YEAR_AF_DIAN_CHANNEL_ID, Constant.HIBOY_PRO_ONE_CHANNEL_ID, Constant.HIBOY_PRO_TWO_CHANNEL_ID))
                         .last("order by channel_id desc, rand() limit 1"));
 			}
 			if (gptRechargeCardKey == null) {
@@ -254,7 +258,7 @@ public class GptRechargeServiceImpl implements GptRechargeService {
                 return goAfDianRechargeService.confirmRecharge(relation, gptCardKey, cmsUser);
             }
             //hiboy
-            if (gptRechargeCardKey.getChannelId() == Constant.HIBOY_CHANNEL_ID) {
+            if (gptRechargeCardKey.getChannelId() == Constant.HIBOY_CHANNEL_ID || gptRechargeCardKey.getChannelId() == Constant.HIBOY_PRO_ONE_CHANNEL_ID || gptRechargeCardKey.getChannelId() == Constant.HIBOY_PRO_TWO_CHANNEL_ID) {
                 req.setCmsUser(cmsUser);
                 relation.setCardKey(gptCardKey);
                 return hiBoyRechargeService.confirmRecharge(relation, gptCardKey, cmsUser);