|
@@ -7,13 +7,11 @@ import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.common.constant.SourceConstant;
|
|
|
import com.fjhx.common.enums.CodingRuleEnum;
|
|
|
import com.fjhx.common.service.coding.CodingRuleService;
|
|
|
-import com.fjhx.item.entity.product.po.ProductInfo;
|
|
|
import com.fjhx.item.entity.product.vo.ProductInfoVo;
|
|
|
import com.fjhx.item.service.product.ProductInfoService;
|
|
|
import com.fjhx.purchase.entity.purchase.po.Purchase;
|
|
@@ -32,6 +30,10 @@ import com.fjhx.purchase.service.purchase.PurchaseDetailService;
|
|
|
import com.fjhx.purchase.service.purchase.PurchaseService;
|
|
|
import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
|
|
|
import com.fjhx.purchase.service.subscribe.SubscribeService;
|
|
|
+import com.fjhx.supply.entity.supplier.po.SupplierInfo;
|
|
|
+import com.fjhx.supply.service.supplier.SupplierInfoService;
|
|
|
+import com.fjhx.wms.entity.warehouse.po.Warehouse;
|
|
|
+import com.fjhx.wms.service.warehouse.WarehouseService;
|
|
|
import com.ruoyi.common.core.domain.BaseIdPo;
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
@@ -61,217 +63,223 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
public class SubscribeServiceImpl extends ServiceImpl<SubscribeMapper, Subscribe> implements SubscribeService {
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private SubscribeDetailService subscribeDetailService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ProductInfoService productInfoService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ISysDeptService deptService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private CodingRuleService codingRuleService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private PurchaseService purchaseService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private PurchaseDetailService purchaseDetailService;
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public Page<SubscribeVo> getPage(SubscribeSelectDto dto) {
|
|
|
- IWrapper<Subscribe> wrapper = getWrapper();
|
|
|
-
|
|
|
-
|
|
|
- wrapper.in("s", Subscribe::getCompanyId, SecurityUtils.getCompanyIds());
|
|
|
- wrapper.eq("s", Subscribe::getCompanyId, dto.getCompanyId());
|
|
|
-
|
|
|
-
|
|
|
- wrapper.orderByDesc("s", Subscribe::getId);
|
|
|
- Page<SubscribeVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
- return page;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * 详情
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Override
|
|
|
- public SubscribeVo detail(Long id) {
|
|
|
- if (ObjectUtils.isEmpty(id)) {
|
|
|
- throw new ServiceException("参数异常");
|
|
|
- }
|
|
|
- Subscribe subscribe = this.getById(id);
|
|
|
- if (ObjectUtils.isEmpty(subscribe)) {
|
|
|
- throw new ServiceException("数据不存在");
|
|
|
- }
|
|
|
- SubscribeVo subscribeVo = BeanUtil.copyProperties(subscribe, SubscribeVo.class);
|
|
|
-
|
|
|
-
|
|
|
- List<SubscribeDetail> subscribeDetailList = subscribeDetailService.list(
|
|
|
- Wrappers.<SubscribeDetail>query().lambda()
|
|
|
- .eq(SubscribeDetail::getSubscribeId, id));
|
|
|
- List<SubscribeDetailVo> subscribeDetailVos = BeanUtil.copyToList(subscribeDetailList, SubscribeDetailVo.class);
|
|
|
- if (CollectionUtils.isNotEmpty(subscribeDetailList)) {
|
|
|
-
|
|
|
- List<Long> productIds = subscribeDetailList.stream().map(SubscribeDetail::getProductId).collect(Collectors.toList());
|
|
|
- List<ProductInfoVo> productInfoVos = productInfoService.getListByProductIds(productIds);
|
|
|
- Map<Long, List<ProductInfoVo>> productMap = productInfoVos.stream().collect(Collectors.groupingBy(ProductInfoVo::getId));
|
|
|
- for (SubscribeDetailVo s : subscribeDetailVos) {
|
|
|
- if (MapUtils.isNotEmpty(productMap)) {
|
|
|
- ProductInfoVo p = productMap.get(s.getProductId()).get(0);
|
|
|
- s.setProductCategory(p.getClassifyName());
|
|
|
- s.setProductCode(p.getCustomCode());
|
|
|
- s.setProductUnit(p.getUnit());
|
|
|
- s.setProductType(p.getType());
|
|
|
- s.setProductName(p.getName());
|
|
|
- s.setProductDefinition(p.getDefinition());
|
|
|
-
|
|
|
- s.setProductLength(p.getLength());
|
|
|
- s.setProductWidth(p.getWidth());
|
|
|
- s.setProductHeight(p.getHeight());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- subscribeVo.setSubscribeDetailList(subscribeDetailVos);
|
|
|
- return subscribeVo;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @DSTransactional
|
|
|
- @Override
|
|
|
- public void add(SubscribeDto subscribe) {
|
|
|
- SubscribeService subscribeService = SpringUtil.getBean(SubscribeService.class);
|
|
|
- SubscribeDetailService subscribeDetailService = SpringUtil.getBean(SubscribeDetailService.class);
|
|
|
- subscribe.setCode(codingRuleService.createCode(CodingRuleEnum.SUBSCRIBE.getKey(), null));
|
|
|
- subscribeService.save(subscribe);
|
|
|
- List<SubscribeDetail> SubscribeDetails = subscribe.getSubscribeDetailList();
|
|
|
- if (CollectionUtils.isNotEmpty(SubscribeDetails)) {
|
|
|
- for (SubscribeDetail s : SubscribeDetails) {
|
|
|
- s.setSubscribeId(subscribe.getId());
|
|
|
- }
|
|
|
- subscribeDetailService.saveBatch(subscribe.getSubscribeDetailList());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * 编辑
|
|
|
- *
|
|
|
- * @param subscribeDto
|
|
|
- */
|
|
|
- @DSTransactional
|
|
|
- @Override
|
|
|
- public void edit(SubscribeDto subscribeDto) {
|
|
|
- this.updateById(subscribeDto);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void delete(Long id) {
|
|
|
- this.removeById(id);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<SysDept> getDepts(SubscribeDetailSelectDto subscribeDetailDto) {
|
|
|
- List<Long> deptIds = new ArrayList<>();
|
|
|
- List<SubscribeDetail> list;
|
|
|
- String status = subscribeDetailDto.getStatus();
|
|
|
- if(ObjectUtils.isEmpty(status)){
|
|
|
- list = subscribeDetailService.list();
|
|
|
- } else {
|
|
|
- String[] split = status.split(",");
|
|
|
- list = subscribeDetailService.list(q -> q.in(SubscribeDetail::getStatus, split));
|
|
|
- }
|
|
|
- if (ObjectUtils.isEmpty(list)) {
|
|
|
- return new ArrayList<>();
|
|
|
- }
|
|
|
- List<Long> ids = list.stream().map(SubscribeDetail::getProductId).collect(Collectors.toList());
|
|
|
- List<ProductInfo> list1 = productInfoService.listByIds(ids);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (ObjectUtils.isEmpty(deptIds)) {
|
|
|
- return new ArrayList<>();
|
|
|
- }
|
|
|
- DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
- List<SysDept> sysDepts = deptService.listByIds(deptIds);
|
|
|
- DynamicDataSourceContextHolder.poll();
|
|
|
- return sysDepts;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public DecisionAidVo decisionAid(DecisionAidDto dto) {
|
|
|
- DecisionAidVo decisionAidVo = new DecisionAidVo();
|
|
|
-
|
|
|
- Long supplyId = dto.getSupplyId();
|
|
|
- if (supplyId != null) {
|
|
|
- List<Purchase> purchaseList = purchaseService.list(q -> q.eq(Purchase::getSupplyId, supplyId)
|
|
|
- .orderByDesc(BaseIdPo::getId).last("limit 3"));
|
|
|
- decisionAidVo.setPurchaseList(purchaseList);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- List<Long> productIdList = dto.getProductIdList();
|
|
|
- if (ObjectUtil.isNotEmpty(productIdList)) {
|
|
|
-
|
|
|
- Map<Long, List<PurchaseDetail>> map = purchaseDetailService.mapKGroup(PurchaseDetail::getBussinessId, q -> q
|
|
|
- .select(PurchaseDetail::getBussinessId, PurchaseDetail::getPrice)
|
|
|
- .in(PurchaseDetail::getBussinessId, productIdList)
|
|
|
- .orderByDesc(BaseIdPo::getId)
|
|
|
- );
|
|
|
-
|
|
|
- List<DecisionAidVo.ProductPrice> productPriceList = new ArrayList<>();
|
|
|
-
|
|
|
- for (Long productId : productIdList) {
|
|
|
- List<PurchaseDetail> contractProductList = map.get(productId);
|
|
|
- DecisionAidVo.ProductPrice productPrice = new DecisionAidVo.ProductPrice();
|
|
|
- productPrice.setId(productId);
|
|
|
- if (ObjectUtil.isNotEmpty(contractProductList)) {
|
|
|
- productPrice.setLastPrice(contractProductList.get(0).getPrice());
|
|
|
- productPrice.setMaxPrice(contractProductList.stream().map(PurchaseDetail::getPrice).max(BigDecimal::compareTo).get());
|
|
|
- productPrice.setMinPrice(contractProductList.stream().map(PurchaseDetail::getPrice).min(BigDecimal::compareTo).get());
|
|
|
- } else {
|
|
|
- productPrice.setLastPrice(BigDecimal.ZERO);
|
|
|
- productPrice.setMaxPrice(BigDecimal.ZERO);
|
|
|
- productPrice.setMinPrice(BigDecimal.ZERO);
|
|
|
- }
|
|
|
- productPriceList.add(productPrice);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- productInfoService.attributeAssign(productPriceList, DecisionAidVo.ProductPrice::getId, (item, product) -> {
|
|
|
- item.setName(product.getName());
|
|
|
- });
|
|
|
-
|
|
|
- decisionAidVo.setProductPriceList(productPriceList);
|
|
|
- } else {
|
|
|
- decisionAidVo.setProductPriceList(Collections.emptyList());
|
|
|
- }
|
|
|
-
|
|
|
- return decisionAidVo;
|
|
|
- }
|
|
|
+ private final SubscribeDetailService subscribeDetailService;
|
|
|
+ private final ProductInfoService productInfoService;
|
|
|
+ private final ISysDeptService deptService;
|
|
|
+ private final CodingRuleService codingRuleService;
|
|
|
+ private final PurchaseService purchaseService;
|
|
|
+ private final PurchaseDetailService purchaseDetailService;
|
|
|
+ private final WarehouseService warehouseService;
|
|
|
+ private final SupplierInfoService supplierInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public SubscribeServiceImpl(SubscribeDetailService subscribeDetailService, ProductInfoService productInfoService, ISysDeptService deptService, CodingRuleService codingRuleService, PurchaseService purchaseService, PurchaseDetailService purchaseDetailService, WarehouseService warehouseService, SupplierInfoService supplierInfoService) {
|
|
|
+ this.subscribeDetailService = subscribeDetailService;
|
|
|
+ this.productInfoService = productInfoService;
|
|
|
+ this.deptService = deptService;
|
|
|
+ this.codingRuleService = codingRuleService;
|
|
|
+ this.purchaseService = purchaseService;
|
|
|
+ this.purchaseDetailService = purchaseDetailService;
|
|
|
+ this.warehouseService = warehouseService;
|
|
|
+ this.supplierInfoService = supplierInfoService;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<SubscribeVo> getPage(SubscribeSelectDto dto) {
|
|
|
+ IWrapper<Subscribe> wrapper = getWrapper();
|
|
|
+
|
|
|
+
|
|
|
+ wrapper.in("s", Subscribe::getCompanyId, SecurityUtils.getCompanyIds());
|
|
|
+ wrapper.eq("s", Subscribe::getCompanyId, dto.getCompanyId());
|
|
|
+
|
|
|
+
|
|
|
+ wrapper.orderByDesc("s", Subscribe::getId);
|
|
|
+ Page<SubscribeVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 详情
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public SubscribeVo detail(Long id) {
|
|
|
+ if (ObjectUtils.isEmpty(id)) {
|
|
|
+ throw new ServiceException("参数异常");
|
|
|
+ }
|
|
|
+ Subscribe subscribe = this.getById(id);
|
|
|
+ if (ObjectUtils.isEmpty(subscribe)) {
|
|
|
+ throw new ServiceException("数据不存在");
|
|
|
+ }
|
|
|
+ SubscribeVo subscribeVo = BeanUtil.copyProperties(subscribe, SubscribeVo.class);
|
|
|
+
|
|
|
+
|
|
|
+ List<SubscribeDetail> subscribeDetailList = subscribeDetailService.list(q -> q.eq(SubscribeDetail::getSubscribeId, id));
|
|
|
+ List<SubscribeDetailVo> subscribeDetailVos = BeanUtil.copyToList(subscribeDetailList, SubscribeDetailVo.class);
|
|
|
+ if (CollectionUtils.isNotEmpty(subscribeDetailList)) {
|
|
|
+
|
|
|
+ List<Long> productIds = subscribeDetailList.stream().map(SubscribeDetail::getProductId).collect(Collectors.toList());
|
|
|
+ List<ProductInfoVo> productInfoVos = productInfoService.getListByProductIds(productIds);
|
|
|
+ Map<Long, List<ProductInfoVo>> productMap = productInfoVos.stream().collect(Collectors.groupingBy(ProductInfoVo::getId));
|
|
|
+ for (SubscribeDetailVo s : subscribeDetailVos) {
|
|
|
+ if (MapUtils.isNotEmpty(productMap)) {
|
|
|
+ ProductInfoVo p = productMap.get(s.getProductId()).get(0);
|
|
|
+ s.setProductCategory(p.getClassifyName());
|
|
|
+ s.setProductCode(p.getCustomCode());
|
|
|
+ s.setProductUnit(p.getUnit());
|
|
|
+ s.setProductType(p.getType());
|
|
|
+ s.setProductName(p.getName());
|
|
|
+ s.setProductDefinition(p.getDefinition());
|
|
|
+
|
|
|
+ s.setProductLength(p.getLength());
|
|
|
+ s.setProductWidth(p.getWidth());
|
|
|
+ s.setProductHeight(p.getHeight());
|
|
|
+
|
|
|
+ p.getColor();
|
|
|
+ p.getNetWeight();
|
|
|
+ p.getFrontalTexture();
|
|
|
+ p.getReverseTexture();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ subscribeVo.setSubscribeDetailList(subscribeDetailVos);
|
|
|
+
|
|
|
+
|
|
|
+ Warehouse warehouse = warehouseService.getById(subscribeVo.getPutWarehouseId());
|
|
|
+ if (ObjectUtil.isNotEmpty(warehouse)) {
|
|
|
+ subscribeVo.setPutWarehouseName(warehouse.getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ SupplierInfo supplierInfo = supplierInfoService.getById(subscribeVo.getSupplierId());
|
|
|
+ if (ObjectUtil.isNotEmpty(supplierInfo)) {
|
|
|
+ subscribeVo.setSupplierName(supplierInfo.getName());
|
|
|
+ subscribeVo.setSupplierContactPerson(supplierInfo.getContactPerson());
|
|
|
+ subscribeVo.setSupplierContactNumber(supplierInfo.getContactNumber());
|
|
|
+ subscribeVo.setSupplierPrivIncludingTax(supplierInfo.getPrivIncludingTax());
|
|
|
+ subscribeVo.setSupplierPrivTaxPoints(supplierInfo.getPrivTaxPoints());
|
|
|
+ }
|
|
|
+
|
|
|
+ SysDept sysDept = deptService.getById(subscribeVo.getDeptId());
|
|
|
+ if (ObjectUtil.isNotEmpty(sysDept)) {
|
|
|
+ subscribeVo.setDeptName(sysDept.getDeptName());
|
|
|
+ }
|
|
|
+
|
|
|
+ SysDept company = deptService.getById(subscribeVo.getDeptId());
|
|
|
+ if (ObjectUtil.isNotEmpty(company)) {
|
|
|
+ subscribeVo.setCompanyName(company.getDeptName());
|
|
|
+ }
|
|
|
+
|
|
|
+ return subscribeVo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @DSTransactional
|
|
|
+ @Override
|
|
|
+ public void add(SubscribeDto subscribe) {
|
|
|
+ SubscribeService subscribeService = SpringUtil.getBean(SubscribeService.class);
|
|
|
+ SubscribeDetailService subscribeDetailService = SpringUtil.getBean(SubscribeDetailService.class);
|
|
|
+ subscribe.setCode(codingRuleService.createCode(CodingRuleEnum.SUBSCRIBE.getKey(), null));
|
|
|
+ subscribeService.save(subscribe);
|
|
|
+ List<SubscribeDetail> SubscribeDetails = subscribe.getSubscribeDetailList();
|
|
|
+ if (CollectionUtils.isNotEmpty(SubscribeDetails)) {
|
|
|
+ for (SubscribeDetail s : SubscribeDetails) {
|
|
|
+ s.setSubscribeId(subscribe.getId());
|
|
|
+ }
|
|
|
+ subscribeDetailService.saveBatch(subscribe.getSubscribeDetailList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 编辑
|
|
|
+ *
|
|
|
+ * @param subscribeDto
|
|
|
+ */
|
|
|
+ @DSTransactional
|
|
|
+ @Override
|
|
|
+ public void edit(SubscribeDto subscribeDto) {
|
|
|
+ this.updateById(subscribeDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void delete(Long id) {
|
|
|
+ this.removeById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<SysDept> getDepts(SubscribeDetailSelectDto subscribeDetailDto) {
|
|
|
+ List<Long> deptIds = new ArrayList<>();
|
|
|
+ List<SubscribeDetail> list;
|
|
|
+ String status = subscribeDetailDto.getStatus();
|
|
|
+ if (ObjectUtils.isEmpty(status)) {
|
|
|
+ list = subscribeDetailService.list();
|
|
|
+ } else {
|
|
|
+ String[] split = status.split(",");
|
|
|
+ list = subscribeDetailService.list(q -> q.in(SubscribeDetail::getStatus, split));
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isEmpty(list)) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isEmpty(deptIds)) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
+ List<SysDept> sysDepts = deptService.listByIds(deptIds);
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
+ return sysDepts;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public DecisionAidVo decisionAid(DecisionAidDto dto) {
|
|
|
+ DecisionAidVo decisionAidVo = new DecisionAidVo();
|
|
|
+
|
|
|
+ Long supplyId = dto.getSupplyId();
|
|
|
+ if (supplyId != null) {
|
|
|
+ List<Purchase> purchaseList = purchaseService.list(q -> q.eq(Purchase::getSupplyId, supplyId)
|
|
|
+ .orderByDesc(BaseIdPo::getId).last("limit 3"));
|
|
|
+ decisionAidVo.setPurchaseList(purchaseList);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<Long> productIdList = dto.getProductIdList();
|
|
|
+ if (ObjectUtil.isNotEmpty(productIdList)) {
|
|
|
+
|
|
|
+ Map<Long, List<PurchaseDetail>> map = purchaseDetailService.mapKGroup(PurchaseDetail::getBussinessId, q -> q
|
|
|
+ .select(PurchaseDetail::getBussinessId, PurchaseDetail::getPrice)
|
|
|
+ .in(PurchaseDetail::getBussinessId, productIdList)
|
|
|
+ .orderByDesc(BaseIdPo::getId)
|
|
|
+ );
|
|
|
+
|
|
|
+ List<DecisionAidVo.ProductPrice> productPriceList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (Long productId : productIdList) {
|
|
|
+ List<PurchaseDetail> contractProductList = map.get(productId);
|
|
|
+ DecisionAidVo.ProductPrice productPrice = new DecisionAidVo.ProductPrice();
|
|
|
+ productPrice.setId(productId);
|
|
|
+ if (ObjectUtil.isNotEmpty(contractProductList)) {
|
|
|
+ productPrice.setLastPrice(contractProductList.get(0).getPrice());
|
|
|
+ productPrice.setMaxPrice(contractProductList.stream().map(PurchaseDetail::getPrice).max(BigDecimal::compareTo).get());
|
|
|
+ productPrice.setMinPrice(contractProductList.stream().map(PurchaseDetail::getPrice).min(BigDecimal::compareTo).get());
|
|
|
+ } else {
|
|
|
+ productPrice.setLastPrice(BigDecimal.ZERO);
|
|
|
+ productPrice.setMaxPrice(BigDecimal.ZERO);
|
|
|
+ productPrice.setMinPrice(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ productPriceList.add(productPrice);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ productInfoService.attributeAssign(productPriceList, DecisionAidVo.ProductPrice::getId, (item, product) -> {
|
|
|
+ item.setName(product.getName());
|
|
|
+ });
|
|
|
+
|
|
|
+ decisionAidVo.setProductPriceList(productPriceList);
|
|
|
+ } else {
|
|
|
+ decisionAidVo.setProductPriceList(Collections.emptyList());
|
|
|
+ }
|
|
|
+
|
|
|
+ return decisionAidVo;
|
|
|
+ }
|
|
|
|
|
|
}
|