|
|
@@ -1,6 +1,10 @@
|
|
|
package com.zd.netty.service.impl;
|
|
|
|
|
|
+import com.gg.reader.api.dal.GClient;
|
|
|
import com.zd.bottle.feign.service.RemoteBottleService;
|
|
|
+import com.zd.common.core.constant.HttpStatus;
|
|
|
+import com.zd.common.core.domain.R;
|
|
|
+import com.zd.netty.sdk.DeJuRFIDServerImpl;
|
|
|
import com.zd.netty.service.ISendService;
|
|
|
import com.zd.system.api.airbottle.RemoteAirBottleService;
|
|
|
import com.zd.system.api.chemical.RemoteStockService;
|
|
|
@@ -31,14 +35,14 @@ public class SendServiceImpl implements ISendService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public void send(InventoryTag tag) {
|
|
|
+ public void send(InventoryTag tag, GClient client) {
|
|
|
|
|
|
RemoteLabHardware hardware = tag.getRemoteLabHardware();
|
|
|
if (hardware != null) {
|
|
|
int antId = tag.getAntId();
|
|
|
String uniformPower = hardware.getUniformPower();
|
|
|
String[] uniformPowers = uniformPower.split(",");
|
|
|
- handleTag(tag, antId, uniformPowers);
|
|
|
+ handleTag(tag, antId, uniformPowers,client);
|
|
|
} else {
|
|
|
try {
|
|
|
bottleService.remoteAdd(tag);
|
|
|
@@ -58,7 +62,7 @@ public class SendServiceImpl implements ISendService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void handleTag(InventoryTag tag, int antId, String[] uniformPowers) {
|
|
|
+ private void handleTag(InventoryTag tag, int antId, String[] uniformPowers, GClient client) {
|
|
|
// 判断有设备配置和触发的天线编码等与配置天线编号
|
|
|
if (uniformPowers.length > 0) {
|
|
|
String tempUniformPower = uniformPowers[antId - 1];
|
|
|
@@ -66,21 +70,24 @@ public class SendServiceImpl implements ISendService {
|
|
|
String[] tempUniformPowers = tempUniformPower.split(":");
|
|
|
if (tempUniformPowers.length > 1) {
|
|
|
String temp = tempUniformPowers[1];
|
|
|
- sendTag(tag, temp);
|
|
|
+ sendTag(tag, temp,client);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void sendTag(InventoryTag tag, String temp) {
|
|
|
+ private void sendTag(InventoryTag tag, String temp, GClient client) {
|
|
|
+ R<Boolean> result;
|
|
|
if (ALL_TYPE.equals(temp) || BOTTLE_TYPE.equals(temp)) {
|
|
|
try {
|
|
|
- bottleService.remoteAdd(tag);
|
|
|
+ result = bottleService.remoteAdd(tag);
|
|
|
+ alarm(client,result);
|
|
|
} catch (Exception e) {
|
|
|
log.info("气瓶服务异常:" + e.getMessage());
|
|
|
}
|
|
|
try {
|
|
|
- remoteBottleService.remoteAdd(tag);
|
|
|
+ result = remoteBottleService.remoteAdd(tag);
|
|
|
+ alarm(client,result);
|
|
|
} catch (Exception e) {
|
|
|
log.info("新气瓶服务异常:" + e.getMessage());
|
|
|
}
|
|
|
@@ -94,6 +101,12 @@ public class SendServiceImpl implements ISendService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void alarm(GClient client,R<Boolean> result){
|
|
|
+ if (client!=null && result.getCode()== HttpStatus.SUCCESS && Boolean.TRUE.equals(result.getData())){
|
|
|
+ DeJuRFIDServerImpl.alarm(client);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void sendError(String msg) {
|
|
|
log.info(msg);
|