Commit a1df0268 authored by caotao's avatar caotao

车辆统计接口调整优化

parent 9bc23146
...@@ -1444,8 +1444,8 @@ public class CarController extends AbstractBaseController { ...@@ -1444,8 +1444,8 @@ public class CarController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarAreaInfo", method = RequestMethod.GET) @RequestMapping(value = "/getCarAreaInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-获取片区车辆归属信息接口", notes = "车辆统计-获取片区车辆归属信息接口") @ApiOperation(httpMethod = "GET", value = "车辆统计-获取片区车辆归属信息接口", notes = "车辆统计-获取片区车辆归属信息接口")
public Page<CarAreaInfoDto> getCarAreaInfo(@RequestParam Long id) { public Page<CarAreaInfoDto> getCarAreaInfo(@RequestParam String areaName) {
return iCarService.getCarAreaInfo(id); return iCarService.getCarAreaInfo(areaName);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarMileageInfoByMoth", method = RequestMethod.GET) @RequestMapping(value = "/getCarMileageInfoByMoth", method = RequestMethod.GET)
...@@ -1455,11 +1455,16 @@ public class CarController extends AbstractBaseController { ...@@ -1455,11 +1455,16 @@ public class CarController extends AbstractBaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/exportCarMileageInfoByMoth", method = RequestMethod.GET) @RequestMapping(value = "/exportCarMileageInfoByMoth", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "车辆统计-按照月份统计车辆里程", notes = "车辆统计-按照月份统计车辆里程") @ApiOperation(httpMethod = "GET", value = "车辆统计-按照月份统计导出车辆里程", notes = "车辆统计-按照月份统计导出车辆里程")
public void exportCarMileageInfoByMoth(@RequestParam String date, HttpServletResponse response) { public void exportCarMileageInfoByMoth(@RequestParam String date,@RequestParam String value, HttpServletResponse response) {
if(value!=null){
List<CarExportDto> list = this.iCarService.exportCarMileageInfoByMoth(date); List<CarExportDto> list = this.iCarService.exportCarMileageInfoByMoth(date);
String name = "车辆里程月度统计表-"+date; String name = "车辆里程月度统计表-"+date;
FileHelper.exportExcel(list,name,name,CarExportDto.class,UUID.randomUUID().toString()+".xls",response); FileHelper.exportExcel(list,name,name,CarExportDto.class,UUID.randomUUID().toString()+".xls",response);
}else{
response.setHeader("content-Type", null);
}
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@RequestMapping(value = "/getCarMileageInfoByMothOFDay", method = RequestMethod.GET) @RequestMapping(value = "/getCarMileageInfoByMothOFDay", method = RequestMethod.GET)
......
...@@ -202,7 +202,7 @@ public interface ICarService extends IService<Car> { ...@@ -202,7 +202,7 @@ public interface ICarService extends IService<Car> {
Page<CarEquipStateInfoDto> getCarEquipStateInfo(); Page<CarEquipStateInfoDto> getCarEquipStateInfo();
Page<CarEquipAlarmInfoDto> getCarEquipAlarmInfoDto(); Page<CarEquipAlarmInfoDto> getCarEquipAlarmInfoDto();
List<ChartIntegerDto>getCarBelongAreaInfo() ; List<ChartIntegerDto>getCarBelongAreaInfo() ;
Page<CarAreaInfoDto> getCarAreaInfo(Long id ) ; Page<CarAreaInfoDto> getCarAreaInfo(String areaName ) ;
Page<MileageDto> getCarMileageInfoByMoth(String date); Page<MileageDto> getCarMileageInfoByMoth(String date);
List<CarExportDto> exportCarMileageInfoByMoth(String date); List<CarExportDto> exportCarMileageInfoByMoth(String date);
ZZChartsDto getCarMileageInfoByMothOFDay(String iotCode); ZZChartsDto getCarMileageInfoByMothOFDay(String iotCode);
......
...@@ -1826,10 +1826,12 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS ...@@ -1826,10 +1826,12 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
} }
@Override @Override
public Page<CarAreaInfoDto> getCarAreaInfo( Long id) { public Page<CarAreaInfoDto> getCarAreaInfo( String areaName) {
Page<CarAreaInfoDto> page = new Page<>(); Page<CarAreaInfoDto> page = new Page<>();
List<CarAreaInfoDto> list = new ArrayList<>(); List<CarAreaInfoDto> list = new ArrayList<>();
FeignClientResult<java.util.Collection<CompanyModel>> de = Privilege.companyClient.querySubAgencyTree(id); CompanyModel companyModelArea= Privilege.companyClient.queryByCompanyName(areaName).getResult();
if(companyModelArea!=null){
FeignClientResult<java.util.Collection<CompanyModel>> de = Privilege.companyClient.querySubAgencyTree(companyModelArea.getSequenceNbr());
//如果是公司则获取所有片区 //如果是公司则获取所有片区
ArrayList<CompanyModel> companyModels = (ArrayList<CompanyModel>) de.getResult(); ArrayList<CompanyModel> companyModels = (ArrayList<CompanyModel>) de.getResult();
if (companyModels.size() >0 ) { if (companyModels.size() >0 ) {
...@@ -1843,6 +1845,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS ...@@ -1843,6 +1845,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
list.add(carAreaInfoDto); list.add(carAreaInfoDto);
} }
} }
}
page.setRecords(list); page.setRecords(list);
page.setTotal(list.size()); page.setTotal(list.size());
page.setCurrent(1); page.setCurrent(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment