package com.northglass.web.device;
|
|
import java.io.IOException;
|
import java.util.List;
|
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.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 com.northglass.entity.GlassCommer;
|
import com.northglass.entity.GlassNumberColor;
|
import com.northglass.entity.PrintMachine;
|
import com.northglass.entity.RawPackage;
|
import com.northglass.entity.RawPackageTxt;
|
import com.northglass.service.countmachine.CountMachineService;
|
import com.northglass.service.device.Device;
|
import com.northglass.service.device.DeviceService;
|
import com.northglass.service.manage.ManageService;
|
import com.northglass.service.shelfmanager.ShelfManagerService;
|
|
@Controller
|
@RequestMapping(value = "/device")
|
public class DeviceController {
|
|
@Autowired
|
private DeviceService deviceService;
|
|
@Autowired
|
private CountMachineService countMachineService;
|
|
@Autowired
|
private ManageService manageService;
|
|
@Autowired
|
private ShelfManagerService shelfManagerService;
|
|
@RequestMapping(value = "detail", method=RequestMethod.GET)
|
public String listDevice() {
|
return "device/listDevice";
|
}
|
|
@RequestMapping(value="createDevice", method=RequestMethod.GET)
|
public String createDevice() {
|
return "device/createDevice";
|
}
|
|
@RequestMapping(method=RequestMethod.GET, value="deviceManage")
|
public String deviceManage(Model model) {
|
List<Device> deviceList = deviceService.deviceManage();
|
model.addAttribute("deviceList", deviceList);
|
return "device/deviceManage";
|
}
|
|
@RequestMapping(method=RequestMethod.POST, value="/modifyport/{deviceType}/{deviceId}")
|
public String modifyPort(Model model,
|
@PathVariable("deviceType") String deviceType,
|
@PathVariable("deviceId") Long deviceId,
|
@RequestParam(value="devicePort") int devicePort) {
|
deviceService.modifyPort(deviceType, deviceId, devicePort);
|
return "redirect:/device/deviceManage";
|
}
|
|
//掉线情况
|
@RequestMapping(method=RequestMethod.GET, value="/drop")
|
public String drop(Model model) throws IOException {
|
Map<String, Object> param = deviceService.getdropped();
|
model.addAttribute("shelf", param.get("shelf"));
|
model.addAttribute("loadMachine01", param.get("loadMachine01"));
|
model.addAttribute("loadMachine02", param.get("loadMachine02"));
|
model.addAttribute("gaoliweiMachine01", param.get("gaoliweiMachine01"));
|
model.addAttribute("gaoliweiMachine02", param.get("gaoliweiMachine02"));
|
model.addAttribute("countMachine01", param.get("countMachine01"));
|
model.addAttribute("countMachine02", param.get("countMachine02"));
|
return "device/drop";
|
}
|
|
//删除所有掉线情况
|
@RequestMapping(method=RequestMethod.GET, value="/deletedrop")
|
public String deletedrop(Model model) throws IOException {
|
deviceService.deletedrop();
|
return "redirect:/device/drop";
|
}
|
|
//查看色系
|
@RequestMapping(method=RequestMethod.GET, value="/color")
|
public String color(Model model) throws IOException {
|
model.addAttribute("colorHtml", deviceService.findColorHtml());
|
return "device/color";
|
}
|
|
//色系
|
@RequestMapping(method=RequestMethod.GET, value="/createcolor")
|
public String createcolor(Model model) throws IOException {
|
model.addAttribute("colorHtml", deviceService.findColorHtml());
|
return "device/createcolor";
|
}
|
|
//添加色系
|
@RequestMapping(method=RequestMethod.POST, value="/addcolor")
|
public String addcolor(Model model, GlassNumberColor color) throws IOException {
|
deviceService.addcolor(color);
|
return "redirect:/device/createcolor";
|
}
|
|
//删除色系deletecolor
|
@RequestMapping(method=RequestMethod.GET, value="/deletecolor/{id}")
|
public String deletecolor(Model model, @PathVariable("id") String id) throws IOException {
|
deviceService.deletecolor(id);
|
return "redirect:/device/createcolor";
|
}
|
|
/****
|
* 问题:玻璃厂家管理界面
|
* 2019年8月9日
|
* @author 司家旺
|
*
|
* ***/
|
|
@RequestMapping(method=RequestMethod.GET, value="/glasscumtor")
|
public String glasscumtor(Model model) throws IOException {
|
model.addAttribute("glasscumtorhtml", deviceService.findglasscumtorHtml());
|
return "device/glasscumtor";
|
}
|
|
|
/****
|
* 问题:添加玻璃厂家信息
|
* 2019年8月9日
|
* @author 司家旺
|
* ***/
|
|
@RequestMapping(method=RequestMethod.POST, value="/addcommer")
|
public String addcommer(Model model, GlassCommer glassCommer) throws IOException {
|
deviceService.addcommer(glassCommer);
|
return "redirect:/device/glasscumtor";
|
}
|
|
/****
|
* 问题:删除玻璃厂家信息
|
* 2019年8月9日
|
* @author 司家旺
|
* ***/
|
@RequestMapping(method=RequestMethod.GET, value="/deletecumtor/{id}")
|
public String deletecumtor(Model model, @PathVariable("id") String id) throws IOException {
|
deviceService.deletecumtor(id);
|
return "redirect:/device/glasscumtor";
|
}
|
|
//磨边机任务完工
|
@RequestMapping(method=RequestMethod.GET, value="/endmotask")
|
public String endmotask(Model model) throws IOException {
|
deviceService.finish();
|
return "redirect:/device/gaoliwei";
|
}
|
|
//磨边机任务完工
|
@RequestMapping(method=RequestMethod.GET, value="/endmo/{id}")
|
public String endmo(Model model, @PathVariable("id") String id) throws IOException {
|
deviceService.finishmo(id);
|
return "redirect:/device/gaoliwei";
|
}
|
|
//磨边机设置
|
@RequestMapping(method=RequestMethod.GET, value="/gaoliwei")
|
public String gaoliwei(Model model) throws IOException {
|
Map<String, Object> param = countMachineService.showAllGlass();
|
model.addAttribute("sum", param.get("sum"));
|
model.addAttribute("finishoieces", param.get("finishoieces"));
|
model.addAttribute("warning", param.get("warning"));
|
model.addAttribute("allGlasses", param.get("allGlasses"));
|
model.addAttribute("temp", param.get("temp"));
|
model.addAttribute("allGlasseshtml", param.get("allGlasseshtml"));
|
model.addAttribute("EdugMachineHtml", manageService.getEdugMachineHtml());
|
return "device/gaoliwei";
|
}
|
|
//修改当前磨边机的状态
|
@RequestMapping(method=RequestMethod.GET, value="/modify")
|
public String modify(Model model) throws IOException {
|
manageService.modity();
|
return "redirect:/device/gaoliwei";
|
}
|
|
//打印机界面
|
@RequestMapping(method=RequestMethod.GET, value="/printmanage")
|
public String printmanage(Model model) throws IOException {
|
model.addAttribute("printhtml", deviceService.getPrintHtml(1L));
|
model.addAttribute("allGlasseshtml", deviceService.workglass());
|
return "device/printmanage";
|
}
|
|
//打印机测试
|
@RequestMapping(method=RequestMethod.GET, value="/print/{id}")
|
public String print(Model model, @PathVariable("id") String id) throws IOException {
|
deviceService.prints(id);
|
return "redirect:/device/printmanage";
|
}
|
//打印剩余标签otherprint
|
@RequestMapping(method=RequestMethod.GET, value="/otherprint/{id}")
|
public String otherprint(Model model, @PathVariable("id") String id) throws IOException {
|
deviceService.otherprint(id);
|
return "redirect:/device/printmanage";
|
}
|
|
//打印机手工打印
|
@RequestMapping(method=RequestMethod.GET, value="/printglass/{id}/{line}")
|
public String printglass(Model model, @PathVariable("id") String id, @PathVariable("line") String line) throws IOException {
|
deviceService.printglass(id,line);
|
return "redirect:/device/printmanage";
|
}
|
|
//磨边机再次发送
|
@RequestMapping(method=RequestMethod.GET, value="/again/{id}")
|
public String again(Model model, @PathVariable("id") String id) throws IOException {
|
deviceService.again(id);
|
return "redirect:/device/gaoliwei";
|
}
|
|
//磨边机不使用
|
@RequestMapping(method=RequestMethod.GET, value="/nosend/{id}")
|
public String nosend(Model model, @PathVariable("id") String id) throws IOException {
|
deviceService.nosend(id);
|
return "redirect:/device/gaoliwei";
|
}
|
|
//所有的信息状态
|
@RequestMapping(method=RequestMethod.GET, value="/getstatu")
|
public String getstatu(Model model) throws IOException {
|
model.addAttribute("shelfstatu", deviceService.getshelfstatu());
|
model.addAttribute("loadstatu", deviceService.getloadstatu());
|
model.addAttribute("gaoliweistatu", deviceService.getgaoliweistatu());
|
|
return "device/getstatu";
|
}
|
|
//修改打印机的pattern
|
@RequestMapping(method=RequestMethod.POST, value="/modifyPattern")
|
public String modifyPattern(@Valid PrintMachine printMachine, HttpServletRequest request) {
|
deviceService.modifyPattern(printMachine);
|
return "redirect:/device/printmanage";
|
}
|
|
//修改打印机的statu
|
@RequestMapping(method=RequestMethod.POST, value="/modifyStatu")
|
public String modifyStatu(@Valid PrintMachine printMachine, HttpServletRequest request) {
|
deviceService.modifyStatu(printMachine);
|
return "redirect:/device/printmanage";
|
}
|
|
//出库
|
@RequestMapping(method=RequestMethod.POST, value="/serach")
|
public String serach(Model model,@Valid RawPackageTxt rawPackageTxt){
|
model.addAttribute("printhtml", deviceService.getPrintHtml(1L));
|
model.addAttribute("allGlasseshtml", deviceService.serchglass(rawPackageTxt.getTxt_name()));
|
return "device/serach";
|
}
|
|
/**
|
*
|
* @author northglass
|
* 2019年3月18日
|
* 功能:新加的虚拟料架界面
|
*
|
* **/
|
|
@RequestMapping(method=RequestMethod.GET, value="/rankmanager")
|
public String rankmanager(Model model){
|
model.addAttribute("dummyhtml", deviceService.getdummyhtml());
|
model.addAttribute("getColorList", shelfManagerService.getColorList());
|
model.addAttribute("optionHtml",shelfManagerService.getcolorHtml());
|
return "device/rankmanager";
|
}
|
|
/**
|
*
|
* @author northglass
|
* 2019年3月18日
|
* 功能:删除虚拟料架上面的数据
|
*
|
* **/
|
|
@RequestMapping(method=RequestMethod.GET, value="/deleteDummyRack/{id}")
|
public String deleteDummyRack(Model model,@PathVariable("id") String id){
|
deviceService.deleteDummyRack(id);
|
return "redirect:/device/rankmanager";
|
}
|
|
/**
|
*
|
* @author northglass
|
* 2019年3月18日
|
* 功能:手动修改虚拟料架信息
|
*
|
* **/
|
@RequestMapping(method=RequestMethod.POST, value="/modifyRack")
|
public String modifyRack(HttpServletRequest request,@RequestParam(value="pieces") String pieces,@RequestParam("Ids") String Ids) {
|
deviceService.modifyRack(pieces,Ids);
|
return "redirect:/device/rankmanager";
|
}
|
|
/**
|
*
|
* @author northglass
|
* 2019年3月18日
|
* 功能:手动添加虚拟料架信息
|
*
|
* **/
|
@RequestMapping(method=RequestMethod.POST, value="/addRack")
|
public String addRack(@Valid RawPackage rawPackage, HttpServletRequest request,@RequestParam(value="shelfRankNumber") String shelfRankNumber,@RequestParam("Ids") String Ids) {
|
deviceService.addRack(rawPackage, shelfRankNumber,Ids);
|
return "redirect:/device/rankmanager";
|
}
|
|
/**
|
*
|
* @author northglass
|
* 2019年3月19日
|
* 功能:手动查询虚拟料架信息
|
*
|
* **/
|
@RequestMapping(method=RequestMethod.POST, value="/searchRack")
|
public String searchRack(Model model,@RequestParam("color") String color,
|
@RequestParam("glassThickness") String glassThickness) {
|
model.addAttribute("dummyhtml", deviceService.getserachdummyhtml(color,glassThickness));
|
model.addAttribute("getColorList", shelfManagerService.getColorList());
|
model.addAttribute("optionHtml",shelfManagerService.getcolorHtml());
|
return "device/rankmanager";
|
}
|
|
|
/**
|
*
|
* @author northglass
|
* 2020年1月7日
|
* 功能:测量界面
|
*
|
* **/
|
|
@RequestMapping(value="/manage/{groups}")
|
public String manage(@PathVariable("groups") String groups, Model model) {
|
Long machineId = Long.valueOf(groups);
|
Map<String, Object> param = deviceService.getCeliangManageData(groups);
|
model.addAttribute("machineId",machineId);
|
model.addAttribute("identifyMachine", 1);
|
model.addAttribute("identifyFloor", 1);
|
model.addAttribute("preprocessingGlass", param.get("preprocessingGlass"));
|
model.addAttribute("totalPieces", param.get("totalPieces"));
|
model.addAttribute("completePieces", param.get("completePieces"));
|
model.addAttribute("leftPieces", param.get("leftPieces"));
|
model.addAttribute("progress", param.get("progress"));
|
model.addAttribute("identifyResultHtml", param.get("identifyResultHtml"));
|
model.addAttribute("manufactureBatchNumber", param.get("manufactureBatchNumber"));
|
model.addAttribute("color", param.get("color"));
|
model.addAttribute("thickness", param.get("thickness"));
|
model.addAttribute("matchLength", param.get("matchLength"));
|
model.addAttribute("matchWidth", param.get("matchWidth"));
|
model.addAttribute("glassLists", param.get("glassLists"));
|
model.addAttribute("identifyMachineHtml", null);
|
model.addAttribute("pGlass", param.get("pGlass"));
|
model.addAttribute("identifyPatten", param.get("identifyPatten"));
|
model.addAttribute("identifythinckness", param.get("identifythinckness"));
|
model.addAttribute("identifymodifyhtml", param.get("identifymodifyhtml"));
|
return "identifymachine/celiangmanage";
|
}
|
|
|
}
|