| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | |
| | | import com.doumee.dao.business.dao.MemberMapper; |
| | | import com.doumee.dao.business.dto.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.CabinetBoardDataVO; |
| | | import com.doumee.dao.business.vo.CabinetDetailVO; |
| | | import com.doumee.dao.business.vo.CabinetGridInfoVO; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | |
| | | public void timeOutUnCloseAlarm(TimeOutCloseGridDTO dto){ |
| | | if(Objects.nonNull(dto) |
| | | && Objects.nonNull(dto.getGridId())){ |
| | | |
| | | SystemUser systemUser = null; |
| | | if(Objects.nonNull(dto.getMemberId())){ |
| | | systemUser = systemUserMapper.selectOne(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(Objects.nonNull(dto.getMemberId()),SystemUser::getMemberId,dto.getMemberId()) |
| | | .eq(SystemUser::getDeleted,Constants.ZERO) |
| | | .last(" limit 1 ") |
| | | ); |
| | | } |
| | | |
| | | JkCabinetGrid jkCabinetGrid = jkCabinetGridMapper.selectJoinOne(JkCabinetGrid.class, |
| | | new MPJLambdaWrapper<JkCabinetGrid>().selectAll(JkCabinetGrid.class) |
| | | .selectAs(JkCabinet::getName,JkCabinetGrid::getCabinetName) |
| | |
| | | .eq(JkCabinetGrid::getId,dto.getGridId()) |
| | | .last(" limit 1 ") |
| | | ); |
| | | |
| | | if(Objects.nonNull(jkCabinetGrid)){ |
| | | log.error("柜格开门超时未关闭告警信息:{}"+JSONObject.toJSONString(jkCabinetGrid)); |
| | | //规则类型 |
| | |
| | | //存储报警异常记录 |
| | | WarningEvent warningEvent = new WarningEvent(); |
| | | warningEvent.setCreateDate(new Date()); |
| | | warningEvent.setCreator(Objects.nonNull(systemUser)?systemUser.getId():null); |
| | | warningEvent.setWarningId(warning.getId()); |
| | | warningEvent.setTitle(warningConfig.getInfo()); |
| | | warningEvent.setContent(content ); |
| | |
| | | //存储报警异常记录 |
| | | WarningEvent warningEvent = new WarningEvent(); |
| | | warningEvent.setCreateDate(new Date()); |
| | | warningEvent.setCreator(Objects.nonNull(systemUser)?systemUser.getId():null); |
| | | warningEvent.setWarningId(warning.getId()); |
| | | warningEvent.setTitle(warningConfig.getInfo()); |
| | | warningEvent.setContent(content ); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public CabinetBoardDataVO getCabinetGridData(){ |
| | | CabinetBoardDataVO cabinetBoardDataVO = new CabinetBoardDataVO(); |
| | | //所有柜格信息 |
| | | List<JkCabinetGrid> jkCabinetGridList = |
| | | jkCabinetGridMapper.selectJoinList(JkCabinetGrid.class, new MPJLambdaWrapper<JkCabinetGrid>() |
| | | .selectAll(JkCabinetGrid.class) |
| | | .selectAs(JkKeys::getCarCode,JkCabinetGrid::getCarCode) |
| | | .selectAs(JkKeys::getRfidLable,JkCabinetGrid::getKeyCode) |
| | | .selectAs(JkKeys::getStatus,JkCabinetGrid::getKeyStatus) |
| | | .leftJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) |
| | | .eq(JkCabinetGrid::getIsdeleted,Constants.ZERO) |
| | | .orderByAsc(JkCabinetGrid::getCode) |
| | | ); |
| | | List<CabinetGridInfoVO> cabinetGridInfoVOList = new ArrayList<>(); |
| | | if(CollectionUtils.isNotEmpty(jkCabinetGridList)){ |
| | | cabinetBoardDataVO.setGridNum(jkCabinetGridList.size()); |
| | | for (JkCabinetGrid jkCabinetGrid:jkCabinetGridList) { |
| | | CabinetGridInfoVO cabinetGridInfoVO = new CabinetGridInfoVO(); |
| | | BeanUtil.copyProperties(jkCabinetGrid,cabinetGridInfoVO); |
| | | cabinetGridInfoVO.setBindStatus(Objects.isNull(jkCabinetGrid.getKeyId())?Constants.ZERO:Constants.ONE); |
| | | cabinetGridInfoVO.setKeyStatus(Objects.isNull(cabinetGridInfoVO.getKeyStatus())?Constants.ZERO:cabinetGridInfoVO.getKeyStatus()); |
| | | cabinetGridInfoVOList.add(cabinetGridInfoVO); |
| | | } |
| | | cabinetBoardDataVO.setGridNum(jkCabinetGridList.size()); |
| | | cabinetBoardDataVO.setOnlineKeyNum( //在位数量 |
| | | cabinetGridInfoVOList.stream().filter(i->Constants.equalsInteger(i.getKeyStatus(),Constants.ONE)).collect(Collectors.toList()).size() |
| | | ); |
| | | cabinetBoardDataVO.setOutKeyNum( //借出数量 |
| | | cabinetGridInfoVOList.stream().filter(i->Constants.equalsInteger(i.getKeyStatus(),Constants.TWO)).collect(Collectors.toList()).size() |
| | | ); |
| | | cabinetBoardDataVO.setServiceKeyNum( //维护保养数量 |
| | | cabinetGridInfoVOList.stream().filter(i->Constants.equalsInteger(i.getKeyStatus(),Constants.THREE)).collect(Collectors.toList()).size() |
| | | ); |
| | | cabinetBoardDataVO.setUnBindGridNum(//空闲数量 |
| | | cabinetGridInfoVOList.stream().filter(i->Constants.equalsInteger(i.getBindStatus(),Constants.ZERO)).collect(Collectors.toList()).size() |
| | | ); |
| | | } |
| | | return cabinetBoardDataVO; |
| | | } |
| | | |
| | | |
| | | } |