diff --git a/app/src/main/java/com/casic/detector/bean/TaskBean.java b/app/src/main/java/com/casic/detector/bean/TaskBean.java index fb1e229..d6e1101 100644 --- a/app/src/main/java/com/casic/detector/bean/TaskBean.java +++ b/app/src/main/java/com/casic/detector/bean/TaskBean.java @@ -10,27 +10,26 @@ private Long id;//主键ID private String scanner; - private String taskId; private String desc; - // ?? - private String taskdeId; - private String markId; - private String lid; + private String taskId; + private String taskCode; + private String markerId; + private String markerRealId; private String lng; private String lat; private String state; - @Generated(hash = 744278843) - public TaskBean(Long id, String scanner, String taskId, String desc, - String taskdeId, String markId, String lid, String lng, String lat, - String state) { + @Generated(hash = 1891433912) + public TaskBean(Long id, String scanner, String desc, String taskId, + String taskCode, String markerId, String markerRealId, String lng, + String lat, String state) { this.id = id; this.scanner = scanner; - this.taskId = taskId; this.desc = desc; - this.taskdeId = taskdeId; - this.markId = markId; - this.lid = lid; + this.taskId = taskId; + this.taskCode = taskCode; + this.markerId = markerId; + this.markerRealId = markerRealId; this.lng = lng; this.lat = lat; this.state = state; @@ -56,14 +55,6 @@ this.scanner = scanner; } - public String getTaskId() { - return this.taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - public String getDesc() { return this.desc; } @@ -72,28 +63,36 @@ this.desc = desc; } - public String getTaskdeId() { - return this.taskdeId; + public String getTaskId() { + return this.taskId; } - public void setTaskdeId(String taskdeId) { - this.taskdeId = taskdeId; + public void setTaskId(String taskId) { + this.taskId = taskId; } - public String getMarkId() { - return this.markId; + public String getTaskCode() { + return this.taskCode; } - public void setMarkId(String markId) { - this.markId = markId; + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; } - public String getLid() { - return this.lid; + public String getMarkerId() { + return this.markerId; } - public void setLid(String lid) { - this.lid = lid; + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerRealId() { + return this.markerRealId; + } + + public void setMarkerRealId(String markerRealId) { + this.markerRealId = markerRealId; } public String getLng() { diff --git a/app/src/main/java/com/casic/detector/bean/TaskBean.java b/app/src/main/java/com/casic/detector/bean/TaskBean.java index fb1e229..d6e1101 100644 --- a/app/src/main/java/com/casic/detector/bean/TaskBean.java +++ b/app/src/main/java/com/casic/detector/bean/TaskBean.java @@ -10,27 +10,26 @@ private Long id;//主键ID private String scanner; - private String taskId; private String desc; - // ?? - private String taskdeId; - private String markId; - private String lid; + private String taskId; + private String taskCode; + private String markerId; + private String markerRealId; private String lng; private String lat; private String state; - @Generated(hash = 744278843) - public TaskBean(Long id, String scanner, String taskId, String desc, - String taskdeId, String markId, String lid, String lng, String lat, - String state) { + @Generated(hash = 1891433912) + public TaskBean(Long id, String scanner, String desc, String taskId, + String taskCode, String markerId, String markerRealId, String lng, + String lat, String state) { this.id = id; this.scanner = scanner; - this.taskId = taskId; this.desc = desc; - this.taskdeId = taskdeId; - this.markId = markId; - this.lid = lid; + this.taskId = taskId; + this.taskCode = taskCode; + this.markerId = markerId; + this.markerRealId = markerRealId; this.lng = lng; this.lat = lat; this.state = state; @@ -56,14 +55,6 @@ this.scanner = scanner; } - public String getTaskId() { - return this.taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - public String getDesc() { return this.desc; } @@ -72,28 +63,36 @@ this.desc = desc; } - public String getTaskdeId() { - return this.taskdeId; + public String getTaskId() { + return this.taskId; } - public void setTaskdeId(String taskdeId) { - this.taskdeId = taskdeId; + public void setTaskId(String taskId) { + this.taskId = taskId; } - public String getMarkId() { - return this.markId; + public String getTaskCode() { + return this.taskCode; } - public void setMarkId(String markId) { - this.markId = markId; + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; } - public String getLid() { - return this.lid; + public String getMarkerId() { + return this.markerId; } - public void setLid(String lid) { - this.lid = lid; + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerRealId() { + return this.markerRealId; + } + + public void setMarkerRealId(String markerRealId) { + this.markerRealId = markerRealId; } public String getLng() { diff --git a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java index bc7b50a..13c5038 100644 --- a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java +++ b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java @@ -26,11 +26,11 @@ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property Scanner = new Property(1, String.class, "scanner", false, "SCANNER"); - public final static Property TaskId = new Property(2, String.class, "taskId", false, "TASK_ID"); - public final static Property Desc = new Property(3, String.class, "desc", false, "DESC"); - public final static Property TaskdeId = new Property(4, String.class, "taskdeId", false, "TASKDE_ID"); - public final static Property MarkId = new Property(5, String.class, "markId", false, "MARK_ID"); - public final static Property Lid = new Property(6, String.class, "lid", false, "LID"); + public final static Property Desc = new Property(2, String.class, "desc", false, "DESC"); + public final static Property TaskId = new Property(3, String.class, "taskId", false, "TASK_ID"); + public final static Property TaskCode = new Property(4, String.class, "taskCode", false, "TASK_CODE"); + public final static Property MarkerId = new Property(5, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerRealId = new Property(6, String.class, "markerRealId", false, "MARKER_REAL_ID"); public final static Property Lng = new Property(7, String.class, "lng", false, "LNG"); public final static Property Lat = new Property(8, String.class, "lat", false, "LAT"); public final static Property State = new Property(9, String.class, "state", false, "STATE"); @@ -53,11 +53,11 @@ db.execSQL("CREATE TABLE " + constraint + "\"TASK_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"SCANNER\" TEXT," + // 1: scanner - "\"TASK_ID\" TEXT," + // 2: taskId - "\"DESC\" TEXT," + // 3: desc - "\"TASKDE_ID\" TEXT," + // 4: taskdeId - "\"MARK_ID\" TEXT," + // 5: markId - "\"LID\" TEXT," + // 6: lid + "\"DESC\" TEXT," + // 2: desc + "\"TASK_ID\" TEXT," + // 3: taskId + "\"TASK_CODE\" TEXT," + // 4: taskCode + "\"MARKER_ID\" TEXT," + // 5: markerId + "\"MARKER_REAL_ID\" TEXT," + // 6: markerRealId "\"LNG\" TEXT," + // 7: lng "\"LAT\" TEXT," + // 8: lat "\"STATE\" TEXT);"); // 9: state @@ -77,42 +77,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -132,42 +132,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -189,11 +189,11 @@ TaskBean entity = new TaskBean( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // scanner - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // desc - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskdeId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lid + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // desc + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // taskId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskCode + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markerId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // markerRealId cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lng cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lat cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // state @@ -205,11 +205,11 @@ public void readEntity(Cursor cursor, TaskBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setScanner(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setTaskId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setDesc(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setTaskdeId(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setMarkId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLid(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setDesc(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTaskId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setTaskCode(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setMarkerId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setMarkerRealId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setLng(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setLat(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setState(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); diff --git a/app/src/main/java/com/casic/detector/bean/TaskBean.java b/app/src/main/java/com/casic/detector/bean/TaskBean.java index fb1e229..d6e1101 100644 --- a/app/src/main/java/com/casic/detector/bean/TaskBean.java +++ b/app/src/main/java/com/casic/detector/bean/TaskBean.java @@ -10,27 +10,26 @@ private Long id;//主键ID private String scanner; - private String taskId; private String desc; - // ?? - private String taskdeId; - private String markId; - private String lid; + private String taskId; + private String taskCode; + private String markerId; + private String markerRealId; private String lng; private String lat; private String state; - @Generated(hash = 744278843) - public TaskBean(Long id, String scanner, String taskId, String desc, - String taskdeId, String markId, String lid, String lng, String lat, - String state) { + @Generated(hash = 1891433912) + public TaskBean(Long id, String scanner, String desc, String taskId, + String taskCode, String markerId, String markerRealId, String lng, + String lat, String state) { this.id = id; this.scanner = scanner; - this.taskId = taskId; this.desc = desc; - this.taskdeId = taskdeId; - this.markId = markId; - this.lid = lid; + this.taskId = taskId; + this.taskCode = taskCode; + this.markerId = markerId; + this.markerRealId = markerRealId; this.lng = lng; this.lat = lat; this.state = state; @@ -56,14 +55,6 @@ this.scanner = scanner; } - public String getTaskId() { - return this.taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - public String getDesc() { return this.desc; } @@ -72,28 +63,36 @@ this.desc = desc; } - public String getTaskdeId() { - return this.taskdeId; + public String getTaskId() { + return this.taskId; } - public void setTaskdeId(String taskdeId) { - this.taskdeId = taskdeId; + public void setTaskId(String taskId) { + this.taskId = taskId; } - public String getMarkId() { - return this.markId; + public String getTaskCode() { + return this.taskCode; } - public void setMarkId(String markId) { - this.markId = markId; + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; } - public String getLid() { - return this.lid; + public String getMarkerId() { + return this.markerId; } - public void setLid(String lid) { - this.lid = lid; + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerRealId() { + return this.markerRealId; + } + + public void setMarkerRealId(String markerRealId) { + this.markerRealId = markerRealId; } public String getLng() { diff --git a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java index bc7b50a..13c5038 100644 --- a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java +++ b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java @@ -26,11 +26,11 @@ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property Scanner = new Property(1, String.class, "scanner", false, "SCANNER"); - public final static Property TaskId = new Property(2, String.class, "taskId", false, "TASK_ID"); - public final static Property Desc = new Property(3, String.class, "desc", false, "DESC"); - public final static Property TaskdeId = new Property(4, String.class, "taskdeId", false, "TASKDE_ID"); - public final static Property MarkId = new Property(5, String.class, "markId", false, "MARK_ID"); - public final static Property Lid = new Property(6, String.class, "lid", false, "LID"); + public final static Property Desc = new Property(2, String.class, "desc", false, "DESC"); + public final static Property TaskId = new Property(3, String.class, "taskId", false, "TASK_ID"); + public final static Property TaskCode = new Property(4, String.class, "taskCode", false, "TASK_CODE"); + public final static Property MarkerId = new Property(5, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerRealId = new Property(6, String.class, "markerRealId", false, "MARKER_REAL_ID"); public final static Property Lng = new Property(7, String.class, "lng", false, "LNG"); public final static Property Lat = new Property(8, String.class, "lat", false, "LAT"); public final static Property State = new Property(9, String.class, "state", false, "STATE"); @@ -53,11 +53,11 @@ db.execSQL("CREATE TABLE " + constraint + "\"TASK_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"SCANNER\" TEXT," + // 1: scanner - "\"TASK_ID\" TEXT," + // 2: taskId - "\"DESC\" TEXT," + // 3: desc - "\"TASKDE_ID\" TEXT," + // 4: taskdeId - "\"MARK_ID\" TEXT," + // 5: markId - "\"LID\" TEXT," + // 6: lid + "\"DESC\" TEXT," + // 2: desc + "\"TASK_ID\" TEXT," + // 3: taskId + "\"TASK_CODE\" TEXT," + // 4: taskCode + "\"MARKER_ID\" TEXT," + // 5: markerId + "\"MARKER_REAL_ID\" TEXT," + // 6: markerRealId "\"LNG\" TEXT," + // 7: lng "\"LAT\" TEXT," + // 8: lat "\"STATE\" TEXT);"); // 9: state @@ -77,42 +77,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -132,42 +132,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -189,11 +189,11 @@ TaskBean entity = new TaskBean( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // scanner - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // desc - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskdeId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lid + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // desc + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // taskId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskCode + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markerId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // markerRealId cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lng cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lat cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // state @@ -205,11 +205,11 @@ public void readEntity(Cursor cursor, TaskBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setScanner(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setTaskId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setDesc(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setTaskdeId(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setMarkId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLid(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setDesc(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTaskId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setTaskCode(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setMarkerId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setMarkerRealId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setLng(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setLat(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setState(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); diff --git a/app/src/main/java/com/casic/detector/model/TaskModel.java b/app/src/main/java/com/casic/detector/model/TaskModel.java new file mode 100644 index 0000000..4530941 --- /dev/null +++ b/app/src/main/java/com/casic/detector/model/TaskModel.java @@ -0,0 +1,265 @@ +package com.casic.detector.model; + +import java.util.List; + +public class TaskModel { + + private String success; + private List message; + + public String getSuccess() { + return success; + } + + public void setSuccess(String success) { + this.success = success; + } + + public List getMessage() { + return message; + } + + public void setMessage(List message) { + this.message = message; + } + + public static class MessageModel { + private int id; + private String taskCode; + private String description; + private String deployDate; + private Object beginDate; + private Object endDate; + private String status; + private String creatorId; + private String creatorName; + private String patrolerId; + private String patrolerName; + private int isValid; + private List taskDetailInfos; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDeployDate() { + return deployDate; + } + + public void setDeployDate(String deployDate) { + this.deployDate = deployDate; + } + + public Object getBeginDate() { + return beginDate; + } + + public void setBeginDate(Object beginDate) { + this.beginDate = beginDate; + } + + public Object getEndDate() { + return endDate; + } + + public void setEndDate(Object endDate) { + this.endDate = endDate; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getCreatorId() { + return creatorId; + } + + public void setCreatorId(String creatorId) { + this.creatorId = creatorId; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getPatrolerId() { + return patrolerId; + } + + public void setPatrolerId(String patrolerId) { + this.patrolerId = patrolerId; + } + + public String getPatrolerName() { + return patrolerName; + } + + public void setPatrolerName(String patrolerName) { + this.patrolerName = patrolerName; + } + + public int getIsValid() { + return isValid; + } + + public void setIsValid(int isValid) { + this.isValid = isValid; + } + + public List getTaskDetailInfos() { + return taskDetailInfos; + } + + public void setTaskDetailInfos(List taskDetailInfos) { + this.taskDetailInfos = taskDetailInfos; + } + + public static class TaskDetailInfosModel { + private int id; + private String taskId; + private String taskCode; + private Object markerName; + private int markerId; + private String markerIdReal; + private double longitude; + private double latitude; + private int isChecked; + private int isNormal; + private Object imagePath; + private Object description; + private Object finishTime; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public Object getMarkerName() { + return markerName; + } + + public void setMarkerName(Object markerName) { + this.markerName = markerName; + } + + public int getMarkerId() { + return markerId; + } + + public void setMarkerId(int markerId) { + this.markerId = markerId; + } + + public String getMarkerIdReal() { + return markerIdReal; + } + + public void setMarkerIdReal(String markerIdReal) { + this.markerIdReal = markerIdReal; + } + + public double getLongitude() { + return longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public double getLatitude() { + return latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public int getIsChecked() { + return isChecked; + } + + public void setIsChecked(int isChecked) { + this.isChecked = isChecked; + } + + public int getIsNormal() { + return isNormal; + } + + public void setIsNormal(int isNormal) { + this.isNormal = isNormal; + } + + public Object getImagePath() { + return imagePath; + } + + public void setImagePath(Object imagePath) { + this.imagePath = imagePath; + } + + public Object getDescription() { + return description; + } + + public void setDescription(Object description) { + this.description = description; + } + + public Object getFinishTime() { + return finishTime; + } + + public void setFinishTime(Object finishTime) { + this.finishTime = finishTime; + } + } + } +} diff --git a/app/src/main/java/com/casic/detector/bean/TaskBean.java b/app/src/main/java/com/casic/detector/bean/TaskBean.java index fb1e229..d6e1101 100644 --- a/app/src/main/java/com/casic/detector/bean/TaskBean.java +++ b/app/src/main/java/com/casic/detector/bean/TaskBean.java @@ -10,27 +10,26 @@ private Long id;//主键ID private String scanner; - private String taskId; private String desc; - // ?? - private String taskdeId; - private String markId; - private String lid; + private String taskId; + private String taskCode; + private String markerId; + private String markerRealId; private String lng; private String lat; private String state; - @Generated(hash = 744278843) - public TaskBean(Long id, String scanner, String taskId, String desc, - String taskdeId, String markId, String lid, String lng, String lat, - String state) { + @Generated(hash = 1891433912) + public TaskBean(Long id, String scanner, String desc, String taskId, + String taskCode, String markerId, String markerRealId, String lng, + String lat, String state) { this.id = id; this.scanner = scanner; - this.taskId = taskId; this.desc = desc; - this.taskdeId = taskdeId; - this.markId = markId; - this.lid = lid; + this.taskId = taskId; + this.taskCode = taskCode; + this.markerId = markerId; + this.markerRealId = markerRealId; this.lng = lng; this.lat = lat; this.state = state; @@ -56,14 +55,6 @@ this.scanner = scanner; } - public String getTaskId() { - return this.taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - public String getDesc() { return this.desc; } @@ -72,28 +63,36 @@ this.desc = desc; } - public String getTaskdeId() { - return this.taskdeId; + public String getTaskId() { + return this.taskId; } - public void setTaskdeId(String taskdeId) { - this.taskdeId = taskdeId; + public void setTaskId(String taskId) { + this.taskId = taskId; } - public String getMarkId() { - return this.markId; + public String getTaskCode() { + return this.taskCode; } - public void setMarkId(String markId) { - this.markId = markId; + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; } - public String getLid() { - return this.lid; + public String getMarkerId() { + return this.markerId; } - public void setLid(String lid) { - this.lid = lid; + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerRealId() { + return this.markerRealId; + } + + public void setMarkerRealId(String markerRealId) { + this.markerRealId = markerRealId; } public String getLng() { diff --git a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java index bc7b50a..13c5038 100644 --- a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java +++ b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java @@ -26,11 +26,11 @@ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property Scanner = new Property(1, String.class, "scanner", false, "SCANNER"); - public final static Property TaskId = new Property(2, String.class, "taskId", false, "TASK_ID"); - public final static Property Desc = new Property(3, String.class, "desc", false, "DESC"); - public final static Property TaskdeId = new Property(4, String.class, "taskdeId", false, "TASKDE_ID"); - public final static Property MarkId = new Property(5, String.class, "markId", false, "MARK_ID"); - public final static Property Lid = new Property(6, String.class, "lid", false, "LID"); + public final static Property Desc = new Property(2, String.class, "desc", false, "DESC"); + public final static Property TaskId = new Property(3, String.class, "taskId", false, "TASK_ID"); + public final static Property TaskCode = new Property(4, String.class, "taskCode", false, "TASK_CODE"); + public final static Property MarkerId = new Property(5, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerRealId = new Property(6, String.class, "markerRealId", false, "MARKER_REAL_ID"); public final static Property Lng = new Property(7, String.class, "lng", false, "LNG"); public final static Property Lat = new Property(8, String.class, "lat", false, "LAT"); public final static Property State = new Property(9, String.class, "state", false, "STATE"); @@ -53,11 +53,11 @@ db.execSQL("CREATE TABLE " + constraint + "\"TASK_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"SCANNER\" TEXT," + // 1: scanner - "\"TASK_ID\" TEXT," + // 2: taskId - "\"DESC\" TEXT," + // 3: desc - "\"TASKDE_ID\" TEXT," + // 4: taskdeId - "\"MARK_ID\" TEXT," + // 5: markId - "\"LID\" TEXT," + // 6: lid + "\"DESC\" TEXT," + // 2: desc + "\"TASK_ID\" TEXT," + // 3: taskId + "\"TASK_CODE\" TEXT," + // 4: taskCode + "\"MARKER_ID\" TEXT," + // 5: markerId + "\"MARKER_REAL_ID\" TEXT," + // 6: markerRealId "\"LNG\" TEXT," + // 7: lng "\"LAT\" TEXT," + // 8: lat "\"STATE\" TEXT);"); // 9: state @@ -77,42 +77,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -132,42 +132,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -189,11 +189,11 @@ TaskBean entity = new TaskBean( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // scanner - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // desc - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskdeId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lid + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // desc + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // taskId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskCode + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markerId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // markerRealId cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lng cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lat cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // state @@ -205,11 +205,11 @@ public void readEntity(Cursor cursor, TaskBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setScanner(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setTaskId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setDesc(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setTaskdeId(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setMarkId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLid(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setDesc(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTaskId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setTaskCode(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setMarkerId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setMarkerRealId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setLng(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setLat(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setState(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); diff --git a/app/src/main/java/com/casic/detector/model/TaskModel.java b/app/src/main/java/com/casic/detector/model/TaskModel.java new file mode 100644 index 0000000..4530941 --- /dev/null +++ b/app/src/main/java/com/casic/detector/model/TaskModel.java @@ -0,0 +1,265 @@ +package com.casic.detector.model; + +import java.util.List; + +public class TaskModel { + + private String success; + private List message; + + public String getSuccess() { + return success; + } + + public void setSuccess(String success) { + this.success = success; + } + + public List getMessage() { + return message; + } + + public void setMessage(List message) { + this.message = message; + } + + public static class MessageModel { + private int id; + private String taskCode; + private String description; + private String deployDate; + private Object beginDate; + private Object endDate; + private String status; + private String creatorId; + private String creatorName; + private String patrolerId; + private String patrolerName; + private int isValid; + private List taskDetailInfos; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDeployDate() { + return deployDate; + } + + public void setDeployDate(String deployDate) { + this.deployDate = deployDate; + } + + public Object getBeginDate() { + return beginDate; + } + + public void setBeginDate(Object beginDate) { + this.beginDate = beginDate; + } + + public Object getEndDate() { + return endDate; + } + + public void setEndDate(Object endDate) { + this.endDate = endDate; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getCreatorId() { + return creatorId; + } + + public void setCreatorId(String creatorId) { + this.creatorId = creatorId; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getPatrolerId() { + return patrolerId; + } + + public void setPatrolerId(String patrolerId) { + this.patrolerId = patrolerId; + } + + public String getPatrolerName() { + return patrolerName; + } + + public void setPatrolerName(String patrolerName) { + this.patrolerName = patrolerName; + } + + public int getIsValid() { + return isValid; + } + + public void setIsValid(int isValid) { + this.isValid = isValid; + } + + public List getTaskDetailInfos() { + return taskDetailInfos; + } + + public void setTaskDetailInfos(List taskDetailInfos) { + this.taskDetailInfos = taskDetailInfos; + } + + public static class TaskDetailInfosModel { + private int id; + private String taskId; + private String taskCode; + private Object markerName; + private int markerId; + private String markerIdReal; + private double longitude; + private double latitude; + private int isChecked; + private int isNormal; + private Object imagePath; + private Object description; + private Object finishTime; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public Object getMarkerName() { + return markerName; + } + + public void setMarkerName(Object markerName) { + this.markerName = markerName; + } + + public int getMarkerId() { + return markerId; + } + + public void setMarkerId(int markerId) { + this.markerId = markerId; + } + + public String getMarkerIdReal() { + return markerIdReal; + } + + public void setMarkerIdReal(String markerIdReal) { + this.markerIdReal = markerIdReal; + } + + public double getLongitude() { + return longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public double getLatitude() { + return latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public int getIsChecked() { + return isChecked; + } + + public void setIsChecked(int isChecked) { + this.isChecked = isChecked; + } + + public int getIsNormal() { + return isNormal; + } + + public void setIsNormal(int isNormal) { + this.isNormal = isNormal; + } + + public Object getImagePath() { + return imagePath; + } + + public void setImagePath(Object imagePath) { + this.imagePath = imagePath; + } + + public Object getDescription() { + return description; + } + + public void setDescription(Object description) { + this.description = description; + } + + public Object getFinishTime() { + return finishTime; + } + + public void setFinishTime(Object finishTime) { + this.finishTime = finishTime; + } + } + } +} diff --git a/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt index 15afed7..c40dee1 100644 --- a/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt @@ -36,4 +36,10 @@ */ @POST("/ems/marker/get-marker-images.do") suspend fun getLabelPicture(@Body requestBody: RequestBody): String + + /** + * 获取巡检工单 + */ + @GET("/ems/rs/task/get") + suspend fun getTask(@Query("userName") userName: String): String } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/bean/TaskBean.java b/app/src/main/java/com/casic/detector/bean/TaskBean.java index fb1e229..d6e1101 100644 --- a/app/src/main/java/com/casic/detector/bean/TaskBean.java +++ b/app/src/main/java/com/casic/detector/bean/TaskBean.java @@ -10,27 +10,26 @@ private Long id;//主键ID private String scanner; - private String taskId; private String desc; - // ?? - private String taskdeId; - private String markId; - private String lid; + private String taskId; + private String taskCode; + private String markerId; + private String markerRealId; private String lng; private String lat; private String state; - @Generated(hash = 744278843) - public TaskBean(Long id, String scanner, String taskId, String desc, - String taskdeId, String markId, String lid, String lng, String lat, - String state) { + @Generated(hash = 1891433912) + public TaskBean(Long id, String scanner, String desc, String taskId, + String taskCode, String markerId, String markerRealId, String lng, + String lat, String state) { this.id = id; this.scanner = scanner; - this.taskId = taskId; this.desc = desc; - this.taskdeId = taskdeId; - this.markId = markId; - this.lid = lid; + this.taskId = taskId; + this.taskCode = taskCode; + this.markerId = markerId; + this.markerRealId = markerRealId; this.lng = lng; this.lat = lat; this.state = state; @@ -56,14 +55,6 @@ this.scanner = scanner; } - public String getTaskId() { - return this.taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - public String getDesc() { return this.desc; } @@ -72,28 +63,36 @@ this.desc = desc; } - public String getTaskdeId() { - return this.taskdeId; + public String getTaskId() { + return this.taskId; } - public void setTaskdeId(String taskdeId) { - this.taskdeId = taskdeId; + public void setTaskId(String taskId) { + this.taskId = taskId; } - public String getMarkId() { - return this.markId; + public String getTaskCode() { + return this.taskCode; } - public void setMarkId(String markId) { - this.markId = markId; + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; } - public String getLid() { - return this.lid; + public String getMarkerId() { + return this.markerId; } - public void setLid(String lid) { - this.lid = lid; + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerRealId() { + return this.markerRealId; + } + + public void setMarkerRealId(String markerRealId) { + this.markerRealId = markerRealId; } public String getLng() { diff --git a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java index bc7b50a..13c5038 100644 --- a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java +++ b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java @@ -26,11 +26,11 @@ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property Scanner = new Property(1, String.class, "scanner", false, "SCANNER"); - public final static Property TaskId = new Property(2, String.class, "taskId", false, "TASK_ID"); - public final static Property Desc = new Property(3, String.class, "desc", false, "DESC"); - public final static Property TaskdeId = new Property(4, String.class, "taskdeId", false, "TASKDE_ID"); - public final static Property MarkId = new Property(5, String.class, "markId", false, "MARK_ID"); - public final static Property Lid = new Property(6, String.class, "lid", false, "LID"); + public final static Property Desc = new Property(2, String.class, "desc", false, "DESC"); + public final static Property TaskId = new Property(3, String.class, "taskId", false, "TASK_ID"); + public final static Property TaskCode = new Property(4, String.class, "taskCode", false, "TASK_CODE"); + public final static Property MarkerId = new Property(5, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerRealId = new Property(6, String.class, "markerRealId", false, "MARKER_REAL_ID"); public final static Property Lng = new Property(7, String.class, "lng", false, "LNG"); public final static Property Lat = new Property(8, String.class, "lat", false, "LAT"); public final static Property State = new Property(9, String.class, "state", false, "STATE"); @@ -53,11 +53,11 @@ db.execSQL("CREATE TABLE " + constraint + "\"TASK_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"SCANNER\" TEXT," + // 1: scanner - "\"TASK_ID\" TEXT," + // 2: taskId - "\"DESC\" TEXT," + // 3: desc - "\"TASKDE_ID\" TEXT," + // 4: taskdeId - "\"MARK_ID\" TEXT," + // 5: markId - "\"LID\" TEXT," + // 6: lid + "\"DESC\" TEXT," + // 2: desc + "\"TASK_ID\" TEXT," + // 3: taskId + "\"TASK_CODE\" TEXT," + // 4: taskCode + "\"MARKER_ID\" TEXT," + // 5: markerId + "\"MARKER_REAL_ID\" TEXT," + // 6: markerRealId "\"LNG\" TEXT," + // 7: lng "\"LAT\" TEXT," + // 8: lat "\"STATE\" TEXT);"); // 9: state @@ -77,42 +77,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -132,42 +132,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -189,11 +189,11 @@ TaskBean entity = new TaskBean( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // scanner - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // desc - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskdeId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lid + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // desc + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // taskId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskCode + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markerId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // markerRealId cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lng cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lat cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // state @@ -205,11 +205,11 @@ public void readEntity(Cursor cursor, TaskBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setScanner(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setTaskId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setDesc(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setTaskdeId(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setMarkId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLid(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setDesc(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTaskId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setTaskCode(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setMarkerId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setMarkerRealId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setLng(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setLat(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setState(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); diff --git a/app/src/main/java/com/casic/detector/model/TaskModel.java b/app/src/main/java/com/casic/detector/model/TaskModel.java new file mode 100644 index 0000000..4530941 --- /dev/null +++ b/app/src/main/java/com/casic/detector/model/TaskModel.java @@ -0,0 +1,265 @@ +package com.casic.detector.model; + +import java.util.List; + +public class TaskModel { + + private String success; + private List message; + + public String getSuccess() { + return success; + } + + public void setSuccess(String success) { + this.success = success; + } + + public List getMessage() { + return message; + } + + public void setMessage(List message) { + this.message = message; + } + + public static class MessageModel { + private int id; + private String taskCode; + private String description; + private String deployDate; + private Object beginDate; + private Object endDate; + private String status; + private String creatorId; + private String creatorName; + private String patrolerId; + private String patrolerName; + private int isValid; + private List taskDetailInfos; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDeployDate() { + return deployDate; + } + + public void setDeployDate(String deployDate) { + this.deployDate = deployDate; + } + + public Object getBeginDate() { + return beginDate; + } + + public void setBeginDate(Object beginDate) { + this.beginDate = beginDate; + } + + public Object getEndDate() { + return endDate; + } + + public void setEndDate(Object endDate) { + this.endDate = endDate; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getCreatorId() { + return creatorId; + } + + public void setCreatorId(String creatorId) { + this.creatorId = creatorId; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getPatrolerId() { + return patrolerId; + } + + public void setPatrolerId(String patrolerId) { + this.patrolerId = patrolerId; + } + + public String getPatrolerName() { + return patrolerName; + } + + public void setPatrolerName(String patrolerName) { + this.patrolerName = patrolerName; + } + + public int getIsValid() { + return isValid; + } + + public void setIsValid(int isValid) { + this.isValid = isValid; + } + + public List getTaskDetailInfos() { + return taskDetailInfos; + } + + public void setTaskDetailInfos(List taskDetailInfos) { + this.taskDetailInfos = taskDetailInfos; + } + + public static class TaskDetailInfosModel { + private int id; + private String taskId; + private String taskCode; + private Object markerName; + private int markerId; + private String markerIdReal; + private double longitude; + private double latitude; + private int isChecked; + private int isNormal; + private Object imagePath; + private Object description; + private Object finishTime; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public Object getMarkerName() { + return markerName; + } + + public void setMarkerName(Object markerName) { + this.markerName = markerName; + } + + public int getMarkerId() { + return markerId; + } + + public void setMarkerId(int markerId) { + this.markerId = markerId; + } + + public String getMarkerIdReal() { + return markerIdReal; + } + + public void setMarkerIdReal(String markerIdReal) { + this.markerIdReal = markerIdReal; + } + + public double getLongitude() { + return longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public double getLatitude() { + return latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public int getIsChecked() { + return isChecked; + } + + public void setIsChecked(int isChecked) { + this.isChecked = isChecked; + } + + public int getIsNormal() { + return isNormal; + } + + public void setIsNormal(int isNormal) { + this.isNormal = isNormal; + } + + public Object getImagePath() { + return imagePath; + } + + public void setImagePath(Object imagePath) { + this.imagePath = imagePath; + } + + public Object getDescription() { + return description; + } + + public void setDescription(Object description) { + this.description = description; + } + + public Object getFinishTime() { + return finishTime; + } + + public void setFinishTime(Object finishTime) { + this.finishTime = finishTime; + } + } + } +} diff --git a/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt index 15afed7..c40dee1 100644 --- a/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt @@ -36,4 +36,10 @@ */ @POST("/ems/marker/get-marker-images.do") suspend fun getLabelPicture(@Body requestBody: RequestBody): String + + /** + * 获取巡检工单 + */ + @GET("/ems/rs/task/get") + suspend fun getTask(@Query("userName") userName: String): String } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt index a58c09b..d47e14e 100644 --- a/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt @@ -51,4 +51,11 @@ ) return api.getLabelPicture(requestBody) } + + /** + * 获取巡检工单 + */ + suspend fun getTask(userName: String): String { + return api.getTask(userName) + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/bean/TaskBean.java b/app/src/main/java/com/casic/detector/bean/TaskBean.java index fb1e229..d6e1101 100644 --- a/app/src/main/java/com/casic/detector/bean/TaskBean.java +++ b/app/src/main/java/com/casic/detector/bean/TaskBean.java @@ -10,27 +10,26 @@ private Long id;//主键ID private String scanner; - private String taskId; private String desc; - // ?? - private String taskdeId; - private String markId; - private String lid; + private String taskId; + private String taskCode; + private String markerId; + private String markerRealId; private String lng; private String lat; private String state; - @Generated(hash = 744278843) - public TaskBean(Long id, String scanner, String taskId, String desc, - String taskdeId, String markId, String lid, String lng, String lat, - String state) { + @Generated(hash = 1891433912) + public TaskBean(Long id, String scanner, String desc, String taskId, + String taskCode, String markerId, String markerRealId, String lng, + String lat, String state) { this.id = id; this.scanner = scanner; - this.taskId = taskId; this.desc = desc; - this.taskdeId = taskdeId; - this.markId = markId; - this.lid = lid; + this.taskId = taskId; + this.taskCode = taskCode; + this.markerId = markerId; + this.markerRealId = markerRealId; this.lng = lng; this.lat = lat; this.state = state; @@ -56,14 +55,6 @@ this.scanner = scanner; } - public String getTaskId() { - return this.taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - public String getDesc() { return this.desc; } @@ -72,28 +63,36 @@ this.desc = desc; } - public String getTaskdeId() { - return this.taskdeId; + public String getTaskId() { + return this.taskId; } - public void setTaskdeId(String taskdeId) { - this.taskdeId = taskdeId; + public void setTaskId(String taskId) { + this.taskId = taskId; } - public String getMarkId() { - return this.markId; + public String getTaskCode() { + return this.taskCode; } - public void setMarkId(String markId) { - this.markId = markId; + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; } - public String getLid() { - return this.lid; + public String getMarkerId() { + return this.markerId; } - public void setLid(String lid) { - this.lid = lid; + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerRealId() { + return this.markerRealId; + } + + public void setMarkerRealId(String markerRealId) { + this.markerRealId = markerRealId; } public String getLng() { diff --git a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java index bc7b50a..13c5038 100644 --- a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java +++ b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java @@ -26,11 +26,11 @@ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property Scanner = new Property(1, String.class, "scanner", false, "SCANNER"); - public final static Property TaskId = new Property(2, String.class, "taskId", false, "TASK_ID"); - public final static Property Desc = new Property(3, String.class, "desc", false, "DESC"); - public final static Property TaskdeId = new Property(4, String.class, "taskdeId", false, "TASKDE_ID"); - public final static Property MarkId = new Property(5, String.class, "markId", false, "MARK_ID"); - public final static Property Lid = new Property(6, String.class, "lid", false, "LID"); + public final static Property Desc = new Property(2, String.class, "desc", false, "DESC"); + public final static Property TaskId = new Property(3, String.class, "taskId", false, "TASK_ID"); + public final static Property TaskCode = new Property(4, String.class, "taskCode", false, "TASK_CODE"); + public final static Property MarkerId = new Property(5, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerRealId = new Property(6, String.class, "markerRealId", false, "MARKER_REAL_ID"); public final static Property Lng = new Property(7, String.class, "lng", false, "LNG"); public final static Property Lat = new Property(8, String.class, "lat", false, "LAT"); public final static Property State = new Property(9, String.class, "state", false, "STATE"); @@ -53,11 +53,11 @@ db.execSQL("CREATE TABLE " + constraint + "\"TASK_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"SCANNER\" TEXT," + // 1: scanner - "\"TASK_ID\" TEXT," + // 2: taskId - "\"DESC\" TEXT," + // 3: desc - "\"TASKDE_ID\" TEXT," + // 4: taskdeId - "\"MARK_ID\" TEXT," + // 5: markId - "\"LID\" TEXT," + // 6: lid + "\"DESC\" TEXT," + // 2: desc + "\"TASK_ID\" TEXT," + // 3: taskId + "\"TASK_CODE\" TEXT," + // 4: taskCode + "\"MARKER_ID\" TEXT," + // 5: markerId + "\"MARKER_REAL_ID\" TEXT," + // 6: markerRealId "\"LNG\" TEXT," + // 7: lng "\"LAT\" TEXT," + // 8: lat "\"STATE\" TEXT);"); // 9: state @@ -77,42 +77,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -132,42 +132,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -189,11 +189,11 @@ TaskBean entity = new TaskBean( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // scanner - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // desc - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskdeId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lid + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // desc + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // taskId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskCode + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markerId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // markerRealId cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lng cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lat cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // state @@ -205,11 +205,11 @@ public void readEntity(Cursor cursor, TaskBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setScanner(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setTaskId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setDesc(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setTaskdeId(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setMarkId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLid(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setDesc(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTaskId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setTaskCode(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setMarkerId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setMarkerRealId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setLng(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setLat(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setState(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); diff --git a/app/src/main/java/com/casic/detector/model/TaskModel.java b/app/src/main/java/com/casic/detector/model/TaskModel.java new file mode 100644 index 0000000..4530941 --- /dev/null +++ b/app/src/main/java/com/casic/detector/model/TaskModel.java @@ -0,0 +1,265 @@ +package com.casic.detector.model; + +import java.util.List; + +public class TaskModel { + + private String success; + private List message; + + public String getSuccess() { + return success; + } + + public void setSuccess(String success) { + this.success = success; + } + + public List getMessage() { + return message; + } + + public void setMessage(List message) { + this.message = message; + } + + public static class MessageModel { + private int id; + private String taskCode; + private String description; + private String deployDate; + private Object beginDate; + private Object endDate; + private String status; + private String creatorId; + private String creatorName; + private String patrolerId; + private String patrolerName; + private int isValid; + private List taskDetailInfos; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDeployDate() { + return deployDate; + } + + public void setDeployDate(String deployDate) { + this.deployDate = deployDate; + } + + public Object getBeginDate() { + return beginDate; + } + + public void setBeginDate(Object beginDate) { + this.beginDate = beginDate; + } + + public Object getEndDate() { + return endDate; + } + + public void setEndDate(Object endDate) { + this.endDate = endDate; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getCreatorId() { + return creatorId; + } + + public void setCreatorId(String creatorId) { + this.creatorId = creatorId; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getPatrolerId() { + return patrolerId; + } + + public void setPatrolerId(String patrolerId) { + this.patrolerId = patrolerId; + } + + public String getPatrolerName() { + return patrolerName; + } + + public void setPatrolerName(String patrolerName) { + this.patrolerName = patrolerName; + } + + public int getIsValid() { + return isValid; + } + + public void setIsValid(int isValid) { + this.isValid = isValid; + } + + public List getTaskDetailInfos() { + return taskDetailInfos; + } + + public void setTaskDetailInfos(List taskDetailInfos) { + this.taskDetailInfos = taskDetailInfos; + } + + public static class TaskDetailInfosModel { + private int id; + private String taskId; + private String taskCode; + private Object markerName; + private int markerId; + private String markerIdReal; + private double longitude; + private double latitude; + private int isChecked; + private int isNormal; + private Object imagePath; + private Object description; + private Object finishTime; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public Object getMarkerName() { + return markerName; + } + + public void setMarkerName(Object markerName) { + this.markerName = markerName; + } + + public int getMarkerId() { + return markerId; + } + + public void setMarkerId(int markerId) { + this.markerId = markerId; + } + + public String getMarkerIdReal() { + return markerIdReal; + } + + public void setMarkerIdReal(String markerIdReal) { + this.markerIdReal = markerIdReal; + } + + public double getLongitude() { + return longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public double getLatitude() { + return latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public int getIsChecked() { + return isChecked; + } + + public void setIsChecked(int isChecked) { + this.isChecked = isChecked; + } + + public int getIsNormal() { + return isNormal; + } + + public void setIsNormal(int isNormal) { + this.isNormal = isNormal; + } + + public Object getImagePath() { + return imagePath; + } + + public void setImagePath(Object imagePath) { + this.imagePath = imagePath; + } + + public Object getDescription() { + return description; + } + + public void setDescription(Object description) { + this.description = description; + } + + public Object getFinishTime() { + return finishTime; + } + + public void setFinishTime(Object finishTime) { + this.finishTime = finishTime; + } + } + } +} diff --git a/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt index 15afed7..c40dee1 100644 --- a/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt @@ -36,4 +36,10 @@ */ @POST("/ems/marker/get-marker-images.do") suspend fun getLabelPicture(@Body requestBody: RequestBody): String + + /** + * 获取巡检工单 + */ + @GET("/ems/rs/task/get") + suspend fun getTask(@Query("userName") userName: String): String } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt index a58c09b..d47e14e 100644 --- a/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt @@ -51,4 +51,11 @@ ) return api.getLabelPicture(requestBody) } + + /** + * 获取巡检工单 + */ + suspend fun getTask(userName: String): String { + return api.getTask(userName) + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt b/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt index 4d33e9c..9ea2905 100644 --- a/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt +++ b/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt @@ -2,6 +2,8 @@ import com.casic.detector.base.BaseApplication import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.TaskBean +import com.casic.detector.greendao.TaskBeanDao class DataBaseManager private constructor() { companion object { @@ -12,6 +14,7 @@ } private var labelBeanDao = BaseApplication.get().getDaoSession().labelBeanDao + private var taskBeanDao = BaseApplication.get().getDaoSession().taskBeanDao fun clearTaskLabels() { labelBeanDao.deleteAll() @@ -24,4 +27,36 @@ fun loadTaskLabels(): MutableList { return labelBeanDao.loadAll() } + + fun countTaskById(id: String): Int { + val count = taskBeanDao.queryBuilder() + .where(TaskBeanDao.Properties.Id.eq(id)) + .count() + return count.toInt() + } + + fun insertTaskInformation( + scanner: String, + desc: String, + taskId: String, + taskCode: String, + markerId: String, + markerRealId: String, + lng: String, + lat: String, + state: String + ) { + val task = TaskBean() + task.scanner = scanner + task.desc = desc + task.taskId = taskId + task.taskCode = taskCode + task.markerId = markerId + task.markerRealId = markerRealId + task.lng = lng + task.lat = lat + task.state = state + + taskBeanDao.insert(task) + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/bean/TaskBean.java b/app/src/main/java/com/casic/detector/bean/TaskBean.java index fb1e229..d6e1101 100644 --- a/app/src/main/java/com/casic/detector/bean/TaskBean.java +++ b/app/src/main/java/com/casic/detector/bean/TaskBean.java @@ -10,27 +10,26 @@ private Long id;//主键ID private String scanner; - private String taskId; private String desc; - // ?? - private String taskdeId; - private String markId; - private String lid; + private String taskId; + private String taskCode; + private String markerId; + private String markerRealId; private String lng; private String lat; private String state; - @Generated(hash = 744278843) - public TaskBean(Long id, String scanner, String taskId, String desc, - String taskdeId, String markId, String lid, String lng, String lat, - String state) { + @Generated(hash = 1891433912) + public TaskBean(Long id, String scanner, String desc, String taskId, + String taskCode, String markerId, String markerRealId, String lng, + String lat, String state) { this.id = id; this.scanner = scanner; - this.taskId = taskId; this.desc = desc; - this.taskdeId = taskdeId; - this.markId = markId; - this.lid = lid; + this.taskId = taskId; + this.taskCode = taskCode; + this.markerId = markerId; + this.markerRealId = markerRealId; this.lng = lng; this.lat = lat; this.state = state; @@ -56,14 +55,6 @@ this.scanner = scanner; } - public String getTaskId() { - return this.taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - public String getDesc() { return this.desc; } @@ -72,28 +63,36 @@ this.desc = desc; } - public String getTaskdeId() { - return this.taskdeId; + public String getTaskId() { + return this.taskId; } - public void setTaskdeId(String taskdeId) { - this.taskdeId = taskdeId; + public void setTaskId(String taskId) { + this.taskId = taskId; } - public String getMarkId() { - return this.markId; + public String getTaskCode() { + return this.taskCode; } - public void setMarkId(String markId) { - this.markId = markId; + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; } - public String getLid() { - return this.lid; + public String getMarkerId() { + return this.markerId; } - public void setLid(String lid) { - this.lid = lid; + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerRealId() { + return this.markerRealId; + } + + public void setMarkerRealId(String markerRealId) { + this.markerRealId = markerRealId; } public String getLng() { diff --git a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java index bc7b50a..13c5038 100644 --- a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java +++ b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java @@ -26,11 +26,11 @@ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property Scanner = new Property(1, String.class, "scanner", false, "SCANNER"); - public final static Property TaskId = new Property(2, String.class, "taskId", false, "TASK_ID"); - public final static Property Desc = new Property(3, String.class, "desc", false, "DESC"); - public final static Property TaskdeId = new Property(4, String.class, "taskdeId", false, "TASKDE_ID"); - public final static Property MarkId = new Property(5, String.class, "markId", false, "MARK_ID"); - public final static Property Lid = new Property(6, String.class, "lid", false, "LID"); + public final static Property Desc = new Property(2, String.class, "desc", false, "DESC"); + public final static Property TaskId = new Property(3, String.class, "taskId", false, "TASK_ID"); + public final static Property TaskCode = new Property(4, String.class, "taskCode", false, "TASK_CODE"); + public final static Property MarkerId = new Property(5, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerRealId = new Property(6, String.class, "markerRealId", false, "MARKER_REAL_ID"); public final static Property Lng = new Property(7, String.class, "lng", false, "LNG"); public final static Property Lat = new Property(8, String.class, "lat", false, "LAT"); public final static Property State = new Property(9, String.class, "state", false, "STATE"); @@ -53,11 +53,11 @@ db.execSQL("CREATE TABLE " + constraint + "\"TASK_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"SCANNER\" TEXT," + // 1: scanner - "\"TASK_ID\" TEXT," + // 2: taskId - "\"DESC\" TEXT," + // 3: desc - "\"TASKDE_ID\" TEXT," + // 4: taskdeId - "\"MARK_ID\" TEXT," + // 5: markId - "\"LID\" TEXT," + // 6: lid + "\"DESC\" TEXT," + // 2: desc + "\"TASK_ID\" TEXT," + // 3: taskId + "\"TASK_CODE\" TEXT," + // 4: taskCode + "\"MARKER_ID\" TEXT," + // 5: markerId + "\"MARKER_REAL_ID\" TEXT," + // 6: markerRealId "\"LNG\" TEXT," + // 7: lng "\"LAT\" TEXT," + // 8: lat "\"STATE\" TEXT);"); // 9: state @@ -77,42 +77,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -132,42 +132,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -189,11 +189,11 @@ TaskBean entity = new TaskBean( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // scanner - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // desc - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskdeId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lid + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // desc + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // taskId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskCode + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markerId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // markerRealId cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lng cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lat cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // state @@ -205,11 +205,11 @@ public void readEntity(Cursor cursor, TaskBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setScanner(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setTaskId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setDesc(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setTaskdeId(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setMarkId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLid(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setDesc(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTaskId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setTaskCode(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setMarkerId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setMarkerRealId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setLng(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setLat(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setState(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); diff --git a/app/src/main/java/com/casic/detector/model/TaskModel.java b/app/src/main/java/com/casic/detector/model/TaskModel.java new file mode 100644 index 0000000..4530941 --- /dev/null +++ b/app/src/main/java/com/casic/detector/model/TaskModel.java @@ -0,0 +1,265 @@ +package com.casic.detector.model; + +import java.util.List; + +public class TaskModel { + + private String success; + private List message; + + public String getSuccess() { + return success; + } + + public void setSuccess(String success) { + this.success = success; + } + + public List getMessage() { + return message; + } + + public void setMessage(List message) { + this.message = message; + } + + public static class MessageModel { + private int id; + private String taskCode; + private String description; + private String deployDate; + private Object beginDate; + private Object endDate; + private String status; + private String creatorId; + private String creatorName; + private String patrolerId; + private String patrolerName; + private int isValid; + private List taskDetailInfos; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDeployDate() { + return deployDate; + } + + public void setDeployDate(String deployDate) { + this.deployDate = deployDate; + } + + public Object getBeginDate() { + return beginDate; + } + + public void setBeginDate(Object beginDate) { + this.beginDate = beginDate; + } + + public Object getEndDate() { + return endDate; + } + + public void setEndDate(Object endDate) { + this.endDate = endDate; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getCreatorId() { + return creatorId; + } + + public void setCreatorId(String creatorId) { + this.creatorId = creatorId; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getPatrolerId() { + return patrolerId; + } + + public void setPatrolerId(String patrolerId) { + this.patrolerId = patrolerId; + } + + public String getPatrolerName() { + return patrolerName; + } + + public void setPatrolerName(String patrolerName) { + this.patrolerName = patrolerName; + } + + public int getIsValid() { + return isValid; + } + + public void setIsValid(int isValid) { + this.isValid = isValid; + } + + public List getTaskDetailInfos() { + return taskDetailInfos; + } + + public void setTaskDetailInfos(List taskDetailInfos) { + this.taskDetailInfos = taskDetailInfos; + } + + public static class TaskDetailInfosModel { + private int id; + private String taskId; + private String taskCode; + private Object markerName; + private int markerId; + private String markerIdReal; + private double longitude; + private double latitude; + private int isChecked; + private int isNormal; + private Object imagePath; + private Object description; + private Object finishTime; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public Object getMarkerName() { + return markerName; + } + + public void setMarkerName(Object markerName) { + this.markerName = markerName; + } + + public int getMarkerId() { + return markerId; + } + + public void setMarkerId(int markerId) { + this.markerId = markerId; + } + + public String getMarkerIdReal() { + return markerIdReal; + } + + public void setMarkerIdReal(String markerIdReal) { + this.markerIdReal = markerIdReal; + } + + public double getLongitude() { + return longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public double getLatitude() { + return latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public int getIsChecked() { + return isChecked; + } + + public void setIsChecked(int isChecked) { + this.isChecked = isChecked; + } + + public int getIsNormal() { + return isNormal; + } + + public void setIsNormal(int isNormal) { + this.isNormal = isNormal; + } + + public Object getImagePath() { + return imagePath; + } + + public void setImagePath(Object imagePath) { + this.imagePath = imagePath; + } + + public Object getDescription() { + return description; + } + + public void setDescription(Object description) { + this.description = description; + } + + public Object getFinishTime() { + return finishTime; + } + + public void setFinishTime(Object finishTime) { + this.finishTime = finishTime; + } + } + } +} diff --git a/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt index 15afed7..c40dee1 100644 --- a/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt @@ -36,4 +36,10 @@ */ @POST("/ems/marker/get-marker-images.do") suspend fun getLabelPicture(@Body requestBody: RequestBody): String + + /** + * 获取巡检工单 + */ + @GET("/ems/rs/task/get") + suspend fun getTask(@Query("userName") userName: String): String } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt index a58c09b..d47e14e 100644 --- a/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt @@ -51,4 +51,11 @@ ) return api.getLabelPicture(requestBody) } + + /** + * 获取巡检工单 + */ + suspend fun getTask(userName: String): String { + return api.getTask(userName) + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt b/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt index 4d33e9c..9ea2905 100644 --- a/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt +++ b/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt @@ -2,6 +2,8 @@ import com.casic.detector.base.BaseApplication import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.TaskBean +import com.casic.detector.greendao.TaskBeanDao class DataBaseManager private constructor() { companion object { @@ -12,6 +14,7 @@ } private var labelBeanDao = BaseApplication.get().getDaoSession().labelBeanDao + private var taskBeanDao = BaseApplication.get().getDaoSession().taskBeanDao fun clearTaskLabels() { labelBeanDao.deleteAll() @@ -24,4 +27,36 @@ fun loadTaskLabels(): MutableList { return labelBeanDao.loadAll() } + + fun countTaskById(id: String): Int { + val count = taskBeanDao.queryBuilder() + .where(TaskBeanDao.Properties.Id.eq(id)) + .count() + return count.toInt() + } + + fun insertTaskInformation( + scanner: String, + desc: String, + taskId: String, + taskCode: String, + markerId: String, + markerRealId: String, + lng: String, + lat: String, + state: String + ) { + val task = TaskBean() + task.scanner = scanner + task.desc = desc + task.taskId = taskId + task.taskCode = taskCode + task.markerId = markerId + task.markerRealId = markerRealId + task.lng = lng + task.lat = lat + task.state = state + + taskBeanDao.insert(task) + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/view/MainActivity.kt b/app/src/main/java/com/casic/detector/view/MainActivity.kt index a77b13f..ba16ca8 100644 --- a/app/src/main/java/com/casic/detector/view/MainActivity.kt +++ b/app/src/main/java/com/casic/detector/view/MainActivity.kt @@ -32,6 +32,7 @@ import com.casic.detector.extensions.appendDownloadUrl import com.casic.detector.extensions.drawCircle import com.casic.detector.extensions.initLayoutImmersionBar +import com.casic.detector.model.TaskModel import com.casic.detector.utils.* import com.casic.detector.vm.TaskViewModel import com.casic.detector.vm.VersionViewModel @@ -42,6 +43,7 @@ import com.pengxh.kt.lite.utils.SaveKeyValues import com.pengxh.kt.lite.vm.LoadState import com.pengxh.kt.lite.widget.dialog.AlertControlDialog +import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog import com.pengxh.kt.lite.widget.dialog.NoNetworkDialog import kotlinx.android.synthetic.main.activity_main.* import kotlinx.coroutines.CoroutineScope @@ -178,6 +180,50 @@ }) } } + taskViewModel.taskResult.observe(this) { + if (it.success == "true") { + AlertMessageDialog.Builder() + .setContext(this) + .setTitle("温馨提示") + .setMessage("您有${it.message.size}个新任务!") + .setPositiveButton("知道了") + .setOnDialogButtonClickListener(object : + AlertMessageDialog.OnDialogButtonClickListener { + override fun onConfirmClick() { + saveTaskInformation(it) + } + }).build().show() + } + } + } + + private fun saveTaskInformation(it: TaskModel) { + val userName = SaveKeyValues.getValue(LocaleConstant.USER_NAME, "") as String + if (it.message.size > 0) { + it.message.forEach { messageModel -> + val count = DataBaseManager.get.countTaskById(messageModel.id.toString()) + if (count == 0) { + messageModel.taskDetailInfos.forEach { info -> + val desc = if (info.description == null) { + "" + } else { + info.description.toString() + } + DataBaseManager.get.insertTaskInformation( + userName, desc, + info.taskId.toString(), + info.taskCode.toString(), + info.markerId.toString(), + info.markerIdReal.toString(), + info.longitude.toString(), + info.latitude.toString(), + messageModel.status + ) + } + } + } + "工单下载成功!".show(context) + } } private fun showLabelsOnMap() { @@ -279,7 +325,7 @@ override fun onPopupItemClicked(position: Int) { when (position) { 0 -> updateTaskData() - 1 -> {} + 1 -> downloadTask() 2 -> versionViewModel.getApplicationVersion() 3 -> {} 4 -> {} @@ -323,6 +369,23 @@ }).build().show() } + private fun downloadTask() { + if (isNetworkConnected()) { + val userName = SaveKeyValues.getValue(LocaleConstant.USER_NAME, "") + taskViewModel.getTask(userName.toString()) + } else { + NoNetworkDialog.Builder() + .setContext(context) + .setOnDialogButtonClickListener(object : + NoNetworkDialog.OnDialogButtonClickListener { + override fun onButtonClick() { + val intent = Intent(Settings.ACTION_SETTINGS) + startActivity(intent) + } + }).build().show() + } + } + private fun observeRequestState() { versionViewModel.loadState.observe(this) { when (it) { @@ -330,6 +393,13 @@ else -> LoadingDialogHub.dismiss() } } + + taskViewModel.loadState.observe(this) { + when (it) { + LoadState.Loading -> LoadingDialogHub.show(this, "获取巡检工单中,请稍后") + else -> LoadingDialogHub.dismiss() + } + } } private fun downloadApk(url: String?) { diff --git a/app/src/main/java/com/casic/detector/bean/TaskBean.java b/app/src/main/java/com/casic/detector/bean/TaskBean.java index fb1e229..d6e1101 100644 --- a/app/src/main/java/com/casic/detector/bean/TaskBean.java +++ b/app/src/main/java/com/casic/detector/bean/TaskBean.java @@ -10,27 +10,26 @@ private Long id;//主键ID private String scanner; - private String taskId; private String desc; - // ?? - private String taskdeId; - private String markId; - private String lid; + private String taskId; + private String taskCode; + private String markerId; + private String markerRealId; private String lng; private String lat; private String state; - @Generated(hash = 744278843) - public TaskBean(Long id, String scanner, String taskId, String desc, - String taskdeId, String markId, String lid, String lng, String lat, - String state) { + @Generated(hash = 1891433912) + public TaskBean(Long id, String scanner, String desc, String taskId, + String taskCode, String markerId, String markerRealId, String lng, + String lat, String state) { this.id = id; this.scanner = scanner; - this.taskId = taskId; this.desc = desc; - this.taskdeId = taskdeId; - this.markId = markId; - this.lid = lid; + this.taskId = taskId; + this.taskCode = taskCode; + this.markerId = markerId; + this.markerRealId = markerRealId; this.lng = lng; this.lat = lat; this.state = state; @@ -56,14 +55,6 @@ this.scanner = scanner; } - public String getTaskId() { - return this.taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - public String getDesc() { return this.desc; } @@ -72,28 +63,36 @@ this.desc = desc; } - public String getTaskdeId() { - return this.taskdeId; + public String getTaskId() { + return this.taskId; } - public void setTaskdeId(String taskdeId) { - this.taskdeId = taskdeId; + public void setTaskId(String taskId) { + this.taskId = taskId; } - public String getMarkId() { - return this.markId; + public String getTaskCode() { + return this.taskCode; } - public void setMarkId(String markId) { - this.markId = markId; + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; } - public String getLid() { - return this.lid; + public String getMarkerId() { + return this.markerId; } - public void setLid(String lid) { - this.lid = lid; + public void setMarkerId(String markerId) { + this.markerId = markerId; + } + + public String getMarkerRealId() { + return this.markerRealId; + } + + public void setMarkerRealId(String markerRealId) { + this.markerRealId = markerRealId; } public String getLng() { diff --git a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java index bc7b50a..13c5038 100644 --- a/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java +++ b/app/src/main/java/com/casic/detector/greendao/TaskBeanDao.java @@ -26,11 +26,11 @@ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property Scanner = new Property(1, String.class, "scanner", false, "SCANNER"); - public final static Property TaskId = new Property(2, String.class, "taskId", false, "TASK_ID"); - public final static Property Desc = new Property(3, String.class, "desc", false, "DESC"); - public final static Property TaskdeId = new Property(4, String.class, "taskdeId", false, "TASKDE_ID"); - public final static Property MarkId = new Property(5, String.class, "markId", false, "MARK_ID"); - public final static Property Lid = new Property(6, String.class, "lid", false, "LID"); + public final static Property Desc = new Property(2, String.class, "desc", false, "DESC"); + public final static Property TaskId = new Property(3, String.class, "taskId", false, "TASK_ID"); + public final static Property TaskCode = new Property(4, String.class, "taskCode", false, "TASK_CODE"); + public final static Property MarkerId = new Property(5, String.class, "markerId", false, "MARKER_ID"); + public final static Property MarkerRealId = new Property(6, String.class, "markerRealId", false, "MARKER_REAL_ID"); public final static Property Lng = new Property(7, String.class, "lng", false, "LNG"); public final static Property Lat = new Property(8, String.class, "lat", false, "LAT"); public final static Property State = new Property(9, String.class, "state", false, "STATE"); @@ -53,11 +53,11 @@ db.execSQL("CREATE TABLE " + constraint + "\"TASK_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"SCANNER\" TEXT," + // 1: scanner - "\"TASK_ID\" TEXT," + // 2: taskId - "\"DESC\" TEXT," + // 3: desc - "\"TASKDE_ID\" TEXT," + // 4: taskdeId - "\"MARK_ID\" TEXT," + // 5: markId - "\"LID\" TEXT," + // 6: lid + "\"DESC\" TEXT," + // 2: desc + "\"TASK_ID\" TEXT," + // 3: taskId + "\"TASK_CODE\" TEXT," + // 4: taskCode + "\"MARKER_ID\" TEXT," + // 5: markerId + "\"MARKER_REAL_ID\" TEXT," + // 6: markerRealId "\"LNG\" TEXT," + // 7: lng "\"LAT\" TEXT," + // 8: lat "\"STATE\" TEXT);"); // 9: state @@ -77,42 +77,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -132,42 +132,42 @@ if (id != null) { stmt.bindLong(1, id); } - + String scanner = entity.getScanner(); if (scanner != null) { stmt.bindString(2, scanner); } - - String taskId = entity.getTaskId(); - if (taskId != null) { - stmt.bindString(3, taskId); - } - + String desc = entity.getDesc(); if (desc != null) { - stmt.bindString(4, desc); + stmt.bindString(3, desc); } - - String taskdeId = entity.getTaskdeId(); - if (taskdeId != null) { - stmt.bindString(5, taskdeId); + + String taskId = entity.getTaskId(); + if (taskId != null) { + stmt.bindString(4, taskId); } - - String markId = entity.getMarkId(); - if (markId != null) { - stmt.bindString(6, markId); + + String taskCode = entity.getTaskCode(); + if (taskCode != null) { + stmt.bindString(5, taskCode); } - - String lid = entity.getLid(); - if (lid != null) { - stmt.bindString(7, lid); + + String markerId = entity.getMarkerId(); + if (markerId != null) { + stmt.bindString(6, markerId); } - + + String markerRealId = entity.getMarkerRealId(); + if (markerRealId != null) { + stmt.bindString(7, markerRealId); + } + String lng = entity.getLng(); if (lng != null) { stmt.bindString(8, lng); } - + String lat = entity.getLat(); if (lat != null) { stmt.bindString(9, lat); @@ -189,11 +189,11 @@ TaskBean entity = new TaskBean( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // scanner - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // taskId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // desc - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskdeId - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // lid + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // desc + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // taskId + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // taskCode + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // markerId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // markerRealId cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lng cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lat cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // state @@ -205,11 +205,11 @@ public void readEntity(Cursor cursor, TaskBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setScanner(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setTaskId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setDesc(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setTaskdeId(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setMarkId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setLid(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setDesc(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTaskId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setTaskCode(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setMarkerId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setMarkerRealId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setLng(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); entity.setLat(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); entity.setState(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); diff --git a/app/src/main/java/com/casic/detector/model/TaskModel.java b/app/src/main/java/com/casic/detector/model/TaskModel.java new file mode 100644 index 0000000..4530941 --- /dev/null +++ b/app/src/main/java/com/casic/detector/model/TaskModel.java @@ -0,0 +1,265 @@ +package com.casic.detector.model; + +import java.util.List; + +public class TaskModel { + + private String success; + private List message; + + public String getSuccess() { + return success; + } + + public void setSuccess(String success) { + this.success = success; + } + + public List getMessage() { + return message; + } + + public void setMessage(List message) { + this.message = message; + } + + public static class MessageModel { + private int id; + private String taskCode; + private String description; + private String deployDate; + private Object beginDate; + private Object endDate; + private String status; + private String creatorId; + private String creatorName; + private String patrolerId; + private String patrolerName; + private int isValid; + private List taskDetailInfos; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDeployDate() { + return deployDate; + } + + public void setDeployDate(String deployDate) { + this.deployDate = deployDate; + } + + public Object getBeginDate() { + return beginDate; + } + + public void setBeginDate(Object beginDate) { + this.beginDate = beginDate; + } + + public Object getEndDate() { + return endDate; + } + + public void setEndDate(Object endDate) { + this.endDate = endDate; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getCreatorId() { + return creatorId; + } + + public void setCreatorId(String creatorId) { + this.creatorId = creatorId; + } + + public String getCreatorName() { + return creatorName; + } + + public void setCreatorName(String creatorName) { + this.creatorName = creatorName; + } + + public String getPatrolerId() { + return patrolerId; + } + + public void setPatrolerId(String patrolerId) { + this.patrolerId = patrolerId; + } + + public String getPatrolerName() { + return patrolerName; + } + + public void setPatrolerName(String patrolerName) { + this.patrolerName = patrolerName; + } + + public int getIsValid() { + return isValid; + } + + public void setIsValid(int isValid) { + this.isValid = isValid; + } + + public List getTaskDetailInfos() { + return taskDetailInfos; + } + + public void setTaskDetailInfos(List taskDetailInfos) { + this.taskDetailInfos = taskDetailInfos; + } + + public static class TaskDetailInfosModel { + private int id; + private String taskId; + private String taskCode; + private Object markerName; + private int markerId; + private String markerIdReal; + private double longitude; + private double latitude; + private int isChecked; + private int isNormal; + private Object imagePath; + private Object description; + private Object finishTime; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getTaskCode() { + return taskCode; + } + + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; + } + + public Object getMarkerName() { + return markerName; + } + + public void setMarkerName(Object markerName) { + this.markerName = markerName; + } + + public int getMarkerId() { + return markerId; + } + + public void setMarkerId(int markerId) { + this.markerId = markerId; + } + + public String getMarkerIdReal() { + return markerIdReal; + } + + public void setMarkerIdReal(String markerIdReal) { + this.markerIdReal = markerIdReal; + } + + public double getLongitude() { + return longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public double getLatitude() { + return latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public int getIsChecked() { + return isChecked; + } + + public void setIsChecked(int isChecked) { + this.isChecked = isChecked; + } + + public int getIsNormal() { + return isNormal; + } + + public void setIsNormal(int isNormal) { + this.isNormal = isNormal; + } + + public Object getImagePath() { + return imagePath; + } + + public void setImagePath(Object imagePath) { + this.imagePath = imagePath; + } + + public Object getDescription() { + return description; + } + + public void setDescription(Object description) { + this.description = description; + } + + public Object getFinishTime() { + return finishTime; + } + + public void setFinishTime(Object finishTime) { + this.finishTime = finishTime; + } + } + } +} diff --git a/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt index 15afed7..c40dee1 100644 --- a/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/detector/retrofit/RetrofitService.kt @@ -36,4 +36,10 @@ */ @POST("/ems/marker/get-marker-images.do") suspend fun getLabelPicture(@Body requestBody: RequestBody): String + + /** + * 获取巡检工单 + */ + @GET("/ems/rs/task/get") + suspend fun getTask(@Query("userName") userName: String): String } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt index a58c09b..d47e14e 100644 --- a/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/detector/retrofit/RetrofitServiceManager.kt @@ -51,4 +51,11 @@ ) return api.getLabelPicture(requestBody) } + + /** + * 获取巡检工单 + */ + suspend fun getTask(userName: String): String { + return api.getTask(userName) + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt b/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt index 4d33e9c..9ea2905 100644 --- a/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt +++ b/app/src/main/java/com/casic/detector/utils/DataBaseManager.kt @@ -2,6 +2,8 @@ import com.casic.detector.base.BaseApplication import com.casic.detector.bean.LabelBean +import com.casic.detector.bean.TaskBean +import com.casic.detector.greendao.TaskBeanDao class DataBaseManager private constructor() { companion object { @@ -12,6 +14,7 @@ } private var labelBeanDao = BaseApplication.get().getDaoSession().labelBeanDao + private var taskBeanDao = BaseApplication.get().getDaoSession().taskBeanDao fun clearTaskLabels() { labelBeanDao.deleteAll() @@ -24,4 +27,36 @@ fun loadTaskLabels(): MutableList { return labelBeanDao.loadAll() } + + fun countTaskById(id: String): Int { + val count = taskBeanDao.queryBuilder() + .where(TaskBeanDao.Properties.Id.eq(id)) + .count() + return count.toInt() + } + + fun insertTaskInformation( + scanner: String, + desc: String, + taskId: String, + taskCode: String, + markerId: String, + markerRealId: String, + lng: String, + lat: String, + state: String + ) { + val task = TaskBean() + task.scanner = scanner + task.desc = desc + task.taskId = taskId + task.taskCode = taskCode + task.markerId = markerId + task.markerRealId = markerRealId + task.lng = lng + task.lat = lat + task.state = state + + taskBeanDao.insert(task) + } } \ No newline at end of file diff --git a/app/src/main/java/com/casic/detector/view/MainActivity.kt b/app/src/main/java/com/casic/detector/view/MainActivity.kt index a77b13f..ba16ca8 100644 --- a/app/src/main/java/com/casic/detector/view/MainActivity.kt +++ b/app/src/main/java/com/casic/detector/view/MainActivity.kt @@ -32,6 +32,7 @@ import com.casic.detector.extensions.appendDownloadUrl import com.casic.detector.extensions.drawCircle import com.casic.detector.extensions.initLayoutImmersionBar +import com.casic.detector.model.TaskModel import com.casic.detector.utils.* import com.casic.detector.vm.TaskViewModel import com.casic.detector.vm.VersionViewModel @@ -42,6 +43,7 @@ import com.pengxh.kt.lite.utils.SaveKeyValues import com.pengxh.kt.lite.vm.LoadState import com.pengxh.kt.lite.widget.dialog.AlertControlDialog +import com.pengxh.kt.lite.widget.dialog.AlertMessageDialog import com.pengxh.kt.lite.widget.dialog.NoNetworkDialog import kotlinx.android.synthetic.main.activity_main.* import kotlinx.coroutines.CoroutineScope @@ -178,6 +180,50 @@ }) } } + taskViewModel.taskResult.observe(this) { + if (it.success == "true") { + AlertMessageDialog.Builder() + .setContext(this) + .setTitle("温馨提示") + .setMessage("您有${it.message.size}个新任务!") + .setPositiveButton("知道了") + .setOnDialogButtonClickListener(object : + AlertMessageDialog.OnDialogButtonClickListener { + override fun onConfirmClick() { + saveTaskInformation(it) + } + }).build().show() + } + } + } + + private fun saveTaskInformation(it: TaskModel) { + val userName = SaveKeyValues.getValue(LocaleConstant.USER_NAME, "") as String + if (it.message.size > 0) { + it.message.forEach { messageModel -> + val count = DataBaseManager.get.countTaskById(messageModel.id.toString()) + if (count == 0) { + messageModel.taskDetailInfos.forEach { info -> + val desc = if (info.description == null) { + "" + } else { + info.description.toString() + } + DataBaseManager.get.insertTaskInformation( + userName, desc, + info.taskId.toString(), + info.taskCode.toString(), + info.markerId.toString(), + info.markerIdReal.toString(), + info.longitude.toString(), + info.latitude.toString(), + messageModel.status + ) + } + } + } + "工单下载成功!".show(context) + } } private fun showLabelsOnMap() { @@ -279,7 +325,7 @@ override fun onPopupItemClicked(position: Int) { when (position) { 0 -> updateTaskData() - 1 -> {} + 1 -> downloadTask() 2 -> versionViewModel.getApplicationVersion() 3 -> {} 4 -> {} @@ -323,6 +369,23 @@ }).build().show() } + private fun downloadTask() { + if (isNetworkConnected()) { + val userName = SaveKeyValues.getValue(LocaleConstant.USER_NAME, "") + taskViewModel.getTask(userName.toString()) + } else { + NoNetworkDialog.Builder() + .setContext(context) + .setOnDialogButtonClickListener(object : + NoNetworkDialog.OnDialogButtonClickListener { + override fun onButtonClick() { + val intent = Intent(Settings.ACTION_SETTINGS) + startActivity(intent) + } + }).build().show() + } + } + private fun observeRequestState() { versionViewModel.loadState.observe(this) { when (it) { @@ -330,6 +393,13 @@ else -> LoadingDialogHub.dismiss() } } + + taskViewModel.loadState.observe(this) { + when (it) { + LoadState.Loading -> LoadingDialogHub.show(this, "获取巡检工单中,请稍后") + else -> LoadingDialogHub.dismiss() + } + } } private fun downloadApk(url: String?) { diff --git a/app/src/main/java/com/casic/detector/vm/TaskViewModel.kt b/app/src/main/java/com/casic/detector/vm/TaskViewModel.kt index ae827db..136b370 100644 --- a/app/src/main/java/com/casic/detector/vm/TaskViewModel.kt +++ b/app/src/main/java/com/casic/detector/vm/TaskViewModel.kt @@ -7,6 +7,7 @@ import com.casic.detector.extensions.toErrorMessage import com.casic.detector.model.MarkerFileModel import com.casic.detector.model.MarkerImageModel +import com.casic.detector.model.TaskModel import com.casic.detector.retrofit.RetrofitServiceManager import com.google.gson.Gson import com.google.gson.reflect.TypeToken @@ -19,6 +20,7 @@ val markerFileResult = MutableLiveData() val markerImageResult = MutableLiveData() + val taskResult = MutableLiveData() fun getMarkerFile(userId: String, companyId: String) = launch({ val response = RetrofitServiceManager.getMarkerFile(userId, companyId) @@ -45,4 +47,17 @@ }, { it.convertChinese().show(BaseApplication.get()) }) + + fun getTask(userName: String) = launch({ + val response = RetrofitServiceManager.getTask(userName) + if (response.separateResponseState()) { + taskResult.value = gson.fromJson( + response, object : TypeToken() {}.type + ) + } else { + response.toErrorMessage().show(BaseApplication.get()) + } + }, { + it.convertChinese().show(BaseApplication.get()) + }) } \ No newline at end of file