Browse Source

处理品牌审核中文名为空bug

wangyc 8 years ago
parent
commit
3892b88063

+ 12 - 8
src/main/java/com/uas/platform/b2c/prod/product/brand/service/impl/BrandSubmitServiceImpl.java

@@ -267,15 +267,19 @@ public class BrandSubmitServiceImpl implements BrandSubmitService {
 			throw new IllegalOperatorException("此品牌申请已被处理");
 			throw new IllegalOperatorException("此品牌申请已被处理");
 		}
 		}
 		// 检查简介数据正确性
 		// 检查简介数据正确性
-		if (brandSubmit.getBrief() != null) {
-			if (brandSubmit.getBrief().length() > 4000) {
-				throw new IllegalOperatorException("产品简介请不要超过4000字");
-			}
+		if ((brandSubmit.getBrief() != null) && (brandSubmit.getBrief().length() > 4000)) {
+			throw new IllegalOperatorException("产品简介请不要超过4000字");
 		}
 		}
-		if (brandSubmit.getAchievement() != null) {
-			if (brandSubmit.getAchievement().length() > 4000) {
-				throw new IllegalOperatorException("主要成就请不要超过4000字");
-			}
+		if ((brandSubmit.getAchievement() != null) && (brandSubmit.getAchievement().length() > 4000)) {
+			throw new IllegalOperatorException("主要成就请不要超过4000字");
+		}
+
+		if (brandSubmit.getNameEn() == null) {
+			throw new IllegalOperatorException("品牌英文名不可为空");
+		}
+
+		if (brandSubmit.getNameCn() == null) {// 若中文品牌名为空将英文品牌名赋予中文品牌名
+			brandSubmit.setNameCn(brandSubmit.getNameEn());
 		}
 		}
 		// 检查新增还是更新
 		// 检查新增还是更新
 		if (brandSubmit.getUuid() == null) {
 		if (brandSubmit.getUuid() == null) {