|
@@ -61,6 +61,9 @@ public class WorkManageController {
|
|
|
@Autowired
|
|
|
private DefectManageService defectManageService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PatrolTaskService patrolTaskService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private PatrolManageService patrolManageService;
|
|
|
|
|
@@ -709,4 +712,116 @@ public class WorkManageController {
|
|
|
vo.setDataList(dataList);
|
|
|
return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,vo);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 统计图数据
|
|
|
+ * @param request 时间筛选,类型筛选
|
|
|
+ * @return 统计图数据
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/operationDataDetails", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> operationDataDetails(HttpServletRequest request) throws ParseException {
|
|
|
+ Integer version = (Integer) toolUtils.getRequestContent(request, "version", 1);
|
|
|
+ Integer dateType = (Integer) toolUtils.getRequestContent(request, "dateType", 1);
|
|
|
+ Integer mode = (Integer) toolUtils.getRequestContent(request, "mode", 1);
|
|
|
+
|
|
|
+ long l = System.currentTimeMillis();
|
|
|
+ Date date1 = new Date(l);
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTime(date1);
|
|
|
+ int year = calendar.get(Calendar.YEAR); // 获取年份
|
|
|
+ int month = calendar.get(Calendar.MONTH) + 1; // 获取月份
|
|
|
+ long startTime, endTime;
|
|
|
+ String startDate = "";
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ String endDate = simpleDateFormat.format(l);
|
|
|
+ if (dateType == 0) { // 当月
|
|
|
+ if (month < 10) {
|
|
|
+ startDate = year + "-0" + month + "-01";
|
|
|
+ } else {
|
|
|
+ startDate = year + "-" + month + "-01";
|
|
|
+ }
|
|
|
+ } else if (dateType == 1) { // 当年
|
|
|
+ month = 1;
|
|
|
+ startDate = year + "-0" + month + "-01";
|
|
|
+ endDate = simpleDateFormat.format(l);
|
|
|
+ } else if (dateType == 2) { // 全部
|
|
|
+ endDate = simpleDateFormat.format(l);
|
|
|
+ } else if (dateType == 3) { // 具体月份
|
|
|
+ String date = (String) toolUtils.getRequestContent(request, "date", 2);
|
|
|
+ if (date.length() == 0) return toolUtils.response(InterfaceResultEnum.LACK_DATE_ERROR, version);
|
|
|
+ List<String> list = Arrays.asList(date.split("-"));
|
|
|
+ int yearNum = Integer.parseInt(list.get(0));
|
|
|
+ int monthNum = Integer.parseInt(list.get(1));
|
|
|
+ int daysInMonth = YearMonth.of(yearNum, monthNum).lengthOfMonth();
|
|
|
+ if (yearNum == year && monthNum == month) {
|
|
|
+ if (month < 10) {
|
|
|
+ startDate = year + "-" + "0" + month + "-01";
|
|
|
+ } else {
|
|
|
+ startDate = year + "-" + month + "-01";
|
|
|
+ }
|
|
|
+ } else if ((yearNum == year && monthNum > month) || (yearNum > year)) {
|
|
|
+ return toolUtils.response(InterfaceResultEnum.DATE_CHOOSE_ERROR, version);
|
|
|
+ } else {
|
|
|
+ startTime = simpleDateFormat.parse(date + "-01").getTime();
|
|
|
+ endTime = simpleDateFormat.parse(date + "-" + daysInMonth).getTime();
|
|
|
+ startDate = simpleDateFormat.format(startTime);
|
|
|
+ endDate = simpleDateFormat.format(endTime);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ OperationVO operationVO = new OperationVO();
|
|
|
+ operationVO.setStartDate(startDate);
|
|
|
+ operationVO.setEndDate(endDate);
|
|
|
+ operationVO.setSectionList(toolUtils.getSectionList(request));
|
|
|
+ OperationDataVO operationDataVO = new OperationDataVO();
|
|
|
+ if (mode == 4) { // 报警数据
|
|
|
+ Integer alarmUntreatedCount = allAlarmInfoLogService.getAlarmUntreatedCount(operationVO);
|
|
|
+ Integer alarmHandlingCount = allAlarmInfoLogService.getAlarmHandlingCount(operationVO);
|
|
|
+ Integer alarmHandledCount = allAlarmInfoLogService.getAlarmHandledCount(operationVO);
|
|
|
+ operationDataVO.setData1(alarmUntreatedCount);
|
|
|
+ operationDataVO.setData2(alarmHandlingCount);
|
|
|
+ operationDataVO.setData3(alarmHandledCount);
|
|
|
+ } else if (mode == 3) { // 维修项目数据
|
|
|
+ Integer projectNormalCount = repairProjectService.getProjectNormalCount(operationVO);
|
|
|
+ Integer projectAnticipateCount = repairProjectService.getProjectAnticipateCount(operationVO);
|
|
|
+ Integer projectCompleteCount = repairProjectService.getProjectCompleteCount(operationVO);
|
|
|
+ operationDataVO.setData1(projectNormalCount);
|
|
|
+ operationDataVO.setData2(projectAnticipateCount);
|
|
|
+ operationDataVO.setData3(projectCompleteCount);
|
|
|
+ } else if (mode == 2) { // 巡视数据
|
|
|
+ Integer patrolTaskUnStartCount = patrolTaskService.getPatrolTaskUnStartCount(operationVO);
|
|
|
+ Integer patrolTaskHandlingCount = patrolTaskService.getPatrolTaskHandlingCount(operationVO);
|
|
|
+ Integer patrolTaskEndCount = patrolTaskService.getPatrolTaskEndCount(operationVO);
|
|
|
+ Integer patrolCloseArchiveCount = patrolTaskService.getPatrolCloseArchiveCount(operationVO);
|
|
|
+ Integer patrolPostponeCount = patrolTaskService.getPatrolPostponeCount(operationVO);
|
|
|
+ operationDataVO.setData1(patrolTaskUnStartCount);
|
|
|
+ operationDataVO.setData2(patrolTaskHandlingCount);
|
|
|
+ operationDataVO.setData3(patrolTaskEndCount);
|
|
|
+ operationDataVO.setData4(patrolCloseArchiveCount);
|
|
|
+ operationDataVO.setData5(patrolPostponeCount);
|
|
|
+ } else if (mode == 1) { // 缺陷数据
|
|
|
+ Integer defectManageUndistributedCount = defectManageService.getDefectManageUndistributedCount(operationVO);
|
|
|
+ Integer defectManageHandlingCount = defectManageService.getDefectManageHandlingCount(operationVO);
|
|
|
+ Integer defectManageRecheckCount = defectManageService.getDefectManageRecheckCount(operationVO);
|
|
|
+ Integer defectManageCloseCaseCount = defectManageService.getDefectManageCloseCaseCount(operationVO);
|
|
|
+ Integer defectManageArchiveCount = defectManageService.getDefectManageArchiveCount(operationVO);
|
|
|
+ operationDataVO.setData1(defectManageUndistributedCount);
|
|
|
+ operationDataVO.setData2(defectManageHandlingCount);
|
|
|
+ operationDataVO.setData3(defectManageRecheckCount);
|
|
|
+ operationDataVO.setData4(defectManageCloseCaseCount);
|
|
|
+ operationDataVO.setData5(defectManageArchiveCount);
|
|
|
+ } else { // 工单数据
|
|
|
+ Integer workManageUndistributedCount = workManageService.getWorkManageUndistributedCount(operationVO);
|
|
|
+ Integer workManageHandlingCount = workManageService.getWorkManageHandlingCount(operationVO);
|
|
|
+ Integer workManageRecheckCount = workManageService.getWorkManageRecheckCount(operationVO);
|
|
|
+ Integer workManageCloseCaseCount = workManageService.getWorkManageCloseCaseCount(operationVO);
|
|
|
+ Integer workManageArchiveCount = workManageService.getWorkManageArchiveCount(operationVO);
|
|
|
+ operationDataVO.setData1(workManageUndistributedCount);
|
|
|
+ operationDataVO.setData2(workManageHandlingCount);
|
|
|
+ operationDataVO.setData3(workManageRecheckCount);
|
|
|
+ operationDataVO.setData4(workManageCloseCaseCount);
|
|
|
+ operationDataVO.setData5(workManageArchiveCount);
|
|
|
+ }
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,operationDataVO);
|
|
|
+ }
|
|
|
}
|