From 951a1f3cf76ac814cb4d2a0ac6d81f83f160e7b6 Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Mon, 15 Dec 2025 20:50:54 +0800 Subject: [PATCH 01/45] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E6=B4=BE=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/listener/OrderPayedListener.java | 4 +- .../impl/ShopOrderInfoServiceImpl.java | 2 +- .../admin/SFExpressAdminController.java | 10 ++- .../service/SFExpressApiService.java | 18 +++++- .../service/impl/SFExpressApiServiceImpl.java | 64 +++++++++++++++++-- .../service/ShopStoreSfOrderService.java | 4 +- .../impl/ShopStoreSfOrderServiceImpl.java | 9 ++- 7 files changed, 98 insertions(+), 13 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/OrderPayedListener.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/OrderPayedListener.java index 3f181357..aac722ee 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/OrderPayedListener.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/OrderPayedListener.java @@ -69,7 +69,7 @@ public class OrderPayedListener { String dataStr = new String(data, StandardCharsets.UTF_8); listener(dataStr, channel, message); } - + public void listener(String data, Channel channel, Message message) throws IOException, InterruptedException { // String messageId = message.getMessageProperties().getMessageId(); if (StrUtil.isBlank(data)) { @@ -154,7 +154,7 @@ public class OrderPayedListener { && !isBookingOrder) { // 如果是立即下单,将触发顺丰同城下单,否则(预约下单) redis+cron 定时触发顺丰同城下单 - Pair pairCreateSfOrder = sfExpressApiService.innerCreateSfExpressOrder(orderId, orderPickupNum); + Pair pairCreateSfOrder = sfExpressApiService.innerCreateSfExpressOrder(orderId, orderPickupNum, false); if (pairCreateSfOrder == null) { logger.error("[订单支付监听] 顺丰同城下单失败,无返回值 订单ID: {}", orderId); continue; diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderInfoServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderInfoServiceImpl.java index 08801155..f9beecc9 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderInfoServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderInfoServiceImpl.java @@ -907,7 +907,7 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl sfResult = sfExpressApiService.innerCreateSfExpressOrder(orderId, 0L); + Pair sfResult = sfExpressApiService.innerCreateSfExpressOrder(orderId, 0L, false); if (sfResult == null) { logger.error("[预约订单顺丰下单] 调用顺丰接口无返回值, orderId={}", orderId); throw new RuntimeException("预约订单顺丰下单失败,接口无响应"); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/controller/admin/SFExpressAdminController.java b/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/controller/admin/SFExpressAdminController.java index 1113041e..9c99e91e 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/controller/admin/SFExpressAdminController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/controller/admin/SFExpressAdminController.java @@ -44,7 +44,7 @@ public class SFExpressAdminController { } - @ApiOperation(value = "创建顺丰同城店铺", notes = "创建顺丰同城店铺") + @ApiOperation(value = "【测试补偿】创建顺丰同城店铺", notes = "创建顺丰同城店铺") @RequestMapping(value = "/create-shop-inner", method = RequestMethod.POST) public CommonResult createSfExpressShopNotify(@RequestBody JSONObject requestBody) { Pair result = sfExpressApiService.createSfExpressShopInner( @@ -64,4 +64,12 @@ public class SFExpressAdminController { } return CommonResult.failed(result.getSecond()); } + + @ApiOperation(value = "重新创建顺丰订单(重新派发)", notes = "重新创建顺丰订单(重新派发)") + @RequestMapping(value = "/recreate-order", method = RequestMethod.POST) + public CommonResult recreateOrder(@RequestBody JSONObject requestBody) { + return sfExpressApiService.recreateOrder( + requestBody.getStr("order_id") + ); + } } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/SFExpressApiService.java b/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/SFExpressApiService.java index 73f6e8d2..ec0068d6 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/SFExpressApiService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/SFExpressApiService.java @@ -70,8 +70,23 @@ public interface SFExpressApiService { ThirdApiRes createSfExpressShopNotify(String jsonData, String sign); + /** + * 创建顺丰同城订单 + * + * @param shopOrderId + * @return + */ ThirdApiRes createOrder(String shopOrderId); + + /** + * 重新创建顺丰同城订单 + * + * @param shopOrderId + * @return + */ + CommonResult recreateOrder(String shopOrderId); + /** * 获取顺丰同城店铺信息 * @@ -85,9 +100,10 @@ public interface SFExpressApiService { * * @param orderId * @param orderPickupNum + * @param ignoreExists 是否忽略已存在本地订单 * @return */ - Pair innerCreateSfExpressOrder(String orderId, Long orderPickupNum); + Pair innerCreateSfExpressOrder(String orderId, Long orderPickupNum, Boolean ignoreExists); /** * 取消订单,当商家处发生异常需要取消配送时,可调用此接口对订单进行取消操作,同步返回结果。 diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/impl/SFExpressApiServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/impl/SFExpressApiServiceImpl.java index ac0eaf46..fb49d08a 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/impl/SFExpressApiServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/impl/SFExpressApiServiceImpl.java @@ -105,7 +105,6 @@ public class SFExpressApiServiceImpl implements SFExpressApiService { @Autowired private ShopMchEntryService shopMchEntryService; - @Lazy @Autowired private PushMessageService pushMessageService; @@ -553,6 +552,60 @@ public class SFExpressApiServiceImpl implements SFExpressApiService { return JsonUtil.json2object(retRespStr, ThirdApiRes.class); } + /** + * 重新创建顺丰同城订单 + * 1、先获取顺丰同城订单的当前状态,如果没有取消的订单,则取消该订单 + * 2、取消成功,则重新创建顺丰同城订单,取消失败,则返回错误信息 + * 3、重新创建订单成功,更新订单轨迹 + * + * @param shopOrderId 商城订单ID + * @return CommonResult 操作结果 + */ + @Override + public CommonResult recreateOrder(String shopOrderId) { + logger.info("[顺丰] 开始重新创建订单: shopOrderId={}", shopOrderId); + + // 参数校验 + if (StrUtil.isBlank(shopOrderId)) { + logger.warn("[顺丰] 重新创建订单失败: 订单ID为空"); + return CommonResult.failed("订单ID不能为空"); + } + + // 获取顺丰订单ID + String sfOrderId = shopStoreSfOrderService.getSfOrderIdByShopOrderId(shopOrderId); + if (StrUtil.isBlank(sfOrderId)) { + logger.warn("[顺丰] 重新创建订单失败: 未找到对应的顺丰订单, shopOrderId={}", shopOrderId); + return CommonResult.failed("未找到对应的顺丰订单"); + } + + try { + // 取消原订单 + Map params = new HashMap<>(); + params.put("order_id", sfOrderId); + ThirdApiRes cancelOrderRes = cancelOrder(params); + if (cancelOrderRes != null && !ObjectUtil.equal(cancelOrderRes.getError_code(), 0)) { + logger.error("[顺丰] 取消原订单失败: errorCode={}, errorMsg={}", + cancelOrderRes.getError_code(), cancelOrderRes.getError_msg()); + return CommonResult.failed(cancelOrderRes.getError_msg()); + } + + // 重新创建订单,传递默认取货号1 + Pair createOrderRes = innerCreateSfExpressOrder(shopOrderId, 0L, true); + if (createOrderRes.getFirst()) { + logger.info("[顺丰] 重新创建订单成功: shopOrderId={}", shopOrderId); + return CommonResult.success(); + } + + logger.error("[顺丰] 重新创建订单失败: {}", createOrderRes.getSecond()); + return CommonResult.failed(createOrderRes.getSecond()); + + } catch (Exception e) { + logger.error("[顺丰] 重新创建订单过程中发生异常: shopOrderId={}", shopOrderId, e); + return CommonResult.failed("系统异常: " + e.getMessage()); + } + } + + /** * 获取顺丰同城店铺信息 * @@ -592,18 +645,19 @@ public class SFExpressApiServiceImpl implements SFExpressApiService { * * @param shopOrderId * @param orderPickupNum + * @param ignoreExists * @return */ @Transactional @Override - public Pair innerCreateSfExpressOrder(String shopOrderId, Long orderPickupNum) { + public Pair innerCreateSfExpressOrder(String shopOrderId, Long orderPickupNum, Boolean ignoreExists) { logger.info("开始顺丰同城下单"); - if (StrUtil.isBlank(shopOrderId) || orderPickupNum == null) { + if (StrUtil.isBlank(shopOrderId) || CheckUtil.isEmpty(orderPickupNum)) { return Pair.of(false, "顺丰同城下单时,缺少必要参数!"); } // 检查 shop_store_sf_order 订单是否已存在? - if (shopStoreSfOrderService.exists(devId, shopOrderId)) { + if (!ignoreExists && shopStoreSfOrderService.exists(devId, shopOrderId)) { return Pair.of(true, "顺丰同城已下单过!"); } @@ -645,7 +699,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService { shopStoreSfOrder.setStatus_desc("已创建顺丰同城订单"); // 下单成功,保存顺丰同城订单记录到 shop_store_sf_order 表里 - Boolean success = shopStoreSfOrderService.insertShopStoreSfOrder(shopStoreSfOrder); + Boolean success = shopStoreSfOrderService.saveShopStoreSfOrder(shopStoreSfOrder); if (!success) { logger.error("顺丰下单返回的结果:{}", sfExpressApiRes.get("result").toString()); return Pair.of(false, "保存顺丰同城下单失败!"); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSfOrderService.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSfOrderService.java index 892e1841..f5f65fe1 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSfOrderService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSfOrderService.java @@ -31,12 +31,12 @@ public interface ShopStoreSfOrderService extends IBaseService String getSfOrderIdByShopOrderId(String shopOrderId); /** - * 新增一个顺丰同城订单记录 + * 保存(新增或更新)一个顺丰同城订单记录 * * @param record * @return */ - Boolean insertShopStoreSfOrder(ShopStoreSfOrder record); + Boolean saveShopStoreSfOrder(ShopStoreSfOrder record); /** diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSfOrderServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSfOrderServiceImpl.java index f40f1e8a..8929021d 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSfOrderServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSfOrderServiceImpl.java @@ -92,7 +92,7 @@ public class ShopStoreSfOrderServiceImpl extends BaseServiceImpl Date: Tue, 16 Dec 2025 10:59:19 +0800 Subject: [PATCH 02/45] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=9B=B4=E6=94=B9=E4=BA=86=E7=AB=AF=E5=8F=A3=E5=92=8C?= =?UTF-8?q?=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 47bd110b..4b182fb6 100644 --- a/pom.xml +++ b/pom.xml @@ -324,10 +324,10 @@ 114.132.210.208:8718 114.132.210.208 - 3306 + 13307 mall_dev web_dev - Abc654321$^ + bbWHo1th]g25 com.mysql.cj.jdbc.Driver @@ -383,10 +383,10 @@ 114.132.210.208:8718 114.132.210.208 - 3306 + 13307 mall_dev web_dev - Abc654321$^ + bbWHo1th]g25 com.mysql.cj.jdbc.Driver 114.132.210.208 @@ -436,10 +436,10 @@ 10.1.8.3:8718 114.132.210.208 - 3306 + 13307 mall_dev web_dev - Abc654321$^ + bbWHo1th]g25 com.mysql.cj.jdbc.Driver 10.1.8.3 From f6bbf99c109ec9366a15012870bc0b14ce52a009 Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Tue, 16 Dec 2025 16:26:14 +0800 Subject: [PATCH 03/45] =?UTF-8?q?=E7=A9=BA=E7=99=BD=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=9B=BE=E7=89=87,=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/shop/page/service/impl/ShopPageAppServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/page/service/impl/ShopPageAppServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/page/service/impl/ShopPageAppServiceImpl.java index 51cbe017..3af87326 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/page/service/impl/ShopPageAppServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/page/service/impl/ShopPageAppServiceImpl.java @@ -1124,6 +1124,7 @@ public class ShopPageAppServiceImpl extends BaseServiceImpl Date: Tue, 16 Dec 2025 17:25:36 +0800 Subject: [PATCH 04/45] =?UTF-8?q?=E5=BA=97=E9=93=BA=E9=85=8D=E9=80=81?= =?UTF-8?q?=E8=B4=B9=E8=AE=BE=E7=BD=AE=E5=A2=9E=E5=8A=A0=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=95=86=E5=AE=B6id=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/ShopStoreSameCityTransportBase.java | 3 +++ .../service/impl/SFExpressApiServiceImpl.java | 1 + ...pStoreSameCityTransportBaseServiceImpl.java | 18 +++++++++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreSameCityTransportBase.java b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreSameCityTransportBase.java index 8204ee6e..6df4c0ac 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreSameCityTransportBase.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreSameCityTransportBase.java @@ -52,6 +52,9 @@ public class ShopStoreSameCityTransportBase implements Serializable { @ApiModelProperty(value = "顺丰同城(第三方)店铺ID") private String shop_id; + @ApiModelProperty(value = "顺丰平台商家Id (用于县级代理商创建店铺的)") + private String supplier_id; + @ApiModelProperty(value = "店铺主营商品分类ID") private Integer business_type; diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/impl/SFExpressApiServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/impl/SFExpressApiServiceImpl.java index fb49d08a..769c80ef 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/impl/SFExpressApiServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sfexpress/service/impl/SFExpressApiServiceImpl.java @@ -353,6 +353,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService { return Pair.of(false, "创建顺丰店铺失败,返回的店铺ID为空"); } + transportBase.setSupplier_id(sfSupplierId); transportBase.setShop_id(sfShopId); transportBase.setShop_state(CommonConstant.Enable); // 顺丰同城快递商品特惠 transportBase.setDelivery_brand(CommonConstant.DELIVERY_BRAND_SF); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSameCityTransportBaseServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSameCityTransportBaseServiceImpl.java index 9d2ab37e..b31e4c9d 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSameCityTransportBaseServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSameCityTransportBaseServiceImpl.java @@ -43,6 +43,7 @@ import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; import org.springframework.data.util.Pair; import org.springframework.stereotype.Service; @@ -62,6 +63,10 @@ import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser; public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl implements ShopStoreSameCityTransportBaseService { private static final Logger logger = LoggerFactory.getLogger(ShopStoreSameCityTransportBaseServiceImpl.class); + + @Value("${sf-express.supplier_id}") + private String supplierId; + @Autowired private ShopStoreSameCityTransportService shopStoreSameCityTransportService; @Autowired @@ -71,7 +76,6 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("store_id", transportBase.getStore_id()); @@ -455,7 +469,6 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl Date: Wed, 17 Dec 2025 11:52:44 +0800 Subject: [PATCH 05/45] =?UTF-8?q?=E8=83=BD=E7=BC=96=E8=BE=91=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E9=83=BD=E4=B8=8D=E6=98=AF=E5=86=8D=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/shop/page/controller/admin/ShopPageAppController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/page/controller/admin/ShopPageAppController.java b/mall-shop/src/main/java/com/suisung/mall/shop/page/controller/admin/ShopPageAppController.java index 88f0ae86..5a71c4e1 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/page/controller/admin/ShopPageAppController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/page/controller/admin/ShopPageAppController.java @@ -540,6 +540,7 @@ public class ShopPageAppController extends BaseControllerImpl { editShopPageApp.setApp_market_images(shopPageApp.getApp_market_images()); editShopPageApp.setTpl_image(shopPageApp.getTpl_image()); editShopPageApp.setApp_industry(shopPageApp.getApp_industry()); + editShopPageApp.setApp_is_use(0); shopPageAppService.edit(editShopPageApp); return CommonResult.success(); } From 01dd0687de7fbeedf5c63326c84bd92831061790 Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Wed, 17 Dec 2025 15:22:20 +0800 Subject: [PATCH 06/45] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=A9=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E8=87=B4=E7=9A=84=E5=89=8D=E7=AB=AF=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/order/service/impl/ShopOrderReturnServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderReturnServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderReturnServiceImpl.java index d7c653d6..3a44386d 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderReturnServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderReturnServiceImpl.java @@ -253,7 +253,11 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl> statisticCount(Date end, int days) { Integer store_id = Convert.toInt(getCurrentUser().getStore_id()); if (ObjectUtil.isNotNull(store_id)) { - return shopOrderReturnMapper.statisticCountSeller(end, days, store_id); + List> mapList= shopOrderReturnMapper.statisticCountSeller(end, days, store_id); + if(null==mapList){ + mapList=new ArrayList<>(); + } + return mapList; } return shopOrderReturnMapper.statisticCount(end, days); } From a23801eb31a64e9b6b85b2e012142cfd58131151 Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Wed, 17 Dec 2025 16:58:46 +0800 Subject: [PATCH 07/45] =?UTF-8?q?=E5=BA=97=E9=93=BA=E9=85=8D=E9=80=81?= =?UTF-8?q?=E8=B4=B9=E8=AE=BE=E7=BD=AE=E5=A2=9E=E5=8A=A0=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=95=86=E5=AE=B6id=E5=AD=97=E6=AE=B5,=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=9D=E5=AD=98=20=E8=87=AA=E9=85=8D?= =?UTF-8?q?=E9=80=81=EF=BC=8C=E5=86=85=E9=83=A8=E9=85=8D=E9=80=81=E8=B4=B9?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/suisung/mall/common/modules/store/ShopStoreInfo.java | 3 +++ .../shop/store/service/impl/ShopStoreBaseServiceImpl.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreInfo.java b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreInfo.java index 4d9136e1..fafa733b 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreInfo.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreInfo.java @@ -126,6 +126,9 @@ public class ShopStoreInfo implements Serializable { @ApiModelProperty(value = "店铺内部运费,单位(分)0-使用平台的内部运费;>0 使用店铺的内部运费") private Integer shopping_fee_inner; + @ApiModelProperty(value = "是否自配送:1-是;2-否;") + private Integer is_delivery_self; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @ApiModelProperty(value = "新增时间") diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java index 14fb2e54..f7837a02 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java @@ -2503,6 +2503,10 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl Date: Wed, 17 Dec 2025 18:11:53 +0800 Subject: [PATCH 08/45] =?UTF-8?q?=E5=95=86=E5=AE=B6app=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=BA=97=E9=93=BA=E8=87=AA=E6=8F=90?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ShopMchEntryController.java | 2 +- .../service/impl/ShopMchEntryServiceImpl.java | 97 +++++++++++++------ 2 files changed, 68 insertions(+), 31 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/mobile/ShopMchEntryController.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/mobile/ShopMchEntryController.java index 6ffbd5cb..47203d1a 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/mobile/ShopMchEntryController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/mobile/ShopMchEntryController.java @@ -62,7 +62,7 @@ public class ShopMchEntryController extends BaseControllerImpl { @ApiOperation(value = "获取商家入驻资料详情", notes = "获取商家入驻资料详情") @RequestMapping(value = "/detail", method = RequestMethod.POST) public CommonResult shopMerchEntryDetail(@RequestBody JSONObject jsonParam) { - return shopMchEntryService.shopMerchEntryDetail(null, jsonParam.getStr("mobile"), null); + return shopMchEntryService.shopMerchEntryDetail(jsonParam.getLong("mch_id"), jsonParam.getStr("mobile"), null); } @ApiOperation(value = "通过手机号mobile获取商家入驻审核状态", notes = "通过手机号获取商家入驻审核状态,远程调用用途") 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 498727e8..5f1a6c9d 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 @@ -30,6 +30,7 @@ import com.suisung.mall.common.modules.account.AccountUserBase; import com.suisung.mall.common.modules.lakala.LklLedgerEc; import com.suisung.mall.common.modules.store.ShopMchEntry; import com.suisung.mall.common.modules.store.ShopStoreEmployee; +import com.suisung.mall.common.modules.store.ShopStoreInfo; import com.suisung.mall.common.pojo.to.AddressParseResultTO; import com.suisung.mall.common.utils.*; import com.suisung.mall.common.utils.phone.PhoneNumberUtils; @@ -45,6 +46,7 @@ import com.suisung.mall.shop.store.mapper.ShopMchEntryMapper; import com.suisung.mall.shop.store.service.ShopMchEntryService; import com.suisung.mall.shop.store.service.ShopStoreBaseService; import com.suisung.mall.shop.store.service.ShopStoreEmployeeService; +import com.suisung.mall.shop.store.service.ShopStoreInfoService; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Lazy; import org.springframework.data.util.Pair; @@ -97,6 +99,10 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl approvalStatusList) { - // 检查登录用户是否有管理权限或者是用户自己 + log.debug("获取商家入驻申请详情开始: recordId={}, mobile={}", recordId, mobile); - // approvalStatus 入驻商家的审批状态:1-已通过;2-未通过;3-待审核; + // 参数校验:recordId 和 mobile 至少提供一个 if (ObjectUtil.isEmpty(recordId) && StrUtil.isBlank(mobile)) { + log.warn("获取商家入驻详情失败:缺少必要参数 recordId 或 mobile"); return CommonResult.failed("缺少必要参数!"); } - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (ObjectUtil.isNotEmpty(recordId)) { - queryWrapper.eq("id", recordId); - } + try { + // 构建查询条件 + QueryWrapper queryWrapper = new QueryWrapper<>(); - if (StrUtil.isNotBlank(mobile)) { - queryWrapper.eq("login_mobile", mobile); - } + // 根据ID查询 + if (ObjectUtil.isNotEmpty(recordId)) { + queryWrapper.eq("id", recordId); + } - if (CollectionUtil.isNotEmpty(approvalStatusList)) { - queryWrapper.in("approval_status", approvalStatusList); - } - queryWrapper.orderByDesc("id"); - List recordList = list(queryWrapper); - if (CollectionUtil.isEmpty(recordList)) { - return CommonResult.success(new JSONObject().set("approval_status", CommonConstant.MCH_APPR_STA_NONE), "请求成功!"); - } + // 根据手机号查询 + if (StrUtil.isNotBlank(mobile)) { + queryWrapper.eq("login_mobile", mobile); + } - ShopMchEntry record = recordList.get(0); - // 审核意见空值,返回"[]" - if (StrUtil.isBlank(record.getApproval_invalid_col())) { - record.setApproval_invalid_col("[]"); + // 状态过滤条件 + if (CollectionUtil.isNotEmpty(approvalStatusList)) { + queryWrapper.in("approval_status", approvalStatusList); + } + + // 按ID倒序排列,获取最新一条记录 + queryWrapper.orderByDesc("id"); + ShopMchEntry record = getOne(queryWrapper); + + // 如果没有找到记录,返回默认的成功结果 + if (ObjectUtil.isEmpty(record)) { + log.debug("未找到商家入驻记录: recordId={}, mobile={}", recordId, mobile); + return CommonResult.success( + new JSONObject().set("approval_status", CommonConstant.MCH_APPR_STA_NONE), + "请求成功!" + ); + } + + // 获取店铺信息 + ShopStoreInfo storeInfo = shopStoreInfoService.getById(record.getStore_id()); + if (storeInfo == null) { + log.warn("店铺信息异常,找不到对应店铺: storeId={}", record.getStore_id()); + return CommonResult.success(null, "店铺信息异常!"); + } + + // 处理审核意见空值情况 + if (StrUtil.isBlank(record.getApproval_invalid_col())) { + record.setApproval_invalid_col("[]"); + } + + // 尝试更新入驻表的合同下载地址和合同签署状态 + updateMerchEntrySignedStatusAndContractDownloadUrl(record); + + // 转换为JSONObject并添加额外属性 + JSONObject retObj = JSONUtil.parseObj(record); + retObj.set("is_delivery_self", storeInfo.getIs_delivery_self()); + + log.debug("获取商家入驻申请详情成功: recordId={}, mobile={}", recordId, mobile); + return CommonResult.success(retObj); + + } catch (Exception e) { + log.error("获取商家入驻申请详情异常: recordId={}, mobile={}", recordId, mobile, e); + return CommonResult.failed("系统异常,请稍后重试"); } - - // 试试更新入驻表的合同下载地址和合同签署状态 - updateMerchEntrySignedStatusAndContractDownloadUrl(record); - - return CommonResult.success(record); } From 59274f9941989f633a11931dcd13040336b99f92 Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Thu, 18 Dec 2025 10:47:34 +0800 Subject: [PATCH 09/45] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=93=81=E7=89=8C?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BB=A5=E5=8F=8A=E5=95=86=E5=93=81=E6=9D=A1?= =?UTF-8?q?=E7=A0=81=E8=87=AA=E5=8A=A8=E4=B8=8A=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sync/exelModel/SxCategoryModelExcel.java | 6 ++-- .../service/impl/SyncBaseThirdSxAbstract.java | 34 ++++++++++++------- .../impl/SyncShopImageServiceImpl.java | 10 +++--- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/exelModel/SxCategoryModelExcel.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/exelModel/SxCategoryModelExcel.java index 64d58e8f..bc13a11c 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/exelModel/SxCategoryModelExcel.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/exelModel/SxCategoryModelExcel.java @@ -38,7 +38,7 @@ public class SxCategoryModelExcel { @ExcelProperty(value = "第二级分类", index =2) private String second_category_name; - @ApiModelProperty(value = "品牌名称") - @ExcelProperty(value = "品牌名称", index =3) - private String brandName; +// @ApiModelProperty(value = "品牌名称") +// @ExcelProperty(value = "品牌名称", index =3) +// private String brandName; } \ No newline at end of file diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java index 36814cc1..71c85633 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java @@ -41,6 +41,8 @@ import com.suisung.mall.common.utils.DateTimeUtils; import com.suisung.mall.common.utils.I18nUtil; import com.suisung.mall.common.utils.StringUtils; import com.suisung.mall.common.utils.phone.PhoneNumberUtils; +import com.suisung.mall.core.consts.ConstantRedis; +import com.suisung.mall.core.web.service.RedisService; import com.suisung.mall.shop.base.service.ShopBaseProductBrandService; import com.suisung.mall.shop.base.service.ShopBaseProductCategoryService; import com.suisung.mall.shop.base.service.ShopBaseProductSpecService; @@ -102,9 +104,12 @@ public abstract class SyncBaseThirdSxAbstract{ @Autowired private LibraryProductService libraryProductService; + @Autowired + private RedisService redisService; + @Autowired public static final Set FORBID_CATEGORY= Collections.unmodifiableSet(new HashSet<>( - Arrays.asList("香烟类","香烟","烟类", "烟") + Arrays.asList("香烟类","香烟","烟类", "烟","烟草") )); /** @@ -141,6 +146,16 @@ public abstract class SyncBaseThirdSxAbstract{ } List productTypeList = new ArrayList<>(); Map productTypeListMap=new HashMap<>(); + //JSONObject o = (JSONObject) categoryListJSON.get(0); + // String brandName=o.getStr("brandName","其它品牌"); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("store_id",Integer.valueOf(storeId)); + //queryWrapper.in("brand_name",Arrays.asList(brandName.split(","))); + // queryWrapper.eq("brand_name",brandName); + List shopBaseProductBrands=productBrandService.list(queryWrapper); + String brandIds=shopBaseProductBrands.stream() + .map(shopBaseProductBrand -> String.valueOf(shopBaseProductBrand.getBrand_id())) + .collect(Collectors.joining(",")); for (int i = 0; i < list.size(); i++) { String categoryName=list.get(i).getCategory_name(); if(StringUtils.isNotEmpty(getForbidCategory(categoryName))){ @@ -155,15 +170,7 @@ public abstract class SyncBaseThirdSxAbstract{ ShopBaseProductType productType=new ShopBaseProductType(); productType.setType_is_draft(1);//发布 productType.setStore_id(Integer.valueOf(storeId)); - String brandName=o.getStr("brandName","其它品牌"); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("store_id",Integer.valueOf(storeId)); - queryWrapper.in("brand_name",Arrays.asList(brandName.split(","))); - // queryWrapper.eq("brand_name",brandName); - List shopBaseProductBrands=productBrandService.list(queryWrapper); - String brandIds=shopBaseProductBrands.stream() - .map(shopBaseProductBrand -> String.valueOf(shopBaseProductBrand.getBrand_id())) - .collect(Collectors.joining(",")); + if (o != null) { // 重要:分类类型处理(强调共性) Integer typeId = 1001; @@ -877,7 +884,6 @@ public abstract class SyncBaseThirdSxAbstract{ shopProductIndex.setProduct_sale_time(currentDate.getTime()); shopProductIndex.setStore_category_ids(""); // 店铺分类编号(DOT) shopProductIndex.setProduct_tags("");// 商品标签(DOT) - shopProductIndex.setBrand_id(0); shopProductIndex.setProduct_name(productName); // 产品名称:店铺平台先在对用表中检索后通过id检索,检索使用 shopProductIndex.setProduct_name_index(productName); // 名称索引关键字(DOT) shopProductIndex.setCategory_id(categoryId); // 商品分类 @@ -1098,7 +1104,7 @@ public abstract class SyncBaseThirdSxAbstract{ } // spec_id++; } - + List shopBaseProductTypeReidisKeyList=new ArrayList<>(); if(!insertShopBaseProductSpecList.isEmpty()){ List specIdList=shopNumberSeqService.getBatchSpecId(insertShopBaseProductSpecList.size()); for(int i=0;i imageMappingDtos=CovertToShopProductImage(list);//调用es排除异常重新连接 - syncBatchShopImage(imageMappingDtos); + syncBatchShopImage(imageMappingDtos,StateCode.PRODUCT_STATE_OFF_THE_SHELF); success.getAndIncrement(); message= "成功" + finalI; break; @@ -163,7 +163,7 @@ public class SyncShopImageServiceImpl implements SyncShopImageService { final int finalI = i; futures.add(executor.submit(() -> { try { - syncBatchShopImage(imageMappingDtos); + syncBatchShopImage(imageMappingDtos,StateCode.PRODUCT_STATE_NORMAL); success.getAndIncrement(); return "图库匹配成功" + finalI; } catch (Exception e) { @@ -192,7 +192,7 @@ public class SyncShopImageServiceImpl implements SyncShopImageService { * 把匹配的数据更新到商品的图库表 * @param imageMappingDtos */ - private void syncBatchShopImage(List imageMappingDtos){ + private void syncBatchShopImage(List imageMappingDtos,int product_state_id){ if(CollectionUtil.isEmpty(imageMappingDtos)){ log.info("没有匹配到图库"); return; @@ -223,14 +223,14 @@ public class SyncShopImageServiceImpl implements SyncShopImageService { shopProductImageList.add(shopProductImage); shopProductBase.setProduct_id(imageMappingDto.getProductId()); shopProductBase.setProduct_image(thumb); - shopProductBase.setProduct_state_id(StateCode.PRODUCT_STATE_OFF_THE_SHELF); + shopProductBase.setProduct_state_id(product_state_id); shopProductBaseList.add(shopProductBase); shopProductItem.setProduct_id(imageMappingDto.getProductId()); shopProductItem.setItem_enable(StateCode.PRODUCT_STATE_NORMAL); shopProductItemList.add(shopProductItem); ShopProductIndex shopProductIndex=new ShopProductIndex(); shopProductIndex.setProduct_id(imageMappingDto.getProductId()); - shopProductIndex.setProduct_state_id(StateCode.PRODUCT_STATE_OFF_THE_SHELF); + shopProductIndex.setProduct_state_id(product_state_id); shopProductIndexList.add(shopProductIndex); } synchronized (this){ From cbc47d14e43cb5654198306cfd1a68320a388fac Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Thu, 18 Dec 2025 16:23:33 +0800 Subject: [PATCH 10/45] =?UTF-8?q?=E5=95=86=E5=93=81=E6=9D=A1=E7=A0=81?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E8=A1=A5=E5=85=A8=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/product/ShopProductImageMapper.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mall-shop/src/main/resources/mapper/product/ShopProductImageMapper.xml b/mall-shop/src/main/resources/mapper/product/ShopProductImageMapper.xml index 10d0e652..67b3ca2a 100644 --- a/mall-shop/src/main/resources/mapper/product/ShopProductImageMapper.xml +++ b/mall-shop/src/main/resources/mapper/product/ShopProductImageMapper.xml @@ -42,13 +42,14 @@ from ( SELECT - ROW_NUMBER() over(partition by t.product_name order by t.id) rn,t.* + ROW_NUMBER() over(partition by t.product_number order by t.id) rn,t.* from ( SELECT spi.product_image_id, spi.product_id, spi.product_name, + spi.product_number, spi.store_id, lpi. merged_image_url, lp.thumb, @@ -74,11 +75,12 @@ lp.id = lpi.product_id WHERE spi.product_from = '1005' + AND spi.store_id=#{storeId} AND spi.item_image_default = '1' '' ]]>)t )temp where - temp.rn = 1 and temp.store_id=#{storeId} + temp.rn = 1 )tt @@ -93,13 +95,14 @@ from ( SELECT - ROW_NUMBER() over(partition by t.product_name order by t.id) rn,t.* + ROW_NUMBER() over(partition by t.product_number order by t.id) rn,t.* from ( SELECT spi.product_image_id, spi.product_id, spi.product_name, + spi.product_number, spi.store_id, lpi. merged_image_url, lp.thumb, @@ -125,11 +128,12 @@ lp.id = lpi.product_id WHERE spi.product_from = '1005' + AND spi.store_id=#{storeId} AND spi.item_image_default = '1' '' ]]>)t )temp where - temp.rn = 1 and temp.store_id=#{storeId} limit #{offset},#{limit} + temp.rn = 1 limit #{offset},#{limit} From 50872500b3417dc39a3762804f0e97cad2bc333e Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Fri, 26 Dec 2025 15:12:44 +0800 Subject: [PATCH 25/45] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E6=96=B0=E5=A2=9Euser=5Flongin=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/AccountController.java | 5 +++++ .../service/AccountUserBaseService.java | 8 ++++++++ .../impl/AccountUserBaseServiceImpl.java | 17 +++++++++++++++++ .../common/feignService/AccountService.java | 9 +++++++++ .../service/impl/SyncBaseThirdSxAbstract.java | 18 +++++++++++++++++- 5 files changed, 56 insertions(+), 1 deletion(-) diff --git a/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountController.java b/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountController.java index 246e153f..f8eda61b 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountController.java +++ b/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountController.java @@ -467,6 +467,11 @@ public class AccountController { return accountUserBaseService.saveBatchAccountInfo(accountUserInfoList); } + @RequestMapping(value = "/saveBatchAccountUserLogin", method = RequestMethod.POST) + public ThirdApiRes saveBatchAccountUserLogin(@RequestBody List accountUserLoginList) { + return accountUserBaseService.saveBatchAccountUserLogin(accountUserLoginList); + } + @RequestMapping(value = "/findOneAccountUserBase", method = RequestMethod.POST) public AccountUserBase findOneAccountUserBase(@RequestBody AccountUserBase accountUserBase) { diff --git a/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java b/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java index 88c9121a..3ce174c4 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java +++ b/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java @@ -4,6 +4,7 @@ import com.suisung.mall.common.api.CommonResult; import com.suisung.mall.common.domain.UserDto; import com.suisung.mall.common.modules.account.AccountUserBase; import com.suisung.mall.common.modules.account.AccountUserInfo; +import com.suisung.mall.common.modules.account.AccountUserLogin; import com.suisung.mall.common.pojo.req.WxUserInfoReq; import com.suisung.mall.common.pojo.res.ThirdApiRes; import com.suisung.mall.core.web.service.IBaseService; @@ -304,4 +305,11 @@ public interface AccountUserBaseService extends IBaseService { * @return Pair 第一个元素表示是否成功,第二个元素表示提示信息 */ Pair merchantInnerRegister(String mobile); + + /** + * 批量保存accountInfo + * + * @return + */ + ThirdApiRes saveBatchAccountUserLogin(List accountUserLoginList); } diff --git a/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java b/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java index d9727c1c..ffd2ed34 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java +++ b/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java @@ -3849,6 +3849,23 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl accountUserLoginList) { + boolean result = false; + if (!accountUserLoginList.isEmpty()) { + try { + result = accountUserLoginService.saveBatch(accountUserLoginList, accountUserLoginList.size()); + } catch (Exception e) { + throw new RuntimeException("保存AccountUserLogin报错:" + e.getMessage()); + } + } + if (result) { + return new ThirdApiRes().success("成功"); + } + return new ThirdApiRes().fail(250, "保存异常"); + } + + /** * 检查并修复商户店铺信息 * 重要(补偿机制),检查修复商户入驻店铺信息(商家账号关联入驻店铺Id,给商家账户创立公司员工账号和权限) diff --git a/mall-common/src/main/java/com/suisung/mall/common/feignService/AccountService.java b/mall-common/src/main/java/com/suisung/mall/common/feignService/AccountService.java index 5ff48994..86974446 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/feignService/AccountService.java +++ b/mall-common/src/main/java/com/suisung/mall/common/feignService/AccountService.java @@ -280,6 +280,15 @@ public interface AccountService { @PostMapping(value = "/admin/account/accountController/saveBatchAccountInfo") ThirdApiRes saveBatchAccountInfo(@RequestBody List accountUserInfoList); + /** + * 批量保存accountUserLogin + * + * @return + */ + @PostMapping(value = "/admin/account/accountController/saveBatchAccountUserLogin") + ThirdApiRes saveBatchAccountUserLogin(@RequestBody List accountUserLoginList); + + /** * 批量保存accountInfo * diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java index 71c85633..32f9292d 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncBaseThirdSxAbstract.java @@ -22,6 +22,7 @@ import com.suisung.mall.common.feignService.AccountService; import com.suisung.mall.common.feignService.PayService; import com.suisung.mall.common.modules.account.AccountUserBase; import com.suisung.mall.common.modules.account.AccountUserInfo; +import com.suisung.mall.common.modules.account.AccountUserLogin; import com.suisung.mall.common.modules.base.ShopBaseProductBrand; import com.suisung.mall.common.modules.base.ShopBaseProductCategory; import com.suisung.mall.common.modules.base.ShopBaseProductSpec; @@ -608,6 +609,8 @@ public abstract class SyncBaseThirdSxAbstract{ List addAccountUserBases=new ArrayList<>(); List addAcountUserInfo=new ArrayList<>(); List addPayUserResource=new ArrayList<>(); + List accountUserLogins=new ArrayList<>(); + Date today=new Date(); for (int i = 0; i < accountBaseIds.size(); i++) { // account_user_base SyncThirdMemberReq syncThirdMemberReq=addMemberList.get(i); @@ -648,6 +651,14 @@ public abstract class SyncBaseThirdSxAbstract{ accountUserInfo.setUser_birthday(DateTimeUtils.parseDate(syncThirdMemberReq.getUser_birthday(), "yyyy-MM-dd")); } addAcountUserInfo.add(accountUserInfo); + + //account + AccountUserLogin accountUserLogin = new AccountUserLogin(); + accountUserLogin.setUser_id(userId); + accountUserLogin.setUser_active_time(today); + accountUserLogin.setUser_reg_date(today); + accountUserLogin.setUser_reg_time(today.getTime()); + accountUserLogins.add(accountUserLogin); if (syncThirdMemberReq.getUser_money() != null || syncThirdMemberReq.getUser_points() != null) { // pay_user_resource 用户支付资源,积分,余额 PayUserResource payUserResource = new PayUserResource(); @@ -673,13 +684,18 @@ public abstract class SyncBaseThirdSxAbstract{ throw new ApiException(ResultCode.FAILED,"addAcountUserInfo保存异常"); } } - if(!addPayUserResource.isEmpty()){ ThirdApiRes thirdApiRes= payService.saveBatchPayUserResources(addPayUserResource); if(thirdApiRes.getError_code()!=0){ throw new ApiException(ResultCode.FAILED); } } + if(!accountUserLogins.isEmpty()){ + ThirdApiRes thirdApiRes= accountService.saveBatchAccountUserLogin(accountUserLogins); + if(thirdApiRes.getError_code()!=0){ + throw new ApiException(ResultCode.FAILED,"accountUserLogin保存异常"); + } + } return count; } From 3e3a8a32a320f593577061008f7c956947c8d759 Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Sat, 27 Dec 2025 00:04:51 +0800 Subject: [PATCH 26/45] =?UTF-8?q?=E5=88=86=E5=BA=97=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=A2=9E=E5=8A=A0=E5=85=B3=E9=94=AE=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lakala/service/impl/LklTkServiceImpl.java | 29 +++++++++- .../ShopMchEntryBranchAdminController.java | 56 +++++++++++++++++++ .../service/ShopMchEntryBranchService.java | 11 ++++ .../impl/ShopMchEntryBranchServiceImpl.java | 45 ++++++++++++++- 4 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopMchEntryBranchAdminController.java diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java index 3f6e0cae..9d835901 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java @@ -789,8 +789,10 @@ public class LklTkServiceImpl { */ public JSONObject updateMerchantNotify(HttpServletRequest request) { try { + logger.info("开始处理拉卡拉商户增终异步通知"); // 解密请求参数 String requestBody = LakalaUtil.getBody(request); + logger.info("拉卡拉商户增终异步通知返回加密数据:{}", requestBody); if (StrUtil.isBlank(requestBody)) { return new JSONObject().set("code", "400").set("message", "返回参数为空"); @@ -812,6 +814,7 @@ public class LklTkServiceImpl { if (StrUtil.isBlank(lklNotifyResp)) { return new JSONObject().set("code", "400").set("message", "数据解密出错!"); } + logger.info("拉卡拉商户增终异步通知返回明文数据:{}", lklNotifyResp); // 逻辑处理 JSONObject dataJSON = JSONUtil.parseObj(lklNotifyResp); @@ -827,10 +830,32 @@ public class LklTkServiceImpl { StrUtil.isBlank(merCupNo) || StrUtil.isBlank(reviewRelatedId) || StrUtil.isBlank(termNo)) { - return new JSONObject().set("code", "500").set("message", "参数解析出错"); + return new JSONObject().set("code", "500").set("message", "返回参数缺少关键数据"); } - // 给商家入驻表增加拉卡拉的商户号和拉卡拉返回的数据 + // 更新商户分店入驻表 + // status 状态:1-已成功;2-审核未通过;3-未处理;4-待审核; + Integer status = 4; + switch (reviewPass) { + case "PASS": + status = CommonConstant.Enable; + break; + case "UNPASS": + status = CommonConstant.Disable2; + break; + case "PASSING": + status = 3; + break; + case "PREPARE": + status = 4; + break; + default: + status = 4; + + } + shopMchEntryBranchService.updateByReviewRelatedId(reviewRelatedId, status, lklNotifyResp); + + // 给商家总店入驻表增加拉卡拉的商户号和拉卡拉返回的数据 ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByMerInnerNo(merInnerNo); if (shopMchEntry == null) { return new JSONObject().put("code", "500").put("message", merInnerNo + "内部商户号入驻信息不存在"); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopMchEntryBranchAdminController.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopMchEntryBranchAdminController.java new file mode 100644 index 00000000..c8be3184 --- /dev/null +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopMchEntryBranchAdminController.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit. + * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan. + * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna. + * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus. + * Vestibulum commodo. Ut rhoncus gravida arcu. + */ + +package com.suisung.mall.shop.store.controller.admin; + +import cn.hutool.json.JSONObject; +import com.suisung.mall.common.api.CommonResult; +import com.suisung.mall.common.pojo.dto.MainStoreBranchReqDTO; +import com.suisung.mall.common.service.impl.BaseControllerImpl; +import com.suisung.mall.shop.store.service.ShopMchEntryBranchService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.data.util.Pair; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +@Slf4j +@Api(tags = "商家入驻业务控制器") +@RestController +@RequestMapping("/admin/shop/merch/branch") +public class ShopMchEntryBranchAdminController extends BaseControllerImpl { + + + @Resource + private ShopMchEntryBranchService shopMchEntryBranchService; + + /** + * 商家申请入驻商城平台 + * + * @param mainStoreBranchReqJSON + * @return + */ + @ApiOperation(value = "后台-申请总店的分店", notes = "向拉卡拉申请总店的分店") + @RequestMapping(value = "/apply/store", method = RequestMethod.POST) + public CommonResult shopMerchEntryList(@RequestBody JSONObject mainStoreBranchReqJSON) { + MainStoreBranchReqDTO mainStoreBranchReq = mainStoreBranchReqJSON.toBean(MainStoreBranchReqDTO.class); + Pair result = shopMchEntryBranchService.applyMchEntryBranchStore(mainStoreBranchReq); + if (result.getFirst()) { + return CommonResult.success(); + } + + return CommonResult.failed(result.getSecond()); + } + + +} diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMchEntryBranchService.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMchEntryBranchService.java index 0e1cdb89..85de8680 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMchEntryBranchService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMchEntryBranchService.java @@ -22,6 +22,17 @@ public interface ShopMchEntryBranchService { */ Boolean saveShopMchEntryBranch(ShopMchEntryBranch shopMchEntryBranch); + + /** + * 更新商户终端入驻申请信息 + * + * @param reviewRelatedId 商户终端入驻申请ID + * @param status 商户终端入驻申请状态 + * @param notifyResp 商户终端入驻申请通知响应数据 + * @return 更新结果 + */ + Boolean updateByReviewRelatedId(String reviewRelatedId, Integer status, String notifyResp); + /** * 根据商户终端入驻申请ID查询商户终端入驻申请信息 * 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 f937abe2..5b5f80ea 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 @@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.suisung.mall.common.constant.CommonConstant; import com.suisung.mall.common.exception.ApiException; import com.suisung.mall.common.feignService.AccountService; @@ -28,6 +29,7 @@ import org.springframework.data.util.Pair; import org.springframework.stereotype.Service; import java.util.Arrays; +import java.util.Date; import java.util.Objects; @Slf4j @@ -101,6 +103,45 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl 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 (StrUtil.isNotBlank(notifyResp)) { // 允许空字符串,但不能为null + updateWrapper.set(ShopMchEntryBranch::getLkl_notify_reps, notifyResp); + } + + boolean result = update(updateWrapper); + + if (result) { + log.info("成功更新分店入驻申请记录,审核关联号: {}", reviewRelatedId); + } else { + log.warn("更新分店入驻申请记录失败,审核关联号: {}", reviewRelatedId); + } + + return result; + } catch (Exception e) { + log.error("更新分店入驻申请记录时发生异常,审核关联号: {}", reviewRelatedId, e); + return false; + } + } + + /** * 根据商户终端入驻申请ID查询商户终端入驻申请信息 * @@ -159,8 +200,8 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl entryQueryWrapper = new LambdaQueryWrapper<>(); entryQueryWrapper.eq(ShopMchEntry::getStore_id, mainStoreBranchReq.getParent_store_id()) - .eq(ShopMchEntry::getApproval_status, CommonConstant.Enable) - .eq(ShopMchEntry::getParent_id, 0L); + .eq(ShopMchEntry::getApproval_status, CommonConstant.MCH_APPR_STA_PASS) + .eq(ShopMchEntry::getParent_id, 0L); // 总店记录 ShopMchEntry mchEntry = shopMchEntryService.findOneByLambdaQueryWrapper(entryQueryWrapper); if (mchEntry == null) { From d9d9efd2332788806890d044390258791cc8ecd1 Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Sat, 27 Dec 2025 12:11:49 +0800 Subject: [PATCH 27/45] =?UTF-8?q?=E5=88=86=E5=BA=97=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=A2=9E=E5=8A=A0=E5=85=B3=E9=94=AE=E6=97=A5?= =?UTF-8?q?=E5=BF=972?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lakala/service/impl/LklTkServiceImpl.java | 40 +++++++++---------- .../ShopMchEntryBranchAdminController.java | 25 ++++++++---- 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java index 9d835901..7e946ef6 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java @@ -879,10 +879,22 @@ public class LklTkServiceImpl { } + /** + * 向拉卡拉申请增加终端 + * + * @param externalCustomerNo 拉卡拉外部商户号 + * @return 拉卡拉响应数据 + */ public JSONObject openMerchantAddTerm(String externalCustomerNo) { - logger.debug("开始获取拉卡拉商户信息,externalCustomerNo={}", externalCustomerNo); + logger.debug("开始向拉卡拉申请增加终端,externalCustomerNo={}", externalCustomerNo); try { + // 参数校验 + if (StrUtil.isBlank(externalCustomerNo)) { + logger.warn("拉卡拉外部商户号不能为空"); + return null; + } + // 构造请求参数并加密 JSONObject requestParams = new JSONObject(); requestParams.set("externalCustomerNo", externalCustomerNo); @@ -910,7 +922,7 @@ public class LklTkServiceImpl { } String encryptedParams = LakalaUtil.encryptByPrivateKey(requestParams.toString(), privateKey); - logger.warn("请求参数加密完成"); + logger.debug("请求参数加密完成"); // 获取认证信息 String authorization = getLklTkAuthorization(); @@ -930,28 +942,29 @@ public class LklTkServiceImpl { // 检查响应结果 if (response == null || !"000000".equals(response.getStr("code")) || response.get("data") == null) { - logger.error("拉卡拉商户信息获取失败,response={}", response); + logger.error("向拉卡拉申请增加终端失败,response={}", response); return null; } // 解密响应数据 String publicKey = LakalaUtil.getResourceFile(apiPubKeyPath, false, false); if (StrUtil.isBlank(publicKey)) { - logger.error("获取拉卡拉公钥失败,apiPubKeyPath={}", apiPubKeyPath); + logger.error("向拉卡拉申请增加终端获取公钥失败,apiPubKeyPath={}", apiPubKeyPath); return null; } String responseData = LakalaUtil.decryptByPublicKey(response.getStr("data"), publicKey); - logger.warn("响应数据解密完成"); + logger.debug("响应数据解密完成"); return JSONUtil.parseObj(responseData); } catch (Exception e) { - logger.error("获取拉卡拉商户信息异常,externalCustomerNo={}", externalCustomerNo, e); + logger.error("向拉卡拉申请增加终端异常,externalCustomerNo={}", externalCustomerNo, e); return null; } } + /** * 商家进件成功,拉卡拉商户号获取商户信息(需加密) * @@ -960,8 +973,6 @@ public class LklTkServiceImpl { * @return 商户信息JSONObject,获取失败返回null */ public JSONObject openMerchantInfo(String externalCustomerNo, String customerNo) { - logger.debug("开始获取拉卡拉商户信息,externalCustomerNo={}, customerNo={}", externalCustomerNo, customerNo); - try { // 构造请求参数并加密(至少需要一个参数) JSONObject requestParams = new JSONObject(); @@ -983,12 +994,8 @@ public class LklTkServiceImpl { logger.error("获取拉卡拉私钥失败,apiPriKeyPath={}", apiPriKeyPath); return null; } -// logger.info("api 私钥:{}", privateKey); - - logger.info("请求明文参数:{}", requestParams); String encryptedParams = LakalaUtil.encryptByPrivateKey(requestParams.toString(), privateKey); -// logger.debug("请求参数加密完成"); // 获取认证信息 String authorization = getLklTkAuthorization(); @@ -1001,15 +1008,9 @@ public class LklTkServiceImpl { String urlPath = buildLklTkUrl("/htkmerchants/open/merchant/info"); JSONObject header = new JSONObject().set("Authorization", authorization); JSONObject requestBody = new JSONObject().set("data", encryptedParams); - logger.info("请求地址:{}", urlPath); - logger.info("请求头:{}", header); - - logger.info("请求加密参数:{}", requestBody); - // 发送请求 - JSONObject response = RestTemplateHttpUtil.sendLklPostSrc( - urlPath, header, requestBody, JSONObject.class); + JSONObject response = RestTemplateHttpUtil.sendLklPostSrc(urlPath, header, requestBody, JSONObject.class); // 检查响应结果 if (response == null || !"000000".equals(response.getStr("code")) || response.get("data") == null) { @@ -1025,7 +1026,6 @@ public class LklTkServiceImpl { } String responseData = LakalaUtil.decryptByPublicKey(response.getStr("data"), publicKey); - logger.info("响应数据解密完成: {}", responseData); return JSONUtil.parseObj(responseData); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopMchEntryBranchAdminController.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopMchEntryBranchAdminController.java index c8be3184..66886174 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopMchEntryBranchAdminController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopMchEntryBranchAdminController.java @@ -35,7 +35,7 @@ public class ShopMchEntryBranchAdminController extends BaseControllerImpl { private ShopMchEntryBranchService shopMchEntryBranchService; /** - * 商家申请入驻商城平台 + * 申请总店的分店 * * @param mainStoreBranchReqJSON * @return @@ -43,13 +43,24 @@ public class ShopMchEntryBranchAdminController extends BaseControllerImpl { @ApiOperation(value = "后台-申请总店的分店", notes = "向拉卡拉申请总店的分店") @RequestMapping(value = "/apply/store", method = RequestMethod.POST) public CommonResult shopMerchEntryList(@RequestBody JSONObject mainStoreBranchReqJSON) { - MainStoreBranchReqDTO mainStoreBranchReq = mainStoreBranchReqJSON.toBean(MainStoreBranchReqDTO.class); - Pair result = shopMchEntryBranchService.applyMchEntryBranchStore(mainStoreBranchReq); - if (result.getFirst()) { - return CommonResult.success(); - } + try { + // 参数校验 + if (mainStoreBranchReqJSON == null) { + return CommonResult.failed("请求参数不能为空"); + } - return CommonResult.failed(result.getSecond()); + MainStoreBranchReqDTO mainStoreBranchReq = mainStoreBranchReqJSON.toBean(MainStoreBranchReqDTO.class); + Pair result = shopMchEntryBranchService.applyMchEntryBranchStore(mainStoreBranchReq); + + if (result.getFirst()) { + return CommonResult.success(); + } + + return CommonResult.failed(result.getSecond()); + } catch (Exception e) { + log.error("申请总店分店异常", e); + return CommonResult.failed("系统异常,请稍后重试"); + } } From 7f0d3e98977d010107c0ef07fb7551beca17f580 Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Sun, 28 Dec 2025 23:00:43 +0800 Subject: [PATCH 28/45] =?UTF-8?q?=E5=88=86=E5=BA=97=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=B4=A6=E5=8F=B7=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/AccountUserBaseController.java | 6 +- .../service/AccountUserBaseService.java | 3 +- .../impl/AccountUserBaseServiceImpl.java | 37 +++- .../common/feignService/AccountService.java | 3 +- .../lakala/service/impl/LklTkServiceImpl.java | 48 ++--- .../store/service/ShopMchEntryService.java | 17 ++ .../impl/ShopMchEntryBranchServiceImpl.java | 193 ++++++++++++------ .../service/impl/ShopMchEntryServiceImpl.java | 35 +++- 8 files changed, 228 insertions(+), 114 deletions(-) diff --git a/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountUserBaseController.java b/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountUserBaseController.java index 81287903..4e11df41 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountUserBaseController.java +++ b/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountUserBaseController.java @@ -233,10 +233,10 @@ public class AccountUserBaseController extends BaseControllerImpl { return CommonResult.success(accountUserBaseService.logout()); } - @ApiOperation("服务间注册商家账号,项目之间远程调用") + @ApiOperation("注册商家账号,项目之间远程调用") @RequestMapping(value = "/merchant/inner-register", method = RequestMethod.POST) - public Pair merchantInnerRegister(@Param("mobile") String mobile) { - return accountUserBaseService.merchantInnerRegister(mobile); + public Pair merchantInnerRegister(@Param("mobile") String mobile, @Param("regPwd") String regPwd) { + return accountUserBaseService.merchantInnerRegister(mobile, regPwd); } } diff --git a/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java b/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java index 3ce174c4..01c8be0b 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java +++ b/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java @@ -302,9 +302,10 @@ public interface AccountUserBaseService extends IBaseService { * 商家内部注册(服务之间调用) * * @param mobile 商家手机号 + * @param regPwd 注册密码 * @return Pair 第一个元素表示是否成功,第二个元素表示提示信息 */ - Pair merchantInnerRegister(String mobile); + Pair merchantInnerRegister(String mobile, String regPwd); /** * 批量保存accountInfo diff --git a/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java b/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java index ffd2ed34..517f83c6 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java +++ b/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java @@ -1715,8 +1715,6 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl smsArgs = new HashMap<>(); smsArgs.put("password", user_password_src); - sendSmsMessage(PhoneNumberUtils.cleanPhoneNumber(user_mobile), "SMS_496910525", smsArgs); // SMS_496910525 + sendSmsMessage(PhoneNumberUtils.cleanPhoneNumber(user_mobile), "SMS_496910525", smsArgs); } //初次注册发送消息 @@ -3221,6 +3218,20 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl 第一个元素表示是否成功,第二个元素表示提示信息 */ @Override - public Pair merchantInnerRegister(String mobile) { + public Pair merchantInnerRegister(String mobile, String regPwd) { log.info("商家内部注册开始,手机号: {}", mobile); // 1. 参数校验 @@ -3305,7 +3320,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl merchantInnerRegister(@Param("mobile") String mobile); + Pair merchantInnerRegister(@Param("mobile") String mobile, @Param("regPwd") String regPwd); + } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java index 7e946ef6..882dff3d 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java @@ -789,22 +789,24 @@ public class LklTkServiceImpl { */ public JSONObject updateMerchantNotify(HttpServletRequest request) { try { - logger.info("开始处理拉卡拉商户增终异步通知"); // 解密请求参数 String requestBody = LakalaUtil.getBody(request); - logger.info("拉卡拉商户增终异步通知返回加密数据:{}", requestBody); + logger.info("拉卡拉商户增终异步通知 - 接收原始数据: {}", requestBody); if (StrUtil.isBlank(requestBody)) { + logger.warn("拉卡拉商户增终异步通知 - 请求参数为空"); return new JSONObject().set("code", "400").set("message", "返回参数为空"); } JSONObject reqBodyJSON = JSONUtil.parseObj(requestBody); if (reqBodyJSON.isEmpty() || reqBodyJSON.get("data") == null) { + logger.warn("拉卡拉商户增终异步通知 - 参数格式有误,无法解析: {}", requestBody); return new JSONObject().set("code", "400").set("message", "参数格式有误,无法解析"); } String srcData = reqBodyJSON.getStr("data"); if (StrUtil.isBlank(srcData)) { + logger.warn("拉卡拉商户增终异步通知 - 关键参数为空值"); return new JSONObject().set("code", "400").set("message", "关键参数为空值"); } @@ -812,64 +814,56 @@ public class LklTkServiceImpl { String notifyPubKey = LakalaUtil.getResourceFile(notifyPubKeyPath, false, false); String lklNotifyResp = LakalaUtil.decryptNotifyData(notifyPubKey, srcData); if (StrUtil.isBlank(lklNotifyResp)) { + logger.error("拉卡拉商户增终异步通知 - 数据解密失败,加密数据: {}", srcData); return new JSONObject().set("code", "400").set("message", "数据解密出错!"); } - logger.info("拉卡拉商户增终异步通知返回明文数据:{}", lklNotifyResp); + logger.info("拉卡拉商户增终异步通知 - 解密后数据: {}", lklNotifyResp); // 逻辑处理 JSONObject dataJSON = JSONUtil.parseObj(lklNotifyResp); String reviewPass = dataJSON.getStr("reviewPass"); String merCupNo = dataJSON.getStr("externalCustomerNo"); //拉卡拉外部商户号 - String merInnerNo = dataJSON.getStr("customerNo"); //拉卡拉内部商户号 String termNo = dataJSON.getStr("termNo"); //拉卡拉分配的业务终端号 String reviewRelatedId = dataJSON.getStr("reviewRelatedId"); //拉卡拉分配的业务终端号 + logger.info("拉卡拉商户增终异步通知 - 解析数据完成 - 审核状态: {}, 外部商户号: {}, 终端号: {}, 审核关联ID: {}", + reviewPass, merCupNo, termNo, reviewRelatedId); + // 合并参数校验 if (dataJSON.isEmpty() || StrUtil.isBlank(reviewPass) || - StrUtil.isBlank(merCupNo) || StrUtil.isBlank(reviewRelatedId) || StrUtil.isBlank(termNo)) { + logger.warn("拉卡拉商户增终异步通知 - 参数解析出错,解密数据: {}", lklNotifyResp); return new JSONObject().set("code", "500").set("message", "返回参数缺少关键数据"); } // 更新商户分店入驻表 // status 状态:1-已成功;2-审核未通过;3-未处理;4-待审核; - Integer status = 4; - switch (reviewPass) { - case "PASS": - status = CommonConstant.Enable; - break; - case "UNPASS": - status = CommonConstant.Disable2; - break; - case "PASSING": - status = 3; - break; - case "PREPARE": - status = 4; - break; - default: - status = 4; - - } + Integer status = "PASS".equals(reviewPass) ? CommonConstant.Enable : + "UNPASS".equals(reviewPass) ? CommonConstant.Disable2 : + "PASSING".equals(reviewPass) ? 3 : 4; + logger.info("拉卡拉商户增终异步通知 - 更新分店入驻表,审核关联ID: {}, 状态: {}, 通知响应: {}", reviewRelatedId, status, lklNotifyResp); shopMchEntryBranchService.updateByReviewRelatedId(reviewRelatedId, status, lklNotifyResp); // 给商家总店入驻表增加拉卡拉的商户号和拉卡拉返回的数据 - ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByMerInnerNo(merInnerNo); + ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByMerCupNo(merCupNo, 0L); if (shopMchEntry == null) { - return new JSONObject().put("code", "500").put("message", merInnerNo + "内部商户号入驻信息不存在"); + logger.error("拉卡拉商户增终异步通知 - 商户号入驻信息不存在: {}", merCupNo); + return new JSONObject().put("code", "500").put("message", merCupNo + "商户号入驻信息不存在"); } // 校验审核状态: PREPARE:待提交; PASS:通过; UNPASS:未通过; PASSING:审核中; if (!"PASS".equals(reviewPass)) { - String reviewResult = dataJSON.getStr("reviewResult"); - return new JSONObject().set("code", "FAIL").set("message", "审核未通过:" + reviewResult); + logger.info("拉卡拉商户增终异步通知 - 审核未通过,状态: {}, 结果: {}", reviewPass, dataJSON.getStr("reviewResult")); + return new JSONObject().set("code", "500").set("message", "忽略处理,因审核未通过:" + dataJSON.getStr("reviewResult")); } + logger.info("拉卡拉商户增终异步通知 - 审核通过,开始创建分店入驻记录,审核关联ID: {}, 终端号: {}", reviewRelatedId, termNo); // RMK 拉卡拉增终成功, 创建分店入驻记录,创建商家账号、创建店铺和周边信息 shopMchEntryBranchService.createMchEntryBranchStore(reviewRelatedId, termNo, lklNotifyResp); + logger.info("拉卡拉商户增终异步通知 - 处理完成,审核关联ID: {}", reviewRelatedId); return new JSONObject().set("code", "200").set("message", "处理成功"); } catch (Exception e) { diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMchEntryService.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMchEntryService.java index 5f144589..02f3c29b 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMchEntryService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMchEntryService.java @@ -138,6 +138,15 @@ public interface ShopMchEntryService { ShopMchEntry getShopMerchEntryByCondition(String loginMobile, String bizLicenseNumber, Integer... approvalStatusList); + /** + * 根据拉卡拉商户号获取有效的商家入驻申请记录 + * + * @param merCupNo + * @param parentId + * @return + */ + ShopMchEntry getShopMerchEntryByMerCupNo(String merCupNo, Long parentId); + /** * 根据拉卡拉外部商户号获取有效的商家入驻申请记录 * @@ -386,4 +395,12 @@ public interface ShopMchEntryService { ShopMchEntry getLklContractStatusUrl(Integer storeId); ShopMchEntry findOneByLambdaQueryWrapper(LambdaQueryWrapper query); + + /** + * 根据商户入驻Id删除商户入驻记录 + * + * @param mchId 商户入驻Id + * @return 删除结果,true为成功,false为失败 + */ + Boolean removeByMchId(Long mchId); } \ No newline at end of file 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 5b5f80ea..6a605729 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 @@ -191,13 +191,27 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl entryQueryWrapper = new LambdaQueryWrapper<>(); entryQueryWrapper.eq(ShopMchEntry::getStore_id, mainStoreBranchReq.getParent_store_id()) .eq(ShopMchEntry::getApproval_status, CommonConstant.MCH_APPR_STA_PASS) @@ -205,79 +219,57 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl nameQueryWrapper = new LambdaQueryWrapper<>(); nameQueryWrapper.eq(ShopStoreBase::getStore_name, mainStoreBranchReq.getStore_name()); - ShopStoreBase existingStore = shopStoreBaseService.getOne(nameQueryWrapper); - if (existingStore != null) { - log.warn("店铺名称已存在: {}", mainStoreBranchReq.getStore_name()); + if (shopStoreBaseService.getOne(nameQueryWrapper) != null) { return Pair.of(false, "店铺名称已存在"); } - log.debug("店铺名称检查通过"); // 4. 检查分店登录手机号是否已经注册过商户 - log.debug("检查手机号是否已注册商户: {}", mainStoreBranchReq.getLogin_mobile()); Integer status = accountService.isMerchantExists(mainStoreBranchReq.getLogin_mobile()); if (CheckUtil.isEmpty(status)) { - log.error("调用账户服务检查商户信息失败,手机号: {}", mainStoreBranchReq.getLogin_mobile()); return Pair.of(false, "检查商户信息失败!"); } if (CommonConstant.Enable.equals(status)) { - log.warn("手机号商户已被注册: {}", mainStoreBranchReq.getLogin_mobile()); - return Pair.of(false, "手机号商户已被注册"); + return Pair.of(false, "手机号已被其他商家注册"); } - log.debug("手机号检查通过"); // 5. 检查分店终端号是否已经申请或申请中 - log.debug("检查分店终端号是否已申请或申请中,拉卡拉内部商户号: {}", mchEntry.getLkl_mer_inner_no()); LambdaQueryWrapper branchQueryWrapper = new LambdaQueryWrapper<>(); branchQueryWrapper.eq(ShopMchEntryBranch::getLkl_mer_cup_no, mchEntry.getLkl_mer_inner_no()) .in(ShopMchEntryBranch::getStatus, Arrays.asList(1, 3)); // 1-申请中,3-可能的其他状态 - long existingBranchCount = count(branchQueryWrapper); - if (existingBranchCount > 0) { - log.info("分店终端号已申请或申请中,拉卡拉内部商户号: {},已存在申请数量: {}", - mchEntry.getLkl_mer_inner_no(), existingBranchCount); + if (count(branchQueryWrapper) > 0) { return Pair.of(false, "分店终端号已申请或申请中,请等待审核"); } - log.debug("终端号检查通过"); // 6. 调用拉卡拉接口创建商户终端 - log.info("调用拉卡拉接口创建商户终端,主店拉卡拉商户号: {}", mchEntry.getLkl_mer_cup_no()); JSONObject lklResp = lklTkService.openMerchantAddTerm(mchEntry.getLkl_mer_cup_no()); if (lklResp == null || StrUtil.isBlank(lklResp.getStr("reviewRelatedId"))) { log.error("调用拉卡拉接口创建商户终端失败,主店拉卡拉商户号: {}", mchEntry.getLkl_mer_cup_no()); return Pair.of(false, "分店提交申请失败"); } - String reviewRelatedId = lklResp.getStr("reviewRelatedId"); - log.info("拉卡拉接口调用成功,审核关联号: {}", reviewRelatedId); // 7. 保存商户入驻申请信息 - log.debug("开始保存商户入驻申请信息"); ShopMchEntryBranch shopMchEntryBranch = new ShopMchEntryBranch(); shopMchEntryBranch.setLkl_mer_cup_no(mchEntry.getLkl_mer_cup_no()); - shopMchEntryBranch.setReview_related_id(reviewRelatedId); + shopMchEntryBranch.setReview_related_id(lklResp.getStr("reviewRelatedId")); shopMchEntryBranch.setLkl_req(JSONUtil.toJsonStr(mainStoreBranchReq)); shopMchEntryBranch.setLkl_reps(JSONUtil.toJsonStr(lklResp)); - Boolean isSuccess = saveShopMchEntryBranch(shopMchEntryBranch); - if (!isSuccess) { - log.error("保存商户入驻申请信息失败,审核关联号: {}", reviewRelatedId); + if (!saveShopMchEntryBranch(shopMchEntryBranch)) { return Pair.of(false, "分店提交申请失败"); } - log.info("分店商户入驻申请创建成功,审核关联号: {}", lklResp.getStr("reviewRelatedId")); + log.info("分店商户入驻申请创建成功,审核关联号: {}", lklResp.getStr("reviewRelatedId")); return Pair.of(true, "分店提交申请成功"); } catch (Exception e) { @@ -301,7 +293,6 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl registerResult = accountService.merchantInnerRegister(mainStoreBranchReq.getLogin_mobile()); + Pair registerResult = accountService.merchantInnerRegister(mainStoreBranchReq.getLogin_mobile(), mainStoreBranchReq.getPassword()); if (!registerResult.getFirst()) { - log.error("分店商户注册账号失败,手机号: {},错误信息: {}", mainStoreBranchReq.getLogin_mobile(), registerResult.getSecond()); throw new ApiException("分店商户注册账号失败:" + registerResult.getSecond()); } - log.debug("分店商户注册账号成功,手机号: {}", mainStoreBranchReq.getLogin_mobile()); - // 9. 创建分店店铺信息,创建分店店铺周边信息(公司、员工、权限等) - Pair storeResult = shopStoreBaseService.covMerchEntryInfo2StoreInfo(shopMchEntry.getId(), parentStoreId, true); + // 9. 创建分店店铺信息 + Pair storeResult = shopStoreBaseService.covMerchEntryInfo2StoreInfo(shopMchEntry.getId(), Convert.toInt(parentShopMchEntry.getStore_id(), 0), true); if (storeResult == null || storeResult.getFirst() <= 0) { - log.error("创建分店店铺信息失败,分店入驻ID: {},错误信息: {}", shopMchEntry.getId(), - storeResult != null ? storeResult.getSecond() : "返回结果为空"); throw new ApiException("创建分店店铺信息失败: " + (storeResult != null ? storeResult.getSecond() : "未知错误")); } - log.info("分店商户入驻处理成功,分店入驻ID: {}, 店铺ID: {}", shopMchEntry.getId(), storeResult.getFirst()); + log.info("分店商户入驻处理成功,分店入驻ID: {}, 店铺ID: {}", shopMchEntry.getId(), storeResult.getFirst()); return Pair.of(true, "分店商户入驻处理成功"); } catch (Exception e) { @@ -402,4 +374,97 @@ public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl cleanMchEntryBranchStore(String lklMerCupNo, String lklTermNo) { + log.info("开始清理分店商户入驻信息,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo); + + // 1. 参数校验 + if (StrUtil.isBlank(lklMerCupNo) || StrUtil.isBlank(lklTermNo)) { + log.warn("清理分店商户入驻参数校验失败,lklMerCupNo: {}, lklTermNo: {}", lklMerCupNo, lklTermNo); + return Pair.of(false, "参数不能为空"); + } + + try { + log.debug("步骤1 - 查询分店入驻记录,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo); + // 2. 查询分店入驻记录 + LambdaQueryWrapper entryQueryWrapper = new LambdaQueryWrapper<>(); + entryQueryWrapper.eq(ShopMchEntry::getLkl_mer_cup_no, lklMerCupNo) + .eq(ShopMchEntry::getLkl_term_no, lklTermNo); + ShopMchEntry shopMchEntry = shopMchEntryService.findOneByLambdaQueryWrapper(entryQueryWrapper); + + if (shopMchEntry == null) { + log.warn("未找到对应的分店入驻记录,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo); + return Pair.of(false, "未找到对应的分店入驻记录"); + } + log.debug("步骤1 - 找到分店入驻记录,分店ID: {}, 店铺名称: {}", shopMchEntry.getId(), shopMchEntry.getStore_name()); + + log.debug("步骤2 - 查询分店店铺信息,分店入驻ID: {}", shopMchEntry.getId()); + // 3. 查询分店店铺信息 + LambdaQueryWrapper storeQueryWrapper = new LambdaQueryWrapper<>(); + storeQueryWrapper.eq(ShopStoreBase::getStore_id, shopMchEntry.getStore_id()); + ShopStoreBase shopStore = shopStoreBaseService.getOne(storeQueryWrapper); + + if (shopStore == null) { + log.warn("未找到对应的分店店铺信息,分店入驻ID: {}", shopMchEntry.getId()); + } else { + log.debug("步骤2 - 找到分店店铺信息,店铺ID: {}, 店铺名称: {}", shopStore.getStore_id(), shopStore.getStore_name()); + } + + log.debug("步骤3 - 删除分店店铺信息,店铺ID: {}", shopStore != null ? shopStore.getStore_id() : "null"); + // 4. 删除分店店铺信息 + if (shopStore != null) { + boolean deleteStoreResult = shopStoreBaseService.removeById(shopStore.getStore_id()); + if (!deleteStoreResult) { + log.error("删除分店店铺信息失败,店铺ID: {}", shopStore.getStore_id()); + throw new ApiException("删除分店店铺信息失败"); + } + log.debug("步骤3 - 删除分店店铺信息成功,店铺ID: {}", shopStore.getStore_id()); + } + + log.debug("步骤4 - 删除分店入驻记录,分店ID: {}", shopMchEntry.getId()); + // 5. 删除分店入驻记录 + boolean deleteEntryResult = shopMchEntryService.removeByMchId(shopMchEntry.getId()); + if (!deleteEntryResult) { + log.error("删除分店入驻记录失败,分店ID: {}", shopMchEntry.getId()); + throw new ApiException("删除分店入驻记录失败"); + } + log.debug("步骤4 - 删除分店入驻记录成功,分店ID: {}", shopMchEntry.getId()); + + log.debug("步骤5 - 查询分店入驻申请记录,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo); + // 6. 查询分店入驻申请记录 + LambdaQueryWrapper branchQueryWrapper = new LambdaQueryWrapper<>(); + branchQueryWrapper.eq(ShopMchEntryBranch::getLkl_mer_cup_no, lklMerCupNo) + .eq(ShopMchEntryBranch::getLkl_term_no, lklTermNo); + ShopMchEntryBranch shopMchEntryBranch = getOne(branchQueryWrapper); + + if (shopMchEntryBranch != null) { + log.debug("步骤5 - 找到分店入驻申请记录,审核关联ID: {}", shopMchEntryBranch.getReview_related_id()); + + log.debug("步骤6 - 删除分店入驻申请记录,审核关联ID: {}", shopMchEntryBranch.getReview_related_id()); + // 7. 删除分店入驻申请记录 + boolean deleteBranchResult = removeById(shopMchEntryBranch.getId()); + if (!deleteBranchResult) { + log.error("删除分店入驻申请记录失败,审核关联ID: {}", shopMchEntryBranch.getReview_related_id()); + throw new ApiException("删除分店入驻申请记录失败"); + } + log.debug("步骤6 - 删除分店入驻申请记录成功,审核关联ID: {}", shopMchEntryBranch.getReview_related_id()); + } + + log.info("分店商户入驻信息清理完成,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo); + return Pair.of(true, "分店商户入驻信息清理成功"); + + } catch (Exception e) { + log.error("清理分店商户入驻信息时发生异常,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo, e); + throw new ApiException("清理分店商户入驻信息时发生异常,拉卡拉商户号: " + lklMerCupNo + ", 终端号: " + lklTermNo); + } + } + + } 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 8b6bfee6..55e77112 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 @@ -1319,16 +1319,21 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(ShopMchEntry::getLkl_mer_cup_no, merCupNo) - .eq(ShopMchEntry::getParent_id, 0L) // 总店 .eq(ShopMchEntry::getStatus, CommonConstant.Enable) .orderByAsc(ShopMchEntry::getId); + + if (parentId != null && parentId >= 0) { + queryWrapper.eq(ShopMchEntry::getParent_id, parentId); + } + ShopMchEntry record = findOne(queryWrapper); if (ObjectUtil.isEmpty(record)) { return null; @@ -1337,20 +1342,25 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("lkl_mer_inner_no", merInnerNo).eq("status", CommonConstant.Enable).orderByAsc("id"); - List recordList = list(queryWrapper); - if (CollectionUtil.isEmpty(recordList)) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ShopMchEntry::getLkl_mer_inner_no, merInnerNo).eq(ShopMchEntry::getStatus, CommonConstant.Enable).orderByAsc(ShopMchEntry::getId); + ShopMchEntry record = findOne(queryWrapper); + if (ObjectUtil.isEmpty(record)) { return null; } - return recordList.get(0); + return record; } /** @@ -2656,6 +2666,17 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl Date: Mon, 29 Dec 2025 09:38:40 +0800 Subject: [PATCH 29/45] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ShopSyncImportServiceImpl.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/ShopSyncImportServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/ShopSyncImportServiceImpl.java index 5f0e04e1..77c173ce 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/ShopSyncImportServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/ShopSyncImportServiceImpl.java @@ -6,11 +6,13 @@ import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.gson.Gson; import com.suisung.mall.common.api.CommonResult; +import com.suisung.mall.common.domain.UserDto; import com.suisung.mall.common.enums.DicEnum; import com.suisung.mall.common.exception.ApiException; import com.suisung.mall.common.modules.base.ShopBaseProductBrand; import com.suisung.mall.common.modules.base.ShopBaseProductCategory; import com.suisung.mall.common.modules.sync.StoreDbConfig; +import com.suisung.mall.common.utils.ContextUtil; import com.suisung.mall.shop.base.service.ShopBaseProductBrandService; import com.suisung.mall.shop.base.service.ShopBaseProductCategoryService; import com.suisung.mall.shop.number.service.ShopNumberSeqService; @@ -110,6 +112,9 @@ public class ShopSyncImportServiceImpl implements ShopSyncImportService { @Override public CommonResult importBrandData(MultipartFile file,String storeId) { + if(!checkIsPlate()){ + throw new ApiException("用户无权限"); + } String fileName = storeUploadedFile(file); try { List excelList = readBrandExcelData(fileName); @@ -133,6 +138,9 @@ public class ShopSyncImportServiceImpl implements ShopSyncImportService { @Override public CommonResult importCategoryData(MultipartFile file,String storeId) { + if(!checkIsPlate()){ + throw new ApiException("用户无权限"); + } String fileName = storeUploadedFile(file); try { List excelList = readCategoryExcelData(fileName); @@ -157,6 +165,9 @@ public class ShopSyncImportServiceImpl implements ShopSyncImportService { @Override @Async public void importShopsData(MultipartFile file,String storeId) { + if(!checkIsPlate()){ + throw new ApiException("用户无权限"); + } String fileName = storeUploadedFile(file); readAndImportShopsExcelData(fileName,storeId); } @@ -244,6 +255,16 @@ public class ShopSyncImportServiceImpl implements ShopSyncImportService { private void initData(String storeId){ shopBaseProductCategoryService.getCategoryListByStoreId(storeId); } + + /** + * 判断是否平台 + * @return + */ + private boolean checkIsPlate(){ + UserDto userDto= ContextUtil.getCurrentUser(); + assert userDto != null; + return 9 == userDto.getRole_id(); + } } From b7b57d04d0e6482e2ff869cde7ee81361a382c4e Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Mon, 29 Dec 2025 17:28:23 +0800 Subject: [PATCH 30/45] =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E8=B0=83=E7=94=A8=20fi?= =?UTF-8?q?x=20=E4=BF=AE=E5=A4=8D=E5=85=A5=E5=8F=82=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=8F=8D=E5=B0=84=E5=BE=AA=E7=8E=AF?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/AccountBaseUserLevelController.java | 2 + .../admin/AccountUserBaseController.java | 9 +- .../service/AccountUserBaseService.java | 10 ++ .../impl/AccountUserBaseServiceImpl.java | 98 +++++++++++++++++++ .../common/feignService/AccountService.java | 10 +- .../ShopActivityGroupbookingServiceImpl.java | 8 ++ .../impl/AccountBaseConfigServiceImpl.java | 2 + .../impl/ShopOrderInfoServiceImpl.java | 2 + .../impl/ShopStoreEmployeeServiceImpl.java | 1 + 9 files changed, 138 insertions(+), 4 deletions(-) diff --git a/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountBaseUserLevelController.java b/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountBaseUserLevelController.java index bae3ff66..61d10fb0 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountBaseUserLevelController.java +++ b/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountBaseUserLevelController.java @@ -11,6 +11,7 @@ import com.suisung.mall.common.utils.I18nUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; @@ -32,6 +33,7 @@ public class AccountBaseUserLevelController { @Autowired private AccountBaseUserLevelService accountBaseUserLevelService; + @Lazy @Autowired private AccountService accountService; diff --git a/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountUserBaseController.java b/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountUserBaseController.java index 4e11df41..d4d63932 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountUserBaseController.java +++ b/mall-account/src/main/java/com/suisung/mall/account/controller/admin/AccountUserBaseController.java @@ -30,7 +30,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.util.Pair; import org.springframework.web.bind.annotation.RequestMapping; @@ -235,9 +234,15 @@ public class AccountUserBaseController extends BaseControllerImpl { @ApiOperation("注册商家账号,项目之间远程调用") @RequestMapping(value = "/merchant/inner-register", method = RequestMethod.POST) - public Pair merchantInnerRegister(@Param("mobile") String mobile, @Param("regPwd") String regPwd) { + public Pair merchantInnerRegister(@RequestParam("mobile") String mobile, @RequestParam("regPwd") String regPwd) { return accountUserBaseService.merchantInnerRegister(mobile, regPwd); } + @ApiOperation("更改分店商家的手机号(仅限于分店,尽量不要更高总店的手机号),项目之间远程调用") + @RequestMapping(value = "/change/merchant/login-mobile", method = RequestMethod.POST) + public Pair changeMerchantLoginMobile(@RequestParam("oldMobile") String oldMobile, @RequestParam("newMobile") String newMobile, @RequestParam("password") String password) { + return accountUserBaseService.changeMerchantLoginMobile(oldMobile, newMobile, password); + } + } diff --git a/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java b/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java index 01c8be0b..d45acea5 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java +++ b/mall-account/src/main/java/com/suisung/mall/account/service/AccountUserBaseService.java @@ -307,6 +307,16 @@ public interface AccountUserBaseService extends IBaseService { */ Pair merchantInnerRegister(String mobile, String regPwd); + /** + * 更改分店商家的手机号(仅限于分店,尽量不要更改总店的手机号),项目之间远程调用 + * + * @param oldMobile 老的手机号 + * @param newMobile 新的手机号 + * @param password 新的登录密码(可选) + * @return Pair 操作结果和提示信息,true表示成功,false表示失败 + */ + Pair changeMerchantLoginMobile(String oldMobile, String newMobile, String password); + /** * 批量保存accountInfo * diff --git a/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java b/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java index 517f83c6..957fd5a0 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java +++ b/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java @@ -3338,6 +3338,104 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl 操作结果和提示信息,true表示成功,false表示失败 + */ + @Override + public Pair changeMerchantLoginMobile(String oldMobile, String newMobile, String password) { + log.debug("开始更改商家登录手机号,老手机号:{},新手机号:{},是否需要设置密码:{}", oldMobile, newMobile, StrUtil.isNotBlank(password)); + + try { + // 验证输入参数 + if (StrUtil.isBlank(oldMobile) || StrUtil.isBlank(newMobile)) { + log.warn("手机号参数为空,老手机号:{},新手机号:{}", oldMobile, newMobile); + return Pair.of(false, "手机号不能为空"); + } + + // 格式化手机号,添加国际区号 + String formattedOldMobile = PhoneNumberUtils.convZhPhoneNumber(oldMobile); + String formattedNewMobile = PhoneNumberUtils.convZhPhoneNumber(newMobile); + log.debug("格式化后的手机号:老:{} 新:{}", formattedOldMobile, formattedNewMobile); + + // 查询老手机号是否绑定商家账号 + AccountUserBindConnect bindConnect = bindConnectService.getBindByBindId(formattedOldMobile, BindCode.MOBILE, CommonConstant.USER_TYPE_MCH); + if (bindConnect == null) { + log.warn("该老手机号未绑定商家账号,手机号:{}", formattedOldMobile); + return Pair.of(false, "该老手机号未绑定商家账号,无法进行更换"); + } + + // 获取用户信息 + Integer userId = bindConnect.getUser_id(); + log.debug("绑定记录中的用户ID:{}", userId); + + AccountUserBase userBase = get(userId); + if (userBase == null) { + log.warn("用户信息不存在,用户ID:{}", userId); + return Pair.of(false, "用户信息不存在,无法进行更换"); + } + + // 验证用户确实是商家类型 + if (!userBase.getUser_is_admin().equals(CommonConstant.USER_TYPE_MCH)) { + log.warn("该账号不是商家账号,用户ID:{},用户类型:{}", userId, userBase.getUser_is_admin()); + return Pair.of(false, "该账号不是商家账号,无法进行更换"); + } + + // 检查目标手机号是否已被其他商家账号使用 + AccountUserBase existingNewUser = getByAccountAndType(formattedNewMobile, CommonConstant.USER_TYPE_MCH); + if (existingNewUser != null && !existingNewUser.getUser_id().equals(userId)) { + log.warn("目标手机号已被其他商家账号使用,手机号:{},用户ID:{}", formattedNewMobile, existingNewUser.getUser_id()); + return Pair.of(false, "该手机号已被其他商家账号使用"); + } + + // 检查新手机号是否已被其他商家绑定 + AccountUserBindConnect newBindConnect = bindConnectService.getBindByBindId(formattedNewMobile, BindCode.MOBILE, CommonConstant.USER_TYPE_MCH); + if (newBindConnect != null && !newBindConnect.getUser_id().equals(userId)) { + log.warn("该新手机号已被其他商家账号绑定,手机号:{},用户ID:{}", formattedNewMobile, newBindConnect.getUser_id()); + return Pair.of(false, "该手机号已被其他商家账号绑定"); + } + + // 更新用户账号为新手机号 + log.debug("开始更新用户账号信息,用户ID:{},新手机号:{}", userId, formattedNewMobile); + userBase.setUser_account(formattedNewMobile); + + // 如果提供了密码,则更新密码 + if (StrUtil.isNotBlank(password)) { + log.debug("需要更新用户密码"); + String user_salt = IdUtil.simpleUUID(); + String encryptedPassword = SecureUtil.md5(user_salt + SecureUtil.md5(password)); + userBase.setUser_password(encryptedPassword); + userBase.setUser_salt(user_salt); + } + + // 更新用户基础信息 + boolean updateUserResult = saveOrUpdate(userBase); + if (!updateUserResult) { + log.error("更新用户账号信息失败,用户ID:{}", userId); + return Pair.of(false, "更新用户账号信息失败"); + } + + // 更新绑定表中的bind_id为新手机号 + log.debug("开始更新绑定信息,原绑定ID:{},新绑定ID:{}", bindConnect.getBind_id(), formattedNewMobile); + bindConnect.setBind_id(formattedNewMobile); + boolean updateBindResult = accountUserBindConnectService.saveOrUpdate(bindConnect); + if (!updateBindResult) { + log.error("更新绑定信息失败,绑定ID:{}", formattedNewMobile); + return Pair.of(false, "更新绑定信息失败"); + } + + log.info("更换商家登录手机号成功,用户ID:{},新手机号:{}", userId, formattedNewMobile); + return Pair.of(true, "更换商家登录手机号成功"); + } catch (Exception e) { + log.error("更改商家登录手机号过程中发生异常,老手机号:{},新手机号:{}", oldMobile, newMobile, e); + return Pair.of(false, "系统异常:" + e.getMessage()); + } + } + @Override public Map doAppConnectLogin(String bind_name, String code) { diff --git a/mall-common/src/main/java/com/suisung/mall/common/feignService/AccountService.java b/mall-common/src/main/java/com/suisung/mall/common/feignService/AccountService.java index 7147aeab..9887821f 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/feignService/AccountService.java +++ b/mall-common/src/main/java/com/suisung/mall/common/feignService/AccountService.java @@ -6,7 +6,6 @@ import com.suisung.mall.common.modules.push.PushTemplate; import com.suisung.mall.common.pojo.output.TimelineOutput; import com.suisung.mall.common.pojo.res.ThirdApiRes; import io.swagger.annotations.ApiOperation; -import org.apache.ibatis.annotations.Param; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.data.util.Pair; import org.springframework.web.bind.annotation.*; @@ -329,6 +328,13 @@ public interface AccountService { * 服务间注册商家账号,项目之间远程调用 */ @RequestMapping(value = "/admin/account/account-user-base/merchant/inner-register", method = RequestMethod.POST) - Pair merchantInnerRegister(@Param("mobile") String mobile, @Param("regPwd") String regPwd); + Pair merchantInnerRegister(@RequestParam("mobile") String mobile, @RequestParam("regPwd") String regPwd); + + /** + * 服务间注册商家账号,项目之间远程调用 + */ + @RequestMapping(value = "/admin/account/account-user-base/merchant/inner-register", method = RequestMethod.POST) + Pair changeMerchantLoginMobile(@RequestParam("oldMobile") String oldMobile, @RequestParam("newMobile") String newMobile, @RequestParam("password") String password); + } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/activity/service/impl/ShopActivityGroupbookingServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/activity/service/impl/ShopActivityGroupbookingServiceImpl.java index e910890b..c9fc354e 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/activity/service/impl/ShopActivityGroupbookingServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/activity/service/impl/ShopActivityGroupbookingServiceImpl.java @@ -57,9 +57,11 @@ import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser; @Service public class ShopActivityGroupbookingServiceImpl extends BaseServiceImpl implements ShopActivityGroupbookingService { + @Lazy @Autowired private ShopActivityGroupbookingHistoryService shopActivityGroupbookingHistoryService; + @Lazy @Autowired private ShopActivityGroupbookingService shopActivityGroupbookingService; @@ -67,9 +69,11 @@ public class ShopActivityGroupbookingServiceImpl extends BaseServiceImpl configMap; public static Long version = 0L; + + @Lazy @Autowired private AccountService accountService; diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderInfoServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderInfoServiceImpl.java index f9beecc9..def81c7f 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderInfoServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderInfoServiceImpl.java @@ -99,8 +99,10 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl implements ShopStoreEmployeeService { + @Lazy @Autowired private AccountService accountService; From a929635bfc5a5c1df43954dd50bfe44b6b748805 Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Mon, 29 Dec 2025 20:50:28 +0800 Subject: [PATCH 31/45] =?UTF-8?q?=E5=BA=97=E9=93=BA=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=BF=A1=E6=81=AFfix=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AccountUserBaseServiceImpl.java | 2 +- .../mall/common/constant/RedisConstant.java | 2 ++ .../service/impl/ShopMchEntryServiceImpl.java | 25 +++++++++++-------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java b/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java index 957fd5a0..f3b21bee 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java +++ b/mall-account/src/main/java/com/suisung/mall/account/service/impl/AccountUserBaseServiceImpl.java @@ -97,7 +97,7 @@ import static com.suisung.mall.common.utils.I18nUtil._; @Service public class AccountUserBaseServiceImpl extends BaseServiceImpl implements AccountUserBaseService { - private final String VERIFY_CODE_KEY = "register:verifyCode:"; + private final String VERIFY_CODE_KEY = RedisConstant.VERIFY_CODE_KEY; //"register:verifyCode:"; private final Logger logger = LoggerFactory.getLogger(AccountUserBaseServiceImpl.class); @Autowired private AuthService authService; diff --git a/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java b/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java index 37d51763..3c7082c4 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java +++ b/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java @@ -44,4 +44,6 @@ public class RedisConstant { // 预约订单任务新增键 public static final String Order_Booking_Task_Key = ConstantRedis.Cache_NameSpace + "new:order:booking:task:"; + public static final String VERIFY_CODE_KEY = "register:verifyCode:"; + } 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 55e77112..52415a88 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 @@ -698,12 +698,6 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl Date: Mon, 29 Dec 2025 20:50:51 +0800 Subject: [PATCH 32/45] =?UTF-8?q?=E5=BA=97=E9=93=BA=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=BF=A1=E6=81=AFfix=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/shop/store/service/impl/ShopMchEntryServiceImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 52415a88..963c2901 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 @@ -714,15 +714,13 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl Date: Wed, 31 Dec 2025 20:35:52 +0800 Subject: [PATCH 33/45] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/shop/sync/controller/ShopSyncImportController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/ShopSyncImportController.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/ShopSyncImportController.java index a6c54ccb..23e65877 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/ShopSyncImportController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/controller/ShopSyncImportController.java @@ -1,6 +1,7 @@ package com.suisung.mall.shop.sync.controller; import com.suisung.mall.common.api.CommonResult; +import com.suisung.mall.common.exception.ApiException; import com.suisung.mall.common.service.impl.BaseControllerImpl; import com.suisung.mall.shop.sync.service.ShopSyncImportService; import io.swagger.annotations.ApiOperation; @@ -79,6 +80,9 @@ public class ShopSyncImportController extends BaseControllerImpl { @ApiOperation(value = "商品数据导入", notes = "分类数据导入") @RequestMapping(value = "/shopImportData", method = RequestMethod.POST) public CommonResult shopImportData(@RequestParam("file") MultipartFile file,@RequestParam("storeId")String storeId) { + if(!shopSyncImportService.checkIsPlate()){ + throw new ApiException("用户无权限"); + } shopSyncImportService.importShopsData(file,storeId); return CommonResult.success("服务器正则处理文件,稍后查看商品列表"); } From 77afa952d71db95eec7a6c915654fe68f574cc0f Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Wed, 31 Dec 2025 20:45:15 +0800 Subject: [PATCH 34/45] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/shop/sync/service/ShopSyncImportService.java | 2 ++ .../shop/sync/service/impl/ShopSyncImportServiceImpl.java | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/ShopSyncImportService.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/ShopSyncImportService.java index f75fed22..2d53d6b5 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/ShopSyncImportService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/ShopSyncImportService.java @@ -27,4 +27,6 @@ public interface ShopSyncImportService{ // 导入商品Excel数据 void importShopsData(MultipartFile file,String storeId); + + boolean checkIsPlate(); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/ShopSyncImportServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/ShopSyncImportServiceImpl.java index 77c173ce..3c6e103c 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/ShopSyncImportServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/ShopSyncImportServiceImpl.java @@ -165,9 +165,6 @@ public class ShopSyncImportServiceImpl implements ShopSyncImportService { @Override @Async public void importShopsData(MultipartFile file,String storeId) { - if(!checkIsPlate()){ - throw new ApiException("用户无权限"); - } String fileName = storeUploadedFile(file); readAndImportShopsExcelData(fileName,storeId); } @@ -260,7 +257,7 @@ public class ShopSyncImportServiceImpl implements ShopSyncImportService { * 判断是否平台 * @return */ - private boolean checkIsPlate(){ + public boolean checkIsPlate(){ UserDto userDto= ContextUtil.getCurrentUser(); assert userDto != null; return 9 == userDto.getRole_id(); From 8af7ba47487f631adb0b05c236350b89ac7e8a1a Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Wed, 31 Dec 2025 21:34:29 +0800 Subject: [PATCH 35/45] =?UTF-8?q?=E5=85=A5=E9=A9=BB=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E5=AD=97=E6=AE=B5=EF=BC=8C=E6=94=B6=E9=93=B6?= =?UTF-8?q?=E5=8F=B0=E5=9B=BE=E7=89=87=E5=92=8C=E9=93=B6=E8=A1=8C=E5=BC=80?= =?UTF-8?q?=E6=88=B7=E8=AE=B8=E5=8F=AF=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/modules/store/ShopMchEntry.java | 6 ++++ .../lakala/service/impl/LklTkServiceImpl.java | 36 +++++++++++++++---- .../service/impl/ShopMchEntryServiceImpl.java | 12 ++++++- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopMchEntry.java b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopMchEntry.java index 6e8958d7..30a8edd3 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopMchEntry.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopMchEntry.java @@ -96,6 +96,9 @@ public class ShopMchEntry implements Serializable { @ApiModelProperty(value = "入驻商家店铺门面环境图片的存储路径", required = true) private String environment_image; + @ApiModelProperty(value = "收银台照片", required = true) + private String checkstand_image; + @ApiModelProperty(value = "入驻主体类型,企业或个人:1-企业;2-个人;", required = true) private Integer entity_type; @@ -183,6 +186,9 @@ public class ShopMchEntry implements Serializable { @ApiModelProperty(value = "结算账户⾏号", required = true) private String openning_bank_code; + @ApiModelProperty(value = "开户许可证(银行对公开户证明)") + private String opening_permit_image; + @ApiModelProperty(value = "结算账户清算⾏号") private String clearing_bank_code; diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java index 882dff3d..cc0563c0 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java @@ -547,7 +547,8 @@ public class LklTkServiceImpl { logger.debug("开始处理商户附件文件,商户ID: {}", mchId); JSONArray attachments = new JSONArray(); if (Boolean.TRUE.equals(isQy)) { - JSONObject SETTLE_ID_CARD_FRONT = updatePhoto(shopMchEntry.getLegal_person_id_images(), "FR_ID_CARD_FRONT", false); + // 企业 + JSONObject SETTLE_ID_CARD_FRONT = updatePhoto(shopMchEntry.getLegal_person_id_images(), "ID_CARD_FRONT", false); if (SETTLE_ID_CARD_FRONT != null) { attachments.put(SETTLE_ID_CARD_FRONT); // 法人身份证正面 logger.debug("成功添加法人身份证正面图片"); @@ -555,7 +556,7 @@ public class LklTkServiceImpl { logger.warn("法人身份证正面图片添加失败"); } - JSONObject SETTLE_ID_CARD_BEHIND = updatePhoto(shopMchEntry.getLegal_person_id_images2(), "FR_ID_CARD_BEHIND", false); + JSONObject SETTLE_ID_CARD_BEHIND = updatePhoto(shopMchEntry.getLegal_person_id_images2(), "ID_CARD_BEHIND", false); if (SETTLE_ID_CARD_BEHIND != null) { attachments.put(SETTLE_ID_CARD_BEHIND); // 法人身份证国徽面 logger.debug("成功添加法人身份证国徽面图片"); @@ -571,7 +572,17 @@ public class LklTkServiceImpl { logger.warn("营业执照图片添加失败"); } + // 银行对公开户正面 + JSONObject OPENING_PERMIT = updatePhoto(shopMchEntry.getOpening_permit_image(), "OPENING_PERMIT", false); + if (OPENING_PERMIT != null) { + attachments.put(OPENING_PERMIT); // 营业执照 + logger.debug("成功添加开户许可证证明图片"); + } else { + logger.warn("成功添加开户许可证证明图片添加失败"); + } + } else { + // 小微个人 JSONObject ID_CARD_FRONT = updatePhoto(shopMchEntry.getIndividual_id_images(), "ID_CARD_FRONT", false); if (ID_CARD_FRONT != null) { attachments.put(ID_CARD_FRONT); // 身份证正面 @@ -587,6 +598,15 @@ public class LklTkServiceImpl { } else { logger.warn("身份证国徽面图片添加失败"); } + + // 对私必传银行卡 + JSONObject BANK_CARD = updatePhoto(shopMchEntry.getBank_image(), "BANK_CARD", false); + if (BANK_CARD != null) { + attachments.put(BANK_CARD); // 银行卡图片 + logger.debug("成功添加银行卡图片"); + } else { + logger.warn("银行卡图片添加失败"); + } } JSONObject SHOP_OUTSIDE_IMG = updatePhoto(shopMchEntry.getFront_facade_image(), "SHOP_OUTSIDE_IMG", false); @@ -605,13 +625,15 @@ public class LklTkServiceImpl { logger.warn("门店内部图片添加失败"); } - JSONObject BANK_CARD = updatePhoto(shopMchEntry.getBank_image(), "BANK_CARD", false); - if (BANK_CARD != null) { - attachments.put(BANK_CARD); // 银行卡图片 - logger.debug("成功添加银行卡图片"); + // 收银台图片 + JSONObject CHECKSTAND_IMG = updatePhoto(shopMchEntry.getCheckstand_image(), "CHECKSTAND_IMG", false); + if (CHECKSTAND_IMG != null) { + attachments.put(CHECKSTAND_IMG); // 收银台图片 + logger.debug("成功添加收银台图片"); } else { - logger.warn("银行卡图片添加失败"); + logger.warn("收银台图片添加失败"); } + reqJsonBody.put("attchments", attachments); logger.debug("商户附件文件处理完成,共添加 {} 个附件", attachments.size()); // 附件文件相关结束 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 963c2901..2cb75c81 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 @@ -246,6 +246,11 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl Date: Sun, 4 Jan 2026 09:44:58 +0800 Subject: [PATCH 36/45] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=9A=84=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=87=92=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ShopBaseDistrictController.java | 11 +++++++++++ .../shop/base/service/ShopBaseDistrictService.java | 1 + .../service/impl/ShopBaseDistrictServiceImpl.java | 7 +++++++ .../controller/admin/ShopOpenController.java | 14 +++++++++++++- sql/shop/dev/20251231_dml.sql | 1 + 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 sql/shop/dev/20251231_dml.sql diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/mobile/ShopBaseDistrictController.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/mobile/ShopBaseDistrictController.java index b8cfa045..f3b55c0b 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/mobile/ShopBaseDistrictController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/controller/mobile/ShopBaseDistrictController.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.io.IOException; @@ -38,5 +39,15 @@ public class ShopBaseDistrictController { public CommonResult getAppDistrict() throws IOException { return CommonResult.success(shopBaseDistrictService.getAppDistrictByFilePath()); } + + /** + * 分页列表查询 + * @return + */ + @ApiOperation(value = "地区表-根据父id查找子列表", notes = "地区表-根据父id查找子列表") + @RequestMapping(value = "/list", method = RequestMethod.GET) + public CommonResult list(@RequestParam(name = "district_parent_id", defaultValue = "0") Integer district_parent_id ){ + return CommonResult.success(shopBaseDistrictService.getDistrictByParentIdList(district_parent_id)); + } } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/service/ShopBaseDistrictService.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/service/ShopBaseDistrictService.java index 970c54d7..a2162c5e 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/base/service/ShopBaseDistrictService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/service/ShopBaseDistrictService.java @@ -85,4 +85,5 @@ public interface ShopBaseDistrictService extends IBaseService */ String getDistrictIdPathByNamePath(String districtNamePath); + List getDistrictByParentIdList(Integer district_parent_id); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseDistrictServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseDistrictServiceImpl.java index 1ace1af5..567678e8 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseDistrictServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/base/service/impl/ShopBaseDistrictServiceImpl.java @@ -465,5 +465,12 @@ public class ShopBaseDistrictServiceImpl extends BaseServiceImpl getDistrictByParentIdList(Integer district_parent_id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("district_parent_id", district_parent_id); + return this.list(queryWrapper); + } + } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/product/controller/admin/ShopOpenController.java b/mall-shop/src/main/java/com/suisung/mall/shop/product/controller/admin/ShopOpenController.java index 8c16c000..621961f2 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/product/controller/admin/ShopOpenController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/product/controller/admin/ShopOpenController.java @@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.suisung.mall.common.api.CommonResult; import com.suisung.mall.common.modules.distribution.ShopDistributionUserOrder; +import com.suisung.mall.shop.base.service.ShopBaseDistrictService; import com.suisung.mall.shop.distribution.service.ShopDistributionUserOrderService; import com.suisung.mall.shop.product.service.ShopOpenService; import io.swagger.annotations.Api; @@ -26,6 +27,9 @@ public class ShopOpenController { @Autowired private ShopDistributionUserOrderService shopDistributionUserOrderService; + @Autowired + private ShopBaseDistrictService shopBaseDistrictService; + @ApiOperation(value = "商品兑换", notes = "商品兑换") @RequestMapping(value = "/exchange", method = RequestMethod.POST) public CommonResult exchange(@RequestParam(name = "user_id") Integer user_id, @@ -63,5 +67,13 @@ public class ShopOpenController { return CommonResult.success(shopDistributionUserOrderService.lists(queryWrapper, pageNum, pageSize)); } - + /** + * 分页列表查询 + * @return + */ + @ApiOperation(value = "地区表-根据父id查找子列表", notes = "地区表-根据父id查找子列表") + @RequestMapping(value = "/list", method = RequestMethod.GET) + public CommonResult list(@RequestParam(name = "district_parent_id", defaultValue = "0") Integer district_parent_id ){ + return CommonResult.success(shopBaseDistrictService.getDistrictByParentIdList(district_parent_id)); + } } diff --git a/sql/shop/dev/20251231_dml.sql b/sql/shop/dev/20251231_dml.sql new file mode 100644 index 00000000..0eda499d --- /dev/null +++ b/sql/shop/dev/20251231_dml.sql @@ -0,0 +1 @@ +INSERT INTO `admin_base_protocol` (`ctl`, `met`, `db`, `rights_id`, `log`, `path`,`comment`) VALUES ('/mobile/shop/shop-base-district/list', 'index', 'master', '', '0', '/mobile/shop/shop-base-district/list','地区查询列表'); \ No newline at end of file From d0a16f587fb4148a1911899776d0e64975ba6006 Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Sun, 4 Jan 2026 09:59:39 +0800 Subject: [PATCH 37/45] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 82fbcf15..b57a751e 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 @@ -7834,6 +7834,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl Date: Sun, 4 Jan 2026 12:01:27 +0800 Subject: [PATCH 38/45] =?UTF-8?q?=E6=91=87=E4=BA=86=E7=AD=9B=E5=AD=90?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E8=BF=94=E5=9B=9E=E5=89=A9=E4=BD=99=E6=95=B0?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/service/impl/ShopActivityCutpriceServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/activity/service/impl/ShopActivityCutpriceServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/activity/service/impl/ShopActivityCutpriceServiceImpl.java index b9448080..f3b77bef 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/activity/service/impl/ShopActivityCutpriceServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/activity/service/impl/ShopActivityCutpriceServiceImpl.java @@ -1065,6 +1065,7 @@ public class ShopActivityCutpriceServiceImpl extends BaseServiceImpl Date: Sun, 4 Jan 2026 14:46:28 +0800 Subject: [PATCH 39/45] =?UTF-8?q?=E9=A2=84=E8=AE=A1=E6=94=B6=E5=85=A5?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E8=B4=9F=E6=95=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/order/ShopOrderBaseMapper.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml b/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml index a09776c4..5a61b794 100644 --- a/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml +++ b/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml @@ -819,9 +819,8 @@ (od.order_discount_amount + od.voucher_price + od.order_points_fee + od.order_adjust_fee) as total_discount_amount, - - (od.order_item_amount-od.order_discount_amount-od.voucher_price-od.order_points_fee-od.order_adjust_fee-od.platform_fee-order_shipping_fee_inner-lkl_fee+od.packing_fee) - as order_income_amount, + + GREATEST(0, od.order_item_amount-od.order_discount_amount-od.voucher_price-od.order_points_fee-od.order_adjust_fee-od.platform_fee-order_shipping_fee_inner-lkl_fee+od.packing_fee) as order_income_amount, od.platform_fee, od.packing_fee, od.order_message, From 195f3476a95c44cc0b2cb19cc9257b5ed28061cc Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Sun, 4 Jan 2026 14:53:19 +0800 Subject: [PATCH 40/45] =?UTF-8?q?=E5=9C=B0=E5=8C=BA=E6=87=92=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/shop/product/controller/admin/ShopOpenController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/product/controller/admin/ShopOpenController.java b/mall-shop/src/main/java/com/suisung/mall/shop/product/controller/admin/ShopOpenController.java index 621961f2..a7b0dbbe 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/product/controller/admin/ShopOpenController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/product/controller/admin/ShopOpenController.java @@ -72,7 +72,7 @@ public class ShopOpenController { * @return */ @ApiOperation(value = "地区表-根据父id查找子列表", notes = "地区表-根据父id查找子列表") - @RequestMapping(value = "/list", method = RequestMethod.GET) + @RequestMapping(value = "/shop-base-district/list", method = RequestMethod.GET) public CommonResult list(@RequestParam(name = "district_parent_id", defaultValue = "0") Integer district_parent_id ){ return CommonResult.success(shopBaseDistrictService.getDistrictByParentIdList(district_parent_id)); } From f38fbf782b242b724c4eca9aa25a292ee16e6f5a Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Mon, 5 Jan 2026 08:38:35 +0800 Subject: [PATCH 41/45] =?UTF-8?q?=E5=90=88=E5=90=8C=E7=AD=BE=E7=BD=B2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=20=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/common/constant/RedisConstant.java | 3 + .../lakala/service/LklLedgerEcService.java | 10 + .../service/impl/LakalaApiServiceImpl.java | 34 +++- .../service/impl/LklLedgerEcServiceImpl.java | 28 +++ .../lakala/service/impl/LklTkServiceImpl.java | 179 +++++++++--------- .../service/impl/ShopMchEntryServiceImpl.java | 17 +- 6 files changed, 173 insertions(+), 98 deletions(-) diff --git a/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java b/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java index 3c7082c4..fab18fd7 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java +++ b/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java @@ -46,4 +46,7 @@ public class RedisConstant { public static final String VERIFY_CODE_KEY = "register:verifyCode:"; + // 拉卡拉合同是否强制签署 + public static final String LKL_EC_REPEAT_SIGN = "lkl:ec:repeat:sign:"; + } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/LklLedgerEcService.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/LklLedgerEcService.java index b6b3954c..03452138 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/LklLedgerEcService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/LklLedgerEcService.java @@ -9,6 +9,7 @@ package com.suisung.mall.shop.lakala.service; import com.suisung.mall.common.modules.lakala.LklLedgerEc; +import com.suisung.mall.common.modules.store.ShopMchEntry; import com.suisung.mall.core.web.service.IBaseService; public interface LklLedgerEcService extends IBaseService { @@ -58,4 +59,13 @@ public interface LklLedgerEcService extends IBaseService { */ String getLklEcResultUrl(Long mchId); + /** + * 是否已签署拉卡拉商户合同 + * + * @param lklLedgerEc + * @param shopMchEntry + * @return + */ + Boolean isSignedLklEc(LklLedgerEc lklLedgerEc, ShopMchEntry shopMchEntry); + } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java index bafd6aef..a2088b47 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java @@ -25,7 +25,9 @@ import com.lkl.laop.sdk.request.model.V3LabsTradeLocationInfo; import com.lkl.laop.sdk.request.model.V3SacsSeparateRecvDatas; import com.suisung.mall.common.api.CommonResult; import com.suisung.mall.common.constant.CommonConstant; +import com.suisung.mall.common.constant.RedisConstant; import com.suisung.mall.common.exception.ApiException; +import com.suisung.mall.common.feignService.AccountService; import com.suisung.mall.common.feignService.ShopService; import com.suisung.mall.common.modules.esign.EsignPlatformInfo; import com.suisung.mall.common.modules.lakala.*; @@ -36,6 +38,7 @@ import com.suisung.mall.common.pojo.dto.LklSeparateWithTotalAmountDTO; import com.suisung.mall.common.service.impl.CommonService; import com.suisung.mall.common.utils.*; import com.suisung.mall.core.web.service.RedisService; +import com.suisung.mall.shop.base.service.impl.AccountBaseConfigServiceImpl; import com.suisung.mall.shop.esign.service.EsignPlatformInfoService; import com.suisung.mall.shop.lakala.service.*; import com.suisung.mall.shop.lakala.utils.LakalaUtil; @@ -48,6 +51,7 @@ import com.suisung.mall.shop.store.service.ShopMchEntryService; import com.suisung.mall.shop.store.service.ShopStoreBaseService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.time.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; import org.springframework.data.util.Pair; @@ -175,6 +179,10 @@ public class LakalaApiServiceImpl implements LakalaApiService { @Lazy @Resource private OssService ossService; + @Autowired + private AccountService accountService; + @Autowired + private AccountBaseConfigServiceImpl accountBaseConfigService; /** @@ -419,14 +427,35 @@ public class LakalaApiServiceImpl implements LakalaApiService { return Pair.of(false, "缺少商家相关入驻信息!"); } + // 3. 检查是否已存在已完成的电子合同 + LklLedgerEc lklLedgerEc = lklLedgerEcService.getByMchId(mchId, "", CommonConstant.Enable); + + // 如果配置不允许重复签署拉卡拉电子合同,则检查是否已签署拉卡拉电子合同,已签署直接跳过签署合同 + if (ObjectUtil.notEqual("1", accountBaseConfigService.getConfig(RedisConstant.LKL_EC_REPEAT_SIGN))) { + if (lklLedgerEcService.isSignedLklEc(lklLedgerEc, shopMchEntry)) { + log.info("商户:{} 已签署拉卡拉电子合同,直接进行进件处理!", mchId); + + // 13. 触发拉卡拉商家进件流程 + log.info("开始触发拉卡拉商家进件流程,mchId: {}", mchId); + Pair resultPair = lklTkService.registrationMerchant(mchId); + if (!resultPair.getFirst()) { + String errMsg = resultPair.getSecond(); + log.error("拉卡拉商家进件失败: {},mchId: {}", errMsg, mchId); + shopMchEntryService.updateMerchEntryApprovalByMchId(mchId, CommonConstant.MCH_APPR_STA_LKL_NOPASS, errMsg); + throw new ApiException(errMsg); + } + + return Pair.of(true, "已签署合同,等待进件中!"); + } + } + + String contractMobile = shopMchEntry.getLegal_person_mobile(); if (StrUtil.isBlank(contractMobile)) { log.warn("商家申请入网电子合同失败:联系人手机号为空,入驻编号: {}", mchId); return Pair.of(false, "联系人手机号不能为空!"); } - // 3. 检查是否已存在已完成的电子合同 - LklLedgerEc lklLedgerEc = lklLedgerEcService.getByMchId(shopMchEntry.getId(), "", CommonConstant.Enable); if (lklLedgerEc != null && "COMPLETED".equals(lklLedgerEc.getEc_status())) { log.info("商户:{} 电子合同已签署过,重新提交将被覆盖!", mchId); } @@ -1061,6 +1090,7 @@ public class LakalaApiServiceImpl implements LakalaApiService { updRecord.setEc_file(ecCosFileUrl); // 合同本地文件COS URL链接 updRecord.setLkl_file_path(eclklFilePath); updRecord.setEc_status(paramsJSON.getStr("ecStatus")); + updRecord.setResp_notify_body(paramsJSON.toString()); Boolean success = lklLedgerEcService.updateByApplyId(updRecord); if (!success) { diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklLedgerEcServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklLedgerEcServiceImpl.java index 8c251d88..d71080ec 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklLedgerEcServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklLedgerEcServiceImpl.java @@ -13,6 +13,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.suisung.mall.common.constant.CommonConstant; import com.suisung.mall.common.modules.lakala.LklLedgerEc; +import com.suisung.mall.common.modules.store.ShopMchEntry; import com.suisung.mall.common.utils.CheckUtil; import com.suisung.mall.core.web.service.impl.BaseServiceImpl; import com.suisung.mall.shop.lakala.mapper.LklLedgerEcMapper; @@ -150,4 +151,31 @@ public class LklLedgerEcServiceImpl extends BaseServiceImpl areaCode = getAreaCode(shopMchEntry.getStore_area(), false); if (ObjectUtil.isNotEmpty(areaCode)) { - reqJsonBody.put("provinceCode", areaCode.get("provinceCode")); - reqJsonBody.put("cityCode", areaCode.get("cityCode")); - reqJsonBody.put("countyCode", areaCode.get("countyCode")); + reqJsonBody.set("provinceCode", areaCode.get("provinceCode")); + reqJsonBody.set("cityCode", areaCode.get("cityCode")); + reqJsonBody.set("countyCode", areaCode.get("countyCode")); } //银行结算信息省市信息 @@ -510,38 +515,38 @@ public class LklTkServiceImpl { String[] bankAreaCodes = shopMchEntry.getBank_district().split("/"); String[] bankAreaNames = shopMchEntry.getBank_area().split("/"); if (bankAreaCodes.length >= 2 && bankAreaNames.length >= 2) { - reqJsonBody.put("settleProvinceCode", bankAreaCodes[0]); - reqJsonBody.put("settleProvinceName", bankAreaCodes[1]); - reqJsonBody.put("settleCityCode", bankAreaNames[0]); - reqJsonBody.put("settleCityName", bankAreaNames[1]); + reqJsonBody.set("settleProvinceCode", bankAreaCodes[0]); + reqJsonBody.set("settleProvinceName", bankAreaCodes[1]); + reqJsonBody.set("settleCityCode", bankAreaNames[0]); + reqJsonBody.set("settleCityName", bankAreaNames[1]); } } else { Map bankAreaCode = getAreaCode(shopMchEntry.getBank_area(), true); if (ObjectUtil.isNotEmpty(bankAreaCode)) { - reqJsonBody.put("settleProvinceCode", bankAreaCode.get("provinceCode")); - reqJsonBody.put("settleCityCode", bankAreaCode.get("cityCode")); + reqJsonBody.set("settleProvinceCode", bankAreaCode.get("provinceCode")); + reqJsonBody.set("settleCityCode", bankAreaCode.get("cityCode")); String[] bankAreaName = shopMchEntry.getBank_area().split("/"); if (bankAreaName.length >= 2) { - reqJsonBody.put("settleProvinceName", bankAreaName[0]); - reqJsonBody.put("settleCityName", bankAreaName[1]); + reqJsonBody.set("settleProvinceName", bankAreaName[0]); + reqJsonBody.set("settleCityName", bankAreaName[1]); } } } // 费率和设备、活动 JSONObject bizContent = new JSONObject(); - bizContent.put("activityId", activityId); - bizContent.put("termNum", "1"); - bizContent.put("mcc", "12015"); // 超市的 MCC code - bizContent.put("fees", new JSONArray() {{ + bizContent.set("activityId", activityId); + bizContent.set("termNum", "1"); + bizContent.set("mcc", "12015"); // 超市的 MCC code + bizContent.set("fees", new JSONArray() {{ put(new JSONObject() { { - put("feeCode", "WECHAT"); - put("feeValue", wxFee); + set("feeCode", "WECHAT"); + set("feeValue", wxFee); } }); }}); - reqJsonBody.put("bizContent", bizContent); + reqJsonBody.set("bizContent", bizContent); // 附件文件相关开始 logger.debug("开始处理商户附件文件,商户ID: {}", mchId); @@ -550,7 +555,7 @@ public class LklTkServiceImpl { // 企业 JSONObject SETTLE_ID_CARD_FRONT = updatePhoto(shopMchEntry.getLegal_person_id_images(), "ID_CARD_FRONT", false); if (SETTLE_ID_CARD_FRONT != null) { - attachments.put(SETTLE_ID_CARD_FRONT); // 法人身份证正面 + attachments.set(SETTLE_ID_CARD_FRONT); // 法人身份证正面 logger.debug("成功添加法人身份证正面图片"); } else { logger.warn("法人身份证正面图片添加失败"); @@ -558,7 +563,7 @@ public class LklTkServiceImpl { JSONObject SETTLE_ID_CARD_BEHIND = updatePhoto(shopMchEntry.getLegal_person_id_images2(), "ID_CARD_BEHIND", false); if (SETTLE_ID_CARD_BEHIND != null) { - attachments.put(SETTLE_ID_CARD_BEHIND); // 法人身份证国徽面 + attachments.set(SETTLE_ID_CARD_BEHIND); // 法人身份证国徽面 logger.debug("成功添加法人身份证国徽面图片"); } else { logger.warn("法人身份证国徽面图片添加失败"); @@ -566,7 +571,7 @@ public class LklTkServiceImpl { JSONObject BUSINESS_LICENCE = updatePhoto(shopMchEntry.getBiz_license_image(), "BUSINESS_LICENCE", false); if (BUSINESS_LICENCE != null) { - attachments.put(BUSINESS_LICENCE); // 营业执照 + attachments.set(BUSINESS_LICENCE); // 营业执照 logger.debug("成功添加营业执照图片"); } else { logger.warn("营业执照图片添加失败"); @@ -575,7 +580,7 @@ public class LklTkServiceImpl { // 银行对公开户正面 JSONObject OPENING_PERMIT = updatePhoto(shopMchEntry.getOpening_permit_image(), "OPENING_PERMIT", false); if (OPENING_PERMIT != null) { - attachments.put(OPENING_PERMIT); // 营业执照 + attachments.set(OPENING_PERMIT); // 营业执照 logger.debug("成功添加开户许可证证明图片"); } else { logger.warn("成功添加开户许可证证明图片添加失败"); @@ -585,7 +590,7 @@ public class LklTkServiceImpl { // 小微个人 JSONObject ID_CARD_FRONT = updatePhoto(shopMchEntry.getIndividual_id_images(), "ID_CARD_FRONT", false); if (ID_CARD_FRONT != null) { - attachments.put(ID_CARD_FRONT); // 身份证正面 + attachments.set(ID_CARD_FRONT); // 身份证正面 logger.debug("成功添加身份证正面图片"); } else { logger.warn("身份证正面图片添加失败"); @@ -593,7 +598,7 @@ public class LklTkServiceImpl { JSONObject ID_CARD_BEHIND = updatePhoto(shopMchEntry.getIndividual_id_images2(), "ID_CARD_BEHIND", false); if (ID_CARD_BEHIND != null) { - attachments.put(ID_CARD_BEHIND); // 身份证国徽面 + attachments.set(ID_CARD_BEHIND); // 身份证国徽面 logger.debug("成功添加身份证国徽面图片"); } else { logger.warn("身份证国徽面图片添加失败"); @@ -602,7 +607,7 @@ public class LklTkServiceImpl { // 对私必传银行卡 JSONObject BANK_CARD = updatePhoto(shopMchEntry.getBank_image(), "BANK_CARD", false); if (BANK_CARD != null) { - attachments.put(BANK_CARD); // 银行卡图片 + attachments.set(BANK_CARD); // 银行卡图片 logger.debug("成功添加银行卡图片"); } else { logger.warn("银行卡图片添加失败"); @@ -611,7 +616,7 @@ public class LklTkServiceImpl { JSONObject SHOP_OUTSIDE_IMG = updatePhoto(shopMchEntry.getFront_facade_image(), "SHOP_OUTSIDE_IMG", false); if (SHOP_OUTSIDE_IMG != null) { - attachments.put(SHOP_OUTSIDE_IMG); // 门店门面图片 + attachments.set(SHOP_OUTSIDE_IMG); // 门店门面图片 logger.debug("成功添加门店门面图片"); } else { logger.warn("门店门面图片添加失败"); @@ -619,7 +624,7 @@ public class LklTkServiceImpl { JSONObject SHOP_INSIDE_IMG = updatePhoto(shopMchEntry.getEnvironment_image(), "SHOP_INSIDE_IMG", false); if (SHOP_INSIDE_IMG != null) { - attachments.put(SHOP_INSIDE_IMG); // 门店内部图片 + attachments.set(SHOP_INSIDE_IMG); // 门店内部图片 logger.debug("成功添加门店内部图片"); } else { logger.warn("门店内部图片添加失败"); @@ -628,13 +633,13 @@ public class LklTkServiceImpl { // 收银台图片 JSONObject CHECKSTAND_IMG = updatePhoto(shopMchEntry.getCheckstand_image(), "CHECKSTAND_IMG", false); if (CHECKSTAND_IMG != null) { - attachments.put(CHECKSTAND_IMG); // 收银台图片 + attachments.set(CHECKSTAND_IMG); // 收银台图片 logger.debug("成功添加收银台图片"); } else { logger.warn("收银台图片添加失败"); } - reqJsonBody.put("attchments", attachments); + reqJsonBody.set("attchments", attachments); logger.debug("商户附件文件处理完成,共添加 {} 个附件", attachments.size()); // 附件文件相关结束 @@ -755,7 +760,7 @@ public class LklTkServiceImpl { ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByMerInnerNo(merInnerNo); if (shopMchEntry == null) { logger.error("拉卡拉进件异步通知:{}内部商户号入驻信息不存在!", merInnerNo); - return new JSONObject().put("code", "500").put("message", merInnerNo + "内部商户号入驻信息不存在"); + return new JSONObject().set("code", "500").set("message", merInnerNo + "内部商户号入驻信息不存在"); } Long mchId = shopMchEntry.getId(); @@ -872,7 +877,7 @@ public class LklTkServiceImpl { ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByMerCupNo(merCupNo, 0L); if (shopMchEntry == null) { logger.error("拉卡拉商户增终异步通知 - 商户号入驻信息不存在: {}", merCupNo); - return new JSONObject().put("code", "500").put("message", merCupNo + "商户号入驻信息不存在"); + return new JSONObject().set("code", "500").set("message", merCupNo + "商户号入驻信息不存在"); } // 校验审核状态: PREPARE:待提交; PASS:通过; UNPASS:未通过; PASSING:审核中; @@ -1175,7 +1180,7 @@ public class LklTkServiceImpl { } JSONObject header = new JSONObject(); - header.put("Authorization", getLklTkAuthorization()); + header.set("Authorization", getLklTkAuthorization()); String urlPath = "/sit/htkregistration/organization"; if (isLklProd) { @@ -1279,10 +1284,10 @@ public class LklTkServiceImpl { // Base64Utils.encodeToString(file.getBytes()); JSONObject requestBody = new JSONObject(); - requestBody.put("fileBase64", fileBase64); - requestBody.put("imgType", imgType); - requestBody.put("sourcechnl", "0"); // 来源: 0:PC,1:安卓,2:IOS - requestBody.put("isOcr", "true"); + requestBody.set("fileBase64", fileBase64); + requestBody.set("imgType", imgType); + requestBody.set("sourcechnl", "0"); // 来源: 0:PC,1:安卓,2:IOS + requestBody.set("isOcr", "true"); String urlPath = "/sit/htkregistration/file/base/upload"; if (isLklProd) { @@ -1303,7 +1308,7 @@ public class LklTkServiceImpl { return null; } - return new JSONObject().put("id", result.get("url")).put("type", imgType); + return new JSONObject().set("id", result.get("url")).set("type", imgType); } catch (Exception e) { logger.error("上传文件异常:{}", e.getMessage()); return null; @@ -1315,13 +1320,13 @@ public class LklTkServiceImpl { } JSONObject header = new JSONObject(); - header.put("Authorization", getLklTkAuthorization()); + header.set("Authorization", getLklTkAuthorization()); // Base64Utils.encodeToString(file.getBytes()); JSONObject requestBody = new JSONObject(); - requestBody.put("areaCode", areaCode); - requestBody.put("bankName", bankName); + requestBody.set("areaCode", areaCode); + requestBody.set("bankName", bankName); String urlPath = "/sit/registration/bank"; if (isLklProd) { @@ -1342,7 +1347,7 @@ public class LklTkServiceImpl { return null; } - return new JSONObject().put("id", result.get("url")).put("type", ""); + return new JSONObject().set("id", result.get("url")).set("type", ""); } catch (Exception e) { logger.error("上传文件异常:{}", e.getMessage()); return null; 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 2cb75c81..ed7189ce 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 @@ -662,17 +662,17 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl approvalStatusList) { - log.debug("获取商家入驻申请详情开始: recordId={}, mobile={}", recordId, mobile); + public CommonResult shopMerchEntryDetail(Long mchId, String mobile, List approvalStatusList) { + log.debug("获取商家入驻申请详情开始: recordId={}, mobile={}", mchId, mobile); // 参数校验:recordId 和 mobile 至少提供一个 - if (ObjectUtil.isEmpty(recordId) && StrUtil.isBlank(mobile)) { + if (ObjectUtil.isEmpty(mchId) && StrUtil.isBlank(mobile)) { log.warn("获取商家入驻详情失败:缺少必要参数 recordId 或 mobile"); return CommonResult.failed("缺少必要参数!"); } @@ -682,8 +682,8 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); // 根据ID查询 - if (ObjectUtil.isNotEmpty(recordId)) { - queryWrapper.eq("id", recordId); + if (ObjectUtil.isNotEmpty(mchId)) { + queryWrapper.eq("id", mchId); } // 根据手机号查询 @@ -702,7 +702,7 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl Date: Mon, 5 Jan 2026 21:21:39 +0800 Subject: [PATCH 42/45] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E8=87=AA?= =?UTF-8?q?=E9=85=8D=E9=80=81=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/store/controller/admin/ShopStoreBaseController.java | 1 + .../mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java | 3 +++ .../src/main/resources/mapper/order/ShopOrderBaseMapper.xml | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopStoreBaseController.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopStoreBaseController.java index 33b083b0..97d75e97 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopStoreBaseController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/controller/admin/ShopStoreBaseController.java @@ -93,6 +93,7 @@ public class ShopStoreBaseController extends BaseControllerImpl { if (StrUtil.isNotBlank(store_area)) { queryWrapper.like("store_area", store_area); } + Integer user_id = shopStoreBase.getUser_id(); if (ObjectUtil.isNotNull(user_id)) { queryWrapper.eq("user_id", user_id); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java index d2605702..56f485fb 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java @@ -285,6 +285,9 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl baseStoreGrades = base_store_grade_rows.stream().filter(h -> ObjectUtil.equal(h.getStore_grade_id(), store_grade_id)).findFirst(); ShopBaseStoreGrade grade = baseStoreGrades.orElseGet(ShopBaseStoreGrade::new); s.put("store_grade_name", grade.getStore_grade_name()); + + // 店铺是否自配送? + s.put("is_delivery_self", s.getOrDefault("is_delivery_self", CommonConstant.Disable2)); }); } diff --git a/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml b/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml index 5a61b794..47a412eb 100644 --- a/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml +++ b/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml @@ -820,7 +820,8 @@ (od.order_discount_amount + od.voucher_price + od.order_points_fee + od.order_adjust_fee) as total_discount_amount, - GREATEST(0, od.order_item_amount-od.order_discount_amount-od.voucher_price-od.order_points_fee-od.order_adjust_fee-od.platform_fee-order_shipping_fee_inner-lkl_fee+od.packing_fee) as order_income_amount, + + GREATEST(0, od.trade_payment_money-od.platform_fee-od.lkl_fee) as order_income_amount, od.platform_fee, od.packing_fee, od.order_message, From b7963b1972db3b786b475fa8c2f75dc6db5578a2 Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Tue, 6 Jan 2026 16:42:35 +0800 Subject: [PATCH 43/45] =?UTF-8?q?=E5=BA=97=E9=93=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=8E=B7=E5=8F=96bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ShopStoreBaseServiceImpl.java | 12 ++--- .../service/impl/ShopUserCartServiceImpl.java | 44 +++++++++---------- .../mapper/store/ShopStoreInfoMapper.xml | 17 +++++++ 3 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 mall-shop/src/main/resources/mapper/store/ShopStoreInfoMapper.xml diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java index 56f485fb..52f78218 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java @@ -271,10 +271,14 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl shopStoreInfos = store_info_rows.stream().filter(r -> r.equals(ObjectUtil.equal(r.getStore_id(), store_id))).findFirst(); + Optional shopStoreInfos = store_info_rows.stream().filter(r -> ObjectUtil.equal(r.getStore_id(), store_id)).findFirst(); if (shopStoreInfos.isPresent()) { ShopStoreInfo shopStoreInfo = shopStoreInfos.orElseGet(ShopStoreInfo::new); Map map = Convert.toMap(Object.class, Object.class, shopStoreInfo); + // 店铺是否自配送? +// s.put("is_delivery_self", s.getOrDefault("is_delivery_self", CommonConstant.Disable2)); +// // 店铺内部配送费 +// s.put("shopping_fee_inner", s.getOrDefault("shopping_fee_inner", 0)); s.putAll(map); } @@ -285,9 +289,6 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl baseStoreGrades = base_store_grade_rows.stream().filter(h -> ObjectUtil.equal(h.getStore_grade_id(), store_grade_id)).findFirst(); ShopBaseStoreGrade grade = baseStoreGrades.orElseGet(ShopBaseStoreGrade::new); s.put("store_grade_name", grade.getStore_grade_name()); - - // 店铺是否自配送? - s.put("is_delivery_self", s.getOrDefault("is_delivery_self", CommonConstant.Disable2)); }); } @@ -2505,7 +2506,8 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl + + + + + * + + + + From 45d4d9905d342302b58d4775cc280fe01c0a2947 Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Tue, 6 Jan 2026 17:29:13 +0800 Subject: [PATCH 44/45] =?UTF-8?q?=E5=BA=97=E9=93=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=8E=B7=E5=8F=96bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/store/service/impl/ShopStoreBaseServiceImpl.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java index 52f78218..e5c1a698 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreBaseServiceImpl.java @@ -272,13 +272,9 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl shopStoreInfos = store_info_rows.stream().filter(r -> ObjectUtil.equal(r.getStore_id(), store_id)).findFirst(); - if (shopStoreInfos.isPresent()) { + if (shopStoreInfos.isPresent()) { // 匹配到店铺信息 ShopStoreInfo shopStoreInfo = shopStoreInfos.orElseGet(ShopStoreInfo::new); Map map = Convert.toMap(Object.class, Object.class, shopStoreInfo); - // 店铺是否自配送? -// s.put("is_delivery_self", s.getOrDefault("is_delivery_self", CommonConstant.Disable2)); -// // 店铺内部配送费 -// s.put("shopping_fee_inner", s.getOrDefault("shopping_fee_inner", 0)); s.putAll(map); } From 916ff8fe5c61422d6a0748fe5d5eef15aef7629c Mon Sep 17 00:00:00 2001 From: Jack <46790855@qq.com> Date: Thu, 8 Jan 2026 17:08:33 +0800 Subject: [PATCH 45/45] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ShopOrderBaseServiceImpl.java | 15 +++--- .../impl/ShopMchEntryBranchServiceImpl.java | 50 ++++++++++++------- .../service/impl/ShopMchEntryServiceImpl.java | 1 - .../impl/ShopStoreBaseServiceImpl.java | 12 ++--- .../service/impl/ShopUserCartServiceImpl.java | 2 +- 5 files changed, 46 insertions(+), 34 deletions(-) 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