无关风月
3 天以前 7e92d9c7f76777c48f76376c99ffaae2e16fe7ed
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WithdrawController.java
@@ -324,15 +324,23 @@
    @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")
@@ -374,16 +382,17 @@
        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);
    }