Authored by mali

价格走势

... ... @@ -13,8 +13,18 @@ public class PriceTrendModel {
private BigDecimal skuPrice;
public Integer getEndTime() {
return endTime;
}
public void setEndTime(Integer endTime) {
this.endTime = endTime;
}
private Integer createTime;
private Integer endTime;
public Integer getId() {
return id;
}
... ...
... ... @@ -18,6 +18,16 @@ public class PriceTrendResp {
private String createTime;
private String endTime;
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public Integer getId() {
return id;
}
... ... @@ -81,6 +91,16 @@ public class PriceTrendResp {
private String createTime;
private String endTime;
public String getEndTime() {
return endTime;
}
public Builder setEndTime(String endTime) {
this.endTime = endTime;
return this;
}
public PriceTrendResp build() {
PriceTrendResp resp = new PriceTrendResp();
... ... @@ -89,6 +109,7 @@ public class PriceTrendResp {
resp.setSizeId(this.sizeId);
resp.setProductId(this.productId);
resp.setCreateTime(this.createTime);
resp.setEndTime(this.endTime);
return resp;
}
... ...
... ... @@ -60,6 +60,7 @@ public class ProductPriceService implements ApplicationContextAware{
.setSknPrice(item.getSknPrice())
.setSkuPrice(item.getSkuPrice())
.setCreateTime(DateUtil.getDateFormatEx(item.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS))
.setEndTime(DateUtil.getDateFormatEx(item.getEndTime(), DateUtil.yyyy_MM_dd_HH_mm_SS))
.build())
);
... ...
... ... @@ -29,7 +29,11 @@ public class PriceTrendDayService implements PriceTrendServiceInf{
LOG.info("method priceTrendDayMapper.selectByProductId in, productId:{},sizeId:{},currentSecond:{},tomorrowSecond:{}", productId, sizeId, currentSecond, tomorrowSecond);
return priceTrendDayMapper.selectByProductId(productId, sizeId, currentSecond, tomorrowSecond);
List<PriceTrendModel> priceTrendModels = priceTrendDayMapper.selectByProductId(productId, sizeId, currentSecond, tomorrowSecond);
priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 7200 + item.getCreateTime()));
return priceTrendModels;
}
return Lists.newArrayList();
... ...
... ... @@ -19,7 +19,13 @@ public class PriceTrendHalfYearService implements PriceTrendServiceInf{
public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) {
if (null != productId) {
return priceTrendHalfYearMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-180), DateUtil.getTimeSecondOfDay(0));
List<PriceTrendModel> priceTrendModels = priceTrendHalfYearMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-180), DateUtil.getTimeSecondOfDay(0));
priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 259200 + item.getCreateTime()));
return priceTrendModels;
}
return Lists.newArrayList();
... ...
... ... @@ -21,7 +21,11 @@ public class PriceTrendMonthService implements PriceTrendServiceInf{
public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) {
if (null != productId) {
return priceTrendMonthMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0));
List<PriceTrendModel> priceTrendModels = priceTrendMonthMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0));
priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 43200 + item.getCreateTime()));
return priceTrendModels;
}
return Lists.newArrayList();
... ...
... ... @@ -19,7 +19,9 @@ public class PriceTrendSixtyDayService implements PriceTrendServiceInf{
public List<PriceTrendModel> queryProductPriceTrend(Integer productId, Integer sizeId) {
if (null != productId) {
return priceTrendSixtyDayMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0));
List<PriceTrendModel> priceTrendModels = priceTrendSixtyDayMapper.selectByProductId(productId, sizeId, DateUtil.getTimeSecondOfDay(-30), DateUtil.getTimeSecondOfDay(0));
priceTrendModels.stream().forEach(item -> item.setEndTime(null == item.getCreateTime() ? null : 86400 + item.getCreateTime()));
return priceTrendModels;
}
return Lists.newArrayList();
... ...