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";
|
}*/
|
|
|
|
|
|
|
}
|