From eae081c85a3f570a1ada34b2fbf63140b037d9a3 Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期一, 20 五月 2024 14:38:37 +0800
Subject: [PATCH] 写拍卖师端

---
 ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomController.java |   47 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 33 insertions(+), 14 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 1e84c3b..76cbb5e 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
@@ -3,18 +3,17 @@
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.ruoyi.auction.controller.forepart.VO.AuctionSalesroomVO;
+import com.ruoyi.auction.controller.forepart.DTO.ForepartAuctionBidRecordDTO;
+import com.ruoyi.auction.controller.forepart.VO.ForepartAuctionSalesroomVO;
 import com.ruoyi.auction.domain.pojo.AuctionSalesroom;
 import com.ruoyi.auction.domain.pojo.AuctionVideo;
 import com.ruoyi.auction.service.IAuctionSalesroomService;
 import com.ruoyi.auction.service.IAuctionVideoService;
 import com.ruoyi.common.core.domain.R;
+import com.ruoyi.system.api.domain.SysUser;
+import com.ruoyi.system.api.feignClient.SysUserClient;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -37,6 +36,9 @@
 
     @Resource
     private IAuctionVideoService  iAuctionVideoService;
+
+    @Resource
+    private SysUserClient sysUserClient;
 
     /**
      * 拍卖大屏获取拍卖信息
@@ -61,33 +63,50 @@
     @RequestMapping("/getBaaner")
     @ResponseBody
     @ApiOperation(value = " 暖场视频or封面海报")
-    public R<AuctionSalesroomVO> getBaaner(@PathVariable("salesroomId") Integer SalesroomId) {
+    public R<ForepartAuctionSalesroomVO> getBaaner(@PathVariable("salesroomId") Integer SalesroomId) {
 
         LambdaQueryWrapper<AuctionVideo> wrapper=Wrappers.lambdaQuery();
         wrapper.eq(AuctionVideo::getAuctionSalesroomId,SalesroomId);
         wrapper.eq(AuctionVideo::getDelFlag,0);
         AuctionVideo auctionVideo=iAuctionVideoService.getOne(wrapper);
-        AuctionSalesroomVO auctionSalesroomVO=new AuctionSalesroomVO();
+        ForepartAuctionSalesroomVO forepartAuctionSalesroomVO =new ForepartAuctionSalesroomVO();
         AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
-        auctionSalesroomVO.setAuctionSalesroomStatus(auctionSalesroom.getStatus().getCode());
+        forepartAuctionSalesroomVO.setAuctionSalesroomStatus(auctionSalesroom.getStatus().getCode());
         if (auctionVideo!=null){
-            auctionSalesroomVO.setUrl(auctionVideo.getPromotionVideoUrl());
+            forepartAuctionSalesroomVO.setUrl(auctionVideo.getPromotionVideoUrl());
         }else{
-            auctionSalesroomVO.setUrl(auctionSalesroom.getCoverPic());
+            forepartAuctionSalesroomVO.setUrl(auctionSalesroom.getCoverPic());
         }
 
-        return R.ok(auctionSalesroomVO);
+        return R.ok(forepartAuctionSalesroomVO);
     }
 
 
     @RequestMapping("/getAuctionBidRecordOne")
     @ResponseBody
     @ApiOperation(value = "扫码二维码获取拍卖场信息")
-    public R<AuctionSalesroom> getAuctionBidRecordOne(@PathVariable("auctionSalesroomQrcode") String auctionSalesroomQrcode) {
+    public R<AuctionSalesroom> getAuctionBidRecordOne(@RequestBody ForepartAuctionBidRecordDTO arepartAuctionBidRecordDTO) {
+
+        R<SysUser> r=sysUserClient.queryUserByPhone(arepartAuctionBidRecordDTO.getPhone());
+        SysUser sysUser=r.getData();
+
+        if (sysUser!=null){
+            R.fail("手机号未注册");
+        }
+
+        if (!sysUser.getPassword().equals(arepartAuctionBidRecordDTO.getPassword())){
+            R.fail("密码输入错误");
+        }
+
+        if (!sysUser.getUserType().equals("2")){
+            R.fail("该人员不是拍卖师");
+        }
+
         LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery();
-        wrapper.eq(AuctionSalesroom::getAuctionSalesroomQrcode,auctionSalesroomQrcode);
+        wrapper.eq(AuctionSalesroom::getAuctionSalesroomQrcode,arepartAuctionBidRecordDTO.getAuctionSalesroomQrcode());
         wrapper.eq(AuctionSalesroom::getDelFlag,0);
         AuctionSalesroom auctionBidRecord=iAuctionSalesroomService.getOne(wrapper);
+
         return R.ok(auctionBidRecord);
 
     }

--
Gitblit v1.7.1