自动化立体仓库 - WCS系统
zhangc
2025-03-11 d5449236ef0b3adafb3e4cc872f50479efa0ce7b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.zy.common.web;
 
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
 
import javax.servlet.http.HttpServletResponse;
 
/**
 * Created by vincent on 2019-07-30
 */
@Controller
public class RouterController {
 
    @Value("${server.servlet.context-path}")
    private String contextPath;
 
    @RequestMapping("/")
    public void index(HttpServletResponse response) {
        try {
            response.sendRedirect(contextPath + "/views/index.html");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
 
    @RequestMapping("/login")
    public void login(HttpServletResponse response) {
        try {
            response.sendRedirect(contextPath + "/views/login.html");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
 
    @RequestMapping("/control")
    public void control(HttpServletResponse response) {
        try {
            response.sendRedirect(contextPath + "/views/control.html");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
 
    @RequestMapping("/monitor/{cnrId}/{ledId}")
    public void monitor(@PathVariable("cnrId") Integer cnrId,
                        @PathVariable("ledId") Integer ledId,
                        HttpServletResponse response) {
        try {
            response.sendRedirect(contextPath + "/views/monitor/monitor.html" + "?" + "crnId=" + cnrId + "&" + "ledId=" + ledId);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
 
    @RequestMapping("/monitor0/{ledId}")
    public void monitor(@PathVariable("ledId") Integer ledId,
                        HttpServletResponse response) {
        try {
            response.sendRedirect(contextPath + "/views/monitor/monitor0.html" + "?" + "crnId=" + 2 + "&" + "ledId=" + ledId);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
 
}