package com.northglass.service.device; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import com.northglass.constants.MachineType; import com.northglass.constants.StateConstants.LoadMachineRackState; import com.northglass.constants.StateConstants.PrintMachineState; import com.northglass.constants.StateConstants.RackState; import com.northglass.constants.StateConstants.ShelfHoistState; import com.northglass.constants.StateConstants.ShelfRankState; import com.northglass.constants.StateConstants.sendGlassState; import com.northglass.entity.CountMachine; import com.northglass.entity.CutMachine; import com.northglass.entity.DummyFixRack; import com.northglass.entity.FilmRemoveMachine; import com.northglass.entity.GaoliweiMachine; import com.northglass.entity.Glass; import com.northglass.entity.GlassCommer; import com.northglass.entity.GlassNumberColor; import com.northglass.entity.LoadMachine; import com.northglass.entity.LoadMachineRack; import com.northglass.entity.MachineStatu; import com.northglass.entity.PrintMachine; import com.northglass.entity.PrintName; import com.northglass.entity.PrintSize; import com.northglass.entity.RawPackage; import com.northglass.entity.RawPackageTxt; import com.northglass.entity.Shelf; import com.northglass.entity.ShelfHoist; import com.northglass.entity.ShelfRank; import com.northglass.entity.ShelfStatu; import com.northglass.entity.TestOut; import com.northglass.listener.GMMSPrinter; import com.northglass.repository.CountMachineDao; import com.northglass.repository.DummyFixRackDao; import com.northglass.repository.GaoliweiMachineDao; import com.northglass.repository.GlassCommerDao; import com.northglass.repository.GlassDao; import com.northglass.repository.GlassNumberColorDao; import com.northglass.repository.LoadMachineRackDao; import com.northglass.repository.MachineStatuDao; import com.northglass.repository.PrintMachineDao; import com.northglass.repository.PrintNameDao; import com.northglass.repository.PrintSizeDao; import com.northglass.repository.RawPackageTxtDao; import com.northglass.repository.ShelfHoistDao; import com.northglass.repository.ShelfRankDao; import com.northglass.repository.ShelfStatuDao; import com.northglass.repository.TestOutDao; import com.northglass.service.arrangemachine.ArrangeMachineService; import com.northglass.service.countmachine.CountMachineService; import com.northglass.service.cutmachine.CutMachineService; import com.northglass.service.edgemachine.EdgeMachineService; import com.northglass.service.filmremovemachine.FilmRemoveMachineService; import com.northglass.service.gaoliwei.GaoliweiMachineService; import com.northglass.service.identifymachine.IdentifyMachineService; import com.northglass.service.loadmachine.LoadMachineService; import com.northglass.service.measuremachine.MeasureMachineService; import com.northglass.service.shelf.ShelfService; import com.northglass.service.tidy.TidyMachineService; import com.northglass.service.washmachine.WashMachineService; import com.northglass.web.gaoliwei.GaoliweiController; @Component @Transactional public class DeviceService { private static final Logger LOGGER = LoggerFactory.getLogger(DeviceService.class); @Autowired private ShelfService shelfService; @Autowired private CutMachineService cutMachineService; @Autowired private LoadMachineService loadMachineService; @Autowired private FilmRemoveMachineService filmRemoveMachineService; @Autowired private ShelfRankDao shelfRankDao; @Autowired private GaoliweiMachineDao gaoliweiMachineDao; @Autowired private ShelfHoistDao shelfHoistDao; @Autowired private CountMachineDao countMachineDao; @Autowired private LoadMachineRackDao loadMachineRackDao; @Autowired private CountMachineService countMachineService; @Autowired private GaoliweiMachineService gaoliweiMachineService; @Autowired private ArrangeMachineService arrangeMachineService; @Autowired private MeasureMachineService measureMachineService; @Autowired private TestOutDao testOutDao; @Autowired private GlassNumberColorDao colorDao; @Autowired private RawPackageTxtDao rawPackageTxtDao; @Autowired private GlassDao glassDao; @Autowired private PrintSizeDao printSizeDao; @Autowired private PrintNameDao printNameDao; @Autowired private PrintMachineDao printMachineDao; @Autowired private ShelfStatuDao shelfStatuDao; @Autowired private DummyFixRackDao dummyFixRackDao; @Autowired private GlassCommerDao glassCommerDao; @Autowired private IdentifyMachineService identifyMachineService; @Autowired private TidyMachineService tidyMachineService; @Autowired private EdgeMachineService edgeMachineService; @Autowired private WashMachineService washMachineService; public void resetState() { shelfService.resetState(); cutMachineService.resetState(); loadMachineService.resetState(); gaoliweiMachineService.resetState(); //identifyMachineService.resetState(); // edgeMachineService.resetState(); washMachineService.resetState(); // filmRemoveMachineService.resetState(); countMachineService.resetState(); // grindEdgeMachineService.resetState(); // grindEdgeMachineTwoService.resetState(); arrangeMachineService.resetState(); measureMachineService.resetState(); } public void resetRankState() { List shelfRankList = shelfRankDao.findAll(); for (ShelfRank rank : shelfRankList) { rank.setState(ShelfRankState.FREE); } shelfRankDao.save(shelfRankList); List shelfHoistList = shelfHoistDao.findAll(); for (ShelfHoist hoist : shelfHoistList) { hoist.setState(ShelfHoistState.FREE); } shelfHoistDao.save(shelfHoistList); List loadMachineRackList = loadMachineRackDao.findAll(); for (LoadMachineRack rack : loadMachineRackList) { rack.setState(LoadMachineRackState.FREE); } loadMachineRackDao.save(loadMachineRackList); } public void connect() { // shelfService.connect(); // measureMachineService.connect(); /*loadMachineService.connect(); cutMachineService.connect(); identifyMachineService.connect(); arrangeMachineService.connect(); tidyMachineService.connect(); gaoliweiMachineService.connect(); edgeMachineService.connect(); washMachineService.connect(); countMachineService.connect();*/ } public List deviceManage() { LOGGER.debug("> Start deviceManage"); List deviceList = new ArrayList(); Shelf shelf = shelfService.getDefaultShelf(); if (shelf != null) { Device shelfDevice = new Device(shelf.getId(), "原片仓储" + shelf.getNumber(), shelf.getPort(), MachineType.SHELF); deviceList.add(shelfDevice); } List loadMachines = loadMachineService.getAll(); for (LoadMachine loadMachine : loadMachines) { Device loadMachineDevice = new Device(loadMachine.getId(), "上片机" + loadMachine.getNumber(), loadMachine.getPort(), MachineType.LOAD_MACHINE); deviceList.add(loadMachineDevice); } List gaoliweiMachines = gaoliweiMachineDao.findAll(); for (GaoliweiMachine gaoliweiMachine : gaoliweiMachines) { Device loadMachineDevice = new Device(gaoliweiMachine.getId(), "高力威" + gaoliweiMachine.getNumber(), gaoliweiMachine.getPort(), MachineType.LOAD_MACHINE); deviceList.add(loadMachineDevice); } List countMachines = countMachineDao.findAll(); for (CountMachine countMachine : countMachines) { Device loadMachineDevice = new Device(countMachine.getId(), "下片机" + countMachine.getNumber(), countMachine.getPort(), MachineType.LOAD_MACHINE); deviceList.add(loadMachineDevice); } LOGGER.debug("> End deviceManage"); return deviceList; } public void modifyPort(String type, Long id, int port) { LOGGER.debug("> 开始定义"); LOGGER.debug("type: " + type); LOGGER.debug("id: " + id); LOGGER.debug("port: " + port); if (type.equalsIgnoreCase(MachineType.SHELF)) { Shelf shelf = shelfService.getDefaultShelf(); shelf.setPort(port); shelfService.save(shelf); } else if (type.equalsIgnoreCase(MachineType.LOAD_MACHINE)) { LoadMachine loadMachine = loadMachineService.getById(id); loadMachine.setPort(port); loadMachineService.saveLoadMachine(loadMachine); } else if (type.equalsIgnoreCase(MachineType.CUT_MACHINE)) { CutMachine cutMachine = cutMachineService.getById(id); cutMachine.setPort(port); cutMachineService.save(cutMachine); } else if (type.equalsIgnoreCase("filmremovemachine")) { FilmRemoveMachine filmRemoveMachine = filmRemoveMachineService.getById(id); filmRemoveMachine.setPort(port); filmRemoveMachineService.save(filmRemoveMachine); } else if (type.equalsIgnoreCase(MachineType.COUNT_MACHINE)) { CountMachine countMachine = countMachineService.getById(id); countMachine.setPort(port); countMachineService.saveCountMachine(countMachine); } LOGGER.debug("> End modifyPort"); } public Map getdropped() { Map param = new HashMap(); List shelf = testOutDao.findByName("shelf"); List loadMachine01 = testOutDao.findByName("loadMachine01"); List loadMachine02 = testOutDao.findByName("loadMachine02"); List countMachine01 = testOutDao.findByName("countMachine01"); List countMachine02 = testOutDao.findByName("countMachine02"); List gaoliweiMachine01 = testOutDao.findByName("gaoliweiMachine01"); List gaoliweiMachine02 = testOutDao.findByName("gaoliweiMachine02"); param.put("shelf", shelf.size()); param.put("loadMachine01", loadMachine01.size()); param.put("loadMachine02", loadMachine02.size()); param.put("gaoliweiMachine01", gaoliweiMachine01.size()); param.put("gaoliweiMachine02", gaoliweiMachine02.size()); param.put("countMachine01", countMachine01.size()); param.put("countMachine02", countMachine02.size()); return param; } public void deletedrop() { testOutDao.deleteAll(); } public String findColorHtml() { StringBuffer html = new StringBuffer(); List colors = colorDao.findAll(); for (int i = 0; i < colors.size(); i++) { GlassNumberColor color = colors.get(i); html.append("").append(color.getId()).append(""); html.append("").append(color.getGlassId()); html.append("删除"); } return html.toString(); } public void addcolor(GlassNumberColor color) { color.setFlag("0"); colorDao.save(color); } public void deletecolor(String id) { GlassNumberColor color = colorDao.findOne(Long.parseLong(id)); colorDao.delete(Long.parseLong(id)); LOGGER.debug("删除膜系" + color.getGlassId()); } public void finish() { GaoliweiController.setButton("1"); GaoliweiController.setButton1("1"); } public void prints(String s) { PrintMachine printMachin = printMachineDao.findByLine(s); GMMSPrinter printer = new GMMSPrinter("罗兰测试1", "0100000463", "5mmXTY270镀膜不印标(异形)钢化", "5-9 1816289-2 固玻 关埠 按图开介,图-1", "1L", 888, 666, "20181014.02A", "A", "12345", s, 1, (long) 123, printMachin.getName(), printMachin.getStatu(), "4","归来出"); if (!s.equals("1")) { printer = new GMMSPrinter("罗兰测试2", "0100000464", "5mmXTY270镀膜不印标(异形)钢化", "5-9 1816289-2 固玻 关埠 按图开介,图-1", "1L", 1000, 800, "20181024.01A", "B", "33333", s, 1, (long) 123, printMachin.getName(), printMachin.getStatu(), "4","归来去"); } // 开始打印 printer.doPrint(); } public void finishmo(String id) { if (id.equals("1")) { GaoliweiController.setButton("1"); LOGGER.debug("发送一号线清空指令"); } else { GaoliweiController.setButton1("1"); LOGGER.debug("发送二号线清空指令"); } } public void again(String id) { RawPackageTxt rawPackageTxt = rawPackageTxtDao.findAcceptedByGroup("1"); if (rawPackageTxt == null) { LOGGER.debug("没有任务,不处理信息"); } else { String txtName = rawPackageTxt.getTxt_name(); List allGlasses = glassDao.findByBatch(txtName); if (allGlasses.size() > 0) { if (id.equals("1")) { for (Glass glass : allGlasses) { glass.setSendState(sendGlassState.NOTSEND); glassDao.save(glass); } } else if (id.equals("2")) { for (Glass glass : allGlasses) { glass.setSendStates(sendGlassState.NOTSEND); glassDao.save(glass); } } } } } public void nosend(String id) { RawPackageTxt rawPackageTxt = rawPackageTxtDao.findAcceptedByGroup("1"); if (rawPackageTxt == null) { LOGGER.debug("没有任务,不处理信息"); } else { String txtName = rawPackageTxt.getTxt_name(); List allGlasses = glassDao.findByBatch(txtName); if (allGlasses.size() > 0) { if (id.equals("1")) { for (Glass glass : allGlasses) { glass.setSendState(sendGlassState.NOTUSE); glassDao.save(glass); } } else if (id.equals("2")) { for (Glass glass : allGlasses) { glass.setSendStates(sendGlassState.NOTUSE); glassDao.save(glass); } } } } } public PrintSize findPrintSize() { return printSizeDao.findOne(1L); } public PrintName findPrintName(Long s) { return printNameDao.findOne(s); } public String getPrintHtml(long l) { StringBuffer html = new StringBuffer(); List printMachines = printMachineDao.findAll(); if (printMachines.size() > 0) { for (PrintMachine printMachine : printMachines) { html.append("打印机").append(printMachine.getLine()).append(""); html.append(""); if (printMachine.getPattern().equals(PrintMachineState.PATTERN_SINGLE)) { html.append("单片打印"); } else if (printMachine.getPattern().equals(PrintMachineState.PATTERN_ALL)) { html.append("全部打印"); } else { html.append("不打印"); } html.append(""); html.append("").append(printMachine.getStatu()).append(""); html.append("修改打印类型"); html.append("修改打印属性"); html.append("打印测试"); html.append(""); } } html.append(""); return html.toString(); } public void modifyPattern(PrintMachine printMachine) { // String line = printMachine.getLine(); String s = ""; PrintMachine print = printMachineDao.findByLine(printMachine.getLine()); if (printMachine.getPattern().equals("单片打印")) { s = PrintMachineState.PATTERN_SINGLE; } else if (printMachine.getPattern().equals("全部打印")) { s = PrintMachineState.PATTERN_ALL; } else { s = PrintMachineState.PATTERN_NOT; } print.setPattern(s); printMachineDao.save(print); } public void modifyStatu(PrintMachine printMachine) { PrintMachine print = printMachineDao.findByLine(printMachine.getLine()); print.setStatu(printMachine.getStatu()); printMachineDao.save(print); } public String getstatu() { StringBuffer html = new StringBuffer(); return html.toString(); } /** * 仓储信息 * * @author 司家旺 * **/ public String getshelfstatu() { StringBuffer html = new StringBuffer(); List status = shelfStatuDao.findAll(); if (status.size() > 0) { for (ShelfStatu statu : status) { html.append("").append(statu.getId()).append(""); html.append("").append(statu.getAutostate()).append(""); html.append("").append(statu.getErrorstate()).append(""); html.append("").append(statu.getPlcid()).append(""); html.append("").append(statu.getMesid()).append(""); html.append("").append(statu.getSetTime()).append(""); } } return html.toString(); } public String getloadstatu() { StringBuffer html = new StringBuffer(); ShelfStatu statu = shelfStatuDao.findByMachine("load"); if (statu != null) { html.append("").append(statu.getId()).append(""); html.append("").append(statu.getAutostate()).append(""); html.append("").append(statu.getErrorstate()).append(""); html.append("").append(statu.getLoadfinish()).append(""); html.append("").append(statu.getPlcid()).append(""); html.append("").append(statu.getMesid()).append(""); html.append("").append(statu.getSetTime()).append(""); } return html.toString(); } public String getgaoliweistatu() { StringBuffer html = new StringBuffer(); ShelfStatu statu = shelfStatuDao.findByMachine("gaoliwei"); if (statu != null) { html.append("").append(statu.getId()).append(""); html.append("").append(statu.getAutostate()).append(""); html.append("").append(statu.getLoadfinish()).append(""); html.append("").append(statu.getPlcid()).append(""); html.append("").append(statu.getMesid()).append(""); html.append("").append(statu.getSetTime()).append(""); } return html.toString(); } public String serchglass(String name) { StringBuffer html = new StringBuffer(); LOGGER.debug("name:" + name); List glasses = glassDao.findByBatch(name); LOGGER.debug("glasses:" + glasses.size()); if (glasses.size() > 0) { for (Glass glass : glasses) { if (glass.getPieces() == glass.getCompletePieces()) { html.append(""); } else { html.append(""); } html.append("").append(glass.getId()).append(""); html.append("").append(glass.getManufacture_batch()).append(""); html.append("").append(glass.getLength()).append(""); html.append("").append(glass.getWidth()).append(""); html.append("").append(glass.getThickness()).append(""); html.append("").append(glass.getColor()).append(""); html.append("").append(glass.getPieces()).append(""); html.append("").append(glass.getCompletePieces()).append(""); html.append("").append(glass.getDamagePieces()).append(""); html.append("") .append("打印1打印2"); html.append(""); } } return html.toString(); } public String workglass() { StringBuffer html = new StringBuffer(); RawPackageTxt txt = rawPackageTxtDao.findCutFinishByGroup("1"); if (txt == null) { txt = rawPackageTxtDao.findAcceptedByGroup("1"); } if (txt != null) { List glasses = glassDao.findByBatch(txt.getTxt_name()); if (glasses.size() > 0) { for (Glass glass : glasses) { if (glass.getPieces() == glass.getCompletePieces()) { html.append(""); } else { html.append(""); } html.append("").append(glass.getId()).append(""); html.append("").append(glass.getManufacture_batch()).append(""); html.append("").append(glass.getLength()).append(""); html.append("").append(glass.getWidth()).append(""); html.append("").append(glass.getThickness()).append(""); html.append("").append(glass.getColor()).append(""); html.append("").append(glass.getPieces()).append(""); html.append("").append(glass.getCompletePieces()).append(""); html.append("").append(glass.getDamagePieces()).append(""); /*html.append("") .append("打印1打印2");*/ html.append(""); } } } return html.toString(); } public void printglass(String id, String line) { Glass glass = glassDao.findOne(Long.valueOf(id)); PrintMachine printMachin = printMachineDao.findByLine(line); if (glass != null) { new GMMSPrinter(glass.getCustomer(), glass.getApplication(), glass.getProduction(), glass.getFloor_number(), glass.getOrder_number(), glass.getLength(), glass.getWidth(), glass.getApart_id(), glass.getPiece_sign(), glass.getRemark(), line, glass.getPieces(), 1L, printMachin.getName(), printMachin.getStatu(), glass.getArrangeStatu(),glass.getThingsout()).doPrint(); } } public void otherprint(String id) { PrintMachine printMachin = printMachineDao.findByLine(id); RawPackageTxt txt = rawPackageTxtDao.findCutFinishByGroup("1"); if (txt == null) { txt = rawPackageTxtDao.findAcceptedByGroup("1"); } LOGGER.debug("打印剩余的玻璃标签!"); if (txt != null) { List glasses = glassDao.findByBatch(txt.getTxt_name()); if (glasses.size() > 0) { for (Glass glass : glasses) { if (glass.getPieces() > glass.getCompletePieces()) { for (int i = 0; i < glass.getPieces() - glass.getCompletePieces(); i++) { new GMMSPrinter(glass.getCustomer(), glass.getApplication(), glass.getProduction(), glass.getFloor_number(), glass.getOrder_number(), glass.getLength(), glass.getWidth(), glass.getApart_id(), glass.getPiece_sign(), glass.getRemark(), id, glass.getPieces(), 1L, printMachin.getName(), printMachin.getStatu(), glass.getArrangeStatu(),glass.getThingsout()).doPrint(); } glass.setCompletePieces(glass.getPieces()); glassDao.save(glass); } } } } } /** * * @author northglass * 功能:获得虚拟料架的专属列表 * 2019年3月18日 * * **/ public String getdummyhtml() { StringBuffer html = new StringBuffer(); List dummyFixRacks = dummyFixRackDao.findAll(); if (dummyFixRacks.size()>0) { for (DummyFixRack dummyFixRack :dummyFixRacks) { html.append("").append(dummyFixRack.getNumber()).append(""); if (dummyFixRack.getState().equals(RackState.FREE)) { html.append(dummyFixRack.getState()).append(""); html.append(""); }else { html.append("【").append(dummyFixRack.getThickness()).append("mm").append(dummyFixRack.getWidth()); html.append("*"+dummyFixRack.getHeight() + " mm " +dummyFixRack.getColor()+ "】"); html.append(dummyFixRack.getLeftPieces()+"/"+dummyFixRack.getPieces()).append(""); html.append("    "); html.append("删除原片"); } html.append(""); } } return html.toString(); } /*** * * @author northglass * 2019年3月18日 * 功能:删除虚拟料架上面的数据 * * **/ public void deleteDummyRack(String id) { DummyFixRack dummyFixRack = dummyFixRackDao.findOne(Long.parseLong(id)); if (dummyFixRack != null) { dummyFixRack.setColor(null); dummyFixRack.setHeight(0); dummyFixRack.setThickness(0); dummyFixRack.setWidth(0); dummyFixRack.setLeftPieces(0); dummyFixRack.setPieces(0); dummyFixRack.setState(RackState.FREE); dummyFixRackDao.save(dummyFixRack); } } /*** * * @author northglass * 2019年3月18日 * 功能:修改虚拟料架里面的片数 * * **/ public void modifyRack(String pieces, String ids) { DummyFixRack dummyFixRack = dummyFixRackDao.findOne(Long.parseLong(ids)); int pic = Integer.parseInt(pieces); if (pic == 0) { dummyFixRack.setColor(null); dummyFixRack.setHeight(0); dummyFixRack.setThickness(0); dummyFixRack.setWidth(0); dummyFixRack.setLeftPieces(0); dummyFixRack.setPieces(0); dummyFixRack.setState(RackState.FREE); }else { dummyFixRack.setLeftPieces(pic); } dummyFixRackDao.save(dummyFixRack); } /*** * * @author northglass * 2019年3月18日 * 功能:添加虚拟料架上面的信息 * * **/ public void addRack(RawPackage rawPackage, String shelfRankNumber, String ids) { DummyFixRack dummyFixRack = dummyFixRackDao.findOne(Long.parseLong(ids)); if (dummyFixRack !=null ) { dummyFixRack.setColor(rawPackage.getColor()); dummyFixRack.setHeight(rawPackage.getHeight()); dummyFixRack.setWidth(rawPackage.getWidth()); dummyFixRack.setThickness(rawPackage.getThickness()); dummyFixRack.setPieces(rawPackage.getPieces()); dummyFixRack.setLeftPieces(dummyFixRack.getPieces()); dummyFixRack.setState(RackState.IN_WORK); dummyFixRack.setCreateTime(new Date()); dummyFixRackDao.save(dummyFixRack); } } /** * * @author northglass * 功能:获得查询虚拟料架的专属列表 * 2019年3月19日 * * **/ public String getserachdummyhtml(String color, String glassThickness) { StringBuffer html = new StringBuffer(); List dummyFixRacks = dummyFixRackDao.findbyColorAndThickness(color,Double.parseDouble(glassThickness)); if (dummyFixRacks.size()>0) { for (DummyFixRack dummyFixRack :dummyFixRacks) { html.append("").append(dummyFixRack.getNumber()).append(""); if (dummyFixRack.getState().equals(RackState.FREE)) { html.append(dummyFixRack.getState()).append(""); html.append(""); }else { html.append("【").append(dummyFixRack.getThickness()).append("mm").append(dummyFixRack.getWidth()); html.append("*"+dummyFixRack.getHeight() + " mm " +dummyFixRack.getColor()+ "】"); html.append(dummyFixRack.getLeftPieces()+"/"+dummyFixRack.getPieces()).append(""); html.append("    "); html.append("删除原片"); } html.append(""); } } return html.toString(); } public String findglasscumtorHtml() { StringBuffer html = new StringBuffer(); List glassCommers = glassCommerDao.findAll(); for (int i = 0; i < glassCommers.size(); i++) { GlassCommer glassCommer = glassCommers.get(i); html.append("").append(glassCommer.getId()).append(""); html.append("").append(glassCommer.getName()); html.append("删除"); } return html.toString(); } public void addcommer(GlassCommer glassCommer) { glassCommerDao.save(glassCommer); } public void deletecumtor(String id) { GlassCommer glassCommer = glassCommerDao.findOne(Long.parseLong(id)); glassCommerDao.delete(Long.parseLong(id)); LOGGER.debug("删除膜系" + glassCommer.getName()); } public Map getCeliangManageData(String groups) { // Long machineId = Long.valueOf(groups); Map param = new HashMap(); int totalPieces = 0; int completePieces = 0; param.put("totalPieces", totalPieces); param.put("completePieces", completePieces); param.put("leftPieces", totalPieces - completePieces); param.put("progress", ((double) completePieces / (double) totalPieces * 100) + "%"); // 测量结果显示。 // - 若找到匹配玻璃,则显示结果为匹配成功,不需要人工处理,自动执行送片; // - 若没有找到识别玻璃,则显示两个按钮 // - 一个是重新匹配,允许用户校正并重新测量; // - 另一个是匹配失败,需要用户自己将玻璃移除,并确认; StringBuffer html = new StringBuffer(); param.put("identifyResultHtml", html.toString()); return param; } }