From 31267d9b3a33c8b3fbb1b9f810ab08e01c49b846 Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期二, 16 七月 2024 19:12:28 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionGoodsServiceImpl.java |   37 ++++++++++++++++++++++++++++---------
 1 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionGoodsServiceImpl.java b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionGoodsServiceImpl.java
index 42d9475..8b60268 100644
--- a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionGoodsServiceImpl.java
+++ b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionGoodsServiceImpl.java
@@ -274,13 +274,17 @@
                         .collect(Collectors.toSet());
                 List<Member> memberList = memberClient.
                         getMemberListByIds(collect, SecurityConstants.INNER).getData();
-                Map<Long, String> memberMap = memberList.stream()
-                        .collect(Collectors.toMap(Member::getId, Member::getNickname));
+                Map<Long, Member> memberMap = memberList.stream()
+                        .collect(Collectors.toMap(Member::getId, e -> e));
                 List<MgtAuctionBidRecordVO> mgtAuctionBidRecordVOS = BeanUtils.copyList(list,
                         MgtAuctionBidRecordVO.class);
                 for (MgtAuctionBidRecordVO vo : mgtAuctionBidRecordVOS) {
-                    String memberName = memberMap.get(vo.getMemberId());
-                    vo.setMemberName(StringUtils.isNotEmpty(memberName) ? memberName : "");
+                    Member member = memberMap.get(vo.getMemberId());
+                    if (StringUtils.isNotNull(member)) {
+                        vo.setMemberName(member.getNickname());
+                        vo.setPhone(member.getPhone());
+                    }
+
                 }
                 auctionGoodsVO.setRecordList(mgtAuctionBidRecordVOS);
             }
@@ -302,6 +306,10 @@
         if (StringUtils.isNull(auctionGoods)) {
             throw new ServiceException("拍卖商品不存在");
         }
+        // 远程调用商品服务,获取商品信息
+        GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(auctionGoods.getGoodsSkuId(),
+                        SecurityConstants.INNER)
+                .getData();
         if (auctionGoods.getStartStatus().equals(AuctionStartStatusEnum.IN_AUCTION)) {
             // 查询出价记录
             List<AuctionBidRecord> auctionBidRecords = auctionBidRecordService.getBidRecordByGoodsId(
@@ -325,7 +333,7 @@
                 OrderDTO orderDTO = new OrderDTO();
                 orderDTO.setAuctionType(AuctionOrderTypeEnum.REGULAR_ITEMS);
                 orderDTO.setGoodsQuantity(auctionGoods.getAuctionStock());
-                orderDTO.setGoodsSkuId(auctionGoods.getGoodsSkuId());
+                orderDTO.setGoodsSkuId(auctionGoods.getId());
                 orderDTO.setBound(auctionGoods.getBond());
                 orderDTO.setMemberId(auctionBidRecord.getMemberId());
                 orderDTO.setTotalAmount(auctionBidRecord.getLastBidAmount());
@@ -340,6 +348,11 @@
                     orderDTO.setReceiverCity(data.getReceiverCity());
                     orderDTO.setReceiverDetailAddress(data.getDetailedAddress());
                     orderDTO.setReceiverphone(data.getRecipientPhone());
+                }
+                if (StringUtils.isNotNull(goodsSku)) {
+                    orderDTO.setCoverPic(goodsSku.getCoverPic());
+                    orderDTO.setPrice(goodsSku.getPrice());
+                    orderDTO.setSkuName(goodsSku.getSkuName());
                 }
                 orderClient.saveOrderOne(orderDTO, SecurityConstants.INNER);
             } else {
@@ -453,6 +466,7 @@
         auctionGoodsinfoVO.setUnit(goodsSkuOne.getUnit());
         auctionGoodsinfoVO.setBond(byId.getBond());
         auctionGoodsinfoVO.setDescription(goodsSkuOne.getDescription());
+        auctionGoodsinfoVO.setExplain(byId.getDescription());
         auctionGoodsinfoVO.setYears(goodsSkuOne.getYears());
         GoodsBrand data = goodsSkuClient.getBrandOne(goodsSkuOne.getBrandId(), SecurityConstants.INNER).getData();
         GoodsCategory data1 = goodsSkuClient.getCategoryOne(goodsSkuOne.getCategoryId(), SecurityConstants.INNER).getData();
@@ -557,8 +571,8 @@
         }
 
 
-        CustomConfig returnAddressUserName = sysUserClient.getconfig("MALL_ORDER_DESCRIPTION").getData();
-        auctionGoodsinfoVO.setExplain(returnAddressUserName.getConfigValue());
+        /*CustomConfig returnAddressUserName = sysUserClient.getconfig("MALL_ORDER_DESCRIPTION").getData();
+        auctionGoodsinfoVO.setExplain(returnAddressUserName.getConfigValue());*/
 
 
         List<getHomeGoodsSkuXxiVO> homeGoodsSkuXxiVOS=new ArrayList<>();
@@ -582,7 +596,7 @@
         List<OrderAuctionBond> data = orderClient.getAuctionGoodsOrderAuctionBondList(auctionGoodsListDTO, SecurityConstants.INNER).getData();
         Set<Long> goodsSkuIdList = null;
         if (data.size()>0){
-            goodsSkuIdList = data.stream().map(OrderAuctionBond::getAuctionSalesroomId)
+            goodsSkuIdList = data.stream().map(OrderAuctionBond::getAuctionGoodsId)
                     .collect(Collectors.toSet());
         }else {
             Set<Long> goodsSkuIdList1 =new HashSet<>();
@@ -596,7 +610,12 @@
         }
 
         if (auctionGoodsListDTO.getStartStatus()!=4){
-            auctionGoodsListPageDTO.setStartStatus(auctionGoodsListDTO.getStartStatus());
+            if (auctionGoodsListDTO.getStartStatus()==0){
+                auctionGoodsListPageDTO.setStartStatus(5);
+            }else{
+                auctionGoodsListPageDTO.setStartStatus(auctionGoodsListDTO.getStartStatus());
+            }
+
         }
 
         Page<AuctionGoodsListVO> page = new Page<>();

--
Gitblit v1.7.1