入驻流程 fix bug,增加审核错误返回逻辑
This commit is contained in:
parent
d856c1c501
commit
7adbd801cd
@ -40,9 +40,9 @@ public class ContextUtil {
|
|||||||
public static UserDto getCurrentUser() {
|
public static UserDto getCurrentUser() {
|
||||||
try {
|
try {
|
||||||
UserDto loginUser = staticUserInfoService.getUser();
|
UserDto loginUser = staticUserInfoService.getUser();
|
||||||
log.info("##### 当前登录用户:{}###", JsonUtil.object2json(loginUser));
|
// log.info("##### 当前登录用户:{}###", JsonUtil.object2json(loginUser));
|
||||||
return loginUser;//todo 测试去除
|
return loginUser;//todo 测试去除
|
||||||
// UserDto user= new UserDto();
|
// UserDto user= new UserDto();
|
||||||
//user.setStore_id("1");
|
//user.setStore_id("1");
|
||||||
//user.setRole_id(9);
|
//user.setRole_id(9);
|
||||||
//user.setUser_account("18260885688");
|
//user.setUser_account("18260885688");
|
||||||
@ -81,14 +81,15 @@ public class ContextUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 传入的
|
* 传入的
|
||||||
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String getStoreId(String storeId){
|
public static String getStoreId(String storeId) {
|
||||||
if(getCurrentUser()==null){
|
if (getCurrentUser() == null) {
|
||||||
throw new RuntimeException("未登录");
|
throw new RuntimeException("未登录");
|
||||||
}
|
}
|
||||||
if(Objects.requireNonNull(getCurrentUser()).getRole_id()==9){//平台
|
if (Objects.requireNonNull(getCurrentUser()).getRole_id() == 9) {//平台
|
||||||
return storeId;
|
return storeId;
|
||||||
}
|
}
|
||||||
return Objects.requireNonNull(getCurrentUser()).getStore_id();
|
return Objects.requireNonNull(getCurrentUser()).getStore_id();
|
||||||
@ -96,10 +97,11 @@ public class ContextUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验是否为平台
|
* 校验是否为平台
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static boolean checkouRole(){
|
public static boolean checkouRole() {
|
||||||
UserDto userDto=getCurrentUser();
|
UserDto userDto = getCurrentUser();
|
||||||
assert userDto != null;
|
assert userDto != null;
|
||||||
return userDto.getRole_id() == 9;
|
return userDto.getRole_id() == 9;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,12 +42,13 @@ public interface LklLedgerEcService extends IBaseService<LklLedgerEc> {
|
|||||||
/**
|
/**
|
||||||
* 根据商户手机号查询记录
|
* 根据商户手机号查询记录
|
||||||
*
|
*
|
||||||
|
* @param mchId
|
||||||
* @param mchMobile
|
* @param mchMobile
|
||||||
* @param ecStatus
|
* @param ecStatus
|
||||||
* @param status
|
* @param status
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
LklLedgerEc getByMchMobile(String mchMobile, String ecStatus, Integer status);
|
LklLedgerEc getByMchMobile(Long mchId, String mchMobile, String ecStatus, Integer status);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -384,9 +384,14 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
return Pair.of(false, I18nUtil._("缺少商家相关信息!"));
|
return Pair.of(false, I18nUtil._("缺少商家相关信息!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
LklLedgerEc lklLedgerEc = lklLedgerEcService.getByMchMobile(mchMobile, "", CommonConstant.Enable);
|
LklLedgerEc lklLedgerEc = lklLedgerEcService.getByMchMobile(shopMchEntry.getId(), mchMobile, "", CommonConstant.Enable);
|
||||||
if (lklLedgerEc != null && "COMPLETED".equals(lklLedgerEc.getEc_status())) {
|
if (lklLedgerEc != null
|
||||||
return Pair.of(true, I18nUtil._("商家已经申请过入网电子合同!"));
|
&& "COMPLETED".equals(lklLedgerEc.getEc_status())) {
|
||||||
|
// TODO 这种情况,需要怎么处理?
|
||||||
|
// 更新拉卡拉的电子合同信息到商家入驻表中
|
||||||
|
|
||||||
|
// return Pair.of(true, I18nUtil._("已提交进件申请,请等待机构审核!"));
|
||||||
|
log.info("商户:{} 电子合同已签署过,重新提交将被覆盖!", mchMobile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是企业类型商家
|
// 是企业类型商家
|
||||||
@ -535,6 +540,7 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
record.setReq_params(reqBody.toString());
|
record.setReq_params(reqBody.toString());
|
||||||
record.setNotify_url(retUrl);
|
record.setNotify_url(retUrl);
|
||||||
record.setEc_apply_id(respData.getLong("ec_apply_id"));
|
record.setEc_apply_id(respData.getLong("ec_apply_id"));
|
||||||
|
record.setStatus(CommonConstant.Enable);
|
||||||
String ecResultUrl = respData.getStr("result_url");
|
String ecResultUrl = respData.getStr("result_url");
|
||||||
record.setResult_url(ecResultUrl);
|
record.setResult_url(ecResultUrl);
|
||||||
record.setResp_body(respBody.toString());
|
record.setResp_body(respBody.toString());
|
||||||
|
|||||||
@ -129,19 +129,28 @@ public class LklLedgerEcServiceImpl extends BaseServiceImpl<LklLedgerEcMapper, L
|
|||||||
/**
|
/**
|
||||||
* 根据商户手机号查询记录
|
* 根据商户手机号查询记录
|
||||||
*
|
*
|
||||||
|
* @param mchId
|
||||||
* @param mchMobile
|
* @param mchMobile
|
||||||
* @param ecStatus
|
* @param ecStatus
|
||||||
* @param status
|
* @param status
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public LklLedgerEc getByMchMobile(String mchMobile, String ecStatus, Integer status) {
|
public LklLedgerEc getByMchMobile(Long mchId, String mchMobile, String ecStatus, Integer status) {
|
||||||
if (ObjectUtil.isEmpty(mchMobile)) {
|
if (StrUtil.isBlank(mchMobile) && (mchId == null || mchId <= 0)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<LklLedgerEc> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<LklLedgerEc> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("mch_mobile", mchMobile).orderByDesc("id");
|
if (StrUtil.isNotBlank(mchMobile)) {
|
||||||
|
queryWrapper.eq("mch_mobile", mchMobile);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mchId != null && mchId > 0) {
|
||||||
|
queryWrapper.eq("mch_id", mchId);
|
||||||
|
}
|
||||||
|
|
||||||
|
queryWrapper.orderByDesc("id");
|
||||||
if (ObjectUtil.isNotEmpty(status)) {
|
if (ObjectUtil.isNotEmpty(status)) {
|
||||||
queryWrapper.eq("status", status);
|
queryWrapper.eq("status", status);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -606,7 +606,7 @@ public class LklTkServiceImpl {
|
|||||||
|
|
||||||
// 给商家入驻表增加拉卡拉的商户号和拉卡拉返回的数据
|
// 给商家入驻表增加拉卡拉的商户号和拉卡拉返回的数据
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(shopMchEntry)) {
|
if (shopMchEntry == null) {
|
||||||
logger.error("拉卡拉进件异步通知:{}内部商户号入驻信息不存在!", merInnerNo);
|
logger.error("拉卡拉进件异步通知:{}内部商户号入驻信息不存在!", merInnerNo);
|
||||||
return new JSONObject().put("code", "500").put("message", merInnerNo + "内部商户号入驻信息不存在");
|
return new JSONObject().put("code", "500").put("message", merInnerNo + "内部商户号入驻信息不存在");
|
||||||
}
|
}
|
||||||
@ -642,11 +642,10 @@ public class LklTkServiceImpl {
|
|||||||
String mchMobile = shopEntry.getLogin_mobile();
|
String mchMobile = shopEntry.getLogin_mobile();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Pair<Integer, String> retPair = shopStoreBaseService.merchEntryInfo2StoreInfo(mchMobile, false);
|
Pair<Integer, String> retPair = shopStoreBaseService.merchEntryInfo2StoreInfo(mchMobile, true);
|
||||||
|
|
||||||
if (retPair.getFirst() > 0) {
|
if (retPair.getFirst() > 0) {
|
||||||
boolean updateSuccess = shopMchEntryService.updateMulStatus(mchMobile, "", 0, 0, 1, 0, 0, 1, CommonConstant.MCH_APPR_STA_LKL_PADDING);
|
boolean updateSuccess = shopMchEntryService.updateMulStatus(mchMobile, "", 0, 0, 1, 0, 0, 0, CommonConstant.MCH_APPR_STA_LKL_PADDING);
|
||||||
// boolean updateSuccess = shopMchEntryService.updateMerchEntryStoreStatus(mchMobile, CommonConstant.Enable);
|
|
||||||
if (!updateSuccess) {
|
if (!updateSuccess) {
|
||||||
logger.warn("更新店铺状态失败: mchMobile={}", mchMobile);
|
logger.warn("更新店铺状态失败: mchMobile={}", mchMobile);
|
||||||
} else {
|
} else {
|
||||||
@ -663,7 +662,6 @@ public class LklTkServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 1、(电子合同)给商家申请分账功能使用;务必检查是否申请过?申请过忽略
|
// 1、(电子合同)给商家申请分账功能使用;务必检查是否申请过?申请过忽略
|
||||||
// 下一步等待拉卡拉审核通过,再绑定接收方和商家的关系
|
|
||||||
Pair<Boolean, String> retPair = lakalaApiService.innerApplyLedgerMer(merCupNo);
|
Pair<Boolean, String> retPair = lakalaApiService.innerApplyLedgerMer(merCupNo);
|
||||||
|
|
||||||
// 2:新增一个接收方记录,起码要一个平台方,代理商根据入驻信息新增
|
// 2:新增一个接收方记录,起码要一个平台方,代理商根据入驻信息新增
|
||||||
|
|||||||
@ -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.constant.CommonConstant;
|
||||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||||
import com.suisung.mall.common.service.impl.BaiduMapServiceImpl;
|
import com.suisung.mall.common.service.impl.BaiduMapServiceImpl;
|
||||||
import com.suisung.mall.common.service.impl.BaseControllerImpl;
|
import com.suisung.mall.common.service.impl.BaseControllerImpl;
|
||||||
@ -17,12 +18,14 @@ import com.suisung.mall.shop.esign.service.EsignContractFillingFileService;
|
|||||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Api(tags = "店铺基础信息表")
|
@Api(tags = "店铺基础信息表")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/mobile/shop/merch")
|
@RequestMapping("/mobile/shop/merch")
|
||||||
@ -74,30 +77,79 @@ public class ShopMchEntryController extends BaseControllerImpl {
|
|||||||
return record.getApproval_status();
|
return record.getApproval_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商家入驻审核状态(终端接口调用)
|
||||||
|
*
|
||||||
|
* <p>根据手机号查询商家入驻信息,并返回当前审核状态及相关字段。
|
||||||
|
* 若未找到记录或状态为空,则返回默认值以适配前端需求。</p>
|
||||||
|
*
|
||||||
|
* @param jsonParam 请求参数,包含手机号 "mobile"
|
||||||
|
* @return CommonResult 包含审核状态及扩展字段的封装结果
|
||||||
|
*/
|
||||||
@ApiOperation(value = "通过手机号mobile获取商家入驻审核状态", notes = "通过手机号获取商家入驻审核状态,终端接口调用")
|
@ApiOperation(value = "通过手机号mobile获取商家入驻审核状态", notes = "通过手机号获取商家入驻审核状态,终端接口调用")
|
||||||
@RequestMapping(value = "/fresh/approval/status", method = RequestMethod.POST)
|
@RequestMapping(value = "/fresh/approval/status", method = RequestMethod.POST)
|
||||||
public CommonResult shopMerchEntryApprovalStatus2(@RequestBody JSONObject jsonParam) {
|
public CommonResult shopMerchEntryApprovalStatus2(@RequestBody JSONObject jsonParam) {
|
||||||
// approvalStatus 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;4-未申请;
|
try {
|
||||||
ShopMchEntry record = shopMchEntryService.shopMerchEntryApprovalInfo(jsonParam.getStr("mobile"));
|
// 参数校验:防止空指针和无效请求
|
||||||
Map<String, Object> result = new HashMap<>();
|
if (jsonParam == null || !jsonParam.containsKey("mobile")) {
|
||||||
if (record == null || record.getApproval_status() == null) {
|
return CommonResult.failed("请求参数缺失:必须提供 mobile 字段");
|
||||||
// 配合前端的要求,没有申请过入驻商城平台的时候,返回未申请状态
|
}
|
||||||
result.put("id", 0L);
|
|
||||||
result.put("approval_status", 4);
|
|
||||||
result.put("approval_remark", "");
|
|
||||||
result.put("signed_status", -1);
|
|
||||||
result.put("store_status", 2);
|
|
||||||
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("signed_status", record.getSigned_status());
|
|
||||||
result.put("store_status", record.getStore_status());
|
|
||||||
result.put("approval_invalid_col", record.getApproval_invalid_col());
|
|
||||||
}
|
|
||||||
|
|
||||||
return CommonResult.success(result);
|
String mobile = jsonParam.getStr("mobile");
|
||||||
|
if (mobile == null || mobile.isEmpty()) {
|
||||||
|
return CommonResult.failed("手机号不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询商家入驻审核信息(一次调用获取所有数据)
|
||||||
|
ShopMchEntry entry = shopMchEntryService.shopMerchEntryApprovalInfo(mobile);
|
||||||
|
|
||||||
|
// 初始化结果 Map,使用基本类型常量避免动态字符串拼接
|
||||||
|
Map<String, Object> result = new HashMap<>(16);
|
||||||
|
|
||||||
|
// 如果无记录或状态为空,填充默认值
|
||||||
|
if (entry == null || entry.getApproval_status() == null) {
|
||||||
|
result.put("id", 0L);
|
||||||
|
result.put("approval_status", CommonConstant.MCH_APPR_STA_NONE);
|
||||||
|
result.put("approval_remark", "");
|
||||||
|
result.put("has_ec_signed", CommonConstant.Disable);
|
||||||
|
result.put("has_apply_mer", CommonConstant.Disable);
|
||||||
|
result.put("store_status", CommonConstant.Disable);
|
||||||
|
result.put("has_apply_split", CommonConstant.Disable);
|
||||||
|
result.put("has_apply_receiver", CommonConstant.Disable);
|
||||||
|
result.put("has_bind_receiver", CommonConstant.Disable);
|
||||||
|
result.put("approval_invalid_col", "[]");
|
||||||
|
} else {
|
||||||
|
// 存在记录,直接赋值(避免多次调用 getter)
|
||||||
|
Long id = entry.getId();
|
||||||
|
Integer approvalStatus = entry.getApproval_status();
|
||||||
|
String approvalRemark = entry.getApproval_remark();
|
||||||
|
Integer hasEcSigned = entry.getHas_ec_signed();
|
||||||
|
Integer hasApplyMer = entry.getHas_apply_mer();
|
||||||
|
Integer storeStatus = entry.getStore_status();
|
||||||
|
Integer hasApplySplit = entry.getHas_apply_split();
|
||||||
|
Integer hasApplyReceiver = entry.getHas_apply_receiver();
|
||||||
|
Integer hasBindReceiver = entry.getHas_bind_receiver();
|
||||||
|
String approvalInvalidCol = entry.getApproval_invalid_col();
|
||||||
|
|
||||||
|
// 避免重复调用 put,集中设置
|
||||||
|
result.put("id", id != null ? id : 0L);
|
||||||
|
result.put("approval_status", approvalStatus);
|
||||||
|
result.put("approval_remark", approvalRemark != null ? approvalRemark : "");
|
||||||
|
result.put("has_ec_signed", hasEcSigned != null ? hasEcSigned : CommonConstant.Disable);
|
||||||
|
result.put("has_apply_mer", hasApplyMer != null ? hasApplyMer : CommonConstant.Disable);
|
||||||
|
result.put("store_status", storeStatus != null ? storeStatus : CommonConstant.Disable);
|
||||||
|
result.put("has_apply_split", hasApplySplit != null ? hasApplySplit : CommonConstant.Disable);
|
||||||
|
result.put("has_apply_receiver", hasApplyReceiver != null ? hasApplyReceiver : CommonConstant.Disable);
|
||||||
|
result.put("has_bind_receiver", hasBindReceiver != null ? hasBindReceiver : CommonConstant.Disable);
|
||||||
|
result.put("approval_invalid_col", approvalInvalidCol != null ? approvalInvalidCol : "[]");
|
||||||
|
}
|
||||||
|
|
||||||
|
return CommonResult.success(result);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取商家入驻审核状态失败,手机号: {}, 错误信息: {}", jsonParam.getStr("mobile"), e.getMessage(), e);
|
||||||
|
return CommonResult.failed("系统异常,请稍后重试");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "商家重新申请入驻商城平台", notes = "商家申请入驻材料被驳回的时候,修正材料,重新申请入驻")
|
@ApiOperation(value = "商家重新申请入驻商城平台", notes = "商家申请入驻材料被驳回的时候,修正材料,重新申请入驻")
|
||||||
|
|||||||
@ -173,6 +173,11 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
return CommonResult.failed(isApplied.getSecond());
|
return CommonResult.failed(isApplied.getSecond());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shopStoreBaseService.isExistsByStoreName(record.getStore_name())) {
|
||||||
|
log.error("生成店铺:店铺名称已存在");
|
||||||
|
return CommonResult.failed("店铺名称已存在");
|
||||||
|
}
|
||||||
|
|
||||||
Boolean isQy = true;
|
Boolean isQy = true;
|
||||||
|
|
||||||
// 检查企业、法人或个人的营业执照或身份证
|
// 检查企业、法人或个人的营业执照或身份证
|
||||||
@ -778,7 +783,6 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
|
|
||||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("login_mobile", loginMobile)
|
queryWrapper.eq("login_mobile", loginMobile)
|
||||||
.select("id", "approval_status", "approval_remark", "login_mobile", "approval_invalid_col", "signed_status", "contract_download_url", "store_status")
|
|
||||||
.orderByAsc("id");
|
.orderByAsc("id");
|
||||||
|
|
||||||
List<ShopMchEntry> recordList = list(queryWrapper);
|
List<ShopMchEntry> recordList = list(queryWrapper);
|
||||||
@ -1037,7 +1041,7 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
|
|
||||||
return update(new UpdateWrapper<ShopMchEntry>()
|
return update(new UpdateWrapper<ShopMchEntry>()
|
||||||
.eq("id", id)
|
.eq("id", id)
|
||||||
.set("store_id", storeId));
|
.set("store_id", storeId).set("store_status", CommonConstant.Enable));
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
@ -1232,13 +1236,13 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateMerchEntryEcResultUrlByMchId(Long mchId, String lklEcResultUrl) {
|
public Boolean updateMerchEntryEcResultUrlByMchId(Long mchId, String lklEcResultUrl) {
|
||||||
// 检查参数是否有效
|
|
||||||
if (mchId == null || StrUtil.isBlank(lklEcResultUrl)) {
|
|
||||||
log.error("参数无效: mchId={}, lklEcResultUrl={}", mchId, lklEcResultUrl);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// 检查参数是否有效
|
||||||
|
if (mchId == null || mchId <= 0 || StrUtil.isBlank(lklEcResultUrl)) {
|
||||||
|
log.error("参数无效: mchId={}, lklEcResultUrl={}", mchId, lklEcResultUrl);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// 构建更新条件
|
// 构建更新条件
|
||||||
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
||||||
updateWrapper.eq("id", mchId) // 根据商家入驻申请 ID 进行匹配
|
updateWrapper.eq("id", mchId) // 根据商家入驻申请 ID 进行匹配
|
||||||
|
|||||||
@ -3003,6 +3003,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* (重要)入驻审批通过并且合同盖章完结之后,把商家入驻信息转换成店铺信息,正式生成店铺所需的数据
|
* (重要)入驻审批通过并且合同盖章完结之后,把商家入驻信息转换成店铺信息,正式生成店铺所需的数据
|
||||||
|
* 独立新的事务执行
|
||||||
*
|
*
|
||||||
* @param mchMobile
|
* @param mchMobile
|
||||||
* @param allowThrown 是否允许抛出异常?
|
* @param allowThrown 是否允许抛出异常?
|
||||||
@ -3024,15 +3025,15 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByCondition(mchMobile, "");
|
ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByCondition(mchMobile, "");
|
||||||
if (ObjectUtil.isEmpty(shopMchEntry)) {
|
if (shopMchEntry == null) {
|
||||||
logger.error("生成店铺:入驻信息不能为空");
|
logger.error("生成店铺:入驻信息不能为空");
|
||||||
return Pair.of(0, "入驻信息不能为空");
|
return Pair.of(0, "入驻信息不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isExistsByStoreName(shopMchEntry.getStore_name())) {
|
// if (isExistsByStoreName(shopMchEntry.getStore_name())) {
|
||||||
logger.error("生成店铺:店铺名称已存在");
|
// logger.error("生成店铺:店铺名称已存在");
|
||||||
return Pair.of(0, "店铺名称已存在");
|
// return Pair.of(0, "店铺名称已存在");
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 校验店铺状态,
|
// 校验店铺状态,
|
||||||
if (CommonConstant.Enable.equals(shopMchEntry.getStore_status())) {
|
if (CommonConstant.Enable.equals(shopMchEntry.getStore_status())) {
|
||||||
@ -3042,7 +3043,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
if (!CommonConstant.Enable.equals(shopMchEntry.getStore_status())
|
if (!CommonConstant.Enable.equals(shopMchEntry.getStore_status())
|
||||||
&& !CommonConstant.Enable.equals(shopMchEntry.getHas_ec_signed())
|
&& !CommonConstant.Enable.equals(shopMchEntry.getHas_ec_signed())
|
||||||
&& !CommonConstant.Enable.equals(shopMchEntry.getHas_apply_mer())) {
|
&& !CommonConstant.Enable.equals(shopMchEntry.getHas_apply_mer())) {
|
||||||
return Pair.of(0, "前置条件为满足,请检查电子合同或申请进件状态");
|
return Pair.of(0, "前置条件未满足,请检查电子合同或申请进件状态");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -3223,7 +3224,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("店铺生成失败", e);
|
logger.error("店铺生成失败", e);
|
||||||
if (allowThrown) {
|
if (allowThrown) {
|
||||||
throw new ApiException(I18nUtil._("新增店铺失败"));
|
throw new ApiException(I18nUtil._("店铺生成失败"));
|
||||||
}
|
}
|
||||||
return Pair.of(0, e.getMessage());
|
return Pair.of(0, e.getMessage());
|
||||||
}
|
}
|
||||||
@ -3464,7 +3465,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
@Override
|
@Override
|
||||||
public Boolean isExistsByStoreName(String storeName) {
|
public Boolean isExistsByStoreName(String storeName) {
|
||||||
if (StrUtil.isBlank(storeName)) {
|
if (StrUtil.isBlank(storeName)) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<ShopStoreBase> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopStoreBase> queryWrapper = new QueryWrapper<>();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user