|
|
@@ -3581,13 +3581,22 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
if (user == null) throw BusinessRuntimeException.getGatewayApiCode(GatewayApiCode.CMS_TOKEN_VALID);
|
|
|
if (user.getIsBlack()) throw BusinessRuntimeException.getInstance("系统检测操作异常,请稍后再试");
|
|
|
}
|
|
|
- List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, user);
|
|
|
- int noPayCount = upgradeOrderDonMapper.selectCount(Wrappers.lambdaQuery(UpgradeOrderDon.class)
|
|
|
- .in(UpgradeOrderDon::getUserId, userIdList)
|
|
|
- .eq(UpgradeOrderDon::getRelationId, payRequest.getRelationId())
|
|
|
- .eq(UpgradeOrderDon::getStatus, UpgradeOrderDon.Status.noPayment.toString()));
|
|
|
- if (noPayCount > 0) {
|
|
|
- throw new BusinessRuntimeException("您有未支付订单.");
|
|
|
+ if (payRequest.getCmt() == 1) {
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, user);
|
|
|
+ int noPayCount = upgradeOrderDonMapper.selectCount(Wrappers.lambdaQuery(UpgradeOrderDon.class)
|
|
|
+ .in(UpgradeOrderDon::getUserId, userIdList)
|
|
|
+ .eq(UpgradeOrderDon::getRelationId, payRequest.getRelationId())
|
|
|
+ .eq(UpgradeOrderDon::getStatus, UpgradeOrderDon.Status.noPayment.toString()));
|
|
|
+ if (noPayCount > 0) {
|
|
|
+ throw new BusinessRuntimeException("您有未支付订单.");
|
|
|
+ }
|
|
|
+ } else if (payRequest.getCmt() == 2) {
|
|
|
+ UserMirrorShop userMirrorShop = userMirrorShopMapper.selectOne(Wrappers.lambdaQuery(UserMirrorShop.class)
|
|
|
+ .eq(UserMirrorShop::getCustomId, payRequest.getCustomId())
|
|
|
+ .last("limit 1"));
|
|
|
+ if (!userMirrorShop.getStatus()) {
|
|
|
+ throw BusinessRuntimeException.getInstance("店铺已关闭");
|
|
|
+ }
|
|
|
}
|
|
|
GroupsRelation groupsRelation = getGroupsRelation(payRequest.getUserId(), payRequest.getRelationId());
|
|
|
GroupsTrips groupsTrips = getGroupsTrips(groupsRelation);
|
|
|
@@ -3987,6 +3996,13 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
if (noPayCount > 0) {
|
|
|
throw new BusinessRuntimeException("您有未支付订单.");
|
|
|
}
|
|
|
+ } else if (payRequest.getCmt() == 2) {
|
|
|
+ UserMirrorShop userMirrorShop = userMirrorShopMapper.selectOne(Wrappers.lambdaQuery(UserMirrorShop.class)
|
|
|
+ .eq(UserMirrorShop::getCustomId, payRequest.getCustomId())
|
|
|
+ .last("limit 1"));
|
|
|
+ if (!userMirrorShop.getStatus()) {
|
|
|
+ throw BusinessRuntimeException.getInstance("店铺已关闭");
|
|
|
+ }
|
|
|
}
|
|
|
GroupsRelation groupsRelation = getGroupsRelation(payRequest.getUserId(), payRequest.getRelationId());
|
|
|
GroupsTrips groupsTrips = getGroupsTrips(groupsRelation);
|