|
@@ -12,6 +12,7 @@ import com.fjhx.sale.entity.quotation.po.QuotationEstimate;
|
|
|
import com.fjhx.sale.entity.quotation.po.QuotationProduct;
|
|
|
import com.fjhx.sale.entity.quotation.po.QuotationProductBom;
|
|
|
import com.fjhx.sale.entity.quotation.vo.QuotationEstimateVo;
|
|
|
+import com.fjhx.sale.entity.quotation.vo.QuotationProductBomVo;
|
|
|
import com.fjhx.sale.entity.quotation.vo.QuotationProductVo;
|
|
|
import com.fjhx.sale.entity.sale.po.SaleQuotation;
|
|
|
import com.fjhx.sale.entity.sale.vo.SaleQuotationVo;
|
|
@@ -22,6 +23,7 @@ import com.fjhx.sale.service.quotation.QuotationProductService;
|
|
|
import com.fjhx.sale.service.sale.SaleQuotationService;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -75,7 +77,11 @@ public class QuotationEstimateServiceImpl extends ServiceImpl<QuotationEstimateM
|
|
|
//没有现有数据回填报价明细信息
|
|
|
if (ObjectUtil.isEmpty(quotationEstimateVos)) {
|
|
|
quotationEstimateVos = new ArrayList<>();
|
|
|
- List<QuotationProductBom> list1 = quotationProductBomService.list(q -> q.eq(QuotationProductBom::getQuotationProductId, quotationProductId));
|
|
|
+ List<QuotationProductBomVo> list1 = quotationProductBomService.getList(IWrapper.getWrapper()
|
|
|
+ .eq("qpb", QuotationProductBom::getQuotationProductId, quotationProductId)
|
|
|
+ .orderByAsc("FIELD( qpb.type, 1, 3, 2 )")
|
|
|
+ .orderByAsc("qpb.id")
|
|
|
+ );
|
|
|
|
|
|
List<Long> mIds = list1.stream().map(QuotationProductBom::getMaterialId).collect(Collectors.toList());
|
|
|
Map<Long, ProductInfo> materialInfoMap = productInfoService.mapKEntity(ProductInfo::getId, q -> q.in(ProductInfo::getId, mIds));
|
|
@@ -105,7 +111,7 @@ public class QuotationEstimateServiceImpl extends ServiceImpl<QuotationEstimateM
|
|
|
|
|
|
//赋值工序信息
|
|
|
if (ObjectUtil.notEqual(quotationProductBom.getType(), 3)) {
|
|
|
- ProcessesBo processesBo = collect.get(quotationProductBom.getProcessesId());
|
|
|
+ ProcessesBo processesBo = collect.getOrDefault(quotationProductBom.getProcessesId(), collect.get(quotationProductBom.getMaterialId()));
|
|
|
if (ObjectUtil.isNotEmpty(processesBo)) {
|
|
|
quotationEstimate.setCode(processesBo.getCode());
|
|
|
quotationEstimate.setName(processesBo.getName());
|