Explorar el Código

修改物料信息功能

yujia hace 7 años
padre
commit
54b6b1a386

+ 90 - 0
src/main/java/com/uas/platform/b2c/core/utils/StringUtilB2C.java

@@ -2,12 +2,16 @@ package com.uas.platform.b2c.core.utils;
 
 import com.alibaba.fastjson.JSON;
 import com.uas.platform.b2c.logistics.model.Receipt;
+import com.uas.platform.b2c.prod.commodity.constant.UploadConstant;
 import com.uas.platform.b2c.trade.order.model.StatusHistory;
 import com.uas.platform.b2c.trade.order.model.StatusHistorySimpleInfo;
+import com.uas.platform.b2c.trade.support.CodeType;
+import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.Type;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.util.StringUtils;
 
+import java.io.UnsupportedEncodingException;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -20,6 +24,11 @@ import java.util.regex.Pattern;
  */
 public class StringUtilB2C {
 
+	/**
+	 * 验证产品型号
+	 */
+	private static final Pattern codePattern = Pattern.compile(RegexConstant.LetterAndDigitAndEnglishSpecialCharacter);
+
 	/**
 	 * 重新组装好的String
 	 * 
@@ -316,4 +325,85 @@ public class StringUtilB2C {
             return input;
 		}
 	}
+
+	/**
+	 * 验证产品规范的品牌
+	 * @param brand
+	 * @return
+	 */
+	public static ResultMap validateBrand(String brand) {
+		if (StringUtils.isEmpty(brand)) {
+			return new ResultMap(CodeType.NOT_PERMIT, "品牌不能为空");
+		} else {
+			if (brand.length() > 50) {
+				return new ResultMap(CodeType.NOT_PERMIT, "品牌不能超过50个字符");
+			} else {
+				brand = StringUtilB2C.toEnglish(StringUtilB2C.getStr(brand));
+				return ResultMap.success(brand);
+			}
+		}
+	}
+
+	/**
+	 * 验证产品规范的型号
+	 * @param cmpCode
+	 * @return
+	 */
+	public static ResultMap validateCmpCode(String cmpCode) {
+		if (!StringUtils.isEmpty(cmpCode)) {
+			String code = cmpCode.toString().trim();
+			Matcher matcher = codePattern.matcher(code);
+			if (!matcher.find()) {
+				return new ResultMap(CodeType.PARAMETER_ERROR, "不能输入中文或中文特殊字符");
+			}
+			try {
+				if (code.getBytes("GBK").length > 100) {
+					return new ResultMap(CodeType.PARAMETER_ERROR, "产品型号不能超过100字符");
+				}
+			} catch (UnsupportedEncodingException e) {
+				throw new RuntimeException(e + "指定字符集不支持");
+			}
+		} else {
+			return new ResultMap(CodeType.PARAMETER_ERROR, "产品型号不能为空");
+		}
+		cmpCode = StringUtilB2C.getStr(cmpCode);
+		return ResultMap.success(cmpCode);
+	}
+
+	/**
+	 * 验证产品规范的物料名称(类目)
+	 * @param kind
+	 * @return
+	 */
+	public static ResultMap validateKind(String kind) {
+		if (StringUtils.isEmpty(kind)) {
+			return new ResultMap(CodeType.PARAMETER_ERROR.code(), "物料名称(类目)不能为空");
+		} else {
+			try {
+				if (kind.toString().getBytes("GBK").length > 20) {
+					return new ResultMap(CodeType.PARAMETER_ERROR.code(), "物料名称(类目)不能超过20个字符");
+				}
+			} catch (UnsupportedEncodingException e) {
+				throw new RuntimeException(e + "指定字符集不支持");
+			}
+		}
+		kind = StringUtilB2C.getStr(kind);
+		return ResultMap.success(kind);
+	}
+
+	/**
+	 * 验证产品规范的物料名称(类目)
+	 * @param spec
+	 * @return
+	 */
+	public static ResultMap validateSpec(String spec) {
+		if (!StringUtils.isEmpty(spec)) {
+			String str = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutStringIgnoreEncode(spec.toString(), UploadConstant.SPEC_MAX_BYTE);
+			return ResultMap.success(str);
+		} else {
+			return ResultMap.success("");
+		}
+	}
+
+
 }

