package com.gkhy.safePlatform.riskCtrl.controller;
|
|
import com.gkhy.safePlatform.commons.vo.ResultVO;
|
import com.gkhy.safePlatform.riskCtrl.enums.ReportBizEnum;
|
import com.gkhy.safePlatform.riskCtrl.model.dto.resp.RiskMonthReportRespDTO;
|
import com.gkhy.safePlatform.riskCtrl.service.RiskReportService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.validation.constraints.NotNull;
|
import java.util.List;
|
|
@RestController
|
@RequestMapping("riskCtrl/risk/report")
|
public class RiskReportController {
|
|
@Autowired
|
private RiskReportService riskReportService;
|
|
@RequestMapping("/singleMonth/prevent")
|
public Object getPreventMonthReport(@RequestParam(required = true)@NotNull Long depId,
|
@RequestParam(required = true)@NotNull Integer year,
|
@RequestParam(required = true)@NotNull Integer month){
|
ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getReportByMonth(depId, ReportBizEnum.PREVENT_RISK.getType(), year,
|
month);
|
return resultVO;
|
}
|
|
@RequestMapping("/singleMonth/emergency")
|
public Object getEmergencyMonthReport(@RequestParam(required = true)@NotNull Long depId,
|
@RequestParam(required = true)@NotNull Integer year,
|
@RequestParam(required = true)@NotNull Integer month){
|
ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getReportByMonth(depId,
|
ReportBizEnum.EMERGENCY_PRACTICE.getType(), year,
|
month);
|
return resultVO;
|
}
|
|
@RequestMapping("/singleMonth/incident")
|
public Object getIncidentMonthReport(@RequestParam(required = true)@NotNull Long depId,
|
@RequestParam(required = true)@NotNull Integer year,
|
@RequestParam(required = true)@NotNull Integer month){
|
ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getReportByMonth(depId,
|
ReportBizEnum.INCIDENT_COUNT.getType(), year,
|
month);
|
return resultVO;
|
}
|
|
//------------公司级报表------------------
|
@RequestMapping("/singleMonth/prevent/company")
|
public Object getPreventMonthReport(@RequestParam(required = true)@NotNull Integer year,
|
@RequestParam(required = true)@NotNull Integer month){
|
ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getCompanyReportByMonth(ReportBizEnum.PREVENT_RISK.getType(), year, month);
|
return resultVO;
|
}
|
|
@RequestMapping("/singleMonth/emergency/company")
|
public Object getEmergencyMonthReport(@RequestParam(required = true)@NotNull Integer year,
|
@RequestParam(required = true)@NotNull Integer month){
|
ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getCompanyReportByMonth(ReportBizEnum.EMERGENCY_PRACTICE.getType(), year, month);
|
return resultVO;
|
}
|
|
@RequestMapping("/singleMonth/incident/company")
|
public Object getIncidentMonthReport(@RequestParam(required = true)@NotNull Integer year,
|
@RequestParam(required = true)@NotNull Integer month){
|
ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getCompanyReportByMonth(ReportBizEnum.INCIDENT_COUNT.getType(), year, month);
|
return resultVO;
|
}
|
|
//------------指定年份报表------------------
|
|
/**
|
* 获取指定部门的指定年度双重预发隐患统计报表
|
* @param depId
|
* @param year
|
* @param month
|
* @return
|
*/
|
@RequestMapping("/year/prevent/department")
|
public Object getDepartmentYearPreventReport(@RequestParam(required = true)@NotNull Long depId,
|
@RequestParam(required = true)@NotNull Integer year,
|
@RequestParam(required = true)@NotNull Integer month){
|
ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByYear(depId,
|
ReportBizEnum.PREVENT_RISK.getType(), year);
|
return resultVO;
|
}
|
|
/**
|
* 获取指定部门的指定年度应急演练统计统计报表
|
* @param depId
|
* @param year
|
* @param month
|
* @return
|
*/
|
@RequestMapping("/year/emergency/department")
|
public Object getDepartmentYearEmergencyReport(@RequestParam(required = true)@NotNull Long depId,
|
@RequestParam(required = true)@NotNull Integer year,
|
@RequestParam(required = true)@NotNull Integer month){
|
ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByYear(depId,
|
ReportBizEnum.EMERGENCY_PRACTICE.getType(), year);
|
return resultVO;
|
}
|
|
/**
|
* 获取指定部门的指定年度事故统计报表
|
* @param depId
|
* @param year
|
* @param month
|
* @return
|
*/
|
@RequestMapping("/year/incident/department")
|
public Object getDepartmentYearIncidentReport(@RequestParam(required = true)@NotNull Long depId,
|
@RequestParam(required = true)@NotNull Integer year,
|
@RequestParam(required = true)@NotNull Integer month){
|
ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByYear(depId,
|
ReportBizEnum.INCIDENT_COUNT.getType(), year);
|
return resultVO;
|
}
|
|
//---公司报表
|
|
/**
|
* 获取指定部门的指定年度双重预发隐患统计报表
|
* @param year
|
* @return
|
*/
|
@RequestMapping("/year/prevent/company")
|
public Object getCompanyYearPreventReport(@RequestParam(required = true)@NotNull Integer year){
|
ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getCompanyReportByYear(ReportBizEnum.PREVENT_RISK.getType(), year);
|
return resultVO;
|
}
|
|
/**
|
* 获取指定部门的指定年度应急演练统计统计报表
|
* @param year
|
* @return
|
*/
|
@RequestMapping("/year/emergency/company")
|
public Object getCompanyYearEmergencyReport(@RequestParam(required = true)@NotNull Integer year){
|
ResultVO<List<RiskMonthReportRespDTO>> resultVO =
|
riskReportService.getCompanyReportByYear(ReportBizEnum.EMERGENCY_PRACTICE.getType(), year);
|
return resultVO;
|
}
|
|
/**
|
* 获取指定部门的指定年度事故统计报表
|
* @param year
|
* @return
|
*/
|
@RequestMapping("/year/incident/company")
|
public Object getCompanyYearIncidentReport(@RequestParam(required = true)@NotNull Integer year){
|
ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getCompanyReportByYear(ReportBizEnum.INCIDENT_COUNT.getType(), year);
|
return resultVO;
|
}
|
|
//------------------指定月份区间的报表-------------------
|
|
/**
|
* 获取指定部门的指定月份区间双重预发隐患统计报表
|
* @param depId
|
* @param beginYear
|
* @param beginMonth
|
* @param endYear
|
* @param endMonth
|
* @return
|
*/
|
@RequestMapping("/multipleMonth/prevent/department")
|
public Object getDepartmentMultipleMonthPreventReport(@RequestParam(required = true)@NotNull Long depId,
|
@RequestParam(required = true)@NotNull Integer beginYear,
|
@RequestParam(required = true)@NotNull Integer beginMonth,
|
@RequestParam(required = true)@NotNull Integer endYear,
|
@RequestParam(required = true)@NotNull Integer endMonth){
|
ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByMultipleMonth(depId,
|
ReportBizEnum.PREVENT_RISK.getType(), beginYear,beginMonth,endYear,endMonth);
|
return resultVO;
|
}
|
|
/**
|
* 获取指定部门的直属子部门在指定月份区间双重预发隐患统计报表
|
* @param depId
|
* @param beginYear
|
* @param beginMonth
|
* @param endYear
|
* @param endMonth
|
* @return
|
*/
|
@RequestMapping("/multipleMonth/prevent/subDepartments")
|
public Object getSubDepartmentMultipleMonthPreventReport(@RequestParam(required = true)@NotNull Long depId,
|
@RequestParam(required = true)@NotNull Integer beginYear,
|
@RequestParam(required = true)@NotNull Integer beginMonth,
|
@RequestParam(required = true)@NotNull Integer endYear,
|
@RequestParam(required = true)@NotNull Integer endMonth){
|
ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getSubDepartmentReportByMultipleMonth(depId,
|
ReportBizEnum.PREVENT_RISK.getType(), beginYear,beginMonth,endYear,endMonth);
|
return resultVO;
|
}
|
|
/**
|
* 获取指定部门的指定月份区间事故统计报表
|
* @param depId
|
* @param beginYear
|
* @param beginMonth
|
* @param endYear
|
* @param endMonth
|
* @return
|
*/
|
@RequestMapping("/multipleMonth/incident/department")
|
public Object getDepartmentMultipleMonthIncidentReport(@RequestParam(required = true)@NotNull Long depId,
|
@RequestParam(required = true)@NotNull Integer beginYear,
|
@RequestParam(required = true)@NotNull Integer beginMonth,
|
@RequestParam(required = true)@NotNull Integer endYear,
|
@RequestParam(required = true)@NotNull Integer endMonth){
|
ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByMultipleMonth(depId,
|
ReportBizEnum.INCIDENT_COUNT.getType(), beginYear,beginMonth,endYear,endMonth);
|
return resultVO;
|
}
|
|
/**
|
* 获取指定部门的指定月份区间应急演练统计报表
|
* @param depId
|
* @param beginYear
|
* @param beginMonth
|
* @param endYear
|
* @param endMonth
|
* @return
|
*/
|
@RequestMapping("/multipleMonth/emergency/department")
|
public Object getDepartmentMultipleMonthEmergencyReport(@RequestParam(required = true)@NotNull Long depId,
|
@RequestParam(required = true)@NotNull Integer beginYear,
|
@RequestParam(required = true)@NotNull Integer beginMonth,
|
@RequestParam(required = true)@NotNull Integer endYear,
|
@RequestParam(required = true)@NotNull Integer endMonth){
|
ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByMultipleMonth(depId,
|
ReportBizEnum.EMERGENCY_PRACTICE.getType(), beginYear,beginMonth,endYear,endMonth);
|
return resultVO;
|
}
|
|
|
|
}
|