菜品绑定修改1
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
package cn.iocoder.yudao.module.system.controller.app.devuce.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 设备新增/修改 Request VO")
|
||||
@Data
|
||||
@ -17,6 +18,7 @@ public class DevuceSaveReqVO {
|
||||
private String deviceSn;
|
||||
|
||||
@Schema(description = "菜品id", example = "17970")
|
||||
@NotNull(message = "菜品id不能为空")
|
||||
private Long dishesId;
|
||||
|
||||
@Schema(description = "是否绑定", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
@ -110,11 +110,17 @@ public class DevuceServiceImpl implements DevuceService {
|
||||
.eq(DevuceDO::getBind, DevuceDO.BIND))
|
||||
.stream()
|
||||
.map(DevuceDO::getDishesId).collect(Collectors.toList());
|
||||
if(ObjUtil.isNotEmpty(collect)){
|
||||
return dishesMapper.selectList(new LambdaQueryWrapperX<DishesDO>()
|
||||
.notIn(DishesDO::getId, collect)
|
||||
.eq(DishesDO::getCarteenId,carteenId)
|
||||
.eq(DishesDO::getDishecType,dishecType));
|
||||
}else{
|
||||
return dishesMapper.selectList(new LambdaQueryWrapperX<DishesDO>()
|
||||
.eq(DishesDO::getCarteenId,carteenId)
|
||||
.eq(DishesDO::getDishecType,dishecType));
|
||||
}
|
||||
|
||||
return dishesMapper.selectList(new LambdaQueryWrapperX<DishesDO>()
|
||||
.notIn(DishesDO::getId, collect)
|
||||
.eq(DishesDO::getCarteenId,carteenId)
|
||||
.eq(DishesDO::getDishecType,dishecType));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user