|
@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.xy.utils.Beans.copy;
|
|
|
import static com.xy.utils.PlusBeans.toIPage;
|
|
@@ -67,9 +69,18 @@ public class DeviceErrorsRecordServiceImpl extends ServiceImpl<DeviceErrorsRecor
|
|
|
.ge(DeviceErrorsRecord::getCreateTime, page.getBeginCreateTime())
|
|
|
.le(DeviceErrorsRecord::getCreateTime, page.getEndCreateTime())
|
|
|
.build()
|
|
|
- .orderByDesc(!Emptys.check(pageBean.getOrders()), DeviceErrorsRecord::getCreateTime);
|
|
|
+ .orderByDesc(!Emptys.check(pageBean.getOrders()), DeviceErrorsRecord::getId);
|
|
|
IPage<DeviceErrorsRecord> iPage = page(toIPage(pageBean), lambdaQueryWrapper);
|
|
|
- return R.ok(toPageBean(DeviceErrorsRecordDto.Vo.class, iPage));
|
|
|
+ PageBean<DeviceErrorsRecordDto.Vo> voPageBean = toPageBean(DeviceErrorsRecordDto.Vo.class, iPage);
|
|
|
+ //反显设备名称
|
|
|
+ if(Emptys.check(voPageBean.getRecords())){
|
|
|
+ List<Long> deviceIdList = voPageBean.getRecords().stream().map(DeviceErrorsRecordDto.Vo::getDeviceId).collect(Collectors.toList());
|
|
|
+ Map<Long, String> deviceMap = deviceInfoService.getDeviceNameList(new DeviceInfoDto.DeviceIdDto().setDeviceId(deviceIdList)).getData();
|
|
|
+ voPageBean.getRecords().forEach(i->{
|
|
|
+ i.setDeviceName(deviceMap.get(i.getDeviceId()));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return R.ok(voPageBean);
|
|
|
}
|
|
|
|
|
|
@PostMapping("list")
|