zoujiajian há 5 meses atrás
pai
commit
5f80b8966e

+ 22 - 11
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -1866,17 +1866,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 					relation.setCmt(0);
 				}
 				//代充平台以及部分邀请制平台
-				//需填写账号
-				if ((goodsDon.getSpecialType() != null && goodsDon.getSpecialType() == GoodsDon.SpecialType.recharge) || Constant.RECHARGE_INVITE_GOODS_IDS.contains(order.getGoodsId())) {
-					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());
-					}
-				}
+				setRelationInfoIfRecharge(relation, goodsDon, sku);
 				GroupsTrips.Status tripsStatus = groupsTrips.getStatus();
 				//邀请制 不给车票设置时间
 				if (goodsDon.getSecondType() != null && goodsDon.getSecondType() == 1) {
@@ -1977,6 +1967,27 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		}
 	}
 
+	private void setRelationInfoIfRecharge(GroupsRelation relation, GoodsDon goodsDon, GoodsDonSku sku) {
+		//邀请制代充平台
+		if ((goodsDon.getSpecialType() != null && goodsDon.getSpecialType() == GoodsDon.SpecialType.recharge) || Constant.RECHARGE_INVITE_GOODS_IDS.contains(goodsDon.getId())) {
+			//多邻国个人规格
+			if (goodsDon.getId() == Constant.DLG_GID && !ObjectUtil.equal(Constant.DLG_DX_SKU_ID, sku.getId())) {
+				return;
+			}
+			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);
+		}
+	}
+
 	private void createNanoUser(Long userId, Long relationId, GoodsDonSku sku) {
 		//nano
 		//是否存在nano 推广体验车票