| | |
| | | if (null == staReserveService.reserveStaIn(destSta, task, 1)) { |
| | | throw new BusinessException("destSta:" + destSta.getStaNo() + " 预约失败"); |
| | | } |
| | | staReserveService.allocateCallBack(destSta, task, agv.getId()); |
| | | |
| | | // task |
| | | task.setOriLoc(oriLoc.getId()); |
| | |
| | | if (null == staReserveService.reserveStaOut(oriSta, task, 1)) { |
| | | throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 预约失败"); |
| | | } |
| | | staReserveService.allocateCallBack(oriSta, task, agv.getId()); |
| | | |
| | | // destLoc |
| | | if (!Cools.isEmpty(param.getEndLocNo())) { |
| | |
| | | if (null == staReserveService.reserveStaOut(oriSta, task, 1)) { |
| | | throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 预约失败"); |
| | | } |
| | | staReserveService.allocateCallBack(oriSta, task, agv.getId()); |
| | | |
| | | // destSta |
| | | if (!Cools.isEmpty(param.getEndStaNo())) { |
| | |
| | | if (null == staReserveService.reserveStaIn(destSta, task, 1)) { |
| | | throw new BusinessException("destSta:" + destSta.getStaNo() + " 预约失败"); |
| | | } |
| | | staReserveService.allocateCallBack(destSta, task, agv.getId()); |
| | | |
| | | // task |
| | | task.setOriSta(oriSta.getId()); |
| | |
| | | public Boolean cancel(Long segmentId, Long userId) { |
| | | Date now = new Date(); |
| | | Segment segment = this.getById(segmentId); |
| | | Long travelId = segment.getTravelId(); |
| | | String groupId = segment.getGroupId(); |
| | | // update segment list |
| | | List<Segment> segmentList = this.list(new LambdaQueryWrapper<Segment>().eq(Segment::getGroupId, groupId)); |
| | | List<Segment> segmentList = this.list(new LambdaQueryWrapper<Segment>().eq(Segment::getTravelId, travelId)); |
| | | for (Segment seg : segmentList) { |
| | | Task task = taskService.getById(segment.getTaskId()); |
| | | if (task != null && |
| | |
| | | } |
| | | this.processNext(segmentList); |
| | | // update action list |
| | | actionService.updateStsByGroupId(groupId, ActionStsType.EXPIRED.val()); |
| | | if (!Cools.isEmpty(groupId)) { |
| | | actionService.updateStsByGroupId(groupId, ActionStsType.EXPIRED.val()); |
| | | } |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | |
| | | AND type = #{type} |
| | | AND deleted = 0 |
| | | AND status = 1 |
| | | -- AND state IN ('WAITING','RESERVED') |
| | | </update> |
| | | |
| | | <update id="updateStateToWaiting"> |
| | |
| | | AND type = #{type} |
| | | AND deleted = 0 |
| | | AND status = 1 |
| | | -- AND state IN ('RESERVED','WAITING') |
| | | </update> |
| | | |
| | | <update id="updateStateBackToWaiting"> |
| | |
| | | AND type = #{type} |
| | | AND deleted = 0 |
| | | AND status = 1 |
| | | -- AND state = 'WAITING' |
| | | </update> |
| | | |
| | | </mapper> |