修改菜品逻辑

This commit is contained in:
seesaw
2024-08-19 13:53:16 +08:00
parent 8ccac59b95
commit a12212c689
2 changed files with 17 additions and 14 deletions

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.service.deviceinfo;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo.DeviceInfoPageReqVO;
@ -106,9 +107,11 @@ public class DeviceInfoServiceImpl implements DeviceInfoService {
}
}
deviceInfoMapper.update(new DeviceInfoDO(),new LambdaUpdateWrapper<DeviceInfoDO>()
.set(DeviceInfoDO::getAlive,"0")
.in(DeviceInfoDO::getDeviceIp,updateList));
if(CollectionUtil.isNotEmpty(updateList)){
deviceInfoMapper.update(new DeviceInfoDO(),new LambdaUpdateWrapper<DeviceInfoDO>()
.set(DeviceInfoDO::getAlive,"0")
.in(DeviceInfoDO::getDeviceIp,updateList));
}
return updateList.size();
}

View File

@ -155,20 +155,20 @@ public class DevuceServiceImpl implements DevuceService {
@Override
public List<DishesDO> getDishesList(Long carteenId,Long dishecType) {
//获取已绑定的菜品id
List<Long> collect = devuceMapper.selectList(new LambdaQueryWrapperX<DevuceDO>()
.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{
// List<Long> collect = devuceMapper.selectList(new LambdaQueryWrapperX<DevuceDO>()
// .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));
}
// }
}