|
@@ -89,7 +89,8 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
* @return Boolean true
|
|
|
*/
|
|
|
public Boolean updateProduct(UpdateProductVO updateProductVO) {
|
|
|
- if(updateProductVO.getName().equals(this.selectProductByName(updateProductVO.getName()).getName())){
|
|
|
+ LantoneProduct lantoneProductInfo = this.selectProductByName(updateProductVO.getName());
|
|
|
+ if(updateProductVO.getName().equals(lantoneProductInfo.getName()) && updateProductVO.getId() != lantoneProductInfo.getId()){
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
"产品名称重复");
|
|
|
}
|
|
@@ -97,7 +98,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
BeanUtil.copyProperties(updateProductVO, lantoneProduct);
|
|
|
lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
|
|
|
lantoneProduct.setGmtModified(DateUtil.now());
|
|
|
- if(updateProductVO.getServiceStatus()==StatusEnum.Disable.getKey()){
|
|
|
+ if(null != updateProductVO.getServiceStatus() && updateProductVO.getServiceStatus()==StatusEnum.Disable.getKey()){
|
|
|
Page page =new Page();
|
|
|
OpenedProductsIndex openedProductsIndex =new OpenedProductsIndex();
|
|
|
openedProductsIndex.setProductId(updateProductVO.getId());
|