ソースを参照

授权下商品名称可重复

Aslee 4 年 前
コミット
ed1e4c575c

+ 1 - 3
src/main/java/com/caimei/modules/zplm/web/CmBrandAuthProductController.java

@@ -104,9 +104,7 @@ public class CmBrandAuthProductController extends BaseController {
 		}
 		CmBrandAuthProduct sameProduct = cmBrandAuthProductDao.findSameProduct(cmBrandAuthProduct);
 		if (null != sameProduct) {
-			if (cmBrandAuthProduct.getName().equals(sameProduct.getName())) {
-				model.addAttribute("errorMsg", "该品牌授权下的"+sameProduct.getName()+"商品名称已存在,请勿重复添加");
-			}else if (cmBrandAuthProduct.getSnCode().equals(sameProduct.getSnCode())) {
+			if (cmBrandAuthProduct.getSnCode().equals(sameProduct.getSnCode())) {
 				model.addAttribute("errorMsg", "该品牌授权下的"+sameProduct.getSnCode()+"商品SN码已存在,请勿重复添加");
 			}
 			return true;

+ 1 - 1
src/main/resources/mappings/modules/zplm/CmBrandAuthProductMapper.xml

@@ -73,7 +73,7 @@
 	</select>
 	<select id="findSameProduct" resultType="com.caimei.modules.zplm.entity.CmBrandAuthProduct">
 		select name,snCode from cm_brand_auth_product
-		where (name = #{name} or snCode = #{snCode}) and authId = #{authId}
+		where snCode = #{snCode} and authId = #{authId}
 		<if test="id != null and id != ''">
 			and id != #{id}
 		</if>