| | |
| | | ActionTypeType.ReadyTakeFromAgvSite.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now, // 工作时间 |
| | | destSta.getStaTypeIsCheck() == 1 ? 2 : 0, |
| | | destSta.getStaNo() |
| | | now // 工作时间 |
| | | |
| | | )); |
| | | // 计算货叉工作方向 |
| | | staWorkDirection = mapService.calculateAgvWorkDirectionByStation(destStaWorkDirection, lastDirection); |
| | |
| | | ActionTypeType.ReadyReleaseToConveyorSta.val(), // 动作类型 |
| | | actionPrepareSts, // 动作进度 |
| | | agvId, // AGV |
| | | now // 工作时间 |
| | | now, // 工作时间 |
| | | destSta.getStaTypeIsCheck() == 1 ? 2 : 0, |
| | | destSta.getStaNo() |
| | | )); |
| | | break; |
| | | case TO_CHARGE: |
| | |
| | | .setQrCode(action.getCode()) |
| | | .bodySync(body -> body.setHeight((short) Double.parseDouble(action.getParams()))) |
| | | ); |
| | | if (!Cools.isEmpty(action.getAskType()) && (action.getAskType() == 1 || action.getAskType() == 2)) { |
| | | flag = askSta(action.getAskType(), action.getAskSta()); |
| | | } |
| | | break; |
| | | case ReadyTakeFromAgvSite: |
| | | agvAction.add(new AgvActionItem<>(ReadyTakeFromAgvSite.class) |
| | |
| | | .setQrCode(action.getCode()) |
| | | .bodySync(body -> body.setHeight((short) Double.parseDouble(action.getParams()))) |
| | | ); |
| | | if (!Cools.isEmpty(action.getAskType()) && (action.getAskType() == 1 || action.getAskType() == 2)) { |
| | | flag = askSta(action.getAskType(), action.getAskSta()); |
| | | } |
| | | break; |
| | | case ReadyReleaseToAgvSite: |
| | | agvAction.add(new AgvActionItem<>(ReadyReleaseToAgvSite.class) |
| | |
| | | default: |
| | | break; |
| | | } |
| | | if (!Cools.isEmpty(action.getAskType()) && (action.getAskType() == 1 || action.getAskType() == 2)) { |
| | | flag = askSta(action.getAskType(), action.getAskSta()); |
| | | } |
| | | |
| | | } |
| | | if (!flag) { |
| | | log.error("任务组 [{}] 动作指令下发失败 ,向输送线询问报错!!!", actionGroupId); |
| | |
| | | task.setUpdateTime(now); |
| | | if (!taskService.updateById(task)) { |
| | | log.error("Task [{}] 更新失败 !!!", task.getSeqNum()); |
| | | } else { |
| | | report(task, null, TaskReportStsType.END); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | TaskReport taskReport = new TaskReport(); |
| | | taskReport.setAgvId(task.getAgvId()); |
| | | taskReport.setAgvNo(task.getAgvId$()); |
| | | taskReport.setBusNo(task.getBusId$()); |
| | | taskReport.setCreateTime(new Date()); |
| | | taskReport.setCompleted(0); |
| | | taskReport.setQrCode(qrCode); |
| | | taskReport.setReportTimes(0); |
| | | taskReport.setTaskSts(taskReportStsType.status); |
| | | taskReport.setEventType(taskReportStsType.name); |
| | | taskReport.setSeqNum(task.getSeqNum()); |
| | | taskReport.setZpallet(task.getZpallet()); |
| | | if (!taskReportService.save(taskReport)) { |
| | |
| | | |
| | | private boolean askSta(Integer askType, String askSta) { |
| | | log.info("来询问输送线了,{},{}", askType, askSta); |
| | | String wmsUrl = configService.getVal("WMS_URL", String.class); |
| | | String wmsUrl = configService.getVal("WCS_URL", String.class); |
| | | String wmsPath = configService.getVal("WMS_STA", String.class); |
| | | if (Cools.isEmpty(wmsPath) || Cools.isEmpty(wmsUrl)) { |
| | | return true; |
| | | return false; |
| | | } |
| | | Integer time = configService.getVal("TIMEOUT", Integer.class, 5); |
| | | //Integer times = configService.getVal("REPORT_TIMES", Integer.class, 2); |