| | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.cars.response.CarsAlarmResultListResponse; |
| | | import com.doumee.core.haikang.model.cars.response.CarsDeviceDetaisResponse; |
| | | import com.doumee.core.haikang.model.param.BaseListPageRequest; |
| | | import com.doumee.core.haikang.model.param.BaseListPageResponse; |
| | |
| | | public BoardCarsListVO platformJobCarsList(){ |
| | | BoardCarsListVO data = new BoardCarsListVO(); |
| | | List<CarsDeviceDetaisResponse> detaisResponses = HKCarOpenService.getAllCarsDetais(); |
| | | List<CarsAlarmResultListResponse> eventList = HKCarOpenService.getAlarmEvemtList(detaisResponses,new Date()); |
| | | data.setCarsList(detaisResponses); |
| | | if(data.getCarsList()!=null && data.getCarsList().size()>0){ |
| | | List<String> codes = new ArrayList<>(); |
| | |
| | | int online = 0; |
| | | for(CarsDeviceDetaisResponse model:detaisResponses){ |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.ONE) ||Constants.equalsInteger(model.getStatus(),Constants.TWO)){ |
| | | //如果是在线或者休眠,查询在途还是空闲 |
| | | //如果是在线或者休眠,查询在途还是空闲ty |
| | | codes.add(model.getPlateNum()); |
| | | }else |
| | | data.setOfflineNum(data.getOfflineNum()+1); |
| | |
| | | 3) 自来水二氧化碳排放量(kg)=自来水使用量(m3)×0.91;*/ |
| | | data.setCarbon(Constants.formatBigdecimal2Float((carbonElec.multiply(new BigDecimal(0.785))) |
| | | .add(carbonGas.multiply(new BigDecimal(0.19))) |
| | | .add(carbonWater.multiply(new BigDecimal(0.91))))); |
| | | .add(carbonWater.multiply(new BigDecimal(0.91)))).divide(new BigDecimal(1000),2,BigDecimal.ROUND_HALF_UP)); |
| | | return data; |
| | | |
| | | } |
| | |
| | | param.setPeriodType("day"); |
| | | BigDecimal total = new BigDecimal(0); |
| | | BaseResponse<EnergyTrendResponse> response = HKService.energyTrend(param); |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null&& response.getData().getYvalues()!=null ){ |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) |
| | | && response.getData()!=null&& response.getData().getYvalues()!=null ){ |
| | | for (int i = 0; i < response.getData().getYvalues().get(0).getValue().length; i++) { |
| | | total = total.add(new BigDecimal(StringUtils.defaultString( response.getData().getYvalues().get(0).getValue()[i],"0"))); |
| | | } |
| | |
| | | data.setRingPercent("0"); |
| | | data.setSecondRegionDataList(new ArrayList<>()); |
| | | } |
| | | return data; |
| | | if(data.getSecondRegionDataList()!=null && data.getSecondRegionDataList().size()>1){ |
| | | int index =-1; |
| | | for (int i = 0; i <data.getSecondRegionDataList().size() ; i++) { |
| | | RegionTopPowerResponse t=data.getSecondRegionDataList().get(i); |
| | | if(Constants.formatBigdecimal(t.getPercent()).compareTo(new BigDecimal(1)) == 0){ |
| | | index =i; |
| | | break; |
| | | } |
| | | } |
| | | if(index>-1){ |
| | | data.getSecondRegionDataList().remove(index);//删除根节点数据 |
| | | } |
| | | } |
| | | |
| | | return data; |
| | | } |
| | | /** |
| | | * 近12个水电气油耗数据统计 |