| | |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dao.MemberMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.CabinetBoardWaningRataDataVO; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public PageData<WarningEvent> getCabinetBoardWarningPage(PageWrap<WarningEvent> pageWrap){ |
| | | IPage<WarningEvent> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | IPage<WarningEvent> pageData = warningEventMapper.selectJoinPage(page,WarningEvent.class, |
| | | new MPJLambdaWrapper<WarningEvent>() |
| | | .selectAll(WarningEvent.class) |
| | | .selectAs(SystemUser::getRealname,WarningEvent::getCreateUserName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,WarningEvent::getCreator) |
| | | .leftJoin(Warning.class,Warning::getId,WarningEvent::getWarningId) |
| | | .eq(WarningEvent::getIsdeleted,Constants.ZERO) |
| | | .in(Warning::getCode,Constants.WarningConfig.KEY_TIME_OUT_BACK.getKey(),Constants.WarningConfig.ALARM_TEST.getKey(),Constants.WarningConfig.GRID_TIME_OUT_INFO.getKey()) |
| | | .like(WarningEvent::getCreateDate,DateUtil.getCurrDate()) |
| | | .orderByDesc(WarningEvent::getId) |
| | | ); |
| | | return PageData.from(pageData); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public CabinetBoardWaningRataDataVO getCabinetBoardWarningRataData(Integer type){ |
| | | |
| | | CabinetBoardWaningRataDataVO vo = new CabinetBoardWaningRataDataVO(); |
| | | vo.setAlcoholNum(Constants.ZERO); |
| | | vo.setUnCloseNum(Constants.ZERO); |
| | | vo.setTimeOutNum(Constants.ZERO); |
| | | |
| | | List<WarningEvent> warningEventList = warningEventMapper.selectJoinList(WarningEvent.class, |
| | | new MPJLambdaWrapper<WarningEvent>(). |
| | | selectAll(WarningEvent.class) |
| | | .selectAs(Warning::getCode,WarningEvent::getWarningId) |
| | | .leftJoin(Warning.class,Warning::getId,WarningEvent::getWarningCode) |
| | | .eq(WarningEvent::getIsdeleted,Constants.ZERO) |
| | | .in(Warning::getCode,Constants.WarningConfig.KEY_TIME_OUT_BACK.getKey(),Constants.WarningConfig.ALARM_TEST.getKey(),Constants.WarningConfig.GRID_TIME_OUT_INFO.getKey()) |
| | | .like(Objects.nonNull(type)&&Constants.equalsInteger(Constants.ZERO,type),WarningEvent::getCreateDate,DateUtil.getCurrDate()) |
| | | .like(Objects.nonNull(type)&&Constants.equalsInteger(Constants.ONE,type),WarningEvent::getCreateDate,DateUtil.getFomartDate(new Date(),"yyyy-MM")) |
| | | .like(Objects.nonNull(type)&&Constants.equalsInteger(Constants.TWO,type),WarningEvent::getCreateDate,DateUtil.getFomartDate(new Date(),"yyyy")) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(warningEventList)){ |
| | | vo.setAlcoholNum( |
| | | warningEventList.stream().filter(i->StringUtils.isNotBlank(i.getWarningCode())&& |
| | | i.getWarningCode().equals(Constants.WarningConfig.ALARM_TEST.getKey())).collect(Collectors.toList()).size() |
| | | ); |
| | | vo.setUnCloseNum( |
| | | warningEventList.stream().filter(i->StringUtils.isNotBlank(i.getWarningCode())&& |
| | | i.getWarningCode().equals(Constants.WarningConfig.GRID_TIME_OUT_INFO.getKey())).collect(Collectors.toList()).size() |
| | | ); |
| | | vo.setTimeOutNum( |
| | | warningEventList.stream().filter(i->StringUtils.isNotBlank(i.getWarningCode())&& |
| | | i.getWarningCode().equals(Constants.WarningConfig.KEY_TIME_OUT_BACK.getKey())).collect(Collectors.toList()).size() |
| | | ); |
| | | } |
| | | |
| | | |
| | | return vo; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |