严智鑫
2025-11-13 945bc394f40d8af1072a53da9a94f24207124e6d
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
231
232
233
234
235
236
237
238
239
240
241
package com.northglass.web.standalone;
 
 
import java.util.Map;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
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.ResponseBody;
 
import com.northglass.repository.ProdLineStateDao;
import com.northglass.repository.RawPackageTxtDao;
import com.northglass.service.manage.ManageService;
import com.northglass.service.shelfmanager.ShelfManagerService;
import com.northglass.service.standalone.StandAloneService;
 
/**
 * 单机界面管理
 * @author GO1
 *
 */
@Controller
@RequestMapping(value="/standalonemanage")
public class StandAloneController<ShelfManagerervice> {
    
    private static final Logger LOGGER = LoggerFactory.getLogger(StandAloneController.class);
    
    @Autowired
    RawPackageTxtDao rawPackageTxtDao;
    
    @Autowired
    StandAloneService standAloneService;
    
    @Autowired
    ProdLineStateDao prodLineStateDao;
    
    @Autowired
    ShelfManagerService shelfManagerService;
    
    @Autowired
    ManageService manageService;
    
    
    /**
     * 进入单机界面
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/intopages")
    public String inToPages(Model model,HttpServletRequest request){
         return "standalone/startStandalonePage";
    }
    /**
     * 进入单机界面
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/intopage")
    public String inToPage(Model model,HttpServletRequest request){
        String id=request.getParameter("id");
        return standAloneService.intoPage(id, model);
    }
    
    
    /**
     * 查看当前料架信息
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/getrawinfo")
    public String getRawInfo(Model model,HttpServletRequest request){
        model.addAttribute("rawPackageHtml", standAloneService.getRawInfo(model, request));
        //获取机号
        String machine = request.getParameter("machine");
        if(machine.equals("1")){
            return "standalone/rawinfo";
        }else{
            return "standalone/rawinfo2";
        }
    }
    
    /**
     * 筛选符合条件的料架
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/getpagebycondition")
    public String getPageByCondition(HttpServletRequest request , Model model){
        return standAloneService.getTaskCurrentLine(request, "1", model);
    }
    
    /**
     * 筛选符合条件的料架(2号)
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/getpagebycondition2")
    public String getPageByCondition2(HttpServletRequest request , Model model){
        return standAloneService.getTaskCurrentLine(request, "2", model);
    }
    
    
    
    /**
     * 退库前输入剩余玻璃片数
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/exitShelfEnterLeftPieces")
    public String exitShelfEnterLeftPieces(HttpServletRequest request , Model model){
        return standAloneService.exitShelfEnterLeftPieces(request, "1", model);
    }
    
    /**
     * 退库前输入剩余玻璃片数(2号)
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/exitShelfEnterLeftPieces2")
    public String exitShelfEnterLeftPieces2(HttpServletRequest request , Model model){
        return standAloneService.exitShelfEnterLeftPieces(request, "2", model);
    }
    
    /**
     * 退库
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/exitshelf")
    public String exitShelf(HttpServletRequest request , Model model){
        return standAloneService.exitShelf(request, "1", model);
    }
    
    /**
     * 退库(2号)
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/exitshelf2")
    public String exitShelf2(HttpServletRequest request , Model model){
        return standAloneService.exitShelf(request, "2", model);
    }
    
    
    /**
     * 调度状态
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/dispatchinfo")
    public String dispatchInfo(Model model){
        model.addAttribute("disPatchStateHtml", standAloneService.getDispatchHtml((long)1));
        return "standalone/dispatchPage";
    }
    
    /**
     * 调度状态(2号)
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/dispatchinfo2")
    public String dispatchInfo2(Model model){
        model.addAttribute("disPatchStateHtml", standAloneService.getDispatchHtml((long)2));
        return "standalone/dispatchPage";
    }
    
    /**
     * 校验需要创建的料架任务
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/loadranktaskcheck")
    @ResponseBody
    public String loadRankTaskCheck(Model model,HttpServletRequest request,HttpServletResponse response){
        return standAloneService.checkLoadRankTask(request, (long) 1);
    }
    
    /**
     * 创建料架任务
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/createloadtask")
    public String createLoadTask(Model model,HttpServletRequest request){
        return standAloneService.createLoadTask(request, "1", model);
    }
 
    /**
     * 校验需要创建的料架任务(2号)
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/loadranktaskcheck2")
    @ResponseBody
    public String loadRankTaskCheck2(Model model,HttpServletRequest request,HttpServletResponse response){
        return standAloneService.checkLoadRankTask(request, (long) 2);
    }
    
    /**
     * 创建料架任务(2号)
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/createloadtask2")
    public String createLoadTask2(Model model,HttpServletRequest request){
        return standAloneService.createLoadTask(request, "2", model);
    }
    
    /**
     * 退出单机模式
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/endSingleMachine")
    public String endSingleMachine(HttpServletRequest request,Model model){
        return standAloneService.endSingleMachine(request, model);
    }
    
    /**
     * 输入剩余原片数量后退出
     * @return
     */
    @RequestMapping(method=RequestMethod.GET,value="/endsinglemodel")
    public String endSingleModel(HttpServletRequest request){
        return standAloneService.endSingleModel(request);
    }
    
    
    /**
     * 查询
     * @return
     */
    @RequestMapping(method=RequestMethod.POST,value="/search")
    public String serch(Model model,@RequestParam("idHtml") String idHtml,@RequestParam("color") String color,@RequestParam("glassThickness") String glassThickness){
        StringBuffer html = new StringBuffer();
        html.append("<option>").append(idHtml).append("</option>");
        model.addAttribute("idHtml",html.toString());
        model.addAttribute("getLoadsHtmls",shelfManagerService.getLoadsHtmls(idHtml));
        model.addAttribute("optionHtml",shelfManagerService.getcolorHtml());
        model.addAttribute("shelfRankNumberList", shelfManagerService.getFreeShelfRankNumberList());
        model.addAttribute("getColorList", shelfManagerService.getColorList());
        model.addAttribute("loadMachineHtml", shelfManagerService.getLoadMachineRankHtml(1L));
        model.addAttribute("shelftasks", shelfManagerService.findShelfTask());
        model.addAttribute("rankList", shelfManagerService.findRankList(color,glassThickness));
        return "standalone/shelfRankPage";
    }
    
}