|
@@ -754,4 +754,29 @@ public class DataController extends BaseController {
|
|
setLampLogData(baseVO, lampLogVO);
|
|
setLampLogData(baseVO, lampLogVO);
|
|
return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS, version, lampLogVO);
|
|
return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS, version, lampLogVO);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 灯控平均数据
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "/lampAvgData", method = RequestMethod.POST)
|
|
|
|
+ public BaseResult<?> lampAvgData(BaseVO baseVO) {
|
|
|
|
+ Integer version = baseVO.getVersion();
|
|
|
|
+
|
|
|
|
+ List<Integer> sectionList = getSectionList(baseVO.getUsername());
|
|
|
|
+ baseVO.setSectionList(sectionList);
|
|
|
|
+ LampInfoDTO lampInfoDTO = lampService.getLampAvgDataByBaseVO(baseVO);
|
|
|
|
+
|
|
|
|
+ DecimalFormat df = new DecimalFormat("0.##");
|
|
|
|
+ LampInfoDataVO lampInfoDataVO = new LampInfoDataVO();
|
|
|
|
+ if (lampInfoDTO == null) {
|
|
|
|
+ lampInfoDataVO.setAveLightness("0");
|
|
|
|
+ lampInfoDataVO.setAveUsageYears("0");
|
|
|
|
+ lampInfoDataVO.setAveLightTime("0");
|
|
|
|
+ } else {
|
|
|
|
+ lampInfoDataVO.setAveLightness(df.format(lampInfoDTO.getAveLightness()));
|
|
|
|
+ lampInfoDataVO.setAveUsageYears(df.format(lampInfoDTO.getAveUsageYears()));
|
|
|
|
+ lampInfoDataVO.setAveLightTime(df.format(lampInfoDTO.getAveLightTime() / 60));
|
|
|
|
+ }
|
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS, version, lampInfoDataVO);
|
|
|
|
+ }
|
|
}
|
|
}
|