| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void saveVehicleAccident(SaveVehicleAccidentDto dto, XpOperationsUser xpOperationsUser) { |
| | | XpTask xpTask = new XpTask(); |
| | |
| | | xpTask.setTaskDescription(dto.getTaskDescription()); |
| | | // todo 获取车辆当前位置 |
| | | // xpTask.setVehicleLocation(); |
| | | xpTask.setVehicleId(dto.getId()); |
| | | xpTask.setVehicleId(dto.getId()); |
| | | // xpTask.setVehicleLon(); |
| | | // xpTask.setVehicleLat(); |
| | | xpTask.setReportUserId(xpOperationsUser.getId()); |
| | |
| | | List<Long> userIds = xpOperationsRoleResult.getData().stream().map(XpOperationsRole::getOperationsUserId).collect(Collectors.toList()); |
| | | xpTask.setHandleUserId(StringUtils.join(userIds, ",")); |
| | | } |
| | | //查询事故处理限时配置 |
| | | // 根据事故处理限时配置设置任务截止时间 |
| | | LocalDateTime endTime = LocalDateTime.now().plusMinutes(taskRule.getProcessingTimeLimit()); |
| | | xpTask.setEndTime(endTime); |
| | | this.save(xpTask); |
| | | |
| | | //发送消息通知 |
| | | // 发送消息通知 |
| | | List<Long> userIds = Arrays.stream(xpTask.getHandleUserId().split(",")).map(Long::valueOf).collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(userIds)) { |
| | | R<List<XpOperationsUser>> xpOperationUserResult = xpOperationUserClient.listByIds(userIds); |