| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | // 指定格子出片 |
| | | public Result AddOutGlass(Integer cell, Integer glasstype) { |
| | | GlassInfo glass = albaniaMapper.SelectGlassInfo(glasstype); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (glass != null) { |
| | | albaniaMapper.AddFinishNumber(glass.getFlowcard(), glass.getMateid(), glass.getTier()); |
| | | UpdateStroageCageByCell(cell, -1);// 玻璃数量-1 |
| | | // 增加出片队列的任务 |
| | | albaniaMapper.InsertOutTask(1, 0, cell, 2001, glass.getGlassid(), |
| | | glass.getGlasstype(), glass.getFlowcard(), glass.getMateid(), glass.getTier()); |
| | | map.put("message", "200"); |
| | | } else { |
| | | map.put("message", "300"); |
| | | } |
| | | return Result.success(map); |
| | | } |
| | | |
| | | // 查询进/出片任务 |
| | | public List<StorageTask> SelectStorageTask(int task_type) { |
| | | List<StorageTask> storageTasks = new ArrayList<>(); |
| | |
| | | } |
| | | // storageTask.setstorageCage(homeMapper.SelectStorageByCell(loadrack)); |
| | | storageTask.setstorageCage(homeMapper.SelectStorageByCellGlass(storageTask.getId())); |
| | | |
| | | |
| | | } |
| | | return storageTasks; |
| | | } |
| | | |
| | | // 查询出片队列 |
| | | public List<Map> SelectOutTask() { |
| | | return homeMapper.SelectOutTask(); |
| | | } |
| | | |
| | | // 查询出片队列 |
| | | public List<Map> SelectOutLog() { |
| | | return homeMapper.SelectOutLog(); |
| | | } |
| | | |
| | | // 查询进/出片任务 |
| | |
| | | public Map StorageCageForm() { |
| | | return homeMapper.SelectMeasureWidthHeight(); |
| | | } |
| | | //手动结束任务 |
| | | |
| | | // 手动结束任务 |
| | | public Result TerminateTask(int id) { |
| | | for (int i = 1; i < 7; i++) { |
| | | int taskcont = albaniaMapper.SelectTaskcount(); // 正在进行的任务数量 |
| | |
| | | System.out.println("结束进片任务:" + storageTask.getId()); |
| | | homeMapper.FinishTask(storageTask.getId(), 2);// 完成任务 |
| | | homeMapper.DeletequeueByGlassid(storageTask.getGlasstype().toString()); |
| | | glassInfoMapper.updateGlassNumber(storageTask.getGlasstype());//减少扫描次数 |
| | | glassInfoMapper.updateGlassNumber(storageTask.getGlasstype());// 减少扫描次数 |
| | | } else { |
| | | System.out.println("结束出片任务:" + storageTask.getId()); |
| | | homeMapper.FinishTask(storageTask.getId(), 2);// 完成任务 |
| | |
| | | public Result UpdateQueue(GlassInfo glassInfo) { |
| | | // 删除数据 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // QueueMapper.DeleteQueue(); |
| | | int count = homeMapper.SelectQueue(); |
| | | if (count > 0) { |
| | | homeMapper.UpdateQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(), |
| | | QueueMapper.DeleteQueue(); |
| | | System.out.println("人工匹配ID:" + glassInfo.getMateid() + "膜系:" + glassInfo.getFilms()); |
| | | // int count = homeMapper.SelectQueue(); |
| | | // if (count > 0) { |
| | | // homeMapper.UpdateQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(), |
| | | // glassInfo.getGlasstype(), glassInfo.getThickness(), glassInfo.getTier(), glassInfo.getMateid()); |
| | | homeMapper.AddQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(), |
| | | glassInfo.getGlasstype(), glassInfo.getThickness(), glassInfo.getTier(), glassInfo.getMateid()); |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1); |
| | | map.put("message", "200"); |
| | | }else { |
| | | map.put("message", "300"); |
| | | } |
| | | // } else { |
| | | // map.put("message", "300"); |
| | | // } |
| | | return Result.success(map); |
| | | } |
| | | |
| | |
| | | homeMapper.StartChange(flowcard, orderstate); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | int state = homeMapper.selectStartChange(flowcard); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | // 开始/暂停出片队列 |
| | | public Result UpdateOutTask(Integer id, Integer state) { |
| | | homeMapper.UpdateOutTask(id, state); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | // 删除出片队列 |
| | | public Result DeleteOutTask(Integer id) { |
| | | homeMapper.DeleteOutTask(id); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | |
| | | glasstype = Integer.valueOf(value); |
| | | } |
| | | // |
| | | |
| | | homeMapper.AddGlassinfo(map.get("order").toString(), glasstype, |
| | | Integer.parseInt(map.get("matching").toString()) // 需要计算 配片ID |
| | | , map.get("order").toString() + "-" + count + "" // 需要计算 玻璃ID |
| | | , Integer.parseInt(map.get("tier").toString()), map.get("films").toString(), |
| | | Double.parseDouble(map.get("base").toString()), Double.parseDouble(map.get("height").toString()), |
| | | Double.parseDouble(map.get("thickness").toString()), |
| | | Integer.parseInt(map.get("quantity").toString()), groupby.get(tierkey));// 需要计算总层数 |
| | | Integer.parseInt(map.get("quantity").toString()), groupby.get(tierkey), |
| | | map.get("Customer").toString());// 需要计算总层数 |
| | | // 订单内总层数 |
| | | homeMapper.InsertFlowcard(map.get("order").toString(), OrderFinishedProduct.get(tierkey + "_Sum")); |
| | | homeMapper.InsertFlowcard(map.get("order").toString(), OrderFinishedProduct.get(tierkey + "_Sum"), |
| | | map.get("Customer").toString()); |
| | | count++; |
| | | } |
| | | Map<String, Object> ResultCode = new HashMap<>(); |