| | |
| | | import com.doumee.service.business.third.BoardService; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | public class BoardServiceImpl implements BoardService { |
| | | @Autowired |
| | | private PlatformLogMapper platformLogMapper; |
| | | @Autowired |
| | | private HiddenDangerMapper hiddenDangerMapper; |
| | | @Autowired |
| | | private PlatformWaterGasMapper platformWaterGasMapper; |
| | | @Autowired |
| | |
| | | List<EnergyDataVO> loadCurveList = new ArrayList<>(); |
| | | try { |
| | | BaseResponse<List<EnergyTodayLoadDataResponse>> response = HKService.energyTodayLoadData(); |
| | | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) || response.getData()==null ){ |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){ |
| | | for (EnergyTodayLoadDataResponse model :response.getData()) { |
| | | EnergyDataVO data = new EnergyDataVO(); |
| | | data.setTimeData(model.getName()); |
| | | data.setEnergy(new BigDecimal(model.getName())); |
| | | data.setEnergy(new BigDecimal(StringUtils.defaultString(model.getValue(),"0"))); |
| | | loadCurveList.add(data); |
| | | } |
| | | } |
| | |
| | | return oilDataVOList; |
| | | } |
| | | |
| | | /** |
| | | * 【消防管控】看板-本年和本月新增消防设备/设施维护情况 |
| | | * @return |
| | | * |
| | | */ |
| | | @Override |
| | | public List<AlarmEventDataVO> fightingAdminAlertList(){ |
| | | List<AlarmEventDataVO> data = new ArrayList<>(); |
| | | |
| | | //查询24小时内的 |
| | | FindHomeAlarmInfoPageRequest param = new FindHomeAlarmInfoPageRequest(); |
| | | param.setHour(24); |
| | | param.setPage(1); |
| | | param.setAlarmStartTime(DateUtil.getPlusTime2(DateUtil.addDaysToDate(new Date(),-1))); |
| | | param.setAlarmEndTime(DateUtil.getPlusTime2(new Date())); |
| | | param.setPageSize(20); |
| | | BaseResponse<BaseListPageResponse<FindHomeAlarmInfoPageResponse>> response = HKService.findHomeAlarmInfoPage(param); |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) |
| | | && response.getData()!=null |
| | | &&response.getData().getList()!=null) { |
| | | for(FindHomeAlarmInfoPageResponse r : response.getData().getList()){ |
| | | AlarmEventDataVO t = new AlarmEventDataVO(); |
| | | BeanUtils.copyProperties(r,t); |
| | | data.add(t); |
| | | } |
| | | } |
| | | return data; |
| | | |
| | | } |
| | | /** |
| | | * 【消防管控】看板-实时监测数据 |
| | | * @return |
| | | * |
| | | */ |
| | | @Override |
| | | public List<MonitorDataVO> monitorDataList(){ |
| | | List<MonitorDataVO> list = new ArrayList<>(); |
| | | MinitorDataSearchRequest param = new MinitorDataSearchRequest(); |
| | | param.setResourceTypeCodes(new String[]{}); |
| | | param.setRegionIndexCode("root0001"); |
| | | param.setIncludeDown("1"); |
| | | param.setUserId("admin"); |
| | | BaseResponse<BaseListPageResponse<MonitorDataSearchResponse>> response = HKService.minitorDataSearch(param); |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) |
| | | && response.getData()!=null ) { |
| | | List<MonitorDataSearchResponse> r = response.getData().getList(); |
| | | if(r!= null){ |
| | | for(MonitorDataSearchResponse model : r){ |
| | | MonitorDataVO m = new MonitorDataVO(); |
| | | m.setName(model.getName()); |
| | | m.setDataList(new ArrayList<>()); |
| | | if(model.getValues()!=null){ |
| | | for(MonitorDataValResponse v : model.getValues()){ |
| | | MonitorDataInfoVO vm = new MonitorDataInfoVO(); |
| | | vm.setValue(v.getMonitorValue()); |
| | | vm.setCateName(v.getMonitorSpecificName()); |
| | | vm.setCateCode(v.getMonitorTypeKey()); |
| | | vm.setTypeCode(v.getMonitorTypeCode()); |
| | | vm.setTypeName(v.getMonitorTypeName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 【消防管控】看板-告警处理分析集合 |
| | | * @return |
| | | * |
| | | */ |
| | | @Override |
| | | public List<AlarmDataVO> fightingAlarmHandleData(){ |
| | | List<AlarmDataVO> alarmHandleDataVOList = new ArrayList<>(); |
| | | Date now = DateUtil.getStartOfDay(new Date()); |
| | | for (int i = 1; i < 12; i++) { |
| | | Date start = DateUtil.addMonthToDate(now,-12+i); |
| | | Date end = DateUtil.addMonthToDate(now,-11+i); |
| | | AlarmDataVO t = getAlertDataByStartEndTime(DateUtil.getPlusTime2(start),DateUtil.getPlusTime2(end)); |
| | | alarmHandleDataVOList.add(t); |
| | | } |
| | | return alarmHandleDataVOList; |
| | | } |
| | | /** |
| | | * 【消防管控】看板-告警信息集合 |
| | | * |
| | | * @return |
| | | * |
| | | */ |
| | | @Override |
| | | public AlarmDataVO alarmDataSumByCate(){ |
| | | AlarmDataVO alarmDataVO = getAlertDataByStartEndTime(DateUtil.getPlusTime2(DateUtil.addDaysToDate(new Date(),-1)) |
| | | ,(DateUtil.getPlusTime2(new Date()))); |
| | | return alarmDataVO; |
| | | } |
| | | |
| | | public static AlarmDataVO getAlertDataByStartEndTime(String start,String end){ |
| | | AlarmDataVO alarmDataVO = new AlarmDataVO(); |
| | | FindAlarmBaseDataStatisticRequest param = new FindAlarmBaseDataStatisticRequest(); |
| | | param.setAlarmStartTime(start); |
| | | param.setAlarmEndTime(end); |
| | | param.setUserId("admin"); |
| | | BaseResponse<FindAlarmBaseDataStatisticResponse> response = HKService.findAlarmBaseDataStatistic(param); |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) |
| | | && response.getData()!=null ) { |
| | | alarmDataVO.setTotalNum(Constants.formatIntegerNum(response.getData().getTotalAlarmNum())); |
| | | alarmDataVO.setRealNum(Constants.formatIntegerNum(response.getData().getTotalAlarmNum())); |
| | | alarmDataVO.setErrNum(Constants.formatIntegerNum(response.getData().getMisReportAlarmNum())); |
| | | alarmDataVO.setLiftNum(Constants.formatIntegerNum(response.getData().getHandledAlarmNum())); |
| | | alarmDataVO.setProcessingNum(Constants.formatIntegerNum(response.getData().getUnHandedAlarmNum())); |
| | | alarmDataVO.setStartDate(start); |
| | | alarmDataVO.setEndDate(end); |
| | | } |
| | | return alarmDataVO; |
| | | } |
| | | /** |
| | | * 【消防管控】看板-本年和本月新增消防设备/设施维护情况 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public YearDeviceDataVO yearFightingAdminDeviceData(){ |
| | | YearDeviceDataVO data = new YearDeviceDataVO(); |
| | | |
| | | FireStatisticRequest param = new FireStatisticRequest(); |
| | | param.setIndexCode("api_fire_statistic"); |
| | | BaseResponse<FireStatisticResponse> response = HKService.fireStatistic(param); |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ) { |
| | | data.setProtectNum(Constants.formatIntegerNum(response.getData().getMaintenanceNum())); |
| | | data.setPlanProtectTotal(Constants.formatIntegerNum(response.getData().getDeviceTotalNum())); |
| | | } |
| | | |
| | | param = new FireStatisticRequest(); |
| | | param.setIndexCode("api_fire_statistic_month"); |
| | | BaseResponse<FireStatisticResponse> response1 = HKService.fireStatisticMonth(param); |
| | | if(response1 != null && StringUtils.equals(response1.getCode(), HKConstants.RESPONSE_SUCCEE) |
| | | && response1.getData()!=null ) { |
| | | data.setMonthAddNum(Constants.formatIntegerNum(response1.getData().getMaintenanceNum())); |
| | | data.setMonthTotalNum(Constants.formatIntegerNum(response1.getData().getDeviceTotalNum())); |
| | | } |
| | | return data; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 【消防管控】看板-分类和汇总的各状态设备数量 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public FightingAdminCenterDataVO centerFightingAdminData(){ |
| | | FightingAdminCenterDataVO data = new FightingAdminCenterDataVO(); |
| | | List<DeviceNumByTypeVO> list = new ArrayList<>(); |
| | | FireDevStatusTotalRequest param = new FireDevStatusTotalRequest(); |
| | | param.setIncludeBool(1); |
| | | param.setRegionIds(new String[]{"root000000"}); |
| | | BaseResponse<List<FireDevStatusListResponse>> response = HKService.getFireDevStatusList(param); |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){ |
| | | for(FireDevStatusListResponse r :response.getData()){ |
| | | DeviceNumByTypeVO t = new DeviceNumByTypeVO(); |
| | | t.setTypeName(r.getDevTypeName()); |
| | | t.setOfflineDeviceNum(Constants.formatIntegerNum(r.getOfflineFireDevCount())); |
| | | t.setAlarmDeviceNum(Constants.formatIntegerNum(r.getAlarmFireDevCount())); |
| | | t.setOnlineDeviceNum(Constants.formatIntegerNum(r.getOnlineFireDevCount())); |
| | | t.setErrDeviceNum(Constants.formatIntegerNum(r.getFaultFireDevCount())); |
| | | t.setTotalDeviceNum(Constants.formatIntegerNum(r.getTotalFireDevCount())); |
| | | list.add(t); |
| | | data.setOfflineDeviceNum(Constants.formatIntegerNum( data.getOfflineDeviceNum())+Constants.formatIntegerNum(r.getOfflineFireDevCount())); |
| | | data.setAlarmDeviceNum(Constants.formatIntegerNum( data.getAlarmDeviceNum())+Constants.formatIntegerNum(r.getAlarmFireDevCount())); |
| | | data.setOnlineDeviceNum(Constants.formatIntegerNum( data.getOnlineDeviceNum())+Constants.formatIntegerNum(r.getOnlineFireDevCount())); |
| | | data.setErrDeviceNum(Constants.formatIntegerNum( data.getErrDeviceNum())+Constants.formatIntegerNum(r.getFaultFireDevCount())); |
| | | data.setTotalDeviceNum(Constants.formatIntegerNum( data.getTotalDeviceNum())+Constants.formatIntegerNum(r.getTotalFireDevCount())); |
| | | } |
| | | } |
| | | data.setDeviceTypeList(list); |
| | | Long totalNum =hiddenDangerMapper.selectCount(new QueryWrapper<HiddenDanger>().lambda() |
| | | .eq(HiddenDanger::getIsdeleted,Constants.ZERO ) |
| | | .apply("to_day(create_data) = to_days(now())" ) ); |
| | | data.setDangerTotalNum(totalNum !=null?totalNum.intValue():0);//今日隐患数量 |
| | | totalNum =hiddenDangerMapper.selectCount(new QueryWrapper<HiddenDanger>().lambda() |
| | | .eq(HiddenDanger::getIsdeleted,Constants.ZERO ) |
| | | .in(HiddenDanger::getStatus,Constants.ONE,Constants.TWO ) |
| | | .apply("to_day(check_date) = to_days(now())" ) ); |
| | | data.setDangerDealedNum(totalNum !=null?totalNum.intValue():0);//今日处理隐患数量 |
| | | return data; |
| | | } |
| | | /** |
| | | * 用电总能耗同比、环比和区域用电量集合 |
| | | * @return |
| | |
| | | data.setGasQuantity(getDefaultData());//上月用气 |
| | | data.setMonthElectricity(getDefaultData());//本月用电 |
| | | data.setYesterdayElectricity(getDefaultData());//昨日用电 |
| | | getMonthElectricityData(data.getMonthElectricity());//通过安防平获取本月数据 |
| | | getMonthElectricityData(data.getMonthElectricity());//通过安防平获取本月用电量数据 |
| | | carbonElec = new BigDecimal(StringUtils.defaultString(data.getMonthElectricity().getTotal(), "0")); |
| | | getLastMonthElectricityData(data.getElectricityQuantity());//通过安防平获取上月数据 |
| | | String firstDate = DateUtil.getFirstDayOfThisMonth() +" 00:00:00"; |
| | | getLastMonthElectricityData(data.getElectricityQuantity());//通过安防平获取上月用电量数据 |
| | | getCurrentDateElectircityData(data.getTodayElectricity(),0);//通过安防平获取今日用电量数据 |
| | | getCurrentDateElectircityData(data.getYesterdayElectricity(),-1);//通过安防平获取昨日用电量数据 |
| | | String firstDate = DateUtil.getFirstDayCurrentMonth() +" 00:00:00"; |
| | | Date month0 = DateUtil.getDateFromString(firstDate); |
| | | Date month1 = DateUtil.increaseMonth(month0,-1);//上月 |
| | | Date month2 = DateUtil.increaseMonth(month0,-2);//上上月 |
| | | Date month3 = DateUtil.increaseMonth(month0,-12);//去年同月 |
| | | Date month3 = DateUtil.increaseMonth(month0,-13);//去年同月 |
| | | |
| | | List<PlatformWaterGas> list = platformWaterGasMapper.selectList(new QueryWrapper<PlatformWaterGas>() |
| | | .lambda() |
| | |
| | | data.getGasQuantity().setTotal(Constants.formatBigdecimal(model.getNum())+""); |
| | | } |
| | | if(model.getTimeInfo().getTime() == month2.getTime()){ |
| | | data.getGasQuantity().setSameNum(Constants.formatBigdecimal(model.getNum()) ); |
| | | data.getGasQuantity().setRingNum(Constants.formatBigdecimal(model.getNum()) ); |
| | | } |
| | | if(model.getTimeInfo().getTime() == month3.getTime()){ |
| | | data.getGasQuantity().setRingNum(Constants.formatBigdecimal(model.getNum()) ); |
| | | data.getGasQuantity().setSameNum(Constants.formatBigdecimal(model.getNum()) ); |
| | | } |
| | | |
| | | }else if(Constants.equalsInteger(model.getType(),Constants.ZERO)){ |
| | |
| | | data.getWaterQuantity().setTotal(Constants.formatBigdecimal(model.getNum())+""); |
| | | } |
| | | if(model.getTimeInfo().getTime() == month2.getTime()){ |
| | | data.getWaterQuantity().setSameNum(Constants.formatBigdecimal(model.getNum()) ); |
| | | data.getWaterQuantity().setRingNum(Constants.formatBigdecimal(model.getNum()) ); |
| | | } |
| | | if(model.getTimeInfo().getTime() == month3.getTime()){ |
| | | data.getWaterQuantity().setRingNum(Constants.formatBigdecimal(model.getNum()) ); |
| | | data.getWaterQuantity().setSameNum(Constants.formatBigdecimal(model.getNum()) ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if( data.getGasQuantity().getTotalNum().compareTo(new BigDecimal(0)) !=0){ |
| | | //计算用气同比环比 |
| | | data.getGasQuantity().setSameRate(Constants.formatBigdecimal4Float(data.getGasQuantity().getSameNum().divide(data.getGasQuantity().getTotalNum())).doubleValue()*100 +""); |
| | | data.getGasQuantity().setRingRate(Constants.formatBigdecimal4Float(data.getGasQuantity().getRingNum().divide(data.getGasQuantity().getTotalNum())).doubleValue()*100 +""); |
| | | 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 +""); |
| | | } |
| | | if( data.getWaterQuantity().getTotalNum().compareTo(new BigDecimal(0)) !=0){ |
| | | // //计算用水同比环比 |
| | | data.getWaterQuantity().setSameRate(Constants.formatBigdecimal4Float(data.getWaterQuantity().getSameNum().divide(data.getWaterQuantity().getTotalNum())).doubleValue()*100 +""); |
| | | data.getWaterQuantity().setRingRate(Constants.formatBigdecimal4Float(data.getWaterQuantity().getRingNum().divide(data.getWaterQuantity().getTotalNum())).doubleValue()*100 +""); |
| | | data.getWaterQuantity().setSameRate(Constants.formatBigdecimal4Float(data.getWaterQuantity().getSameNum().divide(data.getWaterQuantity().getTotalNum(),4,BigDecimal.ROUND_HALF_UP)).doubleValue()*100 +""); |
| | | data.getWaterQuantity().setRingRate(Constants.formatBigdecimal4Float(data.getWaterQuantity().getRingNum().divide(data.getWaterQuantity().getTotalNum(),4,BigDecimal.ROUND_HALF_UP)).doubleValue()*100 +""); |
| | | } |
| | | |
| | | /*计算碳排量,以下三个因素之和 |
| | |
| | | */ |
| | | private void getMonthElectricityData(EnergyModelDataVO data) { |
| | | BaseResponse<MonthDataByMeterTypeResponse> response = HKService.getCurrentMonthDataByMeterType("1"); |
| | | if(response != null && !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){ |
| | | 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")); |
| | | data.setTotal(StringUtils.defaultString(response.getData().getValue(),"0")); |
| | |
| | | * @param data |
| | | */ |
| | | private void getLastMonthElectricityData(EnergyModelDataVO data) { |
| | | BaseResponse<LastMonthFeeByMeterTypeResponse> response = HKService.lastMonthFeeByMeterType("1"); |
| | | if(response != null && !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){ |
| | | 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")); |
| | | data.setTotal(StringUtils.defaultString(response.getData().getValue(),"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"); |
| | | 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()); |
| | | } |
| | | |
| | | private EnergyModelDataVO getDefaultData() { |
| | |
| | | public RegionEnergyListResponse energyRegionData(){ |
| | | RegionEnergyListResponse data = null; |
| | | BaseResponse<RegionEnergyListResponse> response = HKService.regionEnergyList("1"); |
| | | if(response != null && !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){ |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){ |
| | | data = response.getData(); |
| | | } |
| | | if(data == null){ |
| | |
| | | if(type >=0 && type <=2){ |
| | | //用水用电用气 |
| | | List<PlatformWaterGas> list = platformWaterGasMapper.selectList(new QueryWrapper<PlatformWaterGas>() |
| | | .select("DATE_FORMAT(TIME_INFO,'yyyy-MM') as time_info_str,sum(num) as num") |
| | | .select("DATE_FORMAT(TIME_INFO,'%Y-%m') as time_info_str,sum(num) as num") |
| | | .lambda() |
| | | .eq(PlatformWaterGas::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformWaterGas::getType,type) |
| | | .apply("time_info BETWEEN DATE_SUB(CURDATE(), INTERVAL 12 MONTH) AND CURDATE()")//近12个月 |
| | | .last(" groupby DATE_FORMAT(TIME_INFO,'yyyy-MM')") |
| | | .last(" group by DATE_FORMAT(TIME_INFO,'%Y-%m')") |
| | | ); |
| | | for (int i = 0; i < 12; i++) { |
| | | Date tempDate = DateUtil.increaseMonth(lastMonth,i); |
| | |
| | | param.setNodeId("root000000"); |
| | | param.setPeriodType("year"); |
| | | 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 < 12; i++) { |
| | | if(response.getData().getYvalues().size()>0 &&response.getData().getYvalues().get(0).getValue().length>i){ |
| | | //取相应的参数值 |
| | | energyDataVOList.get(0).setEnergy(new BigDecimal(response.getData().getYvalues().get(0).getValue()[i])); |
| | | energyDataVOList.get(i).setEnergy(new BigDecimal(StringUtils.defaultString(response.getData().getYvalues().get(0).getValue()[i],"0"))); |
| | | } |
| | | } |
| | | |
| | |
| | | if(jobList==null || jobList.size()==0){ |
| | | return workEfficiencyVOList; |
| | | } |
| | | /* List<PlatformWmsDetail> jobList = platformWmsDetailMapper.selectJoinList(PlatformWmsDetail.class, new MPJLambdaWrapper<PlatformWmsDetail>() |
| | | .selectAll( PlatformWmsDetail.class) |
| | | .selectAs( PlatformJob::getDoneDate,PlatformWmsDetail::getDoneDate) |
| | | .leftJoin(PlatformJob.class,PlatformJob::getId,PlatformWmsDetail::getJobId) |
| | | .eq(PlatformWmsDetail::getIsdeleted, Constants.ZERO) |
| | | .eq(PlatformJob::getIsdeleted, Constants.ZERO) |
| | | .in(Constants.equalsInteger(type,Constants.ZERO),PlatformJob::getType,new Integer[]{0,2,4}) |
| | | .in(Constants.equalsInteger(type,Constants.ONE),PlatformJob::getType,new Integer[]{1,3}) |
| | | .in(PlatformJob::getStatus, Constants.PlatformJobStatus.DONE.getKey() |
| | | , Constants.PlatformJobStatus.AUTHED_LEAVE.getKey() |
| | | , Constants.PlatformJobStatus.LEAVED.getKey()) |
| | | .apply("to_days(t1.create_date) = to_days(now())") |
| | | );*/ |
| | | int curtotalNum = 0; |
| | | Date today = Utils.Date.getStart(new Date()); |
| | | long curTime=0, lastTime=0; |
| | |
| | | public List<PlatformWarnEvent> warningList(int limit){ |
| | | List<PlatformWarnEvent> platformLogList = platformWarnEventMapper.selectList(new QueryWrapper<PlatformWarnEvent>().lambda() |
| | | .eq(PlatformWarnEvent::getIsdeleted,Constants.ZERO) |
| | | .apply("to_days(create_date) = to_days(now())") |
| | | .orderByDesc(PlatformWarnEvent::getCreateDate) |
| | | .last(" limit "+limit) |
| | | ); |