燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-07-18 93bfb9dc2bc52801132fdbc024e2bf5cb4e96316
src/main/java/com/yssh/controller/WarningAnalyseController.java
@@ -5,7 +5,6 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -13,23 +12,22 @@
import org.springframework.web.bind.annotation.RestController;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yssh.service.IWarningAnalyseService;
import com.yssh.service.WarningAnalyseService;
import com.yssh.utils.Result;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Api(tags = "告警分析")
@RequestMapping("/warning")
@RestController
@SuppressWarnings("rawtypes")
public class WarningAnalyseController {
    @Autowired
    private IWarningAnalyseService warningService;
    @Resource
    private WarningAnalyseService warningService;
    private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
@@ -82,8 +80,8 @@
        //if (null != obj) {
        //    map = (Map<String, List<Double>>) obj;
        //} else {
            //map = warningService.selectEachLocationDataChange();
            map = warningService.select3Hours();
        //map = warningService.selectEachLocationDataChange();
        map = warningService.select3Hours();
        //    if (null != map && map.size() > 0) {
        //        CacheUtils.put(key, map);
        //    }
@@ -98,15 +96,15 @@
    public Result monthTop10() {
        //return Result.OK(warningService.selectThisMonthLocationValueDataTop10());
        String key = dateFormat.format(new Date()) + "_top10";
        Object obj = CacheUtils.get(key);
        //String key = dateFormat.format(new Date()) + "_top10";
        //Object obj = CacheUtils.get(key);
        List<Qxsh> list;
        //if (null != obj) {
        //    list = (List<Qxsh>) obj;
        //} else {
            //list = warningService.selectThisMonthLocationValueDataTop10();
            list = warningService.selectMonthTop10();
        //list = warningService.selectThisMonthLocationValueDataTop10();
        list = warningService.selectMonthTop10();
        //    if (null != list && list.size() > 0) {
        //        CacheUtils.put(key, list);
        //    }