From 2b1e285c6b27a710a0d4b9d6059f687cbf4cbcdc Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Fri, 9 Jan 2026 20:12:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=BA=97=E8=A1=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E5=AD=97=E6=AE=B5=20=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=A4=87=E6=B3=A8=E5=92=8C=E7=99=BB=E5=BD=95=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/store/ShopMchEntryBranch.java | 8 +- .../impl/ShopMchEntryBranchServiceImpl.java | 73 +++++++++++++------ .../service/impl/ShopMchEntryServiceImpl.java | 26 +++++-- 3 files changed, 77 insertions(+), 30 deletions(-) diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopMchEntryBranch.java b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopMchEntryBranch.java index eedb62a8..e4e41879 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopMchEntryBranch.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopMchEntryBranch.java @@ -38,6 +38,9 @@ public class ShopMchEntryBranch implements Serializable { @ApiModelProperty(value = "拉卡拉终端号") private String lkl_term_no; + @ApiModelProperty(value = "商户登录手机号") + private String login_mobile; + @ApiModelProperty(value = "审核关联号", required = true) private String review_related_id; @@ -50,9 +53,12 @@ public class ShopMchEntryBranch implements Serializable { @ApiModelProperty(value = "拉卡拉通知响应数据") private String lkl_notify_reps; - @ApiModelProperty(value = "该商家入驻记录是否有效,0:无效,1:有效") + @ApiModelProperty(value = "状态:1-已成功;2-审核未通过;3-未处理;4-待审核;") private Integer status; + @ApiModelProperty(value = "审核状态") + private String status_text; + @ApiModelProperty(value = "商家入驻记录的创建时间") private Date created_at; diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryBranchServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryBranchServiceImpl.java index 2de5d095..9fcb7643 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryBranchServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryBranchServiceImpl.java @@ -110,37 +110,58 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl updateWrapper = new LambdaUpdateWrapper<>(); - updateWrapper.eq(ShopMchEntryBranch::getReview_related_id, reviewRelatedId) - .set(ShopMchEntryBranch::getUpdated_at, new Date()); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(ShopMchEntryBranch::getReview_related_id, reviewRelatedId) + .set(ShopMchEntryBranch::getUpdated_at, new Date()); - // 更新状态字段 - if (CheckUtil.isNotEmpty(status)) { - updateWrapper.set(ShopMchEntryBranch::getStatus, status); - log.debug("更新状态字段为: {}", status); - } + // 更新状态字段 + if (CheckUtil.isNotEmpty(status)) { + updateWrapper.set(ShopMchEntryBranch::getStatus, status); + String statusText = getStatusText(status); + updateWrapper.set(ShopMchEntryBranch::getStatus_text, statusText); + log.debug("更新状态字段为: {} ({})", status, statusText); + } - // 更新通知响应内容和终端号 - if (StrUtil.isNotBlank(notifyResp)) { - updateWrapper.set(ShopMchEntryBranch::getLkl_notify_reps, notifyResp); -// + // 更新通知响应内容和终端号 + if (StrUtil.isNotBlank(notifyResp)) { + updateWrapper.set(ShopMchEntryBranch::getLkl_notify_reps, notifyResp); + + // 从通知响应中提取并更新终端号 +// try { // JSONObject notifyRespJson = JSONUtil.parseObj(notifyResp); -// String termNo = notifyRespJson.getStr("termNo", ""); +// String termNo = notifyRespJson.getStr("termNo"); // if (StrUtil.isNotBlank(termNo)) { // updateWrapper.set(ShopMchEntryBranch::getLkl_term_no, termNo); // log.debug("更新商户终端编号字段为: {}", termNo); // } +// } catch (Exception e) { +// log.warn("解析通知响应数据失败,无法提取终端号: {}", e.getMessage()); +// } + } - } + boolean result = update(updateWrapper); + log.info("{}更新分店入驻申请记录,审核关联号: {}", result ? "成功" : "失败", reviewRelatedId); - boolean result = update(updateWrapper); - log.info("{}更新分店入驻申请记录,审核关联号: {}", result ? "成功" : "失败", reviewRelatedId); + return result; + } - 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 branchQueryWrapper = new LambdaQueryWrapper<>(); 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) { return Pair.of(false, "分店终端号已申请或申请中,请等待审核"); } @@ -265,9 +286,11 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl