...
|
...
|
@@ -134,6 +134,26 @@ public class ChannelSkuCompareServiceImpl implements IChannelSkuCompareService, |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int updateSuggestRate(ChannelSkuCompareReq req) {
|
|
|
if(null == req.getId()) {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
ChannelSkuCompare csc = channelSkuCompareMapper.selectById(req.getId());
|
|
|
if(null == csc) {
|
|
|
LOGGER.error("id not exist! id is {}", req.getId());
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
BigDecimal lowRate = null == req.getSuggestLowRate() ? csc.getLowRate() : req.getSuggestLowRate();
|
|
|
BigDecimal highRate = null == req.getSuggestHighRate() ? csc.getHighRate() : req.getSuggestHighRate();
|
|
|
|
|
|
//更新比例
|
|
|
return channelSkuCompareMapper.updateRateById(req.getId(), lowRate, highRate);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Class getDataClass() {
|
|
|
return ChannelSkuCompareRspBo.class;
|
|
|
}
|
...
|
...
|
@@ -174,8 +194,8 @@ public class ChannelSkuCompareServiceImpl implements IChannelSkuCompareService, |
|
|
bo.setSizeName(sizeIdNameMap.get(csc.getSizeId()));
|
|
|
bo.setChannelPrice(getFormatPrice(csc.getChannelPrice()));
|
|
|
bo.setChannelUrl(csc.getChannelUrl());
|
|
|
bo.setLowRate(csc.getLowRate().multiply(BigDecimal.valueOf(100)) + "%");
|
|
|
bo.setHighRate(csc.getHighRate().multiply(BigDecimal.valueOf(100)) + "%");
|
|
|
bo.setLowRate(csc.getLowRate());
|
|
|
bo.setHighRate(csc.getHighRate());
|
|
|
BigDecimal channelLowPrice = csc.getChannelPrice().multiply(BigDecimal.valueOf(1).subtract(csc.getLowRate()));
|
|
|
BigDecimal channelHighPrice = csc.getChannelPrice().multiply(BigDecimal.valueOf(1).add(csc.getHighRate()));
|
|
|
bo.setChannelPriceRange(getFormatPrice(channelLowPrice) + "~" + getFormatPrice(channelHighPrice));
|
...
|
...
|
|