|
@@ -2,10 +2,13 @@ package com.welampiot.controller;
|
|
|
|
|
|
import com.welampiot.common.BaseResult;
|
|
|
import com.welampiot.common.InterfaceResultEnum;
|
|
|
+import com.welampiot.dto.AirSwitchInfoDTO;
|
|
|
import com.welampiot.dto.WaterImmersionDevInfoDTO;
|
|
|
import com.welampiot.dto.WaterImmersionDevInfoLogDTO;
|
|
|
+import com.welampiot.service.AirSwitchInfoService;
|
|
|
import com.welampiot.service.WaterImmersionDevInfoService;
|
|
|
import com.welampiot.utils.ToolUtils;
|
|
|
+import com.welampiot.vo.AirSwitchInfoReturnVO;
|
|
|
import com.welampiot.vo.WaterImmersionDevInfoLogVO;
|
|
|
import com.welampiot.vo.WaterImmersionDevInfoVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -17,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* ClassName: WaterImmersionController
|
|
@@ -37,6 +41,9 @@ public class WaterImmersionController {
|
|
|
@Autowired
|
|
|
private ToolUtils toolUtils;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AirSwitchInfoService airSwitchInfoService;
|
|
|
+
|
|
|
/**
|
|
|
* 获取水浸传感器列表
|
|
|
* @param request
|
|
@@ -179,4 +186,49 @@ public class WaterImmersionController {
|
|
|
}
|
|
|
return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 水浸设备概览
|
|
|
+ * @param request sectionList
|
|
|
+ * @return 水浸设备概览
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/data", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> data(HttpServletRequest request) {
|
|
|
+ Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
|
|
|
+ Integer areaId = (Integer) toolUtils.getRequestContent(request,"areaId",1);
|
|
|
+ Integer sectionId = (Integer) toolUtils.getRequestContent(request,"sectionId",1);
|
|
|
+ WaterImmersionDevInfoDTO dto = new WaterImmersionDevInfoDTO();
|
|
|
+ dto.setSectionId(sectionId);
|
|
|
+ dto.setAreaId(areaId);
|
|
|
+ dto.setSectionList(toolUtils.getSectionList(request));
|
|
|
+ Integer total = waterImmersionDevInfoService.getWaterImmersionTotal(dto);
|
|
|
+ Integer onlineCount = waterImmersionDevInfoService.getWaterImmersionOnlineCount(dto);
|
|
|
+ Integer alarmCount = waterImmersionDevInfoService.getWaterImmersionAlarmCount(dto);
|
|
|
+ Integer newCount = waterImmersionDevInfoService.getWaterImmersionNewCount(dto);
|
|
|
+ WaterImmersionDevInfoVO waterImmersionDevInfoVO = new WaterImmersionDevInfoVO();
|
|
|
+ waterImmersionDevInfoVO.setTotal(total);
|
|
|
+ waterImmersionDevInfoVO.setOnlineCount(onlineCount);
|
|
|
+ waterImmersionDevInfoVO.setAlarmCount(alarmCount);
|
|
|
+ waterImmersionDevInfoVO.setNewCount(newCount);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,waterImmersionDevInfoVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 电箱下的空开列表
|
|
|
+ * @param vo address
|
|
|
+ * @return 电箱下的空开列表
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/airList", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> airList(AirSwitchInfoReturnVO vo) {
|
|
|
+ AirSwitchInfoReturnVO airSwitchInfoReturnVO = AirSwitchInfoReturnVO.getAirSwitchInfoReturnVO(vo);
|
|
|
+ Integer version = airSwitchInfoReturnVO.getVersion();
|
|
|
+ String address = airSwitchInfoReturnVO.getBoxAddress();
|
|
|
+ if (address.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
|
|
|
+ List<AirSwitchInfoDTO> airSwitchList = airSwitchInfoService.getAirSwitchAddressByEleBoxAddr(address);
|
|
|
+ Integer total = airSwitchInfoService.getAirSwitchCountByEleBoxAddr(address);
|
|
|
+ AirSwitchInfoReturnVO airSwitchInfoReturnVO1 = new AirSwitchInfoReturnVO();
|
|
|
+ airSwitchInfoReturnVO1.setList(airSwitchList);
|
|
|
+ airSwitchInfoReturnVO1.setTotal(total);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,airSwitchInfoReturnVO1);
|
|
|
+ }
|
|
|
}
|