廖井涛
2025-11-28 67f0be5a1d634ba3274fa9366ceacc3580f056b7
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
package com.northglass.web.hollow;
 
 
 
import java.text.ParseException;
import java.util.List;
import java.util.Map;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
 
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.entity.GalssTaskDetails;
import com.northglass.entity.RawPackage;
import com.northglass.repository.GalssTaskDetailsDao;
import com.northglass.service.hollow.HollowService;
import com.northglass.service.shelfmanager.ShelfManagerService;
 
 
@Controller
@RequestMapping(value="/hollow")
public class HollowController {
    @Autowired
    private HollowService hollowService;
    @Autowired
    ShelfManagerService shelfManagerService;
    
    @Autowired
    GalssTaskDetailsDao galssTaskDetailsDao;
    
    //待领取任务界面(1号切割机)
    @RequestMapping(method=RequestMethod.GET, value="/gettask/{line}")
    public String getTask(Model model,@PathVariable("line") String line){
        return hollowService.getTask(line, model);
    }
    
    @RequestMapping(method=RequestMethod.GET, value="/gettask2/{line}")
    public String getTask2(Model model,@PathVariable("line") String line){
        return hollowService.getTask2(line, model);
    }
    
    @RequestMapping(method=RequestMethod.GET, value="/gettasks/{line}")
    public String getTasks(Model model,@PathVariable("line") String line){       
        return hollowService.getTasks(line, model);
    }
    
    @RequestMapping(method=RequestMethod.GET, value="/gottask/{id}/{line}")
    public String gotTask(@PathVariable("id") String id,@PathVariable("line") String line,HttpServletRequest request,HttpServletResponse response,Model model){
        
        return hollowService.getTaskInterface(request, response, Long.valueOf(id),Long.valueOf(line), model);
    }
    
    @RequestMapping(method=RequestMethod.GET, value="/gottasks/{line}")
    public String gottasks(@PathVariable("line") String line,HttpServletRequest request,HttpServletResponse response,Model model){
 
        model.addAttribute("groups", line);
        return "hollow/gotasks"; 
    }
      
    @RequestMapping(method=RequestMethod.GET,value="/loadmachinerack/{groups}")
    public String loadMachine(Model model,@PathVariable("groups") long groups){
        model.addAttribute("shelfRankNumberList", hollowService.getFreeShelfRankNumberList1());
        model.addAttribute("getColorList", hollowService.getColorList());
          model.addAttribute("loadMachineHtml", hollowService.getLoadMachineHtml(groups));
          model.addAttribute("loadflagHtml", hollowService.getloadflagHtml(groups));
          /*model.addAttribute("loadMachineFixHtml", HollowService.getLoadMachineFixHtml());*/
          return "hollow/loadmachinerack"; 
    }
    
    @RequestMapping(method=RequestMethod.GET,value="/deleteinfo/{loadMachineId}")
    public String deleteinfo(Model model,@PathVariable("loadMachineId") String loadMachineId){
        return hollowService.deleteinfo(loadMachineId);
    }
    
    //结束任务
    @RequestMapping(method=RequestMethod.GET,value="/delecttask/{id}")
    public String delecttask(Model model,@PathVariable("id") Long id){
        return hollowService.delecttask(id);
    }
    
    //添加架子
      @RequestMapping(method=RequestMethod.POST, value="/updateinfo")
      @ResponseBody
      public boolean updateinfo(HttpServletRequest request, Model model) {
          hollowService.updateinfo(request.getParameter("dropFrameid"));
          return true;
      }
    
 
    
   /* @RequestMapping(method=RequestMethod.GET,value="/tuikuinfo/{loadMachineId}")
    public String tuikuinfo(Model model,@PathVariable("loadMachineId") String loadMachineId){
        return HollowService.tuikuinfo(loadMachineId);
    }*/
 
    
    //手动修改上片位信息
      @RequestMapping(method=RequestMethod.POST, value="/modifyAction/{groups}")
      public String modifyAction(HttpServletRequest request,@PathVariable("groups") long groups,@RequestParam(value="pieces") String pieces,@RequestParam("Ids") String Ids) {
          hollowService.modifyAction(pieces,Ids);
          return "redirect:/hollow/loadmachinerack/"+groups;
      }
      
      @RequestMapping(method=RequestMethod.GET, value="/taskreport")
    public String getTaskReportPage(Model model){
        //处理1号线的统计任务
        List<GalssTaskDetails> galssTaskDetails = galssTaskDetailsDao.findGalssTaskDetails();
        model.addAttribute("reportTasks", galssTaskDetails);
        /*Map<String, Object> param1 = manageService.showMachineState();
          model.addAttribute("allstatu", param1.get("allstatu"));
         model.addAttribute("info", param1.get("info"));*/
        return "hollow/reportTask";
    }
      
       
     @RequestMapping(method=RequestMethod.POST, value="/selectreport")
     public String selectReport(HttpServletRequest request,Model model) throws ParseException{
         //获取点击的optname
         List<GalssTaskDetails> galssTaskDetails = hollowService.selectgalssTaskDetails(request);
         model.addAttribute("reportTasks", galssTaskDetails);
         return "hollow/reportTask";
     }
     
     @RequestMapping(method=RequestMethod.POST, value="/updatetask")
    @ResponseBody
    public boolean updatetask(HttpServletRequest request, Model model) {
         hollowService.updatetask(Long.valueOf(request.getParameter("id")));
        return true;
    }
     
     @RequestMapping(method=RequestMethod.POST, value="/updatetask1")
    @ResponseBody
    public boolean updatetask1(HttpServletRequest request, Model model) {
         hollowService.updatetask1(Long.valueOf(request.getParameter("id")));
        return true;
    }
     
     
     @RequestMapping(method=RequestMethod.POST, value="/updatemachinefalg/{groups}")
      @ResponseBody
      public boolean updatemachinefalg(HttpServletRequest request,@PathVariable("groups") long groups, Model model) {
         hollowService.updatemachinefalg(groups);
          return true;
      }
     
 
      
 
     
      
}