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