|
@@ -23,6 +23,7 @@ import java.net.InetSocketAddress;
|
23
|
23
|
import java.util.Date;
|
24
|
24
|
import java.util.HashMap;
|
25
|
25
|
import java.util.Map;
|
|
26
|
+import java.util.concurrent.TimeUnit;
|
26
|
27
|
|
27
|
28
|
@Log4j2
|
28
|
29
|
@Component
|
|
@@ -91,7 +92,13 @@ public class BootNettyChannelInboundHandlerAdapter extends ChannelInboundHandler
|
91
|
92
|
||(jsonObject!=null && jsonObject.getString(Constant.CN).equals(Constant.HOUR))){
|
92
|
93
|
// adapter.publisherService.pubMsg(jsonObject);
|
93
|
94
|
if (ObjectUtils.notEqual(jsonObject.get("CN"),Constant.MINUTE_STR)){
|
94
|
|
- adapter.redisQueueService.sendMessage(Constant.SERVER, jsonObject);
|
|
95
|
+ String CN = jsonObject.getString("CN");
|
|
96
|
+ String MN = jsonObject.getString("MN");
|
|
97
|
+ String dataTime = jsonObject.getString("DataTime");
|
|
98
|
+ if (!adapter.redisQueueService.isElementExist(MN +":"+ CN +":"+ dataTime, dataTime)){
|
|
99
|
+ adapter.redisQueueService.addElementWithExpire(MN +":"+ CN +":"+ dataTime, dataTime, 2, TimeUnit.HOURS);
|
|
100
|
+ adapter.redisQueueService.sendMessage(Constant.SERVER, jsonObject);
|
|
101
|
+ }
|
95
|
102
|
}
|
96
|
103
|
}
|
97
|
104
|
} else {
|
|
@@ -102,7 +109,13 @@ public class BootNettyChannelInboundHandlerAdapter extends ChannelInboundHandler
|
102
|
109
|
if ((jsonObject!=null && jsonObject.getString(Constant.CN).equals(Constant.MINUTE))
|
103
|
110
|
|| (jsonObject!=null && jsonObject.getString(Constant.CN).equals(Constant.HOUR))){
|
104
|
111
|
if (ObjectUtils.notEqual(jsonObject.get("CN"),Constant.MINUTE_STR)) {
|
105
|
|
- adapter.redisQueueService.sendMessage(Constant.SERVER, jsonObject);
|
|
112
|
+ String CN = jsonObject.getString("CN");
|
|
113
|
+ String MN = jsonObject.getString("MN");
|
|
114
|
+ String dataTime = jsonObject.getString("DataTime");
|
|
115
|
+ if (!adapter.redisQueueService.isElementExist(MN +":"+ CN +":"+ dataTime, dataTime)){
|
|
116
|
+ adapter.redisQueueService.addElementWithExpire(MN +":"+ CN +":"+ dataTime, dataTime, 2, TimeUnit.HOURS);
|
|
117
|
+ adapter.redisQueueService.sendMessage(Constant.SERVER, jsonObject);
|
|
118
|
+ }
|
106
|
119
|
}
|
107
|
120
|
// adapter.publisherService.pubMsg(jsonObject);
|
108
|
121
|
}
|