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; + } }