| | |
| | | // private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}}; |
| | | private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}}; |
| | | |
| | | private static final Integer jarMaxLoc = 6; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (emptyInSta.getStaNo()==607 && staProtocol.getStaNo()==607 && staProtocol.getWorkNo()>20000){ |
| | | if (emptyInSta.getStaNo()==607 && staProtocol.getStaNo()==607 && staProtocol.getWorkNo()>20000 && staProtocol.isLoading() && staProtocol.isAutoing()){ |
| | | try { |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | | BasDevp basDevp = basDevpService.selectById(staProtocol.getStaNo()); |
| | | if (basDevp.getReportSign()==0){ |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | | |
| | | SearchLocParam param = new SearchLocParam(); |
| | | param.setIoType(10); |
| | | param.setSourceStaNo(emptyInSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | SearchLocParam param = new SearchLocParam(); |
| | | param.setIoType(10); |
| | | param.setSourceStaNo(emptyInSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | basDevp.setReportSign(1); |
| | | basDevpService.updateById(basDevp); |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | // 更新站点信息 且 下发plc命令 |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | staProtocol.setStaNo(607); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(5, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | // 更新站点信息 且 下发plc命令 |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | staProtocol.setStaNo(607); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(5, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | // 站点条件判断 |
| | |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)!=0){ |
| | | break; |
| | | } |
| | | if (basJarMastService.getJarMastByJarIdCount(jarSlave.getId())>=14){ |
| | | if (basJarMastService.getJarMastByJarIdCount(jarSlave.getId())>=jarMaxLoc*2){ |
| | | break; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getId(),0,9)>=7){ |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getId(),0,9)>=jarMaxLoc){ |
| | | break; |
| | | } |
| | | if (!Objects.equals |
| | |
| | | break; |
| | | } |
| | | jarLocDigit = 1; |
| | | } else if (jarMastByJarIdMax.getJarLocDigit()<7){ |
| | | } else if (jarMastByJarIdMax.getJarLocDigit()<jarMaxLoc){ |
| | | jarLocDigit = jarMastByJarIdMax.getJarLocDigit()+1; |
| | | } else { |
| | | continue; |
| | |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(4); |
| | | }}); |
| | | if (basJarMastList.size() != 7){ |
| | | if (basJarMastList.size() != jarMaxLoc){ |
| | | return false; |
| | | } |
| | | |
| | |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | if (basJar.getJarCount()!=7){ |
| | | if (!basJar.getJarCount().equals(jarMaxLoc)){ |
| | | log.error("{}号硫化罐查询设备库存数异常!!!库存待入数:{}",jarProtocol.getJarNo(),basJar.getJarCount()); |
| | | return false; |
| | | } |
| | |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(6); |
| | | }}); |
| | | if (basJarMastList.size() != 7){ |
| | | if (basJarMastList.size() != jarMaxLoc){ |
| | | return false; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=0){ |
| | |
| | | |
| | | } else { |
| | | //调车 == > endRow |
| | | if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){ |
| | | if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(jarProtocolOther.getJarNo()))){ |
| | | log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}", |
| | | wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign); |
| | | } |
| | |
| | | |
| | | if (steProtocol.getCharge()>95.0F || steProtocol.getFullCharge()){ |
| | | } else if (steProtocol.getCharge()>50.0F){ |
| | | if (wrkMastExecuteService.selectNoStartCharge(steSlave.getId())==0){ |
| | | if (wrkMastExecuteService.selectMoveStart(steSlave.getId())==0){ |
| | | continue; |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusListCharge(steSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(5); |
| | | add(11); |
| | | add(17); |
| | | }}); |
| | | if(basJarMastList.isEmpty()){ |
| | | if (wrkMastExecuteService.selectNoStartCharge(steSlave.getId())==0){ |
| | | if (wrkMastExecuteService.selectMoveStart(steSlave.getId())==0){ |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | |
| | | if (staNo1!=0){ |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 2); |
| | | StaProtocol staProtocol607 = devpThread.getStation().get(607); |
| | | if (staProtocol607.getWorkNo()<9001 && staProtocol607.getWorkNo()!=0 && staProtocol607.isLoading() && staProtocol607.isAutoing()){ |
| | | if (staProtocol607.getWorkNo()<9001 && staProtocol607.getWorkNo()!=0 && staProtocol607.isLoading() && staProtocol607.isAutoing() && staProtocol607.getStaNo() == 607){ |
| | | staProtocol607.setStaNo(staNo1); |
| | | boolean result2 = MessageQueue.offer(SlaveType.Devp, 2, new Task(5, staProtocol607)); |
| | | } |
| | |
| | | } |
| | | public synchronized Integer jarGetStartStaNo(Integer staNo) { |
| | | try { |
| | | int[] jarNos=new int[]{1,2,3,4};//(607分配硫化罐) |
| | | int[] jarNos=new int[]{4,2,3,1};//(607分配硫化罐) |
| | | ArrayList<Integer> staNos = new ArrayList<Integer>() {{ |
| | | add(607);add(608);add(609);add(610);add(611);add(612); |
| | | add(613);add(614);add(615);add(616);add(617);add(618); |
| | |
| | | if (basJarMastList.isEmpty()){ |
| | | continue; |
| | | } |
| | | if (basJarMastList.size()>0 && basJarMastList.size()<7){ |
| | | if (basJarMastList.size()>0 && basJarMastList.size()<jarMaxLoc){ |
| | | jarNoList.add(jarNo); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | if (count<7){ |
| | | if (count<jarMaxLoc){ |
| | | return basJar.getEntStaNo$(); |
| | | } |
| | | } |