Authored by wangshusheng

修改

... ... @@ -21,6 +21,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* RFID读写器接口
*/
@Controller
public class RfidController {
... ... @@ -29,6 +32,7 @@ public class RfidController {
private RfidConfig rfidConfig;
@Autowired
private RfidInit rfidInit;
/**
* 查询失效的sku信息
* @return
... ...
... ... @@ -8,7 +8,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.lang.reflect.Field;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
... ...
... ... @@ -10,7 +10,9 @@ import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* RFID管理,开启、配置、监听,接收数据上报
*/
public class RfidManager {
private static final Logger logger = LoggerFactory.getLogger(RfidManager.class);
... ... @@ -143,9 +145,4 @@ public class RfidManager {
return mRfidSetting;
}
private void clearData() {
SocketConstant.allTags.clear();
}
}
\ No newline at end of file
... ...
package com.yoho.rfid.service;
import com.yoho.rfid.model.RfidClient;
import com.yoho.rfid.util.SocketConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
... ...
package com.yoho.rfid.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
import JW.UHF.JWReader;
import JW.UHF.Tag;
import com.yoho.rfid.model.RfidClient;
public class SocketConstant {
// 默认timeout 时间 60s
public static final int SOCKET_TIMEOUT = 60 * 1000;
/**
* 指定时间没有数据上报,则认为已经离开货架,给前端返回数据 1.5s
*/
... ... @@ -38,11 +30,6 @@ public class SocketConstant {
public static Map<String, JWReader> rfidJWReaderValidMap = new ConcurrentHashMap<>();
/**
* mac和ip的对应关系
*/
public static Map<String, String> macIpMap = new HashMap<>();
/**
* map中每个ip(读写器)一条记录,具体存放sku和最新一条上报的时间戳
*/
public static Map<String, Map<String, Long>> allTags = new ConcurrentHashMap<String, Map<String, Long>>();
... ...