Merge branch 'gzynwcs' of http://47.97.1.152:5880/r/zy-wcs into gzynwcs
| | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | /** |
| | | * 配置常量 |
| | |
| | | public static final Charset CHARSET_GBK = Charset.forName("GBK"); |
| | | |
| | | public static Map<String, Date> FIRE_HEARTBEAT = new HashMap<>(); |
| | | |
| | | public static Map<Integer, String> errorMap = new ConcurrentHashMap<>(); |
| | | |
| | | } |
| | |
| | | package com.zy.core.netty.handle; |
| | | |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.service.impl.MainServiceImpl; |
| | | import com.zy.core.netty.AbstractInboundHandler; |
| | | import com.zy.core.netty.cache.ChannelCache; |
| | |
| | | String now = "20" + fire3030.getYear() + "-" + fire3030.getMonth() + "-" + fire3030.getDay() |
| | | + " " + fire3030.getHour() + ":" + fire3030.getMinute() + ":" + fire3030.getSeconds(); |
| | | |
| | | Constant.FIRE_HEARTBEAT.put(fire3030.getNo().toString(), DateUtils.convert(now)); |
| | | ChannelCache.setChannel(String.valueOf(fire3030.getNo()), ctx.channel()); |
| | | Constant.errorMap.remove(fire3030.getNo()); |
| | | break; |
| | | case FIRE_ALARM: |
| | | |
| | |
| | | import com.core.common.Cools; |
| | | import com.zy.core.netty.AbstractInboundHandler; |
| | | import com.zy.core.netty.cache.ChannelCache; |
| | | import com.zy.core.netty.constant.Constant; |
| | | import com.zy.core.netty.domain.ChPackage; |
| | | import io.netty.channel.ChannelHandler; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | |
| | | ctx.close(); |
| | | if (!Cools.isEmpty(uuid)){ |
| | | log.info("uuid={} 空闲剔除", uuid); |
| | | Constant.errorMap.put(Integer.parseInt(uuid), "断开异常"); |
| | | } |
| | | } |
| | | } |