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

@@ -280,6 +280,7 @@ public enum ErrorCodeEnum {
PRE_FRY_RECORD_EXIST(1511030,"当前门店已存在同类型预炸资质申请记录",null), PRE_FRY_RECORD_EXIST(1511030,"当前门店已存在同类型预炸资质申请记录",null),
PRE_FRY_APPLY_NOT_EXIST(1511030,"预炸资质申请信息不存在",null), PRE_FRY_APPLY_NOT_EXIST(1511030,"预炸资质申请信息不存在",null),
CURRENT_STAGE_NOT_OPERATION(1511030,"当前有更优选择,请确认!",null), CURRENT_STAGE_NOT_OPERATION(1511030,"当前有更优选择,请确认!",null),
PRODUCTS_STATUS(1511031,"包含下架的产品,请重新选择后提交!",null),
; ;

View File

@@ -55,6 +55,16 @@ public class PreFryRecordsServiceImpl implements PreFryRecordsService {
if (minApplyTypeByStoreCode==null){ if (minApplyTypeByStoreCode==null){
throw new ServiceException(ErrorCodeEnum.PRE_FRY_APPLY_NOT_EXIST); 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最低 //如果出现优先级升高的情况 优先级低的只有报废可选择 1的优先级最高 3最低
if (minApplyTypeByStoreCode.getApplyType()<addPreFryRecordsDTO.getApplyType() if (minApplyTypeByStoreCode.getApplyType()<addPreFryRecordsDTO.getApplyType()
&&addPreFryRecordsDTO.getCurrentStage()!= DISCARDED.getCode()){ &&addPreFryRecordsDTO.getCurrentStage()!= DISCARDED.getCode()){