Browse Source

Merge branch 'mall' into dev

hulh 8 years ago
parent
commit
f5d5b784ec

+ 4 - 0
pom.xml

@@ -46,6 +46,10 @@
             <groupId>org.springframework</groupId>
             <artifactId>spring-tx</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-webmvc</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-core</artifactId>

+ 139 - 0
src/main/java/com/uas/ps/brand/entity/BrandInfo.java

@@ -0,0 +1,139 @@
+package com.uas.ps.brand.entity;
+
+import java.util.Date;
+
+/**
+ * 品牌简要信息
+ * @author hulh
+ */
+public class BrandInfo {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * uuid
+     */
+    private String uuid;
+
+    /**
+     * 版本号
+     */
+    private Short version;
+
+    /**
+     * 品牌中文名称
+     */
+    private String nameCn;
+
+    /**
+     * 品牌英文名称
+     */
+    private String nameEn;
+
+    /**
+     * logo路径
+     */
+    private String logoUrl;
+
+    /**
+     * 权重,可用于排序
+     */
+    private Double weight;
+
+    private String vendor;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 英文品牌名首字母
+     */
+    private String inital;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getUuid() {
+        return uuid;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+
+    public Short getVersion() {
+        return version;
+    }
+
+    public void setVersion(Short version) {
+        this.version = version;
+    }
+
+    public String getNameCn() {
+        return nameCn;
+    }
+
+    public void setNameCn(String nameCn) {
+        this.nameCn = nameCn;
+    }
+
+    public String getNameEn() {
+        return nameEn;
+    }
+
+    public void setNameEn(String nameEn) {
+        this.nameEn = nameEn;
+    }
+
+    public String getLogoUrl() {
+        return logoUrl;
+    }
+
+    public void setLogoUrl(String logoUrl) {
+        this.logoUrl = logoUrl;
+    }
+
+    public Double getWeight() {
+        return weight;
+    }
+
+    public void setWeight(Double weight) {
+        this.weight = weight;
+    }
+
+    public String getVendor() {
+        return vendor;
+    }
+
+    public void setVendor(String vendor) {
+        this.vendor = vendor;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getInital() {
+        return inital;
+    }
+
+    public void setInital(String inital) {
+        this.inital = inital;
+    }
+
+}
+

+ 357 - 0
src/main/java/com/uas/ps/component/entity/ComponentInfo.java

@@ -0,0 +1,357 @@
+package com.uas.ps.component.entity;
+
+import com.uas.ps.brand.entity.BrandInfo;
+import com.uas.ps.kind.entity.KindInfo;
+
+/**
+ * 器件简要信息
+ * @author hulh
+ */
+public class ComponentInfo {
+    /**
+     * 序列号
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 器件的uuid
+     */
+    private String uuid;
+
+    /**
+     * 版本
+     */
+    private Short version;
+
+    /**
+     * 原厂型号
+     */
+    private String code;
+
+    /**
+     * 类目id
+     */
+    private Long kindid;
+
+    /**
+     * 器件的类目
+     */
+    private KindInfo kind;
+
+    /**
+     * 品牌id
+     */
+    private Long brandid;
+
+    /**
+     * 器件的品牌
+     */
+    private BrandInfo brand;
+
+    /**
+     * 器件规格
+     */
+    private String encapsulation;
+
+    /**
+     * 器件的标准单位
+     */
+    private String unit;
+
+    /**
+     * 单重(g)
+     */
+    private Float weight;
+
+    /**
+     * 搜索排序权重
+     */
+    private Double searchWeight;
+
+    /**
+     * 附件id
+     */
+    private String attach;
+
+    /**
+     * 图片path
+     */
+    private String img;
+
+    /**
+     * 以下为器件的库存交易属性,由器件对应的上架商品发生变化时,更新反应到器件
+     */
+
+    /**
+     * 器件的库存
+     */
+    private Double reserve;
+
+    /**
+     * 器件的库存类型
+     */
+    private Short reserveType;
+
+    /**
+     * 器件的最低单价
+     */
+    private Double minPrice;
+
+    /**
+     * 器件的最高单价
+     */
+    private Double maxPrice;
+
+    /**
+     * 器件的最小起订量
+     */
+    private Double minBuyQty;
+
+    /**
+     * 器件最小送货周期
+     */
+    private Short minDelivery;
+
+    /**
+     * 器件最大送货周期
+     */
+    private Short maxDelivery;
+
+    /**
+     * 交易订单数 - 来自订单表中统计订单数
+     */
+    private Double orderNumber;
+
+    /**
+     * 交易数量 - 来自订单表中统计交易数量
+     */
+    private Double orderQty;
+
+    /**
+     * 样品数量汇总
+     */
+    private Double sampleQty;
+
+    /**
+     * 现货数量
+     */
+    private Double originalQty;
+
+    /**
+     * 呆滞库存数量
+     */
+    private Double inactionStockQty;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getUuid() {
+        return uuid;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+
+    public Short getVersion() {
+        return version;
+    }
+
+    public void setVersion(Short version) {
+        this.version = version;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public Long getKindid() {
+        return kindid;
+    }
+
+    public void setKindid(Long kindid) {
+        this.kindid = kindid;
+    }
+
+    public KindInfo getKind() {
+        return kind;
+    }
+
+    public void setKind(KindInfo kind) {
+        this.kind = kind;
+    }
+
+    public Long getBrandid() {
+        return brandid;
+    }
+
+    public void setBrandid(Long brandid) {
+        this.brandid = brandid;
+    }
+
+    public BrandInfo getBrand() {
+        return brand;
+    }
+
+    public void setBrand(BrandInfo brand) {
+        this.brand = brand;
+    }
+
+    public String getEncapsulation() {
+        return encapsulation;
+    }
+
+    public void setEncapsulation(String encapsulation) {
+        this.encapsulation = encapsulation;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public Float getWeight() {
+        return weight;
+    }
+
+    public void setWeight(Float weight) {
+        this.weight = weight;
+    }
+
+    public Double getSearchWeight() {
+        return searchWeight;
+    }
+
+    public void setSearchWeight(Double searchWeight) {
+        this.searchWeight = searchWeight;
+    }
+
+    public String getAttach() {
+        return attach;
+    }
+
+    public void setAttach(String attach) {
+        this.attach = attach;
+    }
+
+    public String getImg() {
+        return img;
+    }
+
+    public void setImg(String img) {
+        this.img = img;
+    }
+
+    public Double getReserve() {
+        return reserve;
+    }
+
+    public void setReserve(Double reserve) {
+        this.reserve = reserve;
+    }
+
+    public Short getReserveType() {
+        return reserveType;
+    }
+
+    public void setReserveType(Short reserveType) {
+        this.reserveType = reserveType;
+    }
+
+    public Double getMinPrice() {
+        return minPrice;
+    }
+
+    public void setMinPrice(Double minPrice) {
+        this.minPrice = minPrice;
+    }
+
+    public Double getMaxPrice() {
+        return maxPrice;
+    }
+
+    public void setMaxPrice(Double maxPrice) {
+        this.maxPrice = maxPrice;
+    }
+
+    public Double getMinBuyQty() {
+        return minBuyQty;
+    }
+
+    public void setMinBuyQty(Double minBuyQty) {
+        this.minBuyQty = minBuyQty;
+    }
+
+    public Short getMinDelivery() {
+        return minDelivery;
+    }
+
+    public void setMinDelivery(Short minDelivery) {
+        this.minDelivery = minDelivery;
+    }
+
+    public Short getMaxDelivery() {
+        return maxDelivery;
+    }
+
+    public void setMaxDelivery(Short maxDelivery) {
+        this.maxDelivery = maxDelivery;
+    }
+
+    public Double getOrderNumber() {
+        return orderNumber;
+    }
+
+    public void setOrderNumber(Double orderNumber) {
+        this.orderNumber = orderNumber;
+    }
+
+    public Double getOrderQty() {
+        return orderQty;
+    }
+
+    public void setOrderQty(Double orderQty) {
+        this.orderQty = orderQty;
+    }
+
+    public Double getSampleQty() {
+        return sampleQty;
+    }
+
+    public void setSampleQty(Double sampleQty) {
+        this.sampleQty = sampleQty;
+    }
+
+    public Double getOriginalQty() {
+        return originalQty;
+    }
+
+    public void setOriginalQty(Double originalQty) {
+        this.originalQty = originalQty;
+    }
+
+    public Double getInactionStockQty() {
+        return inactionStockQty;
+    }
+
+    public void setInactionStockQty(Double inactionStockQty) {
+        this.inactionStockQty = inactionStockQty;
+    }
+}

+ 86 - 0
src/main/java/com/uas/ps/kind/entity/KindInfo.java

@@ -0,0 +1,86 @@
+package com.uas.ps.kind.entity;
+
+/**
+ * 类目简要信息
+ * @author hulh
+ */
+public class KindInfo {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 类目名称
+     */
+    private String nameCn;
+
+    /**
+     * 英文名
+     */
+    private String nameEn;
+
+    /**
+     * 是否为叶子类目 1是 0否
+     */
+    private Short isLeaf;
+
+    /**
+     * 父节点id
+     */
+    private Long parentid;
+
+    /**
+     * 类目的层级,从1开始,1、2、3、4
+     */
+    private Short level;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getNameCn() {
+        return nameCn;
+    }
+
+    public void setNameCn(String nameCn) {
+        this.nameCn = nameCn;
+    }
+
+    public String getNameEn() {
+        return nameEn;
+    }
+
+    public void setNameEn(String nameEn) {
+        this.nameEn = nameEn;
+    }
+
+    public Short getIsLeaf() {
+        return isLeaf;
+    }
+
+    public void setIsLeaf(Short isLeaf) {
+        this.isLeaf = isLeaf;
+    }
+
+    public Long getParentid() {
+        return parentid;
+    }
+
+    public void setParentid(Long parentid) {
+        this.parentid = parentid;
+    }
+
+    public Short getLevel() {
+        return level;
+    }
+
+    public void setLevel(Short level) {
+        this.level = level;
+    }
+}

+ 22 - 0
src/main/java/com/uas/ps/product/ProductConstant.java

@@ -0,0 +1,22 @@
+package com.uas.ps.product;
+
+/**
+ * 物料常量
+ * @author hulh
+ */
+public final class ProductConstant {
+
+    private ProductConstant() {
+
+    }
+
+    /**
+     * 标准
+     */
+    public static final Short STANDARD = 1;
+
+    /**
+     * 非准
+     */
+    public static final Short NON_STANDARD = 0;
+}

+ 24 - 4
src/main/java/com/uas/ps/product/controller/ProductController.java

@@ -16,10 +16,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -127,6 +124,29 @@ public class ProductController {
         return productService.match(enUU, userUU, type);
     }
 
+    /**
+     * 商城一键匹配
+     *
+     * @param enUU 企业UU
+     * @param userUU 用户UU
+     * @return
+     */
+    @RequestMapping(value = "/match/nonProduct", method = RequestMethod.POST)
+    @ResponseBody
+    public ModelMap matchB2cAll(@RequestParam Long enUU, @RequestParam Long userUU) {
+        return productService.matchB2cAll(enUU, userUU);
+    }
+
+    /**
+     * 匹配选中的列表
+     * @param idList
+     * @return
+     */
+    @RequestMapping(value = "/match/selected", method = RequestMethod.POST)
+    public ModelMap matchSelected(@RequestParam Long enUU, @RequestBody List<Long> idList) {
+        return productService.batchMatch(enUU, idList);
+    }
+
     /**
      * 分配个人物料
      *

+ 19 - 0
src/main/java/com/uas/ps/product/repository/ProductDao.java

@@ -1,6 +1,7 @@
 package com.uas.ps.product.repository;
 
 import com.uas.ps.entity.Product;
+import com.uas.ps.product.entity.Prod;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.stereotype.Repository;
@@ -22,6 +23,14 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
      */
     List<Product> findByEnUUAndCode(Long pr_enuu, String pr_code);
 
+    /**
+     * 查找企业下所有标准或非标物料
+     * @param enUU
+     * @param standard
+     * @return
+     */
+    List<Product> findByEnUUAndStandard(Long enUU, Short standard);
+
     /**
      * 根据物料所属enUU、来源app和下载状态查询物料
      * @param enUU 物料企业UU
@@ -61,6 +70,16 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
      */
     List<Product> findByTitleAndPCmpCodeAndPBrandAndEnUU(String title, String cmpcode, String brand, Long enUU);
 
+    /**
+     * 根据以下字段查询物料
+     *
+     * @param pcmpcode  物料型号
+     * @param pbranden  物料品牌
+     * @param enUU      企业uu
+     * @return
+     */
+    List<Product> findProductByPcmpcodeAndPbrandenAndEnUU(String pcmpcode, String pbranden, Long enUU);
+
 //    /**
 //     * 通过uu查询非标准器件进行存储
 //     *

+ 19 - 0
src/main/java/com/uas/ps/product/service/ProductService.java

@@ -5,6 +5,7 @@ import com.uas.ps.product.entity.Prod;
 import com.uas.ps.product.entity.ProductSaler;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.List;
 
@@ -49,6 +50,16 @@ public interface ProductService {
      */
     ModelMap match(Long enUU, Long userUU, String type);
 
+    /**
+     * 通过 enUU 查询非标准器件进行匹配
+     *
+     * @param enUU 企业UU
+     * @param userUU 用户UU
+     * @return
+     */
+    ModelMap matchB2cAll(Long enUU, Long userUU);
+
+
     /**
      * 分配个人物料
      *
@@ -112,4 +123,12 @@ public interface ProductService {
      * @return
      */
     ModelMap releaseByWorkbook(Workbook workbook, Long enUU, Long userUU);
+
+    /**
+     * 匹配选中的物料
+     * @param enUU
+     * @param idList
+     * @return
+     */
+    ModelMap batchMatch(Long enUU, List<Long> idList);
 }

+ 133 - 43
src/main/java/com/uas/ps/product/service/impl/ProductServiceImpl.java

@@ -1,8 +1,13 @@
 package com.uas.ps.product.service.impl;
 
+import com.alibaba.fastjson.JSON;
+import com.uas.ps.brand.entity.BrandInfo;
+import com.uas.ps.component.entity.ComponentInfo;
 import com.uas.ps.entity.Product;
+import com.uas.ps.entity.ProductMatchResult;
 import com.uas.ps.entity.ProductUsers;
 import com.uas.ps.entity.Status;
+import com.uas.ps.product.ProductConstant;
 import com.uas.ps.product.entity.Constant;
 import com.uas.ps.product.entity.Prod;
 import com.uas.ps.product.entity.ProductSaler;
@@ -11,6 +16,7 @@ import com.uas.ps.product.repository.ProductMatchResultDao;
 import com.uas.ps.product.repository.ProductStoreStatusDao;
 import com.uas.ps.product.repository.ProductUsersDao;
 import com.uas.ps.product.service.ProductService;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -18,12 +24,10 @@ import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.ui.ModelMap;
-import org.springframework.util.CollectionUtils;
+import org.springframework.web.client.RestTemplate;
 
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * @author sunyj
@@ -44,6 +48,9 @@ public class ProductServiceImpl implements ProductService {
     @Autowired
     private ProductStoreStatusDao productStoreStatusDao;
 
+    @Autowired
+    private RestTemplate restTemplate;
+
     /**
      * 保存物料
      *
@@ -85,48 +92,131 @@ public class ProductServiceImpl implements ProductService {
     @Override
     public ModelMap match(Long enUU, Long userUU, String matchtype) {
         ModelMap map = new ModelMap();
-        //TODO
-//        boolean flag = true;
-//        ProductStoreStatus status = productStoreStatusDao.findByEnuu(enUU);
-//        if (status != null) {
-//            if (status.getStatus().equals(Status.RUNNING.value())) {// 有人正在操作这张单据,不能进行操作
-//                map.put("error", "当前有人正在进行匹配操作,无法进行匹配");
-//                flag = false;
-//            } else {
-//                status.setStatus(Status.RUNNING.value());
-//                status = productStoreStatusDao.save(status);
-//            }
-//        } else {
-//            ProductStoreStatus stroestatus = new ProductStoreStatus();
-//            stroestatus.setDate(new Date());
-//            stroestatus.setEnuu(enUU);
-//            stroestatus.setUseruu(userUU);
-//            stroestatus.setStatus(Status.RUNNING.value());
-//            status = productStoreStatusDao.save(stroestatus);
-//        }
-//        String num = null;
-//        if (flag) {
-//            if (matchtype.equals("sale")) {
-//                num = productDao.updateResultByEnuuForSale(enUU);
-////                logger.log("产品匹配", "一键匹配了产品信息", "大小" + num);
-//            } else if (matchtype.equals("purc")) {
-//                num = productDao.updateResultByEnuuForPurc(enUU);
-////                logger.log("物料匹配", "一键匹配了物料信息", "大小" + num);
-//            } else if (matchtype.equals("all")) {
-//                num = productDao.updateResultByEnuu(enUU);
-////                logger.log("物料匹配", "一键匹配了产品(物料)信息", "大小" + num);
-//            }
-//            if (null == num) {
-//                map.put("size", 0);
-//            } else {
-//                map.put("size", num);
-//            }
-//            status.setStatus(Status.FINISH.value());
-//            productStoreStatusDao.save(status);
-//        }
         return map;
     }
 
+    @Override
+    public ModelMap matchB2cAll(Long enUU, Long userUU) {
+        ModelMap map = new ModelMap();
+        int success = 0;
+        List<Product> nonStandardList = productDao.findByEnUUAndStandard(enUU, ProductConstant.NON_STANDARD);
+        for (Product product : nonStandardList) {
+            success += matchOne(product, enUU);
+        }
+        map.put("success", success);
+        return map;
+    }
+
+    /**
+     * 批量匹配
+     * @param   enUU
+     * @param   idList
+     */
+    @Override
+    public ModelMap batchMatch(Long enUU, List<Long> idList) {
+        ModelMap map = new ModelMap();
+        int success = 0;
+        for (Long id : idList) {
+            Product product = productDao.findOne(id);
+            success += matchOne(product, enUU);
+        }
+        map.put("success", success);
+        return map;
+    }
+
+    /**
+     * 单个物料匹配
+     * @param   product
+     * @param   enUU
+     */
+    private int matchOne(Product product, Long enUU) {
+        // 获取品牌
+        String brandUrl = "http://10.1.51.89:8080/platform-b2c/api/product/brand/byName/brand?name=" + product.getpBrandEn();
+        BrandInfo brand = restTemplate.getForEntity(brandUrl, BrandInfo.class).getBody();
+        if (brand.getUuid() != null) {
+            String componentUrl = "http://10.1.51.89:8080/platform-b2c/api/product/component/codeAndBrand/info?brandId="
+                    + brand.getId() + "&cmpCode=" + product.getpCmpCode();
+            ComponentInfo component = restTemplate.getForEntity(componentUrl, ComponentInfo.class).getBody();
+            if (component != null) {
+                // 更新物料信息
+                updateProductByComponent(product, component);
+                List<Product> standardList = productDao.findProductByPcmpcodeAndPbrandenAndEnUU(product.getpCmpCode(), product.getpBrand(), enUU);
+                if (CollectionUtils.isNotEmpty(standardList)) {
+                    // TODO 已有标准产品,该如何处理
+                }
+                productDao.save(product);
+                return 1;
+            }
+        }
+        // 根据型号匹配
+        String codeUrl = "http://10.1.51.89:8080/platform-b2c/api/product/component/byCode?code=" + product.getpCmpCode();
+        String componentJson = restTemplate.getForEntity(codeUrl, String.class).getBody();
+        List<ComponentInfo> componentInfoList = JSON.parseArray(componentJson, ComponentInfo.class);
+        Set<ProductMatchResult> productMatchResults = convertComponentToResult(componentInfoList, enUU);
+        if (CollectionUtils.isNotEmpty(productMatchResults)) {
+            product.setMatchResults(productMatchResults);
+            productDao.save(product);
+        }
+        return 0;
+    }
+
+    /**
+     * 器件转化为ProductMatchResult list
+     * @param componentInfoList 器件list
+     * @param enUU  企业uu
+     * @return
+     */
+    private Set<ProductMatchResult> convertComponentToResult(List<ComponentInfo> componentInfoList, Long enUU) {
+        Set<ProductMatchResult> resultSet = new HashSet<>(componentInfoList.size());
+        for (ComponentInfo info : componentInfoList) {
+            ProductMatchResult result = convertOneInfoToResult(info, enUU);
+            resultSet.add(result);
+        }
+        return resultSet;
+    }
+
+    /**
+     * 将单个器件转化为ProductMatchResult实体
+     * @param info  单个器件
+     * @param enUU  企业uu
+     * @return
+     */
+    private ProductMatchResult convertOneInfoToResult(ComponentInfo info, Long enUU) {
+        ProductMatchResult result = new ProductMatchResult();
+        result.setBrandCn(info.getBrand().getNameCn());
+        result.setBrandEn(info.getBrand().getNameEn());
+        result.setBrandId(info.getBrand().getId());
+        result.setpBrandUuid(info.getBrand().getUuid());
+        result.setCmpCode(info.getCode());
+        result.setCmpId(info.getId());
+        result.setKindId(info.getKind().getId());
+        result.setKindCn(info.getKind().getNameCn());
+        result.setKindEn(info.getKind().getNameEn());
+        result.setUuid(info.getUuid());
+        result.setCmpImg(info.getImg());
+        result.setEnUU(enUU);
+        return result;
+    }
+
+    /**
+     * 匹配成标准后更新product信息
+     * @param product   物料
+     * @param component 器件
+     */
+    private void updateProductByComponent(Product product, ComponentInfo component) {
+        product.setCmpUuid(component.getUuid());
+        product.setCmpImg(component.getImg());
+        product.setpCmpCode(component.getCode());
+        product.setpBrandId(component.getBrand().getId());
+        product.setpBrand(component.getBrand().getNameCn());
+        product.setpBrandEn(component.getBrand().getNameEn());
+        product.setpBrandUuid(component.getBrand().getUuid());
+        product.setKind(component.getKind().getNameCn());
+        product.setKindEn(component.getKind().getNameEn());
+        product.setKindId(component.getKindid());
+        product.setStandard(ProductConstant.STANDARD);
+    }
+
     @Override
     public ModelMap assignPersonalProduct(Long userUU, Long productId) {
         ModelMap map = new ModelMap();