From 7b7963c12d6959cb74e5c1efb2a738a74ff725ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=86=E6=98=9F=E9=9C=96?= <729219176@qq.com> Date: Sat, 30 Mar 2024 14:23:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E5=9B=9E=E8=B0=83=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=BC=80=E6=94=BE=E3=80=82=E5=BE=85=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...serWithdrawDepositRecordAppController.java | 4 +-- ...etUserWithdrawDepositRecordController.java | 17 +++++++---- ...ayletUserWithdrawDepositRecordService.java | 2 ++ ...tUserWithdrawDepositRecordServiceImpl.java | 28 +++++++++++++++++-- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletUserWithdrawDepositRecordAppController.java b/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletUserWithdrawDepositRecordAppController.java index 71a4ca0..fa166c5 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletUserWithdrawDepositRecordAppController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletUserWithdrawDepositRecordAppController.java @@ -41,11 +41,11 @@ public class PlayletUserWithdrawDepositRecordAppController extends BaseControlle public String record() { return prefix + "/record"; } - + @ResponseBody @PostMapping("/getWithdrawDepositList") @ApiOperation(value = "分页查询用户提现记录列表") - public Result> getWithdrawDepositList(@RequestBody PlayletUserWithdrawDepositRecord playletUserWithdrawDepositRecord, + public Result> getWithdrawDepositList(@RequestBody PlayletUserWithdrawDepositRecord playletUserWithdrawDepositRecord, @RequestParam(value = "pageNum") Integer pageNum, @RequestParam(value = "pageSize") Integer pageSize) { return Result.success(service.getWithdrawDepositList(playletUserWithdrawDepositRecord, pageNum, pageSize)); diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserWithdrawDepositRecordController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserWithdrawDepositRecordController.java index 7719c28..4be3927 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserWithdrawDepositRecordController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserWithdrawDepositRecordController.java @@ -2,17 +2,15 @@ package com.playlet.web.controller.system; import java.util.List; +import com.playlet.common.core.domain.Result; +import com.playlet.system.domain.PlayletUserWithdrawalPassword; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.playlet.common.annotation.Log; import com.playlet.common.enums.BusinessType; import com.playlet.system.domain.PlayletUserWithdrawDepositRecord; @@ -124,4 +122,13 @@ public class PlayletUserWithdrawDepositRecordController extends BaseController { public AjaxResult remove(String ids) { return toAjax(playletUserWithdrawDepositRecordService.deletePlayletUserWithdrawDepositRecordByIds(ids)); } + + @ApiOperation(value = "交易回调") + @ResponseBody + @PostMapping("/recordCallbackUpdate") + public Result recordCallbackUpdate(@RequestBody PlayletUserWithdrawDepositRecord playletUserWithdrawalPassword) { + return Result.success(playletUserWithdrawDepositRecordService.recordCallbackUpdate(playletUserWithdrawalPassword.getWithdrawOrder(), playletUserWithdrawalPassword.getStatus())); + } + + } diff --git a/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserWithdrawDepositRecordService.java b/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserWithdrawDepositRecordService.java index 1dfc6d8..db1a31f 100644 --- a/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserWithdrawDepositRecordService.java +++ b/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserWithdrawDepositRecordService.java @@ -59,4 +59,6 @@ public interface IPlayletUserWithdrawDepositRecordService extends IService wrapper = new QueryWrapper<>(); wrapper.lambda().select().eq(PlayletUserWithdrawDepositRecord::getWithdrawOrder, uuIdMsg); PlayletUserWithdrawDepositRecord recordByDb = playletUserWithdrawDepositRecordMapper.selectOne(wrapper); - if(ObjectUtils.isNull(recordByDb)){ + if (ObjectUtils.isNull(recordByDb)) { break; } } + // todo:根据银行手续费提示,进行修改金额。待补充。 playletUserWithdrawDepositRecord.setWithdrawOrder(UUID.randomUUID().toString()); return playletUserWithdrawDepositRecordMapper.insertPlayletUserWithdrawDepositRecord(playletUserWithdrawDepositRecord); } @@ -90,9 +91,10 @@ public class PlayletUserWithdrawDepositRecordServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); wrapper.lambda().select().eq(PlayletUserWithdrawDepositRecord::getWithdrawOrder, playletUserWithdrawDepositRecord.getWithdrawOrder()); PlayletUserWithdrawDepositRecord recordByDb = playletUserWithdrawDepositRecordMapper.selectOne(wrapper); - if(ObjectUtils.isNull(recordByDb)){ + if (ObjectUtils.isNull(recordByDb)) { throw new ServiceException("当前订单号不存在,禁止修改"); } + // todo:根据银行手续费提示,进行修改金额。待补充。 playletUserWithdrawDepositRecord.setUpdateTime(DateUtils.getNowDate()); return playletUserWithdrawDepositRecordMapper.updatePlayletUserWithdrawDepositRecord(playletUserWithdrawDepositRecord); } @@ -118,4 +120,24 @@ public class PlayletUserWithdrawDepositRecordServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); + wrapper.lambda().select().eq(PlayletUserWithdrawDepositRecord::getWithdrawOrder, orderId); + PlayletUserWithdrawDepositRecord recordByDb = playletUserWithdrawDepositRecordMapper.selectOne(wrapper); + if (ObjectUtils.isNull(recordByDb)) { + throw new ServiceException("当前订单号不存在,回调更新失败"); + } + + // 更新状态 1 申请提现 2 审批通过 3 交易完成 4 审批不通过 + if (status == 1L || status == 2L || status == 3L || status == 4L) { + } else { + throw new ServiceException("状态信息异常。回调更新失败。"); + } + recordByDb.setStatus(status); + recordByDb.setUpdateTime(DateUtils.getNowDate()); + return playletUserWithdrawDepositRecordMapper.updatePlayletUserWithdrawDepositRecord(recordByDb) > 0; + } }