| | |
| | | @GetMapping("/confirmMoney") |
| | | |
| | | R<String> confirmWithdraw(@RequestParam("id")String id){ |
| | | Withdraw withdraw = withdrawService.getById(id); |
| | | WithdrawRecord withdrawRecord = new WithdrawRecord(); |
| | | withdrawRecord.setWithdrawId(withdraw.getId()); |
| | | withdrawRecord.setOrderId(withdraw.getOrderId()); |
| | | withdrawRecord.setUserId(withdraw.getUserId()); |
| | | withdrawRecord.setWithdrawType(3); |
| | | withdrawRecord.setCreateTime(new Date()); |
| | | withdrawRecord.setAuditStatus(1); |
| | | withdrawRecordService.save(withdrawRecord); |
| | | Order order = orderService.getById(id); |
| | | Withdraw withdraw = withdrawService.lambdaQuery() |
| | | .eq(Withdraw::getOrderId,order.getId()).last("limit 1") |
| | | .one(); |
| | | List<WithdrawRecord> list = withdrawRecordService.lambdaQuery().eq(WithdrawRecord::getWithdrawId, withdraw.getId()) |
| | | .eq(WithdrawRecord::getWithdrawType, 3).list(); |
| | | if (list.isEmpty()){ |
| | | WithdrawRecord withdrawRecord = new WithdrawRecord(); |
| | | withdrawRecord.setWithdrawId(withdraw.getId()); |
| | | withdrawRecord.setOrderId(withdraw.getOrderId()); |
| | | withdrawRecord.setUserId(withdraw.getUserId()); |
| | | withdrawRecord.setWithdrawType(3); |
| | | withdrawRecord.setCreateTime(new Date()); |
| | | withdrawRecord.setAuditStatus(1); |
| | | withdrawRecordService.save(withdrawRecord); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | @GetMapping("/withdrawDetailByUser") |
| | |
| | | if (null != withdraw) { |
| | | withdrawDetailVO.setWithdrawalState(withdraw.getState()); |
| | | withdrawDetailVO.setWithdrawalTime(withdraw.getCreateTime()); |
| | | List<WithdrawRecord> list = withdrawRecordService.lambdaQuery().eq(WithdrawRecord::getOrderId, orderId) |
| | | .eq(WithdrawRecord::getWithdrawId, withdraw.getId()) |
| | | .eq(WithdrawRecord::getUserId, withdraw.getUserId()).list(); |
| | | withdrawDetailVO.setWithdrawRecords(list); |
| | | } |
| | | withdrawDetailVO.setPackageInfo(order.getPackageInfo()); |
| | | withdrawDetailVO.setAddress(order.getAddress()); |
| | | if (null != serveRecord) { |
| | | withdrawDetailVO.setPhoto(serveRecord.getPhoto()); |
| | | } |
| | | List<WithdrawRecord> list = withdrawRecordService.lambdaQuery().eq(WithdrawRecord::getOrderId, orderId) |
| | | .eq(WithdrawRecord::getWithdrawId, withdraw.getId()) |
| | | .eq(WithdrawRecord::getUserId, withdraw.getUserId()).list(); |
| | | withdrawDetailVO.setWithdrawRecords(list); |
| | | |
| | | return R.ok(withdrawDetailVO); |
| | | } |
| | | |