| | |
| | | import org.springblade.system.cache.SysCache; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | baseMapper.updateexpireTime(expireTime,deviceNumber); |
| | | } |
| | | |
| | | /** |
| | | * 修改设备状态 2021-5-6 arsn修改 |
| | | * @param state 设备状态 |
| | | * @param reason 原因 |
| | | * @param deviceNumber 设备编号 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateExstate(String state, String reason, String deviceNumber) { |
| | | baseMapper.updateExstate(state, reason, deviceNumber); |
| | | if(state.equals("系统故障")){ |
| | | String dType = "3"; |
| | | baseMapper.updateExstate(dType, reason, deviceNumber); |
| | | } |
| | | if(state.equals("一键报警")){ |
| | | String dType = "2"; |
| | | baseMapper.updateExstate(dType, reason, deviceNumber); |
| | | } |
| | | if(state.equals("处理完成")){ |
| | | String dType = "1"; |
| | | baseMapper.updateExstate(dType, reason, deviceNumber); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | public Integer selectEqCg() { |
| | | return baseMapper.selectEqCg(); |
| | | } |
| | | |
| | | /** |
| | | * 获取各个设备状态统计数量 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> selEqTypeSum() { |
| | | //设备在线数量 |
| | | Integer integerz = baseMapper.selectEqCz(); |
| | | //设备掉线数量 |
| | | Integer integerd = baseMapper.selectEqCd(); |
| | | //设备预警数量 |
| | | Integer alarmSum = baseMapper.selectEqCys(); |
| | | //设备故障数量 |
| | | Integer integerg = baseMapper.selectEqCg(); |
| | | //封装数据 |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("zx", integerz); |
| | | map.put("dx", integerd); |
| | | map.put("yj", alarmSum); |
| | | map.put("gz", integerg); |
| | | //返回数据 |
| | | return map; |
| | | } |
| | | } |