廖井涛
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
package com.northglass.web.compound;
 
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
 
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
 
import org.hibernate.engine.transaction.jta.platform.internal.SynchronizationRegistryBasedSynchronizationStrategy;
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.RawPackage;
import com.northglass.service.compound.CompoundMachineService;
import com.northglass.service.identifymachine.IdentifyMachineService;
 
@Controller
@Transactional
@RequestMapping(value="/compoundMachine")
public class CompoundMachineController {
 
    
    @Autowired
    private CompoundMachineService compoundMachineService;
    
    
    @RequestMapping(method=RequestMethod.GET, value="/compound/{groups}")
    public String gaoliwei(Model model,@PathVariable("groups") Long groups) throws IOException {
        Map<String, Object> param = compoundMachineService.showAllGlass(groups);
        model.addAttribute("allGlasseshtml", param.get("allGlasseshtml"));
        return "compound/compound";
    }
    
    @RequestMapping(method=RequestMethod.GET, value="/updatecompound/{id}/{groups}")
    public String updatecompound(Model model, @PathVariable("id") Long id,@PathVariable("groups") Long groups) throws IOException {
        compoundMachineService.updatecompound(id,groups);
        return "redirect:/compoundMachine/compound/"+groups;
    }
    
    @RequestMapping(method=RequestMethod.GET, value="/updatecompoundSetFinish/{id}/{groups}")
    public String updatecompoundSetFinish(Model model, @PathVariable("id") Long id,@PathVariable("groups") Long groups) throws IOException {
        compoundMachineService.updatecompoundSetFinish(id,groups);
        return "redirect:/compoundMachine/compound/"+groups;
   
    }
    /*@RequestMapping(method=RequestMethod.GET, value="/device")
    public String ShowData(Model model)throws IOException {
        Map<String,Object> param=compoundMachineService.getPlCView();
        Iterator<String> iter = param.keySet().iterator();
        while(iter.hasNext()){
            String key=iter.next();
            Object v=param.get(key);
            model.addAttribute(key,v);
        }
        return "compound/device";
    }*/
    
    
    @RequestMapping(method=RequestMethod.GET, value="/queue/{groups}")
    public String getOnlineGlass(Model model,@PathVariable("groups") Long groups)throws IOException{
        
        model.addAttribute("glasses",compoundMachineService.getgalsstasklistsum(groups));
        return "compound/queue";
    }
    
    /*@RequestMapping(method=RequestMethod.GET, value="/updatequeue")
    public String actOnlineGlass(Model model,@RequestParam(value="id") long id,@RequestParam(value="act") int act)throws IOException{
        compoundMachineService.UpdateGlassStatus(id, act);
           return "redirect:/compoundMachine/queue/3";
    }*/
    
    @RequestMapping(method=RequestMethod.GET, value="/updatecompoundgalss/{id}/{groups}/{type}")
    public String updatecompoundgalss(Model model,@PathVariable("id") Long id,@PathVariable("groups") Long groups,@PathVariable("type") Long type)throws IOException{
        compoundMachineService.updatecompoundgalss(id, groups,type);
           return "redirect:/compoundMachine/queue/"+groups;
    }
    
    /*@RequestMapping(method=RequestMethod.GET, value="/galsstasklit/{line}")
    public String galsstasklit(Model model, @PathVariable("line") Long line) throws IOException {
        model.addAttribute("galsstasklisthtml",compoundMachineService.getgalsstasklist(line));
        return "compound/galsstasklist";
    }*/
    
 
    
 
    
    
}