+ 17 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/dao/GoodsDao.java

@@ -810,4 +810,21 @@ public interface GoodsDao extends JpaSpecificationExecutor<Goods>, JpaRepository
      */
     @Query(nativeQuery = true, value = "select * from trade$goods where br_name_uuid is not null and ki_name in (:kind) and go_status = 601 limit 0,8")
     List<Goods> findInKindNamesAndBrandIsNotNull(@Param("kind")List<String> kinds);
+
+    /**
+     * 根据物料信息更更新在售产品
+     * @param brandCn 中文品牌
+     * @param brandEn 英文品牌
+     * @param brandid 品牌id
+     * @param branduuid 品牌uuid
+     * @param kiName 类目
+     * @param kindId 类目id
+     * @param img 图片
+     * @param cmpUuid uuid
+     * @param spec 规格
+     * @param productid 物料的id
+     */
+    @Modifying
+    @Query(nativeQuery = true, value = "update trade$goods g set g.br_name_cn = :brandCn, g.br_name_en = :brandEn, g.br_name_id = :brandid, g.br_name_uuid = :branduuid, g.ki_name = :kiName, g.go_kind_uuid = :kindId, g.cmp_img = :img, g.cmp_uuid = :cmpUuid, g.go_spec = :spec where g.go_productid = :productid")
+    void updateGoodsByProduct(@Param("brandCn") String brandCn, @Param("brandEn") String brandEn, @Param("brandid") Long brandid, @Param("branduuid") String branduuid, @Param("kiName") String kiName, @Param("kindId") Long kindId, @Param("img") String img, @Param("cmpUuid") String cmpUuid, @Param("spec") String spec, @Param("productid") Long productid);
 }

+ 2 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java

@@ -77,7 +77,7 @@ public class Goods implements Serializable {
 	/**
 	 * 器件的附件URL
 	 */
-	@Transient
+	@Column(name = "cmp_attach")
 	private String attach;
 
 	/**
@@ -530,7 +530,7 @@ public class Goods implements Serializable {
 	/**
 	 * 规格信息
 	 */
-	@Column(name = "go_spec")
+	@Column(name = "go_spec", length = 4000)
 	private String spec;
 
 	@Transient

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsHistory.java

@@ -412,7 +412,7 @@ public class GoodsHistory {
 	/**
 	 * 规格信息
 	 */
-	@Column(name = "go_spec")
+	@Column(name = "go_spec", length = 4000)
 	private String spec;
 
 	/**

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsSimple.java

@@ -224,7 +224,7 @@ public class GoodsSimple {
 	/**
 	 * 规格信息
 	 */
-	@Column(name ="go_spec")
+	@Column(name ="go_spec", length = 4000)
 	private String spec;
 
 	/**

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -717,7 +717,7 @@ public class ReleaseProductByBatch implements Serializable {
 	}
 
 	/**
-	 * 交期赋值逻辑较为复杂,在调用类进行赋值
+	 * 规格信息
 	 * @param value
 	 */
 	public void setSpecByExcel(Object value) {

+ 7 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsService.java

@@ -753,4 +753,11 @@ public interface GoodsService {
      * @return
      */
     Map<String, List<Goods>> getCmsPcb();
+
+    /**
+     * 根据产品更新在售产品
+     * @param product 产品信息
+     * @return
+     */
+    void updateGoodsByProduct(Product product);
 }

+ 49 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -2534,7 +2534,10 @@ public class GoodsServiceImpl implements GoodsService {
                     }
                     componentMap.put(goods.getUuid(), component);
                 }
-                goods.setAttach(component.getAttach());
+                if (StringUtils.isEmpty(goods.getAttach())) {
+                    goods.setAttach(component.getAttach());
+                }
+
                 goods.setBrand(component.getBrand());
             }
         }
