|
@@ -79,6 +79,12 @@ public class NewLampPoleController {
|
|
|
private ProgramService programService;
|
|
|
@Autowired
|
|
|
private EmergencyService emergencyService;
|
|
|
+ @Autowired
|
|
|
+ private BroadcastService broadcastService;
|
|
|
+ @Autowired
|
|
|
+ private WaterImmersionDevInfoService waterImmersionDevInfoService;
|
|
|
+ @Autowired
|
|
|
+ private SmartLockDevInfoService smartLockDevInfoService;
|
|
|
|
|
|
@RequestMapping(value = "/info",method = RequestMethod.POST)
|
|
|
public BaseResult info(HttpServletRequest request){
|
|
@@ -118,6 +124,21 @@ public class NewLampPoleController {
|
|
|
loopDTO.setSectionList(sectionList);
|
|
|
lampPoleInfoVO.setLoopCount(loopService.getTotalBySectionList(loopDTO));
|
|
|
|
|
|
+ // 音柱设备数量
|
|
|
+ BroadcastDTO broadcastDTO = new BroadcastDTO();
|
|
|
+ broadcastDTO.setSectionList(sectionList);
|
|
|
+ lampPoleInfoVO.setRadioCount(broadcastService.getTotalBySectionList(broadcastDTO));
|
|
|
+
|
|
|
+ // 水浸设备数量
|
|
|
+ WaterImmersionDevInfoDTO waterImmersionDevInfoDTO = new WaterImmersionDevInfoDTO();
|
|
|
+ waterImmersionDevInfoDTO.setSectionList(sectionList);
|
|
|
+ lampPoleInfoVO.setWaterImmersionCount(waterImmersionDevInfoService.getTotalBySectionList(waterImmersionDevInfoDTO));
|
|
|
+
|
|
|
+ // 门锁设备数量
|
|
|
+ SmartLockDevInfoDTO smartLockDevInfoDTO = new SmartLockDevInfoDTO();
|
|
|
+ smartLockDevInfoDTO.setSectionList(sectionList);
|
|
|
+ lampPoleInfoVO.setLockCount(smartLockDevInfoService.getTotalBySectionList(smartLockDevInfoDTO));
|
|
|
+
|
|
|
for (LampPoleDTO l:listByVO) {
|
|
|
String devType = l.getDevType();
|
|
|
List split = Arrays.asList(devType.split(","));
|
|
@@ -128,7 +149,7 @@ public class NewLampPoleController {
|
|
|
}
|
|
|
|
|
|
// 近期创建数据
|
|
|
- Date date = new Date(System.currentTimeMillis() - 24 * 3600 * 30 * 1000);
|
|
|
+ Date date = new Date(System.currentTimeMillis() - (24L * 3600 * 30 * 1000));
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String createTime = simpleDateFormat.format(date);
|
|
|
LampPoleCountVO lampPoleCountVO = new LampPoleCountVO();
|
|
@@ -141,9 +162,16 @@ public class NewLampPoleController {
|
|
|
lampPoleCountVO.setSectionList(sectionList);
|
|
|
lampPoleInfoVO.setFaultCount(lampPoleService.getAlarmCountByVO(lampPoleCountVO));
|
|
|
|
|
|
-// $data['dayCom'] = round($data['dayCom'],1);
|
|
|
-// $data['monthCom'] = round($data['monthCom'],1);
|
|
|
-// $data['totalCom'] = round($data['totalCom'],1);
|
|
|
+ lampPoleInfoVO.setRunCount(lampPoleInfoVO.getDeviceCount() - lampPoleInfoVO.getFaultCount());
|
|
|
+
|
|
|
+// LampPoleVO lampPoleVO1 = new LampPoleVO();
|
|
|
+ LampInfoLogNewDTO comBySectionList = lampPoleService.getComBySectionList(lampPoleVO);
|
|
|
+ lampPoleInfoVO.setDayCom(Float.parseFloat(comBySectionList.getDayGeneraEnergy()));
|
|
|
+ lampPoleInfoVO.setMonthCom(Float.parseFloat(comBySectionList.getDayGeneraEnergy())+Float.parseFloat(comBySectionList.getMonthGeneraEnergyCache()));
|
|
|
+ lampPoleInfoVO.setTotalCom(Float.parseFloat(comBySectionList.getDayGeneraEnergy())+Float.parseFloat(comBySectionList.getTotalGeneraEnergyCache()));
|
|
|
+// lampPoleInfoVO.setDayCom((float) Math.round(lampPoleInfoVO.getDayCom()/100*100));
|
|
|
+// lampPoleInfoVO.setMonthCom((float)Math.round(lampPoleInfoVO.getMonthCom()/100*100));
|
|
|
+// lampPoleInfoVO.setTotalCom((float)Math.round(lampPoleInfoVO.getTotalCom()/100*100));
|
|
|
|
|
|
return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampPoleInfoVO);
|
|
|
}
|
|
@@ -944,15 +972,23 @@ public class NewLampPoleController {
|
|
|
Integer mode = (Integer) toolUtils.getRequestContent(request,"mode",1);
|
|
|
List sectionList1 = toolUtils.getSectionList(request);
|
|
|
SectionVO sectionVO = new SectionVO();
|
|
|
- sectionVO.setSectionList(sectionList1);
|
|
|
+ sectionVO.setIdList(sectionList1);
|
|
|
sectionVO.setVersion(version);
|
|
|
- HashMap<Integer, LampPoleInfoVO> integerObjectHashMap = new HashMap<>();
|
|
|
+ HashMap<String, LampPoleInfoVO> integerObjectHashMap = new HashMap<>();
|
|
|
+
|
|
|
+ LampListResponseVO lampListResponseVO = new LampListResponseVO();
|
|
|
+ lampListResponseVO.setSectionList(sectionList1);
|
|
|
+ List<LampInfoDTO> listByVO = lampService.areaInfoLampList(lampListResponseVO);
|
|
|
+
|
|
|
+ LampPoleVO lampPoleVO = new LampPoleVO();
|
|
|
+ lampPoleVO.setSectionList(sectionList1);
|
|
|
+ List<LampPoleDTO> listByVO1 = lampPoleService.getListByVO(lampPoleVO);
|
|
|
|
|
|
if (mode == 0){ // 区域
|
|
|
List<SectionDTO> listByIdList = sectionService.getListByVO(sectionVO);
|
|
|
for (SectionDTO s :listByIdList) {
|
|
|
LampPoleInfoVO lampPoleInfoVO = new LampPoleInfoVO();
|
|
|
- lampPoleInfoVO.setAreaId(s.getPid());
|
|
|
+ lampPoleInfoVO.setAreaId(s.getPid().toString());
|
|
|
lampPoleInfoVO.setName(s.getArea());
|
|
|
lampPoleInfoVO.setDeviceCount(0);
|
|
|
lampPoleInfoVO.setNewCount(0);
|
|
@@ -966,15 +1002,37 @@ public class NewLampPoleController {
|
|
|
lampPoleInfoVO.setRadioCount(0);
|
|
|
lampPoleInfoVO.setEmCount(0);
|
|
|
lampPoleInfoVO.setChargeCount(0);
|
|
|
- if (!integerObjectHashMap.containsKey(s.getPid())) integerObjectHashMap.put(s.getPid(),lampPoleInfoVO);
|
|
|
+ lampPoleInfoVO.setWaterImmersionCount(0);
|
|
|
+ lampPoleInfoVO.setTiltCount(0);
|
|
|
+ lampPoleInfoVO.setLockCount(0);
|
|
|
+ if (!integerObjectHashMap.containsKey(s.getPid())) integerObjectHashMap.put(s.getPid().toString(),lampPoleInfoVO);
|
|
|
}
|
|
|
}else { // 公司
|
|
|
-
|
|
|
+ List<SectionDTO> listByIdList = sectionService.getListByVO(sectionVO);
|
|
|
+ for (LampPoleDTO dto :listByVO1) {
|
|
|
+ LampPoleInfoVO lampPoleInfoVO = new LampPoleInfoVO();
|
|
|
+ lampPoleInfoVO.setAreaId(dto.getCompany());
|
|
|
+ lampPoleInfoVO.setName(dto.getCompany());
|
|
|
+ lampPoleInfoVO.setDeviceCount(0);
|
|
|
+ lampPoleInfoVO.setNewCount(0);
|
|
|
+ lampPoleInfoVO.setDisableCount(0);
|
|
|
+ lampPoleInfoVO.setLampCount(0);
|
|
|
+ lampPoleInfoVO.setVideoCount(0);
|
|
|
+ lampPoleInfoVO.setWeatherCount(0);
|
|
|
+ lampPoleInfoVO.setWifiCount(0);
|
|
|
+ lampPoleInfoVO.setScreenCount(0);
|
|
|
+ lampPoleInfoVO.setLoopCount(0);
|
|
|
+ lampPoleInfoVO.setRadioCount(0);
|
|
|
+ lampPoleInfoVO.setEmCount(0);
|
|
|
+ lampPoleInfoVO.setChargeCount(0);
|
|
|
+ lampPoleInfoVO.setWaterImmersionCount(0);
|
|
|
+ lampPoleInfoVO.setTiltCount(0);
|
|
|
+ lampPoleInfoVO.setLockCount(0);
|
|
|
+ if (!integerObjectHashMap.containsKey(dto.getCompany())) integerObjectHashMap.put(dto.getCompany(),lampPoleInfoVO);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- LampListResponseVO lampListResponseVO = new LampListResponseVO();
|
|
|
- lampListResponseVO.setSectionList(sectionList1);
|
|
|
- List<LampInfoDTO> listByVO = lampService.areaInfoLampList(lampListResponseVO);
|
|
|
+
|
|
|
for (LampInfoDTO l :listByVO) {
|
|
|
Integer id;
|
|
|
if (mode == 0){
|
|
@@ -985,23 +1043,94 @@ public class NewLampPoleController {
|
|
|
if (integerObjectHashMap.containsKey(id)){
|
|
|
LampPoleInfoVO lampPoleInfoVO = integerObjectHashMap.get(id);
|
|
|
lampPoleInfoVO.setLampCount(lampPoleInfoVO.getLampCount()+1);
|
|
|
- integerObjectHashMap.put(id,lampPoleInfoVO);
|
|
|
+ integerObjectHashMap.put(id.toString(),lampPoleInfoVO);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ for (LampPoleDTO dto :listByVO1) {
|
|
|
+ String areaId;
|
|
|
+ if (mode == 0) {
|
|
|
+ areaId = dto.getAreaId().toString();
|
|
|
+ }else {
|
|
|
+ areaId = dto.getCompany();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (integerObjectHashMap.containsKey(areaId)){
|
|
|
+ LampPoleInfoVO lampPoleInfoVO = integerObjectHashMap.get(areaId);
|
|
|
+ System.out.println(dto.getCreateTime());
|
|
|
+ if (!dto.getCreateTime().isEmpty()) {
|
|
|
+ String pattern = "yyyy-MM-dd HH:mm:ss";
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat(pattern);
|
|
|
+ try {
|
|
|
+ if (System.currentTimeMillis() - sdf.parse(dto.getCreateTime()).getTime() <= 3600 * 24 * 30 * 1000) {
|
|
|
+ lampPoleInfoVO.setNewCount(lampPoleInfoVO.getNewCount() + 1);
|
|
|
+ }
|
|
|
+ } catch (ParseException e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ lampPoleInfoVO.setDeviceCount(lampPoleInfoVO.getDeviceCount()+1);
|
|
|
+ lampPoleInfoVO.setWifiCount(lampPoleInfoVO.getWifiCount()+1);
|
|
|
|
|
|
-// List sectionList = toolUtils.getSectionList(request);
|
|
|
-// VideoMonitorVO videoMonitorVO = new VideoMonitorVO();
|
|
|
-// videoMonitorVO.setVersion(version);
|
|
|
-// videoMonitorVO.setSectionList(sectionList);
|
|
|
-// videoMonitorVO.setNetStatus(1);
|
|
|
-// List<VideoMonitorDTO> lampPoleListByVO = videoMonitorService.getLampPoleListByVO(videoMonitorVO);
|
|
|
-// List<VideoMonitorDTO> videoMonitorDTOS = new ArrayList<>();
|
|
|
+ String[] split = dto.getDevType().split(",");
|
|
|
+ if (Arrays.binarySearch(split,"5") != -1) lampPoleInfoVO.setEmCount(lampPoleInfoVO.getEmCount()+1);
|
|
|
+ if (Arrays.binarySearch(split,"6") != -1) lampPoleInfoVO.setChargeCount(lampPoleInfoVO.getChargeCount()+1);
|
|
|
+ if (Arrays.binarySearch(split,"7") != -1) lampPoleInfoVO.setWeatherCount(lampPoleInfoVO.getWeatherCount()+1);
|
|
|
+ if (Arrays.binarySearch(split,"9") != -1) lampPoleInfoVO.setRadioCount(lampPoleInfoVO.getRadioCount()+1);
|
|
|
+ if (Arrays.binarySearch(split,"14") != -1) lampPoleInfoVO.setWaterImmersionCount(lampPoleInfoVO.getWaterImmersionCount()+1);
|
|
|
+ if (Arrays.binarySearch(split,"18") != -1) lampPoleInfoVO.setTiltCount(lampPoleInfoVO.getTiltCount()+1);
|
|
|
+
|
|
|
+ integerObjectHashMap.put(areaId.toString(),lampPoleInfoVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ List sectionList = toolUtils.getSectionList(request);
|
|
|
+ VideoMonitorVO videoMonitorVO = new VideoMonitorVO();
|
|
|
+ videoMonitorVO.setVersion(version);
|
|
|
+ videoMonitorVO.setSectionList(sectionList);
|
|
|
+ List<VideoMonitorDTO> lampPoleListByVO = videoMonitorService.getLampPoleListByVO(videoMonitorVO);
|
|
|
+ List<VideoMonitorDTO> videoMonitorDTOS = new ArrayList<>();
|
|
|
+ for (VideoMonitorDTO dto :videoMonitorDTOS) {
|
|
|
+ String areaId = dto.getAreaId().toString();
|
|
|
+ if (integerObjectHashMap.containsKey(areaId)) {
|
|
|
+ LampPoleInfoVO lampPoleInfoVO = integerObjectHashMap.get(areaId);
|
|
|
+ lampPoleInfoVO.setVideoCount(lampPoleInfoVO.getVideoCount() + 1);
|
|
|
+ integerObjectHashMap.put(areaId, lampPoleInfoVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ScreenDTO screenDTO = new ScreenDTO();
|
|
|
+ screenDTO.setSectionList(sectionList);
|
|
|
+ ScreenVO screenList = screenService.getScreenList(screenDTO);
|
|
|
+ for (ScreenDTO dto :screenList.getList()) {
|
|
|
+ if (dto.getAreaId() != null){
|
|
|
+ String areaId = dto.getAreaId().toString();
|
|
|
+ if (integerObjectHashMap.containsKey(areaId)) {
|
|
|
+ LampPoleInfoVO lampPoleInfoVO = integerObjectHashMap.get(areaId);
|
|
|
+ lampPoleInfoVO.setScreenCount(lampPoleInfoVO.getScreenCount() + 1);
|
|
|
+ integerObjectHashMap.put(areaId, lampPoleInfoVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ LampListResponseVO lampVO = new LampListResponseVO();
|
|
|
+ lampVO.setSectionList(sectionList);
|
|
|
+ List<LampInfoDTO> navByVO = lampService.getNavByVO(lampVO);
|
|
|
+ for (LampInfoDTO dto :navByVO) {
|
|
|
+ if (dto.getAreaId() != null){
|
|
|
+ String areaId = dto.getAreaId().toString();
|
|
|
+ if (integerObjectHashMap.containsKey(areaId)) {
|
|
|
+ LampPoleInfoVO lampPoleInfoVO = integerObjectHashMap.get(areaId);
|
|
|
+ lampPoleInfoVO.setLampCount(lampPoleInfoVO.getLampCount() + 1);
|
|
|
+ integerObjectHashMap.put(areaId, lampPoleInfoVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
ArrayList<LampPoleInfoVO> lampPoleInfoVOS = new ArrayList<>();
|
|
|
- Set<Integer> integers = integerObjectHashMap.keySet();
|
|
|
- for (Integer i :integers) {
|
|
|
+ Set<String> integers = integerObjectHashMap.keySet();
|
|
|
+ for (String i :integers) {
|
|
|
+ LampPoleInfoVO lampPoleInfoVO = integerObjectHashMap.get(i);
|
|
|
+ if (lampPoleInfoVO.getDeviceCount() == 0 && type == 0) continue;
|
|
|
lampPoleInfoVOS.add(integerObjectHashMap.get(i));
|
|
|
}
|
|
|
ListResponseVO listResponseVO = new ListResponseVO();
|
|
@@ -1242,11 +1371,17 @@ public class NewLampPoleController {
|
|
|
Integer areaId = (Integer) toolUtils.getRequestContent(request, "areaId", 1);
|
|
|
Integer sectionId = (Integer) toolUtils.getRequestContent(request, "sectionId", 1);
|
|
|
LampPoleVO lampPoleVO = new LampPoleVO();
|
|
|
+ List sectionList = toolUtils.getSectionList(request);
|
|
|
lampPoleVO.setAreaId(areaId);
|
|
|
lampPoleVO.setSectionId(sectionId);
|
|
|
- lampPoleVO.setSectionList(toolUtils.getSectionList(request));
|
|
|
+ lampPoleVO.setSectionList(sectionList);
|
|
|
Integer deviceCount = lampPoleService.getLampPoleInstallTotal(lampPoleVO);
|
|
|
- Integer faultCount = lampPoleService.getLampPoleAlarmTotal(lampPoleVO);
|
|
|
+ // 故障数
|
|
|
+ LampPoleCountVO lampPoleCountVO = new LampPoleCountVO();
|
|
|
+ lampPoleCountVO.setSectionList(sectionList);
|
|
|
+ Integer faultCount = lampPoleService.getAlarmCountByVO(lampPoleCountVO);
|
|
|
+
|
|
|
+// Integer faultCount = lampPoleService.getLampPoleAlarmTotal(lampPoleVO);
|
|
|
Integer newCount = lampPoleService.getNewCreateLampPoleCount(lampPoleVO);
|
|
|
LampPoleVO vo = new LampPoleVO();
|
|
|
vo.setDeviceCount(deviceCount);
|