|
|
@@ -5,14 +5,13 @@ import com.gg.reader.api.protocol.gx.EnumG;
|
|
|
import com.gg.reader.api.protocol.gx.MsgBaseInventoryEpc;
|
|
|
import com.gg.reader.api.protocol.gx.MsgBaseSetPower;
|
|
|
import com.gg.reader.api.protocol.gx.MsgBaseStop;
|
|
|
-import com.payne.reader.Reader;
|
|
|
+import com.zd.common.core.exception.ServiceException;
|
|
|
import com.zd.netty.service.ISendService;
|
|
|
import com.zd.netty.service.IService;
|
|
|
import com.zd.system.api.domain.InventoryTag;
|
|
|
import com.zd.system.api.laboratory.domain.RemoteLabHardware;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -48,16 +47,16 @@ public class DeJuRFIDService implements IService {
|
|
|
//标签上报结束
|
|
|
client.onTagEpcOver = (readName, logBaseEpcOver) -> {
|
|
|
if (null != logBaseEpcOver) {
|
|
|
- System.out.println("Epc log over.");
|
|
|
+ log.info("Epc log over.");
|
|
|
}
|
|
|
};
|
|
|
// 停止指令,空闲态
|
|
|
MsgBaseStop msgBaseStop = new MsgBaseStop();
|
|
|
client.sendSynMsg(msgBaseStop);
|
|
|
if (0 == msgBaseStop.getRtCode()) {
|
|
|
- System.out.println("Stop successful.");
|
|
|
+ log.info("Stop successful.");
|
|
|
} else {
|
|
|
- System.out.println("Stop error.");
|
|
|
+ log.info("Stop error.");
|
|
|
}
|
|
|
|
|
|
// 功率配置, 将4个天线功率都设置为30dBm.
|
|
|
@@ -72,9 +71,9 @@ public class DeJuRFIDService implements IService {
|
|
|
msgBaseSetPower.setDicPower(hashtable);
|
|
|
client.sendSynMsg(msgBaseSetPower);
|
|
|
if (0 == msgBaseSetPower.getRtCode()) {
|
|
|
- System.out.println("Power configuration successful.");
|
|
|
+ log.info("Power configuration successful.");
|
|
|
} else {
|
|
|
- System.out.println("Power configuration error.");
|
|
|
+ log.info("Power configuration error.");
|
|
|
}
|
|
|
|
|
|
// 4个天线读卡, 读取EPC数据区以及TID数据区
|
|
|
@@ -89,13 +88,13 @@ public class DeJuRFIDService implements IService {
|
|
|
|
|
|
client.sendSynMsg(msgBaseInventoryEpc);
|
|
|
if (0 == msgBaseInventoryEpc.getRtCode()) {
|
|
|
- System.out.println("Inventory epc successful.");
|
|
|
+ log.info("Inventory epc successful.");
|
|
|
} else {
|
|
|
- System.out.println("Inventory epc error.");
|
|
|
+ log.info("Inventory epc error.");
|
|
|
}
|
|
|
clientMap.put(ipAddress,client);
|
|
|
} else {
|
|
|
- System.out.println("Connect failure.");
|
|
|
+ throw new ServiceException("Connect failure.");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -108,11 +107,11 @@ public class DeJuRFIDService implements IService {
|
|
|
// 停止读卡,空闲态
|
|
|
client.sendSynMsg(msg);
|
|
|
if (0 == msg.getRtCode()) {
|
|
|
- System.out.println("Stop successful.");
|
|
|
+ log.info("Stop successful.");
|
|
|
} else {
|
|
|
- System.out.println("Stop error.");
|
|
|
+ log.info("Stop error.");
|
|
|
}
|
|
|
- System.out.println("Close the connection");
|
|
|
+ log.info("Close the connection");
|
|
|
client.close();
|
|
|
clientMap.remove(ipAddress);
|
|
|
}
|