package com.ruoyi.project.tr.report.controller;
|
|
import com.ruoyi.framework.web.controller.BaseController;
|
import com.ruoyi.project.system.company.domain.Company;
|
import com.ruoyi.project.system.company.service.ICompanyService;
|
import com.ruoyi.project.system.user.domain.User;
|
import com.ruoyi.project.tr.report.service.ReportService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.ui.ModelMap;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.Collections;
|
import java.util.List;
|
import java.util.Map;
|
|
@Controller
|
@RequestMapping("/tr/report")
|
public class ReportController extends BaseController {
|
@Autowired
|
private ReportService reportService;
|
private String prefix = "tr/report";
|
|
@GetMapping("/riskHome")
|
public String getRiskHome(ModelMap map) {
|
List fourColorPic = reportService.getFourColorPic(getSysUser().getCompanyId());
|
map.put("fourColorPic",fourColorPic);
|
return prefix + "/riskHome";
|
}
|
|
@GetMapping("/hiddenTroubleHome")
|
public String getJHiddenTroubleHome() {
|
return prefix + "/hiddenTroubleHome";
|
}
|
|
/**
|
* 查询按部门分类隐患
|
*
|
* @return
|
*/
|
@GetMapping("/deptDangersReport")
|
@ResponseBody
|
public Map getDeptDangersReport() {
|
return reportService.selectDeptDangers(getSysUser().getCompanyId());
|
}
|
|
/**
|
* 查询按隐患类别分类隐患
|
*
|
* @return
|
*/
|
@GetMapping("/troubleTypeDangersReport")
|
@ResponseBody
|
public Map getTroubleTypeDangersReport() {
|
return reportService.selectTroubleTypeDangers(getSysUser().getCompanyId());
|
}
|
|
/**
|
* 查询按月统计隐患信息
|
*
|
* @return
|
*/
|
@GetMapping("/monthlyDangerReport")
|
@ResponseBody
|
public Map getMonthlyDangers() {
|
return reportService.selectMonthlyDangers(getSysUser().getCompanyId());
|
}
|
|
/**
|
* 查询按年统计隐患信息
|
*
|
* @return
|
*/
|
@GetMapping("/yearlyDangerReport")
|
@ResponseBody
|
public Map getYearlyDangers() {
|
return reportService.selectYearlyDangers(getSysUser().getCompanyId());
|
}
|
|
/**
|
* 根据部门分类查询风险数据
|
*
|
* @return
|
*/
|
@GetMapping("/deptRiskReport")
|
@ResponseBody
|
public Map getRisksByDept() {
|
return reportService.selectRiskByDept(getSysUser().getCompanyId());
|
}
|
|
/**
|
* 根据区域分类查询风险数据
|
*
|
* @return
|
*/
|
@GetMapping("/regionRiskReport")
|
@ResponseBody
|
public Map getRisksByRegion() {
|
return reportService.selectRiskByRegion(getSysUser().getCompanyId());
|
}
|
|
/**
|
* 风险单元统计数据
|
*
|
* @return
|
*/
|
@GetMapping("/riskPointReport/{riskType}")
|
@ResponseBody
|
public Map getRiskPoint(@PathVariable("riskType") Integer riskType) {
|
if (riskType == null) riskType = 1;
|
return reportService.selectRiskPoint(riskType, getSysUser().getCompanyId());
|
}
|
|
/**
|
* 风险趋势数据
|
*
|
* @return
|
*/
|
@GetMapping("/riskTrendReport")
|
@ResponseBody
|
public Map getRiskTrend() {
|
return reportService.selectRiskTrend(getSysUser().getCompanyId());
|
}
|
|
/**
|
* 查询区域隐患信息
|
*
|
* @return
|
*/
|
@GetMapping("/regionDangerReport")
|
@ResponseBody
|
public Map getRegionDanger() {
|
return reportService.selectDangerByRegion(getSysUser().getCompanyId());
|
}
|
|
/**
|
* 查询首页任务数量
|
*
|
* @return
|
*/
|
@GetMapping("/taskCount")
|
@ResponseBody
|
public Map getTaskCount() {
|
User sysUser = getSysUser();
|
return reportService.selectReportCount(sysUser.getCompanyId(), sysUser.getUserId());
|
}
|
|
/**
|
* 查询公示页面所需信息
|
*
|
* @return
|
*/
|
@PostMapping("/publicity")
|
@ResponseBody
|
public Map getPublicityData() {
|
//TODO:返回页面
|
User sysUser = getSysUser();
|
return reportService.selectPublicityReportData(sysUser.getCompanyId());
|
}
|
|
/**
|
* 请求公示页面
|
*
|
* @return
|
*/
|
@GetMapping("/publicity")
|
public String getPublicity(ModelMap map) {
|
reportService.selectPublicityHeadData(getSysUser().getCompanyId(),map);
|
return prefix + "/publicity";
|
}
|
}
|