zoujiajian 1 ano atrás
pai
commit
dbfe6d46d5

+ 19 - 9
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -358,9 +358,17 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		AtomicBoolean isGiftCardPay = new AtomicBoolean(false);
 		//若存在店铺id,校验店铺状态
 		String customId = payRequest.getCustomId();
+		UserMirrorShop userMirrorShop = null;
 		Long yhsId = 0l;
 		if (payRequest.getCmt() == 1) {
 			yhsId = yhShopFrontService.checkShopCustomIdAndReturnShopId(customId);
+		} else if (payRequest.getCmt() == 2) {
+			userMirrorShop = userMirrorShopMapper.selectOne(Wrappers.lambdaQuery(UserMirrorShop.class)
+					.eq(UserMirrorShop::getCustomId, customId)
+					.last("limit 1"));
+			if (!userMirrorShop.getStatus()) {
+				throw BusinessRuntimeException.getInstance("店铺已关闭");
+			}
 		}
 		if (CollUtil.isNotEmpty(giftCards)) {
 			goodsId = payRequest.getGoodsId();
@@ -593,15 +601,10 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		//下单手机号
 		orderDon.setPhone(orderPhone);
 		//镜像店铺订单 区分车票
-		if (payRequest.getCmt() == 2) {
-			UserMirrorShop userMirrorShop = userMirrorShopMapper.selectOne(Wrappers.lambdaQuery(UserMirrorShop.class)
-					.eq(UserMirrorShop::getCustomId, customId)
-					.last("limit 1"));
-			if (userMirrorShop != null) {
-				relation.setCmt(2);
-				relation.setYhsId(userMirrorShop.getId());
-				groupsRelationMapper.updateById(relation);
-			}
+		if (payRequest.getCmt() == 2 && userMirrorShop != null) {
+			relation.setCmt(2);
+			relation.setYhsId(userMirrorShop.getId());
+			groupsRelationMapper.updateById(relation);
 		}
 		this.saveOrUpdate(orderDon);
 
@@ -978,6 +981,13 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		if (payRequest.getCmt() == 1) {
 			//若存在店铺id,校验店铺状态
 			yhsId = yhShopFrontService.checkShopCustomIdAndReturnShopId(customId);
+		} else if (payRequest.getCmt() == 2) {
+			UserMirrorShop userMirrorShop = userMirrorShopMapper.selectOne(Wrappers.lambdaQuery(UserMirrorShop.class)
+					.eq(UserMirrorShop::getCustomId, customId)
+					.last("limit 1"));
+			if (!userMirrorShop.getStatus()) {
+				throw BusinessRuntimeException.getInstance("店铺已关闭");
+			}
 		}
 
 		//是否有其他规格的续费订单 若有请先关闭