|
|
|
@ -4155,16 +4155,41 @@ public class EamServiceImpl implements EamService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//发送语音播报 |
|
|
|
for (SOIssueNotifyOrderMaterialListData data : soIssueNotifyOrderMaterialListData) { |
|
|
|
String vodBuf = "现在播报," + data.getNotifyNo() + "申请单," + addSpace(data.getComponentPartNo()) + "料号未及时配料"; |
|
|
|
loraWatchUtils.sendSoundBox(newLocation.getIp(), 1, 1, vodBuf); |
|
|
|
|
|
|
|
if(soIssueNotifyOrderMaterialListData !=null && soIssueNotifyOrderMaterialListData.size()>0){ |
|
|
|
loraWatchUtils.sendBeepBox(newLocation.getIp(), 1, 1, 1); |
|
|
|
try { |
|
|
|
Thread.sleep(10000); |
|
|
|
Thread.sleep(2000); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
Thread.currentThread().interrupt(); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
// 发送语音播报:大于 2 条时每 3 条播报一次,剩余不足 3 条在结束时一起播报 |
|
|
|
int batchSize = soIssueNotifyOrderMaterialListData.size() > 2 |
|
|
|
? 3 |
|
|
|
: soIssueNotifyOrderMaterialListData.size(); |
|
|
|
int batchCount = 0; |
|
|
|
int processed = 0; |
|
|
|
String vodBuf = ""; |
|
|
|
for (SOIssueNotifyOrderMaterialListData data : soIssueNotifyOrderMaterialListData) { |
|
|
|
vodBuf += data.getNotifyNo() + "申请单," + addSpace(data.getComponentPartNo()) + "料号未及时配料,,,,"; |
|
|
|
batchCount++; |
|
|
|
processed++; |
|
|
|
|
|
|
|
boolean reachBatch = batchCount == batchSize; |
|
|
|
boolean isLast = processed == soIssueNotifyOrderMaterialListData.size(); |
|
|
|
if (reachBatch || isLast) { |
|
|
|
loraWatchUtils.sendSoundBox(newLocation.getIp(), 1, 1, vodBuf); |
|
|
|
vodBuf = ""; |
|
|
|
batchCount = 0; |
|
|
|
// 批次发送之间保持间隔,避免设备被频繁触发 |
|
|
|
if (!isLast && soIssueNotifyOrderMaterialListData.size() > batchSize) { |
|
|
|
try { |
|
|
|
Thread.sleep(28000); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
Thread.currentThread().interrupt(); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|