增加商家重新入驻申请接口,查询审核状态信息接口
This commit is contained in:
parent
f9c648bc0e
commit
15def95223
@ -58,7 +58,7 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
|
|||||||
@Override
|
@Override
|
||||||
public Pair<String, String> getEsignPlatformMobileAndLicenseNumber() {
|
public Pair<String, String> getEsignPlatformMobileAndLicenseNumber() {
|
||||||
QueryWrapper<EsignPlatformInfo> queryWrapper = new QueryWrapper();
|
QueryWrapper<EsignPlatformInfo> queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.eq("type", 0).select("mobile", "license_number", "legal_person_mobile");
|
queryWrapper.eq("type", 0).select("telephone", "license_number", "legal_person_mobile");
|
||||||
List<EsignPlatformInfo> esignPlatformInfos = list(queryWrapper);
|
List<EsignPlatformInfo> esignPlatformInfos = list(queryWrapper);
|
||||||
if (CollectionUtil.isEmpty(esignPlatformInfos)) {
|
if (CollectionUtil.isEmpty(esignPlatformInfos)) {
|
||||||
return null;
|
return null;
|
||||||
@ -69,7 +69,7 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
|
|||||||
if (!PhoneNumberUtils.checkPhoneNumber(mobile) && StrUtil.isNotBlank(esignPlatformInfo.getLegal_person_mobile())) {
|
if (!PhoneNumberUtils.checkPhoneNumber(mobile) && StrUtil.isNotBlank(esignPlatformInfo.getLegal_person_mobile())) {
|
||||||
mobile = esignPlatformInfo.getLegal_person_mobile();
|
mobile = esignPlatformInfo.getLegal_person_mobile();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Pair.of(mobile, esignPlatformInfo.getLicense_number());
|
return Pair.of(mobile, esignPlatformInfo.getLicense_number());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ package com.suisung.mall.shop.store.controller.mobile;
|
|||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
|
import com.suisung.mall.common.modules.merch.ShopMerchEntry;
|
||||||
import com.suisung.mall.common.service.impl.BaseControllerImpl;
|
import com.suisung.mall.common.service.impl.BaseControllerImpl;
|
||||||
import com.suisung.mall.shop.esign.service.FileAndTemplateService;
|
import com.suisung.mall.shop.esign.service.FileAndTemplateService;
|
||||||
import com.suisung.mall.shop.store.service.ShopMerchEntryService;
|
import com.suisung.mall.shop.store.service.ShopMerchEntryService;
|
||||||
@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Api(tags = "店铺基础信息表")
|
@Api(tags = "店铺基础信息表")
|
||||||
@RestController
|
@RestController
|
||||||
@ -63,10 +66,42 @@ public class ShopMerchEntryController extends BaseControllerImpl {
|
|||||||
return shopMerchEntryService.shopMerchEntryDetail(null, jsonParam.getStr("mobile"), null);
|
return shopMerchEntryService.shopMerchEntryDetail(null, jsonParam.getStr("mobile"), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "通过手机号mobile获取商家入驻审核状态", notes = "通过手机号获取商家入驻审核状态")
|
@ApiOperation(value = "通过手机号mobile获取商家入驻审核状态", notes = "通过手机号获取商家入驻审核状态,远程调用用途")
|
||||||
@RequestMapping(value = "/approval/status", method = RequestMethod.POST)
|
@RequestMapping(value = "/approval/status", method = RequestMethod.POST)
|
||||||
public Integer shopMerchEntryApprovalStatus(@RequestBody JSONObject jsonParam) {
|
public Integer shopMerchEntryApprovalStatus(@RequestBody JSONObject jsonParam) {
|
||||||
// approvalStatus 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
// approvalStatus 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
||||||
return shopMerchEntryService.shopMerchEntryApprovalStatus(jsonParam.getStr("mobile"));
|
ShopMerchEntry record = shopMerchEntryService.shopMerchEntryApprovalInfo(jsonParam.getStr("mobile"));
|
||||||
|
if (record == null || record.getApproval_status() == null) {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
return record.getApproval_status();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "通过手机号mobile获取商家入驻审核状态", notes = "通过手机号获取商家入驻审核状态,终端接口调用")
|
||||||
|
@RequestMapping(value = "/fresh/approval/status", method = RequestMethod.POST)
|
||||||
|
public CommonResult shopMerchEntryApprovalStatus2(@RequestBody JSONObject jsonParam) {
|
||||||
|
// approvalStatus 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
||||||
|
ShopMerchEntry record = shopMerchEntryService.shopMerchEntryApprovalInfo(jsonParam.getStr("mobile"));
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
if (record == null || record.getApproval_status() == null) {
|
||||||
|
result.put("id", 0L);
|
||||||
|
result.put("approval_status", 4);
|
||||||
|
result.put("approval_remark", "");
|
||||||
|
result.put("approval_invalid_col", "[]");
|
||||||
|
} else {
|
||||||
|
result.put("id", record.getId());
|
||||||
|
result.put("approval_status", record.getApproval_status());
|
||||||
|
result.put("approval_remark", record.getApproval_remark());
|
||||||
|
result.put("approval_invalid_col", record.getApproval_invalid_col());
|
||||||
|
}
|
||||||
|
|
||||||
|
return CommonResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "商家重新申请入驻商城平台", notes = "商家申请入驻材料被驳回的时候,修正材料,重新申请入驻")
|
||||||
|
@RequestMapping(value = "/re-apply", method = RequestMethod.POST)
|
||||||
|
public CommonResult shopMerchEntryReApply(@RequestBody JSONObject shopMerchEntryJSON) {
|
||||||
|
return shopMerchEntryService.shopMerchEntryReApply(shopMerchEntryJSON);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,13 +24,21 @@ public interface ShopMerchEntryService {
|
|||||||
CommonResult storeBusinessCategoryList();
|
CommonResult storeBusinessCategoryList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品入驻申请
|
* 商家(第一次)申请入驻商城平台
|
||||||
*
|
*
|
||||||
* @param shopMerchEntryJSON
|
* @param shopMerchEntryJSON
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CommonResult shopMerchEntryApply(JSONObject shopMerchEntryJSON);
|
CommonResult shopMerchEntryApply(JSONObject shopMerchEntryJSON);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家重新申请入驻商城平台
|
||||||
|
*
|
||||||
|
* @param shopMerchEntryJSON
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CommonResult shopMerchEntryReApply(JSONObject shopMerchEntryJSON);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商家入驻申请列表
|
* 商家入驻申请列表
|
||||||
*
|
*
|
||||||
@ -79,7 +87,7 @@ public interface ShopMerchEntryService {
|
|||||||
* @param loginMobile
|
* @param loginMobile
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer shopMerchEntryApprovalStatus(String loginMobile);
|
ShopMerchEntry shopMerchEntryApprovalInfo(String loginMobile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据商家手机号、营业执照、审批状态获取有效的商家入驻申请记录
|
* 根据商家手机号、营业执照、审批状态获取有效的商家入驻申请记录
|
||||||
|
|||||||
@ -33,6 +33,7 @@ import org.springframework.data.util.Pair;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -76,7 +77,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品入驻申请
|
* 商家重新申请入驻商城平台
|
||||||
*
|
*
|
||||||
* @param shopMerchEntryJSON
|
* @param shopMerchEntryJSON
|
||||||
* @return
|
* @return
|
||||||
@ -100,7 +101,7 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
|||||||
ShopMerchEntry record = JSONUtil.toBean(shopMerchEntryJSON, ShopMerchEntry.class);
|
ShopMerchEntry record = JSONUtil.toBean(shopMerchEntryJSON, ShopMerchEntry.class);
|
||||||
if (record == null || StrUtil.isBlank(record.getLogin_mobile())) {
|
if (record == null || StrUtil.isBlank(record.getLogin_mobile())) {
|
||||||
log.error("###商家入驻参数转换失败###");
|
log.error("###商家入驻参数转换失败###");
|
||||||
return CommonResult.failed("缺少必要参数!");
|
return CommonResult.failed("参数转换失败,请联系管理员!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isBlank(record.getStore_name()) || StrUtil.isBlank(record.getStore_address())
|
if (StrUtil.isBlank(record.getStore_name()) || StrUtil.isBlank(record.getStore_address())
|
||||||
@ -126,17 +127,12 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
|||||||
return CommonResult.failed("个人身份证号码有误!");
|
return CommonResult.failed("个人身份证号码有误!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(record.getLogin_mobile())) {
|
if (StrUtil.isNotBlank(record.getLogin_mobile()) && !PhoneNumberUtils.checkPhoneNumber(record.getLogin_mobile())) {
|
||||||
if (!PhoneNumberUtils.checkPhoneNumber(record.getLogin_mobile())) {
|
return CommonResult.failed("申请人手机号码有误!");
|
||||||
return CommonResult.failed("申请人手机号码有误!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(record.getLegal_person_mobile())) {
|
if (StrUtil.isNotBlank(record.getLegal_person_mobile()) && !PhoneNumberUtils.checkPhoneNumber(record.getLegal_person_mobile())) {
|
||||||
// String mobile = StrUtil.startWith(record.getLegal_person_mobile(), "+") ? record.getLegal_person_mobile() : CommonConstant.IDD_ZH_CN + record.getLegal_person_mobile();
|
return CommonResult.failed("法人手机号码有误!");
|
||||||
if (!PhoneNumberUtils.checkPhoneNumber(record.getLegal_person_mobile())) {
|
|
||||||
return CommonResult.failed("法人手机号码有误!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查企业、法人或个人的营业执照或身份证
|
// 检查企业、法人或个人的营业执照或身份证
|
||||||
@ -168,6 +164,8 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
record.setCreated_by(userId);
|
record.setCreated_by(userId);
|
||||||
|
record.setApproval_status(CommonConstant.MCH_APPR_STA_PADDING);
|
||||||
|
record.setApproval_remark("您的申请入驻平台材料已提交,待审中,请耐心等待!");
|
||||||
record.setStatus(CommonConstant.Enable);
|
record.setStatus(CommonConstant.Enable);
|
||||||
if (!add(record)) {
|
if (!add(record)) {
|
||||||
return CommonResult.failed("入驻信息提交失败!");
|
return CommonResult.failed("入驻信息提交失败!");
|
||||||
@ -186,6 +184,77 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
|||||||
return CommonResult.success();
|
return CommonResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家重新申请入驻商城平台
|
||||||
|
*
|
||||||
|
* @param shopMerchEntryJSON
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CommonResult shopMerchEntryReApply(JSONObject shopMerchEntryJSON) {
|
||||||
|
// 检查是否已登录?
|
||||||
|
String userId = "0";
|
||||||
|
|
||||||
|
// UserDto user = getCurrentUser();
|
||||||
|
// if (user == null || user.getId() == null) {
|
||||||
|
// return CommonResult.failed("请先登录!");
|
||||||
|
// }
|
||||||
|
// userId = user.getId().toString();
|
||||||
|
|
||||||
|
// 参数校验流程
|
||||||
|
if (shopMerchEntryJSON == null || ObjectUtil.isEmpty(shopMerchEntryJSON.get("id"))) {
|
||||||
|
return CommonResult.failed("缺少必要参数!");
|
||||||
|
}
|
||||||
|
|
||||||
|
ShopMerchEntry record = JSONUtil.toBean(shopMerchEntryJSON, ShopMerchEntry.class);
|
||||||
|
if (record == null) {
|
||||||
|
log.error("###商家入驻参数转换失败###");
|
||||||
|
return CommonResult.failed("参数转换失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验身份证,手机号格式
|
||||||
|
if (StrUtil.isNotBlank(record.getLegal_person_id_number()) && !StringUtils.validateIDCard(record.getLegal_person_id_number())) {
|
||||||
|
return CommonResult.failed("法人身份证号码有误!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(record.getIndividual_id_number()) && !StringUtils.validateIDCard(record.getIndividual_id_number())) {
|
||||||
|
return CommonResult.failed("个人身份证号码有误!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(record.getLogin_mobile()) && !PhoneNumberUtils.checkPhoneNumber(record.getLogin_mobile())) {
|
||||||
|
return CommonResult.failed("申请人手机号码有误!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(record.getLegal_person_mobile()) && !PhoneNumberUtils.checkPhoneNumber(record.getLegal_person_mobile())) {
|
||||||
|
return CommonResult.failed("法人手机号码有误!");
|
||||||
|
}
|
||||||
|
|
||||||
|
record.setLogin_mobile(null);// 手机号不能更改
|
||||||
|
record.setCreated_by(userId);
|
||||||
|
record.setApproval_status(CommonConstant.MCH_APPR_STA_PADDING);
|
||||||
|
record.setApproval_remark("您的重新申请入驻平台材料已提交,待审中,请耐心等待!");
|
||||||
|
record.setApproval_invalid_col("[]"); // 清除历史审核无效字段
|
||||||
|
record.setUpdated_by(userId);
|
||||||
|
record.setUpdated_at(new Date());
|
||||||
|
record.setStatus(CommonConstant.Enable);
|
||||||
|
if (!updateById(record)) {
|
||||||
|
return CommonResult.failed("重新申请入驻提交失败!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 尊敬的管理员,商家 ${name},提交了入驻我们平台的申请,请及时对相关资质材料予以审核,以便推进后续流程。
|
||||||
|
// 获取平台方的手机号码,发送短信通知
|
||||||
|
Pair<String, String> mobileAndLicenseNumber = esignPlatformInfoService.getEsignPlatformMobileAndLicenseNumber();
|
||||||
|
if (mobileAndLicenseNumber != null) {
|
||||||
|
Map<String, Object> tmplArgs = new HashMap<>(1);
|
||||||
|
tmplArgs.put("name", "重新修正再"); // 商家公司名称
|
||||||
|
// 所有店铺管理员的发送邮件, 提醒商家:您有一笔新的订单 ${order_id},请及时处理。
|
||||||
|
shopMessageTemplateService.aliyunSmsSend(mobileAndLicenseNumber.getFirst(), "SMS_479760276", tmplArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CommonResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商家入驻申请列表
|
* 商家入驻申请列表
|
||||||
*
|
*
|
||||||
@ -343,27 +412,29 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl<ShopMerchEntryMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商家入驻审核状态
|
* 获取商家入驻审核信息
|
||||||
* approval_status 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
* approval_status 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
||||||
*
|
*
|
||||||
* @param loginMobile
|
* @param loginMobile
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Integer shopMerchEntryApprovalStatus(String loginMobile) {
|
public ShopMerchEntry shopMerchEntryApprovalInfo(String loginMobile) {
|
||||||
if (StrUtil.isBlank(loginMobile)) {
|
if (StrUtil.isBlank(loginMobile)) {
|
||||||
return 1;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopMerchEntry> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("login_mobile", loginMobile).orderByAsc("id");
|
queryWrapper.eq("login_mobile", loginMobile)
|
||||||
|
.select("id", "approval_status", "approval_remark", "approval_invalid_col")
|
||||||
|
.orderByAsc("id");
|
||||||
|
|
||||||
List<ShopMerchEntry> recordList = list(queryWrapper);
|
List<ShopMerchEntry> recordList = list(queryWrapper);
|
||||||
if (CollectionUtil.isEmpty(recordList)) {
|
if (CollectionUtil.isEmpty(recordList)) {
|
||||||
return 4;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return recordList.get(0).getApproval_status();
|
return recordList.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user