From fc5bdb89e86757d21b648513ce012f57e6dc8e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Thu, 19 Jun 2025 14:41:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=8F=AF=E4=BB=A5=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iflytop/profilometer/api/sync/SyncApi.java | 12 +++++++----- .../com/iflytop/profilometer/core/sync/UploadManager.java | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/iflytop/profilometer/api/sync/SyncApi.java b/app/src/main/java/com/iflytop/profilometer/api/sync/SyncApi.java index b8e573a..afa9655 100644 --- a/app/src/main/java/com/iflytop/profilometer/api/sync/SyncApi.java +++ b/app/src/main/java/com/iflytop/profilometer/api/sync/SyncApi.java @@ -52,12 +52,14 @@ public class SyncApi { Long id = ids.getLong(i); SyncTask syncTask = syncTaskDao.getSyncTaskById(id); if (syncTask != null) { - continue; + syncTask.setSyncStatus(SyncStatus.wait); + syncTaskDao.updateSyncTask(syncTask); + }else{ + ProfileRecordDescription profileRecordDescription = profileRecordDao.getProfileRecordById(id); + profileRecordDescription.setSyncStatus(SyncStatus.wait); + profileRecordDao.updateProfileRecord(profileRecordDescription); + syncTaskDao.insertSyncTask(profileRecordDescription); } - ProfileRecordDescription profileRecordDescription = profileRecordDao.getProfileRecordById(id); - profileRecordDescription.setSyncStatus(SyncStatus.wait); - profileRecordDao.updateProfileRecord(profileRecordDescription); - syncTaskDao.insertSyncTask(profileRecordDescription); SystemService.getInstance().getUploadManager().addUploadId(id); } return Result.success(); diff --git a/app/src/main/java/com/iflytop/profilometer/core/sync/UploadManager.java b/app/src/main/java/com/iflytop/profilometer/core/sync/UploadManager.java index 8ccca2d..cb4184b 100644 --- a/app/src/main/java/com/iflytop/profilometer/core/sync/UploadManager.java +++ b/app/src/main/java/com/iflytop/profilometer/core/sync/UploadManager.java @@ -121,9 +121,9 @@ public class UploadManager { ProfileRecordDao profileRecordDao = new ProfileRecordDao(ProfilometerApplication.getContext()); ProfileRecordPointSetDao profileRecordPointSetDao = new ProfileRecordPointSetDao(ProfilometerApplication.getContext()); ProfileRecordDescription profileRecordDescription = profileRecordDao.getProfileRecordById(uploadId); - if (profileRecordDescription.getSyncStatus() == SyncStatus.finish) { - return true; - } +// if (profileRecordDescription.getSyncStatus() == SyncStatus.finish) { +// return true; +// } SystemConfigDao systemConfigDao = new SystemConfigDao(ProfilometerApplication.getContext()); SystemConfig serverConfig = systemConfigDao.getSystemConfigByKey(SystemConfigType.SERVER); String serverPath = serverConfig.getConfigValue();