Browse Source

对内,对外报价单列表添加历史版本

yzc 1 year ago
parent
commit
af4707961d

+ 10 - 0
hx-sale/src/main/java/com/fjhx/sale/controller/ext/ExtQuotationController.java

@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -84,5 +86,13 @@ public class ExtQuotationController {
         extQuotationService.cancellation(dto.getId());
     }
 
+    /**
+     * 获取报价单历史版本
+     */
+    @PostMapping("/getVersionList")
+    List<ExtQuotationVo> getVersionList(@RequestBody ExtQuotationSelectDto dto) {
+        return extQuotationService.getVersionList(dto.getId());
+    }
+
 
 }

+ 9 - 1
hx-sale/src/main/java/com/fjhx/sale/controller/sale/SaleQuotationController.java

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
 import java.util.Map;
 
 
@@ -155,9 +156,16 @@ public class SaleQuotationController {
      * 趋势分析(客户分析)
      */
     @PostMapping("/trendAnalysis")
-    public  Map<String,Object> trendAnalysis(@RequestBody CustomerDto dto){
+    public Map<String, Object> trendAnalysis(@RequestBody CustomerDto dto) {
         return saleQuotationService.trendAnalysis(dto);
     }
 
+    /**
+     * 获取报价单历史版本
+     */
+    @PostMapping("/getVersionList")
+    List<SaleQuotationVo> getVersionList(@RequestBody CustomerSelectDto dto) {
+        return saleQuotationService.getVersionList(dto.getId());
+    }
 
 }

+ 7 - 0
hx-sale/src/main/java/com/fjhx/sale/service/ext/ExtQuotationService.java

@@ -7,6 +7,8 @@ import com.fjhx.sale.entity.ext.po.ExtQuotation;
 import com.fjhx.sale.entity.ext.vo.ExtQuotationVo;
 import com.ruoyi.common.core.service.BaseService;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -46,4 +48,9 @@ public interface ExtQuotationService extends BaseService<ExtQuotation> {
     void changeSaleQuotation(ExtQuotationDto saleQuotationDto);
 
     void cancellation(Long id);
+
+    /**
+     * 获取报价单历史版本
+     */
+    List<ExtQuotationVo> getVersionList(Long extQuotationId);
 }

+ 150 - 52
hx-sale/src/main/java/com/fjhx/sale/service/ext/impl/ExtQuotationServiceImpl.java

@@ -11,7 +11,6 @@ import com.fjhx.area.utils.CustomizeAreaUtil;
 import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.utils.Assert;
 import com.fjhx.common.utils.Utils;
-import com.fjhx.customer.entity.customer.po.Customer;
 import com.fjhx.customer.service.customer.CustomerService;
 import com.fjhx.item.service.product.ProductInfoService;
 import com.fjhx.sale.entity.ext.dto.ExtQuotationDto;
@@ -151,58 +150,61 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
         if (ObjectUtil.isEmpty(result)) {
             throw new ServiceException("查询不到明细信息请检查");
         }
-        //赋值买方公司名称(客户)
-        Customer customer = customerService.getById(result.getBuyCorporationId());
-        if (ObjectUtil.isNotEmpty(customer)) {
-            result.setBuyCorporationName(customer.getName());
-        }
-
-        //赋值买方公司地址
-        setArea(result);
-        //查询报价-商品表的详情
-        List<ExtQuotationProduct> quotationProductList = extQuotationProductService.list(Wrappers.<ExtQuotationProduct>lambdaQuery()
-                .eq(ExtQuotationProduct::getSaleQuotationId, result.getId()));
 
-        List<ExtQuotationProductVo> quotationProductVos = BeanUtil.copyToList(quotationProductList, ExtQuotationProductVo.class);
-        //赋值产品信息
-        productInfoService.attributeAssign(quotationProductVos, ExtQuotationProductVo::getProductId, (item, productInfo) -> {
-            item.setProductCode(productInfo.getCustomCode());
-            item.setProductName(productInfo.getName());
-            item.setProductLength(productInfo.getLength());
-            item.setProductWidth(productInfo.getWidth());
-            item.setProductHeight(productInfo.getHeight());
-            item.setProductProdImgPath(productInfo.getProdImgPath());
-        });
-
-        //获取配件列表
-        List<Long> ids = quotationProductVos.stream().map(ExtQuotationProduct::getId).collect(Collectors.toList());
-        List<ExtQuotationProductBom> list = extQuotationProductBomService.list(q -> q.in(ExtQuotationProductBom::getQuotationProductId, ids));
-        List<ExtQuotationProductBomVo> quotationProductBomVos = BeanUtil.copyToList(list, ExtQuotationProductBomVo.class);
-        //赋值产品信息
-        productInfoService.attributeAssign(quotationProductBomVos, ExtQuotationProductBom::getProductId, (item, productInfo) -> {
-            item.setProductCode(productInfo.getCustomCode());
-            item.setProductName(productInfo.getName());
-            item.setProductLength(productInfo.getLength());
-            item.setProductWidth(productInfo.getWidth());
-            item.setProductHeight(productInfo.getHeight());
-        });
-
-        Map<Long, List<ExtQuotationProductBomVo>> qpbMap = quotationProductBomVos.stream().collect(Collectors.groupingBy(ExtQuotationProductBom::getQuotationProductId));
-
-        for (ExtQuotationProductVo quotationProductVo : quotationProductVos) {
-            quotationProductVo.setQuotationProductBomList(qpbMap.get(quotationProductVo.getId()));
-        }
-        result.setQuotationProductList(quotationProductVos);
-
-        //赋值报价金额趋势
-        List<ExtQuotation> quotationTrendList = this.list(q -> q
-                .eq(ExtQuotation::getGroupId, result.getGroupId())
-                .ne(ExtQuotation::getStatus, FlowStatusEnum1.CANCELLATION.getKey())
-                .orderByAsc(ExtQuotation::getCreateTime)
-        );
-        result.setQuotationTrendList(quotationTrendList);
-
-        return result;
+        return setDetailInfo(Arrays.asList(result)).get(0);
+
+//        //赋值买方公司名称(客户)
+//        Customer customer = customerService.getById(result.getBuyCorporationId());
+//        if (ObjectUtil.isNotEmpty(customer)) {
+//            result.setBuyCorporationName(customer.getName());
+//        }
+//
+//        //赋值买方公司地址
+//        setArea(result);
+//        //查询报价-商品表的详情
+//        List<ExtQuotationProduct> quotationProductList = extQuotationProductService.list(Wrappers.<ExtQuotationProduct>lambdaQuery()
+//                .eq(ExtQuotationProduct::getSaleQuotationId, result.getId()));
+//
+//        List<ExtQuotationProductVo> quotationProductVos = BeanUtil.copyToList(quotationProductList, ExtQuotationProductVo.class);
+//        //赋值产品信息
+//        productInfoService.attributeAssign(quotationProductVos, ExtQuotationProductVo::getProductId, (item, productInfo) -> {
+//            item.setProductCode(productInfo.getCustomCode());
+//            item.setProductName(productInfo.getName());
+//            item.setProductLength(productInfo.getLength());
+//            item.setProductWidth(productInfo.getWidth());
+//            item.setProductHeight(productInfo.getHeight());
+//            item.setProductProdImgPath(productInfo.getProdImgPath());
+//        });
+//
+//        //获取配件列表
+//        List<Long> ids = quotationProductVos.stream().map(ExtQuotationProduct::getId).collect(Collectors.toList());
+//        List<ExtQuotationProductBom> list = extQuotationProductBomService.list(q -> q.in(ExtQuotationProductBom::getQuotationProductId, ids));
+//        List<ExtQuotationProductBomVo> quotationProductBomVos = BeanUtil.copyToList(list, ExtQuotationProductBomVo.class);
+//        //赋值产品信息
+//        productInfoService.attributeAssign(quotationProductBomVos, ExtQuotationProductBom::getMaterialId, (item, productInfo) -> {
+//            item.setProductCode(productInfo.getCustomCode());
+//            item.setProductName(productInfo.getName());
+//            item.setProductLength(productInfo.getLength());
+//            item.setProductWidth(productInfo.getWidth());
+//            item.setProductHeight(productInfo.getHeight());
+//        });
+//
+//        Map<Long, List<ExtQuotationProductBomVo>> qpbMap = quotationProductBomVos.stream().collect(Collectors.groupingBy(ExtQuotationProductBom::getQuotationProductId));
+//
+//        for (ExtQuotationProductVo quotationProductVo : quotationProductVos) {
+//            quotationProductVo.setQuotationProductBomList(qpbMap.get(quotationProductVo.getId()));
+//        }
+//        result.setQuotationProductList(quotationProductVos);
+//
+//        //赋值报价金额趋势
+//        List<ExtQuotation> quotationTrendList = this.list(q -> q
+//                .eq(ExtQuotation::getGroupId, result.getGroupId())
+//                .ne(ExtQuotation::getStatus, FlowStatusEnum1.CANCELLATION.getKey())
+//                .orderByAsc(ExtQuotation::getCreateTime)
+//        );
+//        result.setQuotationTrendList(quotationTrendList);
+//
+//        return result;
     }
 
     @Override
