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;
|
}
|
|
|
|
|
|
|
}
|
|