Selaa lähdekoodia

对内报价单

yzc 1 vuosi sitten
vanhempi
commit
140ac58047

+ 20 - 0
hx-sale/src/main/java/com/fjhx/sale/controller/quotation/QuotationProductCustomInfoController.java

@@ -0,0 +1,20 @@
+package com.fjhx.sale.controller.quotation;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * <p>
+ * sale_对内报价单产品定制信息 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2024-02-18
+ */
+@RestController
+@RequestMapping("/quotationProductCustomInfo")
+public class QuotationProductCustomInfoController {
+
+
+}

+ 22 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/quotation/dto/QuotationProductCustomInfoDto.java

@@ -0,0 +1,22 @@
+package com.fjhx.sale.entity.quotation.dto;
+
+import com.fjhx.file.entity.ObsFile;
+import com.fjhx.sale.entity.quotation.po.QuotationProductCustomInfo;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * sale_对内报价单产品定制信息新增编辑入参实体
+ *
+ * @author
+ * @since 2024-02-18
+ */
+@Getter
+@Setter
+public class QuotationProductCustomInfoDto extends QuotationProductCustomInfo {
+
+    private List<ObsFile> fileList;
+
+}

+ 17 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/quotation/dto/QuotationProductCustomInfoSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.sale.entity.quotation.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * sale_对内报价单产品定制信息列表查询入参实体
+ *
+ * @author
+ * @since 2024-02-18
+ */
+@Getter
+@Setter
+public class QuotationProductCustomInfoSelectDto extends BaseSelectDto {
+
+}

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/quotation/dto/QuotationProductDto.java

@@ -21,4 +21,9 @@ public class QuotationProductDto extends QuotationProduct {
      */
     private List<QuotationProductBomDto> quotationProductBomList;
 
+    /**
+     * 报价产品定制信息列表
+     */
+    private List<QuotationProductCustomInfoDto> quotationProductCustomInfoList;
+
 }

+ 67 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/quotation/po/QuotationProduct.java

@@ -74,4 +74,71 @@ public class QuotationProduct extends BasePo {
      * 放大比例
      */
     private BigDecimal amplifyRatio;
+    //----------------------------------------
+    /**
+     * 商品名称
+     */
+    private String productCode;
+    /**
+     * 产品长
+     */
+    private BigDecimal productLength;
+    /**
+     * 产品宽
+     */
+    private BigDecimal productWidth;
+    /**
+     * 产品高
+     */
+    private BigDecimal productHeight;
+    /**
+     * 产品颜色
+     */
+    private String productColor;
+    /**
+     * 色卡号
+     */
+    private String colorCardCode;
+    /**
+     * 净重
+     */
+    private BigDecimal netWeight;
+
+    /**
+     * LOGO长
+     */
+    private BigDecimal logoLength;
+    /**
+     * LOGO宽
+     */
+    private BigDecimal logoWidth;
+    /**
+     * LOGO高
+     */
+    private BigDecimal logoHeight;
+    /**
+     * 几色印刷
+     */
+    private Integer colorCount;
+    /**
+     * 是否折叠
+     */
+    private Integer isFold;
+    /**
+     * 折叠数 字典(fold_way)
+     */
+    private String foldWay;
+    /**
+     * 包装要求 字典(pack_ask)
+     */
+    private String packAsk;
+    /**
+     * 是否定制
+     */
+    private Integer isCustomized;
+
+    /**
+     * 原材料id
+     */
+    private Long rawMaterialId;
 }

+ 4 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/quotation/po/QuotationProductBom.java

@@ -79,4 +79,8 @@ public class QuotationProductBom extends BasePo {
     private Integer type;
 
 
+    /**
+     * 报价表ID
+     */
+    private Long saleQuotationId;
 }

+ 51 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/quotation/po/QuotationProductCustomInfo.java

@@ -0,0 +1,51 @@
+package com.fjhx.sale.entity.quotation.po;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.core.domain.BasePo;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * sale_对内报价单产品定制信息
+ * </p>
+ *
+ * @author
+ * @since 2024-02-18
+ */
+@Getter
+@Setter
+@TableName("quotation_product_custom_info")
+public class QuotationProductCustomInfo extends BasePo {
+
+    /**
+     * 产品id
+     */
+    private Long productId;
+
+    /**
+     * 类型 1定制刀模 2定制纹路 3定制模具
+     */
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 是否勾选
+     */
+    private Integer isCheck;
+
+    /**
+     * 报价表ID
+     */
+    private Long saleQuotationId;
+
+    /**
+     * 报价产品id
+     */
+    private Long quotationProductId;
+
+}

+ 22 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/quotation/vo/QuotationProductCustomInfoVo.java

@@ -0,0 +1,22 @@
+package com.fjhx.sale.entity.quotation.vo;
+
+import com.fjhx.file.entity.FileInfoVo;
+import com.fjhx.sale.entity.quotation.po.QuotationProductCustomInfo;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * sale_对内报价单产品定制信息列表查询返回值实体
+ *
+ * @author
+ * @since 2024-02-18
+ */
+@Getter
+@Setter
+public class QuotationProductCustomInfoVo extends QuotationProductCustomInfo {
+
+    List<FileInfoVo> fileList;
+
+}

+ 2 - 1
hx-sale/src/main/java/com/fjhx/sale/entity/quotation/vo/QuotationProductVo.java

@@ -24,11 +24,12 @@ public class QuotationProductVo extends QuotationProduct {
     private BigDecimal productWidth;
     private BigDecimal productHeight;
 
-    private String productColor;
 
     /**
      * 报价信息
      */
     List<QuotationEstimateVo> quotationEstimateList;
 
+    List<QuotationProductCustomInfoVo> quotationProductCustomInfoList;
+
 }

+ 17 - 0
hx-sale/src/main/java/com/fjhx/sale/mapper/quotation/QuotationProductCustomInfoMapper.java

@@ -0,0 +1,17 @@
+package com.fjhx.sale.mapper.quotation;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fjhx.sale.entity.quotation.po.QuotationProductCustomInfo;
+
+
+/**
+ * <p>
+ * sale_对内报价单产品定制信息 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2024-02-18
+ */
+public interface QuotationProductCustomInfoMapper extends BaseMapper<QuotationProductCustomInfo> {
+
+}

+ 17 - 0
hx-sale/src/main/java/com/fjhx/sale/service/quotation/QuotationProductCustomInfoService.java

@@ -0,0 +1,17 @@
+package com.fjhx.sale.service.quotation;
+
+import com.fjhx.sale.entity.quotation.po.QuotationProductCustomInfo;
+import com.ruoyi.common.core.service.BaseService;
+
+
+/**
+ * <p>
+ * sale_对内报价单产品定制信息 服务类
+ * </p>
+ *
+ * @author
+ * @since 2024-02-18
+ */
+public interface QuotationProductCustomInfoService extends BaseService<QuotationProductCustomInfo> {
+
+}

+ 21 - 0
hx-sale/src/main/java/com/fjhx/sale/service/quotation/impl/QuotationProductCustomInfoServiceImpl.java

@@ -0,0 +1,21 @@
+package com.fjhx.sale.service.quotation.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.sale.entity.quotation.po.QuotationProductCustomInfo;
+import com.fjhx.sale.mapper.quotation.QuotationProductCustomInfoMapper;
+import com.fjhx.sale.service.quotation.QuotationProductCustomInfoService;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * <p>
+ * sale_对内报价单产品定制信息 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2024-02-18
+ */
+@Service
+public class QuotationProductCustomInfoServiceImpl extends ServiceImpl<QuotationProductCustomInfoMapper, QuotationProductCustomInfo> implements QuotationProductCustomInfoService {
+
+}

+ 43 - 3
hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java

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

+ 4 - 0
hx-sale/src/main/resources/mapper/quotation/QuotationProductCustomInfoMapper.xml

@@ -0,0 +1,4 @@
+<?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.QuotationProductCustomInfoMapper">
+</mapper>