feat:applyType
This commit is contained in:
@@ -58,8 +58,8 @@ public class PreFryRecordsServiceImpl implements PreFryRecordsService {
|
|||||||
if (addPreFryRecordsDTO!=null&&CollectionUtils.isNotEmpty(addPreFryRecordsDTO.getRecords())){
|
if (addPreFryRecordsDTO!=null&&CollectionUtils.isNotEmpty(addPreFryRecordsDTO.getRecords())){
|
||||||
List<Long> productList = addPreFryRecordsDTO.getRecords().stream().map(AddPreFryRecordsDetailDTO::getProductId).collect(Collectors.toList());
|
List<Long> productList = addPreFryRecordsDTO.getRecords().stream().map(AddPreFryRecordsDetailDTO::getProductId).collect(Collectors.toList());
|
||||||
List<PreFriedProductsDO> preFriedProductsDOS = preFriedProductsDAO.selectByProductIds(productList);
|
List<PreFriedProductsDO> preFriedProductsDOS = preFriedProductsDAO.selectByProductIds(productList);
|
||||||
//校验是否包含下架的产品
|
//校验是否包含下架的产品 recordId是空的时候是新增 是有新增的时候限制
|
||||||
if (preFriedProductsDOS.stream().anyMatch(e->e.getStatus()==0)){
|
if (preFriedProductsDOS.stream().anyMatch(e->e.getStatus()==0)&&addPreFryRecordsDTO.getRecords().get(0).getRecordId()==null){
|
||||||
throw new ServiceException(ErrorCodeEnum.PRODUCTS_STATUS);
|
throw new ServiceException(ErrorCodeEnum.PRODUCTS_STATUS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user