严智鑫
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
package com.northglass.web.identifymachine;
 
import java.util.Map;
 
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
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.LoadMachineFixRack;
import com.northglass.entity.RawPackage;
import com.northglass.service.identifymachine.IdentifyMachineService;
import com.northglass.service.loadmachine.LoadMachineService;
import com.northglass.service.manage.ManageService;
import com.northglass.service.shelfmanager.ShelfManagerService;
 
@Controller
@Transactional
@RequestMapping(value="/identifymachine")
public class IdentifyMachineController {
    
    
    @Autowired
    private LoadMachineService loadMachineService;
    
    @Autowired
    private ShelfManagerService shelfManagerService;
    
    @Autowired
    private ManageService manageService;
    
    @Autowired
    private IdentifyMachineService identifyMachineService;
    
    @RequestMapping(value="/manage/{groups}")
    public String manage(@PathVariable("groups") String groups, Model model) {
        Long machineId = Long.valueOf(groups);
        Map<String, Object> param = identifyMachineService.getCeliangManageData(groups);
        model.addAttribute("machineId",machineId);
        model.addAttribute("identifyMachine", 1);
        model.addAttribute("identifyFloor", 1);
        model.addAttribute("actuallength", param.get("actuallength"));
        model.addAttribute("actualwidth", param.get("actualwidth"));
        model.addAttribute("color", param.get("color"));
        model.addAttribute("txtname", param.get("txtname"));
        model.addAttribute("thickness", param.get("thickness"));
        model.addAttribute("width", param.get("width"));
        model.addAttribute("length", param.get("length"));
        model.addAttribute("glassid", param.get("glassid"));
        model.addAttribute("status", param.get("status"));
        model.addAttribute("img", param.get("img"));
        model.addAttribute("arrangepieces", param.get("arrangepieces"));
        model.addAttribute("totalPieces", param.get("totalPieces"));
        model.addAttribute("completePieces", param.get("completePieces"));
        model.addAttribute("progress", param.get("progress"));
        model.addAttribute("glassLists", identifyMachineService.getGlass()); 
        return "identifymachine/celiangmanage";
    }
    
    @RequestMapping(value="/setup/{groups}")
    public String setup(@PathVariable("groups") String groups, Model model) {
         model.addAttribute("patern", identifyMachineService.getpatern(groups));
         model.addAttribute("floor", identifyMachineService.getfloor(groups));
        return "identifymachine/setup";
    }
    
    //改变磨边的厚度大小
    @RequestMapping(value="/thinckness/{groups}/{thickness}")
    public String thinckness(@PathVariable("groups") String groups, @PathVariable("thickness") String thickness,Model model) {
         model.addAttribute("patern", identifyMachineService.getpatern(groups));
         model.addAttribute("floor", identifyMachineService.getfloor(groups));
        return "redirect:/identifymachine/setup/1";
    }
    
    //手动修改当前的任务
      @RequestMapping(method=RequestMethod.POST, value="/modifyGlass")
      public String modifyGlass( HttpServletRequest request,@RequestParam("txtid") String txtid,@RequestParam("Ids") String Ids,@RequestParam("name") String name) {
          identifyMachineService.modifyGlass(txtid,name);
          return "redirect:/identifymachine/setup/1";
      }
      
    //当前的任务破损
      @RequestMapping(method=RequestMethod.GET, value="/posun")
      public String posun( HttpServletRequest request) {
          identifyMachineService.posun();
          return "redirect:/identifymachine/manage/1";
      }
      
      //切割时玻璃破损
    @RequestMapping(method=RequestMethod.GET, value="/damage")
    public String damage(Model model) {
        model.addAttribute("erroedealhtml", identifyMachineService.damage());
          return "identifymachine/damage";
      }
    
    //切割时玻璃破损
    @RequestMapping(method=RequestMethod.GET, value="/review")
    public String review(Model model) {
        model.addAttribute("erroedealhtml", identifyMachineService.review());
          return "identifymachine/review";
      }
    
    @RequestMapping(method=RequestMethod.GET, value="/reviewglass/{id}")
    @ResponseBody
    public String reviewglass(@PathVariable("id") String id){
        return identifyMachineService.reviewglass(id);
    }
    
    @RequestMapping(method=RequestMethod.GET, value="/damageglass/{id}")
    @ResponseBody
    public String checkData(@PathVariable("id") String id){
        return identifyMachineService.checkEnd(id);
    }
 
    @RequestMapping(method=RequestMethod.POST, value="/modify/{groups}")
      public String modify( @PathVariable("groups") String groups, HttpServletRequest request,@RequestParam("glassid") String glassid) {
          identifyMachineService.modify(groups,glassid);
          return "redirect:/identifymachine/manage/1";
      }
    @RequestMapping(method=RequestMethod.POST, value="/modifyy/{groups}")
      public String modifyy( @PathVariable("groups") String groups2, HttpServletRequest request,@RequestParam("glassid2") String glassid2) {
          identifyMachineService.Deleteglalls(groups2,glassid2);
          return "redirect:/identifymachine/manage/1";
      }
      
    @RequestMapping(method=RequestMethod.POST, value="/modifyErrorRange/{groups}")
      public String modifyErrorRange( @PathVariable("groups") String groups, HttpServletRequest request,@RequestParam("floor") String floor,@RequestParam("ceiling") String ceiling) {
          identifyMachineService.modifyErrorRange(groups,floor,ceiling);
          return "redirect:/identifymachine/setup/1";
      }
    
    //改变磨边的厚度大小
        @RequestMapping(method=RequestMethod.GET, value="/pattern/{groups}/{name}")
        public String pattern(@PathVariable("groups") String groups, @PathVariable("name") String name,Model model) {
            identifyMachineService.pattern(groups,name);
            return "redirect:/identifymachine/setup/1";
        }
        
        @RequestMapping(method=RequestMethod.GET, value="/deleteData")
        public String deleteData(Model model) {
            identifyMachineService.deleteData();
            return "redirect:/identifymachine/setup/1";
        }
        
        @RequestMapping(method=RequestMethod.GET, value="/selectData")
        public String selectData(Model model) {
            model.addAttribute("identifyDetailHtml", identifyMachineService.selectData());
            return "identifymachine/detail";
        }
}