zoujiajian il y a 1 an
Parent
commit
6fae2fa374

+ 13 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GalaxyCoinRenewTicketsView.java

@@ -1,5 +1,6 @@
 package com.cyksj.model.views;
 
+import com.cyksj.model.entity.GroupsRelation;
 import com.ejlchina.searcher.bean.DbField;
 import com.ejlchina.searcher.bean.DbIgnore;
 import com.ejlchina.searcher.bean.SearchBean;
@@ -120,6 +121,18 @@ public class GalaxyCoinRenewTicketsView {
 	@DbField("gr.is_vip")
 	private Boolean isVip;
 
+	/**
+	 * 代充类型
+	 */
+	@DbField("gr.recharge_status")
+	private GroupsRelation.RechargeStatus rechargeStatus;
+
+	@DbIgnore
+	private String remainDays;
+
+	@DbField("gt.status")
+	private String groupsStatus;
+
 	/**
 	 * 最高抵扣可用银河币
 	 */

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/order/impl/VipOrderDonServiceImpl.java

@@ -499,7 +499,7 @@ public class VipOrderDonServiceImpl extends ServiceImpl<VipOrderDonMapper, VipOr
 					throw BusinessRuntimeException.getInstance("银河币抵扣系统错误,请联系客服");
 				}
 				//每个银河币可抵扣金额
-				BigDecimal deductMoneyEachCoin = galaxyCoinPayConfigDto.getGalaxyCoin().divide(galaxyCoinPayConfigDto.getMoney());
+				BigDecimal deductMoneyEachCoin = galaxyCoinPayConfigDto.getMoney().divide(galaxyCoinPayConfigDto.getGalaxyCoin());
 				//此次使用抵扣金额
 				BigDecimal thisDeductMoney = toUseGalaxyCoin.multiply(deductMoneyEachCoin);
 				//该笔平台最高可抵扣金额

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

@@ -1,6 +1,7 @@
 package com.cyksj.web.controller.group;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.BetweenFormater;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
@@ -1300,6 +1301,14 @@ public class GroupRelationController {
                 .field(GalaxyCoinRenewTicketsView::getUserId, userIdList).op(Operator.InList)
                 .put("condition", conditionSql)
                 .field(GalaxyCoinRenewTicketsView::getIsVip, Boolean.FALSE)
+                //非独立账号
+                .field(GalaxyCoinRenewTicketsView::getMonths, 300).op(Operator.NotEqual)
+                //购买
+                .field(GalaxyCoinRenewTicketsView::getAqType, 1)
+                //非代充
+                .field(GalaxyCoinRenewTicketsView::getRechargeStatus).op(Operator.IsNull)
+                //车队状态
+                .field(GalaxyCoinRenewTicketsView::getGroupsStatus, GroupsTrips.Status.waiting.name()).op(Operator.NotEqual)
                 .field(GalaxyCoinRenewTicketsView::getStatus, List.of(GroupsRelation.Status.validity.name(), GroupsRelation.Status.outside.name()))
                 .orderBy(GalaxyCoinRenewTicketsView::getExpiryTime).asc()
                 .build());
@@ -1342,6 +1351,17 @@ public class GroupRelationController {
             //此次最大可抵扣银河币数量
             BigDecimal maxDeductGalaxyCoin = maxPriceSku.getPrice().multiply(maxRate).divide(payMoney).multiply(payGalaxyCoin);
             galaxyCoinRenewTicketsView.setMaxGalaxyCoinDeduct(userGalaxyCoin.compareTo(maxDeductGalaxyCoin) > 0 ? maxDeductGalaxyCoin : userGalaxyCoin);
+            if (galaxyCoinRenewTicketsView.getExpiryTime() != null && galaxyCoinRenewTicketsView.getGoodsType() == 1) {
+                String remainDays = DateUtil.formatBetween(now, galaxyCoinRenewTicketsView.getExpiryTime(), BetweenFormater.Level.DAY);
+                if ("0天".equals(remainDays)) {
+                    remainDays = "小于1天";
+                } else {
+                    //当天也算
+                    int days = Integer.parseInt(remainDays.substring(0, remainDays.indexOf("天")));
+                    remainDays = days + 1 + "天";
+                }
+                galaxyCoinRenewTicketsView.setRemainDays(remainDays);
+            }
         }
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);
     }