zhuguifei
2026-03-10 58402bd5e762361363a0f7d7907153c77dbb819f
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
package com.shlanbao.tzsc.pms.isp.controller;
 
import java.util.List;
import java.util.Map;
 
import javax.servlet.http.HttpServletRequest;
 
import com.google.gson.Gson;
import com.shlanbao.tzsc.base.model.Json;
import com.shlanbao.tzsc.pms.sch.workorder.beans.WorkOrderBean;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
 
import com.shlanbao.tzsc.base.controller.BaseController;
import com.shlanbao.tzsc.pms.isp.beans.BoxerGroup;
import com.shlanbao.tzsc.pms.isp.beans.FilterGroup;
import com.shlanbao.tzsc.pms.isp.beans.RollerPackerGroup;
import com.shlanbao.tzsc.pms.isp.beans.ShooterGroup;
import com.shlanbao.tzsc.pms.isp.beans.WorkorderInfoBean;
import com.shlanbao.tzsc.pms.isp.service.PmsIspServiceI;
 
/**
 * PMS实时监控监控控制器
 *
 * @author Leejean
 * @create 2015年1月22日下午3:03:24
 */
@Controller
@RequestMapping("/pms/isp")
public class PmsIspController extends BaseController {
    @Autowired
    private PmsIspServiceI pmsIspService;
 
    /**
     * 初始化卷包机组
     *
     * @param request
     * @return
     * @author Leejean
     * @create 2015年1月15日上午9:50:17
     */
    @ResponseBody
    @RequestMapping("/initRollerPackerGroups")
    public List<RollerPackerGroup> initRollerPackerGroups(HttpServletRequest request) {
 
        return pmsIspService.initRollerPackerGroups(request);
    }
 
    /**
     * @param type 1:卷烟机工单2:包装机工单3:封箱机工单4:成型机工
     *             卷烟机和包装机为一个整体机组,该机组使用卷烟机工单作为显示
     * @return
     * @author Leejean
     * @create 2015年1月26日上午11:41:07
     */
    @ResponseBody
    @RequestMapping("/initWorkOrderInfo")
    public List<WorkOrderBean> initWorkOrderInfo(Long type) {
        return pmsIspService.initRollerPackerGroupWorkOrderInfo(type);
    }
 
    /**
     * 初始化封箱机
     *
     * @param request
     * @return
     * @author Leejean
     * @create 2015年1月15日上午9:50:17
     */
    @ResponseBody
    @RequestMapping("/initBoxerGroups")
    public List<BoxerGroup> initBoxerGroups(HttpServletRequest request) {
        return pmsIspService.initBoxerGroups(request);
    }
 
    /**
     * 初始化发射机
     *
     * @param request
     * @return
     * @author Leejean
     * @create 2015年1月15日上午9:50:17
     */
    @ResponseBody
    @RequestMapping("/initShootererGroups")
    public List<ShooterGroup> initShootererGroups(HttpServletRequest request) {
        return pmsIspService.initShootererGroups(request);
    }
 
    /**
     * 初始化成型机
     *
     * @param request
     * @return
     * @author Leejean
     * @create 2015年1月15日上午9:50:17
     */
    @ResponseBody
    @RequestMapping("/initFilterGroups")
    public List<FilterGroup> initFilterGroups(HttpServletRequest request) {
        return pmsIspService.initFilterGroups(request);
    }
 
    /**
     * 获得所有卷包机组数据
     *
     * @return
     * @author Leejean
     * @create 2015年1月16日上午9:05:57
     */
    @ResponseBody
    @RequestMapping("/getAllRollerPackerDatas")
    public Json getAllRollerPackerDatas() {
        Json json = new Json();
        List<Map> list = pmsIspService.getAllRollerPackerDatas();
 
        try {
            if (list != null && list.size() > 0) {
                Gson gson = new Gson();
                String s = gson.toJson(list);
                json.setMsg(s);
                json.setSuccess(true);
//                log.info("卷包设备实时数据:" + list.toString());
            } else {
                json.setMsg("获取数据失败!请重试!");
            }
 
 
        } catch (Exception e) {
            e.printStackTrace();
        }
        return json;
    }
 
    /**
     * 获得所有成型机组数据
     *
     * @return
     * @author Leejean
     * @create 2015年1月16日上午9:05:57
     */
    @ResponseBody
    @RequestMapping("/getAllFilterDatas")
    public Json getAllFilterDatas() {
        Json json = new Json();
        List<Map> list = pmsIspService.getAllFilterDatas();
 
        try {
            if (list != null && list.size() > 0) {
                Gson gson = new Gson();
                String s = gson.toJson(list);
                json.setMsg(s);
                json.setSuccess(true);
//                log.info("成型设备实时数据:" + list.toString());
            } else {
                json.setMsg("获取数据失败!请重试!");
            }
 
 
        } catch (Exception e) {
            e.printStackTrace();
        }
        return json;
    }
 
 
    /**
     * @param map 设备相关信息 equCode 设备code
     * @return
     * @desc 获取单个设备的详细实时数据
     * @author zgf
     */
    @ResponseBody
    @RequestMapping("/getEquDetailRealData")
    public Json getEquDetailRealData(@RequestParam Map<Object, Object> map) {
        Map<Object, Object> data = pmsIspService.getEquDetailRealData(map);
        Json json = new Json();
        try {
            if (!data.isEmpty()) {
 
                json.setMsg(JSONObject.fromObject(data).toString());
                json.setSuccess(true);
            } else {
                json.setMsg("获取数据失败!请重试!");
            }
 
        } catch (Exception e) {
            e.printStackTrace();
        }
 
        return json;
    }
 
 
    /**
     * 获取条烟输送实时数据
     * @return
     */
    @ResponseBody
    @RequestMapping("/getFormatted")
    public Json getFormatted() {
        Json json = new Json();
         Map map = pmsIspService.getFormatted();
        try {
            if (map != null && map.size() > 0) {
                Gson gson = new Gson();
                String s = gson.toJson(map);
                json.setMsg(s);
                json.setSuccess(true);
//                log.info("卷包设备实时数据:" + list.toString());
            } else {
                json.setMsg("获取数据失败!请重试!");
            }
 
 
        } catch (Exception e) {
            e.printStackTrace();
        }
        return json;
    }
 
    @RequestMapping("/board")
    public String board(HttpServletRequest request){
        return "pms/isp/board";
    }
}