修改菜品逻辑

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

View File

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