Compare commits

..

3 Commits
dev ... main

3 changed files with 77 additions and 30 deletions

View File

@ -38,6 +38,9 @@ public class ShopMchEntryBranch implements Serializable {
@ApiModelProperty(value = "拉卡拉终端号") @ApiModelProperty(value = "拉卡拉终端号")
private String lkl_term_no; private String lkl_term_no;
@ApiModelProperty(value = "商户登录手机号")
private String login_mobile;
@ApiModelProperty(value = "审核关联号", required = true) @ApiModelProperty(value = "审核关联号", required = true)
private String review_related_id; private String review_related_id;
@ -50,9 +53,12 @@ public class ShopMchEntryBranch implements Serializable {
@ApiModelProperty(value = "拉卡拉通知响应数据") @ApiModelProperty(value = "拉卡拉通知响应数据")
private String lkl_notify_reps; private String lkl_notify_reps;
@ApiModelProperty(value = "该商家入驻记录是否有效0:无效1:有效") @ApiModelProperty(value = "状态1-已成功2-审核未通过3-未处理4-待审核;")
private Integer status; private Integer status;
@ApiModelProperty(value = "审核状态")
private String status_text;
@ApiModelProperty(value = "商家入驻记录的创建时间") @ApiModelProperty(value = "商家入驻记录的创建时间")
private Date created_at; private Date created_at;

View File

@ -110,37 +110,58 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl<ShopMchEntryB
return false; return false;
} }
try { LambdaUpdateWrapper<ShopMchEntryBranch> updateWrapper = new LambdaUpdateWrapper<>();
LambdaUpdateWrapper<ShopMchEntryBranch> updateWrapper = new LambdaUpdateWrapper<>(); updateWrapper.eq(ShopMchEntryBranch::getReview_related_id, reviewRelatedId)
updateWrapper.eq(ShopMchEntryBranch::getReview_related_id, reviewRelatedId) .set(ShopMchEntryBranch::getUpdated_at, new Date());
.set(ShopMchEntryBranch::getUpdated_at, new Date());
// 更新状态字段 // 更新状态字段
if (CheckUtil.isNotEmpty(status)) { if (CheckUtil.isNotEmpty(status)) {
updateWrapper.set(ShopMchEntryBranch::getStatus, status); updateWrapper.set(ShopMchEntryBranch::getStatus, status);
log.debug("更新状态字段为: {}", status); String statusText = getStatusText(status);
} updateWrapper.set(ShopMchEntryBranch::getStatus_text, statusText);
log.debug("更新状态字段为: {} ({})", status, statusText);
}
// 更新通知响应内容和终端号 // 更新通知响应内容和终端号
if (StrUtil.isNotBlank(notifyResp)) { if (StrUtil.isNotBlank(notifyResp)) {
updateWrapper.set(ShopMchEntryBranch::getLkl_notify_reps, notifyResp); updateWrapper.set(ShopMchEntryBranch::getLkl_notify_reps, notifyResp);
//
// 从通知响应中提取并更新终端号
// try {
// JSONObject notifyRespJson = JSONUtil.parseObj(notifyResp); // JSONObject notifyRespJson = JSONUtil.parseObj(notifyResp);
// String termNo = notifyRespJson.getStr("termNo", ""); // String termNo = notifyRespJson.getStr("termNo");
// if (StrUtil.isNotBlank(termNo)) { // if (StrUtil.isNotBlank(termNo)) {
// updateWrapper.set(ShopMchEntryBranch::getLkl_term_no, termNo); // updateWrapper.set(ShopMchEntryBranch::getLkl_term_no, termNo);
// log.debug("更新商户终端编号字段为: {}", termNo); // log.debug("更新商户终端编号字段为: {}", termNo);
// } // }
// } catch (Exception e) {
// log.warn("解析通知响应数据失败,无法提取终端号: {}", e.getMessage());
// }
}
} boolean result = update(updateWrapper);
log.info("{}更新分店入驻申请记录,审核关联号: {}", result ? "成功" : "失败", reviewRelatedId);
boolean result = update(updateWrapper); return result;
log.info("{}更新分店入驻申请记录,审核关联号: {}", result ? "成功" : "失败", reviewRelatedId); }
return result; /**
} catch (Exception e) { * 根据状态码获取对应的状态文本
log.warn("解析通知响应数据失败,无法提取终端号: {}", e.getMessage()); */
return false; private String getStatusText(Integer status) {
switch (status) {
case 1:
return "审核已通过";
case 2:
return "审核未通过";
case 3:
return "未处理";
case 4:
return "待审核";
case 5:
return "业务异常";
default:
return "未知状态";
} }
} }
@ -246,10 +267,10 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl<ShopMchEntryB
return Pair.of(false, "手机已注册过商家账号,请换另一个手机号"); return Pair.of(false, "手机已注册过商家账号,请换另一个手机号");
} }
// 5. 检查分店终端号是否已经申请或申请中 // 5. 检查分店终端号是否已成功或申请中
LambdaQueryWrapper<ShopMchEntryBranch> branchQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ShopMchEntryBranch> branchQueryWrapper = new LambdaQueryWrapper<>();
branchQueryWrapper.eq(ShopMchEntryBranch::getLkl_mer_cup_no, mchEntry.getLkl_mer_inner_no()) branchQueryWrapper.eq(ShopMchEntryBranch::getLkl_mer_cup_no, mchEntry.getLkl_mer_inner_no())
.in(ShopMchEntryBranch::getStatus, Arrays.asList(1, 3)); // 1-申请中3-可能的其他状态 .in(ShopMchEntryBranch::getStatus, Arrays.asList(1, 2, 3)); // 状态1-已成功2-审核未通过3-未处理4-待审核5-业务异常
if (count(branchQueryWrapper) > 0) { if (count(branchQueryWrapper) > 0) {
return Pair.of(false, "分店终端号已申请或申请中,请等待审核"); return Pair.of(false, "分店终端号已申请或申请中,请等待审核");
} }
@ -265,9 +286,11 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl<ShopMchEntryB
ShopMchEntryBranch shopMchEntryBranch = new ShopMchEntryBranch(); ShopMchEntryBranch shopMchEntryBranch = new ShopMchEntryBranch();
shopMchEntryBranch.setLkl_mer_cup_no(mchEntry.getLkl_mer_cup_no()); shopMchEntryBranch.setLkl_mer_cup_no(mchEntry.getLkl_mer_cup_no());
shopMchEntryBranch.setReview_related_id(lklResp.getStr("reviewRelatedId")); shopMchEntryBranch.setReview_related_id(lklResp.getStr("reviewRelatedId"));
shopMchEntryBranch.setLogin_mobile(mainStoreBranchReq.getLogin_mobile());
shopMchEntryBranch.setStatus(4);// 状态1-审核已成功2-审核未通过3-未处理4-待审核
shopMchEntryBranch.setStatus_text("待审核");
shopMchEntryBranch.setLkl_req(JSONUtil.toJsonStr(mainStoreBranchReq)); shopMchEntryBranch.setLkl_req(JSONUtil.toJsonStr(mainStoreBranchReq));
shopMchEntryBranch.setLkl_reps(JSONUtil.toJsonStr(lklResp)); shopMchEntryBranch.setLkl_reps(JSONUtil.toJsonStr(lklResp));
if (!saveShopMchEntryBranch(shopMchEntryBranch)) { if (!saveShopMchEntryBranch(shopMchEntryBranch)) {
return Pair.of(false, "分店提交申请失败"); return Pair.of(false, "分店提交申请失败");
} }
@ -309,6 +332,8 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl<ShopMchEntryB
// 3. 更新分店入驻申请记录 // 3. 更新分店入驻申请记录
shopMchEntryBranch.setLkl_term_no(termNo); shopMchEntryBranch.setLkl_term_no(termNo);
shopMchEntryBranch.setStatus(CommonConstant.Enable); shopMchEntryBranch.setStatus(CommonConstant.Enable);
// 拉卡拉审核通过之后才进入这个方法
shopMchEntryBranch.setStatus_text("审核已成功");
shopMchEntryBranch.setLkl_notify_reps(lklNotifyResp); shopMchEntryBranch.setLkl_notify_reps(lklNotifyResp);
// 使用 LambdaUpdateWrapper 确保只更新指定字段 // 使用 LambdaUpdateWrapper 确保只更新指定字段