@@ -333,4 +335,100 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
         extQuotationProductService.editLinked(quotationProducts, ExtQuotationProduct::getSaleQuotationId, saleQuotationDto.getId());
     }
 
+    /**
+     * 获取报价单历史版本
+     */
+    @Override
+    public List<ExtQuotationVo> getVersionList(Long extQuotationId) {
+        ExtQuotation extQuotation = this.getById(extQuotationId);
+        Assert.notEmpty(extQuotation, "查询不到报价单信息!");
+        Long groupId = extQuotation.getGroupId();
+        List<ExtQuotation> extQuotationList = this.list(q -> q.eq(ExtQuotation::getGroupId, groupId).orderByDesc(ExtQuotation::getCreateTime));
+        List<ExtQuotationVo> extQuotationVos = BeanUtil.copyToList(extQuotationList, ExtQuotationVo.class);
+        return setDetailInfo(extQuotationVos);
+    }
+
+    /**
+     * 赋值明细信息
+     */
+    private List<ExtQuotationVo> setDetailInfo(List<ExtQuotationVo> extQuotationVos) {
+        Long groupId = extQuotationVos.get(0).getGroupId();
+
+        //获取id列表
+        List<Long> ids = extQuotationVos.stream().map(ExtQuotation::getId).collect(Collectors.toList());
+        //获取子产品列表
+        List<ExtQuotationProduct> productList = extQuotationProductService.list(q -> q.in(ExtQuotationProduct::getSaleQuotationId, ids));
+        List<ExtQuotationProductVo> quotationProductVos = BeanUtil.copyToList(productList, ExtQuotationProductVo.class);
+        Map<Long, List<ExtQuotationProductVo>> productMap = quotationProductVos.stream().collect(Collectors.groupingBy(ExtQuotationProductVo::getSaleQuotationId));
+        //赋值产品信息
+        productInfoService.attributeAssign(quotationProductVos, ExtQuotationProductVo::getProductId, (item, productInfo) -> {
+            item.setProductCode(productInfo.getCustomCode());
+            item.setProductName(productInfo.getName());
+            item.setProductLength(productInfo.getLength());
+            item.setProductWidth(productInfo.getWidth());
+            item.setProductHeight(productInfo.getHeight());
+        });
+        //获取配件列表
+        List<Long> qpIds = productList.stream().map(ExtQuotationProduct::getId).collect(Collectors.toList());
+        Map<Long, List<ExtQuotationProductBomVo>> qpbMap = new HashMap<>();
+        if (ObjectUtil.isNotEmpty(qpIds)) {
+            List<ExtQuotationProductBom> bomList = extQuotationProductBomService.list(q -> q.in(ExtQuotationProductBom::getQuotationProductId, qpIds));
+            List<ExtQuotationProductBomVo> quotationProductBomVos = BeanUtil.copyToList(bomList, ExtQuotationProductBomVo.class);
+            //赋值产品信息
+            productInfoService.attributeAssign(quotationProductBomVos, ExtQuotationProductBom::getMaterialId, (item, productInfo) -> {
+                item.setProductCode(productInfo.getCustomCode());
+                item.setProductName(productInfo.getName());
+                item.setProductLength(productInfo.getLength());
+                item.setProductWidth(productInfo.getWidth());
+                item.setProductHeight(productInfo.getHeight());
+            });
+            qpbMap = quotationProductBomVos.stream().collect(Collectors.groupingBy(ExtQuotationProductBom::getQuotationProductId));
+        }
+
+        //赋值客户信息
+        customerService.attributeAssign(extQuotationVos, ExtQuotation::getBuyCorporationId, (item, customer) -> {
+            item.setBuyCorporationName(customer.getName());
+        });
+
+        //获取地址信息
+        List<Long> areaIdList = new ArrayList<>();
+        for (ExtQuotation quotation : extQuotationVos) {
+            areaIdList.add(quotation.getBuyCountryId());
+            areaIdList.add(quotation.getBuyProvinceId());
+            areaIdList.add(quotation.getBuyCityId());
+        }
+        areaIdList = areaIdList.stream().distinct().collect(Collectors.toList());
+        Map<Long, String> areaMap = CustomizeAreaUtil.getAreaMapByIds(areaIdList);
+
+        //获取报价金额趋势
+        List<ExtQuotation> quotationTrendList = this.list(q -> q
+                .eq(ExtQuotation::getGroupId, groupId)
+                .ne(ExtQuotation::getStatus, FlowStatusEnum1.CANCELLATION.getKey())
+                .orderByAsc(ExtQuotation::getCreateTime)
+        );
+
+        //赋值信息
+        for (ExtQuotationVo quotation : extQuotationVos) {
+            //赋值买方地址
+            quotation.setBuyCountryName(areaMap.get(quotation.getBuyCountryId()));
+            quotation.setBuyProvinceName(areaMap.get(quotation.getBuyProvinceId()));
+            quotation.setBuyCityName(areaMap.get(quotation.getBuyCityId()));
+            quotation.setBuyDetailedAddress(quotation.getBuyAddress());
+
+            //赋值产品列表
+            List<ExtQuotationProductVo> quotationProductVos1 = productMap.getOrDefault(quotation.getId(), new ArrayList<>());
+            for (ExtQuotationProductVo quotationProductVo : quotationProductVos1) {
+                //赋值配件列表
+                quotationProductVo.setQuotationProductBomList(qpbMap.get(quotationProductVo.getId()));
+            }
+            quotation.setQuotationProductList(quotationProductVos1);
+
+            //获取报价金额趋势
+            quotation.setQuotationTrendList(quotationTrendList);
+        }
+
+        return extQuotationVos;
+
+    }
+
 }

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/service/sale/SaleQuotationService.java

@@ -111,4 +111,9 @@ public interface SaleQuotationService extends BaseService<SaleQuotation> {
      * 趋势分析(客户分析)
      */
     Map<String, Object> trendAnalysis(CustomerDto dto);
+
+    /**
+     * 获取报价单历史版本
+     */
+    List<SaleQuotationVo> getVersionList(Long saleQuotationId);
 }

+ 148 - 46
hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java

@@ -19,6 +19,7 @@ import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.enums.PushBusinessTypeEnum;
 import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.common.service.corporation.CorporationService;
+import com.fjhx.common.utils.Assert;
 import com.fjhx.common.utils.Utils;
 import com.fjhx.customer.entity.customer.dto.CustomerDto;
 import com.fjhx.customer.entity.customer.dto.CustomerSelectDto;
@@ -299,19 +300,95 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         if (ObjectUtil.isEmpty(result)) {
             throw new ServiceException("查询不到明细信息请检查");
         }
-        //赋值买方公司名称(客户)
-        Customer customer = customerService.getById(result.getBuyCorporationId());
-        if (ObjectUtil.isNotEmpty(customer)) {
-            result.setBuyCorporationName(customer.getName());
-        }
 
-        //赋值买方公司地址
-        setArea(result);
-        //查询报价-商品表的详情
-        List<QuotationProduct> quotationProductList = quotationProductService.list(Wrappers.<QuotationProduct>lambdaQuery()
-                .eq(QuotationProduct::getSaleQuotationId, result.getId()));
+        return setDetailInfo(Arrays.asList(result)).get(0);
+//
+//        //赋值买方公司名称(客户)
+//        Customer customer = customerService.getById(result.getBuyCorporationId());
+//        if (ObjectUtil.isNotEmpty(customer)) {
+//            result.setBuyCorporationName(customer.getName());
+//        }
+//
+//        //赋值买方公司地址
+//        setArea(result);
+//        //查询报价-商品表的详情
+//        List<QuotationProduct> quotationProductList = quotationProductService.list(Wrappers.<QuotationProduct>lambdaQuery()
+//                .eq(QuotationProduct::getSaleQuotationId, result.getId()));
+//
+//        List<QuotationProductVo> quotationProductVos = BeanUtil.copyToList(quotationProductList, QuotationProductVo.class);
+//        //赋值产品信息
+//        productInfoService.attributeAssign(quotationProductVos, QuotationProductVo::getProductId, (item, productInfo) -> {
+//            item.setProductCode(productInfo.getCustomCode());
+//            item.setProductName(productInfo.getName());
+//            item.setProductLength(productInfo.getLength());
+//            item.setProductWidth(productInfo.getWidth());
+//            item.setProductHeight(productInfo.getHeight());
+//        });
+//
+//        //获取配件列表
+//        Map<Long, List<QuotationProductBomVo>> qpbMap = new HashMap<>();
+//        List<Long> ids = quotationProductVos.stream().map(QuotationProduct::getId).collect(Collectors.toList());
+//        if (ObjectUtil.isNotEmpty(ids)) {
+//            List<QuotationProductBom> list = quotationProductBomService.list(q -> q.in(QuotationProductBom::getQuotationProductId, ids));
+//
+//            List<QuotationProductBomVo> quotationProductBomVos = BeanUtil.copyToList(list, QuotationProductBomVo.class);
+//            //赋值产品信息
+//            productInfoService.attributeAssign(quotationProductBomVos, QuotationProductBom::getMaterialId, (item, productInfo) -> {
+//                item.setProductCode(productInfo.getCustomCode());
+//                item.setProductName(productInfo.getName());
+//                item.setProductLength(productInfo.getLength());
+//                item.setProductWidth(productInfo.getWidth());
+//                item.setProductHeight(productInfo.getHeight());
+//            });
+//
+//            qpbMap = quotationProductBomVos.stream().collect(Collectors.groupingBy(QuotationProductBom::getQuotationProductId));
+//        }
+//        for (QuotationProductVo quotationProductVo : quotationProductVos) {
+//            quotationProductVo.setQuotationProductBomList(qpbMap.get(quotationProductVo.getId()));
+//        }
+//        result.setQuotationProductList(quotationProductVos);
+//
+//        //赋值报价金额趋势
+//        List<SaleQuotation> quotationTrendList = this.list(q -> q
+//                .eq(SaleQuotation::getGroupId, result.getGroupId())
+//                .ne(SaleQuotation::getStatus, FlowStatusEnum1.CANCELLATION.getKey())
+//                .orderByAsc(SaleQuotation::getCreateTime)
+//        );
+//        result.setQuotationTrendList(quotationTrendList);
+//
+//        return result;
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+    /**
+     * 获取报价单历史版本
+     */
+    @Override
+    public List<SaleQuotationVo> getVersionList(Long saleQuotationId) {
+        SaleQuotation saleQuotation = this.getById(saleQuotationId);
+        Assert.notEmpty(saleQuotation, "查询不到报价单信息!");
+        Long groupId = saleQuotation.getGroupId();
+        List<SaleQuotation> saleQuotationList = this.list(q -> q.eq(SaleQuotation::getGroupId, groupId).orderByDesc(SaleQuotation::getCreateTime));
+        List<SaleQuotationVo> saleQuotationVos = BeanUtil.copyToList(saleQuotationList, SaleQuotationVo.class);
+        return setDetailInfo(saleQuotationVos);
+    }
 
