| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.domain.enums.WorkNoType; |
| | |
| | | crnCommand.setDestinationPosY(Utils.getLevShort(taskWrk.getTargetPoint())); // 目标库位层 |
| | | crnCommand.setDestinationPosZ(Utils.getRowShort(taskWrk.getTargetPoint())); // 目标库位排 |
| | | crnCommand.setCommand((short)1); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand))) { |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand))) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | throw new CoolException("堆垛机命令生成失败"); |
| | | } |
| | |
| | | crnCommand.setDestinationPosY(crnStn.getLev().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(crnStn.getRow().shortValue()); // 目标库位层 |
| | | crnCommand.setCommand((short)1); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand))) { |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand))) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | throw new CoolException("堆垛机命令生成失败"); |
| | | } |
| | |
| | | StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo()).clone(); |
| | | staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo((short) Integer.parseInt(taskWrk.getTargetPoint())); |
| | | if (!CommandUtils.offer(SlaveType.Devp, crnStn.getDevpPlcId(), new Task(2, staProtocol))) { |
| | | if (!CommandUtils.offer(SlaveType.Devp, crnStn.getDevpPlcId(), new Task(3, staProtocol))) { |
| | | log.error("输送线命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | throw new CoolException("输送线命令生成失败"); |
| | | } |
| | |
| | | @Override |
| | | public void locMove(TaskWrk taskWrk, Long userId) { |
| | | //库格移载任务派发 |
| | | StaDesc staDesc = staDescService.queryCrn(taskWrk.getIoType(), Integer.parseInt(taskWrk.getTargetPoint()), taskWrk.getCrnNo()); |
| | | if (staDesc == null) { |
| | | return;//不存在路径 |
| | | } |
| | | if (Cools.isEmpty(taskWrk.getTargetPoint())){ |
| | | return; |
| | | } |
| | | int workNo = commonService.getWorkNo(WorkNoType.OTHER.type);//获取工作号 |
| | | taskWrk.setWrkNo(workNo);//工作号 |
| | | taskWrk.setStatus(TaskStatusType.DISTRIBUTE.id);//派发状态 |
| | | taskWrk.setAssignTime(new Date());//派发时间 |
| | | taskWrk.setWrkSts(11);//工作状态 11.生成出库ID |
| | | taskWrk.setCrnNo(staDesc.getCrnNo());//堆垛机号 |
| | | //taskWrk.setCrnNo(staDesc.getCrnNo());//堆垛机号 |
| | | taskWrk.setModiTime(new Date()); |
| | | taskWrk.setModiUser(userId); |
| | | updateById(taskWrk); |
| | |
| | | public int saveToHistory(String taskNo) { |
| | | return this.baseMapper.saveToHistory(taskNo); |
| | | } |
| | | |
| | | @Override |
| | | public List<TaskWrk> selectbyWrksts4() { |
| | | return this.baseMapper.selectbyWrksts4(); |
| | | } |
| | | } |