| | |
| | | if (!busService.save(bus)) { |
| | | throw new BusinessException("Internal Server Error!"); |
| | | } |
| | | Boolean locStaStatusCheck = configService.getVal("LOC_STA_STATUS_CHECK", Boolean.class, false); |
| | | Boolean locStaStatusCheck = configService.getVal("LOC_STA_STATUS_CHECK", Boolean.class, true); |
| | | |
| | | |
| | | // 保存任务 |
| | |
| | | if (!taskService.updateById(task)) { |
| | | throw new BusinessException("seqNum: " + task.getSeqNum() + " failed to update"); |
| | | } |
| | | report(task, TaskReportStsType.START); |
| | | report(task,null, TaskReportStsType.START); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("mainService.infuseAgvForTask", e); |
| | |
| | | List<Long> taskIds = actionService.selectTaskIdsByGroupId(serialNo); |
| | | for (Long taskId : taskIds) { |
| | | Task task = taskService.getById(taskId); |
| | | report(task, TaskReportStsType.END); |
| | | report(task, agv_11_up.getQrCode(), TaskReportStsType.END); |
| | | } |
| | | } |
| | | |
| | |
| | | List<Long> taskIds = actionService.selectTaskIdsByGroupId(serialNo); |
| | | for (Long taskId : taskIds) { |
| | | Task task = taskService.getById(taskId); |
| | | report(task, TaskReportStsType.OTBIN); |
| | | report(task, agv_11_up.getQrCode(), TaskReportStsType.OTBIN); |
| | | } |
| | | |
| | | } |
| | |
| | | List<Long> taskIds = actionService.selectTaskIdsByGroupId(serialNo); |
| | | for (Long taskId : taskIds) { |
| | | Task task = taskService.getById(taskId); |
| | | report(task, TaskReportStsType.OTBIN); |
| | | report(task, agv_11_up.getQrCode(), TaskReportStsType.OTBIN); |
| | | } |
| | | } |
| | | //往输送线放货完成 |
| | |
| | | List<Long> taskIds = actionService.selectTaskIdsByGroupId(serialNo); |
| | | for (Long taskId : taskIds) { |
| | | Task task = taskService.getById(taskId); |
| | | report(task, TaskReportStsType.END); |
| | | report(task, agv_11_up.getQrCode(), TaskReportStsType.END); |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * 上报给上游系统,就是插入一条数据到上报表 |
| | | */ |
| | | private void report(Task task, TaskReportStsType taskReportStsType) { |
| | | private void report(Task task, String qrCode, TaskReportStsType taskReportStsType) { |
| | | // TODO 插入一条上报记录 |
| | | if (task.getBusId() == null) { |
| | | return; |
| | |
| | | taskReport.setAgvId(task.getAgvId()); |
| | | taskReport.setBusNo(task.getBusId$()); |
| | | taskReport.setCreateTime(new Date()); |
| | | taskReport.setQrCode(qrCode); |
| | | taskReport.setReportTimes(0); |
| | | taskReport.setTaskSts(taskReportStsType.status); |
| | | taskReport.setSeqNum(task.getSeqNum()); |