|
|
@@ -34,19 +34,27 @@ public class CmsGoodsDonServiceImpl extends ServiceImpl<GoodsDonMapper, GoodsDon
|
|
|
.build());
|
|
|
if (!skuViews.isEmpty()) {
|
|
|
GoodsDonSkuFrontView min = skuViews.get(0);
|
|
|
+ goods.setMinPrice(min.getPrice());
|
|
|
+ if (min.getDays() == null) {
|
|
|
+ min.setDays(0);
|
|
|
+ }
|
|
|
+ if (min.getMonths() == null) {
|
|
|
+ min.setMonths(0);
|
|
|
+ }
|
|
|
+ goods.setMinMonths(min.getMonths());
|
|
|
+ goods.setMinDays(min.getDays());
|
|
|
if (skuViews.size() == 1) {
|
|
|
- goods.setMinPrice(min.getPrice());
|
|
|
- goods.setMinMonths(min.getMonths());
|
|
|
- goods.setMinDays(min.getDays());
|
|
|
-
|
|
|
goods.setMaxPrice(min.getPrice());
|
|
|
goods.setMaxMonths(min.getMonths());
|
|
|
+ goods.setMaxDays(min.getDays());
|
|
|
} else {
|
|
|
GoodsDonSkuFrontView max = skuViews.get(skuViews.size() - 1);
|
|
|
- goods.setMinPrice(min.getPrice());
|
|
|
- goods.setMinMonths(min.getMonths());
|
|
|
- goods.setMinDays(min.getDays());
|
|
|
-
|
|
|
+ if (max.getDays() == null) {
|
|
|
+ max.setDays(0);
|
|
|
+ }
|
|
|
+ if (max.getMonths() == null) {
|
|
|
+ max.setMonths(0);
|
|
|
+ }
|
|
|
goods.setMaxPrice(max.getPrice());
|
|
|
goods.setMaxMonths(max.getMonths());
|
|
|
goods.setMaxDays(max.getDays());
|