Commit c8a7ee45 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_dl' into develop_dl

parents 73211926 a1df0268
...@@ -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) {
List<CarExportDto> list = this.iCarService.exportCarMileageInfoByMoth(date); if(value!=null){
String name = "车辆里程月度统计表-"+date; List<CarExportDto> list = this.iCarService.exportCarMileageInfoByMoth(date);
FileHelper.exportExcel(list,name,name,CarExportDto.class,UUID.randomUUID().toString()+".xls",response); String name = "车辆里程月度统计表-"+date;
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,23 +1826,26 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS ...@@ -1826,23 +1826,26 @@ 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){
ArrayList<CompanyModel> companyModels = (ArrayList<CompanyModel>) de.getResult(); FeignClientResult<java.util.Collection<CompanyModel>> de = Privilege.companyClient.querySubAgencyTree(companyModelArea.getSequenceNbr());
if (companyModels.size() >0 ) { //如果是公司则获取所有片区
for (int i = 0; i < companyModels.size(); i++) { ArrayList<CompanyModel> companyModels = (ArrayList<CompanyModel>) de.getResult();
CompanyModel companyModel = companyModels.get(i); if (companyModels.size() >0 ) {
CarAreaInfoDto carAreaInfoDto = new CarAreaInfoDto(); for (int i = 0; i < companyModels.size(); i++) {
Integer count = this.count(new QueryWrapper<Car>().like("biz_org_code", companyModel.getOrgCode())); CompanyModel companyModel = companyModels.get(i);
carAreaInfoDto.setNo(i+1); CarAreaInfoDto carAreaInfoDto = new CarAreaInfoDto();
carAreaInfoDto.setName(companyModel.getCompanyName()); Integer count = this.count(new QueryWrapper<Car>().like("biz_org_code", companyModel.getOrgCode()));
carAreaInfoDto.setCountOfCar(count); carAreaInfoDto.setNo(i+1);
list.add(carAreaInfoDto); carAreaInfoDto.setName(companyModel.getCompanyName());
} carAreaInfoDto.setCountOfCar(count);
} 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