Explorar el Código

对外报价单

yzc hace 1 año
padre
commit
e599462817

+ 20 - 0
hx-sale/src/main/java/com/fjhx/sale/controller/ext/ExtQuotationProductCustomInfoController.java

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

+ 22 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/dto/ExtQuotationProductCustomInfoDto.java

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

+ 17 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/dto/ExtQuotationProductCustomInfoSelectDto.java

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

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/dto/ExtQuotationProductDto.java

@@ -21,4 +21,9 @@ public class ExtQuotationProductDto extends ExtQuotationProduct {
      */
     private List<ExtQuotationProductBomDto> quotationProductBomList;
 
+    /**
+     * 报价产品定制信息列表
+     */
+    private List<ExtQuotationProductCustomInfoDto> quotationProductCustomInfoList;
+
 }

+ 68 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/po/ExtQuotationProduct.java

@@ -65,4 +65,72 @@ public class ExtQuotationProduct extends BasePo {
      */
     private Long quotationProductId;
 
+    //----------------------------------------
+    /**
+     * 商品名称
+     */
+    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;
+
 }

+ 2 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/po/ExtQuotationProductBom.java

@@ -83,4 +83,6 @@ public class ExtQuotationProductBom extends BasePo {
      */
     private Integer type;
 
+    private Long extQuotationId;
+
 }

+ 51 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/po/ExtQuotationProductCustomInfo.java

@@ -0,0 +1,51 @@
+package com.fjhx.sale.entity.ext.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-19
+ */
+@Getter
+@Setter
+@TableName("ext_quotation_product_custom_info")
+public class ExtQuotationProductCustomInfo extends BasePo {
+
+    /**
+     * 产品id
+     */
+    private Long productId;
+
+    /**
+     * 类型 1定制刀模 2定制纹路 3定制模具
+     */
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 是否勾选
+     */
+    private Integer isCheck;
+
+    /**
+     * 报价表ID
+     */
+    private Long extQuotationId;
+
+    /**
+     * 报价产品id
+     */
+    private Long extQuotationProductId;
+
+}

+ 22 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/vo/ExtQuotationProductCustomInfoVo.java

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

+ 3 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/vo/ExtQuotationProductVo.java

@@ -30,4 +30,7 @@ public class ExtQuotationProductVo extends ExtQuotationProduct {
      */
     private String productProdImgPath;
 
+
+    List<ExtQuotationProductCustomInfoVo> quotationProductCustomInfoList;
+
 }

+ 17 - 0
hx-sale/src/main/java/com/fjhx/sale/mapper/ext/ExtQuotationProductCustomInfoMapper.java

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

+ 17 - 0
hx-sale/src/main/java/com/fjhx/sale/service/ext/ExtQuotationProductCustomInfoService.java

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

+ 21 - 0
hx-sale/src/main/java/com/fjhx/sale/service/ext/impl/ExtQuotationProductCustomInfoServiceImpl.java

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

+ 44 - 12
hx-sale/src/main/java/com/fjhx/sale/service/ext/impl/ExtQuotationServiceImpl.java

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

+ 4 - 0
hx-sale/src/main/resources/mapper/ext/ExtQuotationProductCustomInfoMapper.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.ext.ExtQuotationProductCustomInfoMapper">
+</mapper>