EventMapController.java 2.7 KB
package com.skua.modules.emergency.controller;

import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.modules.emergency.service.IEmergencyRiskEventService;
import com.skua.modules.emergency.vo.DangerDatabaseResult;
import com.skua.modules.emergency.vo.MapDatabaseResult;
import com.skua.modules.emergency.vo.RiskDatabaseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;

/**
 * 安全环保地图接口
 */
@Slf4j
@Api(tags="安全环保地图")
@RestController
@RequestMapping("/safetyEnviron/map")
public class EventMapController {
	@Autowired
	private IEmergencyRiskEventService emergencyRiskEventService;

	/**
	 * 	安全隐患事件数量
	 */
	@AutoLog(value = "安全隐患事件数量")
	@ApiOperation(value="安全隐患事件数量", notes="安全隐患事件数量")
	@GetMapping(value = "/getCount")
	public Result<Map<String,Object>> getHandleCount(String year){
		Result<Map<String,Object>> result = new Result<>();
		Map<String,Object> map = emergencyRiskEventService.getCount(year);
		result.setSuccess(true);
		result.setResult(map);
		return result;
	}

	/**
	 * 	风险库统计
	 */
	@AutoLog(value = "风险库统计")
	@ApiOperation(value="风险库统计", notes="风险库统计")
	@GetMapping(value = "/getRiskList")
	public Result<List<RiskDatabaseResult>> getRiskList(String year){
		Result<List<RiskDatabaseResult>> result = new Result<>();
		List<RiskDatabaseResult> list = emergencyRiskEventService.getRiskList(year);
		result.setSuccess(true);
		result.setResult(list);
		return result;
	}

	/**
	 * 	隐患排查巡检统计
	 */
	@AutoLog(value = "隐患排查巡检统计")
	@ApiOperation(value="隐患排查巡检统计", notes="隐患排查巡检统计")
	@GetMapping(value = "/getDangerList")
	public Result<List<DangerDatabaseResult>> getDangerList(String year){
		Result<List<DangerDatabaseResult>> result = new Result<>();
		List<DangerDatabaseResult> list = emergencyRiskEventService.getDangerList(year);
		result.setSuccess(true);
		result.setResult(list);
		return result;
	}

	/**
	 * 	地图隐患排查巡检统计
	 */
	@AutoLog(value = "地图隐患排查巡检统计")
	@ApiOperation(value="地图隐患排查巡检统计", notes="地图隐患排查巡检统计")
	@GetMapping(value = "/getMapData")
	public Result<List<MapDatabaseResult>> getMapData(String year){
		Result<List<MapDatabaseResult>> result = new Result<>();
		List<MapDatabaseResult> list = emergencyRiskEventService.getMapData(year);
		result.setSuccess(true);
		result.setResult(list);
		return result;
	}

}