|
@@ -12,7 +12,9 @@ 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.QuotationProductVo;
|
|
|
import com.fjhx.sale.entity.sale.po.SaleQuotation;
|
|
|
+import com.fjhx.sale.entity.sale.vo.SaleQuotationVo;
|
|
|
import com.fjhx.sale.mapper.quotation.QuotationEstimateMapper;
|
|
|
import com.fjhx.sale.service.quotation.QuotationEstimateService;
|
|
|
import com.fjhx.sale.service.quotation.QuotationProductBomService;
|
|
@@ -117,6 +119,14 @@ public class QuotationEstimateServiceImpl extends ServiceImpl<QuotationEstimateM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //赋值物料工序信息
|
|
|
+ setEstimateInfo(quotationEstimateVos);
|
|
|
+
|
|
|
+
|
|
|
+ return quotationEstimateVos;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setEstimateInfo(List<QuotationEstimateVo> quotationEstimateVos) {
|
|
|
//赋值物料信息
|
|
|
productInfoService.attributeAssign(quotationEstimateVos, QuotationEstimateVo::getMaterialId, (detail, product) -> {
|
|
|
detail.setMaterialLength(product.getLength());
|
|
@@ -128,7 +138,7 @@ public class QuotationEstimateServiceImpl extends ServiceImpl<QuotationEstimateM
|
|
|
});
|
|
|
|
|
|
//赋值工序信息
|
|
|
- List<ProcessesBo> processesList = productInfoService.getProcessesByTechnologyId(productInfo.getTechnologyId());
|
|
|
+ List<ProcessesBo> processesList = baseMapper.getProductionProcessesList();
|
|
|
Map<Long, ProcessesBo> collect = processesList.stream().collect(Collectors.toMap(ProcessesBo::getId, Function.identity()));
|
|
|
for (QuotationEstimateVo quotationEstimateVo : quotationEstimateVos) {
|
|
|
ProcessesBo processesBo = collect.get(quotationEstimateVo.getProcessesId());
|
|
@@ -137,9 +147,6 @@ public class QuotationEstimateServiceImpl extends ServiceImpl<QuotationEstimateM
|
|
|
quotationEstimateVo.setCode(processesBo.getCode());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- return quotationEstimateVos;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -187,4 +194,29 @@ public class QuotationEstimateServiceImpl extends ServiceImpl<QuotationEstimateM
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public SaleQuotationVo printPdf(QuotationEstimateDto dto) {
|
|
|
+ Long quotationId = dto.getQuotationId();
|
|
|
+ SaleQuotationVo detail = saleQuotationService.detail(quotationId);
|
|
|
+
|
|
|
+ //获取报价信息
|
|
|
+ List<QuotationEstimate> quotationEstimateList = this.list(q -> q
|
|
|
+ .eq(QuotationEstimate::getQuotationId, quotationId)
|
|
|
+ );
|
|
|
+ List<QuotationEstimateVo> quotationEstimateVos = BeanUtil.copyToList(quotationEstimateList, QuotationEstimateVo.class);
|
|
|
+
|
|
|
+ //赋值物料工序信息
|
|
|
+ setEstimateInfo(quotationEstimateVos);
|
|
|
+
|
|
|
+ Map<Long, List<QuotationEstimateVo>> estimateMap = quotationEstimateVos.stream().collect(Collectors.groupingBy(QuotationEstimate::getQuotationProductId));
|
|
|
+
|
|
|
+
|
|
|
+ List<QuotationProductVo> quotationProductList = detail.getQuotationProductList();
|
|
|
+ for (QuotationProductVo quotationProduct : quotationProductList) {
|
|
|
+ quotationProduct.setQuotationEstimateList(estimateMap.get(quotationProduct.getId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return detail;
|
|
|
+ }
|
|
|
+
|
|
|
}
|