|
|
@@ -14,10 +14,7 @@ import com.usky.common.core.util.UUIDUtils;
|
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
|
import com.usky.iot.RemoteIotTaskService;
|
|
|
import com.usky.meeting.domain.*;
|
|
|
-import com.usky.meeting.mapper.EgDeviceMapper;
|
|
|
-import com.usky.meeting.mapper.MeetingDeviceHeartbeatMapper;
|
|
|
-import com.usky.meeting.mapper.MeetingDeviceMapper;
|
|
|
-import com.usky.meeting.mapper.MeetingRoomMapper;
|
|
|
+import com.usky.meeting.mapper.*;
|
|
|
import com.usky.meeting.repository.MeetingRoomRepository;
|
|
|
import com.usky.meeting.service.MeetingDeviceService;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
@@ -60,6 +57,8 @@ public class MeetingDeviceServiceImpl extends AbstractCrudService<MeetingDeviceM
|
|
|
private MeetingDeviceMapper deviceMapper;
|
|
|
@Autowired
|
|
|
private MeetingDeviceHeartbeatMapper heartbeatMapper;
|
|
|
+ @Autowired
|
|
|
+ private MeetingTemplateMapper meetingTemplateMapper;
|
|
|
|
|
|
@Override
|
|
|
public CommonPage<MeetingDevice> meetingDeviceList(MeetingDeviceRequestVO requestVO) {
|
|
|
@@ -102,8 +101,8 @@ public class MeetingDeviceServiceImpl extends AbstractCrudService<MeetingDeviceM
|
|
|
queryWrapper1.like(EgDevice::getDeviceName, requestVO.getEgDeviceName()).eq(EgDevice::getTenantId, tenantId);
|
|
|
egDeviceList = egDeviceMapper.selectList(queryWrapper1);
|
|
|
if (CollectionUtils.isNotEmpty(egDeviceList)) {
|
|
|
- for (int i = 0; i < egDeviceList.size(); i++) {
|
|
|
- egDeviceIdList.add(egDeviceList.get(i).getId());
|
|
|
+ for (EgDevice egDevice : egDeviceList) {
|
|
|
+ egDeviceIdList.add(egDevice.getId());
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -123,15 +122,21 @@ public class MeetingDeviceServiceImpl extends AbstractCrudService<MeetingDeviceM
|
|
|
.eq(MeetingDevice::getTenantId, tenantId)
|
|
|
.orderByAsc(MeetingDevice::getDeviceUuid);
|
|
|
page = this.page(page, queryWrapper3);
|
|
|
- if (page.getRecords().size() > 0) {
|
|
|
+
|
|
|
+ LambdaQueryWrapper<MeetingTemplate> queryWrapper4 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper4.eq(MeetingTemplate::getTenantId, tenantId);
|
|
|
+ List<MeetingTemplate> meetingTemplateList = meetingTemplateMapper.selectList(queryWrapper4);
|
|
|
+
|
|
|
+
|
|
|
+ if (!page.getRecords().isEmpty()) {
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(meetingRoomsList)) {
|
|
|
for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
if (Objects.nonNull(page.getRecords().get(i).getRoomId())) {
|
|
|
- Long RId = Long.valueOf(page.getRecords().get(i).getRoomId());
|
|
|
- for (int j = 0; j < meetingRoomsList.size(); j++) {
|
|
|
- if (RId.equals(meetingRoomsList.get(j).getRoomId())) {
|
|
|
- page.getRecords().get(i).setMeetingRoom(meetingRoomsList.get(j));
|
|
|
+ Long RId = page.getRecords().get(i).getRoomId();
|
|
|
+ for (MeetingRoom meetingRoom : meetingRoomsList) {
|
|
|
+ if (RId.equals(meetingRoom.getRoomId())) {
|
|
|
+ page.getRecords().get(i).setMeetingRoom(meetingRoom);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -144,9 +149,9 @@ public class MeetingDeviceServiceImpl extends AbstractCrudService<MeetingDeviceM
|
|
|
for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
if (Objects.nonNull(page.getRecords().get(i).getEgDeviceId())) {
|
|
|
Integer egDeviceId = page.getRecords().get(i).getEgDeviceId();
|
|
|
- for (int j = 0; j < egDeviceList.size(); j++) {
|
|
|
- if (egDeviceId.equals(egDeviceList.get(j).getId())) {
|
|
|
- page.getRecords().get(i).setEgDevice(egDeviceList.get(j));
|
|
|
+ for (EgDevice egDevice : egDeviceList) {
|
|
|
+ if (egDeviceId.equals(egDevice.getId())) {
|
|
|
+ page.getRecords().get(i).setEgDevice(egDevice);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -154,6 +159,20 @@ public class MeetingDeviceServiceImpl extends AbstractCrudService<MeetingDeviceM
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (CollectionUtils.isNotEmpty(meetingTemplateList)) {
|
|
|
+ for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
+ if (Objects.nonNull(page.getRecords().get(i).getTemplateId())) {
|
|
|
+ Integer templateId = page.getRecords().get(i).getTemplateId();
|
|
|
+ for (MeetingTemplate meetingTemplate : meetingTemplateList) {
|
|
|
+ if (templateId.equals(meetingTemplate.getId())) {
|
|
|
+ page.getRecords().get(i).setMeetingTemplate(meetingTemplate);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return new CommonPage<>(page.getRecords(), page.getTotal(), size, current);
|