rentaiming
2024-05-23 13aa4c21cf369a38e97941b4df6168b22b3e9387
ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomGoodsServiceImpl.java
@@ -67,22 +67,22 @@
     *
     */
    @Override
    public ForepartAuctionSalesroomGoodsVO getAuctionSalesroomGoods(Integer SalesroomId) {
    public ForepartAuctionSalesroomGoodsVO getAuctionSalesroomGoods(AuctionSalesroomGoodsDTO ationSalesroomGoodsDTO) {
        ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO =new ForepartAuctionSalesroomGoodsVO();
        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(ationSalesroomGoodsDTO.getAuctionSalesroomId());
        forepartAuctionSalesroomGoodsVO.setSalesroomId(auctionSalesroom.getId());
        forepartAuctionSalesroomGoodsVO.setSalesroomName(auctionSalesroom.getSalesroomName());
        forepartAuctionSalesroomGoodsVO.setSalesroomType(auctionSalesroom.getType().getCode());
        LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery();
        wrapper.eq(AuctionSalesroomGoods::getStatus,1);
        wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
        wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId());
        wrapper.eq(AuctionSalesroomGoods::getDelFlag,0);
        AuctionSalesroomGoods auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper);
        if (auctionSalesroomGoods==null){
            LambdaQueryWrapper<AuctionSalesroomGoods> wrapper1=Wrappers.lambdaQuery();
            wrapper1.eq(AuctionSalesroomGoods::getStatus,2);
            wrapper1.eq(AuctionSalesroomGoods::getDelFlag,0);
            wrapper1.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
            wrapper1.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId());
            wrapper1.orderByAsc(AuctionSalesroomGoods::getSortNum);
            wrapper1.last("limit 1");
            auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper1);
@@ -90,7 +90,7 @@
                LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
                wrapper2.eq(AuctionSalesroomGoods::getStatus,0);
                wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
                wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
                wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId());
                wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum);
                wrapper2.last("limit 1");
                auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper2);
@@ -130,9 +130,9 @@
     *
     */
    @Override
    public AuctionSalesroomVO getAuctionSalesroominfo(Integer SalesroomId) {
    public AuctionSalesroomVO getAuctionSalesroominfo(AuctionSalesroomGoodsDTO ationSalesroomGoodsDTO) {
        ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO =new ForepartAuctionSalesroomGoodsVO();
        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(ationSalesroomGoodsDTO.getAuctionSalesroomId());
        AuctionSalesroomVO auctionSalesroomVO=new AuctionSalesroomVO();
        auctionSalesroomVO.setCoverPic(auctionSalesroom.getCoverPic());
        auctionSalesroomVO.setDescription(auctionSalesroom.getDescription());
@@ -146,7 +146,7 @@
            LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery();
            wrapper.eq(AuctionSalesroomGoods::getStatus,0);
            wrapper.eq(AuctionSalesroomGoods::getDelFlag,0);
            wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
            wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId());
            wrapper.orderByAsc(AuctionSalesroomGoods::getSortNum);
            List<AuctionSalesroomGoods> auctionSalesroomGoods=iAuctionSalesroomGoodsService.list(wrapper);
            for (AuctionSalesroomGoods salesroomGoods:auctionSalesroomGoods){
@@ -162,7 +162,7 @@
            LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery();
            wrapper.eq(AuctionSalesroomGoods::getStatus,1);
            wrapper.eq(AuctionSalesroomGoods::getDelFlag,0);
            wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
            wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId());
            wrapper.last("limit 1");
            AuctionSalesroomGoods auctionSalesroomGoods= iAuctionSalesroomGoodsService.getOne(wrapper);
            ForepartAuctionSalesroomGoodsVO currentAuctionSalesroomGoods=  new ForepartAuctionSalesroomGoodsVO();
@@ -191,7 +191,7 @@
            LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
            wrapper2.notIn(AuctionSalesroomGoods::getSortNum,list);
            wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
            wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
            wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId());
            wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum);
            wrapper2.orderByAsc(AuctionSalesroomGoods::getStatus);
            List<AuctionSalesroomGoods> auctionSalesroomGoods2=iAuctionSalesroomGoodsService.list(wrapper2);
@@ -220,9 +220,9 @@
     *
     */
    @Override
    public void auctionSalesroomStart(Integer SalesroomId) {
    public void auctionSalesroomStart(AuctionSalesroomGoodsDTO ationSalesroomGoodsDTO) {
        ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO =new ForepartAuctionSalesroomGoodsVO();
        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(ationSalesroomGoodsDTO.getAuctionSalesroomId());
        auctionSalesroom.setStatus(AuctionStartStatusEnum.IN_AUCTION);
        auctionSalesroom.setStartTime(LocalDateTime.now());
        iAuctionSalesroomService.updateById(auctionSalesroom);
@@ -230,7 +230,7 @@
        LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
        wrapper2.eq(AuctionSalesroomGoods::getStatus,0);
        wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId());
        wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum);
        wrapper2.last("limit 1");
        AuctionSalesroomGoods auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper2);
@@ -245,9 +245,9 @@
     *
     */
    @Override
    public void auctionSalesroomEnd(Integer SalesroomId) {
    public void auctionSalesroomEnd(AuctionSalesroomGoodsDTO ationSalesroomGoodsDTO) {
        ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO =new ForepartAuctionSalesroomGoodsVO();
        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(ationSalesroomGoodsDTO.getAuctionSalesroomId());
        auctionSalesroom.setStatus(AuctionStartStatusEnum.ENDED);
        auctionSalesroom.setEndTime(LocalDateTime.now());
        iAuctionSalesroomService.updateById(auctionSalesroom);
@@ -255,7 +255,7 @@
        LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
        wrapper2.eq(AuctionSalesroomGoods::getStatus,0);
        wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId());
        List<AuctionSalesroomGoods> auctionSalesroomGoods=iAuctionSalesroomGoodsService.list(wrapper2);
        for (AuctionSalesroomGoods salesroomGoods:auctionSalesroomGoods){
            salesroomGoods.setStatus(AuctionStartStatusEnum.ENDED);
@@ -265,7 +265,7 @@
        LambdaQueryWrapper<AuctionBidRecord> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(AuctionBidRecord::getAuctionSalesroomId, SalesroomId);
        wrapper.eq(AuctionBidRecord::getAuctionSalesroomId, ationSalesroomGoodsDTO.getAuctionSalesroomId());
        wrapper.eq(AuctionBidRecord::getDelFlag, 0);
        wrapper.eq(AuctionBidRecord::getStatus,0);
        List<AuctionBidRecord>auctionBidRecordList = iAuctionBidRecordService.list(wrapper);
@@ -286,11 +286,11 @@
     *
     */
    @Override
    public List<AuctionSalesroomGoods> isAuctionSalesroom(Integer SalesroomId) {
    public List<AuctionSalesroomGoods> isAuctionSalesroom(AuctionSalesroomGoodsDTO ationSalesroomGoodsDTO) {
        LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
        wrapper2.eq(AuctionSalesroomGoods::getStatus,0);
        wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId());
        List<AuctionSalesroomGoods> auctionSalesroomGoods=iAuctionSalesroomGoodsService.list(wrapper2);
        return auctionSalesroomGoods;
    }