ifengouy преди 2 години
родител
ревизия
523c8fa15a
променени са 1 файла, в които са добавени 4 реда и са изтрити 10 реда
  1. 4 10
      app/src/main/java/com/sunwin/visitorapp/service/PullDataService.java

+ 4 - 10
app/src/main/java/com/sunwin/visitorapp/service/PullDataService.java

@@ -5,13 +5,13 @@ import android.content.Intent;
 import androidx.annotation.NonNull;
 import androidx.core.app.JobIntentService;
 
+import com.sunwin.visitorapp.face.CameraPreviewData;
 import com.sunwin.visitorapp.model.DepartmentResult;
 import com.sunwin.visitorapp.net.ApiService;
 import com.sunwin.visitorapp.net.BaseRsult;
 import com.sunwin.visitorapp.net.CommonRequest;
 import com.sunwin.visitorapp.net.RetrofitUtil;
 import com.sunwin.visitorapp.utils.AppUtil;
-import com.sunwin.visitorapp.utils.Constant;
 import com.sunwin.visitorapp.utils.LogUtil;
 import com.sunwin.visitorapp.utils.SharePrefenceUtils;
 
@@ -54,7 +54,7 @@ public class PullDataService extends JobIntentService {
                     if (response.body().getCode() != 0) {
                         return;
                     }
-                   /* UserCategoryModel.deleteAll();//删除本地无效数据
+                    DatabaseManager.delete(DepartmentResult.class);
                     List<DepartmentResult> list = response.body().getResult();
                     if (list != null && list.size() > 0) {
                         //存入最新数据
@@ -62,17 +62,11 @@ public class PullDataService extends JobIntentService {
                             DepartmentResult resultBean = list.get(i);
                             //新增与编辑
                             if (resultBean.getStatus() == 0 || resultBean.getStatus() == 1) {
-                                UserCategoryModel userCategoryModel = new UserCategoryModel();
-                                userCategoryModel.setCategoryCode(resultBean.getCategoryCode());
-                                userCategoryModel.setCategoryId(resultBean.getCategoryId());
-                                userCategoryModel.setCategoryName(resultBean.getCategoryName());
-                                userCategoryModel.setStatus(0);
-                                userCategoryModel.setUpdateTime(resultBean.getUpdateTime());
-                                userCategoryModel.save();
+                                DatabaseManager.save(resultBean);
                             }
                         }
                         SharePrefenceUtils.putLong("categorys_refreshTime", list.get(list.size() - 1).getUpdateTime());
-                    }*/
+                    }
                 } catch (Exception e) {
 
                 }