Commit 17275b3a7fe7225740912968f90c72e53a2888d4

Authored by 杨帅
2 parents 4009eb8a c48e5ab4
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/presenter/RaceNameListPresenter.java
@@ -177,7 +177,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { @@ -177,7 +177,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> {
177 if (getView() != null) { 177 if (getView() != null) {
178 QMUITipDialogUtil.dismessDialog(); 178 QMUITipDialogUtil.dismessDialog();
179 if (null != callBack) { 179 if (null != callBack) {
180 - callBack.onSuccess(baseInfo.getData().getFenceId(), baseInfo.getData().getEntityName()); 180 + callBack.onSuccess(baseInfo.getData().getFenceId(), baseInfo.getData().getEntityName(),baseInfo.getData().getIsDelete());
181 } 181 }
182 } 182 }
183 } 183 }
@@ -185,7 +185,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> { @@ -185,7 +185,7 @@ public class RaceNameListPresenter extends MvpBasePresenter<RaceNameListView> {
185 } 185 }
186 186
187 public interface CallBack { 187 public interface CallBack {
188 - void onSuccess(String fenceId, String entityName); 188 + void onSuccess(String fenceId, String entityName,String isDelete);
189 189
190 void onFailed(); 190 void onFailed();
191 } 191 }
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/frame/view/RaceNameListView.java
@@ -169,10 +169,15 @@ public class RaceNameListView implements MvpView, OnFenceListener { @@ -169,10 +169,15 @@ public class RaceNameListView implements MvpView, OnFenceListener {
169 //先校验 169 //先校验
170 fragment.getPresenter().checkShoeLine(fragment.getActivity(), eventShoeLinesBean.getId(), eventShoeLinesBean.getEventId(), new RaceNameListPresenter.CallBack() { 170 fragment.getPresenter().checkShoeLine(fragment.getActivity(), eventShoeLinesBean.getId(), eventShoeLinesBean.getEventId(), new RaceNameListPresenter.CallBack() {
171 @Override 171 @Override
172 - public void onSuccess(String fenceId, String entityName) { 172 + public void onSuccess(String fenceId, String entityName,String isDelete) {
173 if (null == fragment.getActivity()) { 173 if (null == fragment.getActivity()) {
174 return; 174 return;
175 } 175 }
  176 + if(isDelete != null && isDelete.equals("1")){
  177 + delectShoeLine(position);
  178 + AlertUtil.showDeftToast(fragment.getActivity(),"该轨迹已被删除");
  179 + return;
  180 + }
176 //判断是否为空 181 //判断是否为空
177 if (!TextUtils.isEmpty(fenceId) && !TextUtils.isEmpty(entityName)) { 182 if (!TextUtils.isEmpty(fenceId) && !TextUtils.isEmpty(entityName)) {
178 List<Long> fenceIdList = new ArrayList<>(); 183 List<Long> fenceIdList = new ArrayList<>();
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/model/CheckShoeLineBean.java
@@ -14,6 +14,7 @@ public class CheckShoeLineBean { @@ -14,6 +14,7 @@ public class CheckShoeLineBean {
14 14
15 private String fenceId; 15 private String fenceId;
16 private String entityName; 16 private String entityName;
  17 + private String isDelete;
17 18
18 public String getFenceId() { 19 public String getFenceId() {
19 return fenceId; 20 return fenceId;
@@ -30,4 +31,12 @@ public class CheckShoeLineBean { @@ -30,4 +31,12 @@ public class CheckShoeLineBean {
30 public void setEntityName(String entityName) { 31 public void setEntityName(String entityName) {
31 this.entityName = entityName; 32 this.entityName = entityName;
32 } 33 }
  34 +
  35 + public String getIsDelete() {
  36 + return isDelete;
  37 + }
  38 +
  39 + public void setIsDelete(String isDelete) {
  40 + this.isDelete = isDelete;
  41 + }
33 } 42 }
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/DaoMaster.java
@@ -21,18 +21,18 @@ public class DaoMaster extends AbstractDaoMaster { @@ -21,18 +21,18 @@ public class DaoMaster extends AbstractDaoMaster {
21 21
22 /** Creates underlying database table using DAOs. */ 22 /** Creates underlying database table using DAOs. */
23 public static void createAllTables(Database db, boolean ifNotExists) { 23 public static void createAllTables(Database db, boolean ifNotExists) {
24 - CollFailedEntityDao.createTable(db, ifNotExists);  
25 CollUserStepEntityDao.createTable(db, ifNotExists); 24 CollUserStepEntityDao.createTable(db, ifNotExists);
26 FailedEntityDao.createTable(db, ifNotExists); 25 FailedEntityDao.createTable(db, ifNotExists);
27 UserStepEntityDao.createTable(db, ifNotExists); 26 UserStepEntityDao.createTable(db, ifNotExists);
  27 + CollFailedEntityDao.createTable(db, ifNotExists);
28 } 28 }
29 29
30 /** Drops underlying database table using DAOs. */ 30 /** Drops underlying database table using DAOs. */
31 public static void dropAllTables(Database db, boolean ifExists) { 31 public static void dropAllTables(Database db, boolean ifExists) {
32 - CollFailedEntityDao.dropTable(db, ifExists);  
33 CollUserStepEntityDao.dropTable(db, ifExists); 32 CollUserStepEntityDao.dropTable(db, ifExists);
34 FailedEntityDao.dropTable(db, ifExists); 33 FailedEntityDao.dropTable(db, ifExists);
35 UserStepEntityDao.dropTable(db, ifExists); 34 UserStepEntityDao.dropTable(db, ifExists);
  35 + CollFailedEntityDao.dropTable(db, ifExists);
36 } 36 }
37 37
38 /** 38 /**
@@ -51,10 +51,10 @@ public class DaoMaster extends AbstractDaoMaster { @@ -51,10 +51,10 @@ public class DaoMaster extends AbstractDaoMaster {
51 51
52 public DaoMaster(Database db) { 52 public DaoMaster(Database db) {
53 super(db, SCHEMA_VERSION); 53 super(db, SCHEMA_VERSION);
54 - registerDaoClass(CollFailedEntityDao.class);  
55 registerDaoClass(CollUserStepEntityDao.class); 54 registerDaoClass(CollUserStepEntityDao.class);
56 registerDaoClass(FailedEntityDao.class); 55 registerDaoClass(FailedEntityDao.class);
57 registerDaoClass(UserStepEntityDao.class); 56 registerDaoClass(UserStepEntityDao.class);
  57 + registerDaoClass(CollFailedEntityDao.class);
58 } 58 }
59 59
60 public DaoSession newSession() { 60 public DaoSession newSession() {
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/sql/dao/DaoSession.java
@@ -8,15 +8,15 @@ import org.greenrobot.greendao.database.Database; @@ -8,15 +8,15 @@ import org.greenrobot.greendao.database.Database;
8 import org.greenrobot.greendao.identityscope.IdentityScopeType; 8 import org.greenrobot.greendao.identityscope.IdentityScopeType;
9 import org.greenrobot.greendao.internal.DaoConfig; 9 import org.greenrobot.greendao.internal.DaoConfig;
10 10
11 -import com.cnlive.moudle.pedometer.sql.entity.CollFailedEntity;  
12 import com.cnlive.moudle.pedometer.sql.entity.CollUserStepEntity; 11 import com.cnlive.moudle.pedometer.sql.entity.CollUserStepEntity;
13 import com.cnlive.moudle.pedometer.sql.entity.FailedEntity; 12 import com.cnlive.moudle.pedometer.sql.entity.FailedEntity;
14 import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity; 13 import com.cnlive.moudle.pedometer.sql.entity.UserStepEntity;
  14 +import com.cnlive.moudle.pedometer.sql.entity.CollFailedEntity;
15 15
16 -import com.cnlive.moudle.pedometer.sql.dao.CollFailedEntityDao;  
17 import com.cnlive.moudle.pedometer.sql.dao.CollUserStepEntityDao; 16 import com.cnlive.moudle.pedometer.sql.dao.CollUserStepEntityDao;
18 import com.cnlive.moudle.pedometer.sql.dao.FailedEntityDao; 17 import com.cnlive.moudle.pedometer.sql.dao.FailedEntityDao;
19 import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao; 18 import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao;
  19 +import com.cnlive.moudle.pedometer.sql.dao.CollFailedEntityDao;
20 20
21 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. 21 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
22 22
@@ -27,23 +27,20 @@ import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao; @@ -27,23 +27,20 @@ import com.cnlive.moudle.pedometer.sql.dao.UserStepEntityDao;
27 */ 27 */
28 public class DaoSession extends AbstractDaoSession { 28 public class DaoSession extends AbstractDaoSession {
29 29
30 - private final DaoConfig collFailedEntityDaoConfig;  
31 private final DaoConfig collUserStepEntityDaoConfig; 30 private final DaoConfig collUserStepEntityDaoConfig;
32 private final DaoConfig failedEntityDaoConfig; 31 private final DaoConfig failedEntityDaoConfig;
33 private final DaoConfig userStepEntityDaoConfig; 32 private final DaoConfig userStepEntityDaoConfig;
  33 + private final DaoConfig collFailedEntityDaoConfig;
34 34
35 - private final CollFailedEntityDao collFailedEntityDao;  
36 private final CollUserStepEntityDao collUserStepEntityDao; 35 private final CollUserStepEntityDao collUserStepEntityDao;
37 private final FailedEntityDao failedEntityDao; 36 private final FailedEntityDao failedEntityDao;
38 private final UserStepEntityDao userStepEntityDao; 37 private final UserStepEntityDao userStepEntityDao;
  38 + private final CollFailedEntityDao collFailedEntityDao;
39 39
40 public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig> 40 public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
41 daoConfigMap) { 41 daoConfigMap) {
42 super(db); 42 super(db);
43 43
44 - collFailedEntityDaoConfig = daoConfigMap.get(CollFailedEntityDao.class).clone();  
45 - collFailedEntityDaoConfig.initIdentityScope(type);  
46 -  
47 collUserStepEntityDaoConfig = daoConfigMap.get(CollUserStepEntityDao.class).clone(); 44 collUserStepEntityDaoConfig = daoConfigMap.get(CollUserStepEntityDao.class).clone();
48 collUserStepEntityDaoConfig.initIdentityScope(type); 45 collUserStepEntityDaoConfig.initIdentityScope(type);
49 46
@@ -53,26 +50,25 @@ public class DaoSession extends AbstractDaoSession { @@ -53,26 +50,25 @@ public class DaoSession extends AbstractDaoSession {
53 userStepEntityDaoConfig = daoConfigMap.get(UserStepEntityDao.class).clone(); 50 userStepEntityDaoConfig = daoConfigMap.get(UserStepEntityDao.class).clone();
54 userStepEntityDaoConfig.initIdentityScope(type); 51 userStepEntityDaoConfig.initIdentityScope(type);
55 52
56 - collFailedEntityDao = new CollFailedEntityDao(collFailedEntityDaoConfig, this); 53 + collFailedEntityDaoConfig = daoConfigMap.get(CollFailedEntityDao.class).clone();
  54 + collFailedEntityDaoConfig.initIdentityScope(type);
  55 +
57 collUserStepEntityDao = new CollUserStepEntityDao(collUserStepEntityDaoConfig, this); 56 collUserStepEntityDao = new CollUserStepEntityDao(collUserStepEntityDaoConfig, this);
58 failedEntityDao = new FailedEntityDao(failedEntityDaoConfig, this); 57 failedEntityDao = new FailedEntityDao(failedEntityDaoConfig, this);
59 userStepEntityDao = new UserStepEntityDao(userStepEntityDaoConfig, this); 58 userStepEntityDao = new UserStepEntityDao(userStepEntityDaoConfig, this);
  59 + collFailedEntityDao = new CollFailedEntityDao(collFailedEntityDaoConfig, this);
60 60
61 - registerDao(CollFailedEntity.class, collFailedEntityDao);  
62 registerDao(CollUserStepEntity.class, collUserStepEntityDao); 61 registerDao(CollUserStepEntity.class, collUserStepEntityDao);
63 registerDao(FailedEntity.class, failedEntityDao); 62 registerDao(FailedEntity.class, failedEntityDao);
64 registerDao(UserStepEntity.class, userStepEntityDao); 63 registerDao(UserStepEntity.class, userStepEntityDao);
  64 + registerDao(CollFailedEntity.class, collFailedEntityDao);
65 } 65 }
66 66
67 public void clear() { 67 public void clear() {
68 - collFailedEntityDaoConfig.clearIdentityScope();  
69 collUserStepEntityDaoConfig.clearIdentityScope(); 68 collUserStepEntityDaoConfig.clearIdentityScope();
70 failedEntityDaoConfig.clearIdentityScope(); 69 failedEntityDaoConfig.clearIdentityScope();
71 userStepEntityDaoConfig.clearIdentityScope(); 70 userStepEntityDaoConfig.clearIdentityScope();
72 - }  
73 -  
74 - public CollFailedEntityDao getCollFailedEntityDao() {  
75 - return collFailedEntityDao; 71 + collFailedEntityDaoConfig.clearIdentityScope();
76 } 72 }
77 73
78 public CollUserStepEntityDao getCollUserStepEntityDao() { 74 public CollUserStepEntityDao getCollUserStepEntityDao() {
@@ -87,4 +83,8 @@ public class DaoSession extends AbstractDaoSession { @@ -87,4 +83,8 @@ public class DaoSession extends AbstractDaoSession {
87 return userStepEntityDao; 83 return userStepEntityDao;
88 } 84 }
89 85
  86 + public CollFailedEntityDao getCollFailedEntityDao() {
  87 + return collFailedEntityDao;
  88 + }
  89 +
90 } 90 }