From 356b6e4b0a11a6e44717dc9b92beaacc9c0c4b7a Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期二, 06 八月 2024 10:13:18 +0800 Subject: [PATCH] 修改bug --- ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomController.java | 49 +++++++++++++++++++++++++++++++++++++------------ 1 files changed, 37 insertions(+), 12 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 5e2336b..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); @@ -171,12 +195,13 @@ } LambdaQueryWrapper<AuctionBondJl> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionBondJl::getAuctionSalesroomId,byId.getId()); - 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); + if (auctionSalesroom!=null){ + auctionSalesroom.setIsState(1); + auctionBondJlMapper.updateById(auctionSalesroom); + } }else{ LambdaQueryWrapper<AuctionBondJl> wrapper=Wrappers.lambdaQuery(); -- Gitblit v1.7.1