| | |
| | | package com.ruoyi.auction.controller.forepart; |
| | | |
| | | |
| | | import com.ruoyi.auction.controller.forepart.dto.AuctionSalesroomGoodsDTO; |
| | | import com.ruoyi.auction.controller.forepart.dto.ForepartAuctionBidRecordDTO; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.auction.mapper.AuctionBondJlMapper; |
| | | import com.ruoyi.auction.mapper.AuctionGoodsMapper; |
| | | import com.ruoyi.auction.service.IAuctionSalesroomGoodsService; |
| | | import com.ruoyi.common.security.annotation.InnerAuth; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomDTO; |
| | | import com.ruoyi.auction.controller.forepart.vo.ForepartAuctionSalesroomVO; |
| | | import com.ruoyi.auction.controller.forepart.vo.MemberAuctionSalesroomInfoVO; |
| | | import com.ruoyi.auction.controller.forepart.vo.MemberAuctionSalesroomVO; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import com.ruoyi.auction.service.IAuctionSalesroomService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.system.api.domain.AppMiniLoginVO; |
| | | import com.ruoyi.system.api.domain.AuctionBondJl; |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import com.ruoyi.system.api.domain.dto.AppMiniLoginDTO; |
| | | import com.ruoyi.system.api.domain.dto.AuctionSalesroomDTO; |
| | | import com.ruoyi.system.api.domain.dto.ForepartAuctionBidRecordDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomDTO; |
| | | import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberAuctionSalesroomInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberAuctionSalesroomVO; |
| | | import com.ruoyi.system.api.domain.vo.PayInfoVO; |
| | | import com.ruoyi.system.api.domain.vo.WdMemberAuctionSalesroomVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/forepart/auction-salesroom") |
| | | @Api(value = "拍卖场相关接口", tags = "拍卖场相关接口", description = "拍卖场相关接口") |
| | |
| | | @Resource |
| | | private IAuctionSalesroomGoodsService iAuctionSalesroomGoodsService; |
| | | |
| | | @InnerAuth |
| | | @PostMapping("/getAuctionSalesroomOne") |
| | | @ResponseBody |
| | | public R<AuctionSalesroom> getauctionSalesroomOne(@RequestBody Long auctionSalesroomId) { |
| | | AuctionSalesroom auctionSalesroomOne=iAuctionSalesroomService.getById(auctionSalesroomId); |
| | | return R.ok(auctionSalesroomOne); |
| | | @Resource |
| | | private AuctionGoodsMapper AuctionGoodsMapper; |
| | | |
| | | } |
| | | @Resource |
| | | private AuctionBondJlMapper auctionBondJlMapper; |
| | | |
| | | /** |
| | | * 拍卖大屏获取拍卖信息 |
| | | * |
| | | */ |
| | | @RequestMapping("getAuctionBidRecordList") |
| | | @ResponseBody |
| | | @PostMapping("/getAuctionBidRecordList") |
| | | @ApiOperation(value = "拍卖大屏-获取拍卖信息") |
| | | public R<PageDTO<AuctionSalesroom>> getAuctionBidRecordList(@RequestBody AuctionSalesroomGoodsDTO ctionSalesroomGoodsDTO) { |
| | | public R<List<AuctionSalesroom>> getAuctionBidRecordList(@RequestBody AuctionSalesroomDTO ctionSalesroomGoodsDTO) { |
| | | return R.ok(iAuctionSalesroomService.getAuctionBidRecordList(ctionSalesroomGoodsDTO)); |
| | | |
| | | } |
| | |
| | | * 暖场视频or封面海报 |
| | | * |
| | | */ |
| | | @RequestMapping("/getBaaner") |
| | | @ResponseBody |
| | | @PostMapping("/getBaaner") |
| | | @ApiOperation(value = "拍卖大屏-暖场视频or封面海报") |
| | | public R<ForepartAuctionSalesroomVO> getBaaner(@RequestBody AuctionSalesroomGoodsDTO ctionSalesroomGoodsDTO) { |
| | | public R<ForepartAuctionSalesroomVO> getBaaner(@RequestBody AuctionSalesroomDTO ctionSalesroomGoodsDTO) { |
| | | return R.ok(iAuctionSalesroomService.getBaaner(ctionSalesroomGoodsDTO)); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/getAuctionBidRecordOne") |
| | | @ResponseBody |
| | | @PostMapping("/getAuctionBidRecordOne") |
| | | @ApiOperation(value = "拍卖师端-扫码二维码获取拍卖场信息") |
| | | public R<AuctionSalesroom> getAuctionBidRecordOne(@RequestBody ForepartAuctionBidRecordDTO arepartAuctionBidRecordDTO) { |
| | | return R.ok(iAuctionSalesroomService.getAuctionBidRecordOne(arepartAuctionBidRecordDTO)); |
| | | } |
| | | |
| | | @RequestMapping("/actionMiniLogin") |
| | | @ResponseBody |
| | | @PostMapping("/actionMiniLogin") |
| | | @ApiOperation(value = "拍卖师端-第三方登陸") |
| | | public R<AppMiniLoginVO> actionMiniLogin(@RequestBody AppMiniLoginDTO appMiniLoginDto) { |
| | | return R.ok(iAuctionSalesroomService.actionMiniLogin(appMiniLoginDto)); |
| | | } |
| | | |
| | | @PostMapping("/isMiniLogin") |
| | | @ApiOperation(value = "拍卖师端-判断是否是拍卖师") |
| | | public R<AppMiniLoginVO> isMiniLogin(@RequestBody AppMiniLoginDTO appMiniLoginDto) { |
| | | return R.ok(iAuctionSalesroomService.isMiniLogin(appMiniLoginDto)); |
| | | } |
| | | |
| | | @RequestMapping("/getMemberAuctionSalesroomList") |
| | | @ResponseBody |
| | | @PostMapping("/getMemberAuctionSalesroomList") |
| | | @ApiOperation(value = "用户端-拍卖场信息列表") |
| | | public R<PageDTO<MemberAuctionSalesroomVO>> getMemberAuctionSalesroomList(@RequestBody MemberAuctionSalesroomDTO MemberAuctionSalesroomDTO) { |
| | | return R.ok(iAuctionSalesroomService.getMemberAuctionSalesroomList(MemberAuctionSalesroomDTO)); |
| | | } |
| | | |
| | | @RequestMapping("/getMemberAuctionSalesroomInfo") |
| | | @ResponseBody |
| | | @PostMapping("/getMemberAuctionSalesroomInfo") |
| | | @ApiOperation(value = "用户端-拍卖场信息详情") |
| | | public R<MemberAuctionSalesroomInfoVO> getMemberAuctionSalesroomInfo(@RequestBody MemberAuctionSalesroomDTO memberAuctionSalesroomDTO) { |
| | | return R.ok(iAuctionSalesroomService.getMemberAuctionSalesroomInfo(memberAuctionSalesroomDTO)); |
| | | } |
| | | |
| | | @RequestMapping("/getMemberAuctionSalesroomSweep") |
| | | @ResponseBody |
| | | @PostMapping("/getMemberAuctionSalesroomSweep") |
| | | @ApiOperation(value = "用户端-扫一扫拍卖场信息") |
| | | public R<MemberAuctionSalesroomVO> getMemberAuctionSalesroomSweep(@RequestBody MemberAuctionSalesroomDTO MemberAuctionSalesroomDTO) { |
| | | return R.ok(iAuctionSalesroomService.getMemberAuctionSalesroomSweep(MemberAuctionSalesroomDTO)); |
| | | } |
| | | |
| | | @RequestMapping("/SaveSignUpNow") |
| | | @ResponseBody |
| | | @PostMapping("/SaveSignUpNow") |
| | | @ApiOperation(value = "用户端-拍卖立即报名") |
| | | public R<PayInfoVO> SaveSignUpNow(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO) { |
| | | return R.ok( iAuctionSalesroomService.SaveSignUpNow(memberAuctionSalesroomBondDTO)); |
| | | log.info("=================================开始拍卖报名================================="); |
| | | if (memberAuctionSalesroomBondDTO.getBondType() == 1) { |
| | | AuctionGoods auctionGoods = AuctionGoodsMapper.selectById(memberAuctionSalesroomBondDTO.getAuctionGoodsId()); |
| | | if (auctionGoods.getListingStatus().getCode()==1){ |
| | | throw new ServiceException("商品拍卖下线"); |
| | | } |
| | | LambdaQueryWrapper<AuctionBondJl> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionBondJl::getAuctionGoodsId, |
| | | memberAuctionSalesroomBondDTO.getAuctionGoodsId()); |
| | | wrapper.eq(AuctionBondJl::getMemberId, memberAuctionSalesroomBondDTO.getMemberId()); |
| | | wrapper.eq(AuctionBondJl::getIsState, 0); |
| | | AuctionBondJl auctionBondJl = auctionBondJlMapper.selectOne(wrapper); |
| | | if (Objects.nonNull(auctionBondJl)) { |
| | | throw new ServiceException("你已报名"); |
| | | } |
| | | log.info("auctionGoods:{}", auctionGoods); |
| | | if (auctionGoods.getBond() == null |
| | | || auctionGoods.getBond().compareTo(BigDecimal.ZERO) == 0) { |
| | | auctionBondJl = new AuctionBondJl(); |
| | | auctionBondJl.setAuctionGoodsId(memberAuctionSalesroomBondDTO.getAuctionGoodsId()); |
| | | auctionBondJl.setIsState(0); |
| | | auctionBondJl.setBondType(memberAuctionSalesroomBondDTO.getBondType()); |
| | | auctionBondJl.setMemberId(memberAuctionSalesroomBondDTO.getMemberId()); |
| | | auctionBondJlMapper.insert(auctionBondJl); |
| | | } |
| | | }else{ |
| | | AuctionSalesroom byId = iAuctionSalesroomService.getById(memberAuctionSalesroomBondDTO.getAuctionSalesroomId()); |
| | | if(byId==null){ |
| | | LambdaQueryWrapper<AuctionSalesroom> auctionSalesroomWrapper = Wrappers.lambdaQuery(); |
| | | auctionSalesroomWrapper.eq(AuctionSalesroom::getAuctionSalesroomNo, |
| | | memberAuctionSalesroomBondDTO.getAuctionSalesroomId()); |
| | | auctionSalesroomWrapper.eq(AuctionSalesroom::getDelFlag, 0); |
| | | byId = iAuctionSalesroomService.getOne(auctionSalesroomWrapper); |
| | | } |
| | | memberAuctionSalesroomBondDTO.setAuctionSalesroomId(byId.getId()); |
| | | LambdaQueryWrapper<AuctionBondJl> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionBondJl::getAuctionSalesroomId, |
| | | memberAuctionSalesroomBondDTO.getAuctionSalesroomId()); |
| | | wrapper.eq(AuctionBondJl::getMemberId, memberAuctionSalesroomBondDTO.getMemberId()); |
| | | wrapper.eq(AuctionBondJl::getIsState, 0); |
| | | AuctionBondJl auctionBondJl = auctionBondJlMapper.selectOne(wrapper); |
| | | if (Objects.nonNull(auctionBondJl)) { |
| | | throw new ServiceException("你已报名"); |
| | | } |
| | | log.info("AuctionSalesroom:{}", byId); |
| | | if (byId.getBond() == null || byId.getBond().compareTo(BigDecimal.ZERO) == 0) { |
| | | auctionBondJl = new AuctionBondJl(); |
| | | auctionBondJl.setAuctionSalesroomId( |
| | | memberAuctionSalesroomBondDTO.getAuctionSalesroomId()); |
| | | auctionBondJl.setIsState(0); |
| | | auctionBondJl.setBondType(memberAuctionSalesroomBondDTO.getBondType()); |
| | | auctionBondJl.setMemberId(memberAuctionSalesroomBondDTO.getMemberId()); |
| | | auctionBondJlMapper.insert(auctionBondJl); |
| | | } |
| | | } |
| | | |
| | | PayInfoVO payInfoVO = iAuctionSalesroomService.SaveSignUpNow(memberAuctionSalesroomBondDTO); |
| | | |
| | | return R.ok(payInfoVO); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/CancelSignUpNow") |
| | | @ApiOperation(value = "用户端-拍卖取消报名") |
| | | public R CancelSignUpNow(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO) { |
| | | iAuctionSalesroomService.CancelSignUpNow(memberAuctionSalesroomBondDTO); |
| | | |
| | | |
| | | if (memberAuctionSalesroomBondDTO.getBondType()==2){ |
| | | AuctionSalesroom byId = iAuctionSalesroomService.getById(memberAuctionSalesroomBondDTO.getAuctionSalesroomId()); |
| | | if(byId==null){ |
| | | LambdaQueryWrapper<AuctionSalesroom> wrapper= Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionSalesroom::getAuctionSalesroomNo,memberAuctionSalesroomBondDTO.getAuctionSalesroomId()); |
| | | wrapper.eq(AuctionSalesroom::getDelFlag,0); |
| | | byId =iAuctionSalesroomService.getOne(wrapper); |
| | | memberAuctionSalesroomBondDTO.setAuctionSalesroomId(byId.getId()); |
| | | } |
| | | LambdaQueryWrapper<AuctionBondJl> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionBondJl::getAuctionSalesroomId,byId.getId()); |
| | | wrapper.eq(AuctionBondJl::getMemberId,memberAuctionSalesroomBondDTO.getMemberId()); |
| | | wrapper.eq(AuctionBondJl::getIsState,0); |
| | | AuctionBondJl auctionSalesroom = auctionBondJlMapper.selectOne(wrapper); |
| | | if (auctionSalesroom!=null){ |
| | | auctionSalesroom.setIsState(1); |
| | | auctionBondJlMapper.updateById(auctionSalesroom); |
| | | } |
| | | |
| | | }else{ |
| | | LambdaQueryWrapper<AuctionBondJl> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionBondJl::getAuctionGoodsId,memberAuctionSalesroomBondDTO.getAuctionGoodsId()); |
| | | wrapper.eq(AuctionBondJl::getMemberId,memberAuctionSalesroomBondDTO.getMemberId()); |
| | | wrapper.eq(AuctionBondJl::getIsState,0); |
| | | AuctionBondJl auctionSalesroom = auctionBondJlMapper.selectOne(wrapper); |
| | | auctionSalesroom.setIsState(1); |
| | | auctionBondJlMapper.updateById(auctionSalesroom); |
| | | } |
| | | return R.ok( ); |
| | | } |
| | | |
| | | /** |
| | | * 拍卖师端拍卖场立即开始 |
| | | * |
| | | */ |
| | | @RequestMapping("/auctionSalesroomStart") |
| | | @ResponseBody |
| | | @PostMapping("/auctionSalesroomStart") |
| | | @ApiOperation(value = "拍卖师端-拍卖场立即开始") |
| | | public R auctionSalesroomStart(@RequestBody AuctionSalesroomGoodsDTO ationSalesroomGoodsDTO) { |
| | | public R auctionSalesroomStart(@RequestBody AuctionSalesroomDTO ationSalesroomGoodsDTO) { |
| | | iAuctionSalesroomGoodsService.auctionSalesroomStart(ationSalesroomGoodsDTO); |
| | | return R.ok(); |
| | | } |
| | |
| | | * 拍卖师端拍卖场立即开始 |
| | | * |
| | | */ |
| | | @RequestMapping("/auctionSalesroomEnd") |
| | | @ResponseBody |
| | | @PostMapping("/auctionSalesroomEnd") |
| | | @ApiOperation(value = "拍卖师端-拍卖场立即结束") |
| | | public R auctionSalesroomEnd(@RequestBody AuctionSalesroomGoodsDTO ationSalesroomGoodsDTO) { |
| | | public R auctionSalesroomEnd(@RequestBody AuctionSalesroomDTO ationSalesroomGoodsDTO) { |
| | | iAuctionSalesroomGoodsService.auctionSalesroomEnd(ationSalesroomGoodsDTO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/getWdAuctionSalesroomList") |
| | | @ApiOperation(value = "用户端-我的拍卖-我的加入了的拍卖场") |
| | | public R<PageDTO<WdMemberAuctionSalesroomVO>> getWdAuctionSalesroomList(@RequestBody MemberAuctionSalesroomDTO MemberAuctionSalesroomDTO) { |
| | | return R.ok(iAuctionSalesroomService.getWdAuctionSalesroomList(MemberAuctionSalesroomDTO)); |
| | | } |
| | | } |