feat:预炸1

This commit is contained in:
苏竹红
2025-06-24 16:37:43 +08:00
parent d4a2123434
commit 3b3bcdca85
2 changed files with 11 additions and 0 deletions

View File

@@ -55,6 +55,16 @@ public class PreFryRecordsServiceImpl implements PreFryRecordsService {
if (minApplyTypeByStoreCode==null){
throw new ServiceException(ErrorCodeEnum.PRE_FRY_APPLY_NOT_EXIST);
}
if (addPreFryRecordsDTO!=null&&CollectionUtils.isNotEmpty(addPreFryRecordsDTO.getRecords())){
List<Long> productList = addPreFryRecordsDTO.getRecords().stream().map(AddPreFryRecordsDetailDTO::getProductId).collect(Collectors.toList());
List<PreFriedProductsDO> preFriedProductsDOS = preFriedProductsDAO.selectByProductIds(productList);
//校验是否包含下架的产品
if (preFriedProductsDOS.stream().anyMatch(e->e.getStatus()==0)){
throw new ServiceException(ErrorCodeEnum.PRODUCTS_STATUS);
}
}
//如果出现优先级升高的情况 优先级低的只有报废可选择 1的优先级最高 3最低
if (minApplyTypeByStoreCode.getApplyType()<addPreFryRecordsDTO.getApplyType()
&&addPreFryRecordsDTO.getCurrentStage()!= DISCARDED.getCode()){