diff --git a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/PlanSearchItemVO.java b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/PlanSearchItemVO.java index 6743ffb4..acf626f7 100644 --- a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/PlanSearchItemVO.java +++ b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/PlanSearchItemVO.java @@ -2,6 +2,8 @@ package com.nflg.mobilebroken.common.pojo.vo; import com.nflg.mobilebroken.common.util.NumberUtil; import lombok.Data; +import lombok.experimental.Accessors; +import org.springframework.data.annotation.AccessType; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -9,6 +11,7 @@ import java.math.BigDecimal; import java.util.Objects; @Data +@Accessors(chain = true) public class PlanSearchItemVO { private Long id; diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/PlanController.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/PlanController.java index 0625e552..f3d6ed34 100644 --- a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/PlanController.java +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/PlanController.java @@ -137,7 +137,7 @@ public class PlanController extends ControllerBase { boolean multiRegionQuotations = isMultiRegionQuotationsUser(); List categoryIds = new ArrayList<>(); if (multiRegionQuotations) { - categoryIds = dictionaryItemService.getListByDictionaryCode("MultiRegionQuotationsSupplier") + categoryIds = dictionaryItemService.getListByDictionaryCode("DirectSalesCategory") .stream() .map(DictionaryItem::getId) .collect(Collectors.toList()); @@ -146,6 +146,7 @@ public class PlanController extends ControllerBase { } List prices = priceService.getAllModelPrice(); Map> fgroup = items.stream().collect(Collectors.groupingBy(PlanSearchItemVO::getModelId)); + pageData.setTotal(fgroup.size()); for (Map.Entry> entry : fgroup.entrySet()) { if (index >= startIndex && index < endIndex) { categoryIds.forEach(categoryId -> { @@ -156,14 +157,30 @@ public class PlanController extends ControllerBase { .collect(Collectors.toList()); if (CollectionUtil.isEmpty(vos)) { entry.getValue().forEach(item -> { - item.setStandardPrice(salePrice); - item.setAreaId(categoryId); - datas.add(item); + datas.add(new PlanSearchItemVO() + .setPlanId(item.getPlanId()) + .setIsDefault(item.getIsDefault()) + .setModelId(item.getModelId()) + .setModelNo(item.getModelNo()) + .setName(item.getName()) + .setRatio(item.getRatio()) + .setAreaId(categoryId) + .setStandardPrice(salePrice) + ); }); } else { vos.forEach(item -> { - item.setStandardPrice(salePrice); - datas.add(item); + datas.add(new PlanSearchItemVO() + .setId(item.getId()) + .setPlanId(item.getPlanId()) + .setIsDefault(item.getIsDefault()) + .setModelId(item.getModelId()) + .setModelNo(item.getModelNo()) + .setName(item.getName()) + .setRatio(item.getRatio()) + .setAreaId(categoryId) + .setStandardPrice(salePrice) + ); }); } });