新增商家入驻全部状态检查接口
This commit is contained in:
parent
4a95eb6460
commit
bd5645296f
@ -54,5 +54,11 @@ public class ShopMchEntryAdminController extends BaseControllerImpl {
|
||||
return shopMchEntryService.shopMerchEntryApproval(jsonParam.getLong("id"), jsonParam.getInt("approvalStatus"), jsonParam.getStr("approvalRemark"), jsonParam.getStr("approvalInvalidCol"));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "检查商户入驻店铺所有状态情况", notes = "检查商户入驻店铺所有状态情况")
|
||||
@RequestMapping(value = "/check/mechentry/all/status", method = RequestMethod.POST)
|
||||
public CommonResult checkMchEntryStoreAllStatus(@RequestBody JSONObject jsonParam) {
|
||||
return shopMchEntryService.checkMchEntryStoreAllStatus(jsonParam.getLong("mchId"), jsonParam.getInt("storeId"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -284,6 +284,15 @@ public interface ShopMchEntryService {
|
||||
*/
|
||||
Boolean checkMchEntryStoreStatus(Integer storeId);
|
||||
|
||||
/**
|
||||
* 检查商户入驻店铺所有状态情况
|
||||
*
|
||||
* @param mchId 商户入驻ID, 和店铺ID 必填一个
|
||||
* @param storeId 店铺ID, 和商户入驻ID 必填一个
|
||||
* @return
|
||||
*/
|
||||
CommonResult checkMchEntryStoreAllStatus(Long mchId, Integer storeId);
|
||||
|
||||
/**
|
||||
* 更新商户入驻签约状态和合同下载URL
|
||||
* 处理逻辑:
|
||||
|
||||
@ -1523,4 +1523,100 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
return false; // 发生异常时返回 false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查商户入驻店铺所有状态情况
|
||||
*
|
||||
* @param mchId 商户入驻ID(与storeId必须至少提供一个)
|
||||
* @param storeId 店铺ID(与mchId必须至少提供一个)
|
||||
* @return CommonResult 包含状态检查结果
|
||||
* @throws IllegalArgumentException 当参数校验失败时抛出
|
||||
*/
|
||||
@Override
|
||||
public CommonResult checkMchEntryStoreAllStatus(Long mchId, Integer storeId) {
|
||||
try {
|
||||
// === 1. 初始化结果对象 ===
|
||||
|
||||
JSONArray flows = new JSONArray();
|
||||
flows.put(new JSONObject().set("idx", 1).set("intro", "电子合同状态:11-已签署;12-未签署"));
|
||||
flows.put(new JSONObject().set("idx", 2).set("intro", "进件状态:21-已进件;22-未进件"));
|
||||
flows.put(new JSONObject().set("idx", 3).set("intro", "店铺初始化:31-已完成;32-未完成"));
|
||||
flows.put(new JSONObject().set("idx", 4).set("intro", "分账申请:41-已申请;42-未申请"));
|
||||
flows.put(new JSONObject().set("idx", 5).set("intro", "接收方申请:51-已申请;52-未申请"));
|
||||
flows.put(new JSONObject().set("idx", 6).set("intro", "接收方绑定:61-已绑定;62-未绑定"));
|
||||
flows.put(new JSONObject().set("idx", 7).set("intro", "整体状态:1-所有入驻流程已完成;2-入驻流程未就绪"));
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("flows", flows);
|
||||
|
||||
// === 2. 参数校验 ===
|
||||
if (CheckUtil.isEmpty(mchId) && CheckUtil.isEmpty(storeId)) {
|
||||
result.put("status", 2);
|
||||
result.put("status_txt", "入驻流程未就绪");
|
||||
return CommonResult.success(result);
|
||||
}
|
||||
|
||||
// === 3. 查询商户入驻信息 ===
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status", CommonConstant.Enable);
|
||||
if (CheckUtil.isNotEmpty(mchId)) queryWrapper.eq("id", mchId);
|
||||
if (CheckUtil.isNotEmpty(storeId)) queryWrapper.eq("store_id", storeId);
|
||||
|
||||
ShopMchEntry entry = findOne(queryWrapper);
|
||||
if (entry == null) {
|
||||
result.put("status", 2);
|
||||
result.put("status_txt", "入驻流程未就绪");
|
||||
return CommonResult.success(result);
|
||||
}
|
||||
|
||||
// === 4. 检查各项状态 ===
|
||||
// 电子合同状态检查
|
||||
if (!CommonConstant.Enable.equals(entry.getHas_ec_signed())) {
|
||||
result.put("status", 12);
|
||||
result.put("status_txt", "电子合同未签署!");
|
||||
}
|
||||
// 进件状态检查
|
||||
if (!CommonConstant.Enable.equals(entry.getHas_apply_mer())) {
|
||||
result.put("status", 22);
|
||||
result.put("status_txt", "商家未进件!");
|
||||
}
|
||||
// 店铺初始化状态检查
|
||||
if (!CommonConstant.Enable.equals(entry.getStore_status())) {
|
||||
result.put("status", 32);
|
||||
result.put("status_txt", "店铺初始化未完成!");
|
||||
}
|
||||
// 分账申请状态检查
|
||||
if (!CommonConstant.Enable.equals(entry.getHas_apply_split())) {
|
||||
result.put("status", 42);
|
||||
result.put("status_txt", "未申请分账业务!");
|
||||
}
|
||||
// 接收方申请状态检查
|
||||
if (!CommonConstant.Enable.equals(entry.getHas_apply_receiver())) {
|
||||
result.put("status", 52);
|
||||
result.put("status_txt", "分账接收方未申请!");
|
||||
}
|
||||
// 接收方绑定状态检查
|
||||
if (!CommonConstant.Enable.equals(entry.getHas_bind_receiver())) {
|
||||
result.put("status", 62);
|
||||
result.put("status_txt", "未绑定分账接收方!");
|
||||
}
|
||||
|
||||
// === 5. 检查整体完成状态 ===
|
||||
if (CommonConstant.Enable.equals(entry.getApproval_status())
|
||||
&& CommonConstant.Enable.equals(entry.getHas_ec_signed())
|
||||
&& CommonConstant.Enable.equals(entry.getHas_apply_mer())
|
||||
&& CommonConstant.Enable.equals(entry.getStore_status())
|
||||
&& CommonConstant.Enable.equals(entry.getHas_apply_split())
|
||||
&& CommonConstant.Enable.equals(entry.getHas_apply_receiver())
|
||||
&& CommonConstant.Enable.equals(entry.getHas_bind_receiver())) {
|
||||
result.put("status", 1);
|
||||
result.put("status_txt", "所有入驻流程已完成!");
|
||||
}
|
||||
|
||||
return CommonResult.success(result);
|
||||
} catch (Exception e) {
|
||||
log.error("检查商户入驻状态异常 mchId:{}, storeId:{}", mchId, storeId, e);
|
||||
return CommonResult.failed("系统异常,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user