rentaiming
2024-05-30 06094ec805862d8f0bebe1e2327addaf586b94ce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package com.ruoyi.order.controller;
 
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.enums.BondStatusEnum;
import com.ruoyi.common.security.annotation.InnerAuth;
import com.ruoyi.order.service.IOrderAuctionBondService;
import com.ruoyi.system.api.domain.OrderAuctionBond;
import com.ruoyi.system.api.domain.dto.*;
import com.ruoyi.system.api.domain.vo.PayInfoVO;
import java.util.List;
import javax.annotation.Resource;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * <p>
 * 拍卖保证金表 前端控制器
 * </p>
 *
 * @author mitao
 * @since 2024-05-16
 */
@RestController
@RequestMapping("/order-auction-bond")
public class OrderAuctionBondController {
 
    @Resource
    private IOrderAuctionBondService  iOrderAuctionBondService;
 
    /**
     * 获取当前商品信息
     *
     */
    @InnerAuth
    @PostMapping("/getOrderAuctionBond")
    @ResponseBody
    public R<T> getOrderAuctionBond(@RequestBody OrderAuctionBondDTO orderAuctionBondDTO) {
        iOrderAuctionBondService.getOrderAuctionBond(orderAuctionBondDTO);
        return R.ok();
 
    }
 
    @InnerAuth
    @PostMapping("/getOrderAuctionBondList")
    @ResponseBody
    public R<List<OrderAuctionBond>> getOrderAuctionBondList(@RequestBody MemberAuctionSalesroomDTO memberAuctionSalesroomDTO) {
        LambdaQueryWrapper<OrderAuctionBond> wrapper= Wrappers.lambdaQuery();
        wrapper.eq(OrderAuctionBond::getMemberId,memberAuctionSalesroomDTO.getMemberId());
        wrapper.eq(OrderAuctionBond::getAuctionSalesroomId,memberAuctionSalesroomDTO.getAuctionSalesroomId());
        wrapper.eq(OrderAuctionBond::getBoundStatus,2);
        wrapper.eq(OrderAuctionBond::getDelFlag,0);
        List<OrderAuctionBond> list = iOrderAuctionBondService.list(wrapper);
        return R.ok(list);
 
    }
 
    @InnerAuth
    @PostMapping("/getAuctionGoodsOrderAuctionBondList")
    @ResponseBody
    public R<List<OrderAuctionBond>> getAuctionGoodsOrderAuctionBondList(@RequestBody AuctionGoodsListDTO auctionGoodsListDTO) {
        LambdaQueryWrapper<OrderAuctionBond> wrapper= Wrappers.lambdaQuery();
        wrapper.eq(OrderAuctionBond::getMemberId,auctionGoodsListDTO.getMemberId());
        wrapper.eq(OrderAuctionBond::getAuctionGoodsId,auctionGoodsListDTO.getGoodsSkuId());
        wrapper.eq(OrderAuctionBond::getBoundStatus,1);
        wrapper.eq(OrderAuctionBond::getDelFlag,0);
        List<OrderAuctionBond> list = iOrderAuctionBondService.list(wrapper);
        return R.ok(list);
 
    }
 
    @InnerAuth
    @PostMapping("/SaveOrderAuctionBond")
    @ResponseBody
    public R<PayInfoVO> SaveOrderAuctionBond(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO) {
        return R.ok(iOrderAuctionBondService.SaveOrderAuctionBond(memberAuctionSalesroomBondDTO));
 
    }
 
    @InnerAuth
    @PostMapping("/UpdateBond")
    @ResponseBody
    public R UpdateBond(@RequestBody BondDTO ondVO) {
        LambdaQueryWrapper<OrderAuctionBond> wrapper= Wrappers.lambdaQuery();
        wrapper.eq(OrderAuctionBond::getOrderNo,ondVO.getOrderNO());
        wrapper.eq(OrderAuctionBond::getDelFlag,0);
        OrderAuctionBond one = iOrderAuctionBondService.getOne(wrapper);
        one.setBoundStatus(BondStatusEnum.PAID);
        iOrderAuctionBondService.updateById(one);
        return R.ok();
 
    }
 
}