Ver Fonte

子账号解除条件

liangpeile há 1 ano atrás
pai
commit
de0e0ee47b

+ 11 - 0
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/NewPlatformApi.java

@@ -274,6 +274,17 @@ public class NewPlatformApi {
             if (null != list && list.size() > 0) {
                 return CommonResult.failed("删除子账号失败,存在未收款订单无法进行解除");
             }
+
+            LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.in(Order::getStatus, 0, 1, 3, 4);
+            queryWrapper.in(Order::getRefundStatus, 0, 1, 2);
+            queryWrapper.eq(Order::getIsDel, false);
+            queryWrapper.eq(Order::getIsEnterpriseUser, 2);
+            queryWrapper.eq(Order::getUid, byId.getUserId());
+            List<Order> orderList = orderService.list(queryWrapper);
+            if (null != orderList && orderList.size() > 0) {
+                return CommonResult.failed("该用户存在未完成订单,请完成订单后进行认证");
+            }
             user.setId(byId.getUserId());
             user.setIsAllOrders(2);
             user.setIsEnterpriseUser(1);