#
zhou zhou
1 天以前 fca6edde8c69a755f1e06dd392ed224bd95a426c
src/main/java/com/zy/controller/MonitorController.java
@@ -1,8 +1,10 @@
package com.zy.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Arith;
import com.core.common.Cools;
import com.core.common.R;
import com.zy.entity.LocDetl;
import com.zy.entity.dto.AxisBean;
import com.zy.entity.dto.WorkChartAxis;
import com.zy.entity.vo.LocChartPie;
@@ -16,12 +18,14 @@
import com.zy.core.model.protocol.CrnProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.LedThread;
import com.zy.service.LocDetlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -38,6 +42,33 @@
    private ReportQueryMapper reportQueryMapper;
    @Autowired
    private SlaveProperties slaveProperties;
    @Autowired
    private LocDetlService locDetlService;
    @GetMapping("/getIpConfig")
    public R getIpConfig(HttpServletRequest request) {
        HashMap<String, String> map = new HashMap<>();
        for (LedSlave slave : slaveProperties.getLed()) {
            if (slave.getIp().equals(request.getRemoteAddr())) {
                map.put("ledIp","10.10.10.200");
                map.put("ledPort","8080");
                map.put("ledUrl","wcs");
                map.put("ledId", String.valueOf(slave.getStaArr().get(0)));
                break;
            }
        }
        return R.ok(map);
    }
    @GetMapping(value = "/locDetl/pda/statisticalModel")
    public R statisticalModel() {
        EntityWrapper<LocDetl> locDetlEntityWrapper = new EntityWrapper<>();
        locDetlEntityWrapper.setSqlSelect("model,COUNT(*) as modelCount").groupBy("model");
       List<Map<String, Object>>  selectMap = locDetlService.selectMaps(locDetlEntityWrapper);
        return R.ok(selectMap);
    }
    /**
     * 获取当前时间