| | |
| | | import static com.moral.common.util.ResourceUtil.getValue;
|
| | | import static com.moral.common.util.WebUtils.getParametersStartingWith;
|
| | |
|
| | | import java.io.*;
|
| | | import java.io.BufferedReader;
|
| | | import java.io.ByteArrayInputStream;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.io.InputStreamReader;
|
| | | import java.util.HashMap;
|
| | | import java.util.LinkedHashMap;
|
| | | import java.util.Map;
|
| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.moral.common.xml.Version;
|
| | | import org.apache.commons.net.ftp.FTPClient;
|
| | | import org.dom4j.Document;
|
| | | import org.dom4j.Element;
|
| | | import org.dom4j.io.SAXReader;
|
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.data.redis.core.RedisTemplate;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.springframework.web.bind.annotation.RequestParam;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import org.xml.sax.InputSource;
|
| | |
|
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alibaba.fastjson.JSONReader;
|
| | | import com.alibaba.fastjson.TypeReference;
|
| | | import com.moral.common.bean.ResultBean;
|
| | | import com.moral.common.util.ValidateUtil;
|
| | | import com.moral.common.xml.Version;
|
| | | import com.moral.service.AccountService;
|
| | | import com.moral.service.DataService;
|
| | | import com.moral.service.DeviceService;
|
| | | import com.moral.service.HistoryMinutelyService;
|
| | | import com.moral.service.HistoryService;
|
| | | import com.moral.service.MachineActivateService;
|
| | | import org.xml.sax.InputSource;
|
| | |
|
| | | /**
|
| | | * The Class ScreenController.大屏接口
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("screen")
|
| | | @CrossOrigin(origins = "*", maxAge = 3600)
|
| | | @RequestMapping("/screen")
|
| | | //@CrossOrigin(origins = "*", maxAge = 3600)
|
| | | public class ScreenController {
|
| | |
|
| | | /** The screen service. */
|
| | |
| | | private DeviceService deviceService;
|
| | |
|
| | | @Resource
|
| | | private DataService dataService;
|
| | | private HistoryMinutelyService historyMinutelyService;
|
| | |
|
| | | @Resource
|
| | | private MachineActivateService machineActivateService;
|
| | |
| | | * the request
|
| | | * @return the equipment states
|
| | | */
|
| | | @GetMapping("equipment-state")
|
| | | @GetMapping("/equipment-state")
|
| | | public Map<String, Object> getDeviceStatesByAccount(HttpServletRequest request) {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | return deviceService.getDeviceStatesByAccount(parameters);
|
| | |
| | | @GetMapping("day-aqi")
|
| | | public Map<String, Object> getDayAQIByDevice(HttpServletRequest request) {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | return dataService.getDayAQIByDevice(parameters);
|
| | | return historyMinutelyService.getDayAQIByDevice(parameters);
|
| | | }
|
| | |
|
| | | /**
|