|
@@ -490,16 +490,18 @@ class AdminServiceImpl implements IAdminService {
|
|
|
if(device==null){
|
|
|
return new Result(false,"设备不存在")
|
|
|
}
|
|
|
- def optional = fingerPrintDataRepository.findById(info.id)
|
|
|
- if(optional.isEmpty()){
|
|
|
- return new Result(false,"数据不存在")
|
|
|
- }
|
|
|
- def fingerPrintData = optional.get()
|
|
|
- def result = mqttHandler.sendMessageToDevice(info.mac, fingerPrintData.convertToBytes())
|
|
|
- if(result){
|
|
|
- return new Result(true,"数据已推送")
|
|
|
+ def listOfData = fingerPrintDataRepository.findAllById(info.id)
|
|
|
+ if(listOfData.size()!=info.id.size()){
|
|
|
+ return new Result(false,"数据不一致")
|
|
|
+ }
|
|
|
+ for(FingerPrintData data:listOfData){
|
|
|
+ def result = mqttHandler.sendMessageToDevice(info.mac, fingerPrintData.convertToBytes())
|
|
|
+ if(!result){
|
|
|
+ return new Result(false,"信息发送失败")
|
|
|
+ }
|
|
|
}
|
|
|
- return new Result(false,"信息发送失败")
|
|
|
+ def commit=new AdminCommitPush(info.mac)
|
|
|
+ return commitPush(commit,token)
|
|
|
}
|
|
|
|
|
|
@Override
|