From 4b0dc1181c28775240ed5005702b018f1a63a1a4 Mon Sep 17 00:00:00 2001 From: ljl Date: Thu, 9 Nov 2023 20:55:04 +0800 Subject: [PATCH] yh --- .../com/ms/biz/spi/callback/BatchPayService.java | 13 +++++++++---- .../biz/spi/callback/DoudianMsgReceiveService.java | 13 +++++++------ .../callback/QuerySupplyPlatformAuthService.java | 12 ++++++++---- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/ms-biz/src/main/java/com/ms/biz/spi/callback/BatchPayService.java b/ms-biz/src/main/java/com/ms/biz/spi/callback/BatchPayService.java index dad54e6..09fe2b6 100644 --- a/ms-biz/src/main/java/com/ms/biz/spi/callback/BatchPayService.java +++ b/ms-biz/src/main/java/com/ms/biz/spi/callback/BatchPayService.java @@ -8,6 +8,7 @@ import com.ms.biz.common.R; import com.ms.biz.common.SPIBaseService; import com.ms.biz.dto.openspi.request.BatchPayParam; import com.ms.biz.dto.openspi.response.BatchPayData; +import com.ms.biz.dto.openspi.response.QuerySupplyPlatformAuthData; import com.ms.biz.service.DistributionOrderService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -20,9 +21,13 @@ public class BatchPayService extends SPIBaseService implements ExtensionServiceH @Override public BaseResponse handle(BaseRequest req) { - BatchPayParam param = req.getData(); - BatchPayData data = new BatchPayData(); - distributionOrderService.batchPay(param, data); - return R.ok(data); + try { + BatchPayParam param = req.getData(); + BatchPayData data = new BatchPayData(); + distributionOrderService.batchPay(param, data); + return BaseResponse.builder().success(true).message("success").code("0").data(data).build(); + } catch (Exception e) { + return BaseResponse.builder().success(true).message(e.getMessage()).code("100003").build(); + } } } \ No newline at end of file diff --git a/ms-biz/src/main/java/com/ms/biz/spi/callback/DoudianMsgReceiveService.java b/ms-biz/src/main/java/com/ms/biz/spi/callback/DoudianMsgReceiveService.java index be6ea51..3f2f1ca 100644 --- a/ms-biz/src/main/java/com/ms/biz/spi/callback/DoudianMsgReceiveService.java +++ b/ms-biz/src/main/java/com/ms/biz/spi/callback/DoudianMsgReceiveService.java @@ -5,6 +5,7 @@ import com.jinritemai.cloud.base.api.BaseRequest; import com.jinritemai.cloud.base.api.BaseResponse; import com.jinritemai.cloud.base.api.ExtensionService; import com.jinritemai.cloud.base.api.ExtensionServiceHandler; +import com.ms.api.dto.common.DoudianMessage; import com.ms.biz.common.R; import com.ms.biz.common.SPIBaseService; import com.ms.biz.service.DoudianMsgService; @@ -22,15 +23,15 @@ public class DoudianMsgReceiveService extends SPIBaseService implements Extensio @Override public BaseResponse handle(BaseRequest> req) { -// initHandle(req); - - // ----参数校验---- List msgList = req.getData(); if (msgList == null || msgList.isEmpty()) { - R.ok(); + return R.ok(); + } + for (String msgStr: msgList) { + DoudianMessage msg = JSON.parseObject(msgStr, DoudianMessage.class); + } - String msgBody = JSON.toJSONString(msgList); - log.info("CloudOpenMsgConsumer request: " + msgBody); + // ----逻辑校验---- // ----业务处理---- diff --git a/ms-biz/src/main/java/com/ms/biz/spi/callback/QuerySupplyPlatformAuthService.java b/ms-biz/src/main/java/com/ms/biz/spi/callback/QuerySupplyPlatformAuthService.java index bfe5836..3dc2670 100644 --- a/ms-biz/src/main/java/com/ms/biz/spi/callback/QuerySupplyPlatformAuthService.java +++ b/ms-biz/src/main/java/com/ms/biz/spi/callback/QuerySupplyPlatformAuthService.java @@ -20,9 +20,13 @@ public class QuerySupplyPlatformAuthService extends SPIBaseService implements Ex @Override public BaseResponse handle(BaseRequest req) { - QuerySupplyPlatformAuthParam param = req.getData(); - QuerySupplyPlatformAuthData data = new QuerySupplyPlatformAuthData(); - shopService.querySupplyPlatformAuth(param, data); - return R.ok(data); + try { + QuerySupplyPlatformAuthParam param = req.getData(); + QuerySupplyPlatformAuthData data = new QuerySupplyPlatformAuthData(); + shopService.querySupplyPlatformAuth(param, data); + return BaseResponse.builder().success(true).message("success").code("0").data(data).build(); + } catch (Exception e) { + return BaseResponse.builder().success(true).message(e.getMessage()).code("100003").build(); + } } } \ No newline at end of file