|
@@ -1,5 +1,6 @@
|
|
|
package com.chelvc.cloud.vehicle.server.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -14,14 +15,13 @@ import com.chelvc.cloud.vehicle.client.param.MerchantAuthPagingParam;
|
|
|
import com.chelvc.cloud.vehicle.client.param.MerchantModifyParam;
|
|
|
import com.chelvc.cloud.vehicle.server.copier.MerchantAuthCopier;
|
|
|
import com.chelvc.cloud.vehicle.server.dao.MerchantAuthMapper;
|
|
|
-import com.chelvc.cloud.vehicle.server.entity.Merchant;
|
|
|
import com.chelvc.cloud.vehicle.server.entity.MerchantAuth;
|
|
|
-import com.chelvc.cloud.vehicle.server.entity.UserAuth;
|
|
|
import com.chelvc.cloud.vehicle.server.service.CategoryService;
|
|
|
import com.chelvc.cloud.vehicle.server.service.MerchantAuthService;
|
|
|
import com.chelvc.cloud.vehicle.server.service.MerchantRelationService;
|
|
|
import com.chelvc.cloud.vehicle.server.service.MerchantService;
|
|
|
import com.chelvc.framework.base.context.SessionContextHolder;
|
|
|
+import com.chelvc.framework.common.exception.ResourceUnavailableException;
|
|
|
import com.chelvc.framework.common.function.Executor;
|
|
|
import com.chelvc.framework.common.model.Pagination;
|
|
|
import com.chelvc.framework.common.util.AssertUtils;
|
|
@@ -58,6 +58,11 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
|
|
|
@Override
|
|
|
public Long addMerchantAuth(@NonNull MerchantAuthModifyParam param) {
|
|
|
Long userId = SessionContextHolder.getId();
|
|
|
+ LambdaQueryWrapper<MerchantAuth> wrapper = Wrappers.lambdaQuery();
|
|
|
+ wrapper.eq(MerchantAuth::getApplicant, userId);
|
|
|
+ if(baseMapper.selectCount(wrapper) > 0){
|
|
|
+ throw new ResourceUnavailableException("审核认证已申请");
|
|
|
+ }
|
|
|
if (StringUtils.isEmpty(param.getStoreAddress())){
|
|
|
param.setStoreAddress(param.getStoreAddress());
|
|
|
}
|
|
@@ -96,7 +101,7 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
|
|
|
}else{
|
|
|
this.merchantService.updateMerchant(merchant.getId(),param1);
|
|
|
}
|
|
|
- //首信易个人子商户认证
|
|
|
+ //首信易商户子商户认证
|
|
|
merchantRelationService.registerMerchantId(merchantAuth);
|
|
|
return merchantAuth.getId();
|
|
|
}
|
|
@@ -107,6 +112,10 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
|
|
|
param.setStoreAddress(param.getStoreAddress());
|
|
|
}
|
|
|
MerchantAuth merchantAuth = AssertUtils.nonnull(this.getById(id), "商家认证不存在");
|
|
|
+ String reviewStatus = merchantAuth.getReviewStatus();
|
|
|
+ if("2".equals(reviewStatus)){
|
|
|
+ throw new ResourceUnavailableException("已认证成功,不可重复认证");
|
|
|
+ }
|
|
|
MerchantAuthCopier.INSTANCE.copying(param, merchantAuth);
|
|
|
merchantAuth.setReviewStatus("1");
|
|
|
merchantAuth.setId(id);
|
|
@@ -136,7 +145,8 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
|
|
|
}else{
|
|
|
this.merchantService.updateMerchant(merchantIds.get(0),param1);
|
|
|
}
|
|
|
-
|
|
|
+ //首信易商户子商户认证
|
|
|
+ merchantRelationService.registerMerchantId(merchantAuth);
|
|
|
}
|
|
|
|
|
|
@Override
|