|
@@ -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);
|
|
|
}
|