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.constant.SecurityConstants;
|
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.*;
|
|
/**
|
* <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("/getOrderAuctionBondone1")
|
@ResponseBody
|
public R<OrderAuctionBond> getOrderAuctionBondone1(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO) {
|
LambdaQueryWrapper<OrderAuctionBond> wrapper= Wrappers.lambdaQuery();
|
wrapper.eq(OrderAuctionBond::getMemberId,memberAuctionSalesroomBondDTO.getMemberId());
|
wrapper.eq(OrderAuctionBond::getAuctionGoodsId,memberAuctionSalesroomBondDTO.getAuctionGoodsId());
|
wrapper.eq(OrderAuctionBond::getBoundStatus,1);
|
wrapper.eq(OrderAuctionBond::getDelFlag,0);
|
OrderAuctionBond one = iOrderAuctionBondService.getOne(wrapper);
|
return R.ok(one);
|
}
|
|
|
@InnerAuth
|
@PostMapping("/getOrderAuctionBondone")
|
@ResponseBody
|
public R<OrderAuctionBond> getOrderAuctionBondone(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO,
|
@RequestHeader(SecurityConstants.FROM_SOURCE) String source){
|
LambdaQueryWrapper<OrderAuctionBond> wrapper= Wrappers.lambdaQuery();
|
wrapper.eq(OrderAuctionBond::getMemberId,memberAuctionSalesroomBondDTO.getMemberId());
|
wrapper.eq(OrderAuctionBond::getAuctionSalesroomId,memberAuctionSalesroomBondDTO.getAuctionSalesroomId());
|
wrapper.eq(OrderAuctionBond::getBoundStatus,2);
|
wrapper.eq(OrderAuctionBond::getDelFlag,0);
|
OrderAuctionBond one = iOrderAuctionBondService.getOne(wrapper);
|
return R.ok(one);
|
}
|
|
@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();
|
|
}
|
|
}
|