소스 검색

报价单转合同相关问题处理

yzc 1 년 전
부모
커밋
1f71a3f896

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

@@ -17,6 +17,7 @@ import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.common.entity.AvailableStockBo;
 import com.fjhx.common.service.file.FtpFileService;
 import com.fjhx.common.service.file.impl.FtpFileServiceImpl;
+import com.fjhx.common.utils.Assert;
 import com.fjhx.file.entity.FileInfoVo;
 import com.fjhx.file.utils.ObsFileUtil;
 import com.fjhx.item.entity.product.ProcessesBo;
@@ -338,11 +339,17 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         if (ObjectUtil.isNull(productBomDetailList)) {
             productBomDetailList = new ArrayList<>();
         }
-        productBomDetailList.forEach(item -> item.setProductId(productInfoDto.getId()));
+        for (ProductBomDetail productBomDetail : productBomDetailList) {
+            productBomDetail.setProductId(productInfoDto.getId());
+            Assert.notEmpty(productBomDetail.getMaterialId(), "物料id不能为空!");
+        }
         productBomDetailService.saveBatch(productBomDetailList);
 
         //保存产品定制信息
         saveOrEditCustomInfo(productInfoDto);
+        if (true) {
+            throw new ServiceException("1111111111111111111");
+        }
     }
 
 //    /**

+ 2 - 0
hx-oa/src/main/java/com/fjhx/oa/entity/invoice/po/InvoiceTaxDeduction.java

@@ -1,5 +1,6 @@
 package com.fjhx.oa.entity.invoice.po;
 
+import com.alibaba.fastjson.annotation.JSONField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.core.domain.BasePo;
@@ -52,6 +53,7 @@ public class InvoiceTaxDeduction extends BasePo {
      * 抵扣工资月
      */
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM")
+    @JSONField(format = "yyyy-MM")
     private Date deductionSalaryMonth;
 
     /**

+ 1 - 1
hx-oa/src/main/java/com/fjhx/oa/service/invoice/impl/InvoiceTaxDeductionServiceImpl.java

@@ -95,7 +95,7 @@ public class InvoiceTaxDeductionServiceImpl extends ServiceImpl<InvoiceTaxDeduct
         detailsList.stream().forEach(item -> item.setInvoiceTaxDeductionId(dto.getId()));
         invoiceTaxDeductionDetailsService.editLinked(detailsList, InvoiceTaxDeductionDetails::getInvoiceTaxDeductionId, dto.getId());
         for (InvoiceTaxDeductionDetails details : detailsList) {
-            ObsFileUtil.editFile(details.getFileList(), dto.getId());
+            ObsFileUtil.editFile(details.getFileList(), details.getId());
         }
     }
 

+ 2 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/contract/po/ContractProduct.java

@@ -110,6 +110,8 @@ public class ContractProduct extends BasePo {
      */
     private Long oldContractProductId;
 
+    private BigDecimal businessCostPrice;
+
     //==========================================================================================================
     /**
      * 附件列表

+ 4 - 0
hx-sale/src/main/java/com/fjhx/sale/mapper/ext/ExtQuotationProductMapper.java

@@ -7,6 +7,8 @@ import com.fjhx.sale.entity.ext.vo.ExtQuotationProductVo;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -19,4 +21,6 @@ import org.apache.ibatis.annotations.Param;
 public interface ExtQuotationProductMapper extends BaseMapper<ExtQuotationProduct> {
 
     Page<ExtQuotationProductVo> waitCreateProductPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<ExtQuotationProduct> wrapper);
+
+    List<ExtQuotationProductVo> getList(@Param("ew") IWrapper wrapper);
 }

+ 6 - 0
hx-sale/src/main/java/com/fjhx/sale/service/ext/ExtQuotationProductService.java

@@ -6,6 +6,9 @@ import com.fjhx.sale.entity.ext.dto.ExtQuotationProductSelectDto;
 import com.fjhx.sale.entity.ext.po.ExtQuotationProduct;
 import com.fjhx.sale.entity.ext.vo.ExtQuotationProductVo;
 import com.ruoyi.common.core.service.BaseService;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+
+import java.util.List;
 
 
 /**
@@ -29,4 +32,7 @@ public interface ExtQuotationProductService extends BaseService<ExtQuotationProd
      * 创建产品
      */
     void createProduct(ProductInfoDto productInfoDto);
+
+    List<ExtQuotationProductVo> getList(IWrapper wrapper);
+
 }

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

@@ -225,4 +225,9 @@ public class ExtQuotationProductServiceImpl extends ServiceImpl<ExtQuotationProd
             );
         }
     }
+
+    @Override
+    public List<ExtQuotationProductVo> getList(IWrapper wrapper) {
+        return baseMapper.getList(wrapper);
+    }
 }

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

@@ -415,8 +415,7 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
         //获取id列表
         List<Long> ids = extQuotationVos.stream().map(ExtQuotation::getId).collect(Collectors.toList());
         //获取子产品列表
-        List<ExtQuotationProduct> productList = extQuotationProductService.list(q -> q.in(ExtQuotationProduct::getSaleQuotationId, ids));
-        List<ExtQuotationProductVo> quotationProductVos = BeanUtil.copyToList(productList, ExtQuotationProductVo.class);
+        List<ExtQuotationProductVo> quotationProductVos = extQuotationProductService.getList(IWrapper.getWrapper().in("eqp", ExtQuotationProduct::getSaleQuotationId, ids));
         Map<Long, List<ExtQuotationProductVo>> productMap = quotationProductVos.stream().collect(Collectors.groupingBy(ExtQuotationProductVo::getSaleQuotationId));
         //赋值产品信息
         productInfoService.attributeAssign(quotationProductVos, ExtQuotationProductVo::getProductId, (item, productInfo) -> {
@@ -428,7 +427,7 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
             item.setProductColor(productInfo.getColor());
         });
         //获取配件列表
-        List<Long> qpIds = productList.stream().map(ExtQuotationProduct::getId).collect(Collectors.toList());
+        List<Long> qpIds = quotationProductVos.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()

+ 2 - 1
hx-sale/src/main/resources/mapper/contract/ContractProductMapper.xml

@@ -19,7 +19,8 @@
                                      LIMIT 1)               AS claimTime,
                t2.contract_template_id AS contractTemplateId,
                t1.quantity,
-               t2.company_id
+               t2.company_id,
+               t1.business_cost_price
         FROM contract_product t1
             LEFT JOIN contract t2
             LEFT JOIN claim_contract co

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

@@ -14,4 +14,11 @@
                  JOIN sale_quotation sq ON eq.sale_quotation_id = sq.id
             ${ew.customSqlSegment}
     </select>
+    <select id="getList" resultType="com.fjhx.sale.entity.ext.vo.ExtQuotationProductVo">
+        SELECT eqp.*,
+               qp.business_cost_price
+        FROM ext_quotation_product eqp
+                 LEFT JOIN quotation_product qp ON eqp.quotation_product_id = qp.id
+            ${ew.customSqlSegment}
+    </select>
 </mapper>