Authored by mali

价格走势

@@ -13,8 +13,18 @@ public class PriceTrendModel { @@ -13,8 +13,18 @@ public class PriceTrendModel {
13 13
14 private BigDecimal skuPrice; 14 private BigDecimal skuPrice;
15 15
  16 + public Integer getEndTime() {
  17 + return endTime;
  18 + }
  19 +
  20 + public void setEndTime(Integer endTime) {
  21 + this.endTime = endTime;
  22 + }
  23 +
16 private Integer createTime; 24 private Integer createTime;
17 25
  26 + private Integer endTime;
  27 +
18 public Integer getId() { 28 public Integer getId() {
19 return id; 29 return id;
20 } 30 }
@@ -18,6 +18,16 @@ public class PriceTrendResp { @@ -18,6 +18,16 @@ public class PriceTrendResp {
18 18
19 private String createTime; 19 private String createTime;
20 20
  21 + private String endTime;
  22 +
  23 + public String getEndTime() {
  24 + return endTime;
  25 + }
  26 +
  27 + public void setEndTime(String endTime) {
  28 + this.endTime = endTime;
  29 + }
  30 +
21 public Integer getId() { 31 public Integer getId() {
22 return id; 32 return id;
23 } 33 }
@@ -81,6 +91,16 @@ public class PriceTrendResp { @@ -81,6 +91,16 @@ public class PriceTrendResp {
81 91
82 private String createTime; 92 private String createTime;
83 93
  94 + private String endTime;
  95 +
  96 + public String getEndTime() {
  97 + return endTime;
  98 + }
  99 +
  100 + public Builder setEndTime(String endTime) {
  101 + this.endTime = endTime;
  102 + return this;
  103 + }
84 104
85 public PriceTrendResp build() { 105 public PriceTrendResp build() {
86 PriceTrendResp resp = new PriceTrendResp(); 106 PriceTrendResp resp = new PriceTrendResp();
@@ -89,6 +109,7 @@ public class PriceTrendResp { @@ -89,6 +109,7 @@ public class PriceTrendResp {
89 resp.setSizeId(this.sizeId); 109 resp.setSizeId(this.sizeId);
90 resp.setProductId(this.productId); 110 resp.setProductId(this.productId);
91 resp.setCreateTime(this.createTime); 111 resp.setCreateTime(this.createTime);
  112 + resp.setEndTime(this.endTime);
92 return resp; 113 return resp;
93 } 114 }
94 115
@@ -60,6 +60,7 @@ public class ProductPriceService implements ApplicationContextAware{ @@ -60,6 +60,7 @@ public class ProductPriceService implements ApplicationContextAware{
60 .setSknPrice(item.getSknPrice()) 60 .setSknPrice(item.getSknPrice())
61 .setSkuPrice(item.getSkuPrice()) 61 .setSkuPrice(item.getSkuPrice())
62 .setCreateTime(DateUtil.getDateFormatEx(item.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS)) 62 .setCreateTime(DateUtil.getDateFormatEx(item.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS))
  63 + .setEndTime(DateUtil.getDateFormatEx(item.getEndTime(), DateUtil.yyyy_MM_dd_HH_mm_SS))
63 .build()) 64 .build())
64 ); 65 );
65 66
@@ -29,7 +29,11 @@ public class PriceTrendDayService implements PriceTrendServiceInf{ @@ -29,7 +29,11 @@ public class PriceTrendDayService implements PriceTrendServiceInf{
29 29
30 LOG.info("method priceTrendDayMapper.selectByProductId in, productId:{},sizeId:{},currentSecond:{},tomorrowSecond:{}", productId, sizeId, currentSecond, tomorrowSecond); 30 LOG.info("method priceTrendDayMapper.selectByProductId in, productId:{},sizeId:{},currentSecond:{},tomorrowSecond:{}", productId, sizeId, currentSecond, tomorrowSecond);
31 31
32 - return priceTrendDayMapper.selectByProductId(productId, sizeId, currentSecond, tomorrowSecond); 32 + List<PriceTrendModel> priceTrendModels = priceTrendDayMapper.selectByProductId(productId, sizeId, currentSecond, tomorrowSecond);
  33 +
  34 + priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 7200 + item.getCreateTime()));
  35 +
  36 + return priceTrendModels;
33 } 37 }
34 38
35 return Lists.newArrayList(); 39 return Lists.newArrayList();
@@ -19,7 +19,13 @@ public class PriceTrendHalfYearService implements PriceTrendServiceInf{ @@ -19,7 +19,13 @@ public class PriceTrendHalfYearService implements PriceTrendServiceInf{
19 19
20 public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) { 20 public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) {
21 if (null != productId) { 21 if (null != productId) {
22 - return priceTrendHalfYearMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-180), DateUtil.getTimeSecondOfDay(0)); 22 + List<PriceTrendModel> priceTrendModels = priceTrendHalfYearMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-180), DateUtil.getTimeSecondOfDay(0));
  23 +
  24 + priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 259200 + item.getCreateTime()));
  25 +
  26 + return priceTrendModels;
  27 +
  28 +
23 } 29 }
24 30
25 return Lists.newArrayList(); 31 return Lists.newArrayList();
@@ -21,7 +21,11 @@ public class PriceTrendMonthService implements PriceTrendServiceInf{ @@ -21,7 +21,11 @@ public class PriceTrendMonthService implements PriceTrendServiceInf{
21 21
22 public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) { 22 public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) {
23 if (null != productId) { 23 if (null != productId) {
24 - return priceTrendMonthMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0)); 24 + List<PriceTrendModel> priceTrendModels = priceTrendMonthMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0));
  25 +
  26 + priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 43200 + item.getCreateTime()));
  27 +
  28 + return priceTrendModels;
25 } 29 }
26 30
27 return Lists.newArrayList(); 31 return Lists.newArrayList();
@@ -19,7 +19,9 @@ public class PriceTrendSixtyDayService implements PriceTrendServiceInf{ @@ -19,7 +19,9 @@ public class PriceTrendSixtyDayService implements PriceTrendServiceInf{
19 19
20 public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) { 20 public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) {
21 if (null != productId) { 21 if (null != productId) {
22 - return priceTrendSixtyDayMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0)); 22 + List<PriceTrendModel> priceTrendModels = priceTrendSixtyDayMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0));
  23 + priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 86400 + item.getCreateTime()));
  24 + return priceTrendModels;
23 } 25 }
24 26
25 return Lists.newArrayList(); 27 return Lists.newArrayList();