Quellcode durchsuchen

修补商户审核功能

Yangzw vor 7 Monaten
Ursprung
Commit
aae5e3968c

+ 9 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapply/MerchantApplyController.java

@@ -1,5 +1,6 @@
 package cn.newfeifan.mall.sale.controller.admin.merchantapply;
 
+import cn.newfeifan.mall.module.enums.MerchantApplyCheckStatusEnum;
 import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplyPageReqVO;
 import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplyRespVO;
 import cn.newfeifan.mall.sale.controller.admin.merchantapply.vo.MerchantApplySaveReqVO;
@@ -80,6 +81,14 @@ public class MerchantApplyController {
         return success(BeanUtils.toBean(pageResult, MerchantApplyRespVO.class));
     }
 
+    @GetMapping("/getMerchantApplyCount")
+    @Operation(summary = "获得商户申请待审核数量")
+    @PreAuthorize("@ss.hasPermission('sale:merchant-apply:query')")
+    public CommonResult<Integer> getMerchantApplyCount(@Valid MerchantApplyPageReqVO pageReqVO) {
+        pageReqVO.setCheckStatus(MerchantApplyCheckStatusEnum.WAIT_AUDIT.getType());
+        return success(merchantApplyService.getMerchantApplyPage(pageReqVO).getList().size());
+    }
+
     @GetMapping("/export-excel")
     @Operation(summary = "导出商户申请 Excel")
     @PreAuthorize("@ss.hasPermission('sale:merchant-apply:export')")

+ 6 - 4
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/merchant/MerchantServiceImpl.java

@@ -1,5 +1,6 @@
 package cn.newfeifan.mall.sale.service.merchant;
 
+import cn.newfeifan.mall.framework.common.exception.ErrorCode;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.framework.common.util.json.JsonUtils;
 import cn.newfeifan.mall.module.product.service.sku.ProductSkuService;
@@ -36,7 +37,6 @@ import java.util.concurrent.TimeUnit;
 
 import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.newfeifan.mall.module.enums.ErrorCodeConstants.MERCHANT_NOT_EXISTS;
-import static cn.newfeifan.mall.module.system.enums.ErrorCodeConstants.USER_MOBILE_EXISTS;
 
 /**
  * 商户 Service 实现类
@@ -73,15 +73,17 @@ public class MerchantServiceImpl implements MerchantService {
         // 如果这个手机号已经存在, 则提示该手机号已经存在
         AdminUserDO adminUserDO = userMapper.selectByMobile(merchant.getContactNumber());
         if (adminUserDO != null) {
-            throw exception(USER_MOBILE_EXISTS);
+            ErrorCode ERROR = new ErrorCode(1_002_003_001, "用户手机号已经存在商户账号");
+            throw exception(ERROR);
         }
         adminUserService.createUserByMobile(merchant.getId(), shopId, merchant.getContactNumber(), merchant.getContact(), true);
 
         // 不同的手机号, 创建不同的账号
         if (mobile != null) {
-            AdminUserDO userDO = userMapper.selectByMobile(merchant.getContactNumber());
+            AdminUserDO userDO = userMapper.selectByMobile(mobile);
             if (userDO != null) {
-                throw exception(USER_MOBILE_EXISTS);
+                ErrorCode ERROR = new ErrorCode(1_002_003_001, "联络人手机号已经存在商户账号");
+                throw exception(ERROR);
             }
             adminUserService.createUserByMobile(merchant.getId(), shopId, mobile, merchant.getContact(),false);
         }