diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java index b57a751e..562a9a26 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java @@ -781,7 +781,6 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl order_ids = Convert.toList(String.class, order_id); @@ -801,10 +800,8 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl updateWrapper = new LambdaUpdateWrapper<>(); - updateWrapper.eq(ShopMchEntryBranch::getReview_related_id, reviewRelatedId).set(ShopMchEntryBranch::getUpdated_at, new Date()); + 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 (StrUtil.isNotBlank(notifyResp)) { // 允许空字符串,但不能为null + // 更新通知响应内容和终端号 + if (StrUtil.isNotBlank(notifyResp)) { updateWrapper.set(ShopMchEntryBranch::getLkl_notify_reps, notifyResp); +// +// JSONObject notifyRespJson = JSONUtil.parseObj(notifyResp); +// String termNo = notifyRespJson.getStr("termNo", ""); +// if (StrUtil.isNotBlank(termNo)) { +// updateWrapper.set(ShopMchEntryBranch::getLkl_term_no, termNo); +// log.debug("更新商户终端编号字段为: {}", termNo); +// } + } boolean result = update(updateWrapper); - - if (result) { - log.info("成功更新分店入驻申请记录,审核关联号: {}", reviewRelatedId); - } else { - log.warn("更新分店入驻申请记录失败,审核关联号: {}", reviewRelatedId); - } + log.info("{}更新分店入驻申请记录,审核关联号: {}", result ? "成功" : "失败", reviewRelatedId); return result; } catch (Exception e) { - log.error("更新分店入驻申请记录时发生异常,审核关联号: {}", reviewRelatedId, e); + log.warn("解析通知响应数据失败,无法提取终端号: {}", e.getMessage()); return false; } } @@ -240,7 +243,7 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(ShopMchEntryBranch::getReview_related_id, reviewRelatedId) + .set(ShopMchEntryBranch::getLkl_term_no, termNo) + .set(ShopMchEntryBranch::getStatus, CommonConstant.Enable) + .set(ShopMchEntryBranch::getLkl_notify_reps, lklNotifyResp) + .set(ShopMchEntryBranch::getUpdated_at, new Date()); + + if (!update(updateWrapper)) { throw new ApiException("更新分店入驻申请记录失败"); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryServiceImpl.java index ed7189ce..95c707b7 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMchEntryServiceImpl.java @@ -923,7 +923,6 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("store_id", storeId).select("packing_fee"); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(ShopStoreBase::getPacking_fee) + .eq(ShopStoreBase::getStore_id, storeId); ShopStoreBase shopStoreBase = shopStoreBaseService.findOne(queryWrapper); - if (shopStoreBase != null) { - return shopStoreBase.getPacking_fee(); - } - - return BigDecimal.ZERO; + return ObjectUtil.isEmpty(shopStoreBase) ? BigDecimal.ZERO : shopStoreBase.getPacking_fee(); } /** diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/user/service/impl/ShopUserCartServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/user/service/impl/ShopUserCartServiceImpl.java index d3d82f60..6c6ce64c 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/user/service/impl/ShopUserCartServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/user/service/impl/ShopUserCartServiceImpl.java @@ -3157,7 +3157,7 @@ public class ShopUserCartServiceImpl extends BaseServiceImpl