|
@@ -13,9 +13,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.system.domain.TShouhuanAlarmList;
|
|
|
import com.ruoyi.system.domain.TSosSolve;
|
|
|
import com.ruoyi.system.domain.dto.*;
|
|
|
-import com.ruoyi.system.service.ITDeviceListService;
|
|
|
-import com.ruoyi.system.service.ITShouhuanAlarmListService;
|
|
|
-import com.ruoyi.system.service.ITSosSolveService;
|
|
|
+import com.ruoyi.system.service.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -43,6 +41,12 @@ public class TDataDisplayController extends BaseController
|
|
|
@Autowired
|
|
|
private ITDeviceListService tDeviceListService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ITShouhuanInfoService itShouhuanInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITUserProfileService userProfileService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private LocationUtils locationUtils;
|
|
|
|
|
@@ -122,8 +126,45 @@ public class TDataDisplayController extends BaseController
|
|
|
public AjaxResult deviceView()
|
|
|
{
|
|
|
DeviceViewDto dto = new DeviceViewDto();
|
|
|
- return success();
|
|
|
+ dto.setDeviceCount(tShouhuanAlarmListService.selectTShouhuanAlarmStatus() + tShouhuanAlarmListService.selectTShouhuanAlarmStatusSolve());
|
|
|
+ dto.setDeviceOnline(tShouhuanAlarmListService.selectTShouhuanAlarmStatus());
|
|
|
+ dto.setUn_deviceOnline(tShouhuanAlarmListService.selectTShouhuanAlarmStatusSolve());
|
|
|
+ dto.setAlarmCount(tShouhuanAlarmListService.selectTShouhuanAlarmListCount());
|
|
|
+ return success(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总数
|
|
|
+ */
|
|
|
+ @GetMapping("/deviceType")
|
|
|
+ public AjaxResult deviceType()
|
|
|
+ {
|
|
|
+ Integer total = tDeviceListService.selectDeviceListCount();
|
|
|
+ List<DeviceTypeDto> deviceListDto = tDeviceListService.selectDeviceListDto();
|
|
|
+ for (DeviceTypeDto listDto : deviceListDto){
|
|
|
+ listDto.setDeviceStr(checkDeviceType(listDto.getDevice_model()));
|
|
|
+ listDto.setDevicePercent(checkPercent(listDto.getCount(),total));
|
|
|
+ }
|
|
|
+ AjaxResult ajax = new AjaxResult();
|
|
|
+ ajax.put("list",deviceListDto);
|
|
|
+ ajax.put("total", total);
|
|
|
+ return AjaxResult.success("操作成功",ajax);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总数
|
|
|
+ */
|
|
|
+ @GetMapping("/userAgeAll")
|
|
|
+ public AjaxResult userAgeAll()
|
|
|
+ {
|
|
|
+ Integer total = userProfileService.selectuserAgeCount();
|
|
|
+ List<UserAgeDto> dtoList = userProfileService.selectuserAgeDto();
|
|
|
+ AjaxResult ajax = new AjaxResult();
|
|
|
+ ajax.put("list",dtoList);
|
|
|
+ ajax.put("total", total);
|
|
|
+ return AjaxResult.success("操作成功",ajax);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询SOS预警处理列表
|
|
|
*/
|
|
@@ -135,6 +176,7 @@ public class TDataDisplayController extends BaseController
|
|
|
for (DataAlarmListDto dto : list){
|
|
|
MessageAlarmListDto alarmListDto = new MessageAlarmListDto();
|
|
|
alarmListDto.setName(dto.getName());
|
|
|
+ alarmListDto.setAlarm_msg(tDeviceListService.checkMessage(dto.getAlarm_type()));
|
|
|
alarmListDto.setTelno(dto.getTel_one());
|
|
|
alarmListDto.setGps_long(dto.getGps_long());
|
|
|
alarmListDto.setGps_lat(dto.getGps_lat());
|
|
@@ -173,4 +215,15 @@ public class TDataDisplayController extends BaseController
|
|
|
String result = numberFormat.format((float)num1/(float)num2*100);
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ public String checkDeviceType(Integer device_model){
|
|
|
+ switch (device_model){
|
|
|
+ case 0:
|
|
|
+ return "S8";
|
|
|
+ case 1:
|
|
|
+ return "X5";
|
|
|
+ default:
|
|
|
+ return "无效";
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|