rentaiming
2024-05-31 e59e26244b2a07b9d8360551cbab75c6fd8a1248
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
package com.ruoyi.order.controller.inner;
 
 
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.AuctionOrderTypeEnum;
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 java.util.List;
import javax.annotation.Resource;
 
import com.ruoyi.system.api.domain.vo.PayInfoVO;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
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 InnerOrderAuctionBondController {
 
    @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::getDelFlag, 0);
        List<OrderAuctionBond> list = iOrderAuctionBondService.list(wrapper);
        return R.ok(list);
 
    }
 
    /**
     * 查询保证金订单列表
     *
     * @param id                   拍卖商品id
     * @param auctionOrderTypeEnum 拍卖类型: 普通拍品 拍卖会拍品
     * @param bondStatusEnum       保证金状态 待支付 已支付 已退款 为null则查询所有
     * @return List<OrderAuctionBond>
     */
    @InnerAuth
    @PostMapping("/list")
    public R<List<OrderAuctionBond>> getOrderAuctionBondList(@RequestParam("id") Long id,
            @RequestParam("auctionOrderTypeEnum") AuctionOrderTypeEnum auctionOrderTypeEnum,
            @RequestParam(value = "bondStatusEnum", required = false) BondStatusEnum bondStatusEnum) {
        return R.ok(iOrderAuctionBondService.getOrderAuctionBondList(id, auctionOrderTypeEnum,
                bondStatusEnum));
    }
 
    /**
     * 批量更新保证金订单状态
     *
     * @param ids            保证金订单id列表
     * @param bondStatusEnum 保证金状态
     */
    @InnerAuth
    @PutMapping
    R<?> updateOrderAuctionBondStatus(@RequestParam("ids") List<Long> ids,
            @RequestParam("bondStatusEnum") BondStatusEnum bondStatusEnum) {
        iOrderAuctionBondService.updateOrderAuctionBondStatus(ids, bondStatusEnum);
        return R.ok();
    }
 
    @InnerAuth
    @PostMapping("/getOrderAuctionBondList1")
    @ResponseBody
    public R<List<OrderAuctionBond>> getOrderAuctionBondList1(@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();
 
    }
    
}