| | |
| | | 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() |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | } |