|
|
@@ -32,7 +32,7 @@ public class DeJuRFIDService implements IService {
|
|
|
|
|
|
private final Map<String, GClient> clientMap = new ConcurrentHashMap<>();
|
|
|
|
|
|
- private boolean isAlerm=false;
|
|
|
+ private volatile boolean isAlarm=false;
|
|
|
|
|
|
private final ScheduledExecutorService scheduledExecutorService= SpringUtils.getBean("scheduledExecutorService");
|
|
|
|
|
|
@@ -153,15 +153,13 @@ public class DeJuRFIDService implements IService {
|
|
|
String status = state == 1 ? "start" : "stop";
|
|
|
if (0 == msgAppSetGpo.getRtCode()) {
|
|
|
log.info("Gpo epc {} successful.",status);
|
|
|
- if (state==1){
|
|
|
- isAlerm=true;
|
|
|
- stopGpo(client,delayTime);
|
|
|
- }else {
|
|
|
- isAlerm=false;
|
|
|
- }
|
|
|
} else {
|
|
|
log.error("Gpo epc {} error.",status);
|
|
|
}
|
|
|
+ if (state==1){
|
|
|
+ stopGpo(client,delayTime);
|
|
|
+ isAlarm=false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void stopGpo(GClient client,int delayTime){
|
|
|
@@ -183,8 +181,11 @@ public class DeJuRFIDService implements IService {
|
|
|
if (logBaseEpcInfo.getResult() == 0) {
|
|
|
log.info("===========》{}",logBaseEpcInfo.getbEpc());
|
|
|
//灯带设置
|
|
|
- if (!isAlerm){
|
|
|
- changeGpo(1, client,10);
|
|
|
+ if (!isAlarm){
|
|
|
+ scheduledExecutorService.execute(() -> {
|
|
|
+ isAlarm=true;
|
|
|
+ changeGpo(1, client,10);
|
|
|
+ });
|
|
|
}
|
|
|
InventoryTag tag = new InventoryTag();
|
|
|
BeanUtils.copyProperties(logBaseEpcInfo, tag);
|