@@ -2600,7 +2603,7 @@ public class GoodsServiceImpl implements GoodsService {
             }
         }, pageInfo);
         for (Goods goods : goodsPage.getContent()) {
-            if (goods.getUuid() != null) {
+            if (StringUtils.isEmpty(goods.getAttach()) && (goods.getUuid() != null)) {
                 Component component = componentDao.findByUuid(goods.getUuid());
                 if (component != null) {
                     goods.setAttach(component.getAttach());
@@ -3828,7 +3831,7 @@ public class GoodsServiceImpl implements GoodsService {
             }
             goods.setFrozen(getFrozenCount(goods.getBatchCode()));
         }
-        if (goods.getUuid() != null) {
+        if (StringUtils.isEmpty(goods.getAttach()) && goods.getUuid() != null) {
             Component component = componentDao.findByUuid(goods.getUuid());
             if (component != null) {
                 goods.setAttach(component.getAttach());
@@ -4167,4 +4170,47 @@ public class GoodsServiceImpl implements GoodsService {
         }
         return map;
     }
+
+
+    /**
+     * 根据产品更新在售产品
+     *
+     * @param product 产品信息
+     * @return
+     */
+    @Transactional
+    @Override
+    public void updateGoodsByProduct(Product product) {
+        if (product == null) {
+            return ;
+        } else {
+            List<GoodsHistory> list = new ArrayList<>();
+            List<ProductPrivate> productPrivates = productPrivateDao.findByPrId(product.getId());
+            ProductPrivate productPrivate = null;
+            if (CollectionUtils.isNotEmpty(productPrivates)) {
+                productPrivate = productPrivates.get(0);
+            }
+            List<Goods> goodses = goodsDao.findByProductId(product.getId());
+            for (Goods goods : goodses) {
+                goods.setSpec(product.getSpec());
+                goods.setAttach(productPrivate.getAttach());
+                goods.setBrandid(product.getPbrandid());
+                goods.setBrandNameCn(product.getPbrand());
+                goods.setBrandNameEn(product.getPbranden());
+                goods.setBranduuid(product.getPbranduuid());
+                goods.setKindUuid(product.getKindid());
+                goods.setKindNameCn(product.getKind());
+                goods.setImg(product.getCmpImg());
+                goods.setCode(product.getPcmpcode());
+                GoodsHistory history = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Update.getPhrase(), false);
+                list.add(history);
+            }
+            if (CollectionUtils.isNotEmpty(goodses)) {
+                goodsDao.save(goodses);
+            }
+            if (CollectionUtils.isNotEmpty(list)) {
+                goodsHistoryService.save(list);
+            }
+        }
+    }
 }

+ 181 - 31
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -17,6 +17,7 @@ import com.uas.platform.b2c.core.constant.Status;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.NumberUtil;
+import com.uas.platform.b2c.core.utils.StringUtilB2C;
 import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.StringConstant;
 import com.uas.platform.b2c.prod.commodity.dao.*;
@@ -216,6 +217,9 @@ public class ProductServiceImpl implements ProductService {
     @Autowired
     private SearchService searchService;
 
+    @Autowired
+    private ProductAttachService productAttachService;
+
     @Value("#{sys.productServiceIp}")
     private String productServiceIp;
 
@@ -1843,6 +1847,7 @@ public class ProductServiceImpl implements ProductService {
      * @param attachUrl 规格书的地址
      * @return the string
      */
+    @Transactional
     @Override
     public ResultMap updateProduct(String json, String attachUrl) {
         if (StringUtils.isEmpty(json)) {
@@ -1859,43 +1864,188 @@ public class ProductServiceImpl implements ProductService {
                 if (persistProduct == null) {
                     return new ResultMap(CodeType.NOT_EXiST, "数据库找不到对应的信息,请重新操作");
                 }
-                Component component = findBybrNameAndcmpCode(persistProduct.getPbranden(), persistProduct.getPcmpcode());
-                if (component != null) {
-                    persistProduct.setPcmpcode(component.getCode());
-                    persistProduct.setPbranden(component.getBrand().getNameEn());
-                    persistProduct.setPbrand(component.getBrand().getNameCn());
-                    persistProduct.setPbranduuid(component.getBrand().getUuid());
-                    persistProduct.setPbrandid(component.getBrandid());
-                    persistProduct.setCmpUuId(component.getUuid());
-                    persistProduct.setCmpImg(component.getImg());
-                    persistProduct.setKinden(component.getKind().getNameEn());
-                    persistProduct.setKind(component.getKind().getNameCn());
-                    persistProduct.setKindid(component.getKindid());
-                    if (!StringUtils.isEmpty(component.getAttach())) {
-                        List<ProductPrivate> privateList = productPrivateDao.findByPrId(persistProduct.getId());
-                        if (CollectionUtils.isNotEmpty(privateList)) {
-                            ProductPrivate productPrivate = privateList.get(0);
-                            productPrivate.setAttach(component.getAttach());
-                        }
-                    } else {
-
-                    }
-                }
-
                 if (persistProduct.getB2cEnabled() != IntegerConstant.YES_SHORT) {
                     return new ResultMap(CodeType.NOT_PERMIT, "该物料商城未启用,不能操作");
                 }
-                if (!persistProduct.getPbranden().equals(product.getPbranden())) {
-                    if (persistProduct.getStandard() == IntegerConstant.YES_SHORT) {
-                        return new ResultMap(CodeType.NOT_PERMIT, "该物料是标准器件,不能操作");
+                if (persistProduct.getStandard() == IntegerConstant.NO_SHORT) {
+                    Component component = findBybrNameAndcmpCode(persistProduct.getPbranden(), persistProduct.getPcmpcode());
+                    if (component != null) {
+                        persistProduct.setPcmpcode(component.getCode());
+                        persistProduct.setPbranden(component.getBrand().getNameEn());
+                        persistProduct.setPbrand(component.getBrand().getNameCn());
+                        persistProduct.setPbranduuid(component.getBrand().getUuid());
+                        persistProduct.setPbrandid(component.getBrandid());
+                        persistProduct.setCmpUuId(component.getUuid());
+                        persistProduct.setCmpImg(component.getImg());
+                        persistProduct.setKinden(component.getKind().getNameEn());
+                        persistProduct.setKind(component.getKind().getNameCn());
+                        persistProduct.setKindid(component.getKindid());
+                        String errorMsg = "该物料可以匹配为标准";
+                        if (!StringUtils.isEmpty(component.getAttach())) {
+                            List<ProductPrivate> privateList = productPrivateDao.findByPrId(persistProduct.getId());
+                            if (CollectionUtils.isNotEmpty(privateList)) {
+                                ProductPrivate productPrivate = privateList.get(0);
+                                productPrivate.setAttach(component.getAttach());
+                                errorMsg = ",且规格书已存在,不能修改";
+                            }
+                        } else {
+                            if (!StringUtils.isEmpty(attachUrl)) {
+                                productAttachService.submit(persistProduct.getId(), attachUrl);
+                            }
+                        }
+                        if (StringUtils.isEmpty(product.getSpec())) {
+                            //如果标准器件库存在规格信息,而用户又未填写,则需要填充对应的信息
+                            if (!StringUtils.isEmpty(component.getDescription())) {
+                                persistProduct.setSpec(component.getDescription());
+                            } else {
+                                persistProduct.setSpec(product.getSpec());
+                            }
+                        } else {
+                            if (!product.getSpec().equals(persistProduct.getSpec())) {
+                                persistProduct.setSpec(product.getSpec());
+                            }
+                        }
+                        productDao.save(persistProduct);
+                        //更新在售产品的信息
+                        goodsDao.updateGoodsByProduct(persistProduct.getPbrand(), persistProduct.getPbranden(), persistProduct.getPbrandid(), persistProduct.getPbranduuid(), persistProduct.getKind(), persistProduct.getKindid(), persistProduct.getCmpImg(), persistProduct.getCmpUuId(), persistProduct.getSpec(), persistProduct.getId());
+                        return ResultMap.success(errorMsg);
+                    } else {
+                        String msg = "";
+                        //非标且找不到标准信息
+                        String brand = "", code = "", kind = "", spec = "";
+                        ProductPrivate productPrivate = null;
+                        if (!StringUtilB2C.equals(persistProduct.getPbranden() , product.getPbranden())) {
+                            brand = product.getPbranden();
+                            ResultMap resultMap = StringUtilB2C.validateBrand(brand);
+                            if (resultMap.getCode() != CodeType.OK.code()) {
+                                return resultMap;
+                            } else {
+                                brand = (String) resultMap.getData();
+                            }
+                        }
+                        if (!StringUtilB2C.equals(persistProduct.getPcmpcode() , product.getPcmpcode())) {
+                            code = product.getPcmpcode();
+                            ResultMap resultMap = StringUtilB2C.validateCmpCode(code);
+                            if (resultMap.getCode() != CodeType.OK.code()) {
+                                return resultMap;
+                            } else {
+                                code = (String) resultMap.getData();
+                            }
+                        }
+                        if (!StringUtilB2C.equals(persistProduct.getKind() , product.getKind())) {
+                            kind = product.getKind();
+                            ResultMap resultMap = StringUtilB2C.validateKind(kind);
+                            if (resultMap.getCode() != CodeType.OK.code()) {
+                                return resultMap;
+                            } else {
+                                kind = (String) resultMap.getData();
+                                persistProduct.setKind(kind);
+                            }
+                        }
+                        if (!StringUtilB2C.equals(persistProduct.getSpec() , product.getSpec())) {
+                            spec = product.getSpec();
+                            ResultMap resultMap = StringUtilB2C.validateSpec(spec);
+                            if (resultMap.getCode() != CodeType.OK.code()) {
+                                return resultMap;
+                            } else {
+                                spec = (String) resultMap.getData();
+                                persistProduct.setSpec(spec);
+                            }
+                        }
+                        //如果修改了品牌、或者型号
+                        if (!StringUtils.isEmpty(brand) || !StringUtils.isEmpty(code)) {
+                            if (StringUtils.isEmpty(code)) {
+                                code = persistProduct.getPcmpcode();
+                            }
+                            if (StringUtils.isEmpty(brand)) {
+                                brand = persistProduct.getPbranden();
+                            }
+                            List<Product> products = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(SystemSession.getUser().getEnterprise().getUu(), code, brand, IntegerConstant.YES_SHORT);
+                            if (CollectionUtils.isNotEmpty(products)) {
+                                return new ResultMap(CodeType.NOT_PERMIT, "该企业下已存在同品牌、同型号的企业。");
+                            } else {
+                                Component component1 = findBybrNameAndcmpCode(brand, code);
+                                if (component1 != null) {
+                                    //TODO 转标准,规格信息设置、规格书设置
+                                } else {
+                                    persistProduct.setPbranden(brand);
+                                    persistProduct.setPbrand(brand);
+                                    persistProduct.setPcmpcode(code);
+                                }
+                            }
+                        }
+                        List<ProductPrivate> productPrivateList = productPrivateDao.findByPrId(persistProduct.getId());
+                        if (CollectionUtils.isNotEmpty(productPrivateList)) {
+                            productPrivate = productPrivateList.get(0);
+                            if (!StringUtils.isEmpty(productPrivate.getAttach())) {
+                                msg = "规格书已存在";
+                            }
+                        }
                     }
-                }
-                if (!persistProduct.getPcmpcode().equals(product.getPcmpcode())) {
-                    if (persistProduct.getStandard() == IntegerConstant.YES_SHORT) {
-                        return new ResultMap(CodeType.NOT_PERMIT, "该物料是标准器件,不能操作");
+                } else {
+                    //标准的信息,只能修改规格书、规格信息
+                    String msg = "";
+                    String updateAttachUrl = "";
+                    String spec = "";
+                    Component component = null;
+                    Product product1 = null;
+                    if (!StringUtilB2C.equals(product.getPbranden(), persistProduct.getPbranden())) {
+                        return new ResultMap(CodeType.NOT_PERMIT, "标准物料,品牌不能修改");
+                    }
+                    if (!StringUtilB2C.equals(product.getPcmpcode(), persistProduct.getPcmpcode())) {
+                        return new ResultMap(CodeType.NOT_PERMIT, "标准物料,型号不能修改");
+                    }
+                    if (!StringUtilB2C.equals(product.getKind(), persistProduct.getKind())) {
+                        return new ResultMap(CodeType.NOT_PERMIT, "标准物料,类目不能修改");
+                    }
+                    if (persistProduct.getCmpUuId() != null) {
+                        component = componentDao.findByUuid(persistProduct.getCmpUuId());
+                    }
+                    if (!StringUtils.isEmpty(attachUrl)) {
+                        List<ProductPrivate> productPrivates = productPrivateDao.findByPrId(persistProduct.getId());
+                        if (CollectionUtils.isNotEmpty(productPrivates)) {
+                            if (StringUtils.isEmpty(productPrivates.get(0).getAttach())) {
+                                if (component != null) {
+                                    if (StringUtils.isEmpty(component.getAttach())) {
+                                        productAttachService.submit(persistProduct.getId(), attachUrl);
+                                    } else {
+                                        msg = "规格书已经存在,不能上传";
+                                        updateAttachUrl = component.getAttach();
+                                        productPrivates.get(0).setAttach(updateAttachUrl);
+                                        productPrivateDao.save(productPrivates.get(0));
+                                    }
+                                } else {
+                                    productAttachService.submit(persistProduct.getId(), attachUrl);
+                                }
+                            } else {
+                                msg = "规格书已经存在,不能上传";
+                            }
+                        }
+                    }
+                    if (!StringUtilB2C.equals(product.getSpec(), persistProduct.getSpec())) {
+                        if (StringUtils.isEmpty(product.getSpec())) {
+                            if (!StringUtils.isEmpty(component.getSpec())) {
+                                spec = component.getSpec();
+                                persistProduct.setSpec(component.getSpec());
+                            } else {
+                                spec = product.getSpec();
+                                persistProduct.setSpec(product.getSpec());
+                            }
+                        } else {
+                            spec = product.getSpec();
+                            persistProduct.setSpec(product.getSpec());
+                        }
+                        product1 = productDao.save(persistProduct);
                     }
-                }
 
+
+                    //更新在售产品信息
+                    goodsService.updateGoodsByProduct(product1);
+                    if (StringUtils.isEmpty(msg)) {
+                        msg = "修改成功";
+                    }
+                    return new ResultMap(CodeType.OK.code(), msg, product1);
+                }
             } else {
                 return new ResultMap(CodeType.NOT_COMPLETE_INFO, "物料信息丢失,请重新操作");
             }

+ 3 - 4
src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentGoods.java

@@ -1,13 +1,12 @@
 package com.uas.platform.b2c.prod.product.component.modal;
 
 import com.alibaba.fastjson.annotation.JSONField;
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
-import com.uas.platform.b2c.prod.commodity.model.Product;
 import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
 import com.uas.platform.b2c.prod.product.kind.model.KindInfo;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.codehaus.jackson.annotate.JsonIgnore;
 import org.springframework.util.StringUtils;
@@ -264,7 +263,7 @@ public class ComponentGoods implements Serializable {
 	/**
 	 * 视图
 	 */
-	@Column(name = "go_spec")
+	@Column(name = "go_spec", length = 4000)
 	private String spec;
 
 	public Long getCmpId() {

+ 1 - 1
src/main/java/com/uas/platform/b2c/trade/order/model/OrderDetail.java

@@ -358,7 +358,7 @@ public class OrderDetail extends Document implements Serializable{
 	/**
 	 * 规格信息
 	 */
-	@Column(name = "go_spec")
+	@Column(name = "go_spec", length = 4000)
 	private String spec;
 	
 	/**

+ 1 - 1
src/main/java/com/uas/platform/b2c/trade/order/model/PurchaseDetail.java

@@ -333,7 +333,7 @@ public class PurchaseDetail extends Document {
 	/**
 	 * 规格字段
 	 */
-	@Column(name = "go_spec")
+	@Column(name = "go_spec", length = 4000)
 	private String spec;