| | |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpFleetVehicle; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicleAnnualRecord; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandCallbackVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | private final XpChargingRecordClient xpChargingRecordClient; |
| | | private final XpTaskClient xpTaskClient; |
| | | private final XpTaskRuleClient xpTaskRuleClient; |
| | | private final MongoTemplate mongoTemplate; |
| | | /** |
| | | * 根据ID列表批量查询车辆信息(内部接口) |
| | | * |
| | |
| | | /** |
| | | * 导出在库车辆列表 |
| | | * |
| | | * @param query 查询参数 |
| | | */ |
| | | @ApiOperation(value = "下载导入模板", tags = {"管理后台-车辆管理-在库车辆管理"}) |
| | | @PostMapping("/api/v1/vehicle/importTemplate") |
| | |
| | | } |
| | | } |
| | | } |
| | | // 查询车辆的续航里程 |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicleVO.getVehicleVin())), VehiclePosition.class); |
| | | if(Objects.nonNull(vehiclePosition)){ |
| | | xpVehicleVO.setMileageRange(vehiclePosition.getMileageRange()); |
| | | xpVehicleVO.setCurrentElectricity(vehiclePosition.getCurrentElectricity()); |
| | | }else { |
| | | xpVehicleVO.setMileageRange(0F); |
| | | xpVehicleVO.setCurrentElectricity(0); |
| | | } |
| | | return R.ok(xpVehicleVO); |
| | | } |
| | | |