xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/utils/XpPricingUtil.java
@@ -113,17 +113,17 @@ // 当前费率+(费率*上升百分比) priceRate = new BigDecimal(priceRate).multiply(divide).add(new BigDecimal(priceRate)).setScale(2, RoundingMode.HALF_UP).doubleValue(); } JSONObject jsonObject1 = jsonObject.getJSONObject("weather"); if(null != jsonObject1){ JSONArray ws = jsonObject.getJSONArray("weather"); if(null != ws){ XpOpenCity openCity = openCityClient.getXpOpenCityById(openCityId).getData(); WeatherDTO data = xpMapClient.wether(openCity.getCityCode()).getData(); List<WeatherDTO.Lives> lives = data.getLives(); if(lives!=null && !lives.isEmpty()){ String w = lives.get(0).getWeather(); Set<String> weather = jsonObject1.keySet(); for (String k : weather) { if(w.contains(k)){ double floatRate = jsonObject.getDouble(k); for (Object o : ws) { JSONObject ele = JSONObject.parseObject(o.toString()); if(w.contains(ele.getString("weatherType"))){ double floatRate = jsonObject.getDouble("ratio"); priceRate = new BigDecimal(priceRate).add(new BigDecimal(floatRate)).doubleValue(); break; } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/controller/XpCruiseCheckInRuleController.java
@@ -2,8 +2,10 @@ import com.xiaopeng.api.model.maintenance.XpCruiseCheckInRecord; import com.xiaopeng.api.model.operation.SysOperLog; import com.xiaopeng.api.vo.account.LoginOperationUser; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.utils.poi.ExcelUtil; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.common.security.service.TokenService; import com.xiaopeng.maintenance.model.vo.AppXpCruiseCheckInLocationVo; @@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.util.List; /** @@ -116,4 +119,13 @@ return R.ok(xpCruiseCheckInRecordService.statistics(query)); } @ApiOperation(value = "查询巡游打卡记录列表导出", tags = {"管理后台-巡游打卡管理"}) @PostMapping("/maintenance-admin/api/v1/cruiseCheckInRecord/export") public R<PageInfo<XpCruiseCheckInRecordVO>> pageListExport(@RequestBody XpCruiseCheckInRecordQuery query, HttpServletResponse response) { List<XpCruiseCheckInRecordVO> list = xpCruiseCheckInRecordService.all(query); ExcelUtil<XpCruiseCheckInRecordVO> util = new ExcelUtil<>(XpCruiseCheckInRecordVO.class); util.exportExcel(response, list, "巡游打卡记录"); return R.ok(); } } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/mapper/XpCruiseCheckInRecordMapper.java
@@ -14,7 +14,9 @@ List<XpCruiseCheckInRecordVO> selectCruiseCheckInRecordList(@Param("pageInfo") PageInfo<XpCruiseCheckInRecordVO> pageInfo, @Param("query") XpCruiseCheckInRecordQuery query); XpCruiseCheckInRecordVO detail(Long id); XpCruiseCheckInRecordVO detail(@Param("id")Long id); XpCruiseCheckInRecordVO selectCruiseCheckInStatistics(XpCruiseCheckInStatisticsQuery query); XpCruiseCheckInRecordVO selectCruiseCheckInStatistics(@Param("userIds") XpCruiseCheckInStatisticsQuery query); List<XpCruiseCheckInRecordVO> selectCruiseCheckInRecordList(@Param("query") XpCruiseCheckInRecordQuery query); } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/IXpCruiseCheckInRecordService.java
@@ -7,6 +7,8 @@ import com.xiaopeng.maintenance.vo.XpCruiseCheckInRecordVO; import com.xiaopeng.maintenance.vo.XpCruiseCheckInStatisticsQuery; import java.util.List; public interface IXpCruiseCheckInRecordService extends IService<XpCruiseCheckInRecord> { PageInfo<XpCruiseCheckInRecordVO> pageList(XpCruiseCheckInRecordQuery query); @@ -14,4 +16,6 @@ XpCruiseCheckInRecordVO detail(Long id); XpCruiseCheckInRecordVO statistics(XpCruiseCheckInStatisticsQuery query); List<XpCruiseCheckInRecordVO> all(XpCruiseCheckInRecordQuery query); } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRecordServiceImpl.java
@@ -1,6 +1,8 @@ package com.xiaopeng.maintenance.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xiaopeng.api.feignClient.account.XpOperationsUserClient; import com.xiaopeng.api.model.account.XpOperationsUser; import com.xiaopeng.api.model.maintenance.XpCruiseCheckInRecord; import com.xiaopeng.common.core.web.page.PageInfo; import com.xiaopeng.maintenance.mapper.XpCruiseCheckInRecordMapper; @@ -11,7 +13,11 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; @Service public class XpCruiseCheckInRecordServiceImpl extends ServiceImpl<XpCruiseCheckInRecordMapper, XpCruiseCheckInRecord> implements IXpCruiseCheckInRecordService { @@ -19,21 +25,83 @@ @Resource private XpCruiseCheckInRecordMapper xpCruiseCheckInRecordMapper; @Resource private XpOperationsUserClient xpOperationsUserClient; @Override public PageInfo<XpCruiseCheckInRecordVO> pageList(XpCruiseCheckInRecordQuery query) { PageInfo<XpCruiseCheckInRecordVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); List<XpCruiseCheckInRecordVO> list = xpCruiseCheckInRecordMapper.selectCruiseCheckInRecordList(pageInfo, query); pageInfo.setRecords(list); List<Long> ids = list.stream().map(XpCruiseCheckInRecordVO::getOperationsUserId).collect(Collectors.toList()); List<XpOperationsUser> xpOperationsUsers = xpOperationsUserClient.listByIds(ids).getData(); Map<Long, XpOperationsUser> userMap = xpOperationsUsers.stream().collect(Collectors.toMap(XpOperationsUser::getId, Function.identity())); list.forEach(record -> { XpOperationsUser user = userMap.get(record.getOperationsUserId()); if (user != null) { record.setOperationsUserId(user.getId()); record.setOperationsUserName(user.getNickName()); record.setPhoneNumber(user.getPhoneNumber()); } }); return pageInfo; } @Override public XpCruiseCheckInRecordVO detail(Long id) { XpCruiseCheckInRecordVO vo = xpCruiseCheckInRecordMapper.detail(id); List<Long> ids = Collections.singletonList(vo.getOperationsUserId()); List<XpOperationsUser> xpOperationsUsers = xpOperationsUserClient.listByIds(ids).getData(); Map<Long, XpOperationsUser> userMap = xpOperationsUsers.stream().collect(Collectors.toMap(XpOperationsUser::getId, Function.identity())); XpOperationsUser user = userMap.get(vo.getOperationsUserId()); if (user != null) { vo.setOperationsUserId(user.getId()); vo.setOperationsUserName(user.getNickName()); vo.setPhoneNumber(user.getPhoneNumber()); } return xpCruiseCheckInRecordMapper.detail(id); } @Override public XpCruiseCheckInRecordVO statistics(XpCruiseCheckInStatisticsQuery query) { return xpCruiseCheckInRecordMapper.selectCruiseCheckInStatistics(query); XpCruiseCheckInRecordVO vo = xpCruiseCheckInRecordMapper.selectCruiseCheckInStatistics(query); List<Long> ids = Collections.singletonList(vo.getOperationsUserId()); List<XpOperationsUser> xpOperationsUsers = xpOperationsUserClient.listByIds(ids).getData(); Map<Long, XpOperationsUser> userMap = xpOperationsUsers.stream().collect(Collectors.toMap(XpOperationsUser::getId, Function.identity())); XpOperationsUser user = userMap.get(vo.getOperationsUserId()); if (user != null) { vo.setOperationsUserId(user.getId()); vo.setOperationsUserName(user.getNickName()); vo.setPhoneNumber(user.getPhoneNumber()); } return vo; } @Override public List<XpCruiseCheckInRecordVO> all(XpCruiseCheckInRecordQuery query) { List<XpCruiseCheckInRecordVO> list = xpCruiseCheckInRecordMapper.selectCruiseCheckInRecordList(query); List<Long> ids = list.stream().map(XpCruiseCheckInRecordVO::getOperationsUserId).collect(Collectors.toList()); List<XpOperationsUser> xpOperationsUsers = xpOperationsUserClient.listByIds(ids).getData(); Map<Long, XpOperationsUser> userMap = xpOperationsUsers.stream().collect(Collectors.toMap(XpOperationsUser::getId, Function.identity())); list.forEach(record -> { XpOperationsUser user = userMap.get(record.getOperationsUserId()); if (user != null) { record.setOperationsUserId(user.getId()); record.setOperationsUserName(user.getNickName()); record.setPhoneNumber(user.getPhoneNumber()); } }); return list; } } xp-robotaxi-maintenance-boot/src/main/resources/mapper/maintenance/XpCruiseCheckInRecordMapper.xml
@@ -42,7 +42,6 @@ r.scene_photo, r.scene_description FROM xp_cruise_check_in_record r LEFT JOIN xp_operations_user u ON r.operations_user_id = u.id AND u.is_deleted = '0' LEFT JOIN xp_check_location cl ON r.check_location_id = cl.id AND cl.is_deleted = '0' LEFT JOIN xp_cruise_check_in_rule cr ON r.cruise_check_in_rule_id = cr.id AND cr.is_deleted = '0' WHERE r.is_deleted = '0' @@ -80,8 +79,6 @@ SELECT r.id, r.operations_user_id, u.nick_name AS operations_user_name, u.phone_number, r.check_location_id, cl.location_address, r.cruise_check_in_rule_id, @@ -92,7 +89,6 @@ r.scene_photo, r.scene_description FROM xp_cruise_check_in_record r LEFT JOIN xp_operations_user u ON r.operations_user_id = u.id AND u.is_deleted = '0' LEFT JOIN xp_check_location cl ON r.check_location_id = cl.id AND cl.is_deleted = '0' LEFT JOIN xp_cruise_check_in_rule cr ON r.cruise_check_in_rule_id = cr.id AND cr.is_deleted = '0' WHERE r.id = #{id} @@ -108,7 +104,6 @@ COUNT(CASE WHEN r.field_situation = 2 THEN 1 END) AS traffic FROM xp_cruise_check_in_record r LEFT JOIN xp_cruise_check_in_rule cr ON r.cruise_check_in_rule_id = cr.id AND cr.is_deleted = '0' LEFT JOIN xp_operations_user u ON r.operations_user_id = u.id AND u.is_deleted = '0' LEFT JOIN xp_fleet_operations fo ON u.id = fo.operationsUserId LEFT JOIN xp_fleet f ON fo.fleetId = f.id WHERE r.is_deleted = '0' xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/controller/XpVehicleController.java
@@ -1170,8 +1170,8 @@ */ @ApiOperation(value = "周围车辆点位查询", notes = "", tags = {"小程序-周围车辆点位查询"}) @GetMapping("/api/v1/mini-program/vehicle/nearby") @XpClientCheck(checkToken = false, checkOtpToken = true) public R<List<XpVehicleVO>> carAround(@RequestParam double lon,@RequestParam double lat,HttpServletRequest request) { @XpClientCheck(checkToken = false) public R<List<XpVehicleVO>> carAround(@RequestParam double lon,@RequestParam double lat) { Point point = new Point(lon, lat); Distance distance = new Distance(3, Metrics.KILOMETERS);