| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.TaskOverToWms; |
| | |
| | | } |
| | | continue; |
| | | } |
| | | // // 入库站点对应堆垛机,判断堆垛机状态,不是自动,先弹窗,然后continue |
| | | // if (getCrnByStaNo(inSta.getStaNo())) { |
| | | // continue; |
| | | // } |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() && (workNo >= 0) |
| | | && staProtocol.isPakMk()) { |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | | if (barcodeThread == null) { |
| | |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | staProtocol.setBarcode(barcode); |
| | | |
| | | if(Cools.isEmpty(barcode) || barcode.equals("00000000")) { |
| | | continue; |
| | | } |
| | | |
| | | TaskWrk taskWrk = taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode", barcode)); |
| | | |
| | | if (!Cools.isEmpty(taskWrk) && staProtocol.isLoading()){ |
| | | // 写组拓信号 |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(4, staProtocol)); |
| | | // Thread.sleep(500); |
| | | // continue; |
| | | } |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() && (workNo >= 0) |
| | | && staProtocol.isPakMk()) { |
| | | |
| | | if(!Cools.isEmpty(barcode)) { |
| | | StaDescService staDescService = SpringUtils.getBean(StaDescService.class); |
| | | |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("x-api-key","7a15b5db-29b6-552c-8cff-0cfec3756da2"); |
| | | |
| | | TaskWrk taskWrk = taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode", barcode)); |
| | | |
| | | if (Cools.isEmpty(taskWrk)){ |
| | | continue; |
| | | } |
| | | |
| | | //StaDesc staDesc1 = staDescService.selectOne(new EntityWrapper<StaDesc>().eq("stn_no",inSta.getBackSta())); |
| | | boolean sign = true; |
| | |
| | | if (!taskWrkService.updateById(taskWrk)){ |
| | | log.error("保存wms库位号失败"); |
| | | } |
| | | // try { |
| | | // // 更新库位为入库预约 |
| | | // LocMast locMast = locMastService.selectByLocNo(taskWrk.getTargetPoint()); |
| | | // locMast.setLocSts("S"); |
| | | // locMastService.updateById(locMast); |
| | | // log.info("-----入库更新库位状态为:S成功----------"+ locMast.getLocNo()); |
| | | // } catch (Exception e){ |
| | | // log.error("-----入库更新库位状态为:S异常----------"+ e); |
| | | // } |
| | | |
| | | }else { |
| | | log.error("wms通讯失败,"+jsonObject.get("msg")); |
| | |
| | | |
| | | // 双深库位且浅库位有货,则需先对浅库位进行库位移转 |
| | | if (Utils.isDeepLoc(slaveProperties, taskWrk.getStartPoint())) { |
| | | // 获取浅库位,状态为S直接出,状态为R,则找到这个库位的工作档,提升优先级先出 |
| | | String shallowLoc = Utils.getShallowLoc(slaveProperties, taskWrk.getStartPoint()); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", shallowLoc)); |
| | | if (locMast.getLocSts().equals("R")) { |
| | | List<TaskWrk> wrkMastList = taskWrkMapper.selectList(new EntityWrapper<TaskWrk>().eq("source_loc_no", locMast.getLocNo())); |
| | | if (!wrkMastList.isEmpty()) { |
| | | TaskWrk wrkMast = wrkMastList.get(0); |
| | | wrkMast.setIoPri(99); |
| | | taskWrkMapper.updateById(wrkMast); |
| | | continue; |
| | | } |
| | | } |
| | | // // 获取浅库位,状态为S直接出,状态为R,则找到这个库位的工作档,提升优先级先出 |
| | | // String shallowLoc = Utils.getShallowLoc(slaveProperties, taskWrk.getStartPoint()); |
| | | // LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", shallowLoc)); |
| | | // if (locMast.getLocSts().equals("R")) { |
| | | // List<TaskWrk> wrkMastList = taskWrkMapper.selectList(new EntityWrapper<TaskWrk>().eq("source_loc_no", locMast.getLocNo())); |
| | | // if (!wrkMastList.isEmpty()) { |
| | | // TaskWrk wrkMast = wrkMastList.get(0); |
| | | // wrkMast.setIoPri(99); |
| | | // taskWrkMapper.updateById(wrkMast); |
| | | // continue; |
| | | // } |
| | | // } |
| | | |
| | | taskWrkMapper.selectPakOutIoType(taskWrk.getCrnNo()); |
| | | |
| | |
| | | for (TaskWrk taskWrk : taskWrkService.selectReceive()) { |
| | | try { |
| | | taskWrkService.distribute(taskWrk.getTaskNo(), 9527L); |
| | | } catch (CoolException e) { |
| | | // log.info(e.getMessage()); |
| | | } catch (Exception e) { |
| | | log.error("自动派发任务异常:"+e.getMessage()+"{" + taskWrk.toString()); |
| | | } |
| | | } |
| | | } |