Procházet zdrojové kódy

对内外报价单 工序问题处理

yzc před 1 rokem
rodič
revize
31736501fd

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/mapper/ext/ExtQuotationProductBomMapper.java

@@ -2,6 +2,10 @@ package com.fjhx.sale.mapper.ext;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fjhx.sale.entity.ext.po.ExtQuotationProductBom;
+import com.fjhx.sale.entity.ext.vo.ExtQuotationProductBomVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+
+import java.util.List;
 
 
 /**
@@ -14,4 +18,5 @@ import com.fjhx.sale.entity.ext.po.ExtQuotationProductBom;
  */
 public interface ExtQuotationProductBomMapper extends BaseMapper<ExtQuotationProductBom> {
 
+    List<ExtQuotationProductBomVo> getList(IWrapper<Object> wrapper);
 }

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/mapper/quotation/QuotationProductBomMapper.java

@@ -2,6 +2,10 @@ package com.fjhx.sale.mapper.quotation;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fjhx.sale.entity.quotation.po.QuotationProductBom;
+import com.fjhx.sale.entity.quotation.vo.QuotationProductBomVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+
+import java.util.List;
 
 
 /**
@@ -14,4 +18,5 @@ import com.fjhx.sale.entity.quotation.po.QuotationProductBom;
  */
 public interface QuotationProductBomMapper extends BaseMapper<QuotationProductBom> {
 
+    List<QuotationProductBomVo> getList(IWrapper<Object> wrapper);
 }

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/service/ext/ExtQuotationProductBomService.java

@@ -1,7 +1,11 @@
 package com.fjhx.sale.service.ext;
 
 import com.fjhx.sale.entity.ext.po.ExtQuotationProductBom;
+import com.fjhx.sale.entity.ext.vo.ExtQuotationProductBomVo;
 import com.ruoyi.common.core.service.BaseService;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+
+import java.util.List;
 
 
 /**
@@ -14,4 +18,5 @@ import com.ruoyi.common.core.service.BaseService;
  */
 public interface ExtQuotationProductBomService extends BaseService<ExtQuotationProductBom> {
 
+    List<ExtQuotationProductBomVo> getList(IWrapper<Object> eqpb);
 }

+ 8 - 0
hx-sale/src/main/java/com/fjhx/sale/service/ext/impl/ExtQuotationProductBomServiceImpl.java

@@ -2,10 +2,14 @@ package com.fjhx.sale.service.ext.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.sale.entity.ext.po.ExtQuotationProductBom;
+import com.fjhx.sale.entity.ext.vo.ExtQuotationProductBomVo;
 import com.fjhx.sale.mapper.ext.ExtQuotationProductBomMapper;
 import com.fjhx.sale.service.ext.ExtQuotationProductBomService;
+import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -18,4 +22,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class ExtQuotationProductBomServiceImpl extends ServiceImpl<ExtQuotationProductBomMapper, ExtQuotationProductBom> implements ExtQuotationProductBomService {
 
+    @Override
+    public List<ExtQuotationProductBomVo> getList(IWrapper<Object> wrapper) {
+        return baseMapper.getList(wrapper);
+    }
 }

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

@@ -410,8 +410,7 @@ 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<ExtQuotationProductBom> bomList = extQuotationProductBomService.list(q -> q.in(ExtQuotationProductBom::getQuotationProductId, qpIds));
-            List<ExtQuotationProductBomVo> quotationProductBomVos = BeanUtil.copyToList(bomList, ExtQuotationProductBomVo.class);
+            List<ExtQuotationProductBomVo> quotationProductBomVos = extQuotationProductBomService.getList(IWrapper.getWrapper().in("eqpb", ExtQuotationProductBom::getQuotationProductId, qpIds));
             //赋值产品信息
             productInfoService.attributeAssign(quotationProductBomVos, ExtQuotationProductBom::getMaterialId, (item, productInfo) -> {
                 item.setProductCode(productInfo.getCustomCode());

+ 7 - 0
hx-sale/src/main/java/com/fjhx/sale/service/quotation/QuotationProductBomService.java

@@ -1,7 +1,12 @@
 package com.fjhx.sale.service.quotation;
 
 import com.fjhx.sale.entity.quotation.po.QuotationProductBom;
+import com.fjhx.sale.entity.quotation.vo.QuotationProductBomVo;
 import com.ruoyi.common.core.service.BaseService;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 /**
@@ -14,4 +19,6 @@ import com.ruoyi.common.core.service.BaseService;
  */
 public interface QuotationProductBomService extends BaseService<QuotationProductBom> {
 
+    List<QuotationProductBomVo> getList(@Param("ew") IWrapper<Object> wrapper);
+
 }

+ 8 - 0
hx-sale/src/main/java/com/fjhx/sale/service/quotation/impl/QuotationProductBomServiceImpl.java

@@ -2,10 +2,14 @@ package com.fjhx.sale.service.quotation.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.sale.entity.quotation.po.QuotationProductBom;
+import com.fjhx.sale.entity.quotation.vo.QuotationProductBomVo;
 import com.fjhx.sale.mapper.quotation.QuotationProductBomMapper;
 import com.fjhx.sale.service.quotation.QuotationProductBomService;
+import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -18,4 +22,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class QuotationProductBomServiceImpl extends ServiceImpl<QuotationProductBomMapper, QuotationProductBom> implements QuotationProductBomService {
 
+    @Override
+    public List<QuotationProductBomVo> getList(IWrapper<Object> wrapper) {
+        return baseMapper.getList(wrapper);
+    }
 }

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

@@ -429,8 +429,7 @@ 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<QuotationProductBom> bomList = quotationProductBomService.list(q -> q.in(QuotationProductBom::getQuotationProductId, qpIds));
-            List<QuotationProductBomVo> quotationProductBomVos = BeanUtil.copyToList(bomList, QuotationProductBomVo.class);
+            List<QuotationProductBomVo> quotationProductBomVos = quotationProductBomService.getList(IWrapper.getWrapper().in("qpb", QuotationProductBom::getQuotationProductId, qpIds));
             //赋值产品信息
             productInfoService.attributeAssign(quotationProductBomVos, QuotationProductBom::getMaterialId, (item, productInfo) -> {
                 item.setProductCode(productInfo.getCustomCode());

+ 7 - 0
hx-sale/src/main/resources/mapper/ext/ExtQuotationProductBomMapper.xml

@@ -1,4 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fjhx.sale.mapper.ext.ExtQuotationProductBomMapper">
+    <select id="getList" resultType="com.fjhx.sale.entity.ext.vo.ExtQuotationProductBomVo">
+        SELECT eqpb.*,
+               pp.`name` AS materialName
+        FROM ext_quotation_product_bom eqpb
+                 LEFT JOIN production_processes pp ON eqpb.material_id = pp.id
+            ${ew.customSqlSegment}
+    </select>
 </mapper>

+ 8 - 0
hx-sale/src/main/resources/mapper/quotation/QuotationProductBomMapper.xml

@@ -1,4 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fjhx.sale.mapper.quotation.QuotationProductBomMapper">
+    <select id="getList" resultType="com.fjhx.sale.entity.quotation.vo.QuotationProductBomVo">
+        SELECT qpb.*,
+               pp.`name` AS processesName,
+               pp.`name` AS materialName
+        FROM quotation_product_bom qpb
+                 LEFT JOIN production_processes pp ON qpb.material_id = pp.id
+            ${ew.customSqlSegment}
+    </select>
 </mapper>