Bläddra i källkod

我的收藏-新增起拍价格

jintao.geng 4 dagar sedan
förälder
incheckning
2c7bf03c75

+ 7 - 2
lot/src/main/java/cn/hobbystocks/auc/response/LotFansResponse.java

@@ -1,5 +1,6 @@
 package cn.hobbystocks.auc.response;
 
+import cn.hobbystocks.auc.annotation.View;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -55,10 +56,10 @@ public class LotFansResponse {
     private Long auctionId;
 
     @ApiModelProperty("起拍价")
-    private BigDecimal startPrice;
+    private String startPrice;
 
     @ApiModelProperty("当前价")
-    private BigDecimal currentPrice;
+    private String currentPrice;
 
     @ApiModelProperty("拍品数量")
     private Long num;
@@ -80,4 +81,8 @@ public class LotFansResponse {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty("收藏时间")
     private Date createTime;
+
+    /** 规则内容 */
+    @ApiModelProperty("规则内容")
+    private String ruleContent;
 }

+ 11 - 0
lot/src/main/java/cn/hobbystocks/auc/service/impl/LotFansServiceImpl.java

@@ -4,9 +4,11 @@ import cn.hobbystocks.auc.common.exception.ServiceException;
 import cn.hobbystocks.auc.common.user.UserInfo;
 import cn.hobbystocks.auc.common.user.UserUtils;
 import cn.hobbystocks.auc.common.utils.DateUtils;
+import cn.hobbystocks.auc.common.utils.StringUtils;
 import cn.hobbystocks.auc.convert.LotConvert;
 import cn.hobbystocks.auc.domain.Lot;
 import cn.hobbystocks.auc.domain.LotFans;
+import cn.hobbystocks.auc.handle.context.tradition.TraditionRule;
 import cn.hobbystocks.auc.mapper.LotFansMapper;
 import cn.hobbystocks.auc.request.LotFansTogglePageRequest;
 import cn.hobbystocks.auc.request.LotFansToggleRequest;
@@ -14,6 +16,7 @@ import cn.hobbystocks.auc.response.LotFansResponse;
 import cn.hobbystocks.auc.service.ILotService;
 import cn.hobbystocks.auc.service.LotFansService;
 import cn.hobbystocks.auc.vo.FansVO;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
@@ -166,7 +169,15 @@ public class LotFansServiceImpl  implements LotFansService {
         if (CollectionUtils.isEmpty(lotList)) {
             return Lists.newArrayList();
         }
+
         List<LotFansResponse> lotFansResponses = lotList.stream().map(LotConvert.INSTANCE::toLotFansResponse).collect(Collectors.toList());
+        for (LotFansResponse lotFansRespons : lotFansResponses) {
+            // 起拍价
+            if (StringUtils.isNotEmpty(lotFansRespons.getRuleContent())) {
+                TraditionRule traditionRule = JSON.parseObject(lotFansRespons.getRuleContent(), TraditionRule.class);
+                lotFansRespons.setStartPrice(String.valueOf(traditionRule.getStartPrice()));
+            }
+        }
         return lotFansResponses;
     }
 }