Просмотр исходного кода

fix 兑换码兑换代充GPT商品,记录代充次数

zoujiajian 1 год назад
Родитель
Сommit
2c5043ec44

+ 8 - 0
netflix-service/src/main/java/com/cyksj/service/exchange/impl/ExchangeCodeServiceImpl.java

@@ -389,8 +389,16 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
 		relation.setOrderId(orderDon.getId());
 		//邀请制代充平台
 		if ((goodsDon.getSpecialType() != null && goodsDon.getSpecialType() == GoodsDon.SpecialType.recharge) || Constant.RECHARGE_INVITE_GOODS_IDS.contains(goodsDon.getId())) {
+			relation.setStartTime(null);
+			relation.setExpiryTime(null);
 			relation.setRechargeStatus(GroupsRelation.RechargeStatus.waiting);
 			relation.setSubmitTime(DateTime.now());
+			//GPT代充
+			if (goodsDon.getId() == Constant.GPT_RECHARGE_GOODS_ID) {
+				//代充次数
+				relation.setRechargeNum(sku.getMonths());
+				relation.setRechargeRemainNum(relation.getRechargeNum());
+			}
 			groupsRelationMapper.updateById(relation);
 		}
 		return relation;