优化检查设备 SIM 卡 ICCID 的代码
This commit is contained in:
parent
2cf8cd9479
commit
faff19e006
@ -44,6 +44,8 @@ public class D3F0SelfCheckMessageExecutor implements Executor<D3F0SelfCheckMessa
|
||||
@Autowired
|
||||
private DataPersistService dataPersistService;
|
||||
@Autowired
|
||||
private GnssDeviceMapper gnssDeviceMapper;
|
||||
@Autowired
|
||||
GnssMsgMapper msgMapper;
|
||||
|
||||
@Autowired
|
||||
@ -186,7 +188,14 @@ public class D3F0SelfCheckMessageExecutor implements Executor<D3F0SelfCheckMessa
|
||||
|
||||
void checkAndAskICCID(Device device){
|
||||
// 如果设备的 ICCID 存在,那么就不用发送 "AT+ICCID" 指令
|
||||
|
||||
if(device.getIccid() != null && !device.getIccid().trim().isEmpty()){
|
||||
GnssDevice gnssDevice = gnssDeviceMapper.queryByDeviceId(device.getDeviceId());
|
||||
if(gnssDevice.getIccid() != null && !gnssDevice.getIccid().trim().isEmpty()){
|
||||
// 状态和流量查询更新需要 1-2 小时,期间 DataPersistService 更新可能不及时
|
||||
// 若是数据库的设备已经更新了 iccid 号,将它同步到 DataPersistService 缓存中
|
||||
device.setIccid(gnssDevice.getIccid());
|
||||
}
|
||||
return;
|
||||
}
|
||||
String sendCmd = "AT+ICCID";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user