|
@@ -42,23 +42,10 @@ public class SendServiceImpl implements ISendService {
|
|
|
int antId = tag.getAntId();
|
|
int antId = tag.getAntId();
|
|
|
String uniformPower = hardware.getUniformPower();
|
|
String uniformPower = hardware.getUniformPower();
|
|
|
String[] uniformPowers = uniformPower.split(",");
|
|
String[] uniformPowers = uniformPower.split(",");
|
|
|
- handleTag(tag, antId, uniformPowers,client);
|
|
|
|
|
|
|
+ handleTag(tag, antId, uniformPowers, client);
|
|
|
} else {
|
|
} else {
|
|
|
- try {
|
|
|
|
|
- bottleService.remoteAdd(tag);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.info("气瓶服务异常:" + e.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
- try {
|
|
|
|
|
- remoteBottleService.remoteAdd(tag);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.info("新气瓶服务异常:" + e.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
- try {
|
|
|
|
|
- remoteStockService.rfidCheck(tag);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.info("化学品服务异常:" + e.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ sendBottle(tag, client);
|
|
|
|
|
+ sendStock(tag,client);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -70,39 +57,54 @@ public class SendServiceImpl implements ISendService {
|
|
|
String[] tempUniformPowers = tempUniformPower.split(":");
|
|
String[] tempUniformPowers = tempUniformPower.split(":");
|
|
|
if (tempUniformPowers.length > 1) {
|
|
if (tempUniformPowers.length > 1) {
|
|
|
String temp = tempUniformPowers[1];
|
|
String temp = tempUniformPowers[1];
|
|
|
- sendTag(tag, temp,client);
|
|
|
|
|
|
|
+ sendTag(tag, temp, client);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ sendTag(tag, null, client);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void sendTag(InventoryTag tag, String temp, GClient client) {
|
|
private void sendTag(InventoryTag tag, String temp, GClient client) {
|
|
|
- R<Boolean> result;
|
|
|
|
|
|
|
+ if (temp==null){
|
|
|
|
|
+ sendBottle(tag, client);
|
|
|
|
|
+ sendStock(tag, client);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (ALL_TYPE.equals(temp) || BOTTLE_TYPE.equals(temp)) {
|
|
if (ALL_TYPE.equals(temp) || BOTTLE_TYPE.equals(temp)) {
|
|
|
- try {
|
|
|
|
|
- result = bottleService.remoteAdd(tag);
|
|
|
|
|
- alarm(client,result);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.info("气瓶服务异常:" + e.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
- try {
|
|
|
|
|
- result = remoteBottleService.remoteAdd(tag);
|
|
|
|
|
- alarm(client,result);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.info("新气瓶服务异常:" + e.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ sendBottle(tag, client);
|
|
|
}
|
|
}
|
|
|
if (ALL_TYPE.equals(temp) || CHEMICAL_TYPE.equals(temp)) {
|
|
if (ALL_TYPE.equals(temp) || CHEMICAL_TYPE.equals(temp)) {
|
|
|
- try {
|
|
|
|
|
- remoteStockService.rfidCheck(tag);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.info("化学品服务异常:" + e.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ sendStock(tag, client);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void sendStock(InventoryTag tag, GClient client) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ remoteStockService.rfidCheck(tag);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.info("化学品服务异常:" + e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void sendBottle(InventoryTag tag, GClient client) {
|
|
|
|
|
+ R<Boolean> result;
|
|
|
|
|
+ try {
|
|
|
|
|
+ result = bottleService.remoteAdd(tag);
|
|
|
|
|
+ alarm(client, result);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.info("气瓶服务异常:" + e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ result = remoteBottleService.remoteAdd(tag);
|
|
|
|
|
+ alarm(client, result);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.info("新气瓶服务异常:" + e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void alarm(GClient client,R<Boolean> result){
|
|
|
|
|
- if (client!=null && result.getCode()== HttpStatus.SUCCESS && Boolean.TRUE.equals(result.getData())){
|
|
|
|
|
|
|
+ private void alarm(GClient client, R<Boolean> result) {
|
|
|
|
|
+ if (client != null && result.getCode() == HttpStatus.SUCCESS && Boolean.TRUE.equals(result.getData())) {
|
|
|
DeJuRFIDServerImpl.alarm(client);
|
|
DeJuRFIDServerImpl.alarm(client);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|