|
@@ -62,6 +62,10 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
* @return Boolean true
|
|
|
*/
|
|
|
public Boolean addProducts(AddProductsVO addProductsVO) {
|
|
|
+ if(addProductsVO.getName().equals(this.selectProductByName(addProductsVO.getName()).getName())){
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "产品名称重复");
|
|
|
+ }
|
|
|
LantoneProduct lantoneProduct = new LantoneProduct();
|
|
|
BeanUtil.copyProperties(addProductsVO, lantoneProduct);
|
|
|
lantoneProduct.setGmtCreate(DateUtil.now());
|
|
@@ -81,6 +85,10 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
* @return Boolean true
|
|
|
*/
|
|
|
public Boolean updateProduct(UpdateProductVO updateProductVO) {
|
|
|
+ if(updateProductVO.getName().equals(this.selectProductByName(updateProductVO.getName()).getName())){
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "产品名称重复");
|
|
|
+ }
|
|
|
LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
|
|
|
BeanUtil.copyProperties(updateProductVO, lantoneProduct);
|
|
|
lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
|