Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | //========== 权限组相关 ========== |
| | | String SYS_GROUP_DELETE_FAIL = "sys.group.delete.fail"; |
| | | |
| | | //========== 运维人员相关 ========== |
| | | String OPERATIONS_USER_DELETE_FLEET_BOUND = "operations.user.delete.fleet.bound"; |
| | | } |
| | |
| | | import com.xiaopeng.account.model.dto.XpOperationsUserDTO; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserPageQuery; |
| | | import com.xiaopeng.account.model.query.XpOperationsUserQuery; |
| | | import com.xiaopeng.account.service.IXpOperationsRoleService; |
| | | import com.xiaopeng.account.service.IXpOperationsUserService; |
| | | import com.xiaopeng.api.dto.account.XpOperationsUserQueryDTO; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpFleetClient; |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpFleet; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserProfileVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserVO; |
| | | import com.xiaopeng.api.vo.account.XpOperationsUserWithRoleVO; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.account.constant.I18nKeyConstant; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | |
| | | private final TokenService tokenService; |
| | | |
| | | private final XpFleetClient xpFleetClient; |
| | | |
| | | @Autowired |
| | | public XpOperationsUserController(IXpOperationsUserService xpOperationsUserService, XpOperationsRoleMapper xpOperationsRoleMapper, TokenService tokenService) { |
| | | public XpOperationsUserController(IXpOperationsUserService xpOperationsUserService, |
| | | XpOperationsRoleMapper xpOperationsRoleMapper, |
| | | TokenService tokenService, |
| | | XpFleetClient xpFleetClient) { |
| | | this.xpOperationsUserService = xpOperationsUserService; |
| | | this.xpOperationsRoleMapper = xpOperationsRoleMapper; |
| | | this.tokenService = tokenService; |
| | | this.xpFleetClient = xpFleetClient; |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "运维人员管理删除", tags = {"管理后台-运维执行"}) |
| | | @DeleteMapping("/api/v1/operationsUser/deleteById") |
| | | public R<String> deleteById(@RequestParam Long id) { |
| | | try { |
| | | R<XpFleet> fleetResult = xpFleetClient.getFleetByOperationsUserId(id); |
| | | if (fleetResult == null) { |
| | | throw new ServiceException("请求失败,请稍后重试", I18nKeyConstant.REQUEST_FAILED); |
| | | } |
| | | XpFleet fleet = fleetResult.getData(); |
| | | if (fleet != null && fleet.getId() != null) { |
| | | String fleetName = com.xiaopeng.common.core.utils.StringUtils.isBlank(fleet.getFleetName()) |
| | | ? String.valueOf(fleet.getId()) |
| | | : fleet.getFleetName(); |
| | | throw new ServiceException( |
| | | "删除失败,该人员已关联车队:" + fleetName, |
| | | I18nKeyConstant.OPERATIONS_USER_DELETE_FLEET_BOUND, |
| | | new Object[]{fleetName} |
| | | ); |
| | | } |
| | | } catch (ServiceException e) { |
| | | throw e; |
| | | } catch (Exception e) { |
| | | throw new ServiceException("请求失败,请稍后重试", I18nKeyConstant.REQUEST_FAILED); |
| | | } |
| | | xpOperationsUserService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.xiaopeng.account.mapper.XpAppUserCouponMapper; |
| | | import com.xiaopeng.account.model.dto.ReceiveCouponDto; |
| | | import com.xiaopeng.account.model.dto.SendCouponDto; |
| | |
| | | xpAppUserCoupon.setTimeJson("[{\"time\": [\"00:00-23:59\"], \"type\": 3, \"typeStr\": 0}]"); |
| | | baseMapper.insert(xpAppUserCoupon); |
| | | } else { |
| | | Long uid = 20260227200715L; |
| | | XpAppUserCoupon xpAppUserCoupon = new XpAppUserCoupon(); |
| | | xpAppUserCoupon.setFullMoney(xpCoupon.getConditionalAmount()); |
| | | xpAppUserCoupon.setMoney(xpCoupon.getAmount()); |
| | | xpAppUserCoupon.setCouponId(dto.getCouponId()); |
| | | xpAppUserCoupon.setAppUserId(uid); |
| | | xpAppUserCoupon.setExpirationTime(LocalDateTime.now().plusDays(7)); |
| | | xpAppUserCoupon.setStatus(1); |
| | | xpAppUserCoupon.setCouponType(xpCoupon.getCouponType()); |
| | | xpAppUserCoupon.setPhone(phone); |
| | | List<Long> uids = Lists.newArrayList(20260227200715L, 202603151057L); |
| | | for (Long uid : uids) { |
| | | XpAppUserCoupon xpAppUserCoupon = new XpAppUserCoupon(); |
| | | xpAppUserCoupon.setFullMoney(xpCoupon.getConditionalAmount()); |
| | | xpAppUserCoupon.setMoney(xpCoupon.getAmount()); |
| | | xpAppUserCoupon.setCouponId(dto.getCouponId()); |
| | | xpAppUserCoupon.setAppUserId(uid); |
| | | xpAppUserCoupon.setExpirationTime(LocalDateTime.now().plusDays(7)); |
| | | xpAppUserCoupon.setStatus(1); |
| | | xpAppUserCoupon.setCouponType(xpCoupon.getCouponType()); |
| | | xpAppUserCoupon.setPhone(phone); |
| | | |
| | | xpAppUserCoupon.setCouponName(xpCoupon.getCouponName()); |
| | | xpAppUserCoupon.setOpenCityId("0"); |
| | | xpAppUserCoupon.setTimeJson("[{\"time\": [\"00:00-23:59\"], \"type\": 3, \"typeStr\": 0}]"); |
| | | baseMapper.insert(xpAppUserCoupon); |
| | | xpAppUserCoupon.setCouponName(xpCoupon.getCouponName()); |
| | | xpAppUserCoupon.setOpenCityId("0"); |
| | | xpAppUserCoupon.setTimeJson("[{\"time\": [\"00:00-23:59\"], \"type\": 3, \"typeStr\": 0}]"); |
| | | baseMapper.insert(xpAppUserCoupon); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | request.failed=Request failed. Please try again later! |
| | | sms.push.failed=SMS sending failed. Please try again later! |
| | | sys.group.delete.fail=Deletion failed. This permission group has been associated with a role |
| | | operations.user.delete.fleet.bound=Delete failed. This user is associated with fleet: {0}. |
| | | account.format.error=The following account format is incorrect: {0} |
| | | account.exist=The following account already exists:{0} |
| | | account.import.error=Importing operation and maintenance personnel data anomaly |
| | | account.import.error=Importing operation and maintenance personnel data anomaly |
| | |
| | | request.failed=请求失败,请稍后重试! |
| | | sms.push.failed=短信发送失败,请稍后重试! |
| | | sys.group.delete.fail=删除失败,该权限组已关联角色 |
| | | operations.user.delete.fleet.bound=删除失败,该人员已关联车队:{0} |
| | | account.format.error=以下帐号格式不正确:{0} |
| | | account.exist=以下帐号已存在:{0} |
| | | account.import.error=导入运维人员数据异常 |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, notification_type, notification_content, operations_user_id, data_id, read_status, is_deleted, create_time, update_time, create_by, update_by |
| | | id, notification_type, notification_content, operations_user_id, data_id, read_status, is_deleted, create_time, update_time, create_by, update_by,notification_ext |
| | | </sql> |
| | | |
| | | <!-- 分页查询用户通知列表 --> |
| | |
| | | /** |
| | | * 推送标题 |
| | | */ |
| | | private static final String PUSH_TITLE = "常规任务提醒"; |
| | | private static final String PUSH_TITLE = "待完成日常任务提示"; |
| | | |
| | | /** |
| | | * 通知内容模板 |
| | |
| | | |
| | | <if test="query.sortType != null"> |
| | | <if test="query.sortType == 1"> |
| | | order by t1.create_time desc, t1.task_urgency_level |
| | | order by t1.task_urgency_level, t1.create_time desc |
| | | <if test="query.sortRule == 2"> |
| | | desc |
| | | desc, t1.create_time desc |
| | | </if> |
| | | </if> |
| | | <if test="query.sortType == 2"> |
| | | order by t1.create_time desc, t2.plate_number |
| | | order by t2.plate_number, t1.create_time desc |
| | | <if test="query.sortRule == 2"> |
| | | desc |
| | | desc, t1.create_time desc |
| | | </if> |
| | | </if> |
| | | <if test="query.sortType == 3"> |
| | |
| | | |
| | | // 点位删除-存在关联巡游点位 |
| | | String POINT_DELETE_HAS_CRUISE_PLAN_POINT = "point.delete.has.cruise.plan.point"; |
| | | |
| | | // 点位启用-不在围栏运营区内 |
| | | String POINT_ENABLE_NOT_IN_OPERATING_AREA = "point.enable.not.in.operating.area"; |
| | | // 点位启用-在禁行区内 |
| | | String POINT_ENABLE_IN_PROHIBITED_AREA = "point.enable.in.prohibited.area"; |
| | | } |
| | |
| | | public R edit(@Validated @RequestBody PointUpdateDto pointAddDto) { |
| | | XpPoint xpPoint = xpPointService.getById(pointAddDto.getId()); |
| | | BeanUtils.copyProperties(pointAddDto, xpPoint); |
| | | if (xpGeoFencingPolygonService.isInFence(pointAddDto.getPointLon(), pointAddDto.getPointLat(), pointAddDto.getFenceId(), "prohibited_area")) { |
| | | return R.ok("in_prohibited_area"); |
| | | if (xpPoint == null) { |
| | | throw new ServiceException("系统异常", I18nKeyConstant.SYSTEM_EXCEPTION); |
| | | } |
| | | |
| | | if (Integer.valueOf(2).equals(pointAddDto.getOperationStatus()) && Integer.valueOf(5).equals(pointAddDto.getVerificationStatus())) { |
| | | Long electronicAreaId = xpPoint.getElectronicAreaId(); |
| | | if (electronicAreaId == null) { |
| | | throw new ServiceException("当前点位不在围栏运营区域内,不能启用。", I18nKeyConstant.POINT_ENABLE_NOT_IN_OPERATING_AREA); |
| | | } |
| | | XpElectronicFenceArea electronicFenceArea = xpElectronicFenceAreaService.getById(electronicAreaId); |
| | | if (electronicFenceArea == null || electronicFenceArea.getElectronicId() == null) { |
| | | throw new ServiceException("运营区域不存在", I18nKeyConstant.POINT_ELECTRONIC_AREA_NOT_EXIST); |
| | | } |
| | | if (xpPoint.getPointLon() == null || xpPoint.getPointLat() == null) { |
| | | throw new ServiceException("系统异常", I18nKeyConstant.SYSTEM_EXCEPTION); |
| | | } |
| | | String fenceId = String.valueOf(electronicFenceArea.getElectronicId()); |
| | | boolean inOperatingArea = xpGeoFencingPolygonService.isInFence(xpPoint.getPointLon(), xpPoint.getPointLat(), fenceId, "operating_area"); |
| | | if (!inOperatingArea) { |
| | | throw new ServiceException("当前点位不在围栏运营区域内,不能启用。", I18nKeyConstant.POINT_ENABLE_NOT_IN_OPERATING_AREA); |
| | | } |
| | | boolean inProhibitedArea = xpGeoFencingPolygonService.isInFence(xpPoint.getPointLon(), xpPoint.getPointLat(), fenceId, "prohibited_area"); |
| | | if (inProhibitedArea) { |
| | | throw new ServiceException("当前点位在禁行区内,不能启用。", I18nKeyConstant.POINT_ENABLE_IN_PROHIBITED_AREA); |
| | | } |
| | | } |
| | | xpPointService.updateById(xpPoint); |
| | | return R.ok(); |
| | | } |
| | |
| | | public List<String> findFencesContainingPoint(GeoPoint point, String collectionName, String geoFieldName) { |
| | | MongoCollection<Document> collection = mongoTemplate.getCollection(collectionName); |
| | | List<String> fenceIds = new ArrayList<>(); |
| | | FindIterable<Document> documents1 = collection.find(); |
| | | for (Document document : documents1) { |
| | | System.out.println(document); |
| | | |
| | | } |
| | | // 查询所有包含该点的围栏 |
| | | Bson filter = Filters.geoIntersects(geoFieldName, MongoGeoFenceUtil.toGeoJsonPoint(point.getLongitude(), point.getLatitude())); |
| | | FindIterable<Document> documents = collection.find(filter); |
| | |
| | | * @return 是否在围栏中 |
| | | */ |
| | | public boolean isInFence(double longitude, double latitude, String fenceId, String collectionName) { |
| | | // 创建GeoPoint对象 |
| | | GeoPoint geoPoint = new GeoPoint(longitude, latitude); |
| | | |
| | | // 调用MongoGeoFenceUtil的方法查询包含该点的围栏 |
| | | List<String> fences = findFencesContainingPoint(geoPoint, collectionName, "points"); |
| | | |
| | | // 检查查询结果中是否包含指定的fenceId |
| | | return fences.contains(fenceId); |
| | | if (fenceId == null || fenceId.trim().isEmpty()) { |
| | | return false; |
| | | } |
| | | MongoCollection<Document> collection = mongoTemplate.getCollection(collectionName); |
| | | Bson fenceIdFilter = Filters.or(Filters.eq("fenceId", fenceId), Filters.eq("parentId", fenceId)); |
| | | Bson geoFilter = Filters.geoIntersects("points", MongoGeoFenceUtil.toGeoJsonPoint(longitude, latitude)); |
| | | Bson filter = Filters.and(fenceIdFilter, geoFilter); |
| | | return collection.find(filter).limit(1).first() != null; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.map.job.base.QuartzManager; |
| | | import com.xiaopeng.map.job.base.TimeJobType; |
| | | import com.xiaopeng.map.job.jobs.ElectronicEffectJob; |
| | | import com.xiaopeng.map.mangodb.service.XpGeoFencingPolygonService; |
| | | import com.xiaopeng.map.mapper.XpElectronicFenceAreaMapper; |
| | | import com.xiaopeng.map.mapper.XpElectronicFenceMapper; |
| | | import com.xiaopeng.map.mapper.XpPointMapper; |
| | |
| | | |
| | | @Autowired |
| | | private XpPointService xpPointService; |
| | | |
| | | @Resource |
| | | private XpGeoFencingPolygonService xpGeoFencingPolygonService; |
| | | |
| | | @Autowired |
| | | private XpRegionMapper xpRegionMapper; |
| | |
| | | } |
| | | } |
| | | } |
| | | //如果区域状态从停用改为启用,需将区域内的点位全部启用 |
| | | if (status ==3 && dto.getStatus() == 2 && !xpPoints.isEmpty()){ |
| | | for (XpPoint xpPoint : xpPoints) { |
| | | xpPoint.setOperationStatus(2); |
| | | xpPointMapper.updateById(xpPoint); |
| | | // 围栏从已停用(3)改为启用中(2)时:同步启用点位需校验点位在运营区内且不在禁行区内 |
| | | Integer newFenceStatus = xpElectronicFence.getStatus(); |
| | | if (status != null && status == 3 && newFenceStatus != null && newFenceStatus == 2) { |
| | | XpElectronicFenceArea operationAreaToEnable = xpElectronicFenceAreaService.lambdaQuery() |
| | | .eq(XpElectronicFenceArea::getElectronicId, dto.getId()) |
| | | .eq(XpElectronicFenceArea::getAreaType, 1) |
| | | .orderByDesc(XpElectronicFenceArea::getId) |
| | | .last("limit 1") |
| | | .one(); |
| | | if (operationAreaToEnable == null || operationAreaToEnable.getId() == null) { |
| | | log.warn("围栏启用同步启用点位跳过:未查询到运营区 fenceId={}", dto.getId()); |
| | | } else { |
| | | Long operationAreaIdToEnable = operationAreaToEnable.getId(); |
| | | LambdaQueryWrapper<XpPoint> pendingEnableQuery = new LambdaQueryWrapper<>(); |
| | | pendingEnableQuery.eq(XpPoint::getElectronicAreaId, operationAreaIdToEnable) |
| | | .eq(XpPoint::getPointType, 1) |
| | | .eq(XpPoint::getOperationStatus, 3); |
| | | List<XpPoint> pendingEnablePoints = xpPointMapper.selectList(pendingEnableQuery); |
| | | int pendingCount = pendingEnablePoints == null ? 0 : pendingEnablePoints.size(); |
| | | if (pendingCount == 0) { |
| | | log.info("围栏启用同步启用点位:无待启用点位 fenceId={}, operationAreaId={}", dto.getId(), operationAreaIdToEnable); |
| | | } else { |
| | | String fenceId = String.valueOf(dto.getId()); |
| | | List<Long> enableIds = new ArrayList<>(); |
| | | for (XpPoint pointItem : pendingEnablePoints) { |
| | | if (pointItem == null || pointItem.getId() == null) { |
| | | continue; |
| | | } |
| | | Double lon = pointItem.getPointLon(); |
| | | Double lat = pointItem.getPointLat(); |
| | | if (lon == null || lat == null) { |
| | | continue; |
| | | } |
| | | try { |
| | | boolean inOperatingArea = xpGeoFencingPolygonService.isInFence(lon, lat, fenceId, "operating_area"); |
| | | if (!inOperatingArea) { |
| | | continue; |
| | | } |
| | | boolean inProhibitedArea = xpGeoFencingPolygonService.isInFence(lon, lat, fenceId, "prohibited_area"); |
| | | if (inProhibitedArea) { |
| | | continue; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("围栏启用同步启用点位校验失败 fenceId={}, pointId={}", dto.getId(), pointItem.getId(), e); |
| | | throw new ServiceException("系统异常", I18nKeyConstant.SYSTEM_EXCEPTION); |
| | | } |
| | | enableIds.add(pointItem.getId()); |
| | | } |
| | | if (CollUtil.isNotEmpty(enableIds)) { |
| | | xpPointService.lambdaUpdate() |
| | | .in(XpPoint::getId, enableIds) |
| | | .eq(XpPoint::getOperationStatus, 3) |
| | | .set(XpPoint::getOperationStatus, 2) |
| | | .update(); |
| | | } |
| | | log.info("围栏启用同步启用点位完成 fenceId={}, pendingCount={}, enableCount={}, skipCount={}", |
| | | dto.getId(), pendingCount, enableIds.size(), Math.max(0, pendingCount - enableIds.size())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | OperationStrategyIndex oldIndex = OperationStrategyIndex.parse(oldOperationStrategy); |
| | | OperationStrategyIndex newIndex = OperationStrategyIndex.parse(newOperationStrategy); |
| | | boolean needAutoDisableByUnion = !oldIndex.equalsNormalized(newIndex) && oldIndex.hasAnyShrinkComparedTo(newIndex); |
| | | // boolean needAutoDisableByUnion = !oldIndex.equalsNormalized(newIndex) && oldIndex.hasAnyShrinkComparedTo(newIndex); |
| | | boolean needAutoDisableByUnion = true; |
| | | |
| | | List<Long> addPointIds = normalizePointIds(dto.getAddPointIdList()); |
| | | List<Long> delPointIds = normalizePointIds(dto.getDelPointIdList()); |
| | |
| | | } |
| | | |
| | | // 围栏运营时间缩短校验:若缩短后点位时间段不在新范围内,则更新为已停用(operation_status=3) |
| | | if (needAutoDisableByUnion && operationAreaId != null) { |
| | | if (operationAreaId != null) { |
| | | LambdaQueryWrapper<XpPoint> pointQuery = new LambdaQueryWrapper<>(); |
| | | pointQuery.eq(XpPoint::getElectronicAreaId, operationAreaId) |
| | | .eq(XpPoint::getPointType, 1) |
| | |
| | | point.number.lock.fail=点位编号生成繁忙,请稍后重试 |
| | | point.number.parse.fail=点位编号生成失败(历史编号格式异常) |
| | | point.delete.has.cruise.plan.point=操作失败,该点位有关联的巡游计划点位 |
| | | point.enable.not.in.operating.area=当前点位不在围栏运营区域内,不能启用。 |
| | | point.enable.in.prohibited.area=当前点位在禁行区内,不能启用。 |
| | |
| | | point.number.lock.fail=Point number generation is busy, please try again later |
| | | point.number.parse.fail=Point number generation failed (invalid historical number format) |
| | | point.delete.has.cruise.plan.point=Operation failed. This point is associated with cruise plan points. |
| | | point.enable.not.in.operating.area=This point is not within the fence operating area and cannot be enabled. |
| | | point.enable.in.prohibited.area=This point is in a prohibited area and cannot be enabled. |
| | |
| | | point.number.lock.fail=点位编号生成繁忙,请稍后重试 |
| | | point.number.parse.fail=点位编号生成失败(历史编号格式异常) |
| | | point.delete.has.cruise.plan.point=操作失败,该点位有关联的巡游计划点位 |
| | | point.enable.not.in.operating.area=当前点位不在围栏运营区域内,不能启用。 |
| | | point.enable.in.prohibited.area=当前点位在禁行区内,不能启用。 |
| | |
| | | */ |
| | | private void closeOrder(XpOrder order) { |
| | | // 更新订单状态为已完成(10) |
| | | this.lambdaUpdate().set(XpOrder::getStatus, 10) |
| | | this.lambdaUpdate().set(XpOrder::getStatus, 8) |
| | | .eq(XpOrder::getId, order.getId()).update(); |
| | | |
| | | |
| | |
| | | sendMessageDTO.setMessage(message); |
| | | sendMessageDTO.setAppUserId(String.valueOf(order.getAppUserId())); |
| | | xpPushMessageClient.sendStatus(sendMessageDTO); |
| | | //结束行程 |
| | | endTrip(order.getId(), order.getAppUserId().toString()); |
| | | log.info("运营人员取消订单成功,推送乘客消息完成"); |
| | | log.info("订单关闭成功,订单ID: {}, 操作人: {}", order.getId(), SecurityUtils.getUsername()); |
| | | } |
| | |
| | | String VEHICLE_IMPORT_VIN_EXISTS = "vehicle.import.vin.exists"; |
| | | String VEHICLE_IMPORT_PLATE_EXISTS = "vehicle.import.plate.exists"; |
| | | |
| | | // ========== 车辆删除相关 ========== |
| | | String VEHICLE_DELETE_HAS_BOUND_FLEET = "vehicle.delete.has.bound.fleet"; |
| | | |
| | | } |
| | |
| | | import com.xiaopeng.vehicleConvoy.model.query.IndexDataQuery; |
| | | import com.xiaopeng.vehicleConvoy.model.vo.IndexDataVO; |
| | | import com.xiaopeng.vehicleConvoy.service.IndexDataService; |
| | | import com.xiaopeng.vehicleConvoy.task.VehicleDocumentExpiryTask; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | |
| | | @Resource |
| | | private IndexDataService indexDataService; |
| | | @Autowired |
| | | private VehicleDocumentExpiryTask vehicleDocumentExpiryTask; |
| | | |
| | | @ApiOperation(value = "首页数据统计", tags = {"管理后台-首页"}) |
| | | @PostMapping("/base/v1/indexData") |
| | |
| | | } |
| | | return R.ok(indexDataService.getIndexData(query)); |
| | | } |
| | | |
| | | @ApiOperation(value = "车辆资质过期检查", tags = {"定时任务"}) |
| | | @PostMapping("/base/v1/vehicle/execute") |
| | | public R<?> vehicleExecute() { |
| | | vehicleDocumentExpiryTask.checkAndStockExpiredVehicles(); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.api.model.account.XpOperationsUser; |
| | | import com.xiaopeng.api.model.maintenance.XpTask; |
| | | import com.xiaopeng.api.model.maintenance.XpTaskRule; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpFleet; |
| | | import com.xiaopeng.api.model.maintenance.XpVehicleRepair; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpFleetVehicle; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | |
| | | |
| | | private final IXpVehicleService xpVehicleService; |
| | | private final IXpFleetVehicleService vehicleService; |
| | | private final IXpFleetService xpFleetService; |
| | | private final IXpVehicleAnnualRecordService xpVehicleAnnualRecordService; |
| | | private final XpVehiclePreparationClient xpVehiclePreparationClient; |
| | | private final XpChargingRecordClient xpChargingRecordClient; |
| | |
| | | @ApiOperation(value = "删除在库车辆",tags = {"管理后台-车辆管理-在库车辆管理"}) |
| | | @DeleteMapping("/api/v1/vehicle/delete/{id}") |
| | | public R<?> delete(@ApiParam(name = "id", value = "车辆ID") @PathVariable Long id) { |
| | | XpFleetVehicle binding = vehicleService.lambdaQuery() |
| | | .eq(XpFleetVehicle::getVehicleId, id) |
| | | .last("limit 1") |
| | | .one(); |
| | | if (binding != null && binding.getFleetId() != null) { |
| | | String fleetName = String.valueOf(binding.getFleetId()); |
| | | try { |
| | | XpFleet fleet = xpFleetService.getById(binding.getFleetId()); |
| | | if (fleet != null && StringUtils.isNotBlank(fleet.getFleetName())) { |
| | | fleetName = fleet.getFleetName(); |
| | | } |
| | | } catch (Exception e) { |
| | | // ignore, fallback to fleetId |
| | | } |
| | | throw new ServiceException("当前车辆已关联车队:" + fleetName, I18nKeyConstant.VEHICLE_DELETE_HAS_BOUND_FLEET, |
| | | new Object[]{fleetName}); |
| | | } |
| | | xpVehicleService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | |
| | | vehicle.import.vin.exists=Row {0}: VIN already exists: {1} |
| | | vehicle.import.plate.exists=Row {0}: plate number already exists: {1} |
| | | vehicle.distance.too.long=Too far away, unable to open |
| | | vehicle.delete.has.bound.fleet=This vehicle is associated with fleet: {0}. |
| | |
| | | vehicle.import.vin.exists=第{0}行车辆VIN码已存在:{1} |
| | | vehicle.import.plate.exists=第{0}行车牌号已存在:{1} |
| | | vehicle.distance.too.long=距离过远,无法打开 |
| | | vehicle.delete.has.bound.fleet=当前车辆已关联车队:{0} |