View File

@ -190,7 +190,7 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
log.debug("开始处理商家入驻申请"); log.debug("开始处理商家入驻申请");
// 检查是否已登录 // 检查是否已登录
Integer userId = 0; Integer userId;
UserDto user = getCurrentUser(); UserDto user = getCurrentUser();
if (user == null || user.getId() == null) { if (user == null || user.getId() == null) {
@ -246,9 +246,20 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
return CommonResult.failed("请选择是企业还是个人"); return CommonResult.failed("请选择是企业还是个人");
} }
if (StrUtil.isBlank(record.getFront_facade_image())) {
log.info("未上传店铺门面照片,手机号: {}", loginMobile);
return CommonResult.failed("请上传店铺门面照片");
}
if (StrUtil.isBlank(record.getEnvironment_image())) {
log.info("未上传店铺环境照片,手机号: {}", loginMobile);
return CommonResult.failed("请上传店铺环境照片");
}
if (StrUtil.isBlank(record.getCheckstand_image())) { if (StrUtil.isBlank(record.getCheckstand_image())) {
log.warn("未上传店铺门头照片,手机号: {}", loginMobile); log.info("未上传店铺收银台照片,手机号: {}", loginMobile);
return CommonResult.failed("请上传店铺收银台照片"); // TODO 商家版App更改之后再开启
// return CommonResult.failed("请上传店铺收银台照片");
} }
// 不管是企业或个人只要没有填写联系人就直接把商家手机号码作为联系人手机号码 // 不管是企业或个人只要没有填写联系人就直接把商家手机号码作为联系人手机号码
@ -277,7 +288,7 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
// 检查企业法人或个人的营业执照或身份证 // 检查企业法人或个人的营业执照或身份证
if (ObjectUtil.isNotEmpty(record.getEntity_type()) && record.getEntity_type().equals(CommonConstant.MCH_ENTITY_TYPE_GR)) { if (ObjectUtil.isNotEmpty(record.getEntity_type()) && record.getEntity_type().equals(CommonConstant.MCH_ENTITY_TYPE_GR)) {
log.debug("个人入驻信息校验,手机号: {}", loginMobile); log.debug("个人入驻信息校验,手机号: {}", loginMobile);
isQy = false; // 个人入驻 isQy = false; // 个人入驻小微
// 个人 // 个人
if (StrUtil.isBlank(record.getIndividual_id_number()) if (StrUtil.isBlank(record.getIndividual_id_number())
|| StrUtil.isBlank(record.getIndividual_id_name()) || StrUtil.isBlank(record.getIndividual_id_name())
@ -299,6 +310,7 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
record.setIndividual_id_period_end("9999-12-31"); record.setIndividual_id_period_end("9999-12-31");
} }
// 联系人名为空则使用身份证
if (StrUtil.isBlank(record.getContact_name())) { if (StrUtil.isBlank(record.getContact_name())) {
record.setContact_name(record.getIndividual_id_name()); record.setContact_name(record.getIndividual_id_name());
} }
@ -343,18 +355,22 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
return CommonResult.failed("法人手机号码有误!"); return CommonResult.failed("法人手机号码有误!");
} }
// 长期身份证
if (StrUtil.contains(record.getLegal_person_id_period_end(), "长期") if (StrUtil.contains(record.getLegal_person_id_period_end(), "长期")
|| StrUtil.contains(record.getLegal_person_id_period_end(), "永久")) { || StrUtil.contains(record.getLegal_person_id_period_end(), "永久")) {
record.setLegal_person_id_period_end("9999-12-31"); record.setLegal_person_id_period_end("9999-12-31");
} }
// 联系人使用法人身份证的姓名
if (StrUtil.isBlank(record.getContact_name())) { if (StrUtil.isBlank(record.getContact_name())) {
record.setContact_name(record.getLegal_person_name()); record.setContact_name(record.getLegal_person_name());
} }
} }
// 检查银行账号 // 检查银行账号
if (StrUtil.isBlank(record.getBank_name()) || StrUtil.isBlank(record.getAccount_number()) || StrUtil.isBlank(record.getAccount_holder_name())) { if (StrUtil.isBlank(record.getBank_name())
|| StrUtil.isBlank(record.getAccount_number())
|| StrUtil.isBlank(record.getAccount_holder_name())) {
log.warn("缺少银行账号信息,手机号: {}", loginMobile); log.warn("缺少银行账号信息,手机号: {}", loginMobile);
return CommonResult.failed("缺少银行账号信息!"); return CommonResult.failed("缺少银行账号信息!");
} }