|
@@ -14,24 +14,18 @@ import com.fjhx.common.service.coding.CodingRuleService;
|
|
|
import com.fjhx.common.utils.Assert;
|
|
|
import com.fjhx.common.utils.Utils;
|
|
|
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.ext.dto.ExtQuotationDto;
|
|
|
-import com.fjhx.sale.entity.ext.dto.ExtQuotationProductBomDto;
|
|
|
-import com.fjhx.sale.entity.ext.dto.ExtQuotationProductDto;
|
|
|
-import com.fjhx.sale.entity.ext.dto.ExtQuotationSelectDto;
|
|
|
-import com.fjhx.sale.entity.ext.po.ExtQuotation;
|
|
|
-import com.fjhx.sale.entity.ext.po.ExtQuotationFollow;
|
|
|
-import com.fjhx.sale.entity.ext.po.ExtQuotationProduct;
|
|
|
-import com.fjhx.sale.entity.ext.po.ExtQuotationProductBom;
|
|
|
+import com.fjhx.sale.entity.ext.dto.*;
|
|
|
+import com.fjhx.sale.entity.ext.po.*;
|
|
|
import com.fjhx.sale.entity.ext.vo.ExtQuotationProductBomVo;
|
|
|
+import com.fjhx.sale.entity.ext.vo.ExtQuotationProductCustomInfoVo;
|
|
|
import com.fjhx.sale.entity.ext.vo.ExtQuotationProductVo;
|
|
|
import com.fjhx.sale.entity.ext.vo.ExtQuotationVo;
|
|
|
import com.fjhx.sale.entity.sale.po.SaleQuotation;
|
|
|
import com.fjhx.sale.mapper.ext.ExtQuotationMapper;
|
|
|
-import com.fjhx.sale.service.ext.ExtQuotationFollowService;
|
|
|
-import com.fjhx.sale.service.ext.ExtQuotationProductBomService;
|
|
|
-import com.fjhx.sale.service.ext.ExtQuotationProductService;
|
|
|
-import com.fjhx.sale.service.ext.ExtQuotationService;
|
|
|
+import com.fjhx.sale.service.ext.*;
|
|
|
import com.fjhx.sale.service.sale.SaleQuotationService;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
@@ -78,6 +72,8 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
|
|
|
private CodingRuleService codingRuleService;
|
|
|
@Autowired
|
|
|
private ISysUserService sysUserService;
|
|
|
+ @Autowired
|
|
|
+ private ExtQuotationProductCustomInfoService quotationProductCustomInfoService;
|
|
|
|
|
|
@Override
|
|
|
public Page<ExtQuotationVo> getPage(ExtQuotationSelectDto dto) {
|
|
@@ -334,8 +330,26 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
|
|
|
for (ExtQuotationProductBom quotationProductBom : quotationProductBomList) {
|
|
|
quotationProductBom.setProductId(quotationProductDto.getProductId());
|
|
|
quotationProductBom.setQuotationProductId(quotationProductDto.getId());
|
|
|
+ quotationProductBom.setExtQuotationId(saleQuotationDto.getId());
|
|
|
}
|
|
|
extQuotationProductBomService.editLinked(quotationProductBomList, ExtQuotationProductBom::getQuotationProductId, quotationProductDto.getId());
|
|
|
+
|
|
|
+
|
|
|
+ List<ExtQuotationProductCustomInfoDto> quotationProductCustomInfoList = quotationProductDto.getQuotationProductCustomInfoList();
|
|
|
+ quotationProductCustomInfoList = ObjectUtil.isEmpty(quotationProductCustomInfoList) ? new ArrayList<>() : quotationProductCustomInfoList;
|
|
|
+
|
|
|
+ for (ExtQuotationProductCustomInfoDto quotationProductCustomInfo : quotationProductCustomInfoList) {
|
|
|
+ if (ObjectUtil.isEmpty(quotationProductCustomInfo.getId())) {
|
|
|
+ quotationProductCustomInfo.setId(IdWorker.getId());
|
|
|
+ }
|
|
|
+ quotationProductCustomInfo.setProductId(quotationProductDto.getProductId());
|
|
|
+ quotationProductCustomInfo.setExtQuotationProductId(quotationProductDto.getId());
|
|
|
+ quotationProductCustomInfo.setExtQuotationId(saleQuotationDto.getId());
|
|
|
+
|
|
|
+ ObsFileUtil.copyFileAndSave(quotationProductCustomInfo.getFileList(), quotationProductCustomInfo.getId());
|
|
|
+ }
|
|
|
+ List<ExtQuotationProductCustomInfo> quotationProductCustomInfos = BeanUtil.copyToList(quotationProductCustomInfoList, ExtQuotationProductCustomInfo.class);
|
|
|
+ quotationProductCustomInfoService.editLinked(quotationProductCustomInfos, ExtQuotationProductCustomInfo::getExtQuotationProductId, quotationProductDto.getId());
|
|
|
}
|
|
|
|
|
|
List<ExtQuotationProduct> quotationProducts = BeanUtil.copyToList(quotationProductList, ExtQuotationProduct.class);
|
|
@@ -394,6 +408,22 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
|
|
|
qpbMap = quotationProductBomVos.stream().collect(Collectors.groupingBy(ExtQuotationProductBom::getQuotationProductId));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ Map<Long, List<ExtQuotationProductCustomInfoVo>> qpcIMap = new HashMap<>();
|
|
|
+ if (ObjectUtil.isNotEmpty(qpIds)) {
|
|
|
+ List<ExtQuotationProductCustomInfo> quotationProductCustomInfoList = quotationProductCustomInfoService.list(q -> q.in(ExtQuotationProductCustomInfo::getExtQuotationProductId, qpIds));
|
|
|
+ List<ExtQuotationProductCustomInfoVo> quotationProductBomVos = BeanUtil.copyToList(quotationProductCustomInfoList, ExtQuotationProductCustomInfoVo.class);
|
|
|
+
|
|
|
+ List<Long> qpbIds = quotationProductBomVos.stream().map(ExtQuotationProductCustomInfo::getId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ Map<Long, List<FileInfoVo>> fileMap = ObsFileUtil.getFileMap(qpbIds);
|
|
|
+ for (ExtQuotationProductCustomInfoVo quotationProductBomVo : quotationProductBomVos) {
|
|
|
+ List<FileInfoVo> fileInfoVoList = fileMap.get(quotationProductBomVo.getId());
|
|
|
+ quotationProductBomVo.setFileList(fileInfoVoList);
|
|
|
+ }
|
|
|
+ qpcIMap = quotationProductBomVos.stream().collect(Collectors.groupingBy(ExtQuotationProductCustomInfoVo::getExtQuotationProductId));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
customerService.attributeAssign(extQuotationVos, ExtQuotation::getBuyCorporationId, (item, customer) -> {
|
|
|
item.setBuyCorporationName(customer.getName());
|
|
@@ -429,6 +459,8 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
|
|
|
for (ExtQuotationProductVo quotationProductVo : quotationProductVos1) {
|
|
|
|
|
|
quotationProductVo.setQuotationProductBomList(qpbMap.get(quotationProductVo.getId()));
|
|
|
+
|
|
|
+ quotationProductVo.setQuotationProductCustomInfoList(qpcIMap.get(quotationProductVo.getId()));
|
|
|
}
|
|
|
quotation.setQuotationProductList(quotationProductVos1);
|
|
|
|