-        List<QuotationProductVo> quotationProductVos = BeanUtil.copyToList(quotationProductList, QuotationProductVo.class);
+    /**
+     * 赋值明细信息
+     */
+    private List<SaleQuotationVo> setDetailInfo(List<SaleQuotationVo> saleQuotationVos) {
+        Long groupId = saleQuotationVos.get(0).getGroupId();
+
+        //获取id列表
+        List<Long> ids = saleQuotationVos.stream().map(SaleQuotation::getId).collect(Collectors.toList());
+        //获取子产品列表
+        List<QuotationProduct> productList = quotationProductService.list(q -> q.in(QuotationProduct::getSaleQuotationId, ids));
+        List<QuotationProductVo> quotationProductVos = BeanUtil.copyToList(productList, QuotationProductVo.class);
+        Map<Long, List<QuotationProductVo>> productMap = quotationProductVos.stream().collect(Collectors.groupingBy(QuotationProductVo::getSaleQuotationId));
         //赋值产品信息
         productInfoService.attributeAssign(quotationProductVos, QuotationProductVo::getProductId, (item, productInfo) -> {
             item.setProductCode(productInfo.getCustomCode());
@@ -320,46 +397,71 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
             item.setProductWidth(productInfo.getWidth());
             item.setProductHeight(productInfo.getHeight());
         });
-
         //获取配件列表
+        List<Long> qpIds = productList.stream().map(QuotationProduct::getId).collect(Collectors.toList());
         Map<Long, List<QuotationProductBomVo>> qpbMap = new HashMap<>();
-        List<Long> ids = quotationProductVos.stream().map(QuotationProduct::getId).collect(Collectors.toList());
-        if (ObjectUtil.isNotEmpty(ids)) {
-            List<QuotationProductBom> list = quotationProductBomService.list(q -> q.in(QuotationProductBom::getQuotationProductId, ids));
-
-            List<QuotationProductBomVo> quotationProductBomVos = BeanUtil.copyToList(list, QuotationProductBomVo.class);
+        if (ObjectUtil.isNotEmpty(qpIds)) {
+            List<QuotationProductBom> bomList = quotationProductBomService.list(q -> q.in(QuotationProductBom::getQuotationProductId, qpIds));
+            List<QuotationProductBomVo> quotationProductBomVos = BeanUtil.copyToList(bomList, QuotationProductBomVo.class);
             //赋值产品信息
-            productInfoService.attributeAssign(quotationProductBomVos, QuotationProductBom::getProductId, (item, productInfo) -> {
+            productInfoService.attributeAssign(quotationProductBomVos, QuotationProductBom::getMaterialId, (item, productInfo) -> {
                 item.setProductCode(productInfo.getCustomCode());
                 item.setProductName(productInfo.getName());
                 item.setProductLength(productInfo.getLength());
                 item.setProductWidth(productInfo.getWidth());
                 item.setProductHeight(productInfo.getHeight());
             });
-
             qpbMap = quotationProductBomVos.stream().collect(Collectors.groupingBy(QuotationProductBom::getQuotationProductId));
         }
-        for (QuotationProductVo quotationProductVo : quotationProductVos) {
-            quotationProductVo.setQuotationProductBomList(qpbMap.get(quotationProductVo.getId()));
+
+        //赋值客户信息
+        customerService.attributeAssign(saleQuotationVos, SaleQuotation::getBuyCorporationId, (item, customer) -> {
+            item.setBuyCorporationName(customer.getName());
+        });
+
+        //获取地址信息
+        List<Long> areaIdList = new ArrayList<>();
+        for (SaleQuotation quotation : saleQuotationVos) {
+            areaIdList.add(quotation.getBuyCountryId());
+            areaIdList.add(quotation.getBuyProvinceId());
+            areaIdList.add(quotation.getBuyCityId());
         }
-        result.setQuotationProductList(quotationProductVos);
+        areaIdList = areaIdList.stream().distinct().collect(Collectors.toList());
+        Map<Long, String> areaMap = CustomizeAreaUtil.getAreaMapByIds(areaIdList);
 
-        //赋值报价金额趋势
+        //获取报价金额趋势
         List<SaleQuotation> quotationTrendList = this.list(q -> q
-                .eq(SaleQuotation::getGroupId, result.getGroupId())
+                .eq(SaleQuotation::getGroupId, groupId)
                 .ne(SaleQuotation::getStatus, FlowStatusEnum1.CANCELLATION.getKey())
                 .orderByAsc(SaleQuotation::getCreateTime)
         );
-        result.setQuotationTrendList(quotationTrendList);
 
-        return result;
-    }
+        //赋值信息
+        for (SaleQuotationVo quotation : saleQuotationVos) {
+            //赋值买方地址
+            quotation.setBuyCountryName(areaMap.get(quotation.getBuyCountryId()));
+            quotation.setBuyProvinceName(areaMap.get(quotation.getBuyProvinceId()));
+            quotation.setBuyCityName(areaMap.get(quotation.getBuyCityId()));
+            quotation.setBuyDetailedAddress(quotation.getBuyAddress());
+
+            //赋值产品列表
+            List<QuotationProductVo> quotationProductVos1 = productMap.getOrDefault(quotation.getId(), new ArrayList<>());
+            for (QuotationProductVo quotationProductVo : quotationProductVos1) {
+                //赋值配件列表
+                quotationProductVo.setQuotationProductBomList(qpbMap.get(quotationProductVo.getId()));
+            }
+            quotation.setQuotationProductList(quotationProductVos1);
+
+            //获取报价金额趋势
+            quotation.setQuotationTrendList(quotationTrendList);
+        }
+
+        return saleQuotationVos;
 
-    @Override
-    public void delete(Long id) {
-        this.removeById(id);
     }
 
+    //==================================================================================================================
+
     /**
      * 报价单的复制功能(报价单,报价-商品表的 ,报价-收费项目表,根据报价表的ID相关数据复制一份)
      */
@@ -788,22 +890,22 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         return map;
     }
 
-    /**
-     * 赋值买卖公司地址
-     */
-    private void setArea(SaleQuotationVo saleQuotationVo) {
-
-        List<Long> areaIdList = Arrays.asList(
-                saleQuotationVo.getBuyCountryId(),
-                saleQuotationVo.getBuyProvinceId(),
-                saleQuotationVo.getBuyCityId()
-        );
-        Map<Long, String> areaMap = CustomizeAreaUtil.getAreaMapByIds(areaIdList);
-        saleQuotationVo.setBuyCountryName(areaMap.get(saleQuotationVo.getBuyCountryId()));
-        saleQuotationVo.setBuyProvinceName(areaMap.get(saleQuotationVo.getBuyProvinceId()));
-        saleQuotationVo.setBuyCityName(areaMap.get(saleQuotationVo.getBuyCityId()));
-        saleQuotationVo.setBuyDetailedAddress(saleQuotationVo.getBuyAddress());
-    }
+//    /**
+//     * 赋值买卖公司地址
+//     */
+//    private void setArea(SaleQuotationVo saleQuotationVo) {
+//
+//        List<Long> areaIdList = Arrays.asList(
+//                saleQuotationVo.getBuyCountryId(),
+//                saleQuotationVo.getBuyProvinceId(),
+//                saleQuotationVo.getBuyCityId()
+//        );
+//        Map<Long, String> areaMap = CustomizeAreaUtil.getAreaMapByIds(areaIdList);
+//        saleQuotationVo.setBuyCountryName(areaMap.get(saleQuotationVo.getBuyCountryId()));
+//        saleQuotationVo.setBuyProvinceName(areaMap.get(saleQuotationVo.getBuyProvinceId()));
+//        saleQuotationVo.setBuyCityName(areaMap.get(saleQuotationVo.getBuyCityId()));
+//        saleQuotationVo.setBuyDetailedAddress(saleQuotationVo.getBuyAddress());
+//    }
 
 
 }