Commit fdf03315 by huangjy

fix: 修复bug

parent 75bcc069
......@@ -22,6 +22,7 @@ import com.makeit.service.platform.space.PlatRegionSettingService;
import com.makeit.utils.LongTimestampUtil;
import com.makeit.utils.data.convert.BeanDtoVoUtils;
import com.makeit.utils.data.convert.JsonUtil;
import com.makeit.utils.old.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -67,6 +68,7 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
.in(PlatDeviceOther::getDeviceId,listDeviceId));
}
platDeviceOthers = platDeviceOthers.stream().filter(platDeviceOther -> StringUtils.isNotEmpty(platDeviceOther.getAttribute())).collect(Collectors.toList());
Map<String,String> map = platDeviceOthers.stream().collect(Collectors.toMap(PlatDeviceOther::getDeviceId,PlatDeviceOther::getAttribute));
List<PlatRegionSetting> list = new ArrayList<>();
listDeviceId.forEach(item->{
......
......@@ -74,6 +74,15 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
throw new BusinessException(CodeMessageEnum.PLATFORM_ERROR_BED_BIND_DEVICE_NOT_AUTH);
}
}
// 绑定床位不重复插入数据,直接绑定
if (StringUtils.isNotEmpty(dto.getBedId())) {
List<PlatRoomBedDevice> platRoomBedDeviceList = list(new QueryWrapper<PlatRoomBedDevice>().lambda().in(PlatRoomBedDevice::getDeviceId, listEquipmentIds));
for (PlatRoomBedDevice platRoomBedDevice : platRoomBedDeviceList) {
platRoomBedDevice.setBedId(dto.getBedId());
updateById(platRoomBedDevice);
}
return;
}
listEquipmentIds.forEach(item -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment