| | |
| | | private HomeMapper homeMapper; |
| | | @Autowired |
| | | private SpianMapper spianMapper; |
| | | @Autowired |
| | | SpianService spianService; |
| | | |
| | | @Autowired |
| | | private JdbcConnections jdbcConnections; |
| | | |
| | | public void AddOutSliceS(String[][] AluminumFrames) throws SQLException { |
| | | int sequence = homeMapper.SelectMaxSquence(); |
| | | // int sequence = homeMapper.SelectMaxSquence(); |
| | | |
| | | // 添加到数据库 |
| | | for (String[] item : AluminumFrames) { |
| | | if (item[1] == "true") { |
| | | String position = jdbcConnections.SelectPositionByFrameBarcode(item[3]); |
| | | homeMapper.AddOutSliceS(item[0], item[2], item[3], item[4], item[5], sequence, position); |
| | | sequence += 1; |
| | | } |
| | | } |
| | | // for (String[] item : AluminumFrames) { |
| | | // if (item[1] == "true") { |
| | | // Short state=0; |
| | | // String position = jdbcConnections.SelectPositionByFrameBarcode(item[3]); |
| | | // homeMapper.AddOutSliceS(item[0], item[2], item[3], item[4], item[5], |
| | | // sequence, position,state ); |
| | | // sequence += 1; |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | // 查询出片队列 |
| | | public List<Out_slice> SelectProductionqueue() { |
| | | List<Out_slice> listoutslice = homeMapper.SelectProductionqueue(); |
| | | for (Out_slice out_slice : listoutslice) { |
| | | out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId())); |
| | | } |
| | | // for (Out_slice out_slice : listoutslice) { |
| | | // out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId())); |
| | | // } |
| | | return listoutslice; |
| | | } |
| | | |
| | | // 完成出片任务 |
| | | public Result CompleteQueue(String id, String frameid, String glassid) { |
| | | homeMapper.CompleteQueue(id); |
| | | Short num = homeMapper.SelectCountByFrameNo(frameid); |
| | |
| | | homeMapper.CompleteQueueByFrameNo(frameid); |
| | | } |
| | | StorageCage storageCage = homeMapper.SelectGlassInfo(glassid); |
| | | if(storageCage!=null){ |
| | | if (storageCage != null&&storageCage.getState().equals("3")) { |
| | | spianMapper.UpdataOutCage1(storageCage.getGlassWidth(), storageCage.getCage(), storageCage.getCell()); |
| | | homeMapper.DeleteByGlassID(glassid); |
| | | } |
| | | homeMapper.UpdateCageTask2(glassid); |
| | | S7control.getinstance().WriteWord("DB105.12", (short) 0); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | //终止进片/出片 |
| | | public void StopTask(String glassid, int i) { |
| | | if (i == 0) {// 进片终止 |
| | | spianService.overtask(glassid); |
| | | DeleteByGlassID(glassid); |
| | | } else {// 出片终止 |
| | | spianMapper.UpdatetaskOut(glassid);//完成出片任务 |
| | | spianMapper.UpdataGlassCage(glassid, 0);// 清除出片格子玻璃信息 |
| | | spianMapper.UpdateCageOver(glassid, 0);// 更改笼子表出片状态 |
| | | homeMapper.UpdateOutSliceGlass(glassid);//修改出片队列此玻璃状态为缺失 |
| | | } |
| | | } |
| | | //删除笼内玻璃还原宽度 |
| | | public void DeleteByGlassID(String glassid) { |
| | | StorageCage glassinfor = homeMapper.SelectGlassInfo(glassid); |
| | | spianMapper.UpdataOutCage1(glassinfor.getGlassWidth(), glassinfor.getCage(), glassinfor.getCell()); |
| | | homeMapper.DeleteByGlassID(glassid); |
| | | } |
| | | |
| | | } |