From 03f9bbbd1500c7519cbc6bcf92206569a180c063 Mon Sep 17 00:00:00 2001 From: Lemon Date: Mon, 11 May 2026 14:39:38 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=96=B0=E5=A2=9E=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BD=99=E9=A2=9D=E4=B8=B4=E6=97=B6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/uniapp/customer/TempController.java | 20 +++++++++++++++++++ .../test/java/SpringBootTestController.java | 15 ++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/TempController.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/TempController.java index d2eb68aca..6254147b3 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/TempController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/TempController.java @@ -94,6 +94,26 @@ public class TempController extends BaseController { @Autowired private EBikeSendCommandService eBikeSendCommandService; + /** + * 临时退款用户余额 + * @param dto + * @return + */ + public RestApiResponse tempRefundAmount(@RequestBody ApplyRefundDTO dto) { + RestApiResponse response = null + try { + String mode = pileMerchantInfoService.getDelayModeByWechatAppId(dto.getWechatAppId()); + // 获取处理逻辑 + AbstractProgramLogic orderLogic = ProgramLogicFactory.getProgramLogic(mode); + orderLogic.refundBalance(dto); + response = new RestApiResponse<>(); + } catch (Exception e) { + logger.error("临时退款用户余额 error", e); + response = new RestApiResponse<>(e); + } + return response; + } + /** * 电单车开始充电 * http://localhost:8080/temp/tempStartCharging diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index a5a4e655f..0e68fe16f 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -313,6 +313,21 @@ public class SpringBootTestController { private final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(10, JsowellThreadFactory.forName("test-thread-factory")); + @Test + public void testRefundAmount() { + ApplyRefundDTO dto = new ApplyRefundDTO(); + dto.setMemberId("42833346"); + dto.setRefundAmount(new BigDecimal("13.12")); + dto.setWechatAppId(Constants.XIXIAO_APP_ID); + dto.setRefundType("2"); + dto.setWalletCode("8986380447445731"); + + String mode = pileMerchantInfoService.getDelayModeByWechatAppId(dto.getWechatAppId()); + // 获取处理逻辑 + AbstractProgramLogic orderLogic = ProgramLogicFactory.getProgramLogic(mode); + orderLogic.refundBalance(dto); + } + @Test public void deleteThirdPartyStationRelationTest() { ThirdPartyStationRelationDTO dto = new ThirdPartyStationRelationDTO();