| | |
| | | // 增加/减少理片笼玻璃数 |
| | | public Result UpdateStroageCageByCell(Integer cell, Integer num) { |
| | | if (num == 0) { |
| | | int sumcell=albaniaMapper.SelectOutTasksum(cell); |
| | | if(sumcell==0){ |
| | | homeMapper.DeleteStroageCageByCell(cell); |
| | | } |
| | | }else if(num==-1){ |
| | | homeMapper.updateStroageCageByCell(cell, num); |
| | | } else { |
| | | homeMapper.updateStroageCageByCell(cell, num); |
| | | homeMapper.UpdateStroageCageWidthByCell(cell);// 修改笼子宽度 |
| | |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | // 界面增加/减少理片笼玻璃数 |
| | | public Result UpdateStroageCageByCells(Integer cell, Integer num) { |
| | | if (num == 0) { |
| | | int sumcell=albaniaMapper.SelectOutTasksum(cell); |
| | | if(sumcell==0){ |
| | | homeMapper.DeleteStroageCageByCell(cell); |
| | | } |
| | | } else { |
| | | homeMapper.updateStroageCageByCell(cell, num); |
| | | homeMapper.UpdateStroageCageWidthByCell(cell);// 修改笼子宽度 |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | |
| | | // 指定格子出片 |
| | | public Result AddOutGlass(Integer cell, Integer glasstype) { |
| | |
| | | |
| | | // 手动结束任务 |
| | | public Result TerminateTask(int id) { |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | // 清除任务地址 |
| | | for (int i = 1; i < 7; i++) { |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStart" + i).getAddress(), (short) 0);// 清除任务地址 |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCTarget" + i).getAddress(), (short) 0);// 清除任务地址 |
| | | } |
| | | System.out.println("结束任务地址"); |
| | | for (int i = 1; i < 7; i++) { |
| | | int taskcont = albaniaMapper.SelectTaskcount(); // 正在进行的任务数量 |
| | | System.out.println("任务数量:" + taskcont); |
| | |
| | | |
| | | // 手动完成任务 |
| | | public Result FinishTask() { |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | // 清除任务地址 |
| | | for (int i = 1; i < 7; i++) { |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStart" + i).getAddress(), (short) 0);// 清除任务地址 |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCTarget" + i).getAddress(), (short) 0);// 清除任务地址 |
| | | } |
| | | System.out.println("结束任务地址"); |
| | | for (int i = 1; i < 7; i++) { |
| | | int taskcont = albaniaMapper.SelectTaskcount(); // 正在进行的任务数量 |
| | | System.out.println("任务数量:" + taskcont); |
| | |
| | | // storageTask.geTier());// 添加出片完成数量 |
| | | |
| | | } |
| | | |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | |
| | | // 添加玻璃到格子内 |
| | | public Result StorageCageAddGlass(String cell, GlassInfo glassInfo) { |
| | | homeMapper.StorageCageAddGlass(cell, glassInfo); |
| | | UpdateStroageCageByCell(Integer.parseInt(cell), 1); |
| | | UpdateStroageCageByCells(Integer.parseInt(cell), 1); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | |
| | | String A02Mes = plcmes.getPlcParameter("MESToGaStatus").getValue(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 移除 |
| | | if ("1".equals(A02Plc)||"2".equals(A02Plc)|"1".equals(A02Mes)) { |
| | | if ("1".equals(A02Plc)||"2".equals(A02Plc)||"1".equals(A02Mes)) { |
| | | Queue queue = QueueMapper.selectLastQueue3(); |
| | | if (queue != null) { |
| | | // 减少匹配次数 |
| | |
| | | |
| | | // 删除出片队列 |
| | | public Result DeleteOutTask(Integer id) { |
| | | |
| | | int cell = homeMapper.SelectOutTaskId(id); |
| | | UpdateStroageCageByCell(cell, 1);// 玻璃数量+1 |
| | | homeMapper.DeleteOutTask(id); |
| | |
| | | |
| | | // 删除工程 |
| | | public Result deleteTasks(Map num) { |
| | | String flowcard = (String) num.get("num"); |
| | | int aa = homeMapper.deleteFlowcard(flowcard.trim()); |
| | | homeMapper.deleteGlassinfo(flowcard.trim()); |
| | | System.out.println(flowcard); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", flowcard.trim()); |
| | | String flowcard = (String) num.get("num"); |
| | | int cagenum=homeMapper.selectflowcardCage(flowcard); |
| | | if(cagenum==0){ |
| | | int aa = homeMapper.deleteFlowcard(flowcard.trim()); |
| | | map.put("message","200"); |
| | | homeMapper.deleteGlassinfo(flowcard.trim()); |
| | | }else{ |
| | | map.put("message", "300"); |
| | | } |
| | | System.out.println("删除工程"+flowcard); |
| | | return Result.success(map); |
| | | } |
| | | |