This commit is contained in:
shuo.wang
2025-06-24 17:36:13 +08:00
parent 88b6cefffb
commit 5c851b3d8e
2 changed files with 6 additions and 3 deletions

View File

@@ -51,6 +51,10 @@ public class PreFriedProductsServiceImpl implements PreFriedProductsService {
if (dto==null||dto.getId() == null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
PreFriedProductsDO preFriedProductsDO = preFriedProductsDAO.queryByProductCode(dto.getProductCode());
if (preFriedProductsDO!=null && !preFriedProductsDO.getId().equals(dto.getId())){
throw new ServiceException(ErrorCodeEnum.PRODUCTS_CODE_EXIST);
}
PreFriedProductsDO product = convertToDO(dto);
product.setUpdatedTime(new Date());
product.setUpdatedUserId(userId);