瀏覽代碼

问题处理

yzc 1 年之前
父節點
當前提交
7883dbc46c

+ 1 - 0
hx-item/src/main/java/com/fjhx/item/controller/product/ProductBomInfoController.java

@@ -62,6 +62,7 @@ public class ProductBomInfoController {
             item.setMaterialWidth(material.getWidth());
             item.setMaterialHeight(material.getHeight());
             item.setMaterialPrice(material.getPrice());
+            item.setMaterialColor(material.getColor());
         });
 
         ProductBomInfoVo productBomInfoVo = new ProductBomInfoVo();

+ 5 - 1
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java

@@ -237,7 +237,11 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         }
 
         //赋值物料信息
-        List<ProductBomDetailVo> productBomDetailVos = productBomDetailService.getList(IWrapper.getWrapper().eq("pbd", ProductBomDetail::getProductId, id));
+        List<ProductBomDetailVo> productBomDetailVos = productBomDetailService.getList(IWrapper.getWrapper()
+                .eq("pbd", ProductBomDetail::getProductId, id)
+                .orderByAsc("FIELD( pbd.type, 1, 3, 2 )")
+                .orderByAsc("pbd.id")
+        );
         this.attributeAssign(productBomDetailVos, ProductBomDetail::getMaterialId, (item, material) -> {
             item.setMaterialName(material.getName());
             item.setMaterialCode(material.getCustomCode());

+ 5 - 1
hx-sale/src/main/java/com/fjhx/sale/service/ext/impl/ExtQuotationServiceImpl.java

@@ -410,7 +410,11 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
         List<Long> qpIds = productList.stream().map(ExtQuotationProduct::getId).collect(Collectors.toList());
         Map<Long, List<ExtQuotationProductBomVo>> qpbMap = new HashMap<>();
         if (ObjectUtil.isNotEmpty(qpIds)) {
-            List<ExtQuotationProductBomVo> quotationProductBomVos = extQuotationProductBomService.getList(IWrapper.getWrapper().in("eqpb", ExtQuotationProductBom::getQuotationProductId, qpIds));
+            List<ExtQuotationProductBomVo> quotationProductBomVos = extQuotationProductBomService.getList(IWrapper.getWrapper()
+                    .in("eqpb", ExtQuotationProductBom::getQuotationProductId, qpIds)
+                    .orderByAsc("FIELD( eqpb.type, 1, 3, 2 )")
+                    .orderByAsc("eqpb.id")
+            );
             //赋值产品信息
             productInfoService.attributeAssign(quotationProductBomVos, ExtQuotationProductBom::getMaterialId, (item, productInfo) -> {
                 item.setProductCode(productInfo.getCustomCode());

+ 8 - 2
hx-sale/src/main/java/com/fjhx/sale/service/quotation/impl/QuotationEstimateServiceImpl.java

@@ -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());

+ 5 - 1
hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java

@@ -429,7 +429,11 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
         List<Long> qpIds = productList.stream().map(QuotationProduct::getId).collect(Collectors.toList());
         Map<Long, List<QuotationProductBomVo>> qpbMap = new HashMap<>();
         if (ObjectUtil.isNotEmpty(qpIds)) {
-            List<QuotationProductBomVo> quotationProductBomVos = quotationProductBomService.getList(IWrapper.getWrapper().in("qpb", QuotationProductBom::getQuotationProductId, qpIds));
+            List<QuotationProductBomVo> quotationProductBomVos = quotationProductBomService.getList(IWrapper.getWrapper()
+                    .in("qpb", QuotationProductBom::getQuotationProductId, qpIds)
+                    .orderByAsc("FIELD( qpb.type, 1, 3, 2 )")
+                    .orderByAsc("qpb.id")
+            );
             //赋值产品信息
             productInfoService.attributeAssign(quotationProductBomVos, QuotationProductBom::getMaterialId, (item, productInfo) -> {
                 item.setProductCode(productInfo.getCustomCode());