|
@@ -29,6 +29,7 @@ import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -63,6 +64,10 @@ public class QuotationEstimateServiceImpl extends ServiceImpl<QuotationEstimateM
|
|
|
QuotationProduct quotationProduct = quotationProductService.getById(quotationProductId);
|
|
|
Assert.notEmpty(quotationProduct, "查询不到报价明细信息!");
|
|
|
|
|
|
+ //获取工序
|
|
|
+ ProductInfo productInfo = productInfoService.getById(quotationProduct.getProductId());
|
|
|
+ Assert.notEmpty(productInfo, "查询不到工艺信息!");
|
|
|
+
|
|
|
//查询现有报价信息
|
|
|
List<QuotationEstimate> quotationEstimateList = list(q -> q.eq(QuotationEstimate::getQuotationProductId, quotationProductId));
|
|
|
List<QuotationEstimateVo> quotationEstimateVos = BeanUtil.copyToList(quotationEstimateList, QuotationEstimateVo.class);
|
|
@@ -97,19 +102,7 @@ public class QuotationEstimateServiceImpl extends ServiceImpl<QuotationEstimateM
|
|
|
quotationEstimateVos.add(quotationEstimate);
|
|
|
}
|
|
|
|
|
|
- //赋值物料信息
|
|
|
- productInfoService.attributeAssign(quotationEstimateVos, QuotationEstimateVo::getMaterialId, (detail, product) -> {
|
|
|
- detail.setMaterialLength(product.getLength());
|
|
|
- detail.setMaterialWidth(product.getWidth());
|
|
|
- detail.setMaterialHeight(product.getHeight());
|
|
|
- detail.setName(product.getName());
|
|
|
- detail.setCode(product.getCustomCode());
|
|
|
- detail.setMaterialColor(product.getColor());
|
|
|
- });
|
|
|
-
|
|
|
- //获取工序
|
|
|
- ProductInfo productInfo = productInfoService.getById(quotationProduct.getProductId());
|
|
|
- Assert.notEmpty(productInfo, "查询不到工艺信息!");
|
|
|
+
|
|
|
List<ProcessesBo> processesList = productInfoService.getProcessesByTechnologyId(productInfo.getTechnologyId());
|
|
|
for (ProcessesBo processesBo : processesList) {
|
|
|
QuotationEstimateVo quotationEstimate = new QuotationEstimateVo();
|
|
@@ -124,6 +117,27 @@ public class QuotationEstimateServiceImpl extends ServiceImpl<QuotationEstimateM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //赋值物料信息
|
|
|
+ productInfoService.attributeAssign(quotationEstimateVos, QuotationEstimateVo::getMaterialId, (detail, product) -> {
|
|
|
+ detail.setMaterialLength(product.getLength());
|
|
|
+ detail.setMaterialWidth(product.getWidth());
|
|
|
+ detail.setMaterialHeight(product.getHeight());
|
|
|
+ detail.setName(product.getName());
|
|
|
+ detail.setCode(product.getCustomCode());
|
|
|
+ detail.setMaterialColor(product.getColor());
|
|
|
+ });
|
|
|
+
|
|
|
+ //赋值工序信息
|
|
|
+ List<ProcessesBo> processesList = productInfoService.getProcessesByTechnologyId(productInfo.getTechnologyId());
|
|
|
+ Map<Long, ProcessesBo> collect = processesList.stream().collect(Collectors.toMap(ProcessesBo::getId, Function.identity()));
|
|
|
+ for (QuotationEstimateVo quotationEstimateVo : quotationEstimateVos) {
|
|
|
+ ProcessesBo processesBo = collect.get(quotationEstimateVo.getProcessesId());
|
|
|
+ if (ObjectUtil.isNotEmpty(processesBo)) {
|
|
|
+ quotationEstimateVo.setName(processesBo.getName());
|
|
|
+ quotationEstimateVo.setCode(processesBo.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
return quotationEstimateVos;
|
|
|
}
|