| | |
| | | .apply("to_days(done_date) = to_days(now())") ); |
| | | if(jobs!=null){ |
| | | for(PlatformJob j :jobs){ |
| | | num =num.add(Constants.formatBigdecimal(j.getTotalNum())); |
| | | if(Objects.nonNull(j)&&Objects.nonNull(j.getTotalNum())){ |
| | | num =num.add(Constants.formatBigdecimal(j.getTotalNum())); |
| | | } |
| | | |
| | | } |
| | | } |
| | | }else{ |
| | |
| | | , Constants.PlatformJobStatus.LEAVED.getKey()) ); |
| | | if(jobs!=null){ |
| | | for(PlatformJob j :jobs){ |
| | | num = num.add(Constants.formatBigdecimal(j.getTotalNum())); |
| | | if(Objects.nonNull(j)&&Objects.nonNull(j.getTotalNum())){ |
| | | num = num.add(Constants.formatBigdecimal(j.getTotalNum())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | BaseResponse<CamerasPreviewURLsResponse> result = HKService.cameraPreviewURLs(request); |
| | | if(result!=null && StringUtils.equals(result.getCode(),HKConstants.RESPONSE_SUCCEE) && result.getData()!=null){ |
| | | return result.getData().getUrl(); |
| | | |
| | | } |
| | | return null; |
| | | } |
| | |
| | | .selectAs(PlatformJob::getId,PlatformJob::getId) |
| | | .selectAs(PlatformJob::getCreateDate,PlatformJob::getCreateDate) |
| | | .selectAs(PlatformJob::getTotalNum,PlatformJob::getTotalNum) |
| | | .selectAs(PlatformJob::getStatus,PlatformJob::getStatus) |
| | | // .select("select sum(io_qty) from platform_wms_details a where a.isdeleted=0 and a.job_id=t.id",create_date) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .apply(queryType==0,"to_days(create_date) >= to_days(now()) -7") |
| | |
| | | */ |
| | | @Override |
| | | public EnergyBoardVO centerEnergyData(){ |
| | | EnergyBoardVO data = new EnergyBoardVO(); |
| | | Random random = new Random(); |
| | | EnergyBoardVO data = new EnergyBoardVO(); |
| | | Random random = new Random(); |
| | | PlatformWaterGas smoke= platformWaterGasMapper.selectOne(new QueryWrapper<PlatformWaterGas>() |
| | | .select("sum(num) as num") |
| | | .lambda() |
| | |
| | | } |
| | | if( data.getGasQuantity().getTotalNum().compareTo(new BigDecimal(0)) !=0){ |
| | | //计算用气同比环比 |
| | | data.getGasQuantity().setSameRate(Constants.formatBigdecimal4Float(data.getGasQuantity().getSameNum().divide(data.getGasQuantity().getTotalNum(),4,BigDecimal.ROUND_HALF_UP)).doubleValue()*100 +""); |
| | | data.getGasQuantity().setRingRate(Constants.formatBigdecimal4Float(data.getGasQuantity().getRingNum().divide(data.getGasQuantity().getTotalNum(),4,BigDecimal.ROUND_HALF_UP)).doubleValue()*100 +""); |
| | | data.getGasQuantity().setSameRate( |
| | | (data.getGasQuantity().getTotalNum().subtract(data.getGasQuantity().getSameNum())).divide(data.getGasQuantity().getSameNum()).doubleValue()*100 +"" |
| | | /*Constants.formatBigdecimal4Float(data.getGasQuantity().getSameNum() |
| | | .divide(data.getGasQuantity().getTotalNum(),4,BigDecimal.ROUND_HALF_UP)).doubleValue()*100 +""*/); |
| | | data.getGasQuantity().setRingRate( |
| | | (data.getGasQuantity().getTotalNum().subtract(data.getGasQuantity().getRingNum())).divide(data.getGasQuantity().getRingNum()).doubleValue()*100 +"" |
| | | //Constants.formatBigdecimal4Float(data.getGasQuantity().getRingNum().divide(data.getGasQuantity().getTotalNum(),4,BigDecimal.ROUND_HALF_UP)).doubleValue()*100 +"" |
| | | ); |
| | | } |
| | | if( data.getWaterQuantity().getTotalNum().compareTo(new BigDecimal(0)) !=0){ |
| | | // //计算用水同比环比 |
| | |
| | | * @param data |
| | | */ |
| | | private void getLastMonthElectricityData(EnergyModelDataVO data) { |
| | | BaseResponse<LastMonthFeeByMeterTypeResponse> response = HKService.lastMonthFeeByMeterType("1"); |
| | | // BaseResponse<LastMonthFeeByMeterTypeResponse> response = HKService.lastMonthFeeByMeterType("1"); |
| | | // if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){ |
| | | // data.setRingRate(StringUtils.defaultString(response.getData().getRingPercent(),"0")); |
| | | // data.setSameRate(StringUtils.defaultString(response.getData().getSamePercent(),"0")); |
| | |
| | | * @param data |
| | | */ |
| | | private void getCurrentDateElectircityData(EnergyModelDataVO data,int days) { |
| | | EnergyTrendRequest param = new EnergyTrendRequest(); |
| | | param.setDate(DateUtil.getFomartDate(DateUtil.addDaysToDate(new Date(),days),"yyyy-MM-dd"));//日期 |
| | | param.setMeterType(1); |
| | | param.setShowType("4"); |
| | | param.setNodeType(2); |
| | | param.setNodeId("root000000"); |
| | | // EnergyTrendRequest param = new EnergyTrendRequest(); |
| | | // param.setDate(DateUtil.getFomartDate(DateUtil.addDaysToDate(new Date(),days),"yyyy-MM-dd"));//日期 |
| | | // param.setMeterType(1); |
| | | // param.setShowType("4"); |
| | | // param.setNodeType(2); |
| | | // param.setNodeId("root000000"); |
| | | // 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 ){ |
| | | // 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.setTotal(Constants.formatBigdecimal2Float(total).toString()); |
| | | EnergyTotalDataRequest param = new EnergyTotalDataRequest(); |
| | | 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 ){ |
| | | 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"))); |
| | | } |
| | | |
| | | param.setDate(DateUtil.getFomartDate(DateUtil.addDaysToDate(new Date(),days),"yyyy-MM-dd")); |
| | | BaseResponse<EnergyTotalDataResponse> beforMonthResponse = HKService.energyTotal(param); |
| | | if(beforMonthResponse != null && StringUtils.equals(beforMonthResponse.getCode(), HKConstants.RESPONSE_SUCCEE) && beforMonthResponse.getData()!=null ){ |
| | | data.setTotal(beforMonthResponse.getData().getElectricity()); |
| | | data.setTotalNum(new BigDecimal(beforMonthResponse.getData().getElectricity())); |
| | | } |
| | | data.setTotal(Constants.formatBigdecimal2Float(total).toString()); |
| | | } |
| | | |
| | | private EnergyModelDataVO getDefaultData() { |
| | |
| | | .last(" group by DATE_FORMAT(TIME_INFO,'%Y-%m')") |
| | | ); |
| | | for (int i = 0; i < 12; i++) { |
| | | Date tempDate = DateUtil.increaseMonth(lastMonth,i); |
| | | Date tempDate = DateUtil.increaseMonth(lastMonth,i); |
| | | EnergyDataVO data = new EnergyDataVO(); |
| | | data.setTimeData(DateUtil.getFomartDate(tempDate,"YYYY-MM")); |
| | | data.setEnergy(new BigDecimal(0)); |
| | |
| | | (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&Objects.isNull(i.getCompanyType())).count() |
| | | ); |
| | | //在园车辆 |
| | | data.setInternalCarTotal( |
| | | data.setInParkCarTotal( |
| | | (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)).count() |
| | | ); |
| | | //在园相关方车辆 |
| | |
| | | data.setReservationCar(data.getReservationCar()+Constants.formatIntegerNum(model.getCountum())); |
| | | data.setCalledNum(data.getCalledNum()+Constants.formatIntegerNum(model.getCountum())); |
| | | data.setWorkedNum(data.getWorkedNum()+Constants.formatIntegerNum(model.getCountum())); |
| | | data.setWorkingCar(data.getWorkingCar()+Constants.formatIntegerNum(model.getCountum())); |
| | | } |
| | | // 作业完成(预约车、签到数、已叫号、作业车、已完成) |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.PlatformJobStatus.DONE.getKey())){ |
| | |
| | | } |
| | | // 已离园 |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.PlatformJobStatus.LEAVED.getKey())){ |
| | | data.setWorkingCar(data.getWorkingCar()+Constants.formatIntegerNum(model.getCountum())); |
| | | // data.setWorkingCar(data.getWorkingCar()+Constants.formatIntegerNum(model.getCountum())); |
| | | } |
| | | // 已过号(预约车、签到数、排队车) |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.PlatformJobStatus.OVER_NUMBER.getKey())){ |
| | |
| | | } |
| | | BaseResponse<List<RegionDataRankingDataResponse>> response = HKService.regionDataRanking(request); |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){ |
| | | return response.getData(); |
| | | List<RegionDataRankingDataResponse> regionDataRankingDataResponseList = new ArrayList<>(); |
| | | for (RegionDataRankingDataResponse regionDataRankingDataResponse:response.getData()) { |
| | | if(StringUtils.isNotBlank(regionDataRankingDataResponse.getPercent())){ |
| | | if(Constants.equalsInteger(Integer.valueOf(new BigDecimal(regionDataRankingDataResponse.getPercent()).intValue()),Constants.ONE)){ |
| | | continue; |
| | | } |
| | | regionDataRankingDataResponseList.add(regionDataRankingDataResponse); |
| | | } |
| | | } |
| | | return regionDataRankingDataResponseList; |
| | | }else{ |
| | | return null; |
| | | } |