From 499ab5e5815d4f53ec27e0524c1c9896d1552e25 Mon Sep 17 00:00:00 2001 From: rentaiming <806181062@qq.com> Date: 星期四, 01 八月 2024 00:35:18 +0800 Subject: [PATCH] 修改bug --- ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomController.java | 42 +++++++++++++++++++++++++++++++++--------- 1 files changed, 33 insertions(+), 9 deletions(-) diff --git a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomController.java b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomController.java index 72492c2..f859079 100644 --- a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomController.java +++ b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomController.java @@ -138,15 +138,39 @@ memberAuctionSalesroomBondDTO.setAuctionSalesroomId(byId.getId()); } } - - AuctionBondJl auctionBondJl=new AuctionBondJl(); - auctionBondJl.setAuctionGoodsId(memberAuctionSalesroomBondDTO.getAuctionGoodsId()); - auctionBondJl.setAuctionSalesroomId(memberAuctionSalesroomBondDTO.getAuctionSalesroomId()); - auctionBondJl.setIsState(0); - auctionBondJl.setBondType(memberAuctionSalesroomBondDTO.getBondType()); - auctionBondJl.setMemberId(memberAuctionSalesroomBondDTO.getMemberId()); - auctionBondJlMapper.insert(auctionBondJl); - + if (memberAuctionSalesroomBondDTO.getBondType()==1) { + 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); + if (auctionSalesroom==null){ + AuctionBondJl auctionBondJl = new AuctionBondJl(); + auctionBondJl.setAuctionGoodsId(memberAuctionSalesroomBondDTO.getAuctionGoodsId()); + auctionBondJl.setIsState(0); + auctionBondJl.setBondType(memberAuctionSalesroomBondDTO.getBondType()); + auctionBondJl.setMemberId(memberAuctionSalesroomBondDTO.getMemberId()); + auctionBondJlMapper.insert(auctionBondJl); + }else{ + throw new ServiceException("你已报名"); + } + }else{ + LambdaQueryWrapper<AuctionBondJl> wrapper = Wrappers.lambdaQuery(); + wrapper.eq(AuctionBondJl::getAuctionSalesroomId, memberAuctionSalesroomBondDTO.getAuctionSalesroomId()); + wrapper.eq(AuctionBondJl::getMemberId, memberAuctionSalesroomBondDTO.getMemberId()); + wrapper.eq(AuctionBondJl::getIsState, 0); + AuctionBondJl auctionSalesroom = auctionBondJlMapper.selectOne(wrapper); + if (auctionSalesroom==null){ + AuctionBondJl auctionBondJl = new AuctionBondJl(); + auctionBondJl.setAuctionSalesroomId(memberAuctionSalesroomBondDTO.getAuctionSalesroomId()); + auctionBondJl.setIsState(0); + auctionBondJl.setBondType(memberAuctionSalesroomBondDTO.getBondType()); + auctionBondJl.setMemberId(memberAuctionSalesroomBondDTO.getMemberId()); + auctionBondJlMapper.insert(auctionBondJl); + }else{ + throw new ServiceException("你已报名"); + } + } PayInfoVO payInfoVO = iAuctionSalesroomService.SaveSignUpNow(memberAuctionSalesroomBondDTO); -- Gitblit v1.7.1