package com.northglass.web.standalone;
|
|
|
import java.util.Map;
|
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
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.repository.ProdLineStateDao;
|
import com.northglass.repository.RawPackageTxtDao;
|
import com.northglass.service.manage.ManageService;
|
import com.northglass.service.shelfmanager.ShelfManagerService;
|
import com.northglass.service.standalone.StandAloneService;
|
|
/**
|
* 单机界面管理
|
* @author GO1
|
*
|
*/
|
@Controller
|
@RequestMapping(value="/standalonemanage")
|
public class StandAloneController<ShelfManagerervice> {
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(StandAloneController.class);
|
|
@Autowired
|
RawPackageTxtDao rawPackageTxtDao;
|
|
@Autowired
|
StandAloneService standAloneService;
|
|
@Autowired
|
ProdLineStateDao prodLineStateDao;
|
|
@Autowired
|
ShelfManagerService shelfManagerService;
|
|
@Autowired
|
ManageService manageService;
|
|
|
/**
|
* 进入单机界面
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/intopages")
|
public String inToPages(Model model,HttpServletRequest request){
|
return "standalone/startStandalonePage";
|
}
|
/**
|
* 进入单机界面
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/intopage")
|
public String inToPage(Model model,HttpServletRequest request){
|
String id=request.getParameter("id");
|
return standAloneService.intoPage(id, model);
|
}
|
|
|
/**
|
* 查看当前料架信息
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/getrawinfo")
|
public String getRawInfo(Model model,HttpServletRequest request){
|
model.addAttribute("rawPackageHtml", standAloneService.getRawInfo(model, request));
|
//获取机号
|
String machine = request.getParameter("machine");
|
if(machine.equals("1")){
|
return "standalone/rawinfo";
|
}else{
|
return "standalone/rawinfo2";
|
}
|
}
|
|
/**
|
* 筛选符合条件的料架
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/getpagebycondition")
|
public String getPageByCondition(HttpServletRequest request , Model model){
|
return standAloneService.getTaskCurrentLine(request, "1", model);
|
}
|
|
/**
|
* 筛选符合条件的料架(2号)
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/getpagebycondition2")
|
public String getPageByCondition2(HttpServletRequest request , Model model){
|
return standAloneService.getTaskCurrentLine(request, "2", model);
|
}
|
|
|
|
/**
|
* 退库前输入剩余玻璃片数
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/exitShelfEnterLeftPieces")
|
public String exitShelfEnterLeftPieces(HttpServletRequest request , Model model){
|
return standAloneService.exitShelfEnterLeftPieces(request, "1", model);
|
}
|
|
/**
|
* 退库前输入剩余玻璃片数(2号)
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/exitShelfEnterLeftPieces2")
|
public String exitShelfEnterLeftPieces2(HttpServletRequest request , Model model){
|
return standAloneService.exitShelfEnterLeftPieces(request, "2", model);
|
}
|
|
/**
|
* 退库
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/exitshelf")
|
public String exitShelf(HttpServletRequest request , Model model){
|
return standAloneService.exitShelf(request, "1", model);
|
}
|
|
/**
|
* 退库(2号)
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/exitshelf2")
|
public String exitShelf2(HttpServletRequest request , Model model){
|
return standAloneService.exitShelf(request, "2", model);
|
}
|
|
|
/**
|
* 调度状态
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/dispatchinfo")
|
public String dispatchInfo(Model model){
|
model.addAttribute("disPatchStateHtml", standAloneService.getDispatchHtml((long)1));
|
return "standalone/dispatchPage";
|
}
|
|
/**
|
* 调度状态(2号)
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/dispatchinfo2")
|
public String dispatchInfo2(Model model){
|
model.addAttribute("disPatchStateHtml", standAloneService.getDispatchHtml((long)2));
|
return "standalone/dispatchPage";
|
}
|
|
/**
|
* 校验需要创建的料架任务
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/loadranktaskcheck")
|
@ResponseBody
|
public String loadRankTaskCheck(Model model,HttpServletRequest request,HttpServletResponse response){
|
return standAloneService.checkLoadRankTask(request, (long) 1);
|
}
|
|
/**
|
* 创建料架任务
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/createloadtask")
|
public String createLoadTask(Model model,HttpServletRequest request){
|
return standAloneService.createLoadTask(request, "1", model);
|
}
|
|
/**
|
* 校验需要创建的料架任务(2号)
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/loadranktaskcheck2")
|
@ResponseBody
|
public String loadRankTaskCheck2(Model model,HttpServletRequest request,HttpServletResponse response){
|
return standAloneService.checkLoadRankTask(request, (long) 2);
|
}
|
|
/**
|
* 创建料架任务(2号)
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/createloadtask2")
|
public String createLoadTask2(Model model,HttpServletRequest request){
|
return standAloneService.createLoadTask(request, "2", model);
|
}
|
|
/**
|
* 退出单机模式
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/endSingleMachine")
|
public String endSingleMachine(HttpServletRequest request,Model model){
|
return standAloneService.endSingleMachine(request, model);
|
}
|
|
/**
|
* 输入剩余原片数量后退出
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.GET,value="/endsinglemodel")
|
public String endSingleModel(HttpServletRequest request){
|
return standAloneService.endSingleModel(request);
|
}
|
|
|
/**
|
* 查询
|
* @return
|
*/
|
@RequestMapping(method=RequestMethod.POST,value="/search")
|
public String serch(Model model,@RequestParam("idHtml") String idHtml,@RequestParam("color") String color,@RequestParam("glassThickness") String glassThickness){
|
StringBuffer html = new StringBuffer();
|
html.append("<option>").append(idHtml).append("</option>");
|
model.addAttribute("idHtml",html.toString());
|
model.addAttribute("getLoadsHtmls",shelfManagerService.getLoadsHtmls(idHtml));
|
model.addAttribute("optionHtml",shelfManagerService.getcolorHtml());
|
model.addAttribute("shelfRankNumberList", shelfManagerService.getFreeShelfRankNumberList());
|
model.addAttribute("getColorList", shelfManagerService.getColorList());
|
model.addAttribute("loadMachineHtml", shelfManagerService.getLoadMachineRankHtml(1L));
|
model.addAttribute("shelftasks", shelfManagerService.findShelfTask());
|
model.addAttribute("rankList", shelfManagerService.findRankList(color,glassThickness));
|
return "standalone/shelfRankPage";
|
}
|
|
}
|