|
@@ -26,14 +26,19 @@ import com.fjhx.customer.entity.customer.dto.CustomerSelectDto;
|
|
|
import com.fjhx.customer.entity.customer.po.Customer;
|
|
|
import com.fjhx.customer.entity.customer.vo.CustomerVo;
|
|
|
import com.fjhx.customer.service.customer.CustomerService;
|
|
|
+import com.fjhx.file.entity.FileInfoVo;
|
|
|
+import com.fjhx.file.utils.ObsFileUtil;
|
|
|
import com.fjhx.item.service.product.ProductInfoService;
|
|
|
import com.fjhx.sale.entity.contract.vo.ContractVo;
|
|
|
import com.fjhx.sale.entity.quotation.dto.QuotationProductBomDto;
|
|
|
+import com.fjhx.sale.entity.quotation.dto.QuotationProductCustomInfoDto;
|
|
|
import com.fjhx.sale.entity.quotation.dto.QuotationProductDto;
|
|
|
import com.fjhx.sale.entity.quotation.po.QuotationPay;
|
|
|
import com.fjhx.sale.entity.quotation.po.QuotationProduct;
|
|
|
import com.fjhx.sale.entity.quotation.po.QuotationProductBom;
|
|
|
+import com.fjhx.sale.entity.quotation.po.QuotationProductCustomInfo;
|
|
|
import com.fjhx.sale.entity.quotation.vo.QuotationProductBomVo;
|
|
|
+import com.fjhx.sale.entity.quotation.vo.QuotationProductCustomInfoVo;
|
|
|
import com.fjhx.sale.entity.quotation.vo.QuotationProductVo;
|
|
|
import com.fjhx.sale.entity.sale.dto.SaleQuotationDto;
|
|
|
import com.fjhx.sale.entity.sale.dto.SaleQuotationSelectDto;
|
|
@@ -43,6 +48,7 @@ import com.fjhx.sale.mapper.sale.SaleQuotationMapper;
|
|
|
import com.fjhx.sale.service.contract.ContractService;
|
|
|
import com.fjhx.sale.service.quotation.QuotationPayService;
|
|
|
import com.fjhx.sale.service.quotation.QuotationProductBomService;
|
|
|
+import com.fjhx.sale.service.quotation.QuotationProductCustomInfoService;
|
|
|
import com.fjhx.sale.service.quotation.QuotationProductService;
|
|
|
import com.fjhx.sale.service.sale.SaleQuotationService;
|
|
|
import com.fjhx.sale.util.code.CodeEnum;
|
|
@@ -106,6 +112,8 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
|
private ProductInfoService productInfoService;
|
|
|
@Autowired
|
|
|
private ISysUserService sysUserService;
|
|
|
+ @Autowired
|
|
|
+ private QuotationProductCustomInfoService quotationProductCustomInfoService;
|
|
|
|
|
|
/**
|
|
|
* 报价表分页
|
|
@@ -191,8 +199,6 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
|
item.setProductLength(productInfo.getLength());
|
|
|
item.setProductWidth(productInfo.getWidth());
|
|
|
item.setProductWidth(productInfo.getHeight());
|
|
|
- item.setProductColor(productInfo.getColor());
|
|
|
-
|
|
|
});
|
|
|
Map<Long, List<QuotationProductVo>> pMap = quotationPayVos.stream().collect(Collectors.groupingBy(QuotationProduct::getSaleQuotationId));
|
|
|
|
|
@@ -323,8 +329,25 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
|
for (QuotationProductBom quotationProductBom : quotationProductBomList) {
|
|
|
quotationProductBom.setProductId(quotationProductDto.getProductId());
|
|
|
quotationProductBom.setQuotationProductId(quotationProductDto.getId());
|
|
|
+ quotationProductBom.setSaleQuotationId(saleQuotationDto.getId());
|
|
|
}
|
|
|
quotationProductBomService.editLinked(quotationProductBomList, QuotationProductBom::getQuotationProductId, quotationProductDto.getId());
|
|
|
+
|
|
|
+ //保存定制信息
|
|
|
+ List<QuotationProductCustomInfoDto> quotationProductCustomInfoList = quotationProductDto.getQuotationProductCustomInfoList();
|
|
|
+ quotationProductCustomInfoList = ObjectUtil.isEmpty(quotationProductCustomInfoList) ? new ArrayList<>() : quotationProductCustomInfoList;
|
|
|
+ for (QuotationProductCustomInfoDto quotationProductCustomInfo : quotationProductCustomInfoList) {
|
|
|
+ if (ObjectUtil.isEmpty(quotationProductCustomInfo.getId())) {
|
|
|
+ quotationProductCustomInfo.setId(IdWorker.getId());
|
|
|
+ }
|
|
|
+ quotationProductCustomInfo.setProductId(quotationProductDto.getProductId());
|
|
|
+ quotationProductCustomInfo.setQuotationProductId(quotationProductDto.getId());
|
|
|
+ quotationProductCustomInfo.setSaleQuotationId(saleQuotationDto.getId());
|
|
|
+
|
|
|
+ ObsFileUtil.copyFileAndSave(quotationProductCustomInfo.getFileList(), quotationProductCustomInfo.getId());
|
|
|
+ }
|
|
|
+ List<QuotationProductCustomInfo> quotationProductCustomInfos = BeanUtil.copyToList(quotationProductCustomInfoList, QuotationProductCustomInfo.class);
|
|
|
+ quotationProductCustomInfoService.editLinked(quotationProductCustomInfos, QuotationProductCustomInfo::getQuotationProductId, quotationProductDto.getId());
|
|
|
}
|
|
|
|
|
|
List<QuotationProduct> quotationProducts = BeanUtil.copyToList(quotationProductList, QuotationProduct.class);
|
|
@@ -390,7 +413,6 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
|
item.setProductLength(productInfo.getLength());
|
|
|
item.setProductWidth(productInfo.getWidth());
|
|
|
item.setProductHeight(productInfo.getHeight());
|
|
|
- item.setProductColor(productInfo.getColor());
|
|
|
});
|
|
|
//获取配件列表
|
|
|
List<Long> qpIds = productList.stream().map(QuotationProduct::getId).collect(Collectors.toList());
|
|
@@ -409,6 +431,22 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
|
});
|
|
|
qpbMap = quotationProductBomVos.stream().collect(Collectors.groupingBy(QuotationProductBom::getQuotationProductId));
|
|
|
}
|
|
|
+ //获取定制信息
|
|
|
+ Map<Long, List<QuotationProductCustomInfoVo>> qpcIMap = new HashMap<>();
|
|
|
+ if (ObjectUtil.isNotEmpty(qpIds)) {
|
|
|
+ List<QuotationProductCustomInfo> quotationProductCustomInfoList = quotationProductCustomInfoService.list(q -> q.in(QuotationProductCustomInfo::getQuotationProductId, qpIds));
|
|
|
+ List<QuotationProductCustomInfoVo> quotationProductBomVos = BeanUtil.copyToList(quotationProductCustomInfoList, QuotationProductCustomInfoVo.class);
|
|
|
+
|
|
|
+ List<Long> qpbIds = quotationProductBomVos.stream().map(QuotationProductCustomInfo::getId).collect(Collectors.toList());
|
|
|
+ //赋值文件信息
|
|
|
+ Map<Long, List<FileInfoVo>> fileMap = ObsFileUtil.getFileMap(qpbIds);
|
|
|
+ for (QuotationProductCustomInfoVo quotationProductBomVo : quotationProductBomVos) {
|
|
|
+ List<FileInfoVo> fileInfoVoList = fileMap.get(quotationProductBomVo.getId());
|
|
|
+ quotationProductBomVo.setFileList(fileInfoVoList);
|
|
|
+ }
|
|
|
+ qpcIMap = quotationProductBomVos.stream().collect(Collectors.groupingBy(QuotationProductCustomInfoVo::getQuotationProductId));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//赋值客户信息
|
|
|
customerService.attributeAssign(saleQuotationVos, SaleQuotation::getBuyCorporationId, (item, customer) -> {
|
|
@@ -445,6 +483,8 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
|
|
|
for (QuotationProductVo quotationProductVo : quotationProductVos1) {
|
|
|
//赋值配件列表
|
|
|
quotationProductVo.setQuotationProductBomList(qpbMap.get(quotationProductVo.getId()));
|
|
|
+ //赋值定制信息列表
|
|
|
+ quotationProductVo.setQuotationProductCustomInfoList(qpcIMap.get(quotationProductVo.getId()));
|
|
|
}
|
|
|
quotation.setQuotationProductList(quotationProductVos1);
|
|